@pylonsync/create-pylon 0.3.55 → 0.3.57

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.
@@ -340,28 +340,37 @@ walkAndSubstitute(root);
340
340
  // picked (each PM exposes "run X in workspace Y" differently).
341
341
  // ---------------------------------------------------------------------------
342
342
 
343
- const wsScripts = pmScripts(flags.pm);
344
- const devScripts = {};
345
- // API runs always every frontend connects to it.
346
- devScripts["dev:api"] = wsScripts.devApi;
347
- if (platforms.includes("web")) devScripts["dev:web"] = wsScripts.devWeb;
348
- if (platforms.includes("expo")) devScripts["dev:expo"] = wsScripts.devExpo;
343
+ // Turborepo orchestrates the workspace. `turbo dev` runs the `dev`
344
+ // task in every package that defines one (apps/api always; apps/web,
345
+ // apps/expo when scaffolded). Native targets (ios, mac) aren't
346
+ // `turbo dev`-shaped Xcode / `swift run` block — so they get
347
+ // dedicated escape-hatch scripts instead. turbo.json ships in
348
+ // _root/, so it's already in the project.
349
+ const helperScripts = {};
349
350
  if (platforms.includes("ios")) {
350
- // `xcodegen generate` materializes the .xcodeproj from project.yml,
351
- // then it's an Xcode-driven flow — no `bun run dev` semantics.
352
- devScripts["dev:ios"] =
351
+ helperScripts["dev:ios"] =
353
352
  "echo 'cd apps/ios && xcodegen generate && open *.xcodeproj (or: swift run for a quick macOS preview)'";
354
353
  }
355
354
  if (platforms.includes("mac")) {
356
- devScripts["dev:mac"] =
355
+ helperScripts["dev:mac"] =
357
356
  "echo 'cd apps/mac && swift run (or: xcodegen generate && open *.xcodeproj)'";
358
357
  }
359
358
 
360
- const parallelDevs = Object.keys(devScripts);
359
+ // Turbo 2.x refuses to run without packageManager set. Pick a recent-
360
+ // stable for whichever PM the user picked. npm doesn't enforce this
361
+ // field but turbo still expects it to be present.
362
+ const PACKAGE_MANAGERS = {
363
+ bun: "bun@1.2.19",
364
+ pnpm: "pnpm@9.12.0",
365
+ yarn: "yarn@4.5.0",
366
+ npm: "npm@10.9.0",
367
+ };
368
+
361
369
  const rootPkg = {
362
370
  name: APP_NAME_KEBAB,
363
371
  private: true,
364
372
  type: "module",
373
+ packageManager: PACKAGE_MANAGERS[flags.pm],
365
374
  workspaces: ["apps/*", "packages/*"].filter((p) => {
366
375
  // Only declare packages/* as a workspace if we actually scaffolded
367
376
  // packages/ui — otherwise the empty match warns on bun install.
@@ -369,14 +378,15 @@ const rootPkg = {
369
378
  return true;
370
379
  }),
371
380
  scripts: {
372
- dev:
373
- parallelDevs.length > 1
374
- ? `npm-run-all --parallel ${parallelDevs.join(" ")}`
375
- : wsScripts.devApi,
376
- ...devScripts,
377
- build: wsScripts.build,
381
+ dev: "turbo dev",
382
+ build: "turbo build",
383
+ check: "turbo check",
384
+ lint: "turbo lint",
385
+ ...helperScripts,
386
+ },
387
+ devDependencies: {
388
+ turbo: "^2.3.0",
378
389
  },
379
- devDependencies: parallelDevs.length > 1 ? { "npm-run-all": "^4.1.5" } : {},
380
390
  };
381
391
  writeFileSync(
382
392
  join(root, "package.json"),
@@ -457,36 +467,3 @@ function detectPackageManager() {
457
467
  return null;
458
468
  }
459
469
 
460
- function pmScripts(pm) {
461
- switch (pm) {
462
- case "bun":
463
- return {
464
- devApi: "bun run --filter './apps/api' dev",
465
- devWeb: "bun run --filter './apps/web' dev",
466
- devExpo: "bun run --filter './apps/expo' start",
467
- build: "bun run --filter '*' build",
468
- };
469
- case "pnpm":
470
- return {
471
- devApi: "pnpm --filter './apps/api' run dev",
472
- devWeb: "pnpm --filter './apps/web' run dev",
473
- devExpo: "pnpm --filter './apps/expo' run start",
474
- build: "pnpm --filter '*' run build",
475
- };
476
- case "yarn":
477
- return {
478
- devApi: `yarn workspace @${APP_NAME_KEBAB}/api run dev`,
479
- devWeb: `yarn workspace @${APP_NAME_KEBAB}/web run dev`,
480
- devExpo: `yarn workspace @${APP_NAME_KEBAB}/expo run start`,
481
- build: "yarn workspaces foreach -A run build",
482
- };
483
- case "npm":
484
- default:
485
- return {
486
- devApi: "npm --workspace apps/api run dev",
487
- devWeb: "npm --workspace apps/web run dev",
488
- devExpo: "npm --workspace apps/expo run start",
489
- build: "npm --workspaces run build --if-present",
490
- };
491
- }
492
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pylonsync/create-pylon",
3
- "version": "0.3.55",
3
+ "version": "0.3.57",
4
4
  "description": "Scaffold a new Pylon app — realtime backend + web/mobile/expo frontends in one command. Run via `npm create @pylonsync/pylon@latest`.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://turbo.build/schema.json",
3
+ "ui": "stream",
4
+ "tasks": {
5
+ "dev": {
6
+ "cache": false,
7
+ "persistent": true
8
+ },
9
+ "build": {
10
+ "dependsOn": ["^build"],
11
+ "outputs": [".next/**", "!.next/cache/**", "dist/**"]
12
+ },
13
+ "check": {
14
+ "dependsOn": ["^build"]
15
+ },
16
+ "lint": {}
17
+ }
18
+ }
@@ -4,9 +4,9 @@
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
7
- "dev": "pylon dev schema.ts --port 4321",
8
- "build": "pylon codegen schema.ts --out pylon.manifest.json && pylon codegen client pylon.manifest.json --out pylon.client.ts",
9
- "schema:push": "pylon schema push pylon.manifest.json --sqlite dev.db",
7
+ "dev": "pylon dev",
8
+ "build": "pylon build",
9
+ "schema:push": "pylon schema push --sqlite dev.db",
10
10
  "schema:inspect": "pylon schema inspect --sqlite dev.db"
11
11
  },
12
12
  "dependencies": {
@@ -4,9 +4,9 @@
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
7
- "dev": "pylon dev schema.ts --port 4321",
8
- "build": "pylon codegen schema.ts --out pylon.manifest.json && pylon codegen client pylon.manifest.json --out pylon.client.ts",
9
- "schema:push": "pylon schema push pylon.manifest.json --sqlite dev.db",
7
+ "dev": "pylon dev",
8
+ "build": "pylon build",
9
+ "schema:push": "pylon schema push --sqlite dev.db",
10
10
  "schema:inspect": "pylon schema inspect --sqlite dev.db"
11
11
  },
12
12
  "dependencies": {
@@ -4,9 +4,9 @@
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
7
- "dev": "pylon dev schema.ts --port 4321",
8
- "build": "pylon codegen schema.ts --out pylon.manifest.json && pylon codegen client pylon.manifest.json --out pylon.client.ts",
9
- "schema:push": "pylon schema push pylon.manifest.json --sqlite dev.db",
7
+ "dev": "pylon dev",
8
+ "build": "pylon build",
9
+ "schema:push": "pylon schema push --sqlite dev.db",
10
10
  "schema:inspect": "pylon schema inspect --sqlite dev.db"
11
11
  },
12
12
  "dependencies": {
@@ -4,9 +4,9 @@
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
7
- "dev": "pylon dev schema.ts --port 4321",
8
- "build": "pylon codegen schema.ts --out pylon.manifest.json && pylon codegen client pylon.manifest.json --out pylon.client.ts",
9
- "schema:push": "pylon schema push pylon.manifest.json --sqlite dev.db",
7
+ "dev": "pylon dev",
8
+ "build": "pylon build",
9
+ "schema:push": "pylon schema push --sqlite dev.db",
10
10
  "schema:inspect": "pylon schema inspect --sqlite dev.db"
11
11
  },
12
12
  "dependencies": {
@@ -4,9 +4,9 @@
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
7
- "dev": "pylon dev schema.ts --port 4321",
8
- "build": "pylon codegen schema.ts --out pylon.manifest.json && pylon codegen client pylon.manifest.json --out pylon.client.ts",
9
- "schema:push": "pylon schema push pylon.manifest.json --sqlite dev.db",
7
+ "dev": "pylon dev",
8
+ "build": "pylon build",
9
+ "schema:push": "pylon schema push --sqlite dev.db",
10
10
  "schema:inspect": "pylon schema inspect --sqlite dev.db"
11
11
  },
12
12
  "dependencies": {
@@ -5,6 +5,7 @@
5
5
  "main": "node_modules/expo/AppEntry.js",
6
6
  "scripts": {
7
7
  "start": "expo start",
8
+ "dev": "expo start",
8
9
  "android": "expo start --android",
9
10
  "ios": "expo start --ios",
10
11
  "web": "expo start --web"
@@ -5,6 +5,7 @@
5
5
  "main": "node_modules/expo/AppEntry.js",
6
6
  "scripts": {
7
7
  "start": "expo start",
8
+ "dev": "expo start",
8
9
  "android": "expo start --android",
9
10
  "ios": "expo start --ios",
10
11
  "web": "expo start --web"
@@ -5,6 +5,7 @@
5
5
  "main": "node_modules/expo/AppEntry.js",
6
6
  "scripts": {
7
7
  "start": "expo start",
8
+ "dev": "expo start",
8
9
  "android": "expo start --android",
9
10
  "ios": "expo start --ios",
10
11
  "web": "expo start --web"
@@ -5,6 +5,7 @@
5
5
  "main": "node_modules/expo/AppEntry.js",
6
6
  "scripts": {
7
7
  "start": "expo start",
8
+ "dev": "expo start",
8
9
  "android": "expo start --android",
9
10
  "ios": "expo start --ios",
10
11
  "web": "expo start --web"