@getcortexlabs/create-mavis 0.1.0-rc.14 → 0.1.0-rc.16

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.
Files changed (69) hide show
  1. package/README.md +21 -28
  2. package/package.json +2 -4
  3. package/src/adapters.mjs +45 -23
  4. package/src/add-desktop.mjs +354 -0
  5. package/src/capabilities.mjs +233 -134
  6. package/src/cli.mjs +64 -60
  7. package/src/desktop.mjs +155 -0
  8. package/src/doctor.mjs +77 -108
  9. package/src/native-framework.mjs +144 -0
  10. package/src/portability.mjs +7 -106
  11. package/src/scaffold.mjs +36 -12
  12. package/src/shared-api.mjs +3 -0
  13. package/src/ui.mjs +30 -42
  14. package/templates/desktop/common/LICENSE +21 -0
  15. package/templates/desktop/common/build.mjs +49 -0
  16. package/templates/desktop/common/src/components.ts +60 -0
  17. package/templates/desktop/common/src/contract.mjs +35 -0
  18. package/templates/desktop/common/src/renderer.ts +76 -0
  19. package/templates/desktop/common/src/storage.ts +29 -0
  20. package/templates/desktop/directory/main.ts +35 -0
  21. package/templates/desktop/macos/launch.mjs +6 -0
  22. package/templates/desktop/macos/package.mjs +114 -0
  23. package/templates/desktop/macos/src/host.mjs +471 -0
  24. package/templates/desktop/welcome/Welcome.vue +56 -0
  25. package/templates/desktop/welcome/main.ts +24 -0
  26. package/templates/desktop/windows/NativeScript-LICENSE +19 -0
  27. package/templates/desktop/windows/launch.mjs +16 -0
  28. package/templates/desktop/windows/package.mjs +54 -0
  29. package/templates/desktop/windows/prepare-host.mjs +73 -0
  30. package/templates/desktop/windows/src/host.mjs +294 -0
  31. package/templates/native-framework/angular/screen.ts +84 -0
  32. package/templates/native-framework/common/nativescript.config.ts +6 -0
  33. package/templates/native-framework/common/src/app.ts +5 -0
  34. package/templates/native-framework/common/src/model.ts +40 -0
  35. package/templates/native-framework/common/src/references.d.ts +8 -0
  36. package/templates/native-framework/common/tsconfig.json +16 -0
  37. package/templates/native-framework/common/webpack.config.js +67 -0
  38. package/templates/native-framework/plain/screen.ts +102 -0
  39. package/templates/native-framework/react/screen.ts +83 -0
  40. package/templates/native-framework/solid/screen.ts +111 -0
  41. package/templates/native-framework/svelte/Welcome.svelte +26 -0
  42. package/templates/native-framework/svelte/screen.ts +14 -0
  43. package/templates/native-framework/svelte-tooling/svelte.config.js +20 -0
  44. package/src/add-macos.mjs +0 -386
  45. package/src/macos-capabilities.generated.mjs +0 -4190
  46. package/src/macos.mjs +0 -394
  47. package/src/migrate-directory.mjs +0 -121
  48. package/templates/directory/macos/DirectoryStorage.swift +0 -68
  49. package/templates/macos/examples/tasks/shared/TaskDetail.lite.tsx +0 -57
  50. package/templates/macos/examples/tasks/shared/TaskRow.lite.tsx +0 -33
  51. package/templates/macos/examples/tasks/shared/Tasks.lite.tsx +0 -251
  52. package/templates/macos/examples/tasks/shared/types.ts +0 -10
  53. package/templates/macos/mobile/src/App.vue +0 -14
  54. package/templates/macos/mobile/src/app.ts +0 -7
  55. package/templates/macos/native/Package.swift +0 -19
  56. package/templates/macos/native/Sources/MavisDesktop/App.swift +0 -35
  57. package/templates/macos/native/Sources/MavisDesktop/Fonts/LICENSE +0 -45
  58. package/templates/macos/native/Sources/MavisDesktop/Fonts/lucide.ttf +0 -0
  59. package/templates/macos/root/tsconfig.json +0 -14
  60. package/templates/macos/scripts/generate.mjs +0 -13
  61. package/templates/macos/scripts/macos-manifest.mjs +0 -33
  62. package/templates/macos/scripts/macos.mjs +0 -58
  63. package/templates/macos/shared/Welcome.lite.tsx +0 -42
  64. package/templates/macos/web/index.html +0 -12
  65. package/templates/macos/web/src/main.js +0 -212
  66. package/templates/macos/web/src/mavis.js +0 -2
  67. package/templates/macos/web/src/style.css +0 -14
  68. package/templates/macos/web/vite.config.mjs +0 -14
  69. package/templates/migrations/directory-rc13.json +0 -36
@@ -1,5 +1,5 @@
1
+ import { desktopComponents } from '../templates/desktop/common/src/contract.mjs'
1
2
  import { adapters } from './adapters.mjs'
2
- import { macosCapabilities } from './macos-capabilities.generated.mjs'
3
3
 
4
4
  /** Shape of `--capabilities --json`, for tools that read it. */
5
5
  export const catalogVersion = 1
@@ -8,8 +8,8 @@ export const schemaVersion = 2
8
8
 
9
9
  /** Baseline pins; coordinated releases update Mavis after validating source templates with matching tarballs. */
10
10
  export const versions = Object.freeze({
11
- mavis: '0.1.0-rc.14',
12
- jolt: '0.1.0-rc.15',
11
+ mavis: '0.1.0-rc.16',
12
+ jolt: '0.1.0-rc.18',
13
13
  vue: '3.5.44',
14
14
  nuxt: '4.6.3',
15
15
  vite: '6.4.5',
@@ -17,7 +17,7 @@ export const versions = Object.freeze({
17
17
  typescript: '6.0.3',
18
18
  nodeTypes: '26.6.6',
19
19
  vueTsc: '3.3.13',
20
- nativeCore: '9.1.3',
20
+ nativeCore: '9.1.4',
21
21
  nativeVue: '3.1.3',
22
22
  android: '9.1.1',
23
23
  ios: '9.1.0',
@@ -25,7 +25,10 @@ export const versions = Object.freeze({
25
25
  webpackCore: '5.112.2',
26
26
  webpackCli: '6.0.1',
27
27
  router: '4.6.4',
28
- nativeRouter: '0.1.0-rc.4',
28
+ nativeRouter: '0.1.0',
29
+ macosNodeApi: '0.5.0-beta.0',
30
+ windowsNapi: '1.0.0-beta.20',
31
+ esbuild: '0.25.12',
29
32
  })
30
33
 
31
34
  /** Tools a project needs. The creator and doctor check against these, not their own numbers. */
@@ -33,7 +36,8 @@ export const requirements = Object.freeze({
33
36
  node: '22.16',
34
37
  packageManagers: Object.freeze({ npm: null, pnpm: '10.26', yarn: null }),
35
38
  native: 'the NativeScript CLI, a JDK and the Android SDK; macOS and Xcode for iOS',
36
- macos: 'macOS 14+ and Xcode',
39
+ macos: 'macOS 13.3+ on Apple Silicon, Node 22.23.3+; Xcode command line tools for packaging',
40
+ windows: 'Windows 10 build 18362+ (x64/arm64), Node 22.23.3+ and Windows SDK Manifest Tool',
37
41
  })
38
42
 
39
43
  const issueOf = (id) => adapters.planned.find((adapter) => adapter.id === id)?.issue
@@ -63,33 +67,73 @@ export const catalog = Object.freeze({
63
67
  },
64
68
  macos: {
65
69
  label: 'Mac',
66
- hint: 'A SwiftUI app · shared Vue or TSX (experimental)',
67
- toolkit: 'swiftui',
68
- adapter: 'macos-swiftui',
70
+ hint: 'NativeScript AppKit (experimental)',
71
+ toolkit: 'nativescript-appkit',
72
+ adapter: 'vue-appkit',
73
+ runtimes: ['appkit'],
69
74
  status: 'experimental',
70
75
  },
76
+ windows: {
77
+ label: 'Windows',
78
+ hint: 'NativeScript XAML Islands (experimental)',
79
+ toolkit: 'nativescript-xaml',
80
+ adapter: 'vue-windows',
81
+ status: 'experimental',
82
+ },
83
+ }),
84
+ macosRuntimes: Object.freeze({
85
+ appkit: { label: 'NativeScript AppKit', hint: 'Vue runs directly with native AppKit controls' },
71
86
  }),
72
87
  frameworks: Object.freeze({
73
88
  vue: { label: 'Vue', status: 'validated' },
74
- react: planned(issueOf('react-web'), 'React'),
75
- angular: planned(issueOf('angular-web'), 'Angular'),
76
- svelte: planned(issueOf('svelte-web'), 'Svelte'),
77
- solid: planned(issueOf('solid-web'), 'Solid'),
89
+ plain: {
90
+ label: 'JavaScript / TypeScript',
91
+ status: 'experimental',
92
+ targets: ['native'],
93
+ since: '0.1.0-rc.15',
94
+ },
95
+ react: {
96
+ label: 'React',
97
+ status: 'experimental',
98
+ targets: ['native'],
99
+ since: '0.1.0-rc.15',
100
+ webIssue: issueOf('react-web'),
101
+ },
102
+ angular: {
103
+ label: 'Angular',
104
+ status: 'experimental',
105
+ targets: ['native'],
106
+ since: '0.1.0-rc.15',
107
+ webIssue: issueOf('angular-web'),
108
+ },
109
+ svelte: {
110
+ label: 'Svelte',
111
+ status: 'experimental',
112
+ targets: ['native'],
113
+ since: '0.1.0-rc.15',
114
+ webIssue: issueOf('svelte-web'),
115
+ },
116
+ solid: {
117
+ label: 'Solid',
118
+ status: 'experimental',
119
+ targets: ['native'],
120
+ since: '0.1.0-rc.15',
121
+ webIssue: issueOf('solid-web'),
122
+ },
78
123
  }),
79
124
  // How screens are written, and what runs: the components directly, or code generated from them.
80
125
  authoring: Object.freeze({
81
- vue: { label: 'Vue templates', mode: 'direct', execution: 'components', status: 'validated' },
82
- mitosis: {
83
- label: 'Shared TSX',
84
- mode: 'portable',
85
- execution: 'generated',
126
+ native: {
127
+ label: 'Direct framework components',
128
+ mode: 'direct',
129
+ execution: 'components',
86
130
  status: 'experimental',
87
131
  },
132
+ vue: { label: 'Vue templates', mode: 'direct', execution: 'components', status: 'validated' },
88
133
  jsx: planned(167, 'React-style JSX compiled for Vue'),
89
134
  }),
90
135
  execution: Object.freeze({
91
136
  components: { label: 'Mavis components in the app', status: 'validated' },
92
- generated: { label: 'Code generated for each target', status: 'experimental' },
93
137
  sdui: planned(173, 'Screens delivered as data'),
94
138
  }),
95
139
  hosts: Object.freeze({
@@ -104,7 +148,6 @@ export const catalog = Object.freeze({
104
148
  hint: 'Server rendering or a static website',
105
149
  rendering: ['ssr', 'ssg'],
106
150
  status: 'validated',
107
- portableSince: '0.1.0-rc.14',
108
151
  },
109
152
  next: planned(issueOf('next'), 'Next.js'),
110
153
  }),
@@ -117,23 +160,15 @@ export const catalog = Object.freeze({
117
160
  welcome: {
118
161
  label: 'Basic project',
119
162
  hint: 'One shared screen to build on',
120
- authoring: ['vue', 'mitosis'],
163
+ authoring: ['vue', 'native'],
121
164
  since: '0.1.0-alpha.6',
122
165
  },
123
166
  directory: {
124
167
  label: 'Search, details and editing',
125
168
  hint: 'Shared routes, forms and local persistence',
126
169
  authoring: ['vue'],
127
- portableAuthoring: 'vue',
128
- portableSince: '0.1.0-rc.14',
129
170
  since: '0.1.0-alpha.9',
130
171
  },
131
- tasks: {
132
- label: 'Tasks',
133
- hint: 'List and detail, forms, shortcuts and motion from one source',
134
- authoring: ['mitosis'],
135
- since: '0.1.0-rc.13',
136
- },
137
172
  }),
138
173
  themes: Object.freeze({
139
174
  mavis: { label: 'Mavis', hint: 'Light, warm and soft' },
@@ -145,29 +180,32 @@ export const catalog = Object.freeze({
145
180
  })
146
181
 
147
182
  /** The combinations of targets the creator scaffolds, and how each has been validated. */
148
- export const combinations = Object.freeze([
183
+ const vueCombinations = [
149
184
  { targets: ['web'], authoring: 'vue', status: 'validated', since: '0.1.0-alpha.6' },
150
185
  { targets: ['native'], authoring: 'vue', status: 'validated', since: '0.1.0-alpha.6' },
151
186
  { targets: ['web', 'native'], authoring: 'vue', status: 'validated', since: '0.1.0-alpha.6' },
152
- { targets: ['macos'], authoring: 'mitosis', status: 'experimental', since: '0.1.0-rc.13' },
153
- {
154
- targets: ['web', 'macos'],
155
- authoring: 'mitosis',
156
- status: 'experimental',
157
- since: '0.1.0-rc.12.2',
158
- },
159
- {
160
- targets: ['native', 'macos'],
161
- authoring: 'mitosis',
162
- status: 'experimental',
163
- since: '0.1.0-rc.13',
164
- },
165
- {
166
- targets: ['web', 'native', 'macos'],
167
- authoring: 'mitosis',
187
+ ]
188
+
189
+ export const combinations = Object.freeze([
190
+ ...['plain', 'react', 'angular', 'svelte', 'solid'].map((framework) => ({
191
+ targets: ['native'],
192
+ framework,
193
+ authoring: 'native',
168
194
  status: 'experimental',
169
- since: '0.1.0-rc.13',
170
- },
195
+ since: '0.1.0-rc.15',
196
+ })),
197
+ ...vueCombinations,
198
+ ...Array.from({ length: 15 }, (_, i) =>
199
+ ['web', 'native', 'macos', 'windows'].filter((_, bit) => (i + 1) & (1 << bit)),
200
+ )
201
+ .filter((targets) => targets.includes('macos') || targets.includes('windows'))
202
+ .map((targets) => ({
203
+ targets,
204
+ authoring: 'vue',
205
+ macosRuntime: targets.includes('macos') ? 'appkit' : undefined,
206
+ status: 'experimental',
207
+ since: '0.1.0-rc.15',
208
+ })),
171
209
  ])
172
210
 
173
211
  export const targetNames = Object.freeze(Object.keys(catalog.targets))
@@ -221,7 +259,7 @@ export function parseTargets(value) {
221
259
  reject({
222
260
  code: 'unknown',
223
261
  option: '--targets',
224
- message: `Targets are a comma-separated list of web, native and macos, for example --targets web,native,macos.`,
262
+ message: `Targets are a comma-separated list of web, native, macos and windows, for example --targets macos,windows.`,
225
263
  })
226
264
  return targetNames.filter((name) => list.includes(name))
227
265
  }
@@ -236,7 +274,7 @@ export function projectTargets(config) {
236
274
 
237
275
  // The scaffold each combination uses. Combinations with Mac share TSX sources.
238
276
  export function layoutOf(targets) {
239
- if (targets.includes('macos')) return 'macos'
277
+ if (targets.includes('windows') || targets.includes('macos')) return 'desktop'
240
278
  if (targets.length === 2) return 'both'
241
279
  return targets[0] === 'native' ? 'mobile' : 'web'
242
280
  }
@@ -252,15 +290,21 @@ export function chosenTargets(options) {
252
290
  }
253
291
 
254
292
  /** Published and validated, published as an experiment, or only in the repository so far. */
255
- export function availabilityOf({ targets, example, web }) {
256
- const combination = combinations.find((entry) => entry.targets.join() === targets.join())
257
- if (
258
- combination.since === null ||
259
- catalog.examples[example].since === null ||
260
- (targets.includes('macos') && catalog.examples[example].portableSince === null) ||
261
- (targets.includes('macos') && web && catalog.hosts[web]?.portableSince === null)
293
+ export function availabilityOf({
294
+ targets,
295
+ example,
296
+ web,
297
+ macosRuntime = 'appkit',
298
+ framework = 'vue',
299
+ }) {
300
+ const combination = combinations.find(
301
+ (entry) =>
302
+ entry.targets.join() === targets.join() &&
303
+ (entry.framework ?? 'vue') === framework &&
304
+ (!entry.macosRuntime || entry.macosRuntime === macosRuntime),
262
305
  )
263
- return 'repository'
306
+ if (!combination) return 'repository'
307
+ if (combination.since === null || catalog.examples[example].since === null) return 'repository'
264
308
  return combination.status === 'validated' ? 'published' : 'published-experimental'
265
309
  }
266
310
  const availabilityLabels = {
@@ -277,7 +321,14 @@ function appsOf({ targets, framework, web, rendering }) {
277
321
  const { toolkit, platforms } = catalog.targets[target]
278
322
  if (target === 'web') return [target, { toolkit, framework, host: web, rendering }]
279
323
  if (target === 'native') return [target, { toolkit, framework, platforms: [...platforms] }]
280
- return [target, { toolkit, framework: null }]
324
+ return [
325
+ target,
326
+ {
327
+ toolkit,
328
+ framework,
329
+ runtime: target === 'macos' ? versions.macosNodeApi : versions.windowsNapi,
330
+ },
331
+ ]
281
332
  }),
282
333
  )
283
334
  }
@@ -306,15 +357,27 @@ export function resolvePreset(options) {
306
357
  })
307
358
  targets = [...legacyTargets[options.target ?? 'web']]
308
359
  }
309
- const target = layoutOf(targets)
310
- const mac = target === 'macos'
360
+ const macosRuntime = options.macosRuntime ?? options['macos-runtime'] ?? 'appkit'
361
+ if (!catalog.macosRuntimes[macosRuntime])
362
+ reject({
363
+ code: 'unknown',
364
+ option: '--macos-runtime',
365
+ message: 'The macOS runtime is NativeScript AppKit.',
366
+ })
367
+ if ((options.macosRuntime || options['macos-runtime']) && !targets.includes('macos'))
368
+ reject({
369
+ code: 'incompatible',
370
+ option: '--macos-runtime',
371
+ message: '--macos-runtime requires the macos target.',
372
+ })
373
+ const target = layoutOf(targets, macosRuntime)
311
374
  const {
312
375
  name,
313
376
  web = 'vite',
314
377
  rendering = web === 'nuxt' ? 'ssr' : 'client',
315
378
  theme = 'mavis',
316
379
  framework = 'vue',
317
- authoring = mac && options.example !== 'directory' ? 'mitosis' : 'vue',
380
+ authoring = framework !== 'vue' ? 'native' : 'vue',
318
381
  example = 'welcome',
319
382
  packageManager = 'npm',
320
383
  familiar,
@@ -331,7 +394,7 @@ export function resolvePreset(options) {
331
394
  reject({
332
395
  code: 'unknown',
333
396
  option: '--example',
334
- message: 'Example must be welcome, directory or tasks.',
397
+ message: 'Example must be welcome or directory.',
335
398
  })
336
399
  if (familiar !== undefined && !catalog.familiar.includes(familiar))
337
400
  reject({
@@ -339,14 +402,18 @@ export function resolvePreset(options) {
339
402
  option: '--familiar',
340
403
  message: `--familiar is one of ${catalog.familiar.join(', ')}. It only shapes the recommendation.`,
341
404
  })
342
- if (framework !== 'vue')
405
+ if (!catalog.frameworks[framework])
406
+ reject({
407
+ code: 'unknown',
408
+ option: '--framework',
409
+ message: 'Framework must be vue, plain, react, angular, svelte or solid.',
410
+ })
411
+ if (framework !== 'vue' && (targets.length !== 1 || targets[0] !== 'native'))
343
412
  reject({
344
- code: catalog.frameworks[framework] ? 'planned' : 'unknown',
413
+ code: 'incompatible',
345
414
  option: '--framework',
346
- message:
347
- 'This creator currently supports Vue. Other framework adapters are tracked in Mavis #145 and #35–39.',
348
- issue: catalog.frameworks[framework]?.issue,
349
- alternatives: available(catalog.frameworks).map((name) => `--framework ${name}`),
415
+ message: `${framework} currently has an iOS/Android starter only. Web, AppKit and Windows hosts use Vue.`,
416
+ alternatives: [`--targets native --framework ${framework}`, '--framework vue'],
350
417
  })
351
418
  if (!catalog.themes[theme])
352
419
  reject({ code: 'unknown', option: '--theme', message: 'Theme must be mavis or midnight.' })
@@ -378,70 +445,71 @@ export function resolvePreset(options) {
378
445
  message: 'Choose client rendering for Vite or ssr/ssg for Nuxt.',
379
446
  alternatives: catalog.hosts[web].rendering.map((mode) => `--rendering ${mode}`),
380
447
  })
381
- if (mac) {
382
- const portableAuthoring = catalog.examples[example].portableAuthoring ?? 'mitosis'
383
- if (authoring !== portableAuthoring)
448
+ if (framework !== 'vue') {
449
+ if (example !== 'welcome' || authoring !== 'native')
384
450
  reject({
385
451
  code: 'incompatible',
386
- option: '--authoring',
387
- message: `With Mac, ${example} uses ${portableAuthoring === 'vue' ? 'shared Vue screens compiled to SwiftUI' : 'shared TSX sources compiled for every target'}. Choose --example directory for shared Vue.`,
388
- alternatives: [
389
- `--authoring ${portableAuthoring}`,
390
- `--targets ${targets.filter((t) => t !== 'macos').join(',') || 'web'}`,
391
- ],
452
+ option: '--example',
453
+ message:
454
+ 'Direct native framework starters provide the welcome example with framework components.',
455
+ alternatives: ['--example welcome --authoring native'],
392
456
  })
393
- if (!catalog.examples[example].authoring.includes(portableAuthoring))
457
+ return describe({
458
+ schemaVersion,
459
+ name,
460
+ targets,
461
+ target: 'mobile',
462
+ apps: appsOf({ targets, framework }),
463
+ framework,
464
+ authoring,
465
+ mode: 'direct',
466
+ execution: 'components',
467
+ example,
468
+ web: null,
469
+ rendering: null,
470
+ theme,
471
+ packageManager,
472
+ ...(familiar ? { familiar } : {}),
473
+ experimental: 'direct-native-framework',
474
+ versions,
475
+ })
476
+ }
477
+ if (target === 'desktop') {
478
+ if (authoring !== 'vue')
394
479
  reject({
395
480
  code: 'incompatible',
396
- option: '--example',
397
- message: `The ${example} example does not provide shared ${portableAuthoring} sources for Mac.`,
398
- alternatives: ['--example welcome', '--example directory', '--example tasks'],
481
+ option: '--authoring',
482
+ message:
483
+ 'NativeScript desktop currently supports shared Vue with welcome or directory. Choose welcome or directory.',
484
+ alternatives: ['--example welcome', '--example directory'],
399
485
  })
400
486
  return describe({
401
487
  schemaVersion,
402
488
  name,
403
489
  targets,
404
490
  target,
491
+ ...(targets.includes('macos') ? { macosRuntime } : {}),
405
492
  apps: appsOf({
406
493
  targets,
407
494
  framework,
408
495
  web: hasWeb ? web : null,
409
496
  rendering: hasWeb ? rendering : null,
497
+ macosRuntime,
410
498
  }),
411
499
  framework,
412
500
  authoring,
413
- mode: 'portable',
414
- execution: 'generated',
501
+ mode: 'direct',
502
+ execution: 'components',
415
503
  example,
416
504
  web: hasWeb ? web : null,
417
505
  rendering: hasWeb ? rendering : null,
418
506
  theme,
419
507
  packageManager,
420
508
  ...(familiar ? { familiar } : {}),
421
- experimental: 'shared-tsx',
509
+ experimental: 'nativescript-desktop',
422
510
  versions,
423
511
  })
424
512
  }
425
- if (authoring === 'mitosis')
426
- reject({
427
- code: 'incompatible',
428
- option: '--authoring',
429
- message:
430
- 'Shared TSX sources come with the Mac target (--targets web,native,macos). Without Mac, use Vue templates.',
431
- alternatives: ['--authoring vue', `--targets ${[...targets, 'macos'].join(',')}`],
432
- })
433
- if (!catalog.examples[example].authoring.includes('vue'))
434
- reject({
435
- code: 'incompatible',
436
- option: '--example',
437
- message:
438
- 'The tasks example is written as shared TSX and comes with the Mac target, for example --targets web,native,macos --example tasks.',
439
- alternatives: [
440
- '--example welcome',
441
- '--example directory',
442
- `--targets ${[...targets, 'macos'].join(',')}`,
443
- ],
444
- })
445
513
  if (authoring !== 'vue')
446
514
  reject({
447
515
  code: catalog.authoring[authoring] ? 'planned' : 'unknown',
@@ -489,12 +557,9 @@ export function checkProject(options) {
489
557
  /** What someone coming from another framework should pick. Advice only: nothing is preselected. */
490
558
  export function recommendation(familiar, targets) {
491
559
  if (!familiar || familiar === 'vue' || familiar === 'other') return undefined
492
- const mac = targets.includes('macos')
493
- if (familiar === 'react')
494
- return mac
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}.`
560
+ return targets.length === 1 && targets[0] === 'native'
561
+ ? `Coming from ${catalog.frameworks[familiar].label}: select --framework ${familiar} for its direct iOS/Android component subset, or Vue for the full native catalog.`
562
+ : `These Web and desktop hosts use Vue. Direct ${catalog.frameworks[familiar].label} starters are available separately with --targets native --framework ${familiar}.`
498
563
  }
499
564
 
500
565
  /** What mavis.config.json records: targets instead of the internal layout name. */
@@ -516,15 +581,27 @@ export function migrateConfig(config) {
516
581
  const targets = projectTargets(config)
517
582
  const hasWeb = targets.includes('web')
518
583
  const framework = config.framework ?? 'vue'
519
- const authoring = config.authoring ?? (targets.includes('macos') ? 'mitosis' : 'vue')
584
+ if (
585
+ targets.includes('macos') &&
586
+ (config.macosRuntime === 'swiftui' ||
587
+ config.apps?.macos?.toolkit === 'swiftui' ||
588
+ config.mode === 'portable' ||
589
+ (!config.macosRuntime && !config.apps?.macos && !config.desktop))
590
+ )
591
+ throw new Error(
592
+ 'This project uses the archived SwiftUI target. Use its pinned creator or the archive/swiftui branch.',
593
+ )
594
+ const authoring = config.authoring ?? 'vue'
520
595
  const web = hasWeb ? (config.web ?? 'vite') : null
521
596
  const rendering = hasWeb ? (config.rendering ?? (web === 'nuxt' ? 'ssr' : 'client')) : null
597
+ const macosRuntime = 'appkit'
522
598
  const { target: _target, ...rest } = config
523
599
  return {
524
600
  ...rest,
525
601
  schemaVersion,
526
602
  targets,
527
- apps: config.apps ?? appsOf({ targets, framework, web, rendering }),
603
+ apps: config.apps ?? appsOf({ targets, framework, web, rendering, macosRuntime }),
604
+ ...(targets.includes('macos') ? { macosRuntime } : {}),
528
605
  framework,
529
606
  authoring,
530
607
  mode: config.mode ?? catalog.authoring[authoring]?.mode ?? 'direct',
@@ -538,7 +615,7 @@ export function migrateConfig(config) {
538
615
  export function normalizeConfig(config) {
539
616
  const migrated = migrateConfig(config)
540
617
  if (!migrated?.targets) return migrated
541
- return { ...migrated, target: layoutOf(migrated.targets) }
618
+ return { ...migrated, target: layoutOf(migrated.targets, migrated.macosRuntime) }
542
619
  }
543
620
 
544
621
  /** The catalog as data: what `--capabilities --json` prints and CI reads. */
@@ -547,17 +624,44 @@ export function describeCapabilities() {
547
624
  return {
548
625
  catalogVersion,
549
626
  schemaVersion,
550
- macos: macosCapabilities,
627
+ desktop: {
628
+ contracts: desktopComponents,
629
+ status: 'experimental',
630
+ since: '0.1.0-rc.15',
631
+ components: [
632
+ 'MScreen',
633
+ 'MColumn',
634
+ 'MRow',
635
+ 'MGrid',
636
+ 'MText',
637
+ 'MInput',
638
+ 'MButton',
639
+ 'MLink',
640
+ 'MCard',
641
+ 'MAlert',
642
+ 'MEmptyState',
643
+ 'MReveal',
644
+ ],
645
+ limits: [
646
+ 'Explicit property subset; unsupported properties fail at runtime.',
647
+ 'MRow uses equal-width columns; MGrid adapts to minColumnWidth.',
648
+ 'MReveal fades in through Jolt AppKit (Core Animation) and Windows (XAML Storyboard), respecting system motion settings.',
649
+ 'NativeScript Core iOS/Android components are not desktop controls.',
650
+ ],
651
+ macosRuntime: versions.macosNodeApi,
652
+ windowsRuntime: versions.windowsNapi,
653
+ },
654
+ macosRuntimes: entries(catalog.macosRuntimes),
551
655
  creator: versions.mavis,
552
656
  migrations: {
553
657
  macos: {
554
658
  flag: '--add-macos',
555
659
  apply: '--write',
556
660
  status: 'experimental',
557
- since: null,
661
+ since: '0.1.0-rc.15',
558
662
  hosts: ['vite', 'nuxt', 'nativescript'],
559
663
  preservesSources: true,
560
- compiler: '@getcortexlabs/mavis-compiler',
664
+ runtimes: ['appkit'],
561
665
  },
562
666
  },
563
667
  combinations: combinations.map((combination) => ({
@@ -565,14 +669,15 @@ export function describeCapabilities() {
565
669
  label: targetLabel(combination.targets),
566
670
  hosts: combination.targets.includes('web') ? available(catalog.hosts) : [],
567
671
  examples: Object.entries(catalog.examples)
568
- .filter(
569
- ([, example]) =>
570
- example.authoring.includes(combination.authoring) ||
571
- (combination.targets.includes('macos') && example.portableAuthoring),
572
- )
672
+ .filter(([, example]) => example.authoring.includes(combination.authoring))
573
673
  .map(([id]) => ({
574
674
  id,
575
- availability: availabilityOf({ targets: combination.targets, example: id }),
675
+ availability: availabilityOf({
676
+ targets: combination.targets,
677
+ example: id,
678
+ macosRuntime: combination.macosRuntime,
679
+ framework: combination.framework,
680
+ }),
576
681
  })),
577
682
  })),
578
683
  targets: entries(catalog.targets),
@@ -597,7 +702,7 @@ export function formatCapabilities() {
597
702
  const lines = ['What this creator can scaffold', '']
598
703
  for (const combination of data.combinations) {
599
704
  lines.push(
600
- ` --targets ${combination.targets.join(',').padEnd(18)} ${combination.label} · ${catalog.authoring[combination.authoring].label}`,
705
+ ` --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
706
  )
602
707
  if (combination.hosts.length)
603
708
  lines.push(
@@ -608,17 +713,11 @@ export function formatCapabilities() {
608
713
  ` --example ${example.id.padEnd(10)} ${availabilityLabel(example.availability)}`,
609
714
  )
610
715
  }
611
- lines.push('', 'Mac components · experimental source inventory (not runtime validation)')
612
- for (const [name, component] of Object.entries(data.macos.components)) {
613
- lines.push(
614
- ` ${name}: ${component.status} · ${component.props.length} Vue props · #${component.issue}`,
615
- )
616
- for (const limit of component.limits) lines.push(` ${limit.en}`)
617
- if (component.rejectedProps.length)
618
- lines.push(` Rejected props: ${component.rejectedProps.join(', ')}`)
619
- }
620
716
  lines.push(
621
- ' Exact props, events and slots: --capabilities --json. Validate your sources with --check-portability.',
717
+ '',
718
+ 'NativeScript desktop · experimental subset',
719
+ ` ${data.desktop.components.join(', ')}`,
720
+ ...data.desktop.limits.map((limit) => ` ${limit}`),
622
721
  )
623
722
  lines.push(
624
723
  '',