Repository navigation
Conversation
Take the Workspace in the constructor instead of a defaultPath'd source
directory, and run Biome from the client's working directory within the
workspace. The full workspace stays mounted so a root biome.json still
resolves, but lint and fix now set the container workdir to /src/<cwd>
(via the new path function, from ws.path), scoping Biome to the invoking
subtree.
fix now extracts directory("/src") instead of the workdir-relative
directory("."), so the changeset is diffed root-against-root rather than
subdir-against-root.
When the workspace root holds no package.json the dependency install is
skipped and npx fetches Biome on demand, so a standalone Biome config
works without a Node project.
Also add a README documenting the functions and the cwd behavior.
Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: kpenfound <[email protected]>
Add a workspace dagger.toml with github.com/dagger/typescript-sdk installed as an SDK (via `dagger sdk install typescript`), mirroring the Dang SDK setup in the dang-based toolchains, so `dagger generate` covers this module. Generate currently reports no changes to apply. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: kpenfound <[email protected]>
Add [modules.biomejs] source = "." so the workspace — and the TypeScript SDK's generate — can find the module, matching the playwright module's setup. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: kpenfound <[email protected]>
With the module registered in the workspace, `dagger check` now runs biomejs:lint against this repo itself. Apply biome's fixes to src/index.ts, prefer template literals over concatenation, and add a biome.json that keeps JSON files space-indented (dagger.json and package.json are written that way by tooling) and excludes the generated SDK files from checking. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: kpenfound <[email protected]>
Record this module in [[modules.dagger-typescript-sdk.as-sdk.modules]] — the SDK's managed-modules list that `dagger generate` iterates. Applying generate marks the SDK entrypoint file as generated and git-ignored. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: kpenfound <[email protected]>
Drop the [modules.{name}] source = "." entry: it installs the module into
the workspace, which is not intended — the workspace should only carry the
test fixtures and SDK functions. The [[...as-sdk.modules]] entry alone
drives `dagger generate` over the module.
Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: kpenfound <[email protected]>
|
typescript-sdk:generate-all is failing, but its passing for me on beta.7 so I think we're ok |
I think that's because the engine version in the CI is younger than beta.7 so some changes may have happen regarding the generate. |
|
Tested end-to-end against engine Works ✅
Bug 🔴 —
|
The CLI applies a returned changeset relative to the caller's working directory, but the changeset was rooted at the workspace root — so applying from a subdirectory nested the paths (e.g. creating messy/messy/bad.js instead of editing messy/bad.js). Scope both the extraction and the diff base to the subtree so the changeset is rooted where it lands. This still avoids the mass-deletion problem (the diff base is the same subtree), and drops the root package-lock.json leak from subdirectory runs. Reported by @TomChv on dagger/eslint#12. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: kpenfound <[email protected]>
Summary
Running
dagger check(orfix) now behaves as if invoked from the user's current working directory within the workspace — same approach as dagger/vitest#17, dagger/prettier#13, and dagger/eslint#12, ported to the TypeScript SDK:ws: Workspaceinstead of adefaultPath: "/"source directory;sourceis nowws.directory("/")and a newpathfunction exposes the client's cwd relative to the workspace root./src(so a rootbiome.jsonstill resolves), butlintandfixsetwithWorkdir("/src/" + path)before running Biome.fixextractsdirectory("/src")instead of the workdir-relativedirectory("."); otherwise the changeset would diff the subdirectory against the full root and manifest as mass deletions.package.json, thenpm installstep is skipped andnpxfetches Biome on demand — a standalone Biome config no longer hard-fails onENOENT package.json.Also adds a README documenting the functions and the cwd behavior.
Testing
In a scratch workspace with messy files at the root and under
sub/nested/:call path→subfromsub/.lintfromsub/checks exactly 1 file (nested/messy2.ts), leaving the root file out of scope.fixfromsub/yields a changeset touching onlysub/nested/messy2.ts(root-relative); from the root it touches both files.package.json(npm install runs) and standalone (install skipped, npx fetch) paths verified.🤖 Generated with Claude Code