create-tamagui 2.7.7 → 3.0.0-beta.643.1

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/dist/index.cjs CHANGED
@@ -23,7 +23,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
23
  ));
24
24
 
25
25
  // src/index.ts
26
- var import_chalk10 = __toESM(require("chalk"));
26
+ var import_chalk9 = __toESM(require("chalk"));
27
27
  var import_commander = __toESM(require("commander"));
28
28
  var import_detect_package_manager = require("detect-package-manager");
29
29
  var import_fs_extra2 = require("fs-extra");
@@ -37,7 +37,7 @@ var import_prompts4 = __toESM(require("prompts"));
37
37
  // package.json
38
38
  var package_default = {
39
39
  name: "create-tamagui",
40
- version: "2.7.6",
40
+ version: "2.7.7",
41
41
  gitHead: "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
42
42
  bin: {
43
43
  "create-tamagui": "run.js"
@@ -190,7 +190,7 @@ async function setupTamaguiDotDir(template) {
190
190
  } catch {
191
191
  }
192
192
  }
193
- const branch = template.repo.branch;
193
+ const ref = template.repo.ref;
194
194
  await (0, import_fs_extra.ensureDir)(tamaguiDir);
195
195
  const isInSubDir = template.repo.dir.length > 0;
196
196
  const sourceGitRepo = template.repo.url;
@@ -198,7 +198,7 @@ async function setupTamaguiDotDir(template) {
198
198
  if (!await (0, import_fs_extra.pathExists)(targetGitDir)) {
199
199
  console.info(`Cloning tamagui base directory`);
200
200
  console.info();
201
- const cmd = `git clone --branch ${branch} ${isInSubDir ? "--depth 1 --sparse --filter=blob:none " : ""}${sourceGitRepo} "${targetGitDir}"`;
201
+ const cmd = `git clone --branch ${ref} ${isInSubDir ? "--depth 1 --sparse --filter=blob:none " : ""}${sourceGitRepo} "${targetGitDir}"`;
202
202
  try {
203
203
  try {
204
204
  console.info(`$ ${cmd}`);
@@ -245,21 +245,11 @@ async function setupTamaguiDotDir(template) {
245
245
  try {
246
246
  const remoteName = getDefaultRemoteName();
247
247
  if (await (0, import_fs_extra.pathExists)((0, import_node_path.join)(targetGitDir, ".git"))) {
248
- const cmd2 = `git pull --rebase --allow-unrelated-histories --depth 1 ${remoteName} ${branch}`;
249
- try {
250
- exec(cmd2, {
251
- cwd: targetGitDir
252
- });
253
- } catch {
254
- exec(cmd2, {
255
- cwd: targetGitDir
256
- });
257
- }
248
+ exec(`git fetch --depth 1 ${remoteName} ${ref}`, { cwd: targetGitDir });
249
+ exec(`git checkout --detach FETCH_HEAD`, { cwd: targetGitDir });
258
250
  console.info();
259
251
  } else {
260
- console.warn(
261
- `Warning: ${targetGitDir} is not a git repository. Skipping pull operation.`
262
- );
252
+ console.warn(`Warning: ${targetGitDir} is not a git repository. Skipping update.`);
263
253
  }
264
254
  } catch (err) {
265
255
  await (0, import_fs_extra.remove)(targetGitDir);
@@ -376,10 +366,12 @@ var getProjectName = async (projectPath2) => {
376
366
  var import_prompts3 = __toESM(require("prompts"));
377
367
 
378
368
  // src/templates.ts
379
- var import_chalk9 = __toESM(require("chalk"));
369
+ var import_chalk8 = __toESM(require("chalk"));
380
370
 
381
- // src/steps/expo-router.ts
371
+ // src/steps/remix.ts
382
372
  var import_chalk5 = __toESM(require("chalk"));
373
+ var packageManager = "bun";
374
+ var runCommand = (scriptName) => `${packageManager} run ${scriptName}`;
383
375
  var main = async ({ isFullClone, projectName }) => {
384
376
  if (isFullClone) {
385
377
  console.info(`
@@ -387,76 +379,60 @@ var main = async ({ isFullClone, projectName }) => {
387
379
 
388
380
  visit your project:
389
381
  ${import_chalk5.default.green("cd")} ${projectName}
390
- `);
391
- }
392
- };
393
- var expo_router_default = main;
394
-
395
- // src/steps/remix.ts
396
- var import_chalk6 = __toESM(require("chalk"));
397
- var packageManager = "bun";
398
- var runCommand = (scriptName) => `${packageManager} run ${scriptName}`;
399
- var main2 = async ({ isFullClone, projectName }) => {
400
- if (isFullClone) {
401
- console.info(`
402
- ${import_chalk6.default.green.bold("Done!")} created a new project under ./${projectName}
403
-
404
- visit your project:
405
- ${import_chalk6.default.green("cd")} ${projectName}
406
382
  `);
407
383
  }
408
384
  console.info(`
409
385
  To start the Remix development server, run:
410
- ${import_chalk6.default.green(runCommand("dev"))}
386
+ ${import_chalk5.default.green(runCommand("dev"))}
411
387
  `);
412
388
  };
413
- var remix_default = main2;
389
+ var remix_default = main;
414
390
 
415
391
  // src/steps/starter-free.ts
416
- var import_chalk7 = __toESM(require("chalk"));
392
+ var import_chalk6 = __toESM(require("chalk"));
417
393
  var packageManager2 = "bun";
418
394
  var runCommand2 = (scriptName) => `${packageManager2} run ${scriptName}`;
419
- var main3 = async ({ isFullClone, projectName }) => {
395
+ var main2 = async ({ isFullClone, projectName }) => {
420
396
  console.info(`Note: you need bun for this repo.`);
421
397
  if (isFullClone) {
422
- console.info(`${import_chalk7.default.green.bold(
398
+ console.info(`${import_chalk6.default.green.bold(
423
399
  "Done!"
424
400
  )} created a new project under ./${projectName}
425
401
 
426
402
  visit your project:
427
- ${import_chalk7.default.green("cd")} ${projectName}
403
+ ${import_chalk6.default.green("cd")} ${projectName}
428
404
  `);
429
405
  }
430
406
  console.info(`
431
407
  To start the Next.js development server, run:
432
- ${import_chalk7.default.green(runCommand2("web"))}
408
+ ${import_chalk6.default.green(runCommand2("web"))}
433
409
 
434
410
  To start Expo Go for mobile development, run:
435
- ${import_chalk7.default.green(runCommand2("native"))}
411
+ ${import_chalk6.default.green(runCommand2("native"))}
436
412
 
437
413
  You can also create Expo development builds by doing:
438
414
 
439
- ${import_chalk7.default.green(`cd apps/expo`)}
415
+ ${import_chalk6.default.green(`cd apps/expo`)}
440
416
  then:
441
- ${import_chalk7.default.green(runCommand2("ios"))}
417
+ ${import_chalk6.default.green(runCommand2("ios"))}
442
418
  or...
443
- ${import_chalk7.default.green(runCommand2("android"))}
419
+ ${import_chalk6.default.green(runCommand2("android"))}
444
420
 
445
421
  Be sure to replace yourprojectsname in app.json with the uid you'd like for your app.
446
422
  `);
447
423
  };
448
- var starter_free_default = main3;
424
+ var starter_free_default = main2;
449
425
 
450
426
  // src/steps/takeout.ts
451
427
  var import_node_child_process2 = require("node:child_process");
452
428
  var import_node_fs2 = require("node:fs");
453
429
  var import_promises = __toESM(require("node:fs/promises"));
454
430
  var import_node_path3 = __toESM(require("node:path"));
455
- var import_chalk8 = __toESM(require("chalk"));
431
+ var import_chalk7 = __toESM(require("chalk"));
456
432
  var import_prompts2 = __toESM(require("prompts"));
457
433
  var packageManager3 = "bun";
458
434
  var runCommand3 = (scriptName) => `${packageManager3} run ${scriptName}`;
459
- var main4 = async ({ isFullClone, projectName, projectPath: projectPath2 }) => {
435
+ var main3 = async ({ isFullClone, projectName, projectPath: projectPath2 }) => {
460
436
  console.info(`
461
437
  ${tamaguiRainbowAsciiArt.split("\n").map((line) => ` ${line}`).join("\n")}
462
438
  ${takeoutAsciiArt}
@@ -519,37 +495,37 @@ ${takeoutAsciiArt}
519
495
  }
520
496
  if (isFullClone) {
521
497
  console.info(`
522
- ${import_chalk8.default.green.bold("Done!")} created a new project under ./${projectName}
498
+ ${import_chalk7.default.green.bold("Done!")} created a new project under ./${projectName}
523
499
 
524
500
  visit your project:
525
- ${import_chalk8.default.green(" cd")} ${projectName}
501
+ ${import_chalk7.default.green(" cd")} ${projectName}
526
502
  `);
527
503
  }
528
504
  console.info(`
529
505
  To start the Next.js development server, run:
530
- ${import_chalk8.default.green(runCommand3("web"))}
506
+ ${import_chalk7.default.green(runCommand3("web"))}
531
507
 
532
508
  To start developing with Expo for native, run:
533
- ${import_chalk8.default.green(runCommand3("native"))}
509
+ ${import_chalk7.default.green(runCommand3("native"))}
534
510
 
535
511
  To start developing for Expo dev build, run:
536
- ${import_chalk8.default.green(runCommand3("ios"))}
537
- ${import_chalk8.default.green(runCommand3("android"))}
512
+ ${import_chalk7.default.green(runCommand3("ios"))}
513
+ ${import_chalk7.default.green(runCommand3("android"))}
538
514
 
539
515
  To run Supabase scripts, cd into the supabase package:
540
- ${import_chalk8.default.green("cd supabase")}
516
+ ${import_chalk7.default.green("cd supabase")}
541
517
 
542
- ${import_chalk8.default.green("yarn reset")} - Resets local database
543
- ${import_chalk8.default.green("yarn generate")} - Generates new types
518
+ ${import_chalk7.default.green("yarn reset")} - Resets local database
519
+ ${import_chalk7.default.green("yarn generate")} - Generates new types
544
520
 
545
- Find info on the rest of the scripts in ${import_chalk8.default.cyan(`supabase/README.md`)}
521
+ Find info on the rest of the scripts in ${import_chalk7.default.cyan(`supabase/README.md`)}
546
522
 
547
523
  If you've purchased and gained access to font and icon packages, you can run:
548
- ${import_chalk8.default.green("yarn add:icon")}
549
- ${import_chalk8.default.green("yarn add:font")}
524
+ ${import_chalk7.default.green("yarn add:icon")}
525
+ ${import_chalk7.default.green("yarn add:font")}
550
526
  `);
551
527
  };
552
- var takeout_default = main4;
528
+ var takeout_default = main3;
553
529
  async function runRetryableCommand(cmd, retriesCount = 0) {
554
530
  try {
555
531
  (0, import_node_child_process2.execSync)(cmd, { stdio: "inherit" });
@@ -565,8 +541,8 @@ async function runRetryableCommand(cmd, retriesCount = 0) {
565
541
  await runRetryableCommand(cmd, retriesCount + 1);
566
542
  } else {
567
543
  console.info(
568
- import_chalk8.default.yellow(
569
- `\u26A0\uFE0F Skipping this step. You can try running this command later. The failed command was \`${import_chalk8.default.underline(
544
+ import_chalk7.default.yellow(
545
+ `\u26A0\uFE0F Skipping this step. You can try running this command later. The failed command was \`${import_chalk7.default.underline(
570
546
  cmd
571
547
  )}\`.`
572
548
  )
@@ -599,8 +575,8 @@ async function linkSupabase() {
599
575
  await linkSupabase();
600
576
  } else {
601
577
  console.info(
602
- import_chalk8.default.yellow(
603
- `\u26A0\uFE0F Skipping this step. You can try running this command later. The failed command was \`${import_chalk8.default.underline(
578
+ import_chalk7.default.yellow(
579
+ `\u26A0\uFE0F Skipping this step. You can try running this command later. The failed command was \`${import_chalk7.default.underline(
604
580
  cmd
605
581
  )}\`.`
606
582
  )
@@ -621,10 +597,11 @@ function getEnvFromSupabaseStatus(status) {
621
597
  }
622
598
 
623
599
  // src/templates.ts
600
+ var tamaguiStarterReleaseRef = "starter/v3-beta.3";
624
601
  var templates = [
625
602
  {
626
- title: `${import_chalk9.default.bold.underline(
627
- `\u{1F961} ${import_chalk9.default.magenta("Takeout")} ${import_chalk9.default.green("Free")}`
603
+ title: `${import_chalk8.default.bold.underline(
604
+ `\u{1F961} ${import_chalk8.default.magenta("Takeout")} ${import_chalk8.default.green("Free")}`
628
605
  )} - Full stack starter: https://tamagui.dev/takeout`,
629
606
  value: "takeout-free",
630
607
  type: "free",
@@ -634,13 +611,13 @@ var templates = [
634
611
  url: `https://github.com/tamagui/takeout-free`,
635
612
  sshFallback: `git@github.com:tamagui/takeout-free.git`,
636
613
  dir: [],
637
- branch: "main"
614
+ ref: "main"
638
615
  },
639
616
  extraSteps: starter_free_default
640
617
  },
641
618
  {
642
- title: `${import_chalk9.default.bold.underline(
643
- `\u{1F961} ${import_chalk9.default.magenta("Takeout")} ${import_chalk9.default.red("Pro")}`
619
+ title: `${import_chalk8.default.bold.underline(
620
+ `\u{1F961} ${import_chalk8.default.magenta("Takeout")} ${import_chalk8.default.red("Pro")}`
644
621
  )} - Full featured starter: https://tamagui.dev/takeout`,
645
622
  value: `takeout-pro`,
646
623
  type: "premium",
@@ -650,13 +627,13 @@ var templates = [
650
627
  url: `https://github.com/tamagui/takeout2`,
651
628
  sshFallback: `git@github.com:tamagui/takeout2.git`,
652
629
  dir: [],
653
- branch: "main"
630
+ ref: "main"
654
631
  },
655
632
  extraSteps: takeout_default
656
633
  },
657
634
  {
658
- title: `${import_chalk9.default.bold.underline(
659
- `\u{1F961} ${import_chalk9.default.magenta("Takeout")} ${import_chalk9.default.yellow("Pro Classic")}`
635
+ title: `${import_chalk8.default.bold.underline(
636
+ `\u{1F961} ${import_chalk8.default.magenta("Takeout")} ${import_chalk8.default.yellow("Pro Classic")}`
660
637
  )} - Original Pro starter: https://tamagui.dev/takeout`,
661
638
  value: `takeout-pro-classic`,
662
639
  type: "premium",
@@ -666,24 +643,10 @@ var templates = [
666
643
  url: `https://github.com/tamagui/takeout`,
667
644
  sshFallback: `git@github.com:tamagui/takeout.git`,
668
645
  dir: [],
669
- branch: "main"
646
+ ref: "main"
670
647
  },
671
648
  extraSteps: takeout_default
672
649
  },
673
- {
674
- title: `Expo Router - Expo with file-based routing`,
675
- value: "expo-router",
676
- type: "free",
677
- hidden: false,
678
- packageManager: "bun",
679
- repo: {
680
- url: `https://github.com/tamagui/tamagui`,
681
- sshFallback: `git@github.com:tamagui/tamagui.git`,
682
- dir: ["code", "starters", "expo-router"],
683
- branch: "main"
684
- },
685
- extraSteps: expo_router_default
686
- },
687
650
  {
688
651
  title: `Remix - Remix with Vite`,
689
652
  value: "remix",
@@ -694,7 +657,7 @@ var templates = [
694
657
  url: `https://github.com/tamagui/tamagui`,
695
658
  sshFallback: `git@github.com:tamagui/tamagui.git`,
696
659
  dir: ["code", "starters", "remix"],
697
- branch: "main"
660
+ ref: tamaguiStarterReleaseRef
698
661
  },
699
662
  extraSteps: remix_default
700
663
  },
@@ -708,7 +671,7 @@ var templates = [
708
671
  url: process.env.STARTER_FREE_REPO_SOURCE || `https://github.com/tamagui/starter-free.git`,
709
672
  sshFallback: `git@github.com:tamagui/starter-free.git`,
710
673
  dir: [],
711
- branch: "main"
674
+ ref: "main"
712
675
  },
713
676
  extraSteps: starter_free_default
714
677
  }
@@ -775,11 +738,11 @@ var program = new import_commander.default.Command(package_default.name).version
775
738
  "Choose between four or more starter templates.",
776
739
  ""
777
740
  ).allowUnknownOption().usage(
778
- `${import_chalk10.default.green("<project-directory>")} [options]
741
+ `${import_chalk9.default.green("<project-directory>")} [options]
779
742
 
780
743
  Example usage:
781
744
 
782
- ${import_chalk10.default.blueBright(`npx ${package_default.name} next-expo`)}`
745
+ ${import_chalk9.default.blueBright(`npx ${package_default.name} next-expo`)}`
783
746
  ).parse(process.argv);
784
747
  if (process.argv.includes("--version")) {
785
748
  console.info(package_default.version);
@@ -801,14 +764,14 @@ async function run() {
801
764
  }
802
765
  console.info();
803
766
  console.info(
804
- import_chalk10.default.bold(
767
+ import_chalk9.default.bold(
805
768
  ' Note: You may need to run "npm create tamagui@latest" to get the latest version!'
806
769
  )
807
770
  );
808
771
  console.info();
809
772
  console.info();
810
773
  console.info(tamaguiRainbowAsciiArt);
811
- console.info(import_chalk10.default.bold("Creating tamagui app..."));
774
+ console.info(import_chalk9.default.bold("Creating tamagui app..."));
812
775
  const gitVersionString = Number.parseFloat(
813
776
  (0, import_node_child_process3.execSync)(`git --version`).toString().replace(`git version `, "").trim()
814
777
  );
@@ -844,33 +807,33 @@ Opening Takeout website - once you purchase you can restart the create process.
844
807
  const { valid, problems } = validateNpmName(projectName);
845
808
  if (!valid) {
846
809
  console.error(
847
- `Could not create a project called ${import_chalk10.default.red(
810
+ `Could not create a project called ${import_chalk9.default.red(
848
811
  `"${projectName}"`
849
812
  )} because of npm naming restrictions:`
850
813
  );
851
- problems.forEach((p) => console.error(` ${import_chalk10.default.red.bold("*")} ${p}`));
814
+ problems.forEach((p) => console.error(` ${import_chalk9.default.red.bold("*")} ${p}`));
852
815
  process.exit(1);
853
816
  }
854
817
  if (import_node_fs3.default.existsSync(resolvedProjectPath)) {
855
818
  console.info();
856
819
  console.info(
857
- import_chalk10.default.red("\u{1F6A8} [tamagui] error"),
858
- `You tried to make a project called ${import_chalk10.default.underline(
859
- import_chalk10.default.blueBright(projectName)
860
- )}, but a folder with that name already exists: ${import_chalk10.default.blueBright(
820
+ import_chalk9.default.red("\u{1F6A8} [tamagui] error"),
821
+ `You tried to make a project called ${import_chalk9.default.underline(
822
+ import_chalk9.default.blueBright(projectName)
823
+ )}, but a folder with that name already exists: ${import_chalk9.default.blueBright(
861
824
  resolvedProjectPath
862
825
  )}
863
826
 
864
- ${import_chalk10.default.bold(import_chalk10.default.red(`Please pick a different project name \u{1F978}`))}`
827
+ ${import_chalk9.default.bold(import_chalk9.default.red(`Please pick a different project name \u{1F978}`))}`
865
828
  );
866
829
  console.info();
867
830
  console.info();
868
831
  process.exit(1);
869
832
  }
870
833
  console.info();
871
- console.info(`Creating a new tamagui app ${import_chalk10.default.blueBright(resolvedProjectPath)}...`);
834
+ console.info(`Creating a new tamagui app ${import_chalk9.default.blueBright(resolvedProjectPath)}...`);
872
835
  import_node_fs3.default.mkdirSync(resolvedProjectPath);
873
- console.info(import_chalk10.default.green(`${projectName} folder created.`));
836
+ console.info(import_chalk9.default.green(`${projectName} folder created.`));
874
837
  try {
875
838
  await cloneStarter(template, resolvedProjectPath, projectName);
876
839
  process.chdir(resolvedProjectPath);
@@ -899,7 +862,7 @@ ${e}`);
899
862
  projectPath: resolvedProjectPath
900
863
  });
901
864
  console.info();
902
- console.info(import_chalk10.default.gray(tamaguiDuckAsciiArt));
865
+ console.info(import_chalk9.default.gray(tamaguiDuckAsciiArt));
903
866
  process.exit(0);
904
867
  } catch (error) {
905
868
  console.error("An unexpected error occurred:", error);