@getcortexlabs/create-mavis 0.1.0-rc.12.2 → 0.1.0-rc.13
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 -6
- package/package.json +1 -1
- package/src/adapters.mjs +76 -0
- package/src/add-target.mjs +1 -1
- package/src/capabilities.mjs +626 -0
- package/src/cli.mjs +43 -12
- package/src/doctor.mjs +77 -36
- package/src/macos.mjs +223 -56
- package/src/package-manager.mjs +12 -4
- package/src/portability.mjs +2 -1
- package/src/presets.mjs +15 -108
- package/src/scaffold.mjs +11 -3
- package/src/ui.mjs +115 -82
- package/templates/macos/examples/tasks/shared/TaskDetail.lite.tsx +57 -0
- package/templates/macos/examples/tasks/shared/TaskRow.lite.tsx +33 -0
- package/templates/macos/examples/tasks/shared/Tasks.lite.tsx +251 -0
- package/templates/macos/examples/tasks/shared/types.ts +9 -0
- package/templates/macos/mobile/src/App.vue +12 -0
- package/templates/macos/mobile/src/app.ts +7 -0
- package/templates/macos/native/Package.swift +9 -1
- package/templates/macos/native/Sources/MavisDesktop/App.swift +4 -4
- package/templates/macos/root/tsconfig.json +14 -0
- package/templates/macos/scripts/generate.mjs +35 -16
- package/templates/macos/scripts/macos.mjs +8 -3
- package/templates/macos/scripts/portable/emit-swift.mjs +1287 -0
- package/templates/macos/scripts/portable/emit-vue.mjs +615 -0
- package/templates/macos/scripts/portable/index.mjs +95 -0
- package/templates/macos/scripts/portable/model.mjs +1441 -0
- package/templates/macos/scripts/portable/program.mjs +163 -0
- package/templates/macos/shared/Welcome.lite.tsx +8 -6
- package/templates/macos/{index.html → web/index.html} +1 -1
- package/templates/macos/web/src/main.js +39 -0
- package/templates/macos/web/{style.css → src/style.css} +1 -1
- package/templates/macos/web/vite.config.mjs +3 -0
- package/templates/macos/scripts/portable.mjs +0 -395
- package/templates/macos/vite.config.mjs +0 -3
- package/templates/macos/web/main.js +0 -15
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# Create Mavis
|
|
2
2
|
|
|
3
|
-
Start
|
|
3
|
+
Start a project for the Web, Native (iOS and Android through NativeScript) and the Mac, in any combination. 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; with the Mac, screens are written once and generated for each target (experimental, see below).
|
|
4
4
|
|
|
5
5
|
Run `npm create @getcortexlabs/mavis@latest` for the interactive wizard, or pass a project name and options:
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
npm create @getcortexlabs/mavis@latest my-app -- --
|
|
8
|
+
npm create @getcortexlabs/mavis@latest my-app -- --targets web,native --web nuxt --rendering ssr --theme midnight --no-install
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
The terminal wizard uses arrow keys and Enter, with descriptions, inline name validation and a summary before creation. Choose **Back** to revisit a choice or **Change choices** at the summary. Escape or Ctrl-C cancels. Explicit flags are preserved. In CI, supply a project name and flags, or `--yes` for defaults without installation.
|
|
@@ -21,7 +21,7 @@ pnpm install
|
|
|
21
21
|
pnpm run dev
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
The wizard, package-manager selection and both examples are included in RC.12.
|
|
24
|
+
The wizard, package-manager selection and both examples are included in RC.12. RC.13 adds `--targets` with any combination of `web`, `native` and `macos` (`--target` keeps working), the Tasks example and `--capabilities`, which prints what can be created and how far each combination has been validated.
|
|
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.
|
|
|
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.13** and **Jolt 0.1.0-rc.13**. 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,6 +49,6 @@ MIT · [Mavis UI](https://github.com/getcortexlabs/mavis-ui)
|
|
|
49
49
|
|
|
50
50
|
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. Upgrade the existing Mavis renderer to RC.12.2 before adding a host.
|
|
51
51
|
|
|
52
|
-
## Experimental
|
|
52
|
+
## Experimental shared sources with Mac
|
|
53
53
|
|
|
54
|
-
`create-mavis first-light --
|
|
54
|
+
`create-mavis first-light --targets web,native,macos` (any combination that includes `macos`) creates an experimental project where shared TSX screens (Mitosis component format) compile to Vue on the Web, Vue for NativeScript and SwiftUI. Run the generated `macos` script on macOS 14+ with Xcode. Shared components with typed props, state, getters, actions, Show and For, forms (`MInput`, `MCheckbox`, `MSelect`), lists, `MGrid`, `MCard`, shortcuts and motion through Jolt are supported; the rest of the Mavis catalog and existing Vue screens are not. `--example tasks` adds a small task manager written once. See the [scope and commands](https://mavis-ui.getcortexlabs.com/guide/macos-experimental).
|
package/package.json
CHANGED
package/src/adapters.mjs
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Generated from targetCapabilities in @getcortexlabs/mavis-core by scripts/sync-creator-adapters.mjs.
|
|
2
|
+
// Do not edit: change core's capabilities and run the script.
|
|
3
|
+
export const adapters = {
|
|
4
|
+
available: [
|
|
5
|
+
{
|
|
6
|
+
id: 'vue-web',
|
|
7
|
+
framework: 'vue',
|
|
8
|
+
renderer: 'dom',
|
|
9
|
+
status: 'experimental',
|
|
10
|
+
rendering: ['client', 'serverImport', 'serverHTML', 'hydration', 'ssg', 'streaming'],
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
id: 'vue-nativescript',
|
|
14
|
+
framework: 'vue',
|
|
15
|
+
renderer: 'nativescript',
|
|
16
|
+
status: 'experimental',
|
|
17
|
+
rendering: ['client'],
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
planned: [
|
|
21
|
+
{
|
|
22
|
+
id: 'react-web',
|
|
23
|
+
issue: 145,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: 'next',
|
|
27
|
+
issue: 159,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: 'angular-web',
|
|
31
|
+
issue: 152,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 'svelte-web',
|
|
35
|
+
issue: 153,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: 'solid-web',
|
|
39
|
+
issue: 154,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: 'react-nativescript',
|
|
43
|
+
issue: 35,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: 'angular-nativescript',
|
|
47
|
+
issue: 36,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: 'svelte-nativescript',
|
|
51
|
+
issue: 37,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: 'solid-nativescript',
|
|
55
|
+
issue: 38,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 'typescript-nativescript',
|
|
59
|
+
issue: 39,
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
research: [
|
|
63
|
+
{
|
|
64
|
+
id: 'react-native',
|
|
65
|
+
issue: 40,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: 'flutter',
|
|
69
|
+
issue: 41,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: 'swiftui-compose',
|
|
73
|
+
issue: 42,
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
}
|
package/src/add-target.mjs
CHANGED
|
@@ -41,7 +41,7 @@ export async function planTarget(options, cwd = process.cwd()) {
|
|
|
41
41
|
const config = await optional(join(root, 'mavis.config.json'))
|
|
42
42
|
if (config && JSON.parse(config).authoring === 'mitosis')
|
|
43
43
|
throw new Error(
|
|
44
|
-
'Add-target migrations do not
|
|
44
|
+
'Add-target migrations do not apply to projects with shared TSX sources. Create a project with the targets you need, for example --targets web,native,macos.',
|
|
45
45
|
)
|
|
46
46
|
const deps = { ...pkg.devDependencies, ...pkg.dependencies }
|
|
47
47
|
const target = options.target
|