@multiplatform.one/cli 7.11.0 → 7.15.0

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 (163) hide show
  1. package/README.md +121 -111
  2. package/bin/createMultiplatformApp.mjs +39 -37
  3. package/lib/bin/multiplatformOne.mjs +65 -75
  4. package/lib/commands/addApp.mjs +78 -0
  5. package/lib/commands/adoptApp.mjs +11 -7
  6. package/lib/commands/doctypeTypes.mjs +148 -0
  7. package/lib/commands/e2e.mjs +2 -2
  8. package/lib/commands/init.mjs +142 -459
  9. package/lib/commands/merge.mjs +359 -0
  10. package/lib/commands/pieces.mjs +236 -0
  11. package/lib/commands/provenance.mjs +108 -0
  12. package/lib/commands/scaffold.mjs +105 -0
  13. package/lib/commands/updateApp.mjs +211 -528
  14. package/lib/source.json +5 -0
  15. package/lib/source.mjs +63 -0
  16. package/package.json +6 -6
  17. package/scripts/frappe-bootstrap.sh +29 -3
  18. package/scripts/frappe-dev.sh +1 -2
  19. package/scripts/frappe-helpers.sh +50 -2
  20. package/scripts/frappe.sh +5 -0
  21. package/scripts/scaffold.sh +937 -0
  22. package/scripts/stamp-source.mjs +51 -0
  23. package/scripts/stamp-source.spec.ts +86 -0
  24. package/src/bin/multiplatformOne.ts +116 -226
  25. package/src/commands/addApp.ts +102 -0
  26. package/src/commands/adoptApp.spec.ts +5 -1
  27. package/src/commands/adoptApp.ts +15 -10
  28. package/src/commands/doctypeTypes.spec.ts +155 -0
  29. package/src/commands/doctypeTypes.ts +214 -0
  30. package/src/commands/init.spec.ts +66 -0
  31. package/src/commands/init.ts +201 -643
  32. package/src/commands/merge.spec.ts +81 -0
  33. package/src/commands/merge.ts +411 -0
  34. package/src/commands/pieces.spec.ts +62 -0
  35. package/src/commands/pieces.ts +340 -0
  36. package/src/commands/provenance.spec.ts +92 -0
  37. package/src/commands/provenance.ts +169 -0
  38. package/src/commands/scaffold.ts +131 -0
  39. package/src/commands/updateApp.spec.ts +540 -331
  40. package/src/commands/updateApp.ts +255 -668
  41. package/src/source.spec.ts +45 -0
  42. package/src/source.ts +88 -0
  43. package/templates/AGENTS.md +161 -0
  44. package/templates/README.md +62 -0
  45. package/templates/pieces/frappe/universal/README.md.partial +7 -32
  46. package/templates/pieces/frappe/universal/env.example.partial +3 -3
  47. package/templates/pieces/frappe-bench/universal/README.md.partial +28 -0
  48. package/templates/pieces/{frappe → frappe-bench}/universal/docker/compose.frappe.yaml +2 -2
  49. package/templates/pieces/tauri/universal/README.md.partial +7 -5
  50. package/templates/pieces/tauri/universal/apps/__NAME__/src-tauri/src/dev.rs +463 -0
  51. package/templates/pieces/tauri/universal/apps/__NAME__/src-tauri/src/lib.rs +6 -0
  52. package/templates/pieces/tauri/universal/apps/__NAME__/src-tauri/tauri.conf.json +2 -1
  53. package/templates/pieces/webext/universal/apps/__NAME__/package.json.partial +1 -0
  54. package/templates/pieces/webext/universal/apps/__NAME__/vite.config.webext.ts +6 -2
  55. package/types/bin/multiplatformOne.d.ts.map +1 -1
  56. package/types/commands/addApp.d.ts +20 -0
  57. package/types/commands/addApp.d.ts.map +1 -0
  58. package/types/commands/adoptApp.d.ts +4 -3
  59. package/types/commands/adoptApp.d.ts.map +1 -1
  60. package/types/commands/doctypeTypes.d.ts +40 -0
  61. package/types/commands/doctypeTypes.d.ts.map +1 -0
  62. package/types/commands/init.d.ts +30 -13
  63. package/types/commands/init.d.ts.map +1 -1
  64. package/types/commands/merge.d.ts +54 -0
  65. package/types/commands/merge.d.ts.map +1 -0
  66. package/types/commands/pieces.d.ts +54 -0
  67. package/types/commands/pieces.d.ts.map +1 -0
  68. package/types/commands/provenance.d.ts +52 -0
  69. package/types/commands/provenance.d.ts.map +1 -0
  70. package/types/commands/scaffold.d.ts +43 -0
  71. package/types/commands/scaffold.d.ts.map +1 -0
  72. package/types/commands/updateApp.d.ts +19 -27
  73. package/types/commands/updateApp.d.ts.map +1 -1
  74. package/types/source.d.ts +35 -0
  75. package/types/source.d.ts.map +1 -0
  76. package/lib/commands/initApp.mjs +0 -431
  77. package/lib/generateVscode.mjs +0 -184
  78. package/scripts/clone.sh +0 -17
  79. package/scripts/update.sh +0 -46
  80. package/src/commands/initApp.spec.ts +0 -720
  81. package/src/commands/initApp.ts +0 -706
  82. package/src/generateVscode.ts +0 -238
  83. package/templates/app/AGENTS.md +0 -142
  84. package/templates/app/README.md +0 -62
  85. package/templates/app/apps/__NAME__/index.html +0 -36
  86. package/templates/app/apps/__NAME__/package.json +0 -31
  87. package/templates/app/apps/__NAME__/public/fonts/inter-400.woff2 +0 -0
  88. package/templates/app/apps/__NAME__/public/fonts/inter-700.woff2 +0 -0
  89. package/templates/app/apps/__NAME__/src/App.tsx +0 -9
  90. package/templates/app/apps/__NAME__/src/main.tsx +0 -14
  91. package/templates/app/apps/__NAME__/tsconfig.json +0 -8
  92. package/templates/app/apps/__NAME__/vite.config.ts +0 -17
  93. package/templates/app/features/__NAME__/package.json +0 -34
  94. package/templates/app/features/__NAME__/src/HomeScreen.tsx +0 -70
  95. package/templates/app/features/__NAME__/src/index.ts +0 -1
  96. package/templates/app/features/__NAME__/tsconfig.json +0 -5
  97. package/templates/app/gitignore +0 -9
  98. package/templates/app/npmrc +0 -2
  99. package/templates/app/oxlintrc.json +0 -39
  100. package/templates/app/package.json +0 -38
  101. package/templates/app/packages/config/config.json +0 -4
  102. package/templates/app/packages/config/index.ts +0 -5
  103. package/templates/app/packages/config/package.json +0 -17
  104. package/templates/app/packages/config/tsconfig.json +0 -5
  105. package/templates/app/pnpm-workspace.yaml +0 -4
  106. package/templates/app/tsconfig.base.json +0 -16
  107. package/templates/universal/AGENTS.md +0 -142
  108. package/templates/universal/README.md +0 -97
  109. package/templates/universal/apps/__NAME__/app.config.js +0 -31
  110. package/templates/universal/apps/__NAME__/config/tamagui.config.ts +0 -4
  111. package/templates/universal/apps/__NAME__/package.json +0 -62
  112. package/templates/universal/apps/__NAME__/polyfills.native.ts +0 -23
  113. package/templates/universal/apps/__NAME__/polyfills.ts +0 -3
  114. package/templates/universal/apps/__NAME__/public/fonts/inter-400.woff2 +0 -0
  115. package/templates/universal/apps/__NAME__/public/fonts/inter-700.woff2 +0 -0
  116. package/templates/universal/apps/__NAME__/routes/_layout.tsx +0 -22
  117. package/templates/universal/apps/__NAME__/routes/_layout.web.tsx +0 -21
  118. package/templates/universal/apps/__NAME__/routes/about.tsx +0 -3
  119. package/templates/universal/apps/__NAME__/routes/index.tsx +0 -3
  120. package/templates/universal/apps/__NAME__/src/app.ts +0 -10
  121. package/templates/universal/apps/__NAME__/tamagui.css +0 -3
  122. package/templates/universal/apps/__NAME__/tsconfig.json +0 -8
  123. package/templates/universal/apps/__NAME__/types.d.ts +0 -9
  124. package/templates/universal/apps/__NAME__/vite.config.ts +0 -20
  125. package/templates/universal/features/__NAME__/package.json +0 -35
  126. package/templates/universal/features/__NAME__/src/AboutScreen.tsx +0 -27
  127. package/templates/universal/features/__NAME__/src/AppLayout.tsx +0 -50
  128. package/templates/universal/features/__NAME__/src/ContactForm.spec.tsx +0 -22
  129. package/templates/universal/features/__NAME__/src/ContactForm.tsx +0 -55
  130. package/templates/universal/features/__NAME__/src/HomeScreen.tsx +0 -40
  131. package/templates/universal/features/__NAME__/src/index.ts +0 -4
  132. package/templates/universal/features/__NAME__/src/screens.spec.ts +0 -12
  133. package/templates/universal/features/__NAME__/tsconfig.json +0 -5
  134. package/templates/universal/features/__NAME__/vitest.config.mjs +0 -7
  135. package/templates/universal/gitignore +0 -14
  136. package/templates/universal/npmrc +0 -3
  137. package/templates/universal/oxlintrc.json +0 -39
  138. package/templates/universal/package.json +0 -51
  139. package/templates/universal/packages/config/config.json +0 -4
  140. package/templates/universal/packages/config/index.ts +0 -5
  141. package/templates/universal/packages/config/package.json +0 -17
  142. package/templates/universal/packages/config/tsconfig.json +0 -5
  143. package/templates/universal/packages/i18n/en/common.json +0 -30
  144. package/templates/universal/packages/i18n/es/common.json +0 -30
  145. package/templates/universal/packages/i18n/i18n.d.ts +0 -16
  146. package/templates/universal/packages/i18n/index.ts +0 -26
  147. package/templates/universal/packages/i18n/package.json +0 -20
  148. package/templates/universal/packages/i18n/resources.ts +0 -13
  149. package/templates/universal/packages/i18n/tsconfig.json +0 -5
  150. package/templates/universal/packages/themes/accent.ts +0 -32
  151. package/templates/universal/packages/themes/base.ts +0 -50
  152. package/templates/universal/packages/themes/fonts.ts +0 -8
  153. package/templates/universal/packages/themes/index.ts +0 -33
  154. package/templates/universal/packages/themes/package.json +0 -23
  155. package/templates/universal/packages/themes/tamagui.config.ts +0 -14
  156. package/templates/universal/packages/themes/tsconfig.json +0 -5
  157. package/templates/universal/pnpm-workspace.yaml +0 -4
  158. package/templates/universal/tsconfig.base.json +0 -21
  159. package/templates/universal/types/env.d.ts +0 -9
  160. package/types/commands/initApp.d.ts +0 -114
  161. package/types/commands/initApp.d.ts.map +0 -1
  162. package/types/generateVscode.d.ts +0 -7
  163. package/types/generateVscode.d.ts.map +0 -1
@@ -1,9 +0,0 @@
1
- node_modules
2
- dist
3
- .turbo
4
- .vite
5
- .tamagui
6
- *.log
7
- .env
8
- .env.local
9
- .DS_Store
@@ -1,2 +0,0 @@
1
- auto-install-peers=true
2
- strict-peer-dependencies=false
@@ -1,39 +0,0 @@
1
- {
2
- "$schema": "./node_modules/oxlint/configuration_schema.json",
3
- "rules": {
4
- "no-unused-vars": [
5
- "warn",
6
- {
7
- "argsIgnorePattern": "^_",
8
- "varsIgnorePattern": "^_"
9
- }
10
- ],
11
- "no-console": "warn",
12
- "eqeqeq": "error",
13
- "no-var": "error",
14
- "prefer-const": "error"
15
- },
16
- "overrides": [
17
- {
18
- "files": [
19
- "apps/**/*.{ts,tsx,js,jsx}",
20
- "features/**/*.{ts,tsx,js,jsx}",
21
- "packages/**/*.{ts,tsx,js,jsx}"
22
- ],
23
- "rules": {
24
- "no-restricted-imports": [
25
- "error",
26
- {
27
- "paths": [
28
- {
29
- "name": "tamagui",
30
- "message": "Raw tamagui is only allowed inside framework packages. Import from @multiplatform.one/components, @multiplatform.one/forms, or @multiplatform.one/theme. See AGENTS.md."
31
- }
32
- ]
33
- }
34
- ]
35
- }
36
- }
37
- ],
38
- "ignorePatterns": ["**/node_modules/**", "**/dist/**", "**/build/**"]
39
- }
@@ -1,38 +0,0 @@
1
- {
2
- "name": "__NAME__",
3
- "version": "0.0.0",
4
- "private": true,
5
- "description": "__NAME__ — multiplatform.one app",
6
- "license": "MIT",
7
- "scripts": {
8
- "dev": "pnpm --filter @app/__NAME__ dev",
9
- "build": "pnpm --filter @app/__NAME__ build",
10
- "lint": "oxlint -c oxlintrc.json .",
11
- "typecheck": "pnpm -r typecheck"
12
- },
13
- "devDependencies": {
14
- "oxlint": "^1.62.0"
15
- },
16
- "engines": {
17
- "node": ">=20"
18
- },
19
- "packageManager": "pnpm@10.32.1",
20
- "pnpm": {
21
- "peerDependencyRules": {
22
- "allowedVersions": {
23
- "react": "19",
24
- "@react-navigation/native": "7",
25
- "vite": "8",
26
- "expo-constants": "55",
27
- "rehype-autolink-headings": "7",
28
- "rehype-slug": "6",
29
- "remark-mdx-frontmatter": "5"
30
- },
31
- "ignoreMissing": [
32
- "@react-navigation/native",
33
- "@types/emscripten",
34
- "react-native"
35
- ]
36
- }
37
- }
38
- }
@@ -1,4 +0,0 @@
1
- {
2
- "private": ["SECRET"],
3
- "public": ["BASE_URL", "DEBUG", "I18N_DEFAULT_LANGUAGE"]
4
- }
@@ -1,5 +0,0 @@
1
- import configJson from "./config.json";
2
-
3
- export const config = configJson;
4
- export type AppConfig = typeof configJson;
5
- export default config;
@@ -1,17 +0,0 @@
1
- {
2
- "name": "@package/config",
3
- "version": "0.0.0",
4
- "private": true,
5
- "type": "module",
6
- "main": "./index.ts",
7
- "exports": {
8
- ".": "./index.ts",
9
- "./config.json": "./config.json"
10
- },
11
- "scripts": {
12
- "typecheck": "tsgo --noEmit"
13
- },
14
- "devDependencies": {
15
- "typescript": "~5.9.3"
16
- }
17
- }
@@ -1,5 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.base.json",
3
- "include": ["./**/*"],
4
- "exclude": ["**/node_modules/**"]
5
- }
@@ -1,4 +0,0 @@
1
- packages:
2
- - apps/*
3
- - features/*
4
- - packages/*
@@ -1,16 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "compilerOptions": {
4
- "target": "ES2022",
5
- "lib": ["ES2022", "DOM", "DOM.Iterable"],
6
- "module": "ESNext",
7
- "moduleResolution": "Bundler",
8
- "jsx": "react-jsx",
9
- "strict": true,
10
- "skipLibCheck": true,
11
- "esModuleInterop": true,
12
- "resolveJsonModule": true,
13
- "isolatedModules": true,
14
- "noEmit": true
15
- }
16
- }
@@ -1,142 +0,0 @@
1
- # AGENTS.md — multiplatform.one conventions
2
-
3
- Machine-readable house rules for humans and coding agents. Prefer this file over
4
- reconstructing conventions from meeting notes. Detailed standards live under
5
- `agent-os/standards/`; the living UX rulebook is linked below.
6
-
7
- ## Workspace layout
8
-
9
- | Path | Role |
10
- | ------------------ | ------------------------------------------------------------------- |
11
- | `apps/<name>/` | Private applications (not published) |
12
- | `features/<name>/` | Feature modules for the matching app (screens, stories, playground) |
13
- | `packages/` | Private app-integration packages (`@package/*`) |
14
- | `public/` | Published `@multiplatform.one/*` packages |
15
-
16
- **App ↔ features twin:** every product app `apps/<name>` MUST have `features/<name>`.
17
- Platform/tooling shells (frappe, keycloak, storybook\*, vocs, vscode, webext, chain
18
- shells) are exempt in the convention linter; consumer apps from `mpo init --app`
19
- are not. Prefer feature code in `features/`, thin wiring in `apps/`.
20
-
21
- **Internal deps:** monorepo packages use `workspace:*`. Consumer / app-only
22
- templates use semver ranges from npm (`@multiplatform.one/*`).
23
-
24
- ## Package boundaries
25
-
26
- | Package | Owns | Must not |
27
- | ------------------------------- | ---------------------------------------------------- | -------------------------------------- |
28
- | `@multiplatform.one/theme` | Knobs, presets, intents, recipes, `useResolvedKnobs` | App screens |
29
- | `@multiplatform.one/components` | Catalog UI (layouts, surfaces, feedback, …) | Frappe/API assumptions |
30
- | `@multiplatform.one/forms` | Fields, Form, InputParts, field contracts | Table chrome / Frappe fetch |
31
- | `@multiplatform.one/table` | DataTable, cells, filters, URL table state | Frappe/API assumptions |
32
- | `@multiplatform.one/frappe-ui` | Frappe adapters (`FrappeTable`, field registry) | Re-implementing table/forms primitives |
33
- | `@multiplatform.one/frappe` | Frappe client / live query | UI |
34
-
35
- Dependency direction: `frappe-ui` → `table` / `forms` / `components` / `theme`.
36
- `table` and `forms` do not depend on `frappe-ui` or `frappe`.
37
-
38
- ### Import rules (enforced)
39
-
40
- 1. **No raw `tamagui` outside `public/`** — apps, features, and packages import
41
- `@multiplatform.one/components`, `@multiplatform.one/forms`, or
42
- `@multiplatform.one/theme` instead.
43
- 2. **Apps never relative-import `public/`** — use package names
44
- (`@multiplatform.one/…`), never `../../../public/…`.
45
- 3. **No `.css` files in `apps/*`** (except ignored bench/vendor trees) — styling
46
- goes through Tamagui + knobs.
47
- 4. **No hex color literals in `features/**`** — use theme tokens (`$color10`,
48
- semantic ramps, knob recipes).
49
-
50
- Run: `pnpm lint` (oxlint + `scripts/lint-conventions.mjs`).
51
-
52
- ## Knobs system (canonical)
53
-
54
- Structural styling (radius, space, elevation, typography, animation) is independent
55
- of Tamagui color themes. Full standard: `agent-os/standards/frontend/knobs-system.md`.
56
-
57
- ```tsx
58
- const { knobProps, control, text, elevation } = useResolvedKnobs({
59
- intent, // "error" | "accent" | "warning" | "success"
60
- component: "Button",
61
- compact,
62
- });
63
-
64
- <View
65
- {...knobProps.surface}
66
- {...knobProps.borderRadius}
67
- {...knobProps.panelPadding}
68
- {...knobProps.gap}
69
- {...knobProps.body}
70
- hoverStyle={{ ...control.hoverKnobProps }}
71
- pressStyle={{ ...control.pressKnobProps }}
72
- focusVisibleStyle={{ ...control.focusVisibleKnobProps }}
73
- />;
74
- ```
75
-
76
- Rules:
77
-
78
- - Always spread complete `knobProps.*` fragments — never cherry-pick resolved tokens.
79
- - `resolveKnobs()` is the only canonical mapping from abstract knobs → Tamagui props.
80
- - Consumer `{...props}` come last (explicit eject), not internal defaults that fight recipes.
81
- - Presets cascade (`<Preset preset="…" theme="…">`); nested `overrides` merge by key.
82
- - One knob flip restyles the screen (LC-18 KNOB-TOTALITY), or the knob is broken.
83
-
84
- ## Forms contract
85
-
86
- Standard refs: `agent-os/standards/frontend/field-architecture.md`,
87
- `field-layout.md`, `form-colors.md`, `input-parts.md`.
88
-
89
- - Initialize with `useFormField()` + `useResolvedValidators()`.
90
- - Three-branch render: skeleton → standalone → form-integrated (`<Field>`).
91
- - Canonical change prop is `onChange(value)` (LC-14). Deprecated aliases may fire
92
- but must not be the only path.
93
- - Field slot order: Label → Hint → Error → Control; error replaces helper in one slot.
94
- - Use form color ramps from `shared/colorRamps.ts` — no hardcoded color tokens.
95
- - Fields auto-detect `useIsInTableCell()` and render chromeless inside cells.
96
- - Capability surfaces (camera, geo, …) MUST preflight before mount (LC-19).
97
-
98
- ## Table contract
99
-
100
- Standard ref: `public/table/README.md` (package boundaries), cell/editor anatomy in
101
- the living rulebook.
102
-
103
- - `@multiplatform.one/table` is framework-agnostic display/filter/sort/paginate.
104
- - Cell editors larger than the anchor use popover (web) / sheet (native) — never
105
- grow the row (LC-06). Editor popups dismiss only on dismissal intent (LC-21).
106
- - Frappe integration belongs in `@multiplatform.one/frappe-ui` (`FrappeTable`,
107
- registry adapters), not in `table`.
108
- - Child-table / TableInput follow the same field `onChange` contract as forms.
109
-
110
- ## Living rulebook
111
-
112
- **Normative UX + composition rules (LC-\* and recipe taxonomy):**
113
-
114
- → [`docs/theme-propagation-spec.md`](./docs/theme-propagation-spec.md)
115
-
116
- That document is the living rulebook: every owner-reported spacing/UX issue is
117
- adjudicated there in-session as VIOLATION or GAP (new LC-\* rule + VERIFY). Agents
118
- changing catalog components MUST read it first; a contradicting change updates the
119
- spec in the same change. Companion docs:
120
-
121
- - Catalog guidelines: `docs/design-guidelines.md` + `docs/design-guidelines-blueprint.md`
122
- - Click-matrix / VERIFY arm: `docs/storybook-knob-edge-cases.md`
123
- - Agent OS standards index: `agent-os/standards/index.yml`
124
-
125
- ## Tooling
126
-
127
- | Command | Purpose |
128
- | ----------------------- | -------------------------------------------------------------- |
129
- | `pnpm lint` | oxlint (incl. convention rules) + structural convention checks |
130
- | `pnpm lint:conventions` | Structural checks only (css twin, features twin) |
131
- | `pnpm format` | oxfmt |
132
- | `pnpm ci:local` | format + lint + typecheck + build + test + tree-clean |
133
-
134
- Use **oxlint / oxfmt**, not ESLint / Prettier
135
- (`agent-os/standards/global/linting-formatting.md`).
136
-
137
- ## Coding defaults
138
-
139
- - Named exports only; cut dead/legacy aliases unless a task explicitly needs them.
140
- - Cross-platform: shared code first; `.native.tsx` / `.web.tsx` only when required.
141
- - Stories and tests live next to the component / feature they cover.
142
- - Deeper style rules: `agent-os/standards/global/coding-style.md`.
@@ -1,97 +0,0 @@
1
- # **NAME**
2
-
3
- Universal multiplatform.one project scaffolded by
4
- [`@multiplatform.one/cli`](https://www.npmjs.com/package/@multiplatform.one/cli)
5
- (`mpo init`). One codebase serves **web (SSR)**, **iOS**, and **Android** through
6
- the [`one`](https://onestack.dev) framework.
7
-
8
- This is **not** a fork of the multiplatform.one monorepo. Framework packages come
9
- from npm at semver ranges (`@multiplatform.one/*`: `__MPO_VERSION__`), never
10
- `workspace:*`.
11
-
12
- ## Layout
13
-
14
- | Path | Role |
15
- | -------------------- | ------------------------------------------------------------------- |
16
- | `apps/__NAME__/` | Universal app shell: file-based routes, providers, vite/expo config |
17
- | `features/__NAME__/` | Feature screens / UI — import from here, not from `apps/` |
18
- | `packages/config/` | Shared app config (`@package/config`) |
19
- | `packages/i18n/` | Translations (`@package/i18n`) |
20
- | `packages/themes/` | Tamagui theme config (`@package/themes`) |
21
-
22
- Convention: every `apps/<name>` has a matching `features/<name>`.
23
-
24
- ## Commands
25
-
26
- ```bash
27
- pnpm install
28
-
29
- # web
30
- pnpm dev # dev server (web + native bundles) on :3456
31
- pnpm build # production web build (one build)
32
- pnpm serve # serve the production build
33
-
34
- # native (Expo dev client via one)
35
- pnpm native # generate ios/ + android/ projects (one prebuild)
36
- pnpm ios # build & run on iOS simulator/device (one run:ios)
37
- pnpm android # build & run on Android emulator/device (one run:android)
38
-
39
- # quality
40
- pnpm test # vitest (features)
41
- pnpm lint # oxlint
42
- pnpm typecheck # tsc across workspace packages
43
- ```
44
-
45
- Native flow: `pnpm ios` / `pnpm android` builds a dev client and connects it to
46
- the dev server started by `pnpm dev`. Run `pnpm dev` in another terminal first.
47
-
48
- ## Routing
49
-
50
- Routes are files in `apps/__NAME__/routes/`:
51
-
52
- - `routes/index.tsx` → `/` (`HomeScreen`)
53
- - `routes/about.tsx` → `/about` (`AboutScreen`)
54
- - `routes/_layout.tsx` / `_layout.web.tsx` — root layout, providers, i18n
55
-
56
- Navigate with `Link` / `useRouter` / `usePathname` from `one` — the same
57
- pattern the framework's own layouts use.
58
-
59
- ## Starter screens
60
-
61
- - `HomeScreen` — theme/knob-wired welcome card (`useResolvedKnobs`) + navigation
62
- - `AboutScreen` — router navigation demo
63
- - `ContactForm` — `@multiplatform.one/forms` fields (`Input`, `TextArea`, `Button`)
64
-
65
- ## i18n
66
-
67
- Translations live in `packages/i18n/<lng>/common.json`. Add a language by adding
68
- a folder + `common.json` and listing it in `packages/i18n/index.ts`. Use
69
- `useTranslation()` from `react-i18next` in screens.
70
-
71
- ## Dependencies
72
-
73
- Framework packages come from npm at semver ranges, for example:
74
-
75
- ```json
76
- {
77
- "@multiplatform.one/components": "__MPO_VERSION__",
78
- "@multiplatform.one/forms": "__MPO_VERSION__",
79
- "@multiplatform.one/router": "__MPO_VERSION__",
80
- "@multiplatform.one/theme": "__MPO_VERSION__"
81
- }
82
- ```
83
-
84
- Upgrade with `pnpm update "@multiplatform.one/*"`.
85
-
86
- ## Conventions
87
-
88
- See [`AGENTS.md`](./AGENTS.md) for package boundaries, the apps ↔ features twin,
89
- import rules (no raw `tamagui` outside framework packages, no hex literals in
90
- features), and knobs/forms/table contracts.
91
-
92
- ## Next steps
93
-
94
- 1. Replace the starter screens in `features/__NAME__/src/`.
95
- 2. Add routes under `apps/__NAME__/routes/` that re-export feature screens.
96
- 3. Adjust the theme in `packages/themes/index.ts` (`createDefaultThemeConfig`).
97
- 4. Do **not** copy `public/` from the framework monorepo into this project.
@@ -1,31 +0,0 @@
1
- // Expo config consumed by `one prebuild` / `one run:ios` / `one run:android`.
2
- // Evaluated through @expo/config's CJS pipeline, so CommonJS is required here.
3
- const { public: publicConfigKeys } = require("../../packages/config/config.json");
4
-
5
- const publicConfig = publicConfigKeys.reduce((acc, key) => {
6
- if (process.env[key]) acc[key] = process.env[key];
7
- return acc;
8
- }, {});
9
-
10
- module.exports = {
11
- expo: {
12
- name: "__NAME_PASCAL__",
13
- slug: "__NAME__",
14
- scheme: "__NAME__",
15
- version: "1.0.0",
16
- orientation: "portrait",
17
- userInterfaceStyle: "automatic",
18
- platforms: ["ios", "android"],
19
- ios: {
20
- bundleIdentifier: "com.__NAME_APPID__.app",
21
- supportsTablet: true,
22
- },
23
- android: {
24
- package: "com.__NAME_APPID__.app",
25
- },
26
- extra: {
27
- ...publicConfig,
28
- },
29
- plugins: ["vxrn/expo-plugin"],
30
- },
31
- };
@@ -1,4 +0,0 @@
1
- import { config } from "@package/themes/tamagui.config";
2
- export type { AppConfig as Conf } from "@package/themes/tamagui.config";
3
- export { config };
4
- export default config;
@@ -1,62 +0,0 @@
1
- {
2
- "name": "@app/__NAME__",
3
- "version": "0.0.0",
4
- "private": true,
5
- "type": "module",
6
- "scripts": {
7
- "dev": "one dev --port 3456",
8
- "build": "one build",
9
- "serve": "one serve",
10
- "typecheck": "tsgo --noEmit",
11
- "prebuild:native": "one prebuild",
12
- "prebuild:ios": "one prebuild --platform ios",
13
- "prebuild:android": "one prebuild --platform android",
14
- "ios": "one run:ios",
15
- "android": "one run:android"
16
- },
17
- "dependencies": {
18
- "@features/__NAME__": "workspace:*",
19
- "@multiplatform.one/components": "__MPO_VERSION__",
20
- "@multiplatform.one/core": "__MPO_VERSION__",
21
- "@multiplatform.one/frappe": "__MPO_VERSION__",
22
- "@multiplatform.one/frappe-ui": "__MPO_VERSION__",
23
- "@multiplatform.one/i18n": "__MPO_VERSION__",
24
- "@multiplatform.one/keycloak": "__MPO_VERSION__",
25
- "@multiplatform.one/platform": "__MPO_VERSION__",
26
- "@multiplatform.one/theme": "__MPO_VERSION__",
27
- "@package/config": "workspace:*",
28
- "@package/i18n": "workspace:*",
29
- "@package/themes": "workspace:*",
30
- "@react-navigation/native": "~7.2.2",
31
- "@tamagui/core": "2.7.6",
32
- "@tanstack/react-query": "^5.100.7",
33
- "@tanstack/react-query-devtools": "^5.100.7",
34
- "@tanstack/react-virtual": "^3.13.24",
35
- "expo": "~55.0.26",
36
- "i18next": "^25.10.10",
37
- "one": "1.16.5",
38
- "react": "19.2.5",
39
- "react-dom": "19.2.5",
40
- "react-i18next": "^16.6.6",
41
- "react-native": "0.83.2",
42
- "react-native-gesture-handler": "~2.31.1",
43
- "react-native-reanimated": "~4.2.1",
44
- "react-native-safe-area-context": "~5.7.0",
45
- "react-native-screens": "^4.24.0",
46
- "react-native-svg": "15.15.4",
47
- "react-native-web": "^0.21.2",
48
- "react-native-worklets": "~0.7.4",
49
- "shiki": "^4.0.2",
50
- "tamagui": "2.7.6",
51
- "text-encoding-utf-8": "^1.0.2"
52
- },
53
- "devDependencies": {
54
- "@multiplatform.one/config": "__MPO_VERSION__",
55
- "@react-native-community/cli": "^20.1.3",
56
- "@types/react": "~19.2.14",
57
- "@typescript/native-preview": "^7.0.0-dev.20260707.2",
58
- "@vitejs/plugin-react": "^6.0.2",
59
- "typescript": "~5.9.3",
60
- "vite": "^8.0.10"
61
- }
62
- }
@@ -1,23 +0,0 @@
1
- // Hermes (React Native) ships without the WHATWG TextEncoder/TextDecoder
2
- // globals. Install them as the first side-effect of the native root layout,
3
- // before any provider mounts.
4
- import { TextDecoder, TextEncoder } from "text-encoding-utf-8";
5
-
6
- const globals = globalThis as Record<string, unknown>;
7
- if (typeof globals.TextEncoder === "undefined") globals.TextEncoder = TextEncoder;
8
- if (typeof globals.TextDecoder === "undefined") globals.TextDecoder = TextDecoder;
9
-
10
- // React Native's built-in URL exposes protocol/pathname/search/hash as
11
- // GETTER-ONLY. expo-asset's getManifestBaseUrl() assigns to those properties at
12
- // module init, which throws in strict mode and takes down the native root
13
- // layout at boot. Install tolerant no-op setters so the assignment silently
14
- // no-ops. Guarded so a future spec-complete URL polyfill is never overwritten.
15
- const urlProto = (globals.URL as { prototype?: object } | undefined)?.prototype;
16
- if (urlProto) {
17
- for (const prop of ["protocol", "pathname", "search", "hash"]) {
18
- const desc = Object.getOwnPropertyDescriptor(urlProto, prop);
19
- if (desc && typeof desc.get === "function" && typeof desc.set !== "function") {
20
- Object.defineProperty(urlProto, prop, { ...desc, set() {} });
21
- }
22
- }
23
- }
@@ -1,3 +0,0 @@
1
- // Web has native TextEncoder/TextDecoder — no polyfill needed. This no-op is the
2
- // web/default resolution of `./polyfills`; the native variant does the work.
3
- export {};
@@ -1,22 +0,0 @@
1
- import "../polyfills"; // installs TextEncoder/TextDecoder before any provider mounts (Hermes lacks them)
2
- import { AppLayout } from "@features/__NAME__";
3
- import { createRootLayout } from "@multiplatform.one/core";
4
- import { defaultLanguage, defaultNamespace, languages, namespaces } from "@package/i18n";
5
- import { resources } from "@package/i18n/resources";
6
- import { importFonts } from "@package/themes/fonts";
7
- import { AppProvider } from "../src/app";
8
-
9
- // Native root layout (web resolves _layout.web.tsx). Translations are imported
10
- // statically here; web loads them through the vite i18next loader.
11
- export default createRootLayout({
12
- AppProvider,
13
- RootLayout: AppLayout,
14
- fonts: importFonts(),
15
- i18n: {
16
- languages,
17
- namespaces,
18
- defaultLanguage,
19
- defaultNamespace,
20
- resources,
21
- },
22
- });
@@ -1,21 +0,0 @@
1
- import "@tamagui/core/reset.css";
2
- import "../tamagui.css";
3
- import resources from "virtual:i18next-loader";
4
- import { AppLayout } from "@features/__NAME__";
5
- import { createRootLayout } from "@multiplatform.one/core";
6
- import { defaultLanguage, defaultNamespace, languages, namespaces } from "@package/i18n";
7
- import { AppProvider } from "../src/app";
8
-
9
- // Web root layout (native resolves _layout.tsx). Translations come from the
10
- // vite i18next loader (packages/i18n) so they hot-reload in dev.
11
- export default createRootLayout({
12
- AppProvider,
13
- RootLayout: AppLayout,
14
- i18n: {
15
- languages,
16
- namespaces,
17
- defaultLanguage,
18
- defaultNamespace,
19
- resources,
20
- },
21
- });
@@ -1,3 +0,0 @@
1
- import { AboutScreen } from "@features/__NAME__";
2
-
3
- export default AboutScreen;
@@ -1,3 +0,0 @@
1
- import { HomeScreen } from "@features/__NAME__";
2
-
3
- export default HomeScreen;
@@ -1,10 +0,0 @@
1
- import { createApp } from "@multiplatform.one/core";
2
- import { themeConfig } from "@package/themes";
3
-
4
- /**
5
- * App-wide provider stack. Add keycloak / frappe / tanstack / web3 here as the
6
- * app grows — see CreateAppConfig in @multiplatform.one/core.
7
- */
8
- export const { AppProvider, useAppConfig, withApp } = createApp({
9
- theme: themeConfig,
10
- });
@@ -1,3 +0,0 @@
1
- /* Generated by @tamagui/vite-plugin (outputCSS). This stub keeps the
2
- `import "../tamagui.css"` in routes/_layout.web.tsx resolvable on a fresh
3
- scaffold; dev/build regenerate it. */
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.base.json",
3
- "compilerOptions": {
4
- "types": ["vite/client"]
5
- },
6
- "include": ["./config/**/*", "./routes/**/*", "./src/**/*", "./*.ts", "./types.d.ts"],
7
- "exclude": ["**/node_modules/**", "dist/**", "ios/**", "android/**"]
8
- }
@@ -1,9 +0,0 @@
1
- /// <reference types="../../packages/i18n/i18n.d.ts" />
2
- /// <reference types="@multiplatform.one/platform/rnw-overrides" />
3
-
4
- declare module "virtual:*";
5
-
6
- // Published core@6.1.0 sources carry a type skew against published
7
- // frappe-ui@6.1.0 (FrappeProvider auth.token). The app never imports
8
- // frappe-ui directly; treat it as untyped until fixed packages publish.
9
- declare module "@multiplatform.one/frappe-ui";
@@ -1,20 +0,0 @@
1
- import { createViteConfig } from "@multiplatform.one/config/vite";
2
- import { one } from "one/vite";
3
- import configJson from "../../packages/config/config.json" with { type: "json" };
4
-
5
- const publicConfigKeys = configJson.public;
6
-
7
- export default createViteConfig({
8
- publicConfigKeys,
9
- one: true,
10
- tamagui: { config: "./config/tamagui.config.ts", outputCSS: "./tamagui.css" },
11
- i18n: { paths: ["../../packages/i18n"] },
12
- plugins: [
13
- one({
14
- router: { root: "routes" },
15
- web: { deploy: "node", defaultRenderMode: "ssr" },
16
- react: { compiler: true },
17
- native: { key: "__NAME_PASCAL__" },
18
- }),
19
- ],
20
- });