You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: regenerate Angular base project and update dependencies - #1854
The Angular base project (packages/igx-templates/igx-ts/projects/_base) was written by hand. Every Angular release meant comparing it with a fresh ng new and copying the changes over manually.
This PR adds scripts/generate-angular-base.mjs. It builds the base project with Angular's own tools:
ng new
ng add angular-eslint
ng add igniteui-angular
It then copies Angular's config files into the template and applies our changes on top: placeholders, budgets, npm scripts, test setup and extra packages.
Is the base out of date? (writes nothing, exits 1 if it is)
node scripts/generate-angular-base.mjs --check
It needs network access and takes a few minutes.
A version pin only changes when the new project needs a version outside it.
Files we maintain by hand (src/app/*, index.html, styles.scss, README.md, ...) are never overwritten. The script keeps a fingerprint of Angular's version of each one in scripts/generate-angular-base.upstream.json and tells you when Angular changes one, so you can port the change.
Template changes from the first run (Angular 22.2)
tsconfig*.json: removed settings that are now defaults (strict, strictTemplates, moduleResolution, outDir). Nothing becomes less strict.
angular.json: removed the default outputPath and index. Assets now come from the public/ folder plus src/assets, which fixes the missing favicon in the base project. Arrays are formatted the way Angular writes them.
.vscode/tasks.json: Angular's updated patterns. A failed build no longer leaves the serve/test task (and F5 debugging) waiting forever.
.gitignore: keeps .vscode/mcp.json.
package.json:
vitest 4 → 5
angular-eslint 22.0 → 22.6, with typescript-eslint 8.71.0
added igniteui-i18n-core, which ng add igniteui-angular now installs
removed the unused @angular/platform-browser-dynamic
side-nav-auth/files/package.json: now built from the base manifest plus its own packages, because it had drifted (it was still on vitest 4). Also fixes angular-auth-oidc-client: ~22.2.0 was never published, so this project could not install. It is now ~22.0.2.
Removed the duplicate _base_with_home/files/src/favicon.ico.
Docs
AGENTS.md and .agents/README.md point to the generator.
The igniteui-cli-template-anatomy skill has a new "Generated Angular Base Project" section.
The igniteui-cli-template-version-update skill now reports the generator command when a new igniteui-angular needs a newer Angular.
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
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.
…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.
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.
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.
The reason will be displayed to describe this comment to others. Learn more.
The cleanup in this catch isn't guarded. force: true only ignores a missing path, and maxRetries defaults to 0, so on Windows an EBUSY/EPERM (npm still holding esbuild/rollup binaries) throws from rmSync. That error escapes scaffold() instead of Project creation
failed: …, and the folder is left half-deleted.
}catch(error){try{fs.rmSync(projectPath,{recursive: true,force: true});}catch{Util.warn(`Could not remove "${options.name}"; delete it before retrying.`,"yellow");}Util.error(`Project creation failed: ${error.message}`,"red");returnfalse;}
Also a question, since the spec tests this on purpose ("a retry starts clean"): should a failure in the final npm install steps delete a project that's otherwise complete? On master, a failed install left the project in place so the user could re-run npm install. Now a dev or unpublished igniteui-cli version (~ → ETARGET) or a network error removes everything. Cleaning up only when generateProject fails, and leaving the project with a warning if a later step fails, might be a better balance.
The reason will be displayed to describe this comment to others. Learn more.
Two differences from what you suggested:
Cleanup covers more than generateProject. The folder is also removed if copying the template files or patching angular.json/package.json/tsconfigs fails, because a half-patched project isn't one the user can finish with npm install. Only an install failure keeps the folder.
scaffold() still returns false when an install fails, so ig new stops before AI config, git init and the next steps, and the ng-new schematic throws before ai-config and its git task. On master the project also got AI config and git, because installPackages only logged the error. If you'd rather match master fully, scaffold() could return true with the warning and let the callers finish setup. Should I change it to that, or is keeping the project with the warning enough?
The reason will be displayed to describe this comment to others. Learn more.
Keep scaffold() returning false. Returning true would make ig new set packagesInstalled: true (new.ts:207-212) on a project whose node_modules didn't finish installing, so a later ig add would install on top of a broken tree. It would also print "Project Created" and the next steps for a project that doesn't build yet. Matching master fully would need a third result from scaffold() ("created, packages not installed"), which isn't worth it in this PR.
The reason will be displayed to describe this comment to others. Learn more.
This warning also prints from the ng-new schematic, where --skip-install isn't ignored: the schematic still skips the final NodePackageInstallTask (ng-new/index.ts:173) and the start task (:187). The schema.json description and the README in this PR describe that correctly, so the warning contradicts them.
Either warn only from ig new (e.g. the caller decides), or reword it so it's true in both flows:
Util.warn("--skip-install does not apply to the initial setup: `ng add` installs the packages the project starts with.","yellow");
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Angular base project (
packages/igx-templates/igx-ts/projects/_base) was written by hand. Every Angular release meant comparing it with a freshng newand copying the changes over manually.This PR adds
scripts/generate-angular-base.mjs. It builds the base project with Angular's own tools:ng newng add angular-eslintng add igniteui-angularIt then copies Angular's config files into the template and applies our changes on top: placeholders, budgets, npm scripts, test setup and extra packages.
How to use it
node scripts/generate-angular-base.mjs --angular ~22.3.0node scripts/generate-angular-base.mjs --angular ~23.0.0 --igniteui ~23.0.0node scripts/generate-angular-base.mjs --checksrc/app/*,index.html,styles.scss,README.md, ...) are never overwritten. The script keeps a fingerprint of Angular's version of each one inscripts/generate-angular-base.upstream.jsonand tells you when Angular changes one, so you can port the change.Template changes from the first run (Angular 22.2)
tsconfig*.json: removed settings that are now defaults (strict,strictTemplates,moduleResolution,outDir). Nothing becomes less strict.angular.json: removed the defaultoutputPathandindex. Assets now come from thepublic/folder plussrc/assets, which fixes the missing favicon in thebaseproject. Arrays are formatted the way Angular writes them..vscode/tasks.json: Angular's updated patterns. A failed build no longer leaves the serve/test task (and F5 debugging) waiting forever..gitignore: keeps.vscode/mcp.json.package.json:igniteui-i18n-core, whichng add igniteui-angularnow installs@angular/platform-browser-dynamicside-nav-auth/files/package.json: now built from the base manifest plus its own packages, because it had drifted (it was still on vitest 4). Also fixesangular-auth-oidc-client:~22.2.0was never published, so this project could not install. It is now~22.0.2._base_with_home/files/src/favicon.ico.Docs
AGENTS.mdand.agents/README.mdpoint to the generator.igniteui-cli-template-anatomyskill has a new "Generated Angular Base Project" section.igniteui-cli-template-version-updateskill now reports the generator command when a newigniteui-angularneeds a newer Angular.Related Issue
Closes #1527
Type of 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
npm run test)npm run build)npm run lint)Additional Context
spec/templates/angular-specpasses. The fullnpm run testwas not run.scripts/smoke-test.sh): every Angular project, plusbase,side-nav-authandside-nav-mini-auth, installs and builds.baseproject,npm test(vitest 5) andnpm run lintpass.--checkexits 0.