@bleedingdev/modern-js-create 3.2.0-ultramodern.6 → 3.2.0-ultramodern.8
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/index.js +225 -34
- package/package.json +3 -3
- package/template/.agents/skills-lock.json +34 -0
- package/template/AGENTS.md +20 -0
- package/template/api/effect/index.ts.handlebars +7 -39
- package/template/modern.config.ts.handlebars +8 -7
- package/template/oxfmt.config.ts +7 -0
- package/template/oxlint.config.ts +12 -0
- package/template/package.json.handlebars +21 -11
- package/template/scripts/bootstrap-agent-skills.mjs +103 -0
- package/template/scripts/validate-ultramodern.mjs.handlebars +84 -0
- package/template/tsconfig.json +106 -2
- package/template-workspace/.agents/rstackjs-agent-skills-LICENSE +21 -0
- package/template-workspace/.agents/skills/rsbuild-best-practices/SKILL.md +57 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/SKILL.md +96 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/command-map.md +113 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/common-analysis-patterns.md +190 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/install-rsdoctor-common.md +88 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/install-rsdoctor-rspack.md +138 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/install-rsdoctor-webpack.md +71 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/install-rsdoctor.md +39 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/rsdoctor-data-types.md +103 -0
- package/template-workspace/.agents/skills/rslib-best-practices/SKILL.md +58 -0
- package/template-workspace/.agents/skills/rslib-modern-package/SKILL.md +173 -0
- package/template-workspace/.agents/skills/rspack-best-practices/SKILL.md +70 -0
- package/template-workspace/.agents/skills/rspack-tracing/SKILL.md +75 -0
- package/template-workspace/.agents/skills/rspack-tracing/references/bottlenecks.md +47 -0
- package/template-workspace/.agents/skills/rspack-tracing/references/tracing-guide.md +38 -0
- package/template-workspace/.agents/skills/rspack-tracing/scripts/analyze_trace.js +184 -0
- package/template-workspace/.agents/skills/rstest-best-practices/SKILL.md +133 -0
- package/template-workspace/.agents/skills-lock.json +95 -0
- package/template-workspace/AGENTS.md +45 -0
- package/template-workspace/oxfmt.config.ts +7 -0
- package/template-workspace/oxlint.config.ts +12 -0
- package/template-workspace/pnpm-workspace.yaml +0 -2
- package/template-workspace/scripts/bootstrap-agent-skills.mjs +106 -0
- package/template-workspace/scripts/validate-ultramodern-workspace.mjs.handlebars +127 -0
- package/template/biome.json +0 -41
|
@@ -4,12 +4,30 @@ import path from 'node:path';
|
|
|
4
4
|
const root = process.cwd();
|
|
5
5
|
const packageScope = '{{packageScope}}';
|
|
6
6
|
const tanstackVersion = '1.170.1';
|
|
7
|
+
const rstackAgentSkillsCommit =
|
|
8
|
+
'61c948b42512e223bad44b83af4080eba48b2677';
|
|
7
9
|
const modernPackages = [
|
|
8
10
|
'@modern-js/app-tools',
|
|
9
11
|
'@modern-js/plugin-bff',
|
|
10
12
|
'@modern-js/plugin-tanstack',
|
|
11
13
|
'@modern-js/runtime',
|
|
12
14
|
];
|
|
15
|
+
const baselineAgentSkills = [
|
|
16
|
+
'rsbuild-best-practices',
|
|
17
|
+
'rspack-best-practices',
|
|
18
|
+
'rspack-tracing',
|
|
19
|
+
'rsdoctor-analysis',
|
|
20
|
+
'rslib-best-practices',
|
|
21
|
+
'rslib-modern-package',
|
|
22
|
+
'rstest-best-practices',
|
|
23
|
+
];
|
|
24
|
+
const privateAgentSkills = [
|
|
25
|
+
'plan-graph',
|
|
26
|
+
'dag',
|
|
27
|
+
'subagent-graph',
|
|
28
|
+
'helm',
|
|
29
|
+
'debugger-mode',
|
|
30
|
+
];
|
|
13
31
|
|
|
14
32
|
function readText(relativePath) {
|
|
15
33
|
return fs.readFileSync(path.join(root, relativePath), 'utf-8');
|
|
@@ -30,14 +48,30 @@ function assertExists(relativePath) {
|
|
|
30
48
|
}
|
|
31
49
|
|
|
32
50
|
const requiredPaths = [
|
|
51
|
+
'AGENTS.md',
|
|
33
52
|
'package.json',
|
|
34
53
|
'pnpm-workspace.yaml',
|
|
35
54
|
'tsconfig.base.json',
|
|
55
|
+
'oxlint.config.ts',
|
|
56
|
+
'oxfmt.config.ts',
|
|
57
|
+
'.agents/skills-lock.json',
|
|
58
|
+
'.agents/rstackjs-agent-skills-LICENSE',
|
|
59
|
+
'.agents/skills/rsbuild-best-practices/SKILL.md',
|
|
60
|
+
'.agents/skills/rspack-best-practices/SKILL.md',
|
|
61
|
+
'.agents/skills/rspack-tracing/SKILL.md',
|
|
62
|
+
'.agents/skills/rspack-tracing/references/tracing-guide.md',
|
|
63
|
+
'.agents/skills/rspack-tracing/scripts/analyze_trace.js',
|
|
64
|
+
'.agents/skills/rsdoctor-analysis/SKILL.md',
|
|
65
|
+
'.agents/skills/rsdoctor-analysis/references/rsdoctor-data-types.md',
|
|
66
|
+
'.agents/skills/rslib-best-practices/SKILL.md',
|
|
67
|
+
'.agents/skills/rslib-modern-package/SKILL.md',
|
|
68
|
+
'.agents/skills/rstest-best-practices/SKILL.md',
|
|
36
69
|
'topology/reference-topology.json',
|
|
37
70
|
'topology/ownership.json',
|
|
38
71
|
'topology/local-overlays/development.json',
|
|
39
72
|
'.modernjs/ultramodern-workspace-template-manifest.json',
|
|
40
73
|
'.modernjs/ultramodern-package-source.json',
|
|
74
|
+
'scripts/bootstrap-agent-skills.mjs',
|
|
41
75
|
'apps/shell-super-app/package.json',
|
|
42
76
|
'apps/shell-super-app/modern.config.ts',
|
|
43
77
|
'apps/shell-super-app/module-federation.config.ts',
|
|
@@ -65,6 +99,7 @@ for (const requiredPath of requiredPaths) {
|
|
|
65
99
|
|
|
66
100
|
const rootPackage = readJson('package.json');
|
|
67
101
|
const packageSource = readJson('.modernjs/ultramodern-package-source.json');
|
|
102
|
+
const skillsLock = readJson('.agents/skills-lock.json');
|
|
68
103
|
const expectedModernSpecifier =
|
|
69
104
|
packageSource.strategy === 'install'
|
|
70
105
|
? packageSource.modernPackages?.specifier
|
|
@@ -83,6 +118,8 @@ function expectedModernDependency(packageName) {
|
|
|
83
118
|
|
|
84
119
|
assert(rootPackage.private === true, 'Root package must be private');
|
|
85
120
|
assert(rootPackage.modernjs?.preset === 'presetUltramodern', 'Root must declare presetUltramodern');
|
|
121
|
+
assert(rootPackage.packageManager === 'pnpm@11.1.2', 'Root must pin pnpm 11.1.2');
|
|
122
|
+
assert(rootPackage.engines?.pnpm === '>=11.0.0', 'Root must require pnpm >=11');
|
|
86
123
|
assert(
|
|
87
124
|
rootPackage.modernjs?.packageSource?.config ===
|
|
88
125
|
'./.modernjs/ultramodern-package-source.json',
|
|
@@ -116,6 +153,75 @@ assert(
|
|
|
116
153
|
'node ./scripts/validate-ultramodern-workspace.mjs',
|
|
117
154
|
'Root must expose the ultramodern:check script',
|
|
118
155
|
);
|
|
156
|
+
const requiredRootScripts = {
|
|
157
|
+
format: 'oxfmt .',
|
|
158
|
+
'format:check': 'oxfmt --check .',
|
|
159
|
+
lint: 'oxlint .',
|
|
160
|
+
'lint:fix': 'oxlint . --fix',
|
|
161
|
+
'skills:install': 'node ./scripts/bootstrap-agent-skills.mjs',
|
|
162
|
+
'skills:check': 'node ./scripts/bootstrap-agent-skills.mjs --check',
|
|
163
|
+
};
|
|
164
|
+
for (const [scriptName, scriptCommand] of Object.entries(requiredRootScripts)) {
|
|
165
|
+
assert(
|
|
166
|
+
rootPackage.scripts?.[scriptName] === scriptCommand,
|
|
167
|
+
`Root must expose ${scriptName}`,
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
for (const dependency of [
|
|
171
|
+
'@effect/tsgo',
|
|
172
|
+
'@typescript/native-preview',
|
|
173
|
+
'oxlint',
|
|
174
|
+
'oxfmt',
|
|
175
|
+
'ultracite',
|
|
176
|
+
]) {
|
|
177
|
+
assert(
|
|
178
|
+
rootPackage.devDependencies?.[dependency],
|
|
179
|
+
`Root must depend on ${dependency}`,
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const agentsInstructions = readText('AGENTS.md');
|
|
184
|
+
assert(
|
|
185
|
+
agentsInstructions.includes('UltraModern Agent Contract') &&
|
|
186
|
+
agentsInstructions.includes('Required Skill Baseline'),
|
|
187
|
+
'Root AGENTS.md must document the UltraModern agent contract',
|
|
188
|
+
);
|
|
189
|
+
assert(
|
|
190
|
+
skillsLock.source?.repository === 'https://github.com/rstackjs/agent-skills',
|
|
191
|
+
'Agent skills lock must retain the Rstack skill source repository',
|
|
192
|
+
);
|
|
193
|
+
assert(
|
|
194
|
+
skillsLock.source?.commit === rstackAgentSkillsCommit,
|
|
195
|
+
'Agent skills lock must pin the expected Rstack skill commit',
|
|
196
|
+
);
|
|
197
|
+
assert(
|
|
198
|
+
skillsLock.installDir === '.agents/skills',
|
|
199
|
+
'Agent skills lock must use .agents/skills as installDir',
|
|
200
|
+
);
|
|
201
|
+
for (const skillName of baselineAgentSkills) {
|
|
202
|
+
assert(
|
|
203
|
+
skillsLock.baseline?.some(skill => skill.name === skillName),
|
|
204
|
+
`Agent skills lock must include ${skillName}`,
|
|
205
|
+
);
|
|
206
|
+
const skillContent = readText(`.agents/skills/${skillName}/SKILL.md`);
|
|
207
|
+
assert(
|
|
208
|
+
skillContent.includes(`name: ${skillName}`),
|
|
209
|
+
`${skillName} must contain matching skill metadata`,
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
const privateSource = skillsLock.sources?.find(
|
|
213
|
+
source => source.repository === 'https://github.com/TechsioCZ/skills',
|
|
214
|
+
);
|
|
215
|
+
assert(
|
|
216
|
+
privateSource?.install === 'clone-if-authorized',
|
|
217
|
+
'Agent skills lock must configure TechsioCZ skills as clone-if-authorized',
|
|
218
|
+
);
|
|
219
|
+
for (const skillName of privateAgentSkills) {
|
|
220
|
+
assert(
|
|
221
|
+
privateSource.baseline?.some(skill => skill.name === skillName),
|
|
222
|
+
`Agent skills lock must allowlist private skill ${skillName}`,
|
|
223
|
+
);
|
|
224
|
+
}
|
|
119
225
|
|
|
120
226
|
const appPackagePaths = [
|
|
121
227
|
'apps/shell-super-app/package.json',
|
|
@@ -268,6 +374,27 @@ assert(
|
|
|
268
374
|
manifest.packageSource?.strategy === packageSource.strategy,
|
|
269
375
|
'Template manifest must retain the generated package source strategy',
|
|
270
376
|
);
|
|
377
|
+
assert(
|
|
378
|
+
manifest.agentSkills?.source?.commit === rstackAgentSkillsCommit,
|
|
379
|
+
'Template manifest must retain the Rstack agent skills commit',
|
|
380
|
+
);
|
|
381
|
+
assert(
|
|
382
|
+
baselineAgentSkills.every(skillName =>
|
|
383
|
+
manifest.agentSkills?.baseline?.includes(skillName),
|
|
384
|
+
),
|
|
385
|
+
'Template manifest must list every baseline agent skill',
|
|
386
|
+
);
|
|
387
|
+
assert(
|
|
388
|
+
manifest.agentSkills?.privateSource?.repository ===
|
|
389
|
+
'https://github.com/TechsioCZ/skills',
|
|
390
|
+
'Template manifest must retain the private TechsioCZ skill source',
|
|
391
|
+
);
|
|
392
|
+
assert(
|
|
393
|
+
privateAgentSkills.every(skillName =>
|
|
394
|
+
manifest.agentSkills?.privateSource?.baseline?.includes(skillName),
|
|
395
|
+
),
|
|
396
|
+
'Template manifest must list every private agent skill allowlist entry',
|
|
397
|
+
);
|
|
271
398
|
assert(
|
|
272
399
|
manifest.validation?.expectedCommands?.includes('pnpm run ultramodern:check'),
|
|
273
400
|
'Template manifest must document the validation command',
|
package/template/biome.json
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"root": false,
|
|
3
|
-
"$schema": "https://biomejs.dev/schemas/2.4.15/schema.json",
|
|
4
|
-
"vcs": {
|
|
5
|
-
"enabled": true,
|
|
6
|
-
"defaultBranch": "main",
|
|
7
|
-
"clientKind": "git",
|
|
8
|
-
"useIgnoreFile": true
|
|
9
|
-
},
|
|
10
|
-
"formatter": {
|
|
11
|
-
"enabled": true,
|
|
12
|
-
"indentStyle": "space"
|
|
13
|
-
},
|
|
14
|
-
"javascript": {
|
|
15
|
-
"formatter": {
|
|
16
|
-
"quoteStyle": "single",
|
|
17
|
-
"arrowParentheses": "asNeeded",
|
|
18
|
-
"jsxQuoteStyle": "double",
|
|
19
|
-
"lineWidth": 80
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"linter": {
|
|
23
|
-
"enabled": true,
|
|
24
|
-
"rules": {
|
|
25
|
-
"recommended": true,
|
|
26
|
-
"suspicious": {
|
|
27
|
-
"noDuplicateFontNames": "off"
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
"assist": { "actions": { "source": { "organizeImports": "on" } } },
|
|
32
|
-
"files": {
|
|
33
|
-
"ignoreUnknown": true,
|
|
34
|
-
"includes": [
|
|
35
|
-
"**",
|
|
36
|
-
"!**/.vscode/**/*",
|
|
37
|
-
"!**/node_modules/**/*",
|
|
38
|
-
"!**/dist/**/*"
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
}
|