@multiplatform.one/cli 6.0.4 → 6.3.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.
- package/README.md +72 -0
- package/bin/createMultiplatformApp.mjs +77 -0
- package/lib/bin/multiplatformOne.mjs +23 -9
- package/lib/commands/e2e.mjs +3 -3
- package/lib/commands/init.mjs +16 -12
- package/lib/commands/initApp.mjs +145 -0
- package/lib/generateVscode.mjs +27 -10
- package/package.json +23 -12
- package/src/bin/multiplatformOne.ts +54 -16
- package/src/commands/init.ts +7 -18
- package/src/commands/initApp.spec.ts +210 -0
- package/src/commands/initApp.ts +228 -0
- package/src/generateVscode.ts +31 -9
- package/templates/app/AGENTS.md +142 -0
- package/templates/app/README.md +62 -0
- package/templates/app/apps/__NAME__/index.html +36 -0
- package/templates/app/apps/__NAME__/package.json +30 -0
- package/templates/app/apps/__NAME__/public/fonts/inter-400.woff2 +0 -0
- package/templates/app/apps/__NAME__/public/fonts/inter-700.woff2 +0 -0
- package/templates/app/apps/__NAME__/src/App.tsx +9 -0
- package/templates/app/apps/__NAME__/src/main.tsx +14 -0
- package/templates/app/apps/__NAME__/tsconfig.json +8 -0
- package/templates/app/apps/__NAME__/vite.config.ts +17 -0
- package/templates/app/features/__NAME__/package.json +34 -0
- package/templates/app/features/__NAME__/src/HomeScreen.tsx +70 -0
- package/templates/app/features/__NAME__/src/index.ts +1 -0
- package/templates/app/features/__NAME__/tsconfig.json +5 -0
- package/templates/app/gitignore +8 -0
- package/templates/app/npmrc +2 -0
- package/templates/app/oxlintrc.json +39 -0
- package/templates/app/package.json +20 -0
- package/templates/app/packages/config/config.json +4 -0
- package/templates/app/packages/config/index.ts +5 -0
- package/templates/app/packages/config/package.json +17 -0
- package/templates/app/packages/config/tsconfig.json +5 -0
- package/templates/app/pnpm-workspace.yaml +4 -0
- package/templates/app/tsconfig.base.json +16 -0
- package/templates/universal/AGENTS.md +142 -0
- package/templates/universal/README.md +97 -0
- package/templates/universal/apps/__NAME__/app.config.js +31 -0
- package/templates/universal/apps/__NAME__/config/tamagui.config.ts +4 -0
- package/templates/universal/apps/__NAME__/package.json +61 -0
- package/templates/universal/apps/__NAME__/polyfills.native.ts +23 -0
- package/templates/universal/apps/__NAME__/polyfills.ts +3 -0
- package/templates/universal/apps/__NAME__/public/fonts/inter-400.woff2 +0 -0
- package/templates/universal/apps/__NAME__/public/fonts/inter-700.woff2 +0 -0
- package/templates/universal/apps/__NAME__/routes/_layout.tsx +22 -0
- package/templates/universal/apps/__NAME__/routes/_layout.web.tsx +21 -0
- package/templates/universal/apps/__NAME__/routes/about.tsx +3 -0
- package/templates/universal/apps/__NAME__/routes/index.tsx +3 -0
- package/templates/universal/apps/__NAME__/src/app.ts +10 -0
- package/templates/universal/apps/__NAME__/tamagui.css +3 -0
- package/templates/universal/apps/__NAME__/tsconfig.json +8 -0
- package/templates/universal/apps/__NAME__/types.d.ts +9 -0
- package/templates/universal/apps/__NAME__/vite.config.ts +66 -0
- package/templates/universal/features/__NAME__/package.json +35 -0
- package/templates/universal/features/__NAME__/src/AboutScreen.tsx +27 -0
- package/templates/universal/features/__NAME__/src/AppLayout.tsx +50 -0
- package/templates/universal/features/__NAME__/src/ContactForm.spec.tsx +22 -0
- package/templates/universal/features/__NAME__/src/ContactForm.tsx +55 -0
- package/templates/universal/features/__NAME__/src/HomeScreen.tsx +40 -0
- package/templates/universal/features/__NAME__/src/index.ts +4 -0
- package/templates/universal/features/__NAME__/src/screens.spec.ts +12 -0
- package/templates/universal/features/__NAME__/tsconfig.json +5 -0
- package/templates/universal/features/__NAME__/vitest.config.mjs +7 -0
- package/templates/universal/gitignore +12 -0
- package/templates/universal/npmrc +3 -0
- package/templates/universal/oxlintrc.json +39 -0
- package/templates/universal/package.json +27 -0
- package/templates/universal/packages/config/config.json +4 -0
- package/templates/universal/packages/config/index.ts +5 -0
- package/templates/universal/packages/config/package.json +17 -0
- package/templates/universal/packages/config/tsconfig.json +5 -0
- package/templates/universal/packages/i18n/en/common.json +30 -0
- package/templates/universal/packages/i18n/es/common.json +30 -0
- package/templates/universal/packages/i18n/i18n.d.ts +16 -0
- package/templates/universal/packages/i18n/index.ts +26 -0
- package/templates/universal/packages/i18n/package.json +20 -0
- package/templates/universal/packages/i18n/resources.ts +13 -0
- package/templates/universal/packages/i18n/tsconfig.json +5 -0
- package/templates/universal/packages/themes/accent.ts +32 -0
- package/templates/universal/packages/themes/base.ts +50 -0
- package/templates/universal/packages/themes/fonts.ts +8 -0
- package/templates/universal/packages/themes/index.ts +33 -0
- package/templates/universal/packages/themes/package.json +23 -0
- package/templates/universal/packages/themes/tamagui.config.ts +14 -0
- package/templates/universal/packages/themes/tsconfig.json +5 -0
- package/templates/universal/pnpm-workspace.yaml +4 -0
- package/templates/universal/tsconfig.base.json +21 -0
- package/templates/universal/types/env.d.ts +9 -0
- package/types/bin/multiplatformOne.d.ts +11 -0
- package/types/bin/multiplatformOne.d.ts.map +1 -0
- package/types/commands/e2e.d.ts +14 -0
- package/types/commands/e2e.d.ts.map +1 -0
- package/types/commands/init.d.ts +16 -0
- package/types/commands/init.d.ts.map +1 -0
- package/types/commands/initApp.d.ts +25 -0
- package/types/commands/initApp.d.ts.map +1 -0
- package/types/generateVscode.d.ts +7 -0
- package/types/generateVscode.d.ts.map +1 -0
- package/types/index.d.ts +2 -0
- package/types/index.d.ts.map +1 -0
- package/types/types.d.ts +6 -0
- package/types/types.d.ts.map +1 -0
|
@@ -0,0 +1,142 @@
|
|
|
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`.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# **NAME**
|
|
2
|
+
|
|
3
|
+
App-only project scaffolded by [`@multiplatform.one/cli`](https://www.npmjs.com/package/@multiplatform.one/cli)
|
|
4
|
+
(`mpo init --app` / `create-multiplatform-app`).
|
|
5
|
+
|
|
6
|
+
This is **not** a fork of the multiplatform.one monorepo. Framework packages come from npm at
|
|
7
|
+
semver ranges (`@multiplatform.one/*`: `__MPO_VERSION__`), never `workspace:*`.
|
|
8
|
+
|
|
9
|
+
## Layout
|
|
10
|
+
|
|
11
|
+
| Path | Role |
|
|
12
|
+
| -------------------- | --------------------------------------------------------- |
|
|
13
|
+
| `apps/__NAME__/` | App shell (Vite + React web stub) |
|
|
14
|
+
| `features/__NAME__/` | Feature screens / UI — import from here, not from `apps/` |
|
|
15
|
+
| `packages/config/` | Shared app config (`@package/config`) |
|
|
16
|
+
|
|
17
|
+
Convention: every `apps/<name>` has a matching `features/<name>`.
|
|
18
|
+
|
|
19
|
+
## Commands
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pnpm install
|
|
23
|
+
pnpm dev # start the web stub
|
|
24
|
+
pnpm build
|
|
25
|
+
pnpm lint
|
|
26
|
+
pnpm typecheck
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Dependencies
|
|
30
|
+
|
|
31
|
+
Feature and app packages depend on published framework packages, for example:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"@multiplatform.one/components": "__MPO_VERSION__",
|
|
36
|
+
"@multiplatform.one/theme": "__MPO_VERSION__",
|
|
37
|
+
"@multiplatform.one/platform": "__MPO_VERSION__"
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Upgrade with your usual package manager (`pnpm update @multiplatform.one/*`).
|
|
42
|
+
|
|
43
|
+
## Conventions
|
|
44
|
+
|
|
45
|
+
See [`AGENTS.md`](./AGENTS.md) for package boundaries, the apps ↔ features twin,
|
|
46
|
+
import rules (no raw `tamagui` outside framework packages, no relative `public/`
|
|
47
|
+
imports, no hex literals in features), and knobs/forms/table contracts.
|
|
48
|
+
|
|
49
|
+
## Next steps
|
|
50
|
+
|
|
51
|
+
1. Replace the stub `HomeScreen` in `features/__NAME__/src/HomeScreen.tsx`.
|
|
52
|
+
2. Add routes / screens under `features/__NAME__/`.
|
|
53
|
+
3. When you need native (Expo / one), extend `apps/__NAME__/` — keep business UI in `features/`.
|
|
54
|
+
4. Do **not** copy `public/` from the framework monorepo into this project.
|
|
55
|
+
|
|
56
|
+
## Create another app
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
mpo init --app another-app
|
|
60
|
+
# or
|
|
61
|
+
npx --package=@multiplatform.one/cli create-multiplatform-app another-app
|
|
62
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>__NAME_PASCAL__</title>
|
|
7
|
+
<!--
|
|
8
|
+
LC-33 FONT-STABLE-MOUNT: the shell owns Inter (the theme package does
|
|
9
|
+
not inject @font-face as a CSS side effect). Preload + a head face with
|
|
10
|
+
font-display: optional means first paint already renders Inter and the
|
|
11
|
+
face never swaps after mount. The binaries live in public/fonts/.
|
|
12
|
+
-->
|
|
13
|
+
<link rel="preload" href="/fonts/inter-400.woff2" as="font" type="font/woff2" crossorigin />
|
|
14
|
+
<link rel="preload" href="/fonts/inter-700.woff2" as="font" type="font/woff2" crossorigin />
|
|
15
|
+
<style data-font-inter>
|
|
16
|
+
@font-face {
|
|
17
|
+
font-family: "Inter";
|
|
18
|
+
font-style: normal;
|
|
19
|
+
font-weight: 400;
|
|
20
|
+
font-display: optional;
|
|
21
|
+
src: url("/fonts/inter-400.woff2") format("woff2");
|
|
22
|
+
}
|
|
23
|
+
@font-face {
|
|
24
|
+
font-family: "Inter";
|
|
25
|
+
font-style: normal;
|
|
26
|
+
font-weight: 700;
|
|
27
|
+
font-display: optional;
|
|
28
|
+
src: url("/fonts/inter-700.woff2") format("woff2");
|
|
29
|
+
}
|
|
30
|
+
</style>
|
|
31
|
+
</head>
|
|
32
|
+
<body>
|
|
33
|
+
<div id="root"></div>
|
|
34
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
35
|
+
</body>
|
|
36
|
+
</html>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@app/__NAME__",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"preview": "vite preview",
|
|
10
|
+
"typecheck": "tsc --noEmit"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@features/__NAME__": "workspace:*",
|
|
14
|
+
"@multiplatform.one/components": "__MPO_VERSION__",
|
|
15
|
+
"@multiplatform.one/platform": "__MPO_VERSION__",
|
|
16
|
+
"@multiplatform.one/theme": "__MPO_VERSION__",
|
|
17
|
+
"@package/config": "workspace:*",
|
|
18
|
+
"react": "^19.2.5",
|
|
19
|
+
"react-dom": "^19.2.5",
|
|
20
|
+
"react-native-web": "^0.21.2",
|
|
21
|
+
"tamagui": "2.0.0-rc.41"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/react": "~19.2.14",
|
|
25
|
+
"@types/react-dom": "~19.2.3",
|
|
26
|
+
"@vitejs/plugin-react": "^6.0.2",
|
|
27
|
+
"typescript": "~5.9.3",
|
|
28
|
+
"vite": "^8.0.10"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StrictMode } from "react";
|
|
2
|
+
import { createRoot } from "react-dom/client";
|
|
3
|
+
import { App } from "./App";
|
|
4
|
+
|
|
5
|
+
const root = document.getElementById("root");
|
|
6
|
+
if (!root) {
|
|
7
|
+
throw new Error("#root element missing");
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
createRoot(root).render(
|
|
11
|
+
<StrictMode>
|
|
12
|
+
<App />
|
|
13
|
+
</StrictMode>,
|
|
14
|
+
);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import react from "@vitejs/plugin-react";
|
|
2
|
+
import { defineConfig } from "vite";
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
plugins: [react()],
|
|
6
|
+
server: {
|
|
7
|
+
port: 3456,
|
|
8
|
+
},
|
|
9
|
+
resolve: {
|
|
10
|
+
alias: {
|
|
11
|
+
"react-native": "react-native-web",
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
optimizeDeps: {
|
|
15
|
+
include: ["react", "react-dom", "react-native-web"],
|
|
16
|
+
},
|
|
17
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@features/__NAME__",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./src/index.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./src/index.ts",
|
|
9
|
+
"./*": "./src/*.ts",
|
|
10
|
+
"./HomeScreen": "./src/HomeScreen.tsx"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"typecheck": "tsc --noEmit"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@multiplatform.one/components": "__MPO_VERSION__",
|
|
17
|
+
"@multiplatform.one/platform": "__MPO_VERSION__",
|
|
18
|
+
"@multiplatform.one/theme": "__MPO_VERSION__",
|
|
19
|
+
"@package/config": "workspace:*",
|
|
20
|
+
"react": "^19.2.5",
|
|
21
|
+
"react-dom": "^19.2.5",
|
|
22
|
+
"react-native-web": "^0.21.2",
|
|
23
|
+
"tamagui": "2.0.0-rc.41"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@types/react": "~19.2.14",
|
|
27
|
+
"@types/react-dom": "~19.2.3",
|
|
28
|
+
"typescript": "~5.9.3"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"react": "^19.1.0",
|
|
32
|
+
"react-dom": "^19.1.0"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { CSSProperties } from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Feature screen for __NAME__.
|
|
5
|
+
*
|
|
6
|
+
* Keep product UI in features/<name>. The app shell (apps/<name>) should only
|
|
7
|
+
* wire providers, routing, and platform entry points.
|
|
8
|
+
*
|
|
9
|
+
* Prefer importing from @multiplatform.one/components once you add Tamagui
|
|
10
|
+
* providers (see apps/__NAME__/src/main.tsx). This stub stays dependency-light
|
|
11
|
+
* so `pnpm dev` works immediately after scaffold.
|
|
12
|
+
*/
|
|
13
|
+
export function HomeScreen() {
|
|
14
|
+
return (
|
|
15
|
+
<main style={styles.main}>
|
|
16
|
+
<p style={styles.eyebrow}>multiplatform.one</p>
|
|
17
|
+
<h1 style={styles.title}>__NAME_PASCAL__</h1>
|
|
18
|
+
<p style={styles.body}>
|
|
19
|
+
App-only scaffold. Framework packages resolve from npm at semver ranges — not{" "}
|
|
20
|
+
<code>workspace:*</code>.
|
|
21
|
+
</p>
|
|
22
|
+
<ul style={styles.list}>
|
|
23
|
+
<li>
|
|
24
|
+
<code>apps/__NAME__</code> — shell
|
|
25
|
+
</li>
|
|
26
|
+
<li>
|
|
27
|
+
<code>features/__NAME__</code> — screens (you are here)
|
|
28
|
+
</li>
|
|
29
|
+
<li>
|
|
30
|
+
<code>packages/config</code> — shared config
|
|
31
|
+
</li>
|
|
32
|
+
</ul>
|
|
33
|
+
</main>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const styles: Record<string, CSSProperties> = {
|
|
38
|
+
main: {
|
|
39
|
+
fontFamily:
|
|
40
|
+
'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
41
|
+
maxWidth: 560,
|
|
42
|
+
margin: "0 auto",
|
|
43
|
+
padding: "4rem 1.5rem",
|
|
44
|
+
color: "#0f172a",
|
|
45
|
+
},
|
|
46
|
+
eyebrow: {
|
|
47
|
+
margin: 0,
|
|
48
|
+
fontSize: 12,
|
|
49
|
+
letterSpacing: "0.08em",
|
|
50
|
+
textTransform: "uppercase",
|
|
51
|
+
color: "#64748b",
|
|
52
|
+
},
|
|
53
|
+
title: {
|
|
54
|
+
margin: "0.5rem 0 1rem",
|
|
55
|
+
fontSize: "2.25rem",
|
|
56
|
+
lineHeight: 1.15,
|
|
57
|
+
},
|
|
58
|
+
body: {
|
|
59
|
+
margin: "0 0 1.5rem",
|
|
60
|
+
fontSize: 16,
|
|
61
|
+
lineHeight: 1.55,
|
|
62
|
+
color: "#334155",
|
|
63
|
+
},
|
|
64
|
+
list: {
|
|
65
|
+
margin: 0,
|
|
66
|
+
paddingInlineStart: "1.25rem",
|
|
67
|
+
color: "#334155",
|
|
68
|
+
lineHeight: 1.8,
|
|
69
|
+
},
|
|
70
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HomeScreen } from "./HomeScreen";
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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": "tsc --noEmit"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"typescript": "~5.9.3"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
}
|