@shrkcrft/presets 0.1.0-alpha.7 → 0.1.0-alpha.9
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/README.md +1 -1
- package/dist/builtin/builtin-presets.d.ts.map +1 -1
- package/dist/builtin/builtin-presets.js +9 -30
- package/dist/builtin/r26-presets.d.ts.map +1 -1
- package/dist/builtin/r26-presets.js +3 -3
- package/dist/builtin/r45-presets.d.ts.map +1 -1
- package/dist/builtin/r45-presets.js +3 -3
- package/dist/builtin/r47-presets.d.ts.map +1 -1
- package/dist/builtin/r47-presets.js +3 -3
- package/dist/builtin/shared-snippets.d.ts +3 -25
- package/dist/builtin/shared-snippets.d.ts.map +1 -1
- package/dist/builtin/shared-snippets.js +0 -265
- package/dist/emit/synthesize-files.d.ts.map +1 -1
- package/dist/emit/synthesize-files.js +17 -76
- package/package.json +8 -9
- package/dist/builtin/angular21-presets.d.ts +0 -9
- package/dist/builtin/angular21-presets.d.ts.map +0 -1
- package/dist/builtin/angular21-presets.js +0 -218
- package/dist/builtin/angular21-snippets.d.ts +0 -28
- package/dist/builtin/angular21-snippets.d.ts.map +0 -1
- package/dist/builtin/angular21-snippets.js +0 -243
- package/dist/builtin/nest11-presets.d.ts +0 -11
- package/dist/builtin/nest11-presets.d.ts.map +0 -1
- package/dist/builtin/nest11-presets.js +0 -257
- package/dist/builtin/nest11-snippets.d.ts +0 -32
- package/dist/builtin/nest11-snippets.d.ts.map +0 -1
- package/dist/builtin/nest11-snippets.js +0 -270
- package/dist/builtin/react19-presets.d.ts +0 -12
- package/dist/builtin/react19-presets.d.ts.map +0 -1
- package/dist/builtin/react19-presets.js +0 -299
- package/dist/builtin/react19-snippets.d.ts +0 -43
- package/dist/builtin/react19-snippets.d.ts.map +0 -1
- package/dist/builtin/react19-snippets.js +0 -363
|
@@ -1,62 +1,3 @@
|
|
|
1
|
-
// Self-contained preambles for each emitted file kind. Generated files
|
|
2
|
-
// must work in a brand-new downstream repo where no `@shrkcrft/*`
|
|
3
|
-
// packages are installed. The loaders (knowledge / templates / pipelines)
|
|
4
|
-
// are shape-agnostic — they accept any object with the required string
|
|
5
|
-
// fields — so we just need helpers + enum-like constants the snippets
|
|
6
|
-
// reference. See `packages/knowledge/src/load/typescript-knowledge-loader.ts`
|
|
7
|
-
// for the loader contract.
|
|
8
|
-
const KNOWLEDGE_HELPERS = `// Local helpers — keep this file self-contained (no @shrkcrft/* imports).
|
|
9
|
-
const KnowledgePriority = {
|
|
10
|
-
Critical: 'critical',
|
|
11
|
-
High: 'high',
|
|
12
|
-
Medium: 'medium',
|
|
13
|
-
Low: 'low',
|
|
14
|
-
} as const;
|
|
15
|
-
|
|
16
|
-
const KnowledgeType = {
|
|
17
|
-
Rule: 'rule',
|
|
18
|
-
Path: 'path',
|
|
19
|
-
Template: 'template',
|
|
20
|
-
Architecture: 'architecture',
|
|
21
|
-
Technical: 'technical',
|
|
22
|
-
Business: 'business',
|
|
23
|
-
Command: 'command',
|
|
24
|
-
Environment: 'environment',
|
|
25
|
-
Dependency: 'dependency',
|
|
26
|
-
Feature: 'feature',
|
|
27
|
-
Task: 'task',
|
|
28
|
-
Warning: 'warning',
|
|
29
|
-
Decision: 'decision',
|
|
30
|
-
Convention: 'convention',
|
|
31
|
-
Workflow: 'workflow',
|
|
32
|
-
Testing: 'testing',
|
|
33
|
-
Security: 'security',
|
|
34
|
-
Deployment: 'deployment',
|
|
35
|
-
Integration: 'integration',
|
|
36
|
-
Custom: 'custom',
|
|
37
|
-
} as const;
|
|
38
|
-
|
|
39
|
-
function defineKnowledgeEntry<T>(entry: T): T {
|
|
40
|
-
return entry;
|
|
41
|
-
}
|
|
42
|
-
`;
|
|
43
|
-
const TEMPLATE_HELPERS = `// Local helpers — keep this file self-contained (no @shrkcrft/* imports).
|
|
44
|
-
function defineTemplate<T>(template: T): T {
|
|
45
|
-
return template;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function kebab(s: string): string {
|
|
49
|
-
return s
|
|
50
|
-
.replace(/([a-z0-9])([A-Z])/g, '$1-$2')
|
|
51
|
-
.replace(/[^A-Za-z0-9]+/g, '-')
|
|
52
|
-
.toLowerCase();
|
|
53
|
-
}
|
|
54
|
-
`;
|
|
55
|
-
const PIPELINE_HELPERS = `// Local helpers — keep this file self-contained (no @shrkcrft/* imports).
|
|
56
|
-
function definePipeline<T>(pipeline: T): T {
|
|
57
|
-
return pipeline;
|
|
58
|
-
}
|
|
59
|
-
`;
|
|
60
1
|
function recordToMap(v) {
|
|
61
2
|
if (!v)
|
|
62
3
|
return new Map();
|
|
@@ -70,47 +11,48 @@ function listBlock(items, indent = ' ') {
|
|
|
70
11
|
return items.map((expr) => indent + expr.replace(/\n/g, `\n${indent}`)).join(',\n') + ',\n';
|
|
71
12
|
}
|
|
72
13
|
function knowledgeFile(items) {
|
|
73
|
-
return (
|
|
74
|
-
'
|
|
14
|
+
return ("import { defineKnowledgeEntry, KnowledgePriority, KnowledgeType } from '@shrkcrft/knowledge';\n\n" +
|
|
15
|
+
'const knowledge = [\n' +
|
|
75
16
|
listBlock(items) +
|
|
76
17
|
'];\n\n' +
|
|
77
18
|
'export default knowledge;\n');
|
|
78
19
|
}
|
|
79
20
|
function rulesFile(items) {
|
|
80
|
-
return (
|
|
81
|
-
'
|
|
21
|
+
return ("import { defineKnowledgeEntry, KnowledgePriority, KnowledgeType } from '@shrkcrft/knowledge';\n\n" +
|
|
22
|
+
'const rules = [\n' +
|
|
82
23
|
listBlock(items) +
|
|
83
24
|
'];\n\n' +
|
|
84
25
|
'export default rules;\n');
|
|
85
26
|
}
|
|
86
27
|
function pathsFile(items) {
|
|
87
|
-
return (
|
|
88
|
-
'
|
|
28
|
+
return ("import { defineKnowledgeEntry, KnowledgePriority, KnowledgeType } from '@shrkcrft/knowledge';\n\n" +
|
|
29
|
+
'const paths = [\n' +
|
|
89
30
|
listBlock(items) +
|
|
90
31
|
'];\n\n' +
|
|
91
32
|
'export default paths;\n');
|
|
92
33
|
}
|
|
93
34
|
function templatesFile(items) {
|
|
94
|
-
|
|
95
|
-
|
|
35
|
+
// Inject a small kebab helper so template content() closures can use it.
|
|
36
|
+
// Generated code is self-contained — no extra runtime dependency required.
|
|
37
|
+
return ("import { defineTemplate } from '@shrkcrft/templates';\n\n" +
|
|
38
|
+
'function kebab(s: string): string {\n' +
|
|
39
|
+
" return s.replace(/([a-z0-9])([A-Z])/g, '$1-$2').replace(/[^A-Za-z0-9]+/g, '-').toLowerCase();\n" +
|
|
40
|
+
'}\n\n' +
|
|
41
|
+
'const templates = [\n' +
|
|
96
42
|
listBlock(items) +
|
|
97
43
|
'];\n\n' +
|
|
98
44
|
'export default templates;\n');
|
|
99
45
|
}
|
|
100
46
|
function pipelinesFile(items) {
|
|
101
|
-
return (
|
|
102
|
-
'
|
|
47
|
+
return ("import { definePipeline } from '@shrkcrft/pipelines';\n\n" +
|
|
48
|
+
'const pipelines = [\n' +
|
|
103
49
|
listBlock(items) +
|
|
104
50
|
'];\n\n' +
|
|
105
51
|
'export default pipelines;\n');
|
|
106
52
|
}
|
|
107
53
|
function configFile(preset) {
|
|
108
54
|
// Generic config that points at the standard knowledge/rules/paths/etc.
|
|
109
|
-
// files. Consumers can tailor it later.
|
|
110
|
-
// the config loader (packages/config/src/config-loader.ts) validates the
|
|
111
|
-
// shape via zod and accepts an object literal as well as a
|
|
112
|
-
// `defineSharkCraftConfig()`-wrapped value, so the generated file does
|
|
113
|
-
// not need to import anything from `@shrkcrft/*`.
|
|
55
|
+
// files. Consumers can tailor it later.
|
|
114
56
|
const filesByKind = inferFiles(preset);
|
|
115
57
|
const knowledgeFiles = filesByKind.has('knowledge.ts') ? ['knowledge.ts'] : [];
|
|
116
58
|
const ruleFiles = filesByKind.has('rules.ts') ? ['rules.ts'] : [];
|
|
@@ -125,8 +67,7 @@ function configFile(preset) {
|
|
|
125
67
|
? ` surface: { profile: ${JSON.stringify(preset.surfaceProfile)} },\n`
|
|
126
68
|
: '';
|
|
127
69
|
return (`// Generated by \`shrk presets apply ${preset.id}\`.\n` +
|
|
128
|
-
'// Edit freely. SharkCraft does not regenerate this file.\n' +
|
|
129
|
-
'// Plain default export — no @shrkcrft/* import required.\n\n' +
|
|
70
|
+
'// Edit freely. SharkCraft does not regenerate this file.\n\n' +
|
|
130
71
|
'const config = {\n' +
|
|
131
72
|
` projectName: 'shrk-project',\n` +
|
|
132
73
|
` description: ${JSON.stringify(preset.description)},\n` +
|
package/package.json
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shrkcrft/presets",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.9",
|
|
4
4
|
"description": "SharkCraft presets: reusable project setups (knowledge/rules/paths/templates/pipelines/docs) that can be applied to a target repo through the CLI.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "SharkCraft contributors",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./dist/index.js",
|
|
9
|
-
"types": "./dist/index.d.
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
|
-
"bun": "./src/index.ts",
|
|
14
13
|
"import": "./dist/index.js",
|
|
15
14
|
"default": "./dist/index.js"
|
|
16
15
|
}
|
|
@@ -22,12 +21,12 @@
|
|
|
22
21
|
],
|
|
23
22
|
"repository": {
|
|
24
23
|
"type": "git",
|
|
25
|
-
"url": "git+https://github.com/
|
|
24
|
+
"url": "git+https://github.com/sharkcraft/sharkcraft.git",
|
|
26
25
|
"directory": "packages/presets"
|
|
27
26
|
},
|
|
28
|
-
"homepage": "https://github.com/
|
|
27
|
+
"homepage": "https://github.com/sharkcraft/sharkcraft",
|
|
29
28
|
"bugs": {
|
|
30
|
-
"url": "https://github.com/
|
|
29
|
+
"url": "https://github.com/sharkcraft/sharkcraft/issues"
|
|
31
30
|
},
|
|
32
31
|
"keywords": [
|
|
33
32
|
"sharkcraft",
|
|
@@ -42,9 +41,9 @@
|
|
|
42
41
|
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
43
42
|
},
|
|
44
43
|
"dependencies": {
|
|
45
|
-
"@shrkcrft/core": "^0.1.0-alpha.
|
|
46
|
-
"@shrkcrft/knowledge": "^0.1.0-alpha.
|
|
47
|
-
"@shrkcrft/workspace": "^0.1.0-alpha.
|
|
44
|
+
"@shrkcrft/core": "^0.1.0-alpha.9",
|
|
45
|
+
"@shrkcrft/knowledge": "^0.1.0-alpha.9",
|
|
46
|
+
"@shrkcrft/workspace": "^0.1.0-alpha.9"
|
|
48
47
|
},
|
|
49
48
|
"publishConfig": {
|
|
50
49
|
"access": "public"
|
|
@@ -1,9 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,218 +0,0 @@
|
|
|
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
|
-
]);
|
|
@@ -1,28 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|