Skip to content

feat(workspace): a yodel project as a chant workspace member, with dbt (#2) - #264

Merged
lex00 merged 3 commits into
mainfrom
feat/2-workspace-outputs
Oct 13, 2026
Merged

lex00 merged 3 commits into
mainfrom
feat/2-workspace-outputs

Conversation

@lex00

@lex00 lex00 commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Closes #2

Draft: this waits on chant 0.124.23. That release carries INTENTIUS/chant#3931 (sql tables and columns as workspace outputs), #3932 (the dbt member kind) and #3941 (a member's Ops no longer hide its outputs). Until it's on npm, test/workspace.test.ts fails against the published 0.124.21. Before merging, this PR moves @intentius/chant and @intentius/chant-lexicon-sql to 0.124.23 in package.json.

What changed

  • A yodel project works as a kind: "chant" member of a chant workspace, with no other changes. Its tables, views and columns are outputs named as src/ declares them. A dbt member's sources.yml links to them. chant workspace check fails with WSP093, at the dbt file and line, when src/ drops a column a consumer reads. With a -- previously: hint it says what the column was renamed to.
  • Every Op yodel writes or prints now has an export name of its own: the templates' and examples' ops/ (migrateDev, watchDev), the ApplyOp and migrate Op examples, and the yodel new --backfill template (backfillFillCountry). A backfill module can export its single Op under any name, and op and the default export still work. Testing against chant main first found that duplicate op exports stopped chant's fold, which left every link unresolved. chant fixed that in #3941, so older projects work as they are. The renames stop new projects from ever exporting the same name twice.
  • New docs/workspace.md: the workspace declaration, output names, dbt sources, drops and renames, and the Op export names.

Verified

  • npm ci && npm run build && npm run check against chant main packed at 3064f1896 (0.124.22 on main): 834 tests pass, with typecheck and eslint clean.
  • test/workspace.test.ts copies each template in as a member, next to an app link and a dbt project, and checks four things:
    • The check passes with no WSP094.
    • A dropped column fails for both consumers.
    • A rename hint is reported.
    • A project made before this change, with every Op and backfill exported as op, still passes and still fails on a drop.
  • Checked by hand: a scratch workspace on chant 5c6e6fd37, before #3941, reported every link as WSP094 until the Op exports were renamed. On 3064f1896 the old-style project resolves as it is.

lex00 added 3 commits October 12, 2026 19:05
#2)

chant reads a sql member's tables and columns as workspace outputs
(chant#3931) and a dbt member's sources as links to them (chant#3932).
It folds the whole member directory to read them, and every ops/*.op.ts
in a yodel project exported `op`, so the fold stopped on the duplicate
name and every link to the project was unresolved.

- Each Op the templates and examples declare, and each one yodel prints
  or writes (the ApplyOp and migrate Op examples, the backfill template),
  is exported under a name of its own: migrateDev, watchDev,
  backfillFillCountry. A backfill module may export its Op under any
  one name; op and the default export still work.
- test/workspace.test.ts: each template as a member beside an app link
  and a dbt project. chant workspace check passes, fails with WSP093 for
  both consumers once src/ drops the column, and gives the rename for a
  -- previously: hint.
- docs/workspace.md: the workspace, output names, dbt sources, drops
  and renames, and the Op export names for older projects.

Needs a chant release with chant#3931, #3932 and #3941.
@lex00
lex00 force-pushed the feat/2-workspace-outputs branch from 9a412cf to c109cc0 Compare October 13, 2026 01:05
@lex00
lex00 marked this pull request as ready for review October 13, 2026 01:05
@lex00
lex00 merged commit 06154b3 into main Oct 13, 2026
9 checks passed
@lex00
lex00 deleted the feat/2-workspace-outputs branch October 13, 2026 01:13
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.

Workspace outputs and dbt

1 participant