@getcortexlabs/create-mavis 0.1.0-rc.15 → 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.
- package/README.md +6 -29
- package/package.json +2 -4
- package/src/adapters.mjs +0 -7
- package/src/add-desktop.mjs +50 -4
- package/src/capabilities.mjs +39 -186
- package/src/cli.mjs +16 -102
- package/src/desktop.mjs +1 -1
- package/src/doctor.mjs +4 -116
- package/src/native-framework.mjs +1 -1
- package/src/portability.mjs +2 -116
- package/src/scaffold.mjs +1 -6
- package/src/shared-api.mjs +3 -0
- package/src/ui.mjs +4 -64
- package/templates/desktop/common/build.mjs +0 -9
- package/templates/desktop/macos/src/host.mjs +9 -6
- package/templates/desktop/windows/src/host.mjs +21 -4
- package/src/add-macos.mjs +0 -386
- package/src/macos-capabilities.generated.mjs +0 -4190
- package/src/macos.mjs +0 -394
- package/src/migrate-directory.mjs +0 -121
- package/templates/desktop/macos/src/motion.mjs +0 -51
- package/templates/directory/macos/DirectoryStorage.swift +0 -68
- package/templates/macos/examples/tasks/shared/TaskDetail.lite.tsx +0 -57
- package/templates/macos/examples/tasks/shared/TaskRow.lite.tsx +0 -33
- package/templates/macos/examples/tasks/shared/Tasks.lite.tsx +0 -251
- package/templates/macos/examples/tasks/shared/types.ts +0 -10
- package/templates/macos/mobile/src/App.vue +0 -14
- package/templates/macos/mobile/src/app.ts +0 -7
- package/templates/macos/native/Package.swift +0 -19
- package/templates/macos/native/Sources/MavisDesktop/App.swift +0 -35
- package/templates/macos/native/Sources/MavisDesktop/Fonts/LICENSE +0 -45
- package/templates/macos/native/Sources/MavisDesktop/Fonts/lucide.ttf +0 -0
- package/templates/macos/root/tsconfig.json +0 -14
- package/templates/macos/scripts/generate.mjs +0 -13
- package/templates/macos/scripts/macos-manifest.mjs +0 -33
- package/templates/macos/scripts/macos.mjs +0 -58
- package/templates/macos/shared/Welcome.lite.tsx +0 -42
- package/templates/macos/web/index.html +0 -12
- package/templates/macos/web/src/main.js +0 -212
- package/templates/macos/web/src/mavis.js +0 -2
- package/templates/macos/web/src/style.css +0 -14
- package/templates/macos/web/vite.config.mjs +0 -14
- package/templates/migrations/directory-rc13.json +0 -36
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Create Mavis
|
|
2
2
|
|
|
3
|
-
Start a project for Web, NativeScript iOS/Android, AppKit macOS and XAML Windows.
|
|
3
|
+
Start a project for Web, NativeScript iOS/Android, AppKit macOS and XAML Windows. The desktop presets run shared Vue. Web projects use Vue + Vite or Nuxt with server rendering/static generation. Web and Native share a Vue screen and give each host its own service implementation; desktop hosts run Vue directly with an explicit native component subset.
|
|
4
4
|
|
|
5
5
|
Run `npm create @getcortexlabs/mavis@latest` for the interactive wizard, or pass a project name and options:
|
|
6
6
|
|
|
@@ -21,7 +21,7 @@ pnpm install
|
|
|
21
21
|
pnpm run dev
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Use `--capabilities` to list supported frameworks, platforms and examples.
|
|
25
25
|
|
|
26
26
|
- `--dry-run` prints the file plan without writing or installing.
|
|
27
27
|
- Existing directories are never merged or overwritten.
|
|
@@ -31,7 +31,7 @@ The wizard, package-manager selection and both examples are included in RC.12. R
|
|
|
31
31
|
|
|
32
32
|
Node.js 22.16+ is required. Native projects also need the NativeScript CLI and the platform SDK. iOS requires macOS and Xcode. A shared project keeps native dependencies separate from its Web workspace so each renderer loads the correct Vue runtime.
|
|
33
33
|
|
|
34
|
-
Templates pin **Mavis 0.1.0-rc.
|
|
34
|
+
Templates pin **Mavis 0.1.0-rc.16** and **Jolt 0.1.0-rc.18**. The CLI and its generated projects use the same Mavis release. Commit the generated lockfile (both lockfiles for a shared project).
|
|
35
35
|
|
|
36
36
|
pnpm requires **10.26+**. Its generated workspace files keep the mobile installation separate, use a hoisted layout for Vite deduplication, shared imports and NativeScript, and allow only the starter's required dependency build scripts. Yarn Classic and modern Yarn use `node_modules`; initial empty `yarn.lock` files mark separate projects before installation. The starter declares its dependency build scripts explicitly; other package-manager policies remain in effect. If modern Yarn reports a fresh dependency as quarantined, retry after its configured minimum package age. Do not add `apps/mobile` to the Web workspace.
|
|
37
37
|
|
|
@@ -49,9 +49,9 @@ npm run macos # on macOS
|
|
|
49
49
|
npm run windows # on Windows
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
These experimental presets are included in RC.15.
|
|
52
|
+
These experimental presets are included in RC.15. The macOS runtime is NativeScript AppKit. Desktop needs Node 22.23.3+. Mac uses Apple Silicon/macOS 13.3+; Windows uses Windows 10 build 18362+ and the Windows SDK. Run `--doctor` on each OS.
|
|
53
53
|
|
|
54
|
-
The initial desktop contract has 12 components with bounded props; `--capabilities --json` lists them. It does not imply the full Vue mobile catalog runs on desktop.
|
|
54
|
+
The initial desktop contract has 12 components with bounded props; `--capabilities --json` lists them. It does not imply the full Vue mobile catalog runs on desktop. MReveal uses the public Jolt AppKit and Windows drivers to fade in with system motion preferences.
|
|
55
55
|
|
|
56
56
|
Use `--add-macos` or `--add-windows` to preview an existing Vue app's desktop host; `--write` applies it. Source files stay in place. Install the new host's dependencies separately. Custom app providers/router remain application-owned. `package:macos` produces an ad hoc signed .app; `package:windows` produces an unsigned portable folder. Both include Node and native runtimes. See the [desktop guide](https://mavis-ui.getcortexlabs.com/guide/native-desktop) for exact coverage and distribution limits.
|
|
57
57
|
|
|
@@ -65,27 +65,4 @@ Use `--add-macos` or `--add-windows` to preview an existing Vue app's desktop ho
|
|
|
65
65
|
|
|
66
66
|
Run `create-mavis --add-native` in a Vue + Vite/Nuxt package, or `create-mavis --add-web [--web nuxt]` in a NativeScript-Vue package. Use `--dry-run` to inspect the plan and `--screen path/to/Screen.vue` to reuse an existing screen without moving it. The command creates an isolated host under `apps`, adds root launch/install scripts and preserves existing source/configuration/lockfiles. Dependencies install only with `--install`; npm, pnpm and Yarn are supported. Conflicts and unsupported workspaces/version baselines are reported before writing. The selected screen's services, aliases and router remain application-owned; portability diagnostics are not automatic conversion. Align the existing Mavis packages with the creator version before adding a host.
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
Experimental RC.14 includes Nuxt SSR/SSG with Mac, the shared Vue Directory example and `--add-macos`. Check the documented per-component and motion limits before adoption.
|
|
71
|
-
|
|
72
|
-
```sh
|
|
73
|
-
create-mavis studio --targets web,native,macos --macos-runtime swiftui --web nuxt --rendering ssr --example directory
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
`--example directory` keeps the same Vue screens, typed store and route table across Web, NativeScript and SwiftUI. Welcome and Tasks use shared TSX. The compiler is the versioned `@getcortexlabs/mavis-compiler` package, pinned with Mavis; generated projects contain a small launcher instead of a copy of the compiler. The Web host remains Vue + Vite or Nuxt. Run the generated Mac script on macOS 14+ with Xcode. See the [supported source contracts](https://mavis-ui.getcortexlabs.com/guide/macos-experimental) and source diagnostics before adopting an existing screen.
|
|
77
|
-
|
|
78
|
-
## Add SwiftUI to an existing application
|
|
79
|
-
|
|
80
|
-
Run in the existing Web, NativeScript or combined project:
|
|
81
|
-
|
|
82
|
-
```sh
|
|
83
|
-
create-mavis --add-macos --macos-runtime swiftui --shared-root src/shared --entry src/shared/screens/Home.vue
|
|
84
|
-
create-mavis --add-macos --macos-runtime swiftui --shared-root src/shared --entry src/shared/screens/Home.vue --write
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
The first command is a preview. `--write` applies the reviewed plan; `--json` emits the plan for tools. Nested source folders stay in place. The command adds `apps/macos`, `generate:macos`, `build:macos` and `macos`, and migrates schema 1 configuration to schema 2. It preserves existing Web/native hosts and lockfiles, detects conflicts before writing, and never installs packages. Run your package manager after applying. `--shared-root` accepts comma-separated roots; `portability.roots`, `sourceRoot` and `entry` retain those choices.
|
|
88
|
-
|
|
89
|
-
For the unchanged RC.13 Directory template, `--add-macos --migrate-directory` previews the typed storage adapter migration; add `--write` to apply it. The migration requires exact original sources and host entries, preserves the stored JSON array and `mavis:directory` key, and rejects customized versions. It does not transfer stored data between devices. Directory's Swift host uses UserDefaults. Other app-owned service interfaces require explicit Swift implementations; the CLI reports these instead of inventing service behavior.
|
|
90
|
-
|
|
91
|
-
Set `macos.name`, `bundleId`, `icon` (project-relative `.icns`), `minWidth` and `minHeight` in `mavis.config.json`. `--doctor` checks installed compiler/Mavis alignment, the exact Jolt/JoltSwiftUI pin and shared-source diagnostics. Align dependencies first; adoption does not silently upgrade them. Signing, provisioning, notarization and store distribution are separate from this unsigned development build.
|
|
68
|
+
The former SwiftUI target is preserved on [archive/swiftui](https://github.com/getcortexlabs/mavis-ui/tree/archive/swiftui).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getcortexlabs/create-mavis",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.16",
|
|
4
4
|
"description": "Create Vue Web, Nuxt and NativeScript projects with Mavis UI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"src",
|
|
11
11
|
"templates",
|
|
12
|
-
"!templates/macos/scripts/portable",
|
|
13
12
|
"README.md",
|
|
14
13
|
"LICENSE"
|
|
15
14
|
],
|
|
@@ -30,7 +29,6 @@
|
|
|
30
29
|
"dependencies": {
|
|
31
30
|
"@vue/compiler-sfc": "3.5.44",
|
|
32
31
|
"typescript": "6.0.3",
|
|
33
|
-
"@clack/prompts": "1.8.1"
|
|
34
|
-
"@getcortexlabs/mavis-compiler": "0.1.0-rc.15"
|
|
32
|
+
"@clack/prompts": "1.8.1"
|
|
35
33
|
}
|
|
36
34
|
}
|
package/src/adapters.mjs
CHANGED
|
@@ -16,13 +16,6 @@ export const adapters = {
|
|
|
16
16
|
status: 'experimental',
|
|
17
17
|
rendering: ['client'],
|
|
18
18
|
},
|
|
19
|
-
{
|
|
20
|
-
id: 'macos-swiftui',
|
|
21
|
-
framework: 'shared',
|
|
22
|
-
renderer: 'swiftui',
|
|
23
|
-
status: 'experimental',
|
|
24
|
-
rendering: ['client'],
|
|
25
|
-
},
|
|
26
19
|
{
|
|
27
20
|
id: 'vue-appkit',
|
|
28
21
|
framework: 'vue',
|
package/src/add-desktop.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { lstat, readFile, readdir } from 'node:fs/promises'
|
|
1
|
+
import { lstat, mkdir, readFile, readdir, rename, rm, rmdir, writeFile } from 'node:fs/promises'
|
|
2
2
|
import { isAbsolute, join, relative, resolve, sep, dirname, extname } from 'node:path'
|
|
3
3
|
import { parse } from '@vue/compiler-sfc'
|
|
4
4
|
import { desktopHostFiles } from './desktop.mjs'
|
|
@@ -6,7 +6,6 @@ import { copyTemplate } from './scaffold.mjs'
|
|
|
6
6
|
import { migrateConfig, targetNames, versions } from './capabilities.mjs'
|
|
7
7
|
import { desktopComponents } from '../templates/desktop/common/src/contract.mjs'
|
|
8
8
|
import { packageCommands, detectPackageManager } from './package-manager.mjs'
|
|
9
|
-
import { applyMacos } from './add-macos.mjs'
|
|
10
9
|
const json = (value) => JSON.stringify(value, null, 2) + '\n'
|
|
11
10
|
const posix = (path) => path.split(sep).join('/')
|
|
12
11
|
async function safe(root, name) {
|
|
@@ -49,7 +48,7 @@ export async function planDesktop(options, cwd = process.cwd()) {
|
|
|
49
48
|
const prior = raw ? migrateConfig(JSON.parse(raw)) : {}
|
|
50
49
|
if (prior.mode === 'portable' || prior.apps?.macos?.toolkit === 'swiftui')
|
|
51
50
|
throw new Error(
|
|
52
|
-
'This project uses the SwiftUI compiler.
|
|
51
|
+
'This project uses the SwiftUI compiler. Use its pinned creator or the archive/swiftui branch.',
|
|
53
52
|
)
|
|
54
53
|
const manager =
|
|
55
54
|
options.packageManager ??
|
|
@@ -305,4 +304,51 @@ export async function planDesktop(options, cwd = process.cwd()) {
|
|
|
305
304
|
return { root, original, files, destination, entry, manager, diagnostics, alreadyAdded: false }
|
|
306
305
|
}
|
|
307
306
|
|
|
308
|
-
|
|
307
|
+
async function optional(path) {
|
|
308
|
+
try {
|
|
309
|
+
return await readFile(path, 'utf8')
|
|
310
|
+
} catch (error) {
|
|
311
|
+
if (error.code !== 'ENOENT') throw error
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
/** Optimistic transaction: refuse concurrent edits; roll back only bytes written by this plan. */
|
|
315
|
+
export async function applyDesktop(plan, { signal } = {}) {
|
|
316
|
+
if (plan.alreadyAdded) return
|
|
317
|
+
const written = []
|
|
318
|
+
try {
|
|
319
|
+
for (const [name, expected] of plan.original) {
|
|
320
|
+
if ((await optional(await safe(plan.root, name))) !== expected)
|
|
321
|
+
throw new Error(`${name} changed after the preview. Preview the desktop target again.`)
|
|
322
|
+
}
|
|
323
|
+
for (const [name, data] of plan.files) {
|
|
324
|
+
signal?.throwIfAborted()
|
|
325
|
+
const path = await safe(plan.root, name)
|
|
326
|
+
await mkdir(dirname(path), { recursive: true })
|
|
327
|
+
if (plan.original.get(name) === undefined) await writeFile(path, data, { flag: 'wx' })
|
|
328
|
+
else {
|
|
329
|
+
if ((await optional(path)) !== plan.original.get(name))
|
|
330
|
+
throw new Error(`${name} changed during creation.`)
|
|
331
|
+
const staging = `${path}.mavis-${process.pid}.tmp`
|
|
332
|
+
try {
|
|
333
|
+
await writeFile(staging, data, { flag: 'wx' })
|
|
334
|
+
await rename(staging, path)
|
|
335
|
+
} finally {
|
|
336
|
+
await rm(staging, { force: true })
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
written.push(name)
|
|
340
|
+
}
|
|
341
|
+
} catch (error) {
|
|
342
|
+
for (const name of written.reverse()) {
|
|
343
|
+
const path = join(plan.root, name)
|
|
344
|
+
const current = await readFile(path).catch(() => null)
|
|
345
|
+
if (!current?.equals(Buffer.from(plan.files.get(name)))) continue
|
|
346
|
+
const prior = plan.original.get(name)
|
|
347
|
+
if (prior === undefined) await rm(path)
|
|
348
|
+
else await writeFile(path, prior)
|
|
349
|
+
for (let folder = dirname(path); folder !== plan.root; folder = dirname(folder))
|
|
350
|
+
await rmdir(folder).catch(() => {})
|
|
351
|
+
}
|
|
352
|
+
throw error
|
|
353
|
+
}
|
|
354
|
+
}
|
package/src/capabilities.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { desktopComponents } from '../templates/desktop/common/src/contract.mjs'
|
|
2
2
|
import { adapters } from './adapters.mjs'
|
|
3
|
-
import { macosCapabilities } from './macos-capabilities.generated.mjs'
|
|
4
3
|
|
|
5
4
|
/** Shape of `--capabilities --json`, for tools that read it. */
|
|
6
5
|
export const catalogVersion = 1
|
|
@@ -9,8 +8,8 @@ export const schemaVersion = 2
|
|
|
9
8
|
|
|
10
9
|
/** Baseline pins; coordinated releases update Mavis after validating source templates with matching tarballs. */
|
|
11
10
|
export const versions = Object.freeze({
|
|
12
|
-
mavis: '0.1.0-rc.
|
|
13
|
-
jolt: '0.1.0-rc.
|
|
11
|
+
mavis: '0.1.0-rc.16',
|
|
12
|
+
jolt: '0.1.0-rc.18',
|
|
14
13
|
vue: '3.5.44',
|
|
15
14
|
nuxt: '4.6.3',
|
|
16
15
|
vite: '6.4.5',
|
|
@@ -38,7 +37,6 @@ export const requirements = Object.freeze({
|
|
|
38
37
|
packageManagers: Object.freeze({ npm: null, pnpm: '10.26', yarn: null }),
|
|
39
38
|
native: 'the NativeScript CLI, a JDK and the Android SDK; macOS and Xcode for iOS',
|
|
40
39
|
macos: 'macOS 13.3+ on Apple Silicon, Node 22.23.3+; Xcode command line tools for packaging',
|
|
41
|
-
swiftui: 'macOS 14+ and Xcode',
|
|
42
40
|
windows: 'Windows 10 build 18362+ (x64/arm64), Node 22.23.3+ and Windows SDK Manifest Tool',
|
|
43
41
|
})
|
|
44
42
|
|
|
@@ -69,10 +67,10 @@ export const catalog = Object.freeze({
|
|
|
69
67
|
},
|
|
70
68
|
macos: {
|
|
71
69
|
label: 'Mac',
|
|
72
|
-
hint: 'NativeScript AppKit
|
|
70
|
+
hint: 'NativeScript AppKit (experimental)',
|
|
73
71
|
toolkit: 'nativescript-appkit',
|
|
74
72
|
adapter: 'vue-appkit',
|
|
75
|
-
runtimes: ['appkit'
|
|
73
|
+
runtimes: ['appkit'],
|
|
76
74
|
status: 'experimental',
|
|
77
75
|
},
|
|
78
76
|
windows: {
|
|
@@ -85,7 +83,6 @@ export const catalog = Object.freeze({
|
|
|
85
83
|
}),
|
|
86
84
|
macosRuntimes: Object.freeze({
|
|
87
85
|
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
86
|
}),
|
|
90
87
|
frameworks: Object.freeze({
|
|
91
88
|
vue: { label: 'Vue', status: 'validated' },
|
|
@@ -133,17 +130,10 @@ export const catalog = Object.freeze({
|
|
|
133
130
|
status: 'experimental',
|
|
134
131
|
},
|
|
135
132
|
vue: { label: 'Vue templates', mode: 'direct', execution: 'components', status: 'validated' },
|
|
136
|
-
mitosis: {
|
|
137
|
-
label: 'Shared TSX',
|
|
138
|
-
mode: 'portable',
|
|
139
|
-
execution: 'generated',
|
|
140
|
-
status: 'experimental',
|
|
141
|
-
},
|
|
142
133
|
jsx: planned(167, 'React-style JSX compiled for Vue'),
|
|
143
134
|
}),
|
|
144
135
|
execution: Object.freeze({
|
|
145
136
|
components: { label: 'Mavis components in the app', status: 'validated' },
|
|
146
|
-
generated: { label: 'Code generated for each target', status: 'experimental' },
|
|
147
137
|
sdui: planned(173, 'Screens delivered as data'),
|
|
148
138
|
}),
|
|
149
139
|
hosts: Object.freeze({
|
|
@@ -158,7 +148,6 @@ export const catalog = Object.freeze({
|
|
|
158
148
|
hint: 'Server rendering or a static website',
|
|
159
149
|
rendering: ['ssr', 'ssg'],
|
|
160
150
|
status: 'validated',
|
|
161
|
-
portableSince: '0.1.0-rc.14',
|
|
162
151
|
},
|
|
163
152
|
next: planned(issueOf('next'), 'Next.js'),
|
|
164
153
|
}),
|
|
@@ -171,23 +160,15 @@ export const catalog = Object.freeze({
|
|
|
171
160
|
welcome: {
|
|
172
161
|
label: 'Basic project',
|
|
173
162
|
hint: 'One shared screen to build on',
|
|
174
|
-
authoring: ['vue', '
|
|
163
|
+
authoring: ['vue', 'native'],
|
|
175
164
|
since: '0.1.0-alpha.6',
|
|
176
165
|
},
|
|
177
166
|
directory: {
|
|
178
167
|
label: 'Search, details and editing',
|
|
179
168
|
hint: 'Shared routes, forms and local persistence',
|
|
180
169
|
authoring: ['vue'],
|
|
181
|
-
portableAuthoring: 'vue',
|
|
182
|
-
portableSince: '0.1.0-rc.14',
|
|
183
170
|
since: '0.1.0-alpha.9',
|
|
184
171
|
},
|
|
185
|
-
tasks: {
|
|
186
|
-
label: 'Tasks',
|
|
187
|
-
hint: 'List and detail, forms, shortcuts and motion from one source',
|
|
188
|
-
authoring: ['mitosis'],
|
|
189
|
-
since: '0.1.0-rc.13',
|
|
190
|
-
},
|
|
191
172
|
}),
|
|
192
173
|
themes: Object.freeze({
|
|
193
174
|
mavis: { label: 'Mavis', hint: 'Light, warm and soft' },
|
|
@@ -199,29 +180,10 @@ export const catalog = Object.freeze({
|
|
|
199
180
|
})
|
|
200
181
|
|
|
201
182
|
/** The combinations of targets the creator scaffolds, and how each has been validated. */
|
|
202
|
-
const
|
|
183
|
+
const vueCombinations = [
|
|
203
184
|
{ targets: ['web'], authoring: 'vue', status: 'validated', since: '0.1.0-alpha.6' },
|
|
204
185
|
{ targets: ['native'], authoring: 'vue', status: 'validated', since: '0.1.0-alpha.6' },
|
|
205
186
|
{ targets: ['web', 'native'], authoring: 'vue', status: 'validated', since: '0.1.0-alpha.6' },
|
|
206
|
-
{ targets: ['macos'], authoring: 'mitosis', status: 'experimental', since: '0.1.0-rc.13' },
|
|
207
|
-
{
|
|
208
|
-
targets: ['web', 'macos'],
|
|
209
|
-
authoring: 'mitosis',
|
|
210
|
-
status: 'experimental',
|
|
211
|
-
since: '0.1.0-rc.12.2',
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
targets: ['native', 'macos'],
|
|
215
|
-
authoring: 'mitosis',
|
|
216
|
-
status: 'experimental',
|
|
217
|
-
since: '0.1.0-rc.13',
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
targets: ['web', 'native', 'macos'],
|
|
221
|
-
authoring: 'mitosis',
|
|
222
|
-
status: 'experimental',
|
|
223
|
-
since: '0.1.0-rc.13',
|
|
224
|
-
},
|
|
225
187
|
]
|
|
226
188
|
|
|
227
189
|
export const combinations = Object.freeze([
|
|
@@ -232,9 +194,7 @@ export const combinations = Object.freeze([
|
|
|
232
194
|
status: 'experimental',
|
|
233
195
|
since: '0.1.0-rc.15',
|
|
234
196
|
})),
|
|
235
|
-
...
|
|
236
|
-
entry.targets.includes('macos') ? { ...entry, macosRuntime: 'swiftui' } : entry,
|
|
237
|
-
),
|
|
197
|
+
...vueCombinations,
|
|
238
198
|
...Array.from({ length: 15 }, (_, i) =>
|
|
239
199
|
['web', 'native', 'macos', 'windows'].filter((_, bit) => (i + 1) & (1 << bit)),
|
|
240
200
|
)
|
|
@@ -313,10 +273,8 @@ export function projectTargets(config) {
|
|
|
313
273
|
}
|
|
314
274
|
|
|
315
275
|
// The scaffold each combination uses. Combinations with Mac share TSX sources.
|
|
316
|
-
export function layoutOf(targets
|
|
317
|
-
if (targets.includes('windows') ||
|
|
318
|
-
return 'desktop'
|
|
319
|
-
if (targets.includes('macos')) return 'macos'
|
|
276
|
+
export function layoutOf(targets) {
|
|
277
|
+
if (targets.includes('windows') || targets.includes('macos')) return 'desktop'
|
|
320
278
|
if (targets.length === 2) return 'both'
|
|
321
279
|
return targets[0] === 'native' ? 'mobile' : 'web'
|
|
322
280
|
}
|
|
@@ -336,7 +294,7 @@ export function availabilityOf({
|
|
|
336
294
|
targets,
|
|
337
295
|
example,
|
|
338
296
|
web,
|
|
339
|
-
macosRuntime = '
|
|
297
|
+
macosRuntime = 'appkit',
|
|
340
298
|
framework = 'vue',
|
|
341
299
|
}) {
|
|
342
300
|
const combination = combinations.find(
|
|
@@ -346,13 +304,7 @@ export function availabilityOf({
|
|
|
346
304
|
(!entry.macosRuntime || entry.macosRuntime === macosRuntime),
|
|
347
305
|
)
|
|
348
306
|
if (!combination) return 'repository'
|
|
349
|
-
if (
|
|
350
|
-
combination.since === null ||
|
|
351
|
-
catalog.examples[example].since === null ||
|
|
352
|
-
(targets.includes('macos') && catalog.examples[example].portableSince === null) ||
|
|
353
|
-
(targets.includes('macos') && web && catalog.hosts[web]?.portableSince === null)
|
|
354
|
-
)
|
|
355
|
-
return 'repository'
|
|
307
|
+
if (combination.since === null || catalog.examples[example].since === null) return 'repository'
|
|
356
308
|
return combination.status === 'validated' ? 'published' : 'published-experimental'
|
|
357
309
|
}
|
|
358
310
|
const availabilityLabels = {
|
|
@@ -363,7 +315,7 @@ const availabilityLabels = {
|
|
|
363
315
|
export const availabilityLabel = (availability) => availabilityLabels[availability]
|
|
364
316
|
|
|
365
317
|
// One entry per target: what renders it and how. Vue runs the Web and Native apps today.
|
|
366
|
-
function appsOf({ targets, framework, web, rendering
|
|
318
|
+
function appsOf({ targets, framework, web, rendering }) {
|
|
367
319
|
return Object.fromEntries(
|
|
368
320
|
targets.map((target) => {
|
|
369
321
|
const { toolkit, platforms } = catalog.targets[target]
|
|
@@ -371,13 +323,11 @@ function appsOf({ targets, framework, web, rendering, macosRuntime = 'swiftui' }
|
|
|
371
323
|
if (target === 'native') return [target, { toolkit, framework, platforms: [...platforms] }]
|
|
372
324
|
return [
|
|
373
325
|
target,
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
runtime: target === 'macos' ? versions.macosNodeApi : versions.windowsNapi,
|
|
380
|
-
},
|
|
326
|
+
{
|
|
327
|
+
toolkit,
|
|
328
|
+
framework,
|
|
329
|
+
runtime: target === 'macos' ? versions.macosNodeApi : versions.windowsNapi,
|
|
330
|
+
},
|
|
381
331
|
]
|
|
382
332
|
}),
|
|
383
333
|
)
|
|
@@ -407,15 +357,12 @@ export function resolvePreset(options) {
|
|
|
407
357
|
})
|
|
408
358
|
targets = [...legacyTargets[options.target ?? 'web']]
|
|
409
359
|
}
|
|
410
|
-
const macosRuntime =
|
|
411
|
-
options.macosRuntime ??
|
|
412
|
-
options['macos-runtime'] ??
|
|
413
|
-
(options.target === 'macos' ? 'swiftui' : 'appkit')
|
|
360
|
+
const macosRuntime = options.macosRuntime ?? options['macos-runtime'] ?? 'appkit'
|
|
414
361
|
if (!catalog.macosRuntimes[macosRuntime])
|
|
415
362
|
reject({
|
|
416
363
|
code: 'unknown',
|
|
417
364
|
option: '--macos-runtime',
|
|
418
|
-
message: '
|
|
365
|
+
message: 'The macOS runtime is NativeScript AppKit.',
|
|
419
366
|
})
|
|
420
367
|
if ((options.macosRuntime || options['macos-runtime']) && !targets.includes('macos'))
|
|
421
368
|
reject({
|
|
@@ -423,26 +370,14 @@ export function resolvePreset(options) {
|
|
|
423
370
|
option: '--macos-runtime',
|
|
424
371
|
message: '--macos-runtime requires the macos target.',
|
|
425
372
|
})
|
|
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
373
|
const target = layoutOf(targets, macosRuntime)
|
|
434
|
-
const mac = target === 'macos'
|
|
435
374
|
const {
|
|
436
375
|
name,
|
|
437
376
|
web = 'vite',
|
|
438
377
|
rendering = web === 'nuxt' ? 'ssr' : 'client',
|
|
439
378
|
theme = 'mavis',
|
|
440
379
|
framework = 'vue',
|
|
441
|
-
authoring = framework !== 'vue'
|
|
442
|
-
? 'native'
|
|
443
|
-
: mac && options.example !== 'directory'
|
|
444
|
-
? 'mitosis'
|
|
445
|
-
: 'vue',
|
|
380
|
+
authoring = framework !== 'vue' ? 'native' : 'vue',
|
|
446
381
|
example = 'welcome',
|
|
447
382
|
packageManager = 'npm',
|
|
448
383
|
familiar,
|
|
@@ -459,7 +394,7 @@ export function resolvePreset(options) {
|
|
|
459
394
|
reject({
|
|
460
395
|
code: 'unknown',
|
|
461
396
|
option: '--example',
|
|
462
|
-
message: 'Example must be welcome
|
|
397
|
+
message: 'Example must be welcome or directory.',
|
|
463
398
|
})
|
|
464
399
|
if (familiar !== undefined && !catalog.familiar.includes(familiar))
|
|
465
400
|
reject({
|
|
@@ -540,17 +475,13 @@ export function resolvePreset(options) {
|
|
|
540
475
|
})
|
|
541
476
|
}
|
|
542
477
|
if (target === 'desktop') {
|
|
543
|
-
if (authoring !== 'vue'
|
|
478
|
+
if (authoring !== 'vue')
|
|
544
479
|
reject({
|
|
545
480
|
code: 'incompatible',
|
|
546
481
|
option: '--authoring',
|
|
547
482
|
message:
|
|
548
|
-
'NativeScript desktop currently supports shared Vue with welcome or directory.
|
|
549
|
-
alternatives: [
|
|
550
|
-
'--example welcome',
|
|
551
|
-
'--example directory',
|
|
552
|
-
'--targets macos --macos-runtime swiftui --example tasks',
|
|
553
|
-
],
|
|
483
|
+
'NativeScript desktop currently supports shared Vue with welcome or directory. Choose welcome or directory.',
|
|
484
|
+
alternatives: ['--example welcome', '--example directory'],
|
|
554
485
|
})
|
|
555
486
|
return describe({
|
|
556
487
|
schemaVersion,
|
|
@@ -579,71 +510,6 @@ export function resolvePreset(options) {
|
|
|
579
510
|
versions,
|
|
580
511
|
})
|
|
581
512
|
}
|
|
582
|
-
if (mac) {
|
|
583
|
-
const portableAuthoring = catalog.examples[example].portableAuthoring ?? 'mitosis'
|
|
584
|
-
if (authoring !== portableAuthoring)
|
|
585
|
-
reject({
|
|
586
|
-
code: 'incompatible',
|
|
587
|
-
option: '--authoring',
|
|
588
|
-
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.`,
|
|
589
|
-
alternatives: [
|
|
590
|
-
`--authoring ${portableAuthoring}`,
|
|
591
|
-
`--targets ${targets.filter((t) => t !== 'macos').join(',') || 'web'}`,
|
|
592
|
-
],
|
|
593
|
-
})
|
|
594
|
-
if (!catalog.examples[example].authoring.includes(portableAuthoring))
|
|
595
|
-
reject({
|
|
596
|
-
code: 'incompatible',
|
|
597
|
-
option: '--example',
|
|
598
|
-
message: `The ${example} example does not provide shared ${portableAuthoring} sources for Mac.`,
|
|
599
|
-
alternatives: ['--example welcome', '--example directory', '--example tasks'],
|
|
600
|
-
})
|
|
601
|
-
return describe({
|
|
602
|
-
schemaVersion,
|
|
603
|
-
name,
|
|
604
|
-
targets,
|
|
605
|
-
target,
|
|
606
|
-
macosRuntime: 'swiftui',
|
|
607
|
-
apps: appsOf({
|
|
608
|
-
targets,
|
|
609
|
-
framework,
|
|
610
|
-
web: hasWeb ? web : null,
|
|
611
|
-
rendering: hasWeb ? rendering : null,
|
|
612
|
-
}),
|
|
613
|
-
framework,
|
|
614
|
-
authoring,
|
|
615
|
-
mode: 'portable',
|
|
616
|
-
execution: 'generated',
|
|
617
|
-
example,
|
|
618
|
-
web: hasWeb ? web : null,
|
|
619
|
-
rendering: hasWeb ? rendering : null,
|
|
620
|
-
theme,
|
|
621
|
-
packageManager,
|
|
622
|
-
...(familiar ? { familiar } : {}),
|
|
623
|
-
experimental: 'shared-tsx',
|
|
624
|
-
versions,
|
|
625
|
-
})
|
|
626
|
-
}
|
|
627
|
-
if (authoring === 'mitosis')
|
|
628
|
-
reject({
|
|
629
|
-
code: 'incompatible',
|
|
630
|
-
option: '--authoring',
|
|
631
|
-
message:
|
|
632
|
-
'Shared TSX sources come with the Mac target (--targets web,native,macos). Without Mac, use Vue templates.',
|
|
633
|
-
alternatives: ['--authoring vue', `--targets ${[...targets, 'macos'].join(',')}`],
|
|
634
|
-
})
|
|
635
|
-
if (!catalog.examples[example].authoring.includes('vue'))
|
|
636
|
-
reject({
|
|
637
|
-
code: 'incompatible',
|
|
638
|
-
option: '--example',
|
|
639
|
-
message:
|
|
640
|
-
'The tasks example is written as shared TSX and comes with the Mac target, for example --targets web,native,macos --example tasks.',
|
|
641
|
-
alternatives: [
|
|
642
|
-
'--example welcome',
|
|
643
|
-
'--example directory',
|
|
644
|
-
`--targets ${[...targets, 'macos'].join(',')}`,
|
|
645
|
-
],
|
|
646
|
-
})
|
|
647
513
|
if (authoring !== 'vue')
|
|
648
514
|
reject({
|
|
649
515
|
code: catalog.authoring[authoring] ? 'planned' : 'unknown',
|
|
@@ -715,12 +581,20 @@ export function migrateConfig(config) {
|
|
|
715
581
|
const targets = projectTargets(config)
|
|
716
582
|
const hasWeb = targets.includes('web')
|
|
717
583
|
const framework = config.framework ?? 'vue'
|
|
718
|
-
|
|
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'
|
|
719
595
|
const web = hasWeb ? (config.web ?? 'vite') : null
|
|
720
596
|
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')
|
|
597
|
+
const macosRuntime = 'appkit'
|
|
724
598
|
const { target: _target, ...rest } = config
|
|
725
599
|
return {
|
|
726
600
|
...rest,
|
|
@@ -750,7 +624,6 @@ export function describeCapabilities() {
|
|
|
750
624
|
return {
|
|
751
625
|
catalogVersion,
|
|
752
626
|
schemaVersion,
|
|
753
|
-
macos: macosCapabilities,
|
|
754
627
|
desktop: {
|
|
755
628
|
contracts: desktopComponents,
|
|
756
629
|
status: 'experimental',
|
|
@@ -772,7 +645,7 @@ export function describeCapabilities() {
|
|
|
772
645
|
limits: [
|
|
773
646
|
'Explicit property subset; unsupported properties fail at runtime.',
|
|
774
647
|
'MRow uses equal-width columns; MGrid adapts to minColumnWidth.',
|
|
775
|
-
'
|
|
648
|
+
'MReveal fades in through Jolt AppKit (Core Animation) and Windows (XAML Storyboard), respecting system motion settings.',
|
|
776
649
|
'NativeScript Core iOS/Android components are not desktop controls.',
|
|
777
650
|
],
|
|
778
651
|
macosRuntime: versions.macosNodeApi,
|
|
@@ -788,8 +661,7 @@ export function describeCapabilities() {
|
|
|
788
661
|
since: '0.1.0-rc.15',
|
|
789
662
|
hosts: ['vite', 'nuxt', 'nativescript'],
|
|
790
663
|
preservesSources: true,
|
|
791
|
-
runtimes: ['appkit'
|
|
792
|
-
compiler: 'SwiftUI only: @getcortexlabs/mavis-compiler',
|
|
664
|
+
runtimes: ['appkit'],
|
|
793
665
|
},
|
|
794
666
|
},
|
|
795
667
|
combinations: combinations.map((combination) => ({
|
|
@@ -797,11 +669,7 @@ export function describeCapabilities() {
|
|
|
797
669
|
label: targetLabel(combination.targets),
|
|
798
670
|
hosts: combination.targets.includes('web') ? available(catalog.hosts) : [],
|
|
799
671
|
examples: Object.entries(catalog.examples)
|
|
800
|
-
.filter(
|
|
801
|
-
([, example]) =>
|
|
802
|
-
example.authoring.includes(combination.authoring) ||
|
|
803
|
-
(combination.macosRuntime === 'swiftui' && example.portableAuthoring),
|
|
804
|
-
)
|
|
672
|
+
.filter(([, example]) => example.authoring.includes(combination.authoring))
|
|
805
673
|
.map(([id]) => ({
|
|
806
674
|
id,
|
|
807
675
|
availability: availabilityOf({
|
|
@@ -851,21 +719,6 @@ export function formatCapabilities() {
|
|
|
851
719
|
` ${data.desktop.components.join(', ')}`,
|
|
852
720
|
...data.desktop.limits.map((limit) => ` ${limit}`),
|
|
853
721
|
)
|
|
854
|
-
lines.push(
|
|
855
|
-
'',
|
|
856
|
-
'SwiftUI components · paused compiler inventory; not runtime validation or AppKit/Windows coverage',
|
|
857
|
-
)
|
|
858
|
-
for (const [name, component] of Object.entries(data.macos.components)) {
|
|
859
|
-
lines.push(
|
|
860
|
-
` ${name}: ${component.status} · ${component.props.length} Vue props · #${component.issue}`,
|
|
861
|
-
)
|
|
862
|
-
for (const limit of component.limits) lines.push(` ${limit.en}`)
|
|
863
|
-
if (component.rejectedProps.length)
|
|
864
|
-
lines.push(` Rejected props: ${component.rejectedProps.join(', ')}`)
|
|
865
|
-
}
|
|
866
|
-
lines.push(
|
|
867
|
-
' Exact props, events and slots: --capabilities --json. Validate your sources with --check-portability.',
|
|
868
|
-
)
|
|
869
722
|
lines.push(
|
|
870
723
|
'',
|
|
871
724
|
`Themes: ${data.themes.join(', ')} · Package managers: ${data.packageManagers.join(', ')}`,
|