@multiplatform.one/cli 6.4.1 → 6.4.3

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.
@@ -493,7 +493,7 @@ program.command("init").option("--universal", "scaffold the universal template (
493
493
  yes: Boolean(options.yes)
494
494
  });
495
495
  });
496
- program.command("update").option("-c, --checkout <branch>", "branch, tag or commit to merge from upstream (monorepo forks)", "main").option("-r, --remote <url>", "upstream remote URL (monorepo forks)", "https://gitlab.com/bitspur/multiplatform.one/multiplatform.one.git").option("--skip-install", "skip pnpm install after the update").option("--mpo-version <range>", "semver range for @multiplatform.one/* (default: ^<cli version>)").description("update a scaffolded project to the current template (three-way merge via .mpo.json provenance); monorepo forks fall back to the upstream merge flow").action(async (options) => {
496
+ program.command("update").option("-c, --checkout <branch>", "branch, tag or commit to merge from upstream (monorepo forks)", "main").option("-r, --remote <url>", "upstream remote URL (monorepo forks)", "https://gitlab.com/bitspur/frappe/multiplatform.one.git").option("--skip-install", "skip pnpm install after the update").option("--mpo-version <range>", "semver range for @multiplatform.one/* (default: ^<cli version>)").description("update a scaffolded project to the current template (three-way merge via .mpo.json provenance); monorepo forks fall back to the upstream merge flow").action(async (options) => {
497
497
  if (await spawn("git", ["rev-parse", "--is-inside-work-tree"]).then(() => false, () => true)) throw new Error("mpo cannot be updated outside of a git repository");
498
498
  if (readProvenance(projectRoot)) {
499
499
  await updateApp({
@@ -4,7 +4,7 @@ import { execSync } from "node:child_process";
4
4
  import inquirer from "inquirer";
5
5
 
6
6
  //#region src/commands/init.ts
7
- const repoUrl = "https://gitlab.com/bitspur/multiplatform.one/multiplatform.one.git";
7
+ const repoUrl = "https://gitlab.com/bitspur/frappe/multiplatform.one.git";
8
8
  const services = [
9
9
  "frappe",
10
10
  "solana",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/cli",
3
- "version": "6.4.1",
3
+ "version": "6.4.3",
4
4
  "description": "multiplatform.one cli — mpo init / create-multiplatform-app",
5
5
  "keywords": [
6
6
  "create-multiplatform-app",
@@ -61,7 +61,7 @@
61
61
  "nano-spawn": "^2.1.0",
62
62
  "yaml": "^2.8.3",
63
63
  "yocto-spinner": "^1.1.0",
64
- "@multiplatform.one/utils": "6.4.1"
64
+ "@multiplatform.one/utils": "6.4.3"
65
65
  },
66
66
  "devDependencies": {
67
67
  "@types/inquirer": "^9.0.9",
package/scripts/clone.sh CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/bin/sh
2
2
  # Clone multiplatform.one repo into target directory.
3
3
  # Usage: clone.sh <remote_url> <branch> <target_dir>
4
- # Example: clone.sh https://gitlab.com/bitspur/multiplatform.one/multiplatform.one.git main ./my-app
4
+ # Example: clone.sh https://gitlab.com/bitspur/frappe/multiplatform.one.git main ./my-app
5
5
 
6
6
  set -e
7
7
 
package/scripts/update.sh CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/bin/sh
2
2
  # Merge from upstream. Run from project root.
3
3
  # Usage: update.sh <remote_url> [branch]
4
- # Example: update.sh https://gitlab.com/bitspur/multiplatform.one/multiplatform.one.git main
4
+ # Example: update.sh https://gitlab.com/bitspur/frappe/multiplatform.one.git main
5
5
 
6
6
  set -e
7
7
 
@@ -278,11 +278,15 @@ program
278
278
  });
279
279
  });
280
280
 
281
- const defaultUpdateRemote = "https://gitlab.com/bitspur/multiplatform.one/multiplatform.one.git";
281
+ const defaultUpdateRemote = "https://gitlab.com/bitspur/frappe/multiplatform.one.git";
282
282
 
283
283
  program
284
284
  .command("update")
285
- .option("-c, --checkout <branch>", "branch, tag or commit to merge from upstream (monorepo forks)", "main")
285
+ .option(
286
+ "-c, --checkout <branch>",
287
+ "branch, tag or commit to merge from upstream (monorepo forks)",
288
+ "main",
289
+ )
286
290
  .option("-r, --remote <url>", "upstream remote URL (monorepo forks)", defaultUpdateRemote)
287
291
  .option("--skip-install", "skip pnpm install after the update")
288
292
  .option(
@@ -292,121 +296,123 @@ program
292
296
  .description(
293
297
  "update a scaffolded project to the current template (three-way merge via .mpo.json provenance); monorepo forks fall back to the upstream merge flow",
294
298
  )
295
- .action(async (options: {
296
- checkout: string;
297
- remote: string;
298
- skipInstall?: boolean;
299
- mpoVersion?: string;
300
- }) => {
301
- // Update prechecks: must be in a git repo
302
- if (
303
- await spawn("git", ["rev-parse", "--is-inside-work-tree"]).then(
304
- () => false,
305
- () => true,
306
- )
307
- ) {
308
- throw new Error("mpo cannot be updated outside of a git repository");
309
- }
310
- // Scaffolded consumer projects carry .mpo.json provenance — use the
311
- // copier-style three-way template update. Monorepo forks (identified by
312
- // the legacy features/package.json marker) fall through to the upstream-
313
- // merge flow below; anything else gets the provenance guidance instead
314
- // of the fork flow's unrelated errors.
315
- if (readProvenance(projectRoot)) {
316
- await updateApp({ skipInstall: options.skipInstall, version: options.mpoVersion });
317
- return;
318
- }
319
- const legacyFork = await fs.stat(path.resolve(projectRoot, "features/package.json")).then(
320
- (stat) => stat.isFile(),
321
- () => false,
322
- );
323
- if (!legacyFork) {
324
- throw new Error(
325
- ".mpo.json not found — this project predates scaffold provenance. " +
326
- "Create it with { template, cliVersion, name } matching how the project " +
327
- "was generated (cliVersion = the @multiplatform.one/cli that scaffolded it), " +
328
- "then re-run `mpo update`.",
329
- );
330
- }
331
- // Require clean working tree (no staged or unstaged changes)
332
- if (
333
- await spawn("git", ["diff", "--cached", "--quiet"]).then(
334
- () => false,
335
- () => true,
336
- )
337
- ) {
338
- throw new Error("mpo cannot be updated with uncommitted changes (staged changes present)");
339
- }
340
- if (
341
- await spawn("git", ["diff", "--quiet"]).then(
299
+ .action(
300
+ async (options: {
301
+ checkout: string;
302
+ remote: string;
303
+ skipInstall?: boolean;
304
+ mpoVersion?: string;
305
+ }) => {
306
+ // Update prechecks: must be in a git repo
307
+ if (
308
+ await spawn("git", ["rev-parse", "--is-inside-work-tree"]).then(
309
+ () => false,
310
+ () => true,
311
+ )
312
+ ) {
313
+ throw new Error("mpo cannot be updated outside of a git repository");
314
+ }
315
+ // Scaffolded consumer projects carry .mpo.json provenance use the
316
+ // copier-style three-way template update. Monorepo forks (identified by
317
+ // the legacy features/package.json marker) fall through to the upstream-
318
+ // merge flow below; anything else gets the provenance guidance instead
319
+ // of the fork flow's unrelated errors.
320
+ if (readProvenance(projectRoot)) {
321
+ await updateApp({ skipInstall: options.skipInstall, version: options.mpoVersion });
322
+ return;
323
+ }
324
+ const legacyFork = await fs.stat(path.resolve(projectRoot, "features/package.json")).then(
325
+ (stat) => stat.isFile(),
342
326
  () => false,
343
- () => true,
344
- )
345
- ) {
346
- throw new Error(
347
- "multiplatform.one cannot be updated with uncommitted changes (unstaged changes present)",
348
327
  );
349
- }
350
- // Validate multiplatform.one project with clear errors per failure
351
- const rootPkgPath = path.resolve(projectRoot, "package.json");
352
- const featuresPkgPath = path.resolve(projectRoot, "features/package.json");
353
- try {
354
- const stat = await fs.stat(rootPkgPath);
355
- if (!stat.isFile()) {
356
- throw new Error("mpo update requires a valid project: root package.json not found");
328
+ if (!legacyFork) {
329
+ throw new Error(
330
+ ".mpo.json not found — this project predates scaffold provenance. " +
331
+ "Create it with { template, cliVersion, name } matching how the project " +
332
+ "was generated (cliVersion = the @multiplatform.one/cli that scaffolded it), " +
333
+ "then re-run `mpo update`.",
334
+ );
357
335
  }
358
- } catch (err) {
359
- if (err instanceof Error && err.message.includes("valid project")) {
360
- throw err;
336
+ // Require clean working tree (no staged or unstaged changes)
337
+ if (
338
+ await spawn("git", ["diff", "--cached", "--quiet"]).then(
339
+ () => false,
340
+ () => true,
341
+ )
342
+ ) {
343
+ throw new Error("mpo cannot be updated with uncommitted changes (staged changes present)");
361
344
  }
362
- throw new Error("mpo update requires a valid project: root package.json not found");
363
- }
364
- try {
365
- const stat = await fs.stat(featuresPkgPath);
366
- if (!stat.isFile()) {
345
+ if (
346
+ await spawn("git", ["diff", "--quiet"]).then(
347
+ () => false,
348
+ () => true,
349
+ )
350
+ ) {
351
+ throw new Error(
352
+ "multiplatform.one cannot be updated with uncommitted changes (unstaged changes present)",
353
+ );
354
+ }
355
+ // Validate multiplatform.one project with clear errors per failure
356
+ const rootPkgPath = path.resolve(projectRoot, "package.json");
357
+ const featuresPkgPath = path.resolve(projectRoot, "features/package.json");
358
+ try {
359
+ const stat = await fs.stat(rootPkgPath);
360
+ if (!stat.isFile()) {
361
+ throw new Error("mpo update requires a valid project: root package.json not found");
362
+ }
363
+ } catch (err) {
364
+ if (err instanceof Error && err.message.includes("valid project")) {
365
+ throw err;
366
+ }
367
+ throw new Error("mpo update requires a valid project: root package.json not found");
368
+ }
369
+ try {
370
+ const stat = await fs.stat(featuresPkgPath);
371
+ if (!stat.isFile()) {
372
+ throw new Error("mpo update requires a valid project: features/package.json not found");
373
+ }
374
+ } catch (err) {
375
+ if (err instanceof Error && err.message.includes("valid project")) {
376
+ throw err;
377
+ }
367
378
  throw new Error("mpo update requires a valid project: features/package.json not found");
368
379
  }
369
- } catch (err) {
370
- if (err instanceof Error && err.message.includes("valid project")) {
371
- throw err;
380
+ const featuresPkg = JSON.parse(await fs.readFile(featuresPkgPath, "utf8")) as {
381
+ dependencies?: Record<string, string>;
382
+ };
383
+ if (
384
+ !featuresPkg?.dependencies?.["multiplatform.one"] ||
385
+ !String(featuresPkg.dependencies["multiplatform.one"]).length
386
+ ) {
387
+ throw new Error(
388
+ "mpo update requires a valid project: features must depend on multiplatform.one",
389
+ );
372
390
  }
373
- throw new Error("mpo update requires a valid project: features/package.json not found");
374
- }
375
- const featuresPkg = JSON.parse(await fs.readFile(featuresPkgPath, "utf8")) as {
376
- dependencies?: Record<string, string>;
377
- };
378
- if (
379
- !featuresPkg?.dependencies?.["multiplatform.one"] ||
380
- !String(featuresPkg.dependencies["multiplatform.one"]).length
381
- ) {
382
- throw new Error(
383
- "mpo update requires a valid project: features must depend on multiplatform.one",
384
- );
385
- }
386
391
 
387
- // Merge from upstream (update.sh: add remote, fetch, merge, remove remote, restore .updateignore list, pnpm lint)
388
- const updateScript = path.resolve(
389
- path.dirname(fileURLToPath(import.meta.url)),
390
- "../../scripts/update.sh",
391
- );
392
- await spawn("sh", [updateScript, options.remote, options.checkout], {
393
- cwd: projectRoot,
394
- stdio: "inherit",
395
- shell: true,
396
- });
392
+ // Merge from upstream (update.sh: add remote, fetch, merge, remove remote, restore .updateignore list, pnpm lint)
393
+ const updateScript = path.resolve(
394
+ path.dirname(fileURLToPath(import.meta.url)),
395
+ "../../scripts/update.sh",
396
+ );
397
+ await spawn("sh", [updateScript, options.remote, options.checkout], {
398
+ cwd: projectRoot,
399
+ stdio: "inherit",
400
+ shell: true,
401
+ });
397
402
 
398
- // Re-apply modify step with auto-detected apps and services
399
- const presentServices = await getPresentServices(projectRoot);
400
- const presentApps = await getPresentApps(projectRoot);
401
- runModifyStep(projectRoot, presentServices, presentApps);
403
+ // Re-apply modify step with auto-detected apps and services
404
+ const presentServices = await getPresentServices(projectRoot);
405
+ const presentApps = await getPresentApps(projectRoot);
406
+ runModifyStep(projectRoot, presentServices, presentApps);
402
407
 
403
- // Post-update refresh: .vscode from current workspace
404
- try {
405
- await generateVscodeConfig(projectRoot);
406
- } catch {
407
- // may fail in older projects without apps/ layout
408
- }
409
- });
408
+ // Post-update refresh: .vscode from current workspace
409
+ try {
410
+ await generateVscodeConfig(projectRoot);
411
+ } catch {
412
+ // may fail in older projects without apps/ layout
413
+ }
414
+ },
415
+ );
410
416
 
411
417
  program
412
418
  .command("wait")
@@ -3,7 +3,7 @@ import { type Dirent, existsSync, readFileSync, readdirSync, rmSync, writeFileSy
3
3
  import { join, resolve } from "node:path";
4
4
  import inquirer from "inquirer";
5
5
 
6
- const repoUrl = "https://gitlab.com/bitspur/multiplatform.one/multiplatform.one.git";
6
+ const repoUrl = "https://gitlab.com/bitspur/frappe/multiplatform.one.git";
7
7
 
8
8
  const services = ["frappe", "solana", "ethereum", "sui"] as const;
9
9
 
@@ -291,9 +291,7 @@ export async function initApp(
291
291
  // commit so a fresh init is immediately clean.
292
292
  if (scaffoldCommitted) {
293
293
  await spawn("git", ["add", "--", "pnpm-lock.yaml"], { cwd: targetDir })
294
- .then(() =>
295
- spawn("git", ["commit", "--amend", "--no-edit", "--quiet"], { cwd: targetDir }),
296
- )
294
+ .then(() => spawn("git", ["commit", "--amend", "--no-edit", "--quiet"], { cwd: targetDir }))
297
295
  .catch(() => {});
298
296
  }
299
297
  } else {
@@ -379,12 +379,7 @@ export async function updateApp(options: UpdateAppOptions = {}): Promise<void> {
379
379
  // belongs with the update: amend it into the clean-merge commit
380
380
  // (conflict resolutions commit manually and pick it up there).
381
381
  if (!conflicts.length) {
382
- const lockDirty = await git(projectDir, [
383
- "diff",
384
- "--quiet",
385
- "--",
386
- "pnpm-lock.yaml",
387
- ]).then(
382
+ const lockDirty = await git(projectDir, ["diff", "--quiet", "--", "pnpm-lock.yaml"]).then(
388
383
  () => false,
389
384
  () => true,
390
385
  );
@@ -16,5 +16,23 @@
16
16
  "engines": {
17
17
  "node": ">=20"
18
18
  },
19
- "packageManager": "pnpm@10.32.1"
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
+ }
20
38
  }
@@ -40,7 +40,7 @@
40
40
  "react-i18next": "^16.6.6",
41
41
  "react-native": "0.83.2",
42
42
  "react-native-gesture-handler": "~2.31.1",
43
- "react-native-reanimated": "~4.3.0",
43
+ "react-native-reanimated": "~4.2.1",
44
44
  "react-native-safe-area-context": "~5.7.0",
45
45
  "react-native-screens": "^4.24.0",
46
46
  "react-native-svg": "15.15.4",
@@ -23,5 +23,29 @@
23
23
  "engines": {
24
24
  "node": ">=20"
25
25
  },
26
- "packageManager": "pnpm@10.32.1"
26
+ "packageManager": "pnpm@10.32.1",
27
+ "pnpm": {
28
+ "overrides": {
29
+ "react-dom": "19.2.5",
30
+ "react-native-reanimated": "4.2.1",
31
+ "react-native-worklets": "0.7.4"
32
+ },
33
+ "peerDependencyRules": {
34
+ "allowedVersions": {
35
+ "react": "19",
36
+ "react-native": "0.83",
37
+ "@react-navigation/native": "7",
38
+ "vite": "8",
39
+ "expo-constants": "55",
40
+ "rehype-autolink-headings": "7",
41
+ "rehype-slug": "6",
42
+ "remark-mdx-frontmatter": "5"
43
+ },
44
+ "ignoreMissing": [
45
+ "@react-navigation/native",
46
+ "@types/emscripten",
47
+ "react-native"
48
+ ]
49
+ }
50
+ }
27
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"initApp.d.ts","sourceRoot":"","sources":["../../src/commands/initApp.ts"],"names":[],"mappings":"AAaA;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,KAAK,CAAC;AAElD,MAAM,WAAW,cAAc;IAC7B,2DAA2D;IAC3D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,mEAAmE;IACnE,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AA0CD,wBAAgB,UAAU,IAAI,MAAM,GAAG,SAAS,CAQ/C;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,eAAe,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,eAAe,cAAc,CAAC;AAE3C,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,GAAG,IAAI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- {"version":3,"file":"updateApp.d.ts","sourceRoot":"","sources":["../../src/commands/updateApp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH,MAAM,WAAW,gBAAgB;IAC/B,yCAAyC;IACzC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAyJD,wBAAsB,SAAS,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CA0N7E"}
1
+ {"version":3,"file":"updateApp.d.ts","sourceRoot":"","sources":["../../src/commands/updateApp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH,MAAM,WAAW,gBAAgB;IAC/B,yCAAyC;IACzC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAyJD,wBAAsB,SAAS,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAqN7E"}