Skip to content

feat: regenerate Angular base project and update dependencies - #1854

Open
Marina-L-Stoyanova wants to merge 24 commits into
masterfrom
mstoyanova/angular-base-project-generation
Open

Marina-L-Stoyanova wants to merge 24 commits into
masterfrom
mstoyanova/angular-base-project-generation

Conversation

@Marina-L-Stoyanova

@Marina-L-Stoyanova Marina-L-Stoyanova commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Description

The Angular project templates (packages/igx-templates/igx-ts/projects/_base and friends) carried a hand-written copy of what ng new generates: angular.json, package.json, the tsconfigs, src/main.ts, .vscode/, .editorconfig, .gitignore, the favicon. Every Angular release meant diffing that copy against a fresh ng new and porting the changes by hand, and the copies drifted (side-nav-auth was still on vitest 4 and pinned an angular-auth-oidc-client version that was never published).

This PR stops keeping that copy. ig new and the ng-new schematic now create Angular projects with Angular's own CLI, when the project is created:

  1. ng new (scss, routing, no SSR, zone.js kept), run in a temp folder and copied into place
  2. ng add angular-eslint@<Angular major>
  3. ng add igniteui-angular@<IGNITEUI_ANGULAR_PACKAGE range>
  4. The project's files/ are laid over the result, placeholders substituted
  5. Our deviations are applied as patches to the generated angular.json, package.json and tsconfigs
  6. npm install adds playwright and the packages the project declares in its extras

The Angular major is resolved with npm view from the peerDependencies of the IGNITEUI_ANGULAR_PACKAGE range, so constants.ts is the only place Angular project versions are set.

What changed

  • _base/scaffold.ts (new): generateProject (steps 1–3), patchAngularJson, patchPackageJson, updateJson, npmInstall.
    • angular.json: adds src/assets, the theme, our budgets, the environment file replacement, runnerConfig for tests and extract-i18n.
    • package.json: our start/test scripts, igniteui-angular at the IGNITEUI_ANGULAR_PACKAGE range instead of the ^<version> ng add saves, @angular/animations, vitest in a real browser through @vitest/browser-playwright instead of jsdom, and the CLI package as a devDependency (igniteui-cli for ig new, @igniteui/angular-schematics for the schematic).
    • The AI config files that ng add igniteui-angular writes are skipped (IGNITEUI_SKIP_AI_CONFIG) and removed, because ig new and the schematic run their own ai-config with prompts. Without this, AI tooling was added twice.
  • _base/index.ts: BaseIgxProject.scaffold runs the steps above. If creation fails before the project is complete, the folder is removed. If only the final installs fail, the project is kept and the remaining npm install command is printed.
  • Project files/ are now an overlay: the files ng new generates are deleted from _base and side-nav-auth. A project's extra packages and global types go in extras; side-nav-auth and side-nav-mini-auth share authExtras, which pins angular-auth-oidc-client and @angular/language-service to the project's Angular major.
  • ng-new schematic: calls the same scaffold instead of the app-projects schematic, which is removed. ai-config and the guided add loop run in a tree scoped to the new project.
  • cli-config schematic: skips queuing ai-config when IGNITEUI_SKIP_AI_CONFIG is set.
  • ig new: marks Angular projects' packages as installed, so ig add installs what it adds right away. It also prints the ig add / ig start next steps for every non-Blazor scaffold, and the namespace warning only for Blazor.
  • core/util/ai-skills.ts: package skills are read through the App FS that found them, which in the schematic is a tree rooted at the new project, not the cwd.
  • scripts/versionScript.ts: reads the igniteui-angular version from IGNITEUI_ANGULAR_PACKAGE, since _base/files/package.json no longer exists.
  • scripts/smoke-test.sh: calls this checkout's packages/cli/lib/cli.js directly instead of bin/execute.js. Angular projects now get a project-local igniteui-cli during new, and the wrapper would hand list/add off to that published CLI.
  • Removed the duplicate _base_with_home/files/src/favicon.ico.

Related Issue

Closes #1527

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring / code cleanup
  • Build / CI configuration change

Affected Packages

  • igniteui-cli (packages/cli)
  • @igniteui/cli-core (packages/core)
  • @igniteui/angular-templates (packages/igx-templates)
  • @igniteui/angular-schematics (packages/ng-schematics)
  • @igniteui/mcp-server (packages/igniteui-mcp)

Checklist

  • I have tested my changes locally (npm run test)
  • I have built the project successfully (npm run build)
  • I have run the linter (npm run lint)
  • I have added/updated tests as needed
  • My changes do not introduce new warnings or errors

Additional Context

  • spec/templates/angular-spec passes. The full npm run test was not run.
  • Smoke test (scripts/smoke-test.sh): every Angular project, plus base, side-nav-auth and side-nav-mini-auth, installs and builds.
  • In a generated base project, npm test (vitest 5) and npm run lint pass.
  • Running the generator a second time changes nothing, and --check exits 0.

Copilot AI balanced review requested due to automatic review settings October 21, 2026 12:30
@coveralls

coveralls commented Oct 21, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 95.51% (+0.1%) from 95.368% — mstoyanova/angular-base-project-generation into master

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Dependency resolution and compiler/test-runner upgrades need human validation, and check mode has an unresolved correctness issue.

1 open issue
What changed in this PR

Automates Angular base-template regeneration using Angular schematics, reducing manual maintenance for future releases.

Changes:

  • Adds a generator with check mode and upstream fingerprints.
  • Refreshes Angular configuration and dependencies, including the authentication template.
  • Documents the regeneration workflow.
File Description
scripts/​generate-angular-base.upstream.json Records upstream fingerprints.
scripts/​generate-angular-base.mjs Generates and patches base templates.
packages/​igx-templates/​igx-ts/​projects/​side-nav-auth/​files/​package.json Aligns dependencies and fixes the authentication version.
packages/​igx-templates/​igx-ts/​projects/​_base/​files/​tsconfig.spec.json Removes explicit test output directory.
packages/​igx-templates/​igx-ts/​projects/​_base/​files/​tsconfig.json Adopts generated compiler configuration.
packages/​igx-templates/​igx-ts/​projects/​_base/​files/​tsconfig.app.json Removes explicit application output directory.
packages/​igx-templates/​igx-ts/​projects/​_base/​files/​src/​main.ts Reorders bootstrap imports.
packages/​igx-templates/​igx-ts/​projects/​_base/​files/​package.json Refreshes base dependencies.
packages/​igx-templates/​igx-ts/​projects/​_base/​files/​angular.json Updates asset handling and generated configuration.
packages/​igx-templates/​igx-ts/​projects/​_base/​files/​__dot__vscode/​tasks.json Refreshes background task patterns.
packages/​igx-templates/​igx-ts/​projects/​_base/​files/​__dot__gitignore Allows tracking VS Code MCP configuration.
AGENTS.md Directs maintenance to generator patches.
.agents/​skills/​igniteui-cli-template-version-update/​SKILL.md Adds generator guidance for Angular upgrades.
.agents/​skills/​igniteui-cli-template-anatomy/​SKILL.md Documents generated-file ownership and workflow.
.agents/​README.md Adds regeneration workflow references.

Review effort: Balanced

Comment thread scripts/generate-angular-base.mjs Resolved
Marina-L-Stoyanova and others added 3 commits October 21, 2026 15:55
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The network-dependent generator and major tooling upgrades need final human validation before approval.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Avoid overwriting compatible angular-eslint pins during normalization

scripts/​generate-angular-base.mjs:125

This normalization overrides the pin preserved above. If the current angular-eslint pin is ~22.6.2 or exactly 22.6.2 and the installed version satisfies it, these lines still rewrite it to ~22.6.0. That admits previously excluded versions and makes --check report drift even though the existing pin is compatible. Only normalize angular-eslint when its existing pin was not retained.

1 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The generator must explicitly select npm to prevent local Angular package-manager settings from changing generated output and drift-check results.

1 open issue

Review effort: Balanced

Comment thread scripts/generate-angular-base.mjs Resolved
Marina-L-Stoyanova and others added 5 commits October 22, 2026 10:13
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ates

- Deleted package.json, tsconfig.app.json, and tsconfig.spec.json from side-nav-auth project.
- Updated index.ts files in side-nav-auth and side-nav-mini-auth to share authentication extras.
- Removed ng-schematics app-projects related files and schema.
- Updated ng-new schematic to streamline project creation and remove unnecessary complexity.
- Removed generate-angular-base script and upstream tracking for Angular base files.
- Updated versionScript to utilize constants for igniteui-angular package versioning.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Schematic dry runs create project files and install packages outside Angular’s workflow safeguards.

1 open issue
1 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Smoke tests can exercise published templates instead of the checkout, and schematic AI skill copying resolves physical sources from the wrong directory.

1 open issue
1 previously missed issue

In code that hasn't changed since last review

Medium severity AI skills are copied from the parent instead of the new project

packages/​ng-schematics/​src/​ng-new/​index.ts:151

ScopedTree roots virtual reads at the new project, but it does not change the physical paths used to copy AI skills. In packages/core/util/ai-skills.ts, resolveSkillsRoots() detects the installed skills through that tree and returns a relative node_modules/igniteui-angular/skills path. copyAISkillsToProject() then reads that path through FsFileSystem relative to the unchanged parent working directory. When an agent is selected, this copies no package skills if the parent lacks them, or copies the parent's version instead of the new project's. The scaffold has already deleted the initial AI config. Resolve physical skill sources against the new project's directory as well, and add a disk-backed schematic regression test.

1 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The PR description references missing generator and fingerprint files, leaving documented commands unusable and validation claims inconsistent with the runtime-generation design.

2 open issues

Review effort: Balanced

dkalinovInfra
dkalinovInfra previously approved these changes Nov 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new disk-to-tree boundary lacks a disk-backed regression test verifying that scoped AI-config and guided-add rules can read scaffolded files and persist their changes after workflow commit.

1 open issue
2 resolved since last review

Review effort: Balanced

dkalinovInfra
dkalinovInfra previously approved these changes Nov 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The licensed-feed upgrade still runs against the parent tree instead of the new project root, leaving the generated project's trial dependencies unchanged.

2 open issues

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Out-of-transaction filesystem writes, package installs, and private Angular APIs require maintainer validation of real Angular CLI creation, failure cleanup, and dry-run behavior beyond the stubbed tests and reported ig new smoke runs.

2 open issues

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use angular schematics to build base project

6 participants