Skip to content

fix(schematics): import the ecs types from @nanoforge-dev/ecs in item templates - #271

Merged
Exeloo merged 3 commits into
mainfrom
fix/ecs-import-in-item-templates
Nov 9, 2026
Merged

Exeloo merged 3 commits into
mainfrom
fix/ecs-import-in-item-templates

Conversation

@Exeloo

@Exeloo Exeloo commented Nov 8, 2026

Copy link
Copy Markdown
Member

What does this PR do?

No linked issue: found while working on the registry lib move (#263). No issue was filed for it.

nf create component and nf create system (schematics component and system) wrote files that imported @nanoforge-dev/ecs-client or @nanoforge-dev/ecs-server (ecs-<%= part %>). The engine no longer publishes those packages, and projects made by nf new depend on @nanoforge-dev/ecs, so every created item started with a broken import.

  • Templates: the component and system templates (libs/schematics/src/libs/{component,system}/files/{ts,js}) now import from @nanoforge-dev/ecs, like the nf new project templates. Context still comes from @nanoforge-dev/common.
  • Docs: I updated the examples in docs/docs/schematics/{component,system}.mdx. I also removed the warnings that told users to fix the import by hand, from those two pages and from docs/docs/commands/create.mdx, plus that step in docs/guides/components-and-systems.mdx.

part is still passed (create.action.ts). It's still used in a comment of the JS system template, and stays required by both schemas.

How do you test this PR?

  • Before: a created component imported { type EditorComponentManifest } from "@nanoforge-dev/ecs-client", a package that's not installed and no longer published.
  • After: the schematics e2e tests (libs/schematics/e2e/component.test.ts, system.test.ts) check that the generated ts and js files contain "@nanoforge-dev/ecs" and no @nanoforge-dev/ecs- import. @nanoforge-dev/ecs@2.0.0 exports every imported name at its root (EditorComponentManifest, EditorSystemManifest, Registry…).
  • Commands, at 9a4b12a, from the pre-push hook:
    • pnpm run repo:build: 4/4
    • pnpm run repo:lint: 4/4
    • pnpm run repo:test:unit: 4/4
    • pnpm run repo:test:e2e: 6/6

Merge danger

Door: two-way. It changes templates and docs only.
Blast radius: the files nf create component|system writes, once the next CLI release is out. Files already generated don't change. Nothing deploys on merge.

Follow-up issues

None.

Quality gate

Check Result Notes
Docs Updated docs/docs/commands/create.mdx, docs/docs/schematics/{component,system}.mdx, docs/guides/components-and-systems.mdx
Correctness Findings fixed 1 Important (stale docs), fixed in 9a4b12a and re-reviewed; 1 Minor (part stays, still used)
Performance Pass Templates only
Accessibility Pass No output change
Security Pass
Style Pass lint: pass

… templates

The component and system templates imported @nanoforge-dev/ecs-client or
ecs-server, which the engine no longer publishes. The project templates
already use @nanoforge-dev/ecs.
@github-actions github-actions Bot added documentation Improvements or additions to documentation lib:schematics Related to the @nanoforge-dev/schematics library labels Nov 9, 2026
@Exeloo
Exeloo merged commit e95b881 into main Nov 9, 2026
7 checks passed
@Exeloo
Exeloo deleted the fix/ecs-import-in-item-templates branch November 9, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation lib:schematics Related to the @nanoforge-dev/schematics library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant