@getcortexlabs/create-mavis 0.1.0-rc.14 → 0.1.0-rc.15
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 +25 -9
- package/package.json +2 -2
- package/src/adapters.mjs +49 -20
- package/src/add-desktop.mjs +308 -0
- package/src/add-macos.mjs +3 -3
- package/src/capabilities.mjs +288 -42
- package/src/cli.mjs +98 -8
- package/src/desktop.mjs +155 -0
- package/src/doctor.mjs +86 -5
- package/src/native-framework.mjs +144 -0
- package/src/portability.mjs +22 -7
- package/src/scaffold.mjs +38 -9
- package/src/ui.mjs +51 -3
- package/templates/desktop/common/LICENSE +21 -0
- package/templates/desktop/common/build.mjs +58 -0
- package/templates/desktop/common/src/components.ts +60 -0
- package/templates/desktop/common/src/contract.mjs +35 -0
- package/templates/desktop/common/src/renderer.ts +76 -0
- package/templates/desktop/common/src/storage.ts +29 -0
- package/templates/desktop/directory/main.ts +35 -0
- package/templates/desktop/macos/launch.mjs +6 -0
- package/templates/desktop/macos/package.mjs +114 -0
- package/templates/desktop/macos/src/host.mjs +468 -0
- package/templates/desktop/macos/src/motion.mjs +51 -0
- package/templates/desktop/welcome/Welcome.vue +56 -0
- package/templates/desktop/welcome/main.ts +24 -0
- package/templates/desktop/windows/NativeScript-LICENSE +19 -0
- package/templates/desktop/windows/launch.mjs +16 -0
- package/templates/desktop/windows/package.mjs +54 -0
- package/templates/desktop/windows/prepare-host.mjs +73 -0
- package/templates/desktop/windows/src/host.mjs +277 -0
- package/templates/native-framework/angular/screen.ts +84 -0
- package/templates/native-framework/common/nativescript.config.ts +6 -0
- package/templates/native-framework/common/src/app.ts +5 -0
- package/templates/native-framework/common/src/model.ts +40 -0
- package/templates/native-framework/common/src/references.d.ts +8 -0
- package/templates/native-framework/common/tsconfig.json +16 -0
- package/templates/native-framework/common/webpack.config.js +67 -0
- package/templates/native-framework/plain/screen.ts +102 -0
- package/templates/native-framework/react/screen.ts +83 -0
- package/templates/native-framework/solid/screen.ts +111 -0
- package/templates/native-framework/svelte/Welcome.svelte +26 -0
- package/templates/native-framework/svelte/screen.ts +14 -0
- package/templates/native-framework/svelte-tooling/svelte.config.js +20 -0
package/src/capabilities.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { desktopComponents } from '../templates/desktop/common/src/contract.mjs'
|
|
1
2
|
import { adapters } from './adapters.mjs'
|
|
2
3
|
import { macosCapabilities } from './macos-capabilities.generated.mjs'
|
|
3
4
|
|
|
@@ -8,8 +9,8 @@ export const schemaVersion = 2
|
|
|
8
9
|
|
|
9
10
|
/** Baseline pins; coordinated releases update Mavis after validating source templates with matching tarballs. */
|
|
10
11
|
export const versions = Object.freeze({
|
|
11
|
-
mavis: '0.1.0-rc.
|
|
12
|
-
jolt: '0.1.0-rc.
|
|
12
|
+
mavis: '0.1.0-rc.15',
|
|
13
|
+
jolt: '0.1.0-rc.17',
|
|
13
14
|
vue: '3.5.44',
|
|
14
15
|
nuxt: '4.6.3',
|
|
15
16
|
vite: '6.4.5',
|
|
@@ -17,7 +18,7 @@ export const versions = Object.freeze({
|
|
|
17
18
|
typescript: '6.0.3',
|
|
18
19
|
nodeTypes: '26.6.6',
|
|
19
20
|
vueTsc: '3.3.13',
|
|
20
|
-
nativeCore: '9.1.
|
|
21
|
+
nativeCore: '9.1.4',
|
|
21
22
|
nativeVue: '3.1.3',
|
|
22
23
|
android: '9.1.1',
|
|
23
24
|
ios: '9.1.0',
|
|
@@ -25,7 +26,10 @@ export const versions = Object.freeze({
|
|
|
25
26
|
webpackCore: '5.112.2',
|
|
26
27
|
webpackCli: '6.0.1',
|
|
27
28
|
router: '4.6.4',
|
|
28
|
-
nativeRouter: '0.1.0
|
|
29
|
+
nativeRouter: '0.1.0',
|
|
30
|
+
macosNodeApi: '0.5.0-beta.0',
|
|
31
|
+
windowsNapi: '1.0.0-beta.20',
|
|
32
|
+
esbuild: '0.25.12',
|
|
29
33
|
})
|
|
30
34
|
|
|
31
35
|
/** Tools a project needs. The creator and doctor check against these, not their own numbers. */
|
|
@@ -33,7 +37,9 @@ export const requirements = Object.freeze({
|
|
|
33
37
|
node: '22.16',
|
|
34
38
|
packageManagers: Object.freeze({ npm: null, pnpm: '10.26', yarn: null }),
|
|
35
39
|
native: 'the NativeScript CLI, a JDK and the Android SDK; macOS and Xcode for iOS',
|
|
36
|
-
macos: 'macOS
|
|
40
|
+
macos: 'macOS 13.3+ on Apple Silicon, Node 22.23.3+; Xcode command line tools for packaging',
|
|
41
|
+
swiftui: 'macOS 14+ and Xcode',
|
|
42
|
+
windows: 'Windows 10 build 18362+ (x64/arm64), Node 22.23.3+ and Windows SDK Manifest Tool',
|
|
37
43
|
})
|
|
38
44
|
|
|
39
45
|
const issueOf = (id) => adapters.planned.find((adapter) => adapter.id === id)?.issue
|
|
@@ -63,21 +69,69 @@ export const catalog = Object.freeze({
|
|
|
63
69
|
},
|
|
64
70
|
macos: {
|
|
65
71
|
label: 'Mac',
|
|
66
|
-
hint: '
|
|
67
|
-
toolkit: '
|
|
68
|
-
adapter: '
|
|
72
|
+
hint: 'NativeScript AppKit · SwiftUI also available (experimental)',
|
|
73
|
+
toolkit: 'nativescript-appkit',
|
|
74
|
+
adapter: 'vue-appkit',
|
|
75
|
+
runtimes: ['appkit', 'swiftui'],
|
|
76
|
+
status: 'experimental',
|
|
77
|
+
},
|
|
78
|
+
windows: {
|
|
79
|
+
label: 'Windows',
|
|
80
|
+
hint: 'NativeScript XAML Islands (experimental)',
|
|
81
|
+
toolkit: 'nativescript-xaml',
|
|
82
|
+
adapter: 'vue-windows',
|
|
69
83
|
status: 'experimental',
|
|
70
84
|
},
|
|
71
85
|
}),
|
|
86
|
+
macosRuntimes: Object.freeze({
|
|
87
|
+
appkit: { label: 'NativeScript AppKit', hint: 'Vue runs directly with native AppKit controls' },
|
|
88
|
+
swiftui: { label: 'SwiftUI', hint: 'Compile shared Vue or TSX to Swift · existing pipeline' },
|
|
89
|
+
}),
|
|
72
90
|
frameworks: Object.freeze({
|
|
73
91
|
vue: { label: 'Vue', status: 'validated' },
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
92
|
+
plain: {
|
|
93
|
+
label: 'JavaScript / TypeScript',
|
|
94
|
+
status: 'experimental',
|
|
95
|
+
targets: ['native'],
|
|
96
|
+
since: '0.1.0-rc.15',
|
|
97
|
+
},
|
|
98
|
+
react: {
|
|
99
|
+
label: 'React',
|
|
100
|
+
status: 'experimental',
|
|
101
|
+
targets: ['native'],
|
|
102
|
+
since: '0.1.0-rc.15',
|
|
103
|
+
webIssue: issueOf('react-web'),
|
|
104
|
+
},
|
|
105
|
+
angular: {
|
|
106
|
+
label: 'Angular',
|
|
107
|
+
status: 'experimental',
|
|
108
|
+
targets: ['native'],
|
|
109
|
+
since: '0.1.0-rc.15',
|
|
110
|
+
webIssue: issueOf('angular-web'),
|
|
111
|
+
},
|
|
112
|
+
svelte: {
|
|
113
|
+
label: 'Svelte',
|
|
114
|
+
status: 'experimental',
|
|
115
|
+
targets: ['native'],
|
|
116
|
+
since: '0.1.0-rc.15',
|
|
117
|
+
webIssue: issueOf('svelte-web'),
|
|
118
|
+
},
|
|
119
|
+
solid: {
|
|
120
|
+
label: 'Solid',
|
|
121
|
+
status: 'experimental',
|
|
122
|
+
targets: ['native'],
|
|
123
|
+
since: '0.1.0-rc.15',
|
|
124
|
+
webIssue: issueOf('solid-web'),
|
|
125
|
+
},
|
|
78
126
|
}),
|
|
79
127
|
// How screens are written, and what runs: the components directly, or code generated from them.
|
|
80
128
|
authoring: Object.freeze({
|
|
129
|
+
native: {
|
|
130
|
+
label: 'Direct framework components',
|
|
131
|
+
mode: 'direct',
|
|
132
|
+
execution: 'components',
|
|
133
|
+
status: 'experimental',
|
|
134
|
+
},
|
|
81
135
|
vue: { label: 'Vue templates', mode: 'direct', execution: 'components', status: 'validated' },
|
|
82
136
|
mitosis: {
|
|
83
137
|
label: 'Shared TSX',
|
|
@@ -117,7 +171,7 @@ export const catalog = Object.freeze({
|
|
|
117
171
|
welcome: {
|
|
118
172
|
label: 'Basic project',
|
|
119
173
|
hint: 'One shared screen to build on',
|
|
120
|
-
authoring: ['vue', 'mitosis'],
|
|
174
|
+
authoring: ['vue', 'mitosis', 'native'],
|
|
121
175
|
since: '0.1.0-alpha.6',
|
|
122
176
|
},
|
|
123
177
|
directory: {
|
|
@@ -145,7 +199,7 @@ export const catalog = Object.freeze({
|
|
|
145
199
|
})
|
|
146
200
|
|
|
147
201
|
/** The combinations of targets the creator scaffolds, and how each has been validated. */
|
|
148
|
-
|
|
202
|
+
const swiftCombinations = [
|
|
149
203
|
{ targets: ['web'], authoring: 'vue', status: 'validated', since: '0.1.0-alpha.6' },
|
|
150
204
|
{ targets: ['native'], authoring: 'vue', status: 'validated', since: '0.1.0-alpha.6' },
|
|
151
205
|
{ targets: ['web', 'native'], authoring: 'vue', status: 'validated', since: '0.1.0-alpha.6' },
|
|
@@ -168,6 +222,30 @@ export const combinations = Object.freeze([
|
|
|
168
222
|
status: 'experimental',
|
|
169
223
|
since: '0.1.0-rc.13',
|
|
170
224
|
},
|
|
225
|
+
]
|
|
226
|
+
|
|
227
|
+
export const combinations = Object.freeze([
|
|
228
|
+
...['plain', 'react', 'angular', 'svelte', 'solid'].map((framework) => ({
|
|
229
|
+
targets: ['native'],
|
|
230
|
+
framework,
|
|
231
|
+
authoring: 'native',
|
|
232
|
+
status: 'experimental',
|
|
233
|
+
since: '0.1.0-rc.15',
|
|
234
|
+
})),
|
|
235
|
+
...swiftCombinations.map((entry) =>
|
|
236
|
+
entry.targets.includes('macos') ? { ...entry, macosRuntime: 'swiftui' } : entry,
|
|
237
|
+
),
|
|
238
|
+
...Array.from({ length: 15 }, (_, i) =>
|
|
239
|
+
['web', 'native', 'macos', 'windows'].filter((_, bit) => (i + 1) & (1 << bit)),
|
|
240
|
+
)
|
|
241
|
+
.filter((targets) => targets.includes('macos') || targets.includes('windows'))
|
|
242
|
+
.map((targets) => ({
|
|
243
|
+
targets,
|
|
244
|
+
authoring: 'vue',
|
|
245
|
+
macosRuntime: targets.includes('macos') ? 'appkit' : undefined,
|
|
246
|
+
status: 'experimental',
|
|
247
|
+
since: '0.1.0-rc.15',
|
|
248
|
+
})),
|
|
171
249
|
])
|
|
172
250
|
|
|
173
251
|
export const targetNames = Object.freeze(Object.keys(catalog.targets))
|
|
@@ -221,7 +299,7 @@ export function parseTargets(value) {
|
|
|
221
299
|
reject({
|
|
222
300
|
code: 'unknown',
|
|
223
301
|
option: '--targets',
|
|
224
|
-
message: `Targets are a comma-separated list of web, native and
|
|
302
|
+
message: `Targets are a comma-separated list of web, native, macos and windows, for example --targets macos,windows.`,
|
|
225
303
|
})
|
|
226
304
|
return targetNames.filter((name) => list.includes(name))
|
|
227
305
|
}
|
|
@@ -235,7 +313,9 @@ export function projectTargets(config) {
|
|
|
235
313
|
}
|
|
236
314
|
|
|
237
315
|
// The scaffold each combination uses. Combinations with Mac share TSX sources.
|
|
238
|
-
export function layoutOf(targets) {
|
|
316
|
+
export function layoutOf(targets, macosRuntime = 'swiftui') {
|
|
317
|
+
if (targets.includes('windows') || (targets.includes('macos') && macosRuntime === 'appkit'))
|
|
318
|
+
return 'desktop'
|
|
239
319
|
if (targets.includes('macos')) return 'macos'
|
|
240
320
|
if (targets.length === 2) return 'both'
|
|
241
321
|
return targets[0] === 'native' ? 'mobile' : 'web'
|
|
@@ -252,8 +332,20 @@ export function chosenTargets(options) {
|
|
|
252
332
|
}
|
|
253
333
|
|
|
254
334
|
/** Published and validated, published as an experiment, or only in the repository so far. */
|
|
255
|
-
export function availabilityOf({
|
|
256
|
-
|
|
335
|
+
export function availabilityOf({
|
|
336
|
+
targets,
|
|
337
|
+
example,
|
|
338
|
+
web,
|
|
339
|
+
macosRuntime = 'swiftui',
|
|
340
|
+
framework = 'vue',
|
|
341
|
+
}) {
|
|
342
|
+
const combination = combinations.find(
|
|
343
|
+
(entry) =>
|
|
344
|
+
entry.targets.join() === targets.join() &&
|
|
345
|
+
(entry.framework ?? 'vue') === framework &&
|
|
346
|
+
(!entry.macosRuntime || entry.macosRuntime === macosRuntime),
|
|
347
|
+
)
|
|
348
|
+
if (!combination) return 'repository'
|
|
257
349
|
if (
|
|
258
350
|
combination.since === null ||
|
|
259
351
|
catalog.examples[example].since === null ||
|
|
@@ -271,13 +363,22 @@ const availabilityLabels = {
|
|
|
271
363
|
export const availabilityLabel = (availability) => availabilityLabels[availability]
|
|
272
364
|
|
|
273
365
|
// One entry per target: what renders it and how. Vue runs the Web and Native apps today.
|
|
274
|
-
function appsOf({ targets, framework, web, rendering }) {
|
|
366
|
+
function appsOf({ targets, framework, web, rendering, macosRuntime = 'swiftui' }) {
|
|
275
367
|
return Object.fromEntries(
|
|
276
368
|
targets.map((target) => {
|
|
277
369
|
const { toolkit, platforms } = catalog.targets[target]
|
|
278
370
|
if (target === 'web') return [target, { toolkit, framework, host: web, rendering }]
|
|
279
371
|
if (target === 'native') return [target, { toolkit, framework, platforms: [...platforms] }]
|
|
280
|
-
return [
|
|
372
|
+
return [
|
|
373
|
+
target,
|
|
374
|
+
target === 'macos' && macosRuntime === 'swiftui'
|
|
375
|
+
? { toolkit: 'swiftui', framework: null }
|
|
376
|
+
: {
|
|
377
|
+
toolkit,
|
|
378
|
+
framework,
|
|
379
|
+
runtime: target === 'macos' ? versions.macosNodeApi : versions.windowsNapi,
|
|
380
|
+
},
|
|
381
|
+
]
|
|
281
382
|
}),
|
|
282
383
|
)
|
|
283
384
|
}
|
|
@@ -306,7 +407,30 @@ export function resolvePreset(options) {
|
|
|
306
407
|
})
|
|
307
408
|
targets = [...legacyTargets[options.target ?? 'web']]
|
|
308
409
|
}
|
|
309
|
-
const
|
|
410
|
+
const macosRuntime =
|
|
411
|
+
options.macosRuntime ??
|
|
412
|
+
options['macos-runtime'] ??
|
|
413
|
+
(options.target === 'macos' ? 'swiftui' : 'appkit')
|
|
414
|
+
if (!catalog.macosRuntimes[macosRuntime])
|
|
415
|
+
reject({
|
|
416
|
+
code: 'unknown',
|
|
417
|
+
option: '--macos-runtime',
|
|
418
|
+
message: 'Mac runtime must be appkit or swiftui.',
|
|
419
|
+
})
|
|
420
|
+
if ((options.macosRuntime || options['macos-runtime']) && !targets.includes('macos'))
|
|
421
|
+
reject({
|
|
422
|
+
code: 'incompatible',
|
|
423
|
+
option: '--macos-runtime',
|
|
424
|
+
message: '--macos-runtime requires the macos target.',
|
|
425
|
+
})
|
|
426
|
+
if (targets.includes('windows') && targets.includes('macos') && macosRuntime === 'swiftui')
|
|
427
|
+
reject({
|
|
428
|
+
code: 'incompatible',
|
|
429
|
+
option: '--macos-runtime',
|
|
430
|
+
message:
|
|
431
|
+
'Windows shares direct Vue screens with AppKit. Create the SwiftUI app separately or choose --macos-runtime appkit.',
|
|
432
|
+
})
|
|
433
|
+
const target = layoutOf(targets, macosRuntime)
|
|
310
434
|
const mac = target === 'macos'
|
|
311
435
|
const {
|
|
312
436
|
name,
|
|
@@ -314,7 +438,11 @@ export function resolvePreset(options) {
|
|
|
314
438
|
rendering = web === 'nuxt' ? 'ssr' : 'client',
|
|
315
439
|
theme = 'mavis',
|
|
316
440
|
framework = 'vue',
|
|
317
|
-
authoring =
|
|
441
|
+
authoring = framework !== 'vue'
|
|
442
|
+
? 'native'
|
|
443
|
+
: mac && options.example !== 'directory'
|
|
444
|
+
? 'mitosis'
|
|
445
|
+
: 'vue',
|
|
318
446
|
example = 'welcome',
|
|
319
447
|
packageManager = 'npm',
|
|
320
448
|
familiar,
|
|
@@ -339,14 +467,18 @@ export function resolvePreset(options) {
|
|
|
339
467
|
option: '--familiar',
|
|
340
468
|
message: `--familiar is one of ${catalog.familiar.join(', ')}. It only shapes the recommendation.`,
|
|
341
469
|
})
|
|
342
|
-
if (framework
|
|
470
|
+
if (!catalog.frameworks[framework])
|
|
471
|
+
reject({
|
|
472
|
+
code: 'unknown',
|
|
473
|
+
option: '--framework',
|
|
474
|
+
message: 'Framework must be vue, plain, react, angular, svelte or solid.',
|
|
475
|
+
})
|
|
476
|
+
if (framework !== 'vue' && (targets.length !== 1 || targets[0] !== 'native'))
|
|
343
477
|
reject({
|
|
344
|
-
code:
|
|
478
|
+
code: 'incompatible',
|
|
345
479
|
option: '--framework',
|
|
346
|
-
message:
|
|
347
|
-
|
|
348
|
-
issue: catalog.frameworks[framework]?.issue,
|
|
349
|
-
alternatives: available(catalog.frameworks).map((name) => `--framework ${name}`),
|
|
480
|
+
message: `${framework} currently has an iOS/Android starter only. Web, AppKit and Windows hosts use Vue.`,
|
|
481
|
+
alternatives: [`--targets native --framework ${framework}`, '--framework vue'],
|
|
350
482
|
})
|
|
351
483
|
if (!catalog.themes[theme])
|
|
352
484
|
reject({ code: 'unknown', option: '--theme', message: 'Theme must be mavis or midnight.' })
|
|
@@ -378,6 +510,75 @@ export function resolvePreset(options) {
|
|
|
378
510
|
message: 'Choose client rendering for Vite or ssr/ssg for Nuxt.',
|
|
379
511
|
alternatives: catalog.hosts[web].rendering.map((mode) => `--rendering ${mode}`),
|
|
380
512
|
})
|
|
513
|
+
if (framework !== 'vue') {
|
|
514
|
+
if (example !== 'welcome' || authoring !== 'native')
|
|
515
|
+
reject({
|
|
516
|
+
code: 'incompatible',
|
|
517
|
+
option: '--example',
|
|
518
|
+
message:
|
|
519
|
+
'Direct native framework starters provide the welcome example with framework components.',
|
|
520
|
+
alternatives: ['--example welcome --authoring native'],
|
|
521
|
+
})
|
|
522
|
+
return describe({
|
|
523
|
+
schemaVersion,
|
|
524
|
+
name,
|
|
525
|
+
targets,
|
|
526
|
+
target: 'mobile',
|
|
527
|
+
apps: appsOf({ targets, framework }),
|
|
528
|
+
framework,
|
|
529
|
+
authoring,
|
|
530
|
+
mode: 'direct',
|
|
531
|
+
execution: 'components',
|
|
532
|
+
example,
|
|
533
|
+
web: null,
|
|
534
|
+
rendering: null,
|
|
535
|
+
theme,
|
|
536
|
+
packageManager,
|
|
537
|
+
...(familiar ? { familiar } : {}),
|
|
538
|
+
experimental: 'direct-native-framework',
|
|
539
|
+
versions,
|
|
540
|
+
})
|
|
541
|
+
}
|
|
542
|
+
if (target === 'desktop') {
|
|
543
|
+
if (authoring !== 'vue' || example === 'tasks')
|
|
544
|
+
reject({
|
|
545
|
+
code: 'incompatible',
|
|
546
|
+
option: '--authoring',
|
|
547
|
+
message:
|
|
548
|
+
'NativeScript desktop currently supports shared Vue with welcome or directory. Tasks uses the separate SwiftUI compiler.',
|
|
549
|
+
alternatives: [
|
|
550
|
+
'--example welcome',
|
|
551
|
+
'--example directory',
|
|
552
|
+
'--targets macos --macos-runtime swiftui --example tasks',
|
|
553
|
+
],
|
|
554
|
+
})
|
|
555
|
+
return describe({
|
|
556
|
+
schemaVersion,
|
|
557
|
+
name,
|
|
558
|
+
targets,
|
|
559
|
+
target,
|
|
560
|
+
...(targets.includes('macos') ? { macosRuntime } : {}),
|
|
561
|
+
apps: appsOf({
|
|
562
|
+
targets,
|
|
563
|
+
framework,
|
|
564
|
+
web: hasWeb ? web : null,
|
|
565
|
+
rendering: hasWeb ? rendering : null,
|
|
566
|
+
macosRuntime,
|
|
567
|
+
}),
|
|
568
|
+
framework,
|
|
569
|
+
authoring,
|
|
570
|
+
mode: 'direct',
|
|
571
|
+
execution: 'components',
|
|
572
|
+
example,
|
|
573
|
+
web: hasWeb ? web : null,
|
|
574
|
+
rendering: hasWeb ? rendering : null,
|
|
575
|
+
theme,
|
|
576
|
+
packageManager,
|
|
577
|
+
...(familiar ? { familiar } : {}),
|
|
578
|
+
experimental: 'nativescript-desktop',
|
|
579
|
+
versions,
|
|
580
|
+
})
|
|
581
|
+
}
|
|
381
582
|
if (mac) {
|
|
382
583
|
const portableAuthoring = catalog.examples[example].portableAuthoring ?? 'mitosis'
|
|
383
584
|
if (authoring !== portableAuthoring)
|
|
@@ -402,6 +603,7 @@ export function resolvePreset(options) {
|
|
|
402
603
|
name,
|
|
403
604
|
targets,
|
|
404
605
|
target,
|
|
606
|
+
macosRuntime: 'swiftui',
|
|
405
607
|
apps: appsOf({
|
|
406
608
|
targets,
|
|
407
609
|
framework,
|
|
@@ -489,12 +691,9 @@ export function checkProject(options) {
|
|
|
489
691
|
/** What someone coming from another framework should pick. Advice only: nothing is preselected. */
|
|
490
692
|
export function recommendation(familiar, targets) {
|
|
491
693
|
if (!familiar || familiar === 'vue' || familiar === 'other') return undefined
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
? 'Coming from React: shared TSX screens read like function components with a store. They are compiled to Vue for the Web and Native; React itself is not running.'
|
|
496
|
-
: `Coming from React: screens here are Vue templates and Vue runs them. A React adapter is tracked in #${catalog.frameworks.react.issue}; shared TSX, which reads closer to React, comes with the Mac target.`
|
|
497
|
-
return `Coming from ${catalog.frameworks[familiar].label}: Vue runs the Web and Native apps today. A ${catalog.frameworks[familiar].label} adapter is tracked in #${catalog.frameworks[familiar].issue}.`
|
|
694
|
+
return targets.length === 1 && targets[0] === 'native'
|
|
695
|
+
? `Coming from ${catalog.frameworks[familiar].label}: select --framework ${familiar} for its direct iOS/Android component subset, or Vue for the full native catalog.`
|
|
696
|
+
: `These Web and desktop hosts use Vue. Direct ${catalog.frameworks[familiar].label} starters are available separately with --targets native --framework ${familiar}.`
|
|
498
697
|
}
|
|
499
698
|
|
|
500
699
|
/** What mavis.config.json records: targets instead of the internal layout name. */
|
|
@@ -519,12 +718,16 @@ export function migrateConfig(config) {
|
|
|
519
718
|
const authoring = config.authoring ?? (targets.includes('macos') ? 'mitosis' : 'vue')
|
|
520
719
|
const web = hasWeb ? (config.web ?? 'vite') : null
|
|
521
720
|
const rendering = hasWeb ? (config.rendering ?? (web === 'nuxt' ? 'ssr' : 'client')) : null
|
|
721
|
+
const macosRuntime =
|
|
722
|
+
config.macosRuntime ??
|
|
723
|
+
(config.apps?.macos?.toolkit === 'nativescript-appkit' ? 'appkit' : 'swiftui')
|
|
522
724
|
const { target: _target, ...rest } = config
|
|
523
725
|
return {
|
|
524
726
|
...rest,
|
|
525
727
|
schemaVersion,
|
|
526
728
|
targets,
|
|
527
|
-
apps: config.apps ?? appsOf({ targets, framework, web, rendering }),
|
|
729
|
+
apps: config.apps ?? appsOf({ targets, framework, web, rendering, macosRuntime }),
|
|
730
|
+
...(targets.includes('macos') ? { macosRuntime } : {}),
|
|
528
731
|
framework,
|
|
529
732
|
authoring,
|
|
530
733
|
mode: config.mode ?? catalog.authoring[authoring]?.mode ?? 'direct',
|
|
@@ -538,7 +741,7 @@ export function migrateConfig(config) {
|
|
|
538
741
|
export function normalizeConfig(config) {
|
|
539
742
|
const migrated = migrateConfig(config)
|
|
540
743
|
if (!migrated?.targets) return migrated
|
|
541
|
-
return { ...migrated, target: layoutOf(migrated.targets) }
|
|
744
|
+
return { ...migrated, target: layoutOf(migrated.targets, migrated.macosRuntime) }
|
|
542
745
|
}
|
|
543
746
|
|
|
544
747
|
/** The catalog as data: what `--capabilities --json` prints and CI reads. */
|
|
@@ -548,16 +751,45 @@ export function describeCapabilities() {
|
|
|
548
751
|
catalogVersion,
|
|
549
752
|
schemaVersion,
|
|
550
753
|
macos: macosCapabilities,
|
|
754
|
+
desktop: {
|
|
755
|
+
contracts: desktopComponents,
|
|
756
|
+
status: 'experimental',
|
|
757
|
+
since: '0.1.0-rc.15',
|
|
758
|
+
components: [
|
|
759
|
+
'MScreen',
|
|
760
|
+
'MColumn',
|
|
761
|
+
'MRow',
|
|
762
|
+
'MGrid',
|
|
763
|
+
'MText',
|
|
764
|
+
'MInput',
|
|
765
|
+
'MButton',
|
|
766
|
+
'MLink',
|
|
767
|
+
'MCard',
|
|
768
|
+
'MAlert',
|
|
769
|
+
'MEmptyState',
|
|
770
|
+
'MReveal',
|
|
771
|
+
],
|
|
772
|
+
limits: [
|
|
773
|
+
'Explicit property subset; unsupported properties fail at runtime.',
|
|
774
|
+
'MRow uses equal-width columns; MGrid adapts to minColumnWidth.',
|
|
775
|
+
'AppKit reveal: finite opacity through Jolt samples and Core Animation. Windows reveal: immediate visibility; no Jolt Windows driver.',
|
|
776
|
+
'NativeScript Core iOS/Android components are not desktop controls.',
|
|
777
|
+
],
|
|
778
|
+
macosRuntime: versions.macosNodeApi,
|
|
779
|
+
windowsRuntime: versions.windowsNapi,
|
|
780
|
+
},
|
|
781
|
+
macosRuntimes: entries(catalog.macosRuntimes),
|
|
551
782
|
creator: versions.mavis,
|
|
552
783
|
migrations: {
|
|
553
784
|
macos: {
|
|
554
785
|
flag: '--add-macos',
|
|
555
786
|
apply: '--write',
|
|
556
787
|
status: 'experimental',
|
|
557
|
-
since:
|
|
788
|
+
since: '0.1.0-rc.15',
|
|
558
789
|
hosts: ['vite', 'nuxt', 'nativescript'],
|
|
559
790
|
preservesSources: true,
|
|
560
|
-
|
|
791
|
+
runtimes: ['appkit', 'swiftui'],
|
|
792
|
+
compiler: 'SwiftUI only: @getcortexlabs/mavis-compiler',
|
|
561
793
|
},
|
|
562
794
|
},
|
|
563
795
|
combinations: combinations.map((combination) => ({
|
|
@@ -568,11 +800,16 @@ export function describeCapabilities() {
|
|
|
568
800
|
.filter(
|
|
569
801
|
([, example]) =>
|
|
570
802
|
example.authoring.includes(combination.authoring) ||
|
|
571
|
-
(combination.
|
|
803
|
+
(combination.macosRuntime === 'swiftui' && example.portableAuthoring),
|
|
572
804
|
)
|
|
573
805
|
.map(([id]) => ({
|
|
574
806
|
id,
|
|
575
|
-
availability: availabilityOf({
|
|
807
|
+
availability: availabilityOf({
|
|
808
|
+
targets: combination.targets,
|
|
809
|
+
example: id,
|
|
810
|
+
macosRuntime: combination.macosRuntime,
|
|
811
|
+
framework: combination.framework,
|
|
812
|
+
}),
|
|
576
813
|
})),
|
|
577
814
|
})),
|
|
578
815
|
targets: entries(catalog.targets),
|
|
@@ -597,7 +834,7 @@ export function formatCapabilities() {
|
|
|
597
834
|
const lines = ['What this creator can scaffold', '']
|
|
598
835
|
for (const combination of data.combinations) {
|
|
599
836
|
lines.push(
|
|
600
|
-
` --targets ${combination.targets.join(',').padEnd(18)} ${combination.label} · ${catalog.authoring[combination.authoring].label}`,
|
|
837
|
+
` --targets ${combination.targets.join(',').padEnd(18)} ${combination.label} · ${catalog.authoring[combination.authoring].label}${combination.framework ? ` · --framework ${combination.framework}` : ''}${combination.macosRuntime ? ` · --macos-runtime ${combination.macosRuntime}` : ''}`,
|
|
601
838
|
)
|
|
602
839
|
if (combination.hosts.length)
|
|
603
840
|
lines.push(
|
|
@@ -608,7 +845,16 @@ export function formatCapabilities() {
|
|
|
608
845
|
` --example ${example.id.padEnd(10)} ${availabilityLabel(example.availability)}`,
|
|
609
846
|
)
|
|
610
847
|
}
|
|
611
|
-
lines.push(
|
|
848
|
+
lines.push(
|
|
849
|
+
'',
|
|
850
|
+
'NativeScript desktop · experimental subset',
|
|
851
|
+
` ${data.desktop.components.join(', ')}`,
|
|
852
|
+
...data.desktop.limits.map((limit) => ` ${limit}`),
|
|
853
|
+
)
|
|
854
|
+
lines.push(
|
|
855
|
+
'',
|
|
856
|
+
'SwiftUI components · paused compiler inventory; not runtime validation or AppKit/Windows coverage',
|
|
857
|
+
)
|
|
612
858
|
for (const [name, component] of Object.entries(data.macos.components)) {
|
|
613
859
|
lines.push(
|
|
614
860
|
` ${name}: ${component.status} · ${component.props.length} Vue props · #${component.issue}`,
|