Repository navigation
Conversation
Run ESLint from the client's working directory within the workspace
instead of always from the workspace root. The full workspace stays
mounted so root eslint configs still resolve, but lint and fix now set
the container workdir to /src/<cwd> (via the new path field, set from
ws.path), scoping linting 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.
Also rewrite the README in the style of the playwright module's, and
drop documentation for an extensions argument the module doesn't have.
Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: kpenfound <[email protected]>
A standalone eslint config without a Node project previously hard-failed on npm install (ENOENT package.json). When the workspace root holds no package.json, build the runtime container without the install step and let npx fetch ESLint on demand instead. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: kpenfound <[email protected]>
Wire github.com/dagger/dang-sdk into dagger.toml, matching the playwright module's setup, 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.eslint] source = "." so the workspace — and the Dang 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]>
Mark the dang-sdk install with its as-sdk name and record this module in [[modules.dang-sdk.as-sdk.modules]] — the SDK's managed-modules list that `dagger generate` iterates. The module remains in generated form (no changes to apply). 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]>
|
Tested this end-to-end against engine Works ✅
Bug 🔴 —
|
TomChv
left a comment
There was a problem hiding this comment.
Still approving the PR if you wanna fix that in a follow up
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 #12. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: kpenfound <[email protected]>
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]>
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]>
Part of the cwd-awareness sweep (dagger/vitest#17, dagger/prettier#13, dagger/eslint#12, dagger/playwright#1). Like dagger/shellcheck#2, helm needs no code change: it already takes the Workspace per function and discovers charts via relative workspace paths (ws.directory(".")), which resolve from the client's working directory. Running from a subdirectory already lints only the charts in that subtree, and each chart mounts its own directory — the chart boundary — so nothing above it is needed. This PR: - Fixes docstrings that described chart paths as workspace-relative when they are actually cwd-relative. - Adds a README documenting the functions, the ci/*-values.yaml values matrix, and the cwd scoping. Signed-off-by: kpenfound <[email protected]>
The module 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, adapted to this module's structure and the beta engine's Workspace API (ws.cwd, root-absolute with / as the workspace root): source is now the workspace root (excluding **/node_modules) instead of just the project directory. A new root-absolute path field records where the project lives, resolved by a workspacePath helper from ws.cwd plus either sourcePath (relative resolves from the cwd, absolute from the root) or playwright.config.* discovery — which still searches at or below the cwd. base mounts the root at /app and sets withWorkdir("/app" + path), so configs and dependencies that live above the project (monorepo roots, shared configs) keep resolving inside the test container. lockedVersion / declaredImage read package.json and the lockfile through a project accessor (source.directory(path)) since source no longer points at the project. 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, rather than always from the workspace root — same approach as dagger/vitest#17 and dagger/prettier#13:pathfield, set fromws.pathin the constructor: the client's cwd relative to the workspace root (.at the root)./src(so root.eslintrc.*/eslint.config.*still resolve), butlintandfixsetwithWorkdir("/src/" + path)before running ESLint.fixnow extractsdirectory("/src")instead of the workdir-relativedirectory("."); otherwise the changeset would diff the subdirectory against the full root and manifest as mass deletions.Also rewrites the README in the style of the playwright module's, documents the cwd behavior, and drops documentation for an
extensionsargument the module doesn't have.Testing
Verified against a fresh clone of dagger/hello-dagger:
call path→src/componentsfrom that subdir.lintfromsrc/componentspasses and resolves the repo-root.eslintrc.cjsby walking up from the workdir — the case root-mounting exists to support; the root run also still passes.🤖 Generated with Claude Code