@nimiplatform/app-tools 0.14.0 → 0.16.0-rc.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 +48 -5
- package/bin/nimi-app.mjs +26 -10
- package/lib/app-access-declaration.mjs +3 -0
- package/lib/app-dependency-combinations.mjs +70 -24
- package/lib/app-doctor-update.mjs +92 -36
- package/lib/app-host-support.mjs +6 -0
- package/lib/app-identifiers.mjs +27 -0
- package/lib/app-lifecycle-guidance.mjs +1 -1
- package/lib/app-pack.mjs +14 -36
- package/lib/app-project-lifecycle.mjs +141 -243
- package/lib/app-scaffold-capabilities.mjs +13 -109
- package/lib/app-scaffold-profiles.mjs +81 -115
- package/lib/app-scaffold.mjs +68 -164
- package/lib/app-toolchain-updates.mjs +45 -0
- package/lib/canonical-capability-ids.generated.mjs +2 -0
- package/lib/development-environment.d.mts +10 -0
- package/lib/development-environment.mjs +39 -0
- package/lib/hosted-web-release.mjs +98 -0
- package/lib/index.mjs +40 -1
- package/lib/mobile-development.mjs +19 -0
- package/lib/realm-environments.generated.mjs +5 -0
- package/lib/web-coordination.mjs +59 -0
- package/lib/web-development.d.mts +23 -0
- package/lib/web-development.mjs +118 -0
- package/lib/web-scaffold.mjs +125 -0
- package/package.json +32 -21
- package/scripts/dev-shell.mjs +4 -1
- package/scripts/sync-scaffold-versions.mjs +0 -2
- package/skills/nimi-app-lifecycle/SKILL.md +3 -1
- package/skills/nimi-app-lifecycle/references/acceptance.md +6 -2
- package/skills/nimi-app-lifecycle/references/adapt.md +5 -3
- package/skills/nimi-app-lifecycle/references/audit.md +3 -2
- package/skills/nimi-app-lifecycle/references/create.md +6 -2
- package/skills/nimi-app-lifecycle/references/upgrade-platform.md +12 -7
- package/templates/app-source/src/ai-studio-core/ai-studio-core.css +87 -52
- package/templates/app-source/src/ai-studio-core/history-policy.ts +45 -11
- package/templates/app-source/src/ai-studio-core/history.ts +22 -11
- package/templates/app-source/src/ai-studio-core/host-context.tsx +9 -4
- package/templates/app-source/src/ai-studio-core/index.ts +2 -0
- package/templates/app-source/src/ai-studio-core/job-recovery-panel.tsx +15 -5
- package/templates/app-source/src/ai-studio-core/job-recovery.ts +2 -2
- package/templates/app-source/src/ai-studio-core/messages/en.json +73 -19
- package/templates/app-source/src/ai-studio-core/messages/zh.json +73 -19
- package/templates/app-source/src/ai-studio-core/module-registration.ts +1 -0
- package/templates/app-source/src/ai-studio-core/non-success-presentation.ts +30 -5
- package/templates/app-source/src/ai-studio-core/parameter-fields.tsx +12 -6
- package/templates/app-source/src/ai-studio-core/parameters.ts +4 -0
- package/templates/app-source/src/ai-studio-core/prompt-drafts.ts +42 -0
- package/templates/app-source/src/ai-studio-core/runtime-types.ts +9 -2
- package/templates/app-source/src/ai-studio-core/runtime.ts +8 -4
- package/templates/app-source/src/ai-studio-core/section-ai-testing-composer.tsx +98 -90
- package/templates/app-source/src/ai-studio-core/section-ai-testing-exchange-result.tsx +1 -1
- package/templates/app-source/src/ai-studio-core/section-ai-testing-history.tsx +205 -48
- package/templates/app-source/src/ai-studio-core/section-ai-testing-input.ts +1 -0
- package/templates/app-source/src/ai-studio-core/section-ai-testing-output.tsx +36 -14
- package/templates/app-source/src/ai-studio-core/section-ai-testing-result.tsx +96 -75
- package/templates/app-source/src/ai-studio-core/section-ai-testing-run.ts +59 -16
- package/templates/app-source/src/ai-studio-core/section-ai-testing-session-result.tsx +2 -0
- package/templates/app-source/src/ai-studio-core/section-ai-testing-studio-result.tsx +12 -21
- package/templates/app-source/src/ai-studio-core/section-ai-testing-transcription-result.tsx +2 -2
- package/templates/app-source/src/ai-studio-core/section-ai-testing-vision-result.tsx +3 -3
- package/templates/app-source/src/ai-studio-core/section-ai-testing.tsx +158 -76
- package/templates/app-source/src/ai-studio-core/workspace.tsx +49 -22
- package/templates/app-source/src/product-modules/agent-center/index.tsx +2 -3
- package/templates/app-source/src/product-modules/agent-conversation/index.tsx +2 -3
- package/templates/app-source/src/studio-modules/studio-create/messages/en.json +12 -3
- package/templates/app-source/src/studio-modules/studio-create/messages/zh.json +12 -3
- package/templates/app-source/src/studio-modules/studio-create/parameter-panel.tsx +11 -2
- package/templates/app-source/src/studio-modules/studio-create/parameters.ts +2 -1
- package/templates/app-source/src/studio-modules/studio-create/runtime.ts +47 -5
- package/templates/app-source/src/studio-modules/studio-media/messages/en.json +59 -8
- package/templates/app-source/src/studio-modules/studio-media/messages/zh.json +59 -8
- package/templates/app-source/src/studio-modules/studio-media/music-parameters.tsx +2 -1
- package/templates/app-source/src/studio-modules/studio-media/parameter-panel.tsx +271 -83
- package/templates/app-source/src/studio-modules/studio-media/parameters.ts +120 -2
- package/templates/app-source/src/studio-modules/studio-media/registration.ts +1 -0
- package/templates/app-source/src/studio-modules/studio-media/runtime.ts +24 -14
- package/templates/app-source/src/studio-modules/studio-voice/descriptors.ts +1 -1
- package/templates/app-source/src/studio-modules/studio-voice/messages/en.json +3 -2
- package/templates/app-source/src/studio-modules/studio-voice/messages/zh.json +3 -2
- package/templates/app-source/src/studio-modules/studio-voice/parameter-panel.tsx +46 -23
- package/templates/app-source/src/studio-modules/studio-voice/registration.ts +2 -1
- package/templates/app-source/src/studio-modules/studio-voice/runtime.ts +2 -2
- package/templates/app-source/src/workbench-core/workbench-core.tsx +27 -3
- package/templates/default-starter/AGENTS.md +3 -3
- package/templates/default-starter/README.md +1 -1
- package/templates/default-starter/src/shell/App.tsx +6 -18
- package/templates/default-starter/src/shell/auth/local-app-client.ts +6 -15
- package/templates/default-starter/src/shell/auth/runtime-platform.ts +7 -107
- package/templates/default-starter/src/shell/workbench-target-adapter.ts +9 -126
- package/templates/default-starter.manifest.json +0 -16
- package/templates/hosted-web-release.yml +88 -0
- package/templates/default-starter/src-tauri/Cargo.toml +0 -17
- package/templates/default-starter/src-tauri/build.rs +0 -32
- package/templates/default-starter/src-tauri/capabilities/default.json +0 -7
- package/templates/default-starter/src-tauri/tauri.conf.json +0 -26
|
@@ -10,26 +10,15 @@ function frozenSourceMapping(sourceRoot, targetRoot = sourceRoot) {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
function frozenModule(definition) {
|
|
13
|
-
const cargoDependencies = Object.fromEntries(
|
|
14
|
-
Object.entries(definition.cargoDependencies || {}).map(([name, value]) => [
|
|
15
|
-
name,
|
|
16
|
-
value && typeof value === 'object' && !Array.isArray(value)
|
|
17
|
-
? Object.freeze({
|
|
18
|
-
...value,
|
|
19
|
-
...(Array.isArray(value.features) ? { features: Object.freeze([...value.features]) } : {}),
|
|
20
|
-
})
|
|
21
|
-
: value,
|
|
22
|
-
]),
|
|
23
|
-
);
|
|
24
13
|
return Object.freeze({
|
|
25
14
|
...definition,
|
|
15
|
+
carriers: Object.freeze([...(definition.carriers || ['desktop'])]),
|
|
26
16
|
requires: Object.freeze([...(definition.requires || [])]),
|
|
27
17
|
sourceMappings: Object.freeze([...(definition.sourceMappings || [])]),
|
|
28
18
|
appAccessItems: Object.freeze([...(definition.appAccessItems || [])]),
|
|
29
19
|
capabilityContractRefs: Object.freeze([...(definition.capabilityContractRefs || [])]),
|
|
30
20
|
requiredStandardizedFeatureRefs: Object.freeze([...(definition.requiredStandardizedFeatureRefs || [])]),
|
|
31
21
|
npmDependencies: Object.freeze({ ...(definition.npmDependencies || {}) }),
|
|
32
|
-
cargoDependencies: Object.freeze(cargoDependencies),
|
|
33
22
|
views: Object.freeze([...(definition.views || [])]),
|
|
34
23
|
navigation: Object.freeze([...(definition.navigation || [])]),
|
|
35
24
|
styles: Object.freeze([...(definition.styles || [])]),
|
|
@@ -40,6 +29,7 @@ function frozenModule(definition) {
|
|
|
40
29
|
export const APP_SCAFFOLD_MODULE_REGISTRY = Object.freeze({
|
|
41
30
|
'ai-studio-core': frozenModule({
|
|
42
31
|
id: 'ai-studio-core',
|
|
32
|
+
carriers: ['desktop', 'web'],
|
|
43
33
|
kind: 'internal',
|
|
44
34
|
order: 0,
|
|
45
35
|
requires: [],
|
|
@@ -49,7 +39,6 @@ export const APP_SCAFFOLD_MODULE_REGISTRY = Object.freeze({
|
|
|
49
39
|
i18next: '$versions.i18nextVersion',
|
|
50
40
|
'lucide-react': '$versions.lucideReactVersion',
|
|
51
41
|
},
|
|
52
|
-
cargoDependencies: {},
|
|
53
42
|
hostAdapterContract: 'ai-studio-host-v1',
|
|
54
43
|
views: [],
|
|
55
44
|
navigation: [],
|
|
@@ -64,6 +53,7 @@ export const APP_SCAFFOLD_MODULE_REGISTRY = Object.freeze({
|
|
|
64
53
|
}),
|
|
65
54
|
'studio-create': frozenModule({
|
|
66
55
|
id: 'studio-create',
|
|
56
|
+
carriers: ['desktop', 'web'],
|
|
67
57
|
kind: 'feature',
|
|
68
58
|
lifecycle: 'admitted',
|
|
69
59
|
order: 10,
|
|
@@ -74,7 +64,6 @@ export const APP_SCAFFOLD_MODULE_REGISTRY = Object.freeze({
|
|
|
74
64
|
capabilityContractRefs: ['text.generate', 'text.embed'],
|
|
75
65
|
requiredStandardizedFeatureRefs: [],
|
|
76
66
|
npmDependencies: {},
|
|
77
|
-
cargoDependencies: {},
|
|
78
67
|
hostAdapterContract: 'ai-studio-host-v1',
|
|
79
68
|
views: ['text.generate', 'chat.stream', 'text.embed'],
|
|
80
69
|
navigation: ['text.generate', 'chat.stream', 'text.embed'],
|
|
@@ -100,7 +89,6 @@ export const APP_SCAFFOLD_MODULE_REGISTRY = Object.freeze({
|
|
|
100
89
|
capabilityContractRefs: ['image.generate', 'video.generate', 'music.generate', 'music.transcribe', 'audio.voice.convert', 'audio.separate'],
|
|
101
90
|
requiredStandardizedFeatureRefs: [],
|
|
102
91
|
npmDependencies: {},
|
|
103
|
-
cargoDependencies: {},
|
|
104
92
|
hostAdapterContract: 'ai-studio-host-v1',
|
|
105
93
|
views: ['image.generate', 'video.generate', 'music.generate', 'music.transcribe', 'audio.voice.convert', 'audio.separate'],
|
|
106
94
|
navigation: ['image.generate', 'video.generate', 'music.generate', 'music.transcribe', 'audio.voice.convert', 'audio.separate'],
|
|
@@ -126,7 +114,6 @@ export const APP_SCAFFOLD_MODULE_REGISTRY = Object.freeze({
|
|
|
126
114
|
capabilityContractRefs: ['audio.synthesize', 'audio.transcribe', 'voice.create'],
|
|
127
115
|
requiredStandardizedFeatureRefs: [],
|
|
128
116
|
npmDependencies: {},
|
|
129
|
-
cargoDependencies: {},
|
|
130
117
|
hostAdapterContract: 'ai-studio-host-v1',
|
|
131
118
|
views: ['audio.synthesize', 'audio.transcribe', 'voice.create', 'speech.bundle'],
|
|
132
119
|
navigation: ['audio.synthesize', 'audio.transcribe', 'voice.create', 'speech.bundle'],
|
|
@@ -152,7 +139,6 @@ export const APP_SCAFFOLD_MODULE_REGISTRY = Object.freeze({
|
|
|
152
139
|
npmDependencies: {
|
|
153
140
|
'lucide-react': '$versions.lucideReactVersion',
|
|
154
141
|
},
|
|
155
|
-
cargoDependencies: {},
|
|
156
142
|
hostAdapterContract: 'clipboard-copy-v1',
|
|
157
143
|
views: ['kit-recipes'],
|
|
158
144
|
navigation: ['kit-recipes'],
|
|
@@ -177,7 +163,6 @@ export const APP_SCAFFOLD_MODULE_REGISTRY = Object.freeze({
|
|
|
177
163
|
npmDependencies: {
|
|
178
164
|
'lucide-react': '$versions.lucideReactVersion',
|
|
179
165
|
},
|
|
180
|
-
cargoDependencies: {},
|
|
181
166
|
hostAdapterContract: 'local-app-standard-shell-v1',
|
|
182
167
|
views: ['agent-center'],
|
|
183
168
|
navigation: ['agent-center'],
|
|
@@ -202,7 +187,6 @@ export const APP_SCAFFOLD_MODULE_REGISTRY = Object.freeze({
|
|
|
202
187
|
npmDependencies: {
|
|
203
188
|
'lucide-react': '$versions.lucideReactVersion',
|
|
204
189
|
},
|
|
205
|
-
cargoDependencies: {},
|
|
206
190
|
hostAdapterContract: 'app-conversation-browser-media-v1',
|
|
207
191
|
views: ['agent-conversation'],
|
|
208
192
|
navigation: ['agent-conversation'],
|
|
@@ -227,7 +211,6 @@ export const APP_SCAFFOLD_MODULE_REGISTRY = Object.freeze({
|
|
|
227
211
|
npmDependencies: {
|
|
228
212
|
'lucide-react': '$versions.lucideReactVersion',
|
|
229
213
|
},
|
|
230
|
-
cargoDependencies: {},
|
|
231
214
|
hostAdapterContract: 'agent-realtime-browser-media-v1',
|
|
232
215
|
views: ['agent-realtime'],
|
|
233
216
|
navigation: ['agent-realtime'],
|
|
@@ -292,52 +275,6 @@ function targetPathForOwnedSource(entry, sourcePath) {
|
|
|
292
275
|
return suffix ? `${mapping.targetRoot}/${suffix}` : mapping.targetRoot;
|
|
293
276
|
}
|
|
294
277
|
|
|
295
|
-
function canonicalDependencyValue(value) {
|
|
296
|
-
if (Array.isArray(value)) return value.map(canonicalDependencyValue);
|
|
297
|
-
if (!value || typeof value !== 'object') return value;
|
|
298
|
-
return Object.fromEntries(
|
|
299
|
-
Object.keys(value).sort().map((key) => [key, canonicalDependencyValue(value[key])]),
|
|
300
|
-
);
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
function dependencyValuesEqual(left, right) {
|
|
304
|
-
return JSON.stringify(canonicalDependencyValue(left)) === JSON.stringify(canonicalDependencyValue(right));
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
export function validateAppScaffoldCargoDependencyValue(value, label) {
|
|
308
|
-
if (typeof value === 'string') {
|
|
309
|
-
if (isCargoRegistryVersionRequirement(value)) return;
|
|
310
|
-
throw new Error(`App scaffold module Cargo dependency must use a public registry version: ${label}`);
|
|
311
|
-
}
|
|
312
|
-
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
313
|
-
throw new Error(`App scaffold module Cargo dependency is invalid: ${label}`);
|
|
314
|
-
}
|
|
315
|
-
const allowed = new Set(['version', 'package', 'features', 'default-features', 'optional']);
|
|
316
|
-
const entries = Object.entries(value);
|
|
317
|
-
if (entries.length === 0) throw new Error(`App scaffold module Cargo dependency is empty: ${label}`);
|
|
318
|
-
for (const [key, field] of entries) {
|
|
319
|
-
if (!allowed.has(key)) throw new Error(`App scaffold module Cargo dependency field is invalid: ${label}.${key}`);
|
|
320
|
-
if (key === 'version' && typeof field === 'string') {
|
|
321
|
-
if (!isCargoRegistryVersionRequirement(field)) {
|
|
322
|
-
throw new Error(`App scaffold module Cargo dependency must use a public registry version: ${label}.${key}`);
|
|
323
|
-
}
|
|
324
|
-
continue;
|
|
325
|
-
}
|
|
326
|
-
if (key === 'package' && typeof field === 'string') {
|
|
327
|
-
if (!/^[A-Za-z0-9][A-Za-z0-9_-]*$/u.test(field)) {
|
|
328
|
-
throw new Error(`App scaffold module Cargo dependency package name is invalid: ${label}.${key}`);
|
|
329
|
-
}
|
|
330
|
-
continue;
|
|
331
|
-
}
|
|
332
|
-
if (key === 'features' && Array.isArray(field) && field.every((item) => typeof item === 'string' && item && item === item.trim())) continue;
|
|
333
|
-
if ((key === 'default-features' || key === 'optional') && typeof field === 'boolean') continue;
|
|
334
|
-
throw new Error(`App scaffold module Cargo dependency value has the wrong type: ${label}.${key}`);
|
|
335
|
-
}
|
|
336
|
-
if (!Object.hasOwn(value, 'version')) {
|
|
337
|
-
throw new Error(`App scaffold module Cargo registry dependency version is missing: ${label}`);
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
|
|
341
278
|
function assertPublicNpmDependencyVersion(value, label) {
|
|
342
279
|
if (typeof value === 'string' && /^\$versions\.[A-Za-z][A-Za-z0-9]*$/u.test(value)) return;
|
|
343
280
|
validateAppScaffoldNpmRegistryVersion(value, label);
|
|
@@ -359,32 +296,6 @@ function isNpmRegistryVersionSelector(value) {
|
|
|
359
296
|
return /^[A-Za-z0-9][A-Za-z0-9._-]*$/u.test(value);
|
|
360
297
|
}
|
|
361
298
|
|
|
362
|
-
const CARGO_NUMERIC_IDENTIFIER = '(?:0|[1-9][0-9]*)';
|
|
363
|
-
const CARGO_PRERELEASE_IDENTIFIER = '[0-9A-Za-z-]+';
|
|
364
|
-
const CARGO_PRERELEASE = `(?:-${CARGO_PRERELEASE_IDENTIFIER}(?:\\.${CARGO_PRERELEASE_IDENTIFIER})*)?`;
|
|
365
|
-
const CARGO_BUILD = `(?:\\+${CARGO_PRERELEASE_IDENTIFIER}(?:\\.${CARGO_PRERELEASE_IDENTIFIER})*)?`;
|
|
366
|
-
const CARGO_VERSION = new RegExp(
|
|
367
|
-
`^(?:\\*|${CARGO_NUMERIC_IDENTIFIER}|${CARGO_NUMERIC_IDENTIFIER}\\.\\*|${CARGO_NUMERIC_IDENTIFIER}\\.${CARGO_NUMERIC_IDENTIFIER}|${CARGO_NUMERIC_IDENTIFIER}\\.${CARGO_NUMERIC_IDENTIFIER}\\.\\*|${CARGO_NUMERIC_IDENTIFIER}\\.${CARGO_NUMERIC_IDENTIFIER}\\.${CARGO_NUMERIC_IDENTIFIER}${CARGO_PRERELEASE}${CARGO_BUILD})$`,
|
|
368
|
-
'u',
|
|
369
|
-
);
|
|
370
|
-
|
|
371
|
-
function isCargoRegistryVersionRequirement(value) {
|
|
372
|
-
if (typeof value !== 'string' || !value || value !== value.trim()) return false;
|
|
373
|
-
const comparators = value.split(',').map((entry) => entry.trim());
|
|
374
|
-
if (comparators.length === 0 || comparators.some((entry) => !entry)) return false;
|
|
375
|
-
return comparators.every((entry) => {
|
|
376
|
-
const match = entry.match(/^(\^|~|>=|<=|>|<|=)?\s*(.+)$/u);
|
|
377
|
-
if (!match || !isCargoVersionToken(match[2])) return false;
|
|
378
|
-
return !(match[1] && match[2].includes('*'));
|
|
379
|
-
});
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
function isCargoVersionToken(value) {
|
|
383
|
-
if (!CARGO_VERSION.test(value)) return false;
|
|
384
|
-
if (value.includes('*') || value.split(/[+-]/u, 1)[0].split('.').length < 3) return true;
|
|
385
|
-
return semver.valid(value, { loose: false }) !== null;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
299
|
function assertProductEntry(id, entry) {
|
|
389
300
|
const productEntry = entry.productEntry;
|
|
390
301
|
if (!productEntry || typeof productEntry !== 'object' || Array.isArray(productEntry)) {
|
|
@@ -486,21 +397,12 @@ function assertModuleEntry(id, entry, registry) {
|
|
|
486
397
|
if (!entry.npmDependencies || typeof entry.npmDependencies !== 'object' || Array.isArray(entry.npmDependencies)) {
|
|
487
398
|
throw new Error(`App scaffold module npmDependencies are missing: ${id}`);
|
|
488
399
|
}
|
|
489
|
-
if (!entry.cargoDependencies || typeof entry.cargoDependencies !== 'object' || Array.isArray(entry.cargoDependencies)) {
|
|
490
|
-
throw new Error(`App scaffold module cargoDependencies are missing: ${id}`);
|
|
491
|
-
}
|
|
492
400
|
for (const [name, version] of Object.entries(entry.npmDependencies)) {
|
|
493
401
|
if (!name || name !== name.trim() || typeof version !== 'string' || !version.trim()) {
|
|
494
402
|
throw new Error(`App scaffold module npm dependency is invalid: ${id}: ${name || 'missing'}`);
|
|
495
403
|
}
|
|
496
404
|
assertPublicNpmDependencyVersion(version, `${id}:${name}`);
|
|
497
405
|
}
|
|
498
|
-
for (const [name, value] of Object.entries(entry.cargoDependencies)) {
|
|
499
|
-
if (!name || name !== name.trim() || value === undefined || value === null) {
|
|
500
|
-
throw new Error(`App scaffold module Cargo dependency is invalid: ${id}: ${name || 'missing'}`);
|
|
501
|
-
}
|
|
502
|
-
validateAppScaffoldCargoDependencyValue(value, `${id}:${name}`);
|
|
503
|
-
}
|
|
504
406
|
if (typeof entry.hostAdapterContract !== 'string' || !entry.hostAdapterContract.trim()) {
|
|
505
407
|
throw new Error(`App scaffold module hostAdapterContract is missing: ${id}`);
|
|
506
408
|
}
|
|
@@ -655,7 +557,6 @@ function resolveAppScaffoldGraph(input, registry, mode) {
|
|
|
655
557
|
const appAccessItems = [];
|
|
656
558
|
const appAccessSeen = new Set();
|
|
657
559
|
const npmDependencies = {};
|
|
658
|
-
const cargoDependencies = {};
|
|
659
560
|
const views = [];
|
|
660
561
|
const navigation = [];
|
|
661
562
|
const styles = [];
|
|
@@ -703,12 +604,6 @@ function resolveAppScaffoldGraph(input, registry, mode) {
|
|
|
703
604
|
}
|
|
704
605
|
npmDependencies[name] = version;
|
|
705
606
|
}
|
|
706
|
-
for (const [name, version] of Object.entries(entry.cargoDependencies)) {
|
|
707
|
-
if (Object.hasOwn(cargoDependencies, name) && !dependencyValuesEqual(cargoDependencies[name], version)) {
|
|
708
|
-
throw new Error(`App scaffold module Cargo dependency version collision for ${name}`);
|
|
709
|
-
}
|
|
710
|
-
cargoDependencies[name] = version;
|
|
711
|
-
}
|
|
712
607
|
}
|
|
713
608
|
|
|
714
609
|
return Object.freeze({
|
|
@@ -720,7 +615,6 @@ function resolveAppScaffoldGraph(input, registry, mode) {
|
|
|
720
615
|
capabilityContractRefs: Object.freeze(capabilityContractRefs),
|
|
721
616
|
requiredStandardizedFeatureRefs: Object.freeze(requiredStandardizedFeatureRefs),
|
|
722
617
|
npmDependencies: Object.freeze(npmDependencies),
|
|
723
|
-
cargoDependencies: Object.freeze(cargoDependencies),
|
|
724
618
|
views: Object.freeze(views),
|
|
725
619
|
navigation: Object.freeze(navigation),
|
|
726
620
|
styles: Object.freeze(styles),
|
|
@@ -775,3 +669,13 @@ export const APP_SCAFFOLD_REFERENCE_APP_FEATURE_IDS = Object.freeze([
|
|
|
775
669
|
export const APP_SCAFFOLD_ADMITTED_MODULE_IDS = resolveAdmittedModuleIds(
|
|
776
670
|
APP_SCAFFOLD_MODULE_REGISTRY,
|
|
777
671
|
);
|
|
672
|
+
|
|
673
|
+
// @nimi-authority: rule.nimi.platform.app-ecosystem.scaffold-web-carrier
|
|
674
|
+
export function resolveWebAppScaffoldFeatures(selection, resolver = resolveAppScaffoldFeatures) {
|
|
675
|
+
const selected = selection === 'all' || (Array.isArray(selection) && selection.length === 1 && selection[0] === 'all')
|
|
676
|
+
? Object.values(APP_SCAFFOLD_MODULE_REGISTRY).filter(module => module.kind === 'feature' && module.lifecycle === 'admitted' && module.carriers.includes('web')).map(module => module.id)
|
|
677
|
+
: selection;
|
|
678
|
+
const resolution = resolver(selected);
|
|
679
|
+
for (const module of resolution.modules) if (!module.carriers.includes('web')) throw new Error(`Feature ${module.id} has no admitted Web carrier.`);
|
|
680
|
+
return resolution;
|
|
681
|
+
}
|