Skip to content

chore: modernize TypeScript config — drop ignoreDeprecations and adopt Nx project references #224

Description

@NachoVazquez

Summary

After the Angular 22 / Nx 23 / TypeScript 6.0.3 upgrade, the workspace silences TS 6 deprecations with "ignoreDeprecations": "6.0" across root and project tsconfigs. That was intentional migration deferral — not a permanent design. This issue tracks removing that pin by modernizing the TypeScript setup, ideally by migrating from path aliases to package manager workspaces + TypeScript project references per the Nx guide.

Guide: https://nx.dev/docs/technologies/typescript/guides/switch-to-workspaces-project-references

Related: the Angular 22 PR residual risk called this out as follow-up before the TS 7 horizon.

Why

Current state Problem
ignoreDeprecations: "6.0" in tsconfig.base.json + project/e2e tsconfigs Hides real deprecations; will break when TS drops the escape hatch
baseUrl: "." + paths in tsconfig.base.json TS 6–deprecated path-mapping style
moduleResolution: "node" (Node10) on base No exports support; conflicts with modern package resolution
Path aliases only (@ngworker/lumberjack, @internal/*) No workspace linking; no true project-reference graph / incremental tsc -b
No pnpm-workspace.yaml Single root package; not set up for project linking

TS 6 is already on the tree. Leaving ignoreDeprecations until TS 7 just moves the cliff. Doing the project-references migration now removes the deprecated options and unlocks the performance / tooling benefits of solution-style TypeScript.

Current footprint (what must change)

Path aliases today (tsconfig.base.json):

"@internal/console-driver/test-util"
"@internal/test-util"
"@ngworker/lumberjack"
"@ngworker/lumberjack/console-driver"   // secondary entry — multi-segment
"@ngworker/lumberjack/http-driver"      // secondary entry — multi-segment

Published package: packages/ngworker/lumberjack (ng-packagr, secondary entry points).
Internal packages: packages/internal/{test-util,console-driver/test-util} (no publish).
Apps: packages/examples/lumberjack-app, packages/docs/lumberjack-docs-app, e2e under e2e/.

Proposed approach

Follow the Nx guide, adapted for this repo:

  1. Enable pnpm workspaces — add pnpm-workspace.yaml covering packages/** (and e2e if needed). Use workspace:* for local deps.
  2. Root TypeScript config
    • Keep only compilerOptions in tsconfig.base.json (move exclude if required).
    • Set composite: true, drop declaration: false (conflicts with composite).
    • Delete paths, baseUrl, rootDir.
    • Switch moduleResolution to "bundler".
    • Add customConditions: ["@ngworker/source"] (or similar org-unique condition) + declarationMap + isolatedModules.
    • Root tsconfig.json: empty files, references to every project.
  3. Per-project package.json
    • Every project needs a name for workspace linking.
    • Libraries get exports mapping the @ngworker/source condition → source .ts entry points.
    • Secondary entry points (console-driver, http-driver): prefer a single package with multi-entry exports (keep published surface stable) rather than renaming packages.
  4. Project tsconfigs
    • Solution files (tsconfig.lib.json / tsconfig.app.json / tsconfig.spec.json) extend tsconfig.base.json directly.
    • Wire references via nx sync.
    • Register @nx/js/typescript plugin for inferred typecheck / sync generators.
  5. Bundler / test tooling
    • Confirm @nx/angular / ng-packagr / Jest resolver work with workspace symlinks (no TsconfigPathsPlugin / nxViteTsPaths needed if present).
    • Publish path (dist/packages/ngworker/lumberjack) and release workflow must stay valid.
  6. Drop the pin — remove every ignoreDeprecations: "6.0" once the deprecated options are gone and pnpm run ci is green.

Acceptance criteria

  • No ignoreDeprecations anywhere in the repo
  • No baseUrl / paths / moduleResolution: "node" in tsconfigs
  • pnpm workspaces link local projects; imports resolve via package.json name + exports (and secondary entry exports for drivers)
  • TypeScript project references maintained (nx sync clean)
  • pnpm run lint, test, build, e2e green
  • Published package layout unchanged for consumers (@ngworker/lumberjack, /console-driver, /http-driver)
  • nx release version --dry-run still works

Risks / notes

  • ng-packagr secondary entry points are the hard part — project-references migration must not break the published exports map or partial-Ivy output.
  • Multi-segment path aliases map cleanly to multi-entry exports on one package; avoid inventing new package names for drivers if publish surface can stay stable.
  • Docusaurus docs app may need extra care (not a standard Angular lib).
  • Scope is tooling/config only — no public API behavior change to Lumberjack itself.

Out of scope

  • Angular / Nx version bumps
  • Public API or peer-dependency changes
  • ESLint plugin restoration (separate follow-up)

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlumberjackApplies to issues of the Lumberjack project.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions