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