@multiplatform.one/cli 9.17.0 → 10.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/cli",
3
- "version": "9.17.0",
3
+ "version": "10.0.0",
4
4
  "description": "multiplatform.one cli — mpo init clones and prunes the monorepo, mpo update merges it back",
5
5
  "keywords": [
6
6
  "create-multiplatform-app",
@@ -57,18 +57,18 @@
57
57
  "access": "public"
58
58
  },
59
59
  "dependencies": {
60
- "@multiplatform.one/utils": "^9.17.0",
60
+ "@multiplatform.one/utils": "^10.0.0",
61
61
  "commander": "^15.0.0",
62
62
  "dotenv": "^17.4.2",
63
63
  "inquirer": "^14.2.3",
64
64
  "nano-spawn": "^2.1.0",
65
+ "typescript": "~5.9.3",
65
66
  "yaml": "^2.9.1",
66
67
  "yocto-spinner": "^1.2.2"
67
68
  },
68
69
  "devDependencies": {
69
70
  "@types/inquirer": "^9.0.10",
70
71
  "@types/node": "^26.6.5",
71
- "typescript": "~5.9.3",
72
72
  "vitest": "^4.1.12"
73
73
  },
74
74
  "engines": {
@@ -886,6 +886,16 @@ const designBaselines = (value) =>
886
886
  return apps.map((app) => ` --baseline apps/${app}/${file.slice("apps/one/".length)}`).join("");
887
887
  return namesPruned(file) || !scansKeptTree(file) ? "" : whole;
888
888
  });
889
+ // A script is an && chain or a run-gates invocation whose quoted arguments are
890
+ // the gates. Both are a list of steps the pruning filters and rejoins, so a
891
+ // gate naming a removed tree goes the way a chained segment always has.
892
+ const gateRunner = "node scripts/run-gates.mjs ";
893
+ const stepsOf = (value) =>
894
+ value.startsWith(gateRunner)
895
+ ? { steps: [...value.slice(gateRunner.length).matchAll(/'([^']*)'/g)].map((m) => m[1]), gated: true }
896
+ : { steps: value.split(" && "), gated: false };
897
+ const joinSteps = (steps, gated) =>
898
+ gated ? gateRunner + steps.map((step) => `'${step}'`).join(" ") : steps.join(" && ");
889
899
  const scripts = {};
890
900
  for (const [name, script] of Object.entries(pkg.scripts ?? {})) {
891
901
  if (/^(docs|docs:watch|changeset|changeset:publish|generate:tamagui-paths|prepare)$/.test(name)) continue;
@@ -893,22 +903,22 @@ for (const [name, script] of Object.entries(pkg.scripts ?? {})) {
893
903
  if (name === "lint:design" && !/\s--baseline\s/.test(value)) continue;
894
904
  // verify:lc audits the catalog in public/ against the rulebook in docs/.
895
905
  if (name === "verify:lc" && (pruned.includes("public") || pruned.includes("docs"))) continue;
896
- const kept = value
897
- .split(" && ")
906
+ const { steps, gated } = stepsOf(value);
907
+ const kept = steps
898
908
  .filter((segment) => !dropSegment(segment))
899
- .map((segment) => dropPrunedOperands(cleanSegment(segment)));
909
+ .map((segment) => dropPrunedOperands(cleanSegment(segment)).trim())
910
+ .filter(Boolean);
900
911
  if (!kept.length) continue;
901
- scripts[name] = kept.join(" && ");
912
+ scripts[name] = joinSteps(kept, gated);
902
913
  }
903
914
  // Chains that ran a script dropped above lose that call too.
904
915
  for (const [name, value] of Object.entries(scripts)) {
905
- const kept = value
906
- .split(" && ")
907
- .filter((segment) => {
908
- const match = segment.match(/^pnpm\s+(?:run\s+)?([a-z][\w:.-]*)(?:\s|$)/);
909
- return !match || match[1] in scripts || !(match[1] in (pkg.scripts ?? {}));
910
- });
911
- if (kept.length) scripts[name] = kept.join(" && ");
916
+ const { steps, gated } = stepsOf(value);
917
+ const kept = steps.filter((segment) => {
918
+ const match = segment.match(/^pnpm\s+(?:run\s+)?([a-z][\w:.-]*)(?:\s|$)/);
919
+ return !match || match[1] in scripts || !(match[1] in (pkg.scripts ?? {}));
920
+ });
921
+ if (kept.length) scripts[name] = joinSteps(kept, gated);
912
922
  else delete scripts[name];
913
923
  }
914
924
  if (typeof scripts.dev === "string" && /--filter=one\b/.test(scripts.dev)) {
@@ -20,6 +20,7 @@ import { runE2ESession } from "../commands/e2e";
20
20
  import { SINGLETON_APPS, init } from "../commands/init";
21
21
  import { INIT_APP_PIECES } from "../commands/pieces";
22
22
  import { type PythonMode, pythonFiles, runPythonTools } from "../commands/pythonTools";
23
+ import { formatThemeKeysReport, runThemeKeys } from "../commands/themeKeys";
23
24
  import { updateApp } from "../commands/updateApp";
24
25
  import {
25
26
  availableServices,
@@ -399,6 +400,38 @@ frappe
399
400
  await fs.writeFile(out, generated);
400
401
  });
401
402
 
403
+ const migrate = program
404
+ .command("migrate")
405
+ .description("source migrations that follow an MPO upgrade, each a dry run unless --write");
406
+
407
+ migrate
408
+ .command("theme-keys")
409
+ .argument("[paths...]", "files or directories to rename in (default: the whole project)")
410
+ .option("--write", "apply the renames; without it the run only prints per-file counts")
411
+ .option("--exclude <path>", "leave a file or directory alone (repeatable)", collect, [])
412
+ .option("--json <file>", "also write the full report, unclassified sites included, as JSON")
413
+ .description(
414
+ 'rename Tamagui 2 camelCase theme keys to Tamagui 3 kebab-case ($color-12 to $color-12, theme.borderColorControl to theme["border-color-control"]); run after mpo update and Tamagui\'s flat-values codemod',
415
+ )
416
+ .action(async (paths: string[], options) => {
417
+ const fromCwd = (entry: string) => path.resolve(process.cwd(), entry);
418
+ const report = await runThemeKeys(projectRoot, {
419
+ paths: paths.map(fromCwd),
420
+ exclude: (options.exclude as string[]).map((entry) =>
421
+ path.relative(projectRoot, fromCwd(entry)),
422
+ ),
423
+ write: Boolean(options.write),
424
+ });
425
+ if (paths.length && !report.scanned && !report.skipped.length) {
426
+ console.error(`no source file under ${paths.join(", ")}`);
427
+ process.exit(2);
428
+ }
429
+ console.log(formatThemeKeysReport(report));
430
+ if (options.json) {
431
+ await fs.writeFile(fromCwd(options.json), `${JSON.stringify(report, null, 2)}\n`);
432
+ }
433
+ });
434
+
402
435
  program
403
436
  .command("build")
404
437
  .argument(
@@ -0,0 +1,207 @@
1
+ {
2
+ "accent1": "accent-1",
3
+ "accent10": "accent-10",
4
+ "accent11": "accent-11",
5
+ "accent12": "accent-12",
6
+ "accent2": "accent-2",
7
+ "accent3": "accent-3",
8
+ "accent4": "accent-4",
9
+ "accent5": "accent-5",
10
+ "accent6": "accent-6",
11
+ "accent7": "accent-7",
12
+ "accent8": "accent-8",
13
+ "accent9": "accent-9",
14
+ "accentBackground": "accent-background",
15
+ "accentColor": "accent-color",
16
+ "accentOnSurface": "accent-on-surface",
17
+ "background": "background",
18
+ "background0": "background-0",
19
+ "background02": "background-02",
20
+ "background04": "background-04",
21
+ "background06": "background-06",
22
+ "background08": "background-08",
23
+ "backgroundActive": "background-active",
24
+ "backgroundFocus": "background-focus",
25
+ "backgroundHover": "background-hover",
26
+ "backgroundPress": "background-press",
27
+ "blue1": "blue-1",
28
+ "blue10": "blue-10",
29
+ "blue11": "blue-11",
30
+ "blue12": "blue-12",
31
+ "blue2": "blue-2",
32
+ "blue3": "blue-3",
33
+ "blue4": "blue-4",
34
+ "blue5": "blue-5",
35
+ "blue6": "blue-6",
36
+ "blue7": "blue-7",
37
+ "blue8": "blue-8",
38
+ "blue9": "blue-9",
39
+ "borderColor": "border-color",
40
+ "borderColorControl": "border-color-control",
41
+ "borderColorField": "border-color-field",
42
+ "borderColorFieldHover": "border-color-field-hover",
43
+ "borderColorFocus": "border-color-focus",
44
+ "borderColorHairline": "border-color-hairline",
45
+ "borderColorHover": "border-color-hover",
46
+ "borderColorPress": "border-color-press",
47
+ "borderStrong": "border-strong",
48
+ "boundaryColor": "boundary-color",
49
+ "color": "color",
50
+ "color0": "color-0",
51
+ "color02": "color-02",
52
+ "color04": "color-04",
53
+ "color06": "color-06",
54
+ "color08": "color-08",
55
+ "color1": "color-1",
56
+ "color10": "color-10",
57
+ "color11": "color-11",
58
+ "color12": "color-12",
59
+ "color2": "color-2",
60
+ "color3": "color-3",
61
+ "color4": "color-4",
62
+ "color5": "color-5",
63
+ "color6": "color-6",
64
+ "color7": "color-7",
65
+ "color8": "color-8",
66
+ "color9": "color-9",
67
+ "colorFocus": "color-focus",
68
+ "colorHover": "color-hover",
69
+ "colorPress": "color-press",
70
+ "colorTransparent": "color-transparent",
71
+ "gray1": "gray-1",
72
+ "gray10": "gray-10",
73
+ "gray11": "gray-11",
74
+ "gray12": "gray-12",
75
+ "gray2": "gray-2",
76
+ "gray3": "gray-3",
77
+ "gray4": "gray-4",
78
+ "gray5": "gray-5",
79
+ "gray6": "gray-6",
80
+ "gray7": "gray-7",
81
+ "gray8": "gray-8",
82
+ "gray9": "gray-9",
83
+ "green1": "green-1",
84
+ "green10": "green-10",
85
+ "green11": "green-11",
86
+ "green12": "green-12",
87
+ "green2": "green-2",
88
+ "green3": "green-3",
89
+ "green4": "green-4",
90
+ "green5": "green-5",
91
+ "green6": "green-6",
92
+ "green7": "green-7",
93
+ "green8": "green-8",
94
+ "green9": "green-9",
95
+ "identityInk": "identity-ink",
96
+ "neutral1": "neutral-1",
97
+ "neutral10": "neutral-10",
98
+ "neutral11": "neutral-11",
99
+ "neutral12": "neutral-12",
100
+ "neutral2": "neutral-2",
101
+ "neutral3": "neutral-3",
102
+ "neutral4": "neutral-4",
103
+ "neutral5": "neutral-5",
104
+ "neutral6": "neutral-6",
105
+ "neutral7": "neutral-7",
106
+ "neutral8": "neutral-8",
107
+ "neutral9": "neutral-9",
108
+ "orange1": "orange-1",
109
+ "orange10": "orange-10",
110
+ "orange11": "orange-11",
111
+ "orange12": "orange-12",
112
+ "orange2": "orange-2",
113
+ "orange3": "orange-3",
114
+ "orange4": "orange-4",
115
+ "orange5": "orange-5",
116
+ "orange6": "orange-6",
117
+ "orange7": "orange-7",
118
+ "orange8": "orange-8",
119
+ "orange9": "orange-9",
120
+ "outlineColor": "outline-color",
121
+ "pink1": "pink-1",
122
+ "pink10": "pink-10",
123
+ "pink11": "pink-11",
124
+ "pink12": "pink-12",
125
+ "pink2": "pink-2",
126
+ "pink3": "pink-3",
127
+ "pink4": "pink-4",
128
+ "pink5": "pink-5",
129
+ "pink6": "pink-6",
130
+ "pink7": "pink-7",
131
+ "pink8": "pink-8",
132
+ "pink9": "pink-9",
133
+ "placeholderColor": "placeholder-color",
134
+ "purple1": "purple-1",
135
+ "purple10": "purple-10",
136
+ "purple11": "purple-11",
137
+ "purple12": "purple-12",
138
+ "purple2": "purple-2",
139
+ "purple3": "purple-3",
140
+ "purple4": "purple-4",
141
+ "purple5": "purple-5",
142
+ "purple6": "purple-6",
143
+ "purple7": "purple-7",
144
+ "purple8": "purple-8",
145
+ "purple9": "purple-9",
146
+ "red1": "red-1",
147
+ "red10": "red-10",
148
+ "red11": "red-11",
149
+ "red12": "red-12",
150
+ "red2": "red-2",
151
+ "red3": "red-3",
152
+ "red4": "red-4",
153
+ "red5": "red-5",
154
+ "red6": "red-6",
155
+ "red7": "red-7",
156
+ "red8": "red-8",
157
+ "red9": "red-9",
158
+ "selectFill": "select-fill",
159
+ "selectPress": "select-press",
160
+ "selectedBackground": "selected-background",
161
+ "selectedColor": "selected-color",
162
+ "shadow1": "shadow-1",
163
+ "shadow2": "shadow-2",
164
+ "shadow3": "shadow-3",
165
+ "shadow4": "shadow-4",
166
+ "shadow5": "shadow-5",
167
+ "shadow6": "shadow-6",
168
+ "shadowColor": "shadow-color",
169
+ "surfaceMuted": "surface-muted",
170
+ "surfaceStrong": "surface-strong",
171
+ "switchThumb": "switch-thumb",
172
+ "switchTrackOff": "switch-track-off",
173
+ "switchTrackOffBorder": "switch-track-off-border",
174
+ "switchTrackOffHover": "switch-track-off-hover",
175
+ "switchTrackOffPress": "switch-track-off-press",
176
+ "syntaxBlue": "syntax-blue",
177
+ "syntaxGreen": "syntax-green",
178
+ "syntaxOrange": "syntax-orange",
179
+ "syntaxPurple": "syntax-purple",
180
+ "syntaxRed": "syntax-red",
181
+ "teal1": "teal-1",
182
+ "teal10": "teal-10",
183
+ "teal11": "teal-11",
184
+ "teal12": "teal-12",
185
+ "teal2": "teal-2",
186
+ "teal3": "teal-3",
187
+ "teal4": "teal-4",
188
+ "teal5": "teal-5",
189
+ "teal6": "teal-6",
190
+ "teal7": "teal-7",
191
+ "teal8": "teal-8",
192
+ "teal9": "teal-9",
193
+ "textMuted": "text-muted",
194
+ "textSubtle": "text-subtle",
195
+ "yellow1": "yellow-1",
196
+ "yellow10": "yellow-10",
197
+ "yellow11": "yellow-11",
198
+ "yellow12": "yellow-12",
199
+ "yellow2": "yellow-2",
200
+ "yellow3": "yellow-3",
201
+ "yellow4": "yellow-4",
202
+ "yellow5": "yellow-5",
203
+ "yellow6": "yellow-6",
204
+ "yellow7": "yellow-7",
205
+ "yellow8": "yellow-8",
206
+ "yellow9": "yellow-9"
207
+ }