Skip to content

import: erwin import into an empty folder bootstraps a full project - #44

Merged
dbose merged 2 commits into
mainfrom
feat-erwin-scaffold
Sep 27, 2026
Merged

dbose merged 2 commits into
mainfrom
feat-erwin-scaffold

Conversation

@dbose

@dbose dbose commented Sep 27, 2026

Copy link
Copy Markdown
Owner

An erwin export is a whole model, but importing it into an empty folder only wrote object YAMLs plus a bare mdl-project.yaml — no .mdl/lock.yaml, no .mdl/state/, no .gitignore, and in VS Code the command aborted unless a project already existed. Nobody migrates off erwin onto an orphan model.

mdl import erwin now scaffolds a runnable project around the import when --out is empty, configurable and structure-respecting:

  • --scaffold model|workspace|none (default model). workspace also lays down the transform/warehouse dbt project with a zero-setup DuckDB profiles.yml, CODEOWNERS and a .code-workspace; model writes just the skeleton.
  • --dbt-target names the dbt target/profile written into the config.
  • The layout is persisted to mdl-project.yaml under a new scaffold: block (ProjectConfig.scaffold) and joins writer._USER_OWNED_CONFIG so a re-import reproduces, never rewrites, it.
  • An --out that already holds a project (mdl-project.yaml or .mdl/, at the root or a model/ subdir) is respected: no re-scaffold, user config preserved.

VS Code:
importErwin no longer requires an existing model. In an empty workspace it confirms, then scaffolds using modelith.import.scaffold / modelith.import.dbtTarget and sets modelith.modelDir to the written model so the panels resolve it. bootstrap_project + scaffold_workspace_skeleton reuse the audited init/collab plumbing.

CLI 0.6.7, extension 0.3.15.

An erwin export is a whole model, but importing it into an empty folder
only wrote object YAMLs plus a bare mdl-project.yaml — no .mdl/lock.yaml,
no .mdl/state/, no .gitignore, and in VS Code the command aborted unless a
project already existed. Nobody migrates off erwin onto an orphan model.

mdl import erwin now scaffolds a runnable project around the import when
--out is empty, configurable and structure-respecting:

- --scaffold model|workspace|none (default model). workspace also lays down
  the transform/warehouse dbt project with a zero-setup DuckDB profiles.yml,
  CODEOWNERS and a .code-workspace; model writes just the skeleton.
- --dbt-target names the dbt target/profile written into the config.
- The layout is persisted to mdl-project.yaml under a new scaffold: block
  (ProjectConfig.scaffold) and joins writer._USER_OWNED_CONFIG so a re-import
  reproduces, never rewrites, it.
- An --out that already holds a project (mdl-project.yaml or .mdl/, at the
  root or a model/ subdir) is respected: no re-scaffold, user config preserved.

VS Code: importErwin no longer requires an existing model. In an empty
workspace it confirms, then scaffolds using modelith.import.scaffold /
modelith.import.dbtTarget and sets modelith.modelDir to the written model so
the panels resolve it. bootstrap_project + scaffold_workspace_skeleton reuse
the audited init/collab plumbing.

CLI 0.6.7, extension 0.3.15.
…config, generate follows it

Splits the concerns the erwin-scaffold work had coupled. Creating the
logical model and generating the dbt project are now distinct steps, the
project's dbt-project location is one config value editable from the CLI,
and generate honours it.

- mdl import erwin defaults to a MODEL-ONLY project (--scaffold model): the
  .mdl skeleton + object YAMLs, no dbt shell. --scaffold workspace still lays
  (or reuses) a dbt project; --scaffold none writes objects only. Producing
  the dbt project is otherwise a separate mdl generate step, matching mdl init
  (plain = model-only; --workspace/--demo = model + dbt).
- New : the general mdl-project.yaml doorway (the reverse:
  block keeps its richer reverse-config surface). Comment-preserving, dotted
  keys, and the whole doc is re-validated through ProjectConfig before writing
  so a bad set is rejected, not half-applied. e.g.
  mdl config set scaffold.dbt_project_dir transform/warehouse
- mdl generate now defaults its output to config.scaffold.dbt_project_dir
  (resolved relative to the model dir) when set, else target/dbt; an explicit
  -o still wins. The key import stamps is no longer dead.
- VS Code: importErwin shows a layout QuickPick (model|workspace|none) on a
  fresh bootstrap, seeded by modelith.import.scaffold, instead of a confirm-only
  modal.

CLI 0.6.8, extension 0.3.16.
@dbose
dbose merged commit da1c6d3 into main Sep 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant