Skip to content

[feature] node/typescript capability module (+ language-aware scaffold for npm recipes/gitignore/hooks/codeql) #1027

Closed

Description

@c-vigo

Description

The commit-action direnv pilot (vig-os/commit-action#32) needed Node/TypeScript
support, which today has to be hand-wired in every consumer:

sync-issues-action — and every future TS action — needs the byte-identical
setup. This asks for a node (and/or typescript) capability module so a
consumer opts in with modules = [ "node" ] (DEVKIT_MODULES in .vig-os)
instead of copy-pasting the above.

Key design question (raise before implementing)

Per docs/rfcs/ADR-capability-modules.md, a v1 module is packages + env +
shellHook only
. That means a node module can put nodejs in the dev-shell —
but it cannot by itself provide the npm justfile recipes, the .gitignore
fragment, the pre-commit hooks, or the codeql language. Those are scaffold
files, not shell contributions.

So turnkey Node support spans two mechanisms:

  1. The shell module (v1): nodejs (+ optional pnpm/yarn) in
    mkProjectShell, with a selectable Node version — the pilot used
    pkgs.nodejs (24) while the action runtime is node20 (action.yml); the
    module should let a consumer pin to their runtime.
  2. Language-aware scaffold (needs a decision): npm justfile.project recipes,
    the Node .gitignore fragment ([BUG] Scaffold .gitignore is Python-only: blanket dist/ breaks JS Action repos, Node ignores dropped, not upgrade-persistent #1024), eslint/prettier pre-commit hooks, and
    codeql language ([BUG] Scaffold codeql.yml: hardcoded python matrix + conflicts with GitHub default code-scanning setup #1025) — either by extending the module contract so
    modules can contribute scaffold fragments, or by a language-aware scaffold
    keyed on package.json that the module composes with.

Decide (1) alone (shell packages only, leave the rest to #1024/#1025 + manual) vs
(1)+(2) (a true "flavour" that ships everything). The pilot shows (2) is where
the real per-repo toil is.

Acceptance criteria (proposed)

  • modules = [ "node" ] puts a version-selectable Node (+ npm) in the shell,
    stacking cleanly with other modules.
  • Decision recorded on whether the module also drives npm recipes / gitignore
    / hooks / codeql, or those stay in a language-aware scaffold.
  • commit-action and sync-issues-action can drop their hand-wired
    extraPackages/recipes in favor of the module.

Related

Capability modules #884; scaffold language-awareness #1024 (.gitignore), #1025
(codeql.yml). Pilot: vig-os/commit-action#32.

Activity

  1. added this to the Backlog milestone on Jul 14, 2026
  2. added
    feature
    priority:medium
    area:workspace
    effort:large
    semver:minor
    on Jul 14, 2026
  3. c-vigo commented on Jul 14, 2026

    @c-vigo
    ContributorAuthor

    Design decision (pre-implementation)

    Per docs/rfcs/ADR-capability-modules.md, the answer to the key design question is (1) + (2), but split across the two mechanisms the codebase already has — no module-contract extension:

    1. Shell module (v1 contract, this issue): a node module in nix/modules/ contributing nodejs (+ npm) as packages. Version selection uses the ADR's recorded migration path — modules accepts an attrset entry alongside plain strings: { name = "node"; version = 20; } (plain "node" = nixpkgs default). [feature] node/typescript capability module (+ language-aware scaffold for npm recipes/gitignore/hooks/codeql) #1027 is the "first module that needs it", so this lands the per-module-options mechanism the ADR deferred. Per the ADR, each new module ships with its generated checks.<system>.module-node flake check plus a tests/test_flake_modules.py smoke test.

    2. Scaffold pieces (already landing separately): language-aware scaffold rendering now exists in init-workspace.sh (DETECTED_LANGUAGES, keyed on package.json etc.) via [BUG] Scaffold .gitignore is Python-only: blanket dist/ breaks JS Action repos, Node ignores dropped, not upgrade-persistent #1024/[BUG] Scaffold codeql.yml: hardcoded python matrix + conflicts with GitHub default code-scanning setup #1025 (PR fix(setup): render language-aware scaffold .gitignore and codeql matrix #1035), and the release bundle step via [BUG] Release pipeline is python-shaped: no artifact/bundle step for node/TS consumers, stale 'Sync Python dependencies' labels #1029 (PR fix(ci): make scaffolded CI and release pipeline language-neutral #1033). What remains in scope here is seeding npm-mapped recipes into justfile.project only at first scaffold (it is a preserved, consumer-owned file) when node is detected — plus eslint/prettier hooks, which stay out of scope for this issue (they belong with the feat(workspace): generate .pre-commit-config.yaml from the flake (git-hooks.nix) — composable base hooks, consumer-extensible in the project flake #883 consumer-hooks seam; will file separately if wanted).

    This keeps the v1 module contract intact (packages/env/shellHook only), avoids inventing a scaffold-fragment contract, and still delivers turnkey Node: modules = [ "node" ] + automatic language-aware statics + first-scaffold npm recipes.

    Acceptance mapping: version-selectable Node ✔ (attrset option); decision recorded ✔ (this comment); commit-action/sync-issues-action can drop extraPackages + hand-written recipes ✔.

  4. c-vigo commented on Jul 14, 2026

    @c-vigo
    ContributorAuthor

    Implemented in #1042 (merged to dev), per the design decision recorded above: node v1 shell module with version selection via the new per-module-options mechanism ({ name = "node"; version = 22; }), plus first-scaffold npm justfile.project seeding for node-detected consumers. Scaffold statics landed separately via #1024/#1025, release bundling via #1029. eslint/prettier hooks deferred to the #883 seam.

  5. added a commit that references this issue on Jul 14, 2026
    ab2fdd6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:workspaceeffort:largefeaturepriority:mediumsemver:minor

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions