Skip to content

chore(ngx-env): add compatibility with Angular 22 - #158

Merged
chihab merged 3 commits into
mainfrom
claude/ngx-env-angular-22-fbkago
Aug 9, 2026
Merged

chihab merged 3 commits into
mainfrom
claude/ngx-env-angular-22-fbkago

Conversation

@chihab

@chihab chihab commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Bump @ngx-env/builder to 22.0.0 and move the Angular toolchain to v22.

  • packages/angular: peer + dev deps to @angular/build ^22, architect
    ^0.2201.0, TypeScript ~6.0.0, webpack 5.109.2 (aligns with
    @angular-devkit/build-angular@22); resync application/unit-test builder
    schemas from Angular v22.
  • Add rootDir + ignoreDeprecations("6.0") to the package tsconfig and switch
    the schema tooling to import cpy = require("cpy") for TypeScript 6.
  • Ship runtime.d.ts so the side-effect @ngx-env/builder/runtime import
    type-checks under bundler/CJS resolution.
  • Align @dotenv-run/webpack and the example workspace on webpack 5.109.2 so
    the DotenvRunPlugin runs against a single webpack instance.
  • Upgrade the ng-app-cli example to Angular 22 / TypeScript 6.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_0181uWSuY7aymLgS4gMnCJAv

Bump @ngx-env/builder to 22.0.0 and move the Angular toolchain to v22.

- packages/angular: peer + dev deps to @angular/build ^22, architect
  ^0.2201.0, TypeScript ~6.0.0, webpack 5.109.2 (aligns with
  @angular-devkit/build-angular@22); resync application/unit-test builder
  schemas from Angular v22.
- Add rootDir + ignoreDeprecations("6.0") to the package tsconfig and switch
  the schema tooling to `import cpy = require("cpy")` for TypeScript 6.
- Ship runtime.d.ts so the side-effect `@ngx-env/builder/runtime` import
  type-checks under bundler/CJS resolution.
- Align @dotenv-run/webpack and the example workspace on webpack 5.109.2 so
  the DotenvRunPlugin runs against a single webpack instance.
- Upgrade the ng-app-cli example to Angular 22 / TypeScript 6.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@chihab
chihab force-pushed the claude/ngx-env-angular-22-fbkago branch from e1ce179 to f9c2f78 Compare August 8, 2026 18:13
claude added 2 commits August 8, 2026 18:57
Add a `smoke-pack` CI job that packs @ngx-env/builder with `pnpm pack`
(rewriting the `workspace:^` internal deps to concrete, registry-resolvable
ranges), generates a fresh Angular 22 app outside the workspace, installs the
tarball, runs `ng add`, and asserts an `NG_APP_` variable is injected into the
production bundle.

This validates the real consumer install graph -- peer-dep resolution and a
single deduped webpack/Angular instance -- which the in-repo examples cannot,
since they resolve the builder through the pnpm workspace.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The builders import `@dotenv-run/core` as a value (`env`, `DotenvRunPlugin`
config, `Dict`) in every code path, but it was only a devDependency. At runtime
it was reachable solely through the OPTIONAL `@dotenv-run/webpack` dependency,
so `npm i --omit=optional` or a strict/isolated (pnpm/PnP) install of
`@ngx-env/builder` would fail to resolve it -- notably on the default
esbuild/application path, which does not use webpack at all.

Declare `@dotenv-run/core` as a direct `dependency`. Harden the pack smoke test
to assert the installed builder declares it (a plain `--omit=optional` install
can't express this because esbuild itself relies on optionalDependencies for its
platform binary).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@chihab
chihab merged commit 74618bf into main Aug 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants