@shrkcrft/presets 0.1.0-alpha.2 → 0.1.0-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builtin/angular21-presets.d.ts +9 -0
- package/dist/builtin/angular21-presets.d.ts.map +1 -0
- package/dist/builtin/angular21-presets.js +218 -0
- package/dist/builtin/angular21-snippets.d.ts +28 -0
- package/dist/builtin/angular21-snippets.d.ts.map +1 -0
- package/dist/builtin/angular21-snippets.js +243 -0
- package/dist/builtin/builtin-presets.d.ts.map +1 -1
- package/dist/builtin/builtin-presets.js +40 -19
- package/dist/builtin/nest11-presets.d.ts +11 -0
- package/dist/builtin/nest11-presets.d.ts.map +1 -0
- package/dist/builtin/nest11-presets.js +257 -0
- package/dist/builtin/nest11-snippets.d.ts +32 -0
- package/dist/builtin/nest11-snippets.d.ts.map +1 -0
- package/dist/builtin/nest11-snippets.js +270 -0
- package/dist/builtin/r26-presets.d.ts +1 -3
- package/dist/builtin/r26-presets.d.ts.map +1 -1
- package/dist/builtin/r26-presets.js +5 -33
- package/dist/builtin/r26-snippets.d.ts +0 -2
- package/dist/builtin/r26-snippets.d.ts.map +1 -1
- package/dist/builtin/r26-snippets.js +0 -16
- package/dist/builtin/r45-presets.d.ts +1 -1
- package/dist/builtin/r45-presets.d.ts.map +1 -1
- package/dist/builtin/r45-presets.js +5 -5
- package/dist/builtin/r47-presets.d.ts +1 -1
- package/dist/builtin/r47-presets.d.ts.map +1 -1
- package/dist/builtin/r47-presets.js +4 -4
- package/dist/builtin/react19-presets.d.ts +12 -0
- package/dist/builtin/react19-presets.d.ts.map +1 -0
- package/dist/builtin/react19-presets.js +299 -0
- package/dist/builtin/react19-snippets.d.ts +43 -0
- package/dist/builtin/react19-snippets.d.ts.map +1 -0
- package/dist/builtin/react19-snippets.js +363 -0
- package/dist/builtin/shared-snippets.d.ts +25 -3
- package/dist/builtin/shared-snippets.d.ts.map +1 -1
- package/dist/builtin/shared-snippets.js +265 -0
- package/dist/emit/synthesize-files.d.ts.map +1 -1
- package/dist/emit/synthesize-files.js +76 -17
- package/dist/registry/recommend.d.ts.map +1 -1
- package/dist/registry/recommend.js +7 -3
- package/package.json +5 -5
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IPreset } from '../model/preset.js';
|
|
2
|
+
export declare const ANGULAR_21_SIGNALS: IPreset;
|
|
3
|
+
export declare const ANGULAR_21_ZONELESS: IPreset;
|
|
4
|
+
export declare const ANGULAR_21_CONTROL_FLOW: IPreset;
|
|
5
|
+
export declare const ANGULAR_21_RESOURCE: IPreset;
|
|
6
|
+
export declare const ANGULAR_21_MODERN_DI: IPreset;
|
|
7
|
+
export declare const ANGULAR_21_MODERN: IPreset;
|
|
8
|
+
export declare const ANGULAR_21_PRESETS: readonly IPreset[];
|
|
9
|
+
//# sourceMappingURL=angular21-presets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"angular21-presets.d.ts","sourceRoot":"","sources":["../../src/builtin/angular21-presets.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAmDlD,eAAO,MAAM,kBAAkB,EAAE,OAiC/B,CAAC;AAIH,eAAO,MAAM,mBAAmB,EAAE,OA8BhC,CAAC;AAIH,eAAO,MAAM,uBAAuB,EAAE,OAgCpC,CAAC;AAIH,eAAO,MAAM,mBAAmB,EAAE,OA6BhC,CAAC;AAIH,eAAO,MAAM,oBAAoB,EAAE,OA8BjC,CAAC;AAIH,eAAO,MAAM,iBAAiB,EAAE,OAgD9B,CAAC;AAEH,eAAO,MAAM,kBAAkB,EAAE,SAAS,OAAO,EAO/C,CAAC"}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
// Modern Angular 18 / 19 / 20 / 21 preset family.
|
|
2
|
+
//
|
|
3
|
+
// Six presets — five focused on a single area of the modernisation surface,
|
|
4
|
+
// one comprehensive that composes the rest. They target Angular workspaces
|
|
5
|
+
// (HasAngular) with `weight` set above `modern-angular` (R26, weight 9) so
|
|
6
|
+
// the recommender prefers them when the workspace shape allows.
|
|
7
|
+
//
|
|
8
|
+
// Each preset's `paths` includes the standard Angular structure
|
|
9
|
+
// (src/app/, src/app/components/, src/app/services/) so the init paths
|
|
10
|
+
// advisory annotator can verify against the live workspace.
|
|
11
|
+
import { WorkspaceProfile } from '@shrkcrft/workspace';
|
|
12
|
+
import { definePreset } from "../define/define-preset.js";
|
|
13
|
+
import { ANGULAR_PATH_APP, ANGULAR_PATH_COMPONENTS, ANGULAR_PATH_SERVICES, COMMON_AGENT_BRIEFING, COMMON_PIPELINE_CONTEXT_ONLY, COMMON_PIPELINE_FEATURE_DEV, COMMON_PIPELINE_UNIT_TEST, COMMON_SAFETY_RULE, OVERVIEW_DOC, } from "./shared-snippets.js";
|
|
14
|
+
import { NG21_AFTER_RENDER, NG21_BOOTSTRAP_APPLICATION, NG21_CONTROL_FLOW, NG21_DEFER, NG21_HTTP_RESOURCE, NG21_HYBRID_RENDERING, NG21_INJECT_FN, NG21_LET_TEMPLATE, NG21_LINKED_SIGNAL, NG21_MODEL_TWO_WAY, NG21_NG_OPTIMIZED_IMAGE, NG21_NO_EFFECT_FOR_DERIVED, NG21_NO_NGMODULES, NG21_NO_ZONE_APIS, NG21_PROVIDE_HTTP_FETCH, NG21_PROVIDED_IN_ROOT, NG21_RESOURCE_API, NG21_SELF_CLOSING_TAGS, NG21_SIGNAL_CONTENT_CHILD, NG21_SIGNAL_FORMS_INTEROP, NG21_SIGNAL_INPUTS, NG21_SIGNAL_OUTPUTS, NG21_SIGNAL_STATE, NG21_SIGNAL_VIEW_CHILD, NG21_TEST_NO_DETECT_CHANGES_OUTSIDE, NG21_TEST_SIGNAL_INPUT, NG21_ZONELESS, } from "./angular21-snippets.js";
|
|
15
|
+
const NG21_TAGS = ['angular', 'angular-21', 'modern'];
|
|
16
|
+
const NG21_NEXT_COMMANDS = [
|
|
17
|
+
'shrk doctor',
|
|
18
|
+
'shrk task "<task>"',
|
|
19
|
+
'shrk ci scaffold github-actions --quickstart',
|
|
20
|
+
];
|
|
21
|
+
// ─── 1) Signals — state, queries, inputs, outputs, model ─────────────────
|
|
22
|
+
export const ANGULAR_21_SIGNALS = definePreset({
|
|
23
|
+
id: 'angular-21-signals',
|
|
24
|
+
title: 'Angular 21 — signal-everything',
|
|
25
|
+
description: 'Signal-based local state, queries (viewChild / viewChildren / contentChild / contentChildren as functions), inputs (input() / input.required()), outputs (output()), and two-way bindings (model()). Replaces every @Input/@Output/@ViewChild decorator with its signal-era counterpart.',
|
|
26
|
+
tags: [...NG21_TAGS, 'signals'],
|
|
27
|
+
appliesTo: [WorkspaceProfile.HasAngular],
|
|
28
|
+
weight: 11,
|
|
29
|
+
includes: {
|
|
30
|
+
knowledge: [COMMON_AGENT_BRIEFING],
|
|
31
|
+
rules: [
|
|
32
|
+
COMMON_SAFETY_RULE,
|
|
33
|
+
NG21_SIGNAL_STATE,
|
|
34
|
+
NG21_LINKED_SIGNAL,
|
|
35
|
+
NG21_NO_EFFECT_FOR_DERIVED,
|
|
36
|
+
NG21_SIGNAL_VIEW_CHILD,
|
|
37
|
+
NG21_SIGNAL_CONTENT_CHILD,
|
|
38
|
+
NG21_SIGNAL_INPUTS,
|
|
39
|
+
NG21_SIGNAL_OUTPUTS,
|
|
40
|
+
NG21_MODEL_TWO_WAY,
|
|
41
|
+
NG21_SIGNAL_FORMS_INTEROP,
|
|
42
|
+
],
|
|
43
|
+
paths: [ANGULAR_PATH_APP, ANGULAR_PATH_COMPONENTS, ANGULAR_PATH_SERVICES],
|
|
44
|
+
templates: [],
|
|
45
|
+
pipelines: [COMMON_PIPELINE_CONTEXT_ONLY, COMMON_PIPELINE_FEATURE_DEV],
|
|
46
|
+
docs: {
|
|
47
|
+
'overview.md': OVERVIEW_DOC('Angular 21 signals', 'No @Input, no @Output, no @ViewChild, no EventEmitter. Local state in signal(), derived in computed()/linkedSignal(), side effects in effect(), queries via viewChild()/contentChild(), I/O via input()/output()/model().'),
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
recommendedNextCommands: NG21_NEXT_COMMANDS,
|
|
51
|
+
});
|
|
52
|
+
// ─── 2) Zoneless ──────────────────────────────────────────────────────────
|
|
53
|
+
export const ANGULAR_21_ZONELESS = definePreset({
|
|
54
|
+
id: 'angular-21-zoneless',
|
|
55
|
+
title: 'Angular 21 — zoneless change detection',
|
|
56
|
+
description: 'Bootstrap with provideZonelessChangeDetection() and remove zone.js entirely. Codifies the "no NgZone APIs, signals drive CD" posture, plus the migration hints (signal-first state, afterNextRender for DOM-aware work).',
|
|
57
|
+
tags: [...NG21_TAGS, 'zoneless', 'performance'],
|
|
58
|
+
appliesTo: [WorkspaceProfile.HasAngular],
|
|
59
|
+
weight: 11,
|
|
60
|
+
includes: {
|
|
61
|
+
knowledge: [COMMON_AGENT_BRIEFING],
|
|
62
|
+
rules: [
|
|
63
|
+
COMMON_SAFETY_RULE,
|
|
64
|
+
NG21_ZONELESS,
|
|
65
|
+
NG21_NO_ZONE_APIS,
|
|
66
|
+
NG21_SIGNAL_STATE,
|
|
67
|
+
NG21_AFTER_RENDER,
|
|
68
|
+
NG21_BOOTSTRAP_APPLICATION,
|
|
69
|
+
NG21_PROVIDE_HTTP_FETCH,
|
|
70
|
+
],
|
|
71
|
+
paths: [ANGULAR_PATH_APP, ANGULAR_PATH_COMPONENTS, ANGULAR_PATH_SERVICES],
|
|
72
|
+
templates: [],
|
|
73
|
+
pipelines: [COMMON_PIPELINE_CONTEXT_ONLY, COMMON_PIPELINE_FEATURE_DEV],
|
|
74
|
+
docs: {
|
|
75
|
+
'overview.md': OVERVIEW_DOC('Angular 21 zoneless', 'CD runs when signals change, inputs update, or events fire — not on every microtask. No NgZone.run / runOutsideAngular. DOM-aware code uses afterNextRender(). HttpClient uses the fetch backend.'),
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
recommendedNextCommands: NG21_NEXT_COMMANDS,
|
|
79
|
+
});
|
|
80
|
+
// ─── 3) Modern control flow + template ergonomics ────────────────────────
|
|
81
|
+
export const ANGULAR_21_CONTROL_FLOW = definePreset({
|
|
82
|
+
id: 'angular-21-control-flow',
|
|
83
|
+
title: 'Angular 21 — modern template control flow',
|
|
84
|
+
description: 'Built-in @if / @for / @switch / @defer / @let blocks instead of *ngIf / *ngFor / [ngSwitch], self-closing component tags, NgOptimizedImage. Includes the migration guidance for legacy templates.',
|
|
85
|
+
tags: [...NG21_TAGS, 'templates', 'control-flow'],
|
|
86
|
+
appliesTo: [WorkspaceProfile.HasAngular],
|
|
87
|
+
weight: 11,
|
|
88
|
+
includes: {
|
|
89
|
+
knowledge: [COMMON_AGENT_BRIEFING],
|
|
90
|
+
rules: [
|
|
91
|
+
COMMON_SAFETY_RULE,
|
|
92
|
+
NG21_CONTROL_FLOW,
|
|
93
|
+
NG21_DEFER,
|
|
94
|
+
NG21_LET_TEMPLATE,
|
|
95
|
+
NG21_SELF_CLOSING_TAGS,
|
|
96
|
+
NG21_NG_OPTIMIZED_IMAGE,
|
|
97
|
+
],
|
|
98
|
+
paths: [ANGULAR_PATH_APP, ANGULAR_PATH_COMPONENTS],
|
|
99
|
+
templates: [],
|
|
100
|
+
pipelines: [COMMON_PIPELINE_CONTEXT_ONLY, COMMON_PIPELINE_FEATURE_DEV],
|
|
101
|
+
docs: {
|
|
102
|
+
'overview.md': OVERVIEW_DOC('Angular 21 control flow', '@if / @for (track is REQUIRED) / @switch / @defer / @let. Self-closing tags for content-less components. NgOptimizedImage with explicit width/height for every raster image.'),
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
recommendedNextCommands: [
|
|
106
|
+
...NG21_NEXT_COMMANDS,
|
|
107
|
+
'ng generate @angular/core:control-flow',
|
|
108
|
+
],
|
|
109
|
+
});
|
|
110
|
+
// ─── 4) Resource API — declarative async (signal-native) ─────────────────
|
|
111
|
+
export const ANGULAR_21_RESOURCE = definePreset({
|
|
112
|
+
id: 'angular-21-resource',
|
|
113
|
+
title: 'Angular 21 — resource() / httpResource() / linkedSignal',
|
|
114
|
+
description: 'Declarative async state via resource() and httpResource(). Replaces the hand-rolled subscribe+loading+error triplet with a typed state machine driven by signals. Includes the linkedSignal pattern for writable derived values.',
|
|
115
|
+
tags: [...NG21_TAGS, 'async', 'resource'],
|
|
116
|
+
appliesTo: [WorkspaceProfile.HasAngular],
|
|
117
|
+
weight: 11,
|
|
118
|
+
includes: {
|
|
119
|
+
knowledge: [COMMON_AGENT_BRIEFING],
|
|
120
|
+
rules: [
|
|
121
|
+
COMMON_SAFETY_RULE,
|
|
122
|
+
NG21_RESOURCE_API,
|
|
123
|
+
NG21_HTTP_RESOURCE,
|
|
124
|
+
NG21_LINKED_SIGNAL,
|
|
125
|
+
NG21_PROVIDE_HTTP_FETCH,
|
|
126
|
+
NG21_SIGNAL_STATE,
|
|
127
|
+
],
|
|
128
|
+
paths: [ANGULAR_PATH_SERVICES, ANGULAR_PATH_APP],
|
|
129
|
+
templates: [],
|
|
130
|
+
pipelines: [COMMON_PIPELINE_CONTEXT_ONLY, COMMON_PIPELINE_FEATURE_DEV],
|
|
131
|
+
docs: {
|
|
132
|
+
'overview.md': OVERVIEW_DOC('Angular 21 resource API', 'resource({ request, loader }) is the canonical async primitive — exposes value()/status()/error()/reload() as signals. httpResource(() => `/api/...`) for read endpoints. linkedSignal for writable state that follows a source.'),
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
recommendedNextCommands: NG21_NEXT_COMMANDS,
|
|
136
|
+
});
|
|
137
|
+
// ─── 5) Modern DI + lifecycle + bootstrap ────────────────────────────────
|
|
138
|
+
export const ANGULAR_21_MODERN_DI = definePreset({
|
|
139
|
+
id: 'angular-21-modern-di',
|
|
140
|
+
title: 'Angular 21 — inject(), no NgModules, bootstrap modern',
|
|
141
|
+
description: 'inject() function over constructor parameters, providedIn root for tree-shakeable services, no new NgModules, bootstrapApplication() with the provideX() function family, afterNextRender() for DOM-aware lifecycle.',
|
|
142
|
+
tags: [...NG21_TAGS, 'di', 'lifecycle', 'bootstrap'],
|
|
143
|
+
appliesTo: [WorkspaceProfile.HasAngular],
|
|
144
|
+
weight: 11,
|
|
145
|
+
includes: {
|
|
146
|
+
knowledge: [COMMON_AGENT_BRIEFING],
|
|
147
|
+
rules: [
|
|
148
|
+
COMMON_SAFETY_RULE,
|
|
149
|
+
NG21_INJECT_FN,
|
|
150
|
+
NG21_PROVIDED_IN_ROOT,
|
|
151
|
+
NG21_NO_NGMODULES,
|
|
152
|
+
NG21_BOOTSTRAP_APPLICATION,
|
|
153
|
+
NG21_AFTER_RENDER,
|
|
154
|
+
NG21_PROVIDE_HTTP_FETCH,
|
|
155
|
+
],
|
|
156
|
+
paths: [ANGULAR_PATH_APP, ANGULAR_PATH_SERVICES],
|
|
157
|
+
templates: [],
|
|
158
|
+
pipelines: [COMMON_PIPELINE_CONTEXT_ONLY, COMMON_PIPELINE_FEATURE_DEV],
|
|
159
|
+
docs: {
|
|
160
|
+
'overview.md': OVERVIEW_DOC('Angular 21 modern DI + bootstrap', 'inject() over constructor injection. @Injectable({ providedIn: "root" }) for tree-shakeable services. No new @NgModule. main.ts uses bootstrapApplication(AppComponent, { providers: [provideRouter, provideHttpClient(withFetch()), provideZonelessChangeDetection(), provideAnimationsAsync()] }).'),
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
recommendedNextCommands: NG21_NEXT_COMMANDS,
|
|
164
|
+
});
|
|
165
|
+
// ─── 6) The whole stack — composes all of the above ──────────────────────
|
|
166
|
+
export const ANGULAR_21_MODERN = definePreset({
|
|
167
|
+
id: 'angular-21-modern',
|
|
168
|
+
title: 'Angular 21 — modern stack (signals + zoneless + control-flow + resource + DI)',
|
|
169
|
+
description: 'The canonical preset for a new Angular 21 app. Composes signals-everything, zoneless CD, modern control flow, resource() async, and inject()-based DI — plus the testing rules for signal inputs and SSR-safe HTTP. Use this unless you specifically want a narrower slice.',
|
|
170
|
+
tags: [...NG21_TAGS, 'comprehensive'],
|
|
171
|
+
appliesTo: [WorkspaceProfile.HasAngular, WorkspaceProfile.IsFrontend],
|
|
172
|
+
weight: 12,
|
|
173
|
+
composes: [
|
|
174
|
+
'angular-21-signals',
|
|
175
|
+
'angular-21-zoneless',
|
|
176
|
+
'angular-21-control-flow',
|
|
177
|
+
'angular-21-resource',
|
|
178
|
+
'angular-21-modern-di',
|
|
179
|
+
],
|
|
180
|
+
includes: {
|
|
181
|
+
knowledge: [COMMON_AGENT_BRIEFING],
|
|
182
|
+
rules: [
|
|
183
|
+
COMMON_SAFETY_RULE,
|
|
184
|
+
// Extras that don't fit into any single focused preset:
|
|
185
|
+
NG21_HYBRID_RENDERING,
|
|
186
|
+
NG21_TEST_SIGNAL_INPUT,
|
|
187
|
+
NG21_TEST_NO_DETECT_CHANGES_OUTSIDE,
|
|
188
|
+
],
|
|
189
|
+
paths: [ANGULAR_PATH_APP, ANGULAR_PATH_COMPONENTS, ANGULAR_PATH_SERVICES],
|
|
190
|
+
templates: [],
|
|
191
|
+
pipelines: [
|
|
192
|
+
COMMON_PIPELINE_CONTEXT_ONLY,
|
|
193
|
+
COMMON_PIPELINE_FEATURE_DEV,
|
|
194
|
+
COMMON_PIPELINE_UNIT_TEST,
|
|
195
|
+
],
|
|
196
|
+
docs: {
|
|
197
|
+
'overview.md': OVERVIEW_DOC('Angular 21 modern stack', 'No decorators where a signal-era function exists. Zoneless CD. @if/@for/@defer/@let templates. resource() and httpResource() for async. inject() everywhere. bootstrapApplication with provideX functions — no NgModules. SSR via per-route RenderMode tags. Test signal inputs via fixture.componentRef.setInput().'),
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
recommendedNextCommands: [
|
|
201
|
+
'shrk doctor',
|
|
202
|
+
'shrk surface list',
|
|
203
|
+
'shrk task "<task>"',
|
|
204
|
+
'ng generate @angular/core:control-flow',
|
|
205
|
+
'ng generate @angular/core:signal-input-migration',
|
|
206
|
+
'ng generate @angular/core:signal-queries-migration',
|
|
207
|
+
'ng generate @angular/core:output-migration',
|
|
208
|
+
],
|
|
209
|
+
surfaceProfile: 'small-app',
|
|
210
|
+
});
|
|
211
|
+
export const ANGULAR_21_PRESETS = Object.freeze([
|
|
212
|
+
ANGULAR_21_SIGNALS,
|
|
213
|
+
ANGULAR_21_ZONELESS,
|
|
214
|
+
ANGULAR_21_CONTROL_FLOW,
|
|
215
|
+
ANGULAR_21_RESOURCE,
|
|
216
|
+
ANGULAR_21_MODERN_DI,
|
|
217
|
+
ANGULAR_21_MODERN,
|
|
218
|
+
]);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const NG21_SIGNAL_STATE: string;
|
|
2
|
+
export declare const NG21_LINKED_SIGNAL: string;
|
|
3
|
+
export declare const NG21_NO_EFFECT_FOR_DERIVED: string;
|
|
4
|
+
export declare const NG21_SIGNAL_VIEW_CHILD: string;
|
|
5
|
+
export declare const NG21_SIGNAL_CONTENT_CHILD: string;
|
|
6
|
+
export declare const NG21_SIGNAL_INPUTS: string;
|
|
7
|
+
export declare const NG21_SIGNAL_OUTPUTS: string;
|
|
8
|
+
export declare const NG21_MODEL_TWO_WAY: string;
|
|
9
|
+
export declare const NG21_ZONELESS: string;
|
|
10
|
+
export declare const NG21_NO_ZONE_APIS: string;
|
|
11
|
+
export declare const NG21_CONTROL_FLOW: string;
|
|
12
|
+
export declare const NG21_DEFER: string;
|
|
13
|
+
export declare const NG21_LET_TEMPLATE: string;
|
|
14
|
+
export declare const NG21_SELF_CLOSING_TAGS: string;
|
|
15
|
+
export declare const NG21_NG_OPTIMIZED_IMAGE: string;
|
|
16
|
+
export declare const NG21_INJECT_FN: string;
|
|
17
|
+
export declare const NG21_AFTER_RENDER: string;
|
|
18
|
+
export declare const NG21_PROVIDED_IN_ROOT: string;
|
|
19
|
+
export declare const NG21_NO_NGMODULES: string;
|
|
20
|
+
export declare const NG21_BOOTSTRAP_APPLICATION: string;
|
|
21
|
+
export declare const NG21_RESOURCE_API: string;
|
|
22
|
+
export declare const NG21_HTTP_RESOURCE: string;
|
|
23
|
+
export declare const NG21_HYBRID_RENDERING: string;
|
|
24
|
+
export declare const NG21_PROVIDE_HTTP_FETCH: string;
|
|
25
|
+
export declare const NG21_SIGNAL_FORMS_INTEROP: string;
|
|
26
|
+
export declare const NG21_TEST_SIGNAL_INPUT: string;
|
|
27
|
+
export declare const NG21_TEST_NO_DETECT_CHANGES_OUTSIDE: string;
|
|
28
|
+
//# sourceMappingURL=angular21-snippets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"angular21-snippets.d.ts","sourceRoot":"","sources":["../../src/builtin/angular21-snippets.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,iBAAiB,QAQ5B,CAAC;AAEH,eAAO,MAAM,kBAAkB,QAQ7B,CAAC;AAEH,eAAO,MAAM,0BAA0B,QAQrC,CAAC;AAIH,eAAO,MAAM,sBAAsB,QAQjC,CAAC;AAEH,eAAO,MAAM,yBAAyB,QAQpC,CAAC;AAIH,eAAO,MAAM,kBAAkB,QAQ7B,CAAC;AAEH,eAAO,MAAM,mBAAmB,QAQ9B,CAAC;AAEH,eAAO,MAAM,kBAAkB,QAQ7B,CAAC;AAIH,eAAO,MAAM,aAAa,QAQxB,CAAC;AAEH,eAAO,MAAM,iBAAiB,QAQ5B,CAAC;AAIH,eAAO,MAAM,iBAAiB,QAQ5B,CAAC;AAEH,eAAO,MAAM,UAAU,QAQrB,CAAC;AAEH,eAAO,MAAM,iBAAiB,QAQ5B,CAAC;AAEH,eAAO,MAAM,sBAAsB,QAQjC,CAAC;AAEH,eAAO,MAAM,uBAAuB,QAQlC,CAAC;AAIH,eAAO,MAAM,cAAc,QAQzB,CAAC;AAEH,eAAO,MAAM,iBAAiB,QAQ5B,CAAC;AAEH,eAAO,MAAM,qBAAqB,QAQhC,CAAC;AAIH,eAAO,MAAM,iBAAiB,QAQ5B,CAAC;AAEH,eAAO,MAAM,0BAA0B,QAQrC,CAAC;AAIH,eAAO,MAAM,iBAAiB,QAQ5B,CAAC;AAEH,eAAO,MAAM,kBAAkB,QAQ7B,CAAC;AAIH,eAAO,MAAM,qBAAqB,QAQhC,CAAC;AAEH,eAAO,MAAM,uBAAuB,QAQlC,CAAC;AAIH,eAAO,MAAM,yBAAyB,QAQpC,CAAC;AAIH,eAAO,MAAM,sBAAsB,QAQjC,CAAC;AAEH,eAAO,MAAM,mCAAmC,QAQ9C,CAAC"}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
// Modern Angular 18 / 19 / 20 / 21 rule snippets.
|
|
2
|
+
//
|
|
3
|
+
// Covers the post-decorators wave: signal-based reactivity, signal-based
|
|
4
|
+
// queries (`viewChild()` / `contentChild()` etc.), signal-based I/O
|
|
5
|
+
// (`input()` / `output()` / `model()`), zoneless change detection, the new
|
|
6
|
+
// template control flow (`@if` / `@for` / `@switch` / `@defer` / `@let`),
|
|
7
|
+
// `inject()` over constructor DI, `afterRender` / `afterNextRender`,
|
|
8
|
+
// `resource()` / `httpResource()`, `linkedSignal`, `NgOptimizedImage`,
|
|
9
|
+
// self-closing component tags, and the no-NgModules / hybrid-rendering
|
|
10
|
+
// posture.
|
|
11
|
+
//
|
|
12
|
+
// Each snippet is a string injected verbatim into a generated
|
|
13
|
+
// `sharkcraft/*.ts` file; `defineKnowledgeEntry`, `KnowledgeType`, and
|
|
14
|
+
// `KnowledgePriority` are provided by the local-mirror preamble the
|
|
15
|
+
// synthesizer prepends.
|
|
16
|
+
import { ruleSnippet } from "./r26-snippets.js";
|
|
17
|
+
// ─── Signal-based reactivity (Angular 16+, fully baked by 19/20) ──────────
|
|
18
|
+
export const NG21_SIGNAL_STATE = ruleSnippet({
|
|
19
|
+
id: 'angular21.signal-state',
|
|
20
|
+
title: 'Local component state lives in signals',
|
|
21
|
+
priority: 'critical',
|
|
22
|
+
tags: ['angular', 'angular-21', 'signals'],
|
|
23
|
+
appliesWhen: ['generate-component', 'generate-code'],
|
|
24
|
+
content: 'Use signal() for every piece of component-local mutable state. Derive read-only values with computed(). Reserve effect() for side effects only (DOM imperative code, logging, external I/O) — never write to a signal from inside an effect.',
|
|
25
|
+
});
|
|
26
|
+
export const NG21_LINKED_SIGNAL = ruleSnippet({
|
|
27
|
+
id: 'angular21.linked-signal',
|
|
28
|
+
title: 'Use linkedSignal for writable derived state',
|
|
29
|
+
priority: 'high',
|
|
30
|
+
tags: ['angular', 'angular-21', 'signals'],
|
|
31
|
+
appliesWhen: ['generate-component', 'refactor'],
|
|
32
|
+
content: 'When you need a writable signal that resets whenever a source signal changes (e.g. a selection that follows a filtered list), use linkedSignal({ source, computation }) instead of an effect that pokes a writable signal — that pattern is officially discouraged.',
|
|
33
|
+
});
|
|
34
|
+
export const NG21_NO_EFFECT_FOR_DERIVED = ruleSnippet({
|
|
35
|
+
id: 'angular21.no-effect-for-derived',
|
|
36
|
+
title: 'Never derive state inside an effect()',
|
|
37
|
+
priority: 'critical',
|
|
38
|
+
tags: ['angular', 'angular-21', 'signals'],
|
|
39
|
+
appliesWhen: ['generate-code', 'review'],
|
|
40
|
+
content: 'If you find yourself writing effect(() => mySignal.set(compute(otherSignal()))), switch to computed() or linkedSignal(). Writing inside effects breaks single-source-of-truth and reintroduces the very glitches signals were designed to remove.',
|
|
41
|
+
});
|
|
42
|
+
// ─── Signal-based queries (Angular 17.2+) ─────────────────────────────────
|
|
43
|
+
export const NG21_SIGNAL_VIEW_CHILD = ruleSnippet({
|
|
44
|
+
id: 'angular21.signal-view-child',
|
|
45
|
+
title: 'Use viewChild() / viewChildren() functions, not @ViewChild',
|
|
46
|
+
priority: 'critical',
|
|
47
|
+
tags: ['angular', 'angular-21', 'queries', 'signals'],
|
|
48
|
+
appliesWhen: ['generate-component', 'refactor'],
|
|
49
|
+
content: 'Replace @ViewChild and @ViewChildren with the viewChild() / viewChildren() functions. The signal form is reactive (you can pipe it through computed()/effect()), avoids the "expression has changed after it was checked" class of bug, and integrates with OnPush + zoneless out of the box. Use viewChild.required<ElementRef>("name") when the element is guaranteed.',
|
|
50
|
+
});
|
|
51
|
+
export const NG21_SIGNAL_CONTENT_CHILD = ruleSnippet({
|
|
52
|
+
id: 'angular21.signal-content-child',
|
|
53
|
+
title: 'Use contentChild() / contentChildren() functions, not @ContentChild',
|
|
54
|
+
priority: 'critical',
|
|
55
|
+
tags: ['angular', 'angular-21', 'queries', 'signals'],
|
|
56
|
+
appliesWhen: ['generate-component', 'refactor'],
|
|
57
|
+
content: 'Replace @ContentChild and @ContentChildren with the contentChild() / contentChildren() functions. Same reactivity story as viewChild — and contentChild() resolves at the same lifecycle moment regardless of static/dynamic, so you no longer need the {static: true} workaround.',
|
|
58
|
+
});
|
|
59
|
+
// ─── Signal-based inputs / outputs (Angular 17.1+ / 17.3+) ───────────────
|
|
60
|
+
export const NG21_SIGNAL_INPUTS = ruleSnippet({
|
|
61
|
+
id: 'angular21.signal-inputs',
|
|
62
|
+
title: 'Use input() and input.required(), not @Input()',
|
|
63
|
+
priority: 'critical',
|
|
64
|
+
tags: ['angular', 'angular-21', 'inputs', 'signals'],
|
|
65
|
+
appliesWhen: ['generate-component', 'refactor'],
|
|
66
|
+
content: 'Declare inputs as `readonly user = input<User>()` or `readonly id = input.required<string>()` instead of @Input(). Signal inputs are read-only signals — call them as a function in the template (`{{ user() }}`) or pipe them through computed() in the class. Use the transform option for coerced inputs: `input(false, { transform: booleanAttribute })`.',
|
|
67
|
+
});
|
|
68
|
+
export const NG21_SIGNAL_OUTPUTS = ruleSnippet({
|
|
69
|
+
id: 'angular21.signal-outputs',
|
|
70
|
+
title: 'Use output(), not @Output() EventEmitter',
|
|
71
|
+
priority: 'critical',
|
|
72
|
+
tags: ['angular', 'angular-21', 'outputs', 'signals'],
|
|
73
|
+
appliesWhen: ['generate-component', 'refactor'],
|
|
74
|
+
content: 'Declare outputs as `readonly select = output<UserId>()` instead of `@Output() select = new EventEmitter<UserId>()`. The output() helper drops the RxJS dependency, is fully typed, and emits via `this.select.emit(id)`. It still composes with `outputToObservable()` when a stream is needed.',
|
|
75
|
+
});
|
|
76
|
+
export const NG21_MODEL_TWO_WAY = ruleSnippet({
|
|
77
|
+
id: 'angular21.model-two-way',
|
|
78
|
+
title: 'Use model() for two-way bindings',
|
|
79
|
+
priority: 'high',
|
|
80
|
+
tags: ['angular', 'angular-21', 'inputs', 'outputs', 'signals'],
|
|
81
|
+
appliesWhen: ['generate-component'],
|
|
82
|
+
content: 'For components that own a piece of state the parent wants to bind two-way, use `readonly value = model<string>("")`. Banana-in-a-box syntax (`[(value)]="x"`) wires up automatically — no manual @Input + @Output pair, no `valueChange` EventEmitter.',
|
|
83
|
+
});
|
|
84
|
+
// ─── Zoneless change detection (stable in Angular 21) ─────────────────────
|
|
85
|
+
export const NG21_ZONELESS = ruleSnippet({
|
|
86
|
+
id: 'angular21.zoneless',
|
|
87
|
+
title: 'Configure zoneless change detection',
|
|
88
|
+
priority: 'critical',
|
|
89
|
+
tags: ['angular', 'angular-21', 'zoneless', 'performance'],
|
|
90
|
+
appliesWhen: ['bootstrap', 'configure'],
|
|
91
|
+
content: 'Bootstrap with provideZonelessChangeDetection() and remove `zone.js` from polyfills + angular.json. Once zoneless, change detection runs only when a signal changes, an input updates, an event handler fires, or a marked component opts in via markForCheck(). Verify by reading the platform: ApplicationRef.componentTypes should not include any zone-aware regressions.',
|
|
92
|
+
});
|
|
93
|
+
export const NG21_NO_ZONE_APIS = ruleSnippet({
|
|
94
|
+
id: 'angular21.no-zone-apis',
|
|
95
|
+
title: 'Do not call NgZone APIs in zoneless code',
|
|
96
|
+
priority: 'high',
|
|
97
|
+
tags: ['angular', 'angular-21', 'zoneless'],
|
|
98
|
+
appliesWhen: ['generate-code', 'review'],
|
|
99
|
+
content: 'In zoneless apps NgZone.run / runOutsideAngular are no-ops. Replace them with explicit ChangeDetectorRef.markForCheck() (rare), afterNextRender() for DOM-aware logic, or simply let the signal graph propagate.',
|
|
100
|
+
});
|
|
101
|
+
// ─── New template control flow (Angular 17+) ──────────────────────────────
|
|
102
|
+
export const NG21_CONTROL_FLOW = ruleSnippet({
|
|
103
|
+
id: 'angular21.control-flow',
|
|
104
|
+
title: 'Use @if / @for / @switch, not *ngIf / *ngFor / [ngSwitch]',
|
|
105
|
+
priority: 'critical',
|
|
106
|
+
tags: ['angular', 'angular-21', 'templates'],
|
|
107
|
+
appliesWhen: ['generate-template', 'refactor'],
|
|
108
|
+
content: 'Built-in control flow is the canonical form. `@if`, `@else if`, `@else`; `@for (item of items; track item.id)` — track is REQUIRED, not optional; `@switch (x) { @case (\'a\') { … } @default { … } }`. Migrate legacy structural directives with `ng generate @angular/core:control-flow`.',
|
|
109
|
+
});
|
|
110
|
+
export const NG21_DEFER = ruleSnippet({
|
|
111
|
+
id: 'angular21.defer',
|
|
112
|
+
title: 'Use @defer for non-critical UI',
|
|
113
|
+
priority: 'high',
|
|
114
|
+
tags: ['angular', 'angular-21', 'templates', 'performance'],
|
|
115
|
+
appliesWhen: ['generate-template', 'optimize-bundle'],
|
|
116
|
+
content: 'Wrap heavy, below-the-fold, or interaction-gated UI in `@defer (on viewport)` / `(on hover)` / `(on idle)` / `(when condition())`. Pair with `@placeholder`, `@loading`, and `@error` blocks. Each @defer block is its own lazy-loaded chunk — no manual `loadComponent` plumbing needed.',
|
|
117
|
+
});
|
|
118
|
+
export const NG21_LET_TEMPLATE = ruleSnippet({
|
|
119
|
+
id: 'angular21.let-template',
|
|
120
|
+
title: 'Use @let for template-local values',
|
|
121
|
+
priority: 'medium',
|
|
122
|
+
tags: ['angular', 'angular-21', 'templates'],
|
|
123
|
+
appliesWhen: ['generate-template'],
|
|
124
|
+
content: 'Introduce template-scoped names with `@let total = items().reduce(...)`. This replaces the `*ngIf="x as y"` aliasing trick — works anywhere in the template, no implicit-element baggage.',
|
|
125
|
+
});
|
|
126
|
+
export const NG21_SELF_CLOSING_TAGS = ruleSnippet({
|
|
127
|
+
id: 'angular21.self-closing-tags',
|
|
128
|
+
title: 'Self-close components with no content children',
|
|
129
|
+
priority: 'low',
|
|
130
|
+
tags: ['angular', 'angular-21', 'templates'],
|
|
131
|
+
appliesWhen: ['generate-template'],
|
|
132
|
+
content: 'Components / directives that take no projected content should be written `<app-foo [x]="y" />`, not `<app-foo …></app-foo>`. Saves a token and matches modern Angular / JSX conventions.',
|
|
133
|
+
});
|
|
134
|
+
export const NG21_NG_OPTIMIZED_IMAGE = ruleSnippet({
|
|
135
|
+
id: 'angular21.ng-optimized-image',
|
|
136
|
+
title: 'Use NgOptimizedImage for raster images',
|
|
137
|
+
priority: 'high',
|
|
138
|
+
tags: ['angular', 'angular-21', 'performance', 'a11y'],
|
|
139
|
+
appliesWhen: ['generate-template'],
|
|
140
|
+
content: 'Replace `<img src="...">` with `<img ngSrc="..." width="…" height="…" priority? />`. NgOptimizedImage adds automatic responsive `srcset`, lazy-loads non-priority images, sets fetchpriority on LCP images, and enforces explicit dimensions to prevent layout shift.',
|
|
141
|
+
});
|
|
142
|
+
// ─── inject(), afterRender, modern lifecycle (Angular 14+ / 16+) ──────────
|
|
143
|
+
export const NG21_INJECT_FN = ruleSnippet({
|
|
144
|
+
id: 'angular21.inject-fn',
|
|
145
|
+
title: 'Use inject(), not constructor parameters',
|
|
146
|
+
priority: 'high',
|
|
147
|
+
tags: ['angular', 'angular-21', 'di'],
|
|
148
|
+
appliesWhen: ['generate-component', 'generate-service', 'refactor'],
|
|
149
|
+
content: 'Default to `private readonly users = inject(UsersService)` over constructor-parameter injection. Required for functional guards / interceptors, makes inheritance straightforward, and removes the need for `@Self()` / `@SkipSelf()` / `@Optional()` decorator stacks (use the options bag instead).',
|
|
150
|
+
});
|
|
151
|
+
export const NG21_AFTER_RENDER = ruleSnippet({
|
|
152
|
+
id: 'angular21.after-render',
|
|
153
|
+
title: 'Use afterNextRender / afterRender for DOM-aware logic',
|
|
154
|
+
priority: 'high',
|
|
155
|
+
tags: ['angular', 'angular-21', 'lifecycle'],
|
|
156
|
+
appliesWhen: ['generate-component'],
|
|
157
|
+
content: 'For code that needs the DOM (measuring, focusing, third-party libs): use afterNextRender(() => …) for one-shot setup or afterRender(() => …) for every CD pass. Both run only in the browser, so they\'re SSR-safe by construction — replacing the ngAfterViewInit + isPlatformBrowser dance.',
|
|
158
|
+
});
|
|
159
|
+
export const NG21_PROVIDED_IN_ROOT = ruleSnippet({
|
|
160
|
+
id: 'angular21.provided-in-root',
|
|
161
|
+
title: 'Services use providedIn: \'root\' (tree-shakeable)',
|
|
162
|
+
priority: 'high',
|
|
163
|
+
tags: ['angular', 'angular-21', 'di', 'services'],
|
|
164
|
+
appliesWhen: ['generate-service'],
|
|
165
|
+
content: 'Inject services via `@Injectable({ providedIn: "root" })` so unused services tree-shake out. Only override with component / route providers when you need a fresh instance per consumer.',
|
|
166
|
+
});
|
|
167
|
+
// ─── No NgModules / standalone-only ───────────────────────────────────────
|
|
168
|
+
export const NG21_NO_NGMODULES = ruleSnippet({
|
|
169
|
+
id: 'angular21.no-ngmodules',
|
|
170
|
+
title: 'Do not create new NgModules',
|
|
171
|
+
priority: 'critical',
|
|
172
|
+
tags: ['angular', 'angular-21', 'architecture'],
|
|
173
|
+
appliesWhen: ['generate-code', 'create-feature'],
|
|
174
|
+
content: 'Angular 21 starter apps are NgModule-free. Components, directives, and pipes are standalone by default (the `standalone: true` flag is the default since v19). Configure providers via `provideX()` functions in bootstrapApplication() or route data, never with @NgModule. If you find yourself writing @NgModule, you are working against the grain.',
|
|
175
|
+
});
|
|
176
|
+
export const NG21_BOOTSTRAP_APPLICATION = ruleSnippet({
|
|
177
|
+
id: 'angular21.bootstrap-application',
|
|
178
|
+
title: 'bootstrap via bootstrapApplication + provideX functions',
|
|
179
|
+
priority: 'high',
|
|
180
|
+
tags: ['angular', 'angular-21', 'bootstrap'],
|
|
181
|
+
appliesWhen: ['bootstrap'],
|
|
182
|
+
content: 'main.ts uses bootstrapApplication(AppComponent, { providers: [provideRouter(routes), provideHttpClient(withFetch()), provideZonelessChangeDetection(), provideAnimationsAsync()] }). Each capability has a provideX() — no AppModule needed.',
|
|
183
|
+
});
|
|
184
|
+
// ─── Async data: resource() / httpResource() (Angular 19/20+) ────────────
|
|
185
|
+
export const NG21_RESOURCE_API = ruleSnippet({
|
|
186
|
+
id: 'angular21.resource-api',
|
|
187
|
+
title: 'Model async state with resource()',
|
|
188
|
+
priority: 'high',
|
|
189
|
+
tags: ['angular', 'angular-21', 'async', 'signals'],
|
|
190
|
+
appliesWhen: ['generate-component', 'generate-service'],
|
|
191
|
+
content: 'For "fetch X based on signal Y" patterns, use resource({ request: () => y(), loader: ({ request, abortSignal }) => fetch(...) }). The resource exposes `.value()`, `.status()`, `.error()`, and `.reload()` — a fully-typed state machine driven by signals. Don\'t hand-roll subscription + loading-state + error-state triplets anymore.',
|
|
192
|
+
});
|
|
193
|
+
export const NG21_HTTP_RESOURCE = ruleSnippet({
|
|
194
|
+
id: 'angular21.http-resource',
|
|
195
|
+
title: 'Use httpResource() for declarative HTTP',
|
|
196
|
+
priority: 'high',
|
|
197
|
+
tags: ['angular', 'angular-21', 'http', 'signals'],
|
|
198
|
+
appliesWhen: ['generate-service'],
|
|
199
|
+
content: 'For straight reads, `const user = httpResource<User>(() => \\`/api/users/${id()}\\`)` replaces an HttpClient.get + BehaviorSubject + loading flag triple. The signal in the URL closure is tracked; updating it refetches.',
|
|
200
|
+
});
|
|
201
|
+
// ─── Modern SSR / hybrid rendering (Angular 19+) ─────────────────────────
|
|
202
|
+
export const NG21_HYBRID_RENDERING = ruleSnippet({
|
|
203
|
+
id: 'angular21.hybrid-rendering',
|
|
204
|
+
title: 'Configure routes with server-rendering modes',
|
|
205
|
+
priority: 'medium',
|
|
206
|
+
tags: ['angular', 'angular-21', 'ssr'],
|
|
207
|
+
appliesWhen: ['configure-routes'],
|
|
208
|
+
content: 'In app.routes.server.ts, tag each route with a RenderMode: `Prerender` for static, `Server` for per-request SSR, `Client` for CSR-only. The default `provideServerRouting(serverRoutes)` enforces the boundary — no more "did this code accidentally run on the server?" guesswork.',
|
|
209
|
+
});
|
|
210
|
+
export const NG21_PROVIDE_HTTP_FETCH = ruleSnippet({
|
|
211
|
+
id: 'angular21.provide-http-fetch',
|
|
212
|
+
title: 'provideHttpClient(withFetch()) — never the XHR backend',
|
|
213
|
+
priority: 'high',
|
|
214
|
+
tags: ['angular', 'angular-21', 'http', 'ssr'],
|
|
215
|
+
appliesWhen: ['configure'],
|
|
216
|
+
content: 'Provide HttpClient with the fetch backend (`provideHttpClient(withFetch())`). XHR breaks under SSR and pays a startup cost; fetch is universal, supports streaming, and is required for resource transfer between server and client.',
|
|
217
|
+
});
|
|
218
|
+
// ─── Forms — modern signal-compatible patterns ───────────────────────────
|
|
219
|
+
export const NG21_SIGNAL_FORMS_INTEROP = ruleSnippet({
|
|
220
|
+
id: 'angular21.signal-forms-interop',
|
|
221
|
+
title: 'Bridge reactive forms into signals with toSignal()',
|
|
222
|
+
priority: 'medium',
|
|
223
|
+
tags: ['angular', 'angular-21', 'forms', 'signals'],
|
|
224
|
+
appliesWhen: ['generate-component'],
|
|
225
|
+
content: 'When you need a form value as a signal, do `const value = toSignal(form.valueChanges, { initialValue: form.getRawValue() })`. Don\'t mix .subscribe() into a component that otherwise relies on signal-driven CD — that subscription will leak.',
|
|
226
|
+
});
|
|
227
|
+
// ─── Testing — modern flow ───────────────────────────────────────────────
|
|
228
|
+
export const NG21_TEST_SIGNAL_INPUT = ruleSnippet({
|
|
229
|
+
id: 'angular21.test-signal-input',
|
|
230
|
+
title: 'Set signal inputs in tests via setInput()',
|
|
231
|
+
priority: 'medium',
|
|
232
|
+
tags: ['angular', 'angular-21', 'testing'],
|
|
233
|
+
appliesWhen: ['generate-test'],
|
|
234
|
+
content: 'In TestBed, set signal-input values with `fixture.componentRef.setInput("user", u)` — not by assigning `component.user`. Detection runs only when the input signal is updated, and setInput is the supported path that triggers it.',
|
|
235
|
+
});
|
|
236
|
+
export const NG21_TEST_NO_DETECT_CHANGES_OUTSIDE = ruleSnippet({
|
|
237
|
+
id: 'angular21.test-no-detect-changes-outside',
|
|
238
|
+
title: 'Let the framework drive CD in tests',
|
|
239
|
+
priority: 'low',
|
|
240
|
+
tags: ['angular', 'angular-21', 'testing'],
|
|
241
|
+
appliesWhen: ['generate-test'],
|
|
242
|
+
content: 'In zoneless tests, call `fixture.detectChanges()` only at deliberate "settle" points; signal updates inside the test run schedule the next CD automatically. Sprinkling detectChanges() after every assignment masks real reactivity bugs.',
|
|
243
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtin-presets.d.ts","sourceRoot":"","sources":["../../src/builtin/builtin-presets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"builtin-presets.d.ts","sourceRoot":"","sources":["../../src/builtin/builtin-presets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AA8jBlD,eAAO,MAAM,eAAe,EAAE,SAAS,OAAO,EA4C5C,CAAC"}
|