feat(create-analog): add --skipViteOverrides flag and Angular v22 RC templates#2358
Conversation
✅ Deploy Preview for analog-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for analog-blog ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for analog-app ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughThis PR introduces the Angular v21 template for AnalogJS projects alongside updates to existing templates for Angular 22 RC compatibility. The core change adds a Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/create-analog/template-angular-v21/.vscode/tasks.json`:
- Around line 27-40: The test task's VSCode problemMatcher currently uses
background.endsPattern.regexp "bundle generation complete" which is wrong for
Vitest; update the test task's problemMatcher background.endsPattern.regexp to a
Vitest-ready pattern (e.g., match "Waiting for file changes", "Watching for file
changes" or the Vitest completion banner like "Test Files .* passed" / "FAIL .*
Watching for file changes") so VSCode detects readiness for the npm test
(Vitest) task—modify only the test task's
problemMatcher.background.endsPattern.regexp entry (leave the npm start task
as-is).
- Around line 9-21: The background endsPattern "bundle generation complete" is
incorrect for Vite/Vitest; update the task for the npm: start (vite) entry to
use a Vite-ready regex such as matching the Vite ready line (e.g., endsPattern
regexp that matches "ready in .*" or the "Local:"/"Network:" address lines) by
changing problemMatcher.background.endsPattern.regexp in that task, and for the
npm: test (vitest) task either remove the background matcher / set isBackground
to false or replace its endsPattern with a vitest-specific readiness line if it
is long-running; adjust problemMatcher.background and isBackground accordingly
so VS Code preLaunchTask readiness detects the correct output.
In `@packages/create-analog/template-angular-v21/package.json`:
- Around line 5-7: The engines.node constraint in package.json is too strict
(">=20.19.1") and should be relaxed to match Angular 21’s documented minimum of
">=20.19.0"; update the "engines" -> "node" entry in
packages/create-analog/template-angular-v21/package.json (the engines.node
field) to ">=20.19.0" so Node 20.19.0 is allowed while preserving the existing
semantics for higher versions.
In `@packages/create-analog/template-angular-v21/src/app/pages/analog-welcome.ts`:
- Around line 259-263: Replace the mutable class property pattern (count = 0 and
increment()) with Angular signal APIs: import signal from '`@angular/core`',
declare count = signal(0) in the component (replacing the numeric property),
implement increment() to update the signal (e.g., count.update(c => c + 1) or
count.set(count() + 1)), and update any template bindings/calls to read the
signal value via count() and call the increment() method as before; remove the
old numeric property to avoid duplicate state.
In `@packages/create-analog/template-angular-v21/vite.config.ts`:
- Around line 8-10: The Vite build target in vite.config.ts is set to ['es2020']
but tsconfig.json uses target "ES2022"; update the Vite build config so targets
match by changing the build.target in vite.config.ts (the build: { target: [...]
} entry) to use 'es2022' (or otherwise match the tsconfig.json target) so
TypeScript-emitted ES2022 syntax is supported during Vite bundling.
In `@packages/create-analog/template-blog/tsconfig.json`:
- Line 4: Remove the global "ignoreDeprecations": "6.0" setting from
tsconfig.json so generated projects won't suppress TypeScript 6 deprecation
warnings; instead, fix the underlying deprecated usages in template source
files, or if suppression is absolutely needed temporarily, move the key into a
more focused config (e.g., tsconfig.spec.json) and add a TODO comment linking to
an issue explaining why it’s scoped and when to remove it.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: d45c1595-584a-4b48-89c1-4bbbcaf06155
⛔ Files ignored due to path filters (3)
packages/create-analog/template-angular-v21/public/analog.svgis excluded by!**/*.svgand included bypackages/**packages/create-analog/template-angular-v21/public/favicon.icois excluded by!**/*.icoand included bypackages/**packages/create-analog/template-angular-v21/public/vite.svgis excluded by!**/*.svgand included bypackages/**
📒 Files selected for processing (37)
packages/create-analog/__tests__/cli.spec.tspackages/create-analog/index.jspackages/create-analog/template-angular-v21/.editorconfigpackages/create-analog/template-angular-v21/.vscode/extensions.jsonpackages/create-analog/template-angular-v21/.vscode/launch.jsonpackages/create-analog/template-angular-v21/.vscode/tasks.jsonpackages/create-analog/template-angular-v21/README.mdpackages/create-analog/template-angular-v21/_gitignorepackages/create-analog/template-angular-v21/angular.jsonpackages/create-analog/template-angular-v21/index.htmlpackages/create-analog/template-angular-v21/package.jsonpackages/create-analog/template-angular-v21/public/.gitkeeppackages/create-analog/template-angular-v21/src/app/app.config.server.tspackages/create-analog/template-angular-v21/src/app/app.config.tspackages/create-analog/template-angular-v21/src/app/app.spec.tspackages/create-analog/template-angular-v21/src/app/app.tspackages/create-analog/template-angular-v21/src/app/pages/analog-welcome.tspackages/create-analog/template-angular-v21/src/app/pages/index.page.tspackages/create-analog/template-angular-v21/src/main.server.tspackages/create-analog/template-angular-v21/src/main.tspackages/create-analog/template-angular-v21/src/server/routes/api/v1/hello.tspackages/create-analog/template-angular-v21/src/styles.csspackages/create-analog/template-angular-v21/src/test-setup.tspackages/create-analog/template-angular-v21/src/vite-env.d.tspackages/create-analog/template-angular-v21/tsconfig.app.jsonpackages/create-analog/template-angular-v21/tsconfig.jsonpackages/create-analog/template-angular-v21/tsconfig.spec.jsonpackages/create-analog/template-angular-v21/vite.config.tspackages/create-analog/template-blog/package.jsonpackages/create-analog/template-blog/src/app/app.config.tspackages/create-analog/template-blog/tsconfig.jsonpackages/create-analog/template-latest/package.jsonpackages/create-analog/template-latest/src/app/app.config.tspackages/create-analog/template-latest/tsconfig.jsonpackages/create-analog/template-minimal/package.jsonpackages/create-analog/template-minimal/src/app/app.config.tspackages/create-analog/template-minimal/tsconfig.json
💤 Files with no reviewable changes (3)
- packages/create-analog/template-blog/src/app/app.config.ts
- packages/create-analog/template-minimal/src/app/app.config.ts
- packages/create-analog/template-latest/src/app/app.config.ts
| "problemMatcher": { | ||
| "owner": "typescript", | ||
| "pattern": "$tsc", | ||
| "background": { | ||
| "activeOnStart": true, | ||
| "beginsPattern": { | ||
| "regexp": "(.*?)" | ||
| }, | ||
| "endsPattern": { | ||
| "regexp": "bundle generation complete" | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check what Vite actually outputs on startup
cd packages/create-analog/template-angular-v21
echo "Checking package.json scripts to understand Vite invocation..."
cat package.json | jq -r '.scripts.start, .scripts.build'Repository: analogjs/analog
Length of output: 138
🏁 Script executed:
#!/bin/bash
set -euo pipefail
cd packages/create-analog/template-angular-v21
echo "=== tasks.json (problemMatcher) ==="
sed -n '1,120p' .vscode/tasks.json | nl -ba
echo "=== package.json (scripts + vite version) ==="
cat package.json | jq -r '.name, .version, .scripts, .devDependencies? , .dependencies?'Repository: analogjs/analog
Length of output: 156
🌐 Web query:
Vite 8.0 default console output message when build completes "built in" "ready in" "bundle generation complete"
💡 Result:
When the vite build command completes successfully in Vite 8.0, the console output concludes with a message in the format: ✓ built in [time] For example: ✓ built in 1.33s [1] This standard output follows the completion of the bundle generation process [2][1]. While Vite 8 introduced new features—such as forwarding browser console logs to the terminal [3][4]—the fundamental terminal notification for a successful build remains consistent with previous versions of Vite [1].
Citations:
- 1: https://soledadpenades.com/posts/2023/from-zero-to-hello/
- 2: https://github.com/vitejs/vite/blob/main/docs/guide/build.md
- 3: https://vite.dev/blog/announcing-vite8
- 4: https://dev.to/erikch/8-vite-config-options-every-developer-should-know-vite-8-22im
🏁 Script executed:
#!/bin/bash
set -euo pipefail
cd packages/create-analog/template-angular-v21
echo "=== .vscode/tasks.json (full) ==="
cat .vscode/tasks.json
echo "=== package.json scripts ==="
cat package.json | jq -r '.scripts'Repository: analogjs/analog
Length of output: 1241
🌐 Web query:
Vite 8 vite dev server output line on startup (not build) e.g. "ready in" or "Local:" and whether any "bundle generation complete" string exists
💡 Result:
In Vite 8 dev server startup, the usual startup output includes: - A version line with “ready in” (example shown for Vite v4.x: “VITE v4.3.8 ready in 1892 ms”). This is the same style Vite uses when starting its dev server, but I did not find an official Vite 8-specific log snippet in the sources retrieved. - A “Local:” line with the dev URL (example for Vite v4.x: “➜ Local: http://127.0.0.1:3001/”). The search results I found include a concrete “ready in” and “Local:” example from a Vite dev server discussion, but that example is Vite v4.x, not v8. On whether any “bundle generation complete” string exists in Vite 8 dev server output: - I did not find evidence that Vite itself prints the literal string “bundle generation complete”. One retrieved source containing “Application bundle generation complete.” appears to be an Angular CLI development server message, not Vite’s dev server output.[1] - Therefore, based on the sources retrieved, there is no confirmed “bundle generation complete” string in Vite 8 dev-server startup logs. If you want, tell me your exact command (e.g. “vite” vs “vite --host …”, any flags like “--clearScreen false”, and whether you enable Vite 8’s experimental full bundle mode), and I can search again for a matching Vite 8 console transcript showing the startup lines.
Citations:
🏁 Script executed:
#!/bin/bash
set -euo pipefail
cd packages/create-analog/template-angular-v21
echo "=== .vscode/launch.json ==="
ls -la .vscode || true
if [ -f .vscode/launch.json ]; then
cat .vscode/launch.json
else
echo "No launch.json found"
fi
echo "=== launch configs referencing preLaunchTask ==="
rg -n "preLaunchTask|problemMatcher|tasks\\\\/" .vscode || trueRepository: analogjs/analog
Length of output: 1062
🌐 Web query:
VS Code tasks background problemMatcher activeOnStart endsPattern preLaunchTask readiness semantics
💡 Result:
In Visual Studio Code, the background task system allows long-running processes (like watch scripts or servers) to interface with the editor's task and debug lifecycles [1][2]. When a task is marked as "isBackground": true, VS Code understands that the process will not exit on its own [1][3]. To provide readiness semantics—enabling features like using the task as a preLaunchTask—you must configure a problemMatcher with a background property [1]. The background configuration monitors the task's terminal output for specific signals [1][4]: 1. activeOnStart: When set to true, the task system immediately starts monitoring the terminal output for the defined patterns upon task execution [1][2]. 2. beginsPattern: A regular expression that identifies the start of the task's initialization phase [1]. 3. endsPattern: A regular expression that signals the task has finished its initialization and is now "ready" [1][4]. When used as a preLaunchTask in launch.json, VS Code will block the launch of the debugger until the endsPattern is matched in the task's output [1][5]. This provides a reliable way to ensure a server or compiler is fully operational before the debugger attempts to connect [1][3]. Key behavioral notes: - Readiness Signal: The endsPattern acts as the critical "readiness" signal for the debugger [1]. If the task never prints a string matching this pattern, the debugger may timeout or hang waiting for the task [6]. - Dependency Caveats: When tasks have dependsOn relationships, the readiness logic can sometimes behave unexpectedly; VS Code waits for the background task's endsPattern to be satisfied, but issues have been reported where complex task chains may trigger prematurely if not configured carefully [5][7]. - Modern Tooling: Many modern build tools provide output that is highly ephemeral or lacks distinct "start/end" markers [8]. This often necessitates creative use of regex or custom wrapper scripts (e.g., shell scripts that echo specific strings) to satisfy the required beginsPattern/endsPattern handshake [8][6][4]. - Data Capture: While endsPattern is primarily for readiness signaling, the task system has seen community requests and ongoing discussion regarding using named capture groups from these patterns to dynamically populate variables (like ports or URLs) in launch configurations [9]. By combining isBackground: true with a problemMatcher containing these patterns, you bridge the gap between "running" and "ready," allowing VS Code to treat volatile background processes as stable prerequisites for debugging [1][2].
Citations:
- 1: https://code.visualstudio.com/docs/debugtest/tasks
- 2: https://www.eke.li/2023/03/vscode-tasks/
- 3: https://stackoverflow.com/questions/44242048/how-can-i-prevent-vs-code-from-waiting-for-a-prelaunchtask-to-finish
- 4: https://stackoverflow.com/questions/48478701/what-are-the-correct-beginspattern-and-endspattern-for-a-background-task-in-vsco
- 5: Debug launching before preLaunchTask ready when dependsOn task defined microsoft/vscode#54397
- 6: Support fire-and-forget background tasks (for preLaunchTask) microsoft/vscode#151101
- 7: Compound tasks are ignoring endsPattern of dependent tasks microsoft/vscode#85400
- 8: problemMatcher is too complicated and should be modernised microsoft/vscode#141102
- 9: Support
${taskVar:name}variables from problem matcher named capture groups microsoft/vscode#303361
Fix VS Code task readiness: endsPattern doesn’t match Vite/Vitest output
In packages/create-analog/template-angular-v21/.vscode/tasks.json, both npm: start (runs vite) and npm: test (runs vitest) use problemMatcher.background.endsPattern.regexp: "bundle generation complete". VS Code uses endsPattern as the readiness gate for launch.json preLaunchTask, so if Vite 8’s output is instead like ready in ... / Local: ... and Vitest never prints that exact string, the debugger can hang/timeout waiting for readiness. Update the matcher to the actual vite ready line (and use a separate readiness condition for vitest, or remove isBackground/the background matcher for the non-long-running test).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/create-analog/template-angular-v21/.vscode/tasks.json` around lines
9 - 21, The background endsPattern "bundle generation complete" is incorrect for
Vite/Vitest; update the task for the npm: start (vite) entry to use a Vite-ready
regex such as matching the Vite ready line (e.g., endsPattern regexp that
matches "ready in .*" or the "Local:"/"Network:" address lines) by changing
problemMatcher.background.endsPattern.regexp in that task, and for the npm: test
(vitest) task either remove the background matcher / set isBackground to false
or replace its endsPattern with a vitest-specific readiness line if it is
long-running; adjust problemMatcher.background and isBackground accordingly so
VS Code preLaunchTask readiness detects the correct output.
| "problemMatcher": { | ||
| "owner": "typescript", | ||
| "pattern": "$tsc", | ||
| "background": { | ||
| "activeOnStart": true, | ||
| "beginsPattern": { | ||
| "regexp": "(.*?)" | ||
| }, | ||
| "endsPattern": { | ||
| "regexp": "bundle generation complete" | ||
| } | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the referenced tasks.json
FILE="packages/create-analog/template-angular-v21/.vscode/tasks.json"
if [ -f "$FILE" ]; then
echo "=== $FILE (head/tail with line numbers) ==="
nl -ba "$FILE" | sed -n '1,140p'
else
echo "Missing file: $FILE"
fi
# Search for other problemMatcher definitions in the repo around this template
rg -n "problemMatcher|bundle generation complete|Waiting for file changes" "packages/create-analog/template-angular-v21/.vscode/tasks.json" || trueRepository: analogjs/analog
Length of output: 221
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE="packages/create-analog/template-angular-v21/.vscode/tasks.json"
echo "== Repo file check =="
ls -la "$FILE" || true
wc -l "$FILE" 2>/dev/null || true
echo
echo "== First 200 lines (with line numbers via cat -n) =="
if [ -f "$FILE" ]; then
cat -n "$FILE" | sed -n '1,200p'
fi
echo
echo "== Lines containing bundle generation complete / Waiting for file changes =="
rg -n "bundle generation complete|Waiting for file changes|problemMatcher" "$FILE" || true
echo
echo "== Print any task entries with problemMatcher =="
# crude but effective: show around each 'problemMatcher' occurrence
rg -n "problemMatcher" "$FILE" -n -C 8 || trueRepository: analogjs/analog
Length of output: 2727
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Locate template package.json
TEMPLATE_DIR="packages/create-analog/template-angular-v21"
FILE_JSON="$TEMPLATE_DIR/package.json"
echo "== Check package.json exists =="
ls -la "$FILE_JSON" || true
echo
echo "== package.json (relevant parts) =="
if [ -f "$FILE_JSON" ]; then
# print only scripts section-ish
cat -n "$FILE_JSON" | sed -n '1,220p'
fi
echo
echo "== Search for 'bundle generation complete' in template =="
rg -n "bundle generation complete" "$TEMPLATE_DIR" || true
echo
echo "== Search for vitest usage in template =="
rg -n "vitest|vitest run|vitest watch" "$TEMPLATE_DIR" || trueRepository: analogjs/analog
Length of output: 3337
🌐 Web query:
Vitest watch stdout "Waiting for file changes" "Test Files" output
💡 Result:
In Vitest watch mode, the CLI prints a banner that includes the exact text "Waiting for file changes..." when the last run had no failures. [1] After the test run, the same watch banner also includes the “press h to show help” hint and, on successful runs, “press q to quit”. [1] The output also includes a “Test Files …” summary line for the just-executed run (for example, “Test Files 3 passed (3)”). [2] If there are test failures, the banner changes to "FAIL … Watching for file changes..." instead of "Waiting for file changes...". [1] How to reproduce / verify your expected stdout - Run vitest in watch mode (default in dev): vitest or vitest watch (same as vitest without an argument). [3] - Ensure output is not suppressed by a custom reporter or TTY-less mode; Vitest prints “Waiting for file changes...” from its watcher reporter when in watch and the last run did not fail. [1] Notes for automation - If you’re running under a non-interactive environment, Vitest may fall back to run mode automatically (so you won’t see the watch banner). [3][4]
Citations:
- 1: https://github.com/vitest-dev/vitest/blob/fda52af9c3974d5fd16161e1ed502dd47fd38ceb/packages/vitest/src/node/reporters/base.ts
- 2: https://dev.to/jangwook_kim_e31e7291ad98/migrating-from-jest-to-vitest-4-a-complete-2026-guide-4132
- 3: https://vitest.dev/guide/cli
- 4: https://vitest.dev/guide/features
Fix VSCode problemMatcher for the Angular v21 test task
- In
packages/create-analog/template-angular-v21/.vscode/tasks.json, both thenpm startandnpm testtasks usebackground.endsPattern.regexp: "bundle generation complete". - The
testscript runsvitest(watch), which outputs strings likeWaiting for file changes...andTest Files ... passed/FAIL ... Watching for file changes...—notbundle generation complete. - Update the
testtask’sproblemMatcherendsPatternto match a Vitest completion banner so VSCode can correctly detect readiness.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/create-analog/template-angular-v21/.vscode/tasks.json` around lines
27 - 40, The test task's VSCode problemMatcher currently uses
background.endsPattern.regexp "bundle generation complete" which is wrong for
Vitest; update the test task's problemMatcher background.endsPattern.regexp to a
Vitest-ready pattern (e.g., match "Waiting for file changes", "Watching for file
changes" or the Vitest completion banner like "Test Files .* passed" / "FAIL .*
Watching for file changes") so VSCode detects readiness for the npm test
(Vitest) task—modify only the test task's
problemMatcher.background.endsPattern.regexp entry (leave the npm start task
as-is).
| "engines": { | ||
| "node": ">=20.19.1" | ||
| }, |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
What are the minimum Node.js version requirements for Angular 21.0.0, Vite 8.0.0, and Vitest 4.1.0?
💡 Result:
Minimum Node.js version requirements: 1) Angular 21.0.0: Node.js 20.19.0+ (also compatible with 22.12.0+ and 24.0.0+ per Angular’s version compatibility table for 21.0.x). [1] 2) Vite 8.0.0: Node.js 20.19+ (also compatible with 22.12+). [2] 3) Vitest 4.1.0: Node.js 20.0.0+ (minimum), with supported ranges that also include ^22.0.0 and >=24.0.0. [3][4] Note: “Minimum” here is interpreted as the lowest Node.js major/patch version that the official docs/metadata explicitly list as supported for that release line.
Citations:
- 1: https://angular.dev/reference/versions
- 2: https://vite.dev/blog/announcing-vite8
- 3: https://vitest.dev/guide/migration.html
- 4: vitest-dev/vitest@9a0bf2254
Adjust engines.node to match Angular 21’s documented minimum
In packages/create-analog/template-angular-v21/package.json (engines.node: >=20.19.1), the original concern about Angular 21 requiring ^20.11.1 is incorrect: Angular 21.0.x is documented as supporting Node.js 20.19.0+. This change only excludes Node 20.19.0; if nothing in the template/tooling (Vite 8/Vitest 4.1/AnalogJS) requires .1 specifically, align the constraint to >=20.19.0.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/create-analog/template-angular-v21/package.json` around lines 5 - 7,
The engines.node constraint in package.json is too strict (">=20.19.1") and
should be relaxed to match Angular 21’s documented minimum of ">=20.19.0";
update the "engines" -> "node" entry in
packages/create-analog/template-angular-v21/package.json (the engines.node
field) to ">=20.19.0" so Node 20.19.0 is allowed while preserving the existing
semantics for higher versions.
| count = 0; | ||
|
|
||
| increment() { | ||
| this.count++; | ||
| } |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win
Prefer signal APIs for reactive state per Angular modern syntax guidelines.
The counter uses a class property and mutation, but the coding guidelines require using signal APIs for modern Angular syntax. This is a template that will scaffold new projects, so it should demonstrate current best practices.
As per coding guidelines, "Always use modern Angular syntax including dependency injection with inject, control flow, signal APIs, and standalone components."
✨ Proposed refactor to use signal API
+import { Component, signal } from '`@angular/core`';
-import { Component } from '`@angular/core`'; export class AnalogWelcome {
- count = 0;
+ count = signal(0);
increment() {
- this.count++;
+ this.count.update(c => c + 1);
}
}And update the template to call the signal:
<button (click)="increment()" class="lightBtn">
- Count: <span class="count">{{ count }}</span>
+ Count: <span class="count">{{ count() }}</span>
</button>🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/create-analog/template-angular-v21/src/app/pages/analog-welcome.ts`
around lines 259 - 263, Replace the mutable class property pattern (count = 0
and increment()) with Angular signal APIs: import signal from '`@angular/core`',
declare count = signal(0) in the component (replacing the numeric property),
implement increment() to update the signal (e.g., count.update(c => c + 1) or
count.set(count() + 1)), and update any template bindings/calls to read the
signal value via count() and call the increment() method as before; remove the
old numeric property to avoid duplicate state.
| build: { | ||
| target: ['es2020'], | ||
| }, |
There was a problem hiding this comment.
Target mismatch: Vite es2020 vs TypeScript ES2022.
The Vite build target is set to es2020, but tsconfig.json line 19 specifies target: "ES2022". This inconsistency means TypeScript may emit ES2022 syntax that Vite is not configured to handle, potentially causing build or runtime issues.
🔧 Align build targets
build: {
- target: ['es2020'],
+ target: ['es2022'],
},📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| build: { | |
| target: ['es2020'], | |
| }, | |
| build: { | |
| target: ['es2022'], | |
| }, |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/create-analog/template-angular-v21/vite.config.ts` around lines 8 -
10, The Vite build target in vite.config.ts is set to ['es2020'] but
tsconfig.json uses target "ES2022"; update the Vite build config so targets
match by changing the build.target in vite.config.ts (the build: { target: [...]
} entry) to use 'es2022' (or otherwise match the tsconfig.json target) so
TypeScript-emitted ES2022 syntax is supported during Vite bundling.
| { | ||
| "compileOnSave": false, | ||
| "compilerOptions": { | ||
| "ignoreDeprecations": "6.0", |
There was a problem hiding this comment.
Suppressing TypeScript 6.0 deprecations in scaffolding templates hides migration signals.
Adding ignoreDeprecations: "6.0" to the root tsconfig means all projects generated from these templates will suppress TypeScript 6.0 deprecation warnings. This prevents users from seeing signals about deprecated features in their own code and delays necessary migrations.
If specific deprecated TypeScript features are causing build noise in the templates themselves, the better approach is to:
- Fix the actual deprecations in template code
- Document why suppression is temporarily needed (with a TODO/issue)
- Or scope the suppression more narrowly (e.g., only in tsconfig.spec.json if test-related)
Since these are scaffolding templates that define the baseline for all new projects, they should model best practices rather than work around warnings.
What specific TypeScript 6.0 deprecations are these templates encountering that require suppression?
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/create-analog/template-blog/tsconfig.json` at line 4, Remove the
global "ignoreDeprecations": "6.0" setting from tsconfig.json so generated
projects won't suppress TypeScript 6 deprecation warnings; instead, fix the
underlying deprecated usages in template source files, or if suppression is
absolutely needed temporarily, move the key into a more focused config (e.g.,
tsconfig.spec.json) and add a TODO comment linking to an issue explaining why
it’s scoped and when to remove it.
PR Checklist
Adds an internal
--skipViteOverridesflag to thecreate-analogCLI that toggles whether the generatedpackage.jsonkeeps theoverridesblock pinningvite/vitest. Also covers the Angular v22 RC template updates.Closes #
Affected scope
Recommended merge strategy for maintainer [optional]
What is the new behavior?
latest,minimal, andblogtemplates to Angular^22.0.0-rc.0(TypeScript~6.0.0, Vite^8.0.0,@analogjs/* ^2.6.0-beta.1), consistent with the v17–v21 per-major templates.--skipViteOverridesCLI flag:fromBoolArghelper (same convention as--skipTailwind); flag-only, no interactive prompt.viteandvitestfrom the generatedpackage.json'soverridesblock and removes the block if it becomes empty.Test plan
nx format:checkpnpm buildnx test create-analogRan the targeted
nx test create-analogsuite (9 passed, 1 pre-existing skip), including two new tests asserting the overrides are kept by default and stripped with--skipViteOverrides. Did not run the fullpnpm build/pnpm test— this change is scoped to the create-analog CLI and templates.Does this PR introduce a breaking change?
Default scaffolding output is unchanged; the new flag is opt-in.
Other information
The vite/vitest
overridesuse$vite/$vitestplaceholders substituted at publish time; the flag operates on the parsedpackage.jsonbefore write, so it composes with that substitution.🤖 Generated with Claude Code