create-tamagui 1.0.2 → 1.0.4

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.js CHANGED
@@ -44720,7 +44720,7 @@ var globby2 = Object.assign(function globby3(patterns, options) {
44720
44720
  // package.json
44721
44721
  var package_default = {
44722
44722
  name: "create-tamagui",
44723
- version: "1.0.2",
44723
+ version: "1.0.3",
44724
44724
  bin: "./run.js",
44725
44725
  main: "dist",
44726
44726
  files: [
@@ -44754,7 +44754,7 @@ var package_default = {
44754
44754
  },
44755
44755
  devDependencies: {
44756
44756
  "@playwright/test": "^1.29.0",
44757
- "@tamagui/build": "^1.0.1",
44757
+ "@tamagui/build": "^1.0.3",
44758
44758
  "@types/async-retry": "1.4.2",
44759
44759
  "@types/cross-spawn": "^6.0.2",
44760
44760
  "@types/node": "^16.11.9",
@@ -44781,6 +44781,9 @@ var package_default = {
44781
44781
  var pipeline = (0, import_util4.promisify)(import_stream.Stream.pipeline);
44782
44782
  var projectPath = "";
44783
44783
  var IS_TEST = process.env.NODE_ENV === "test";
44784
+ if (IS_TEST) {
44785
+ console.log(`\u{1F9D0} Running create-tamagui in test mode \u{1F9D0}`);
44786
+ }
44784
44787
  var program = new import_commander.default.Command(package_default.name).version(package_default.version).arguments("<project-directory>").action((name) => {
44785
44788
  projectPath = name;
44786
44789
  }).option("--use-npm", `Explicitly tell the CLI to bootstrap the app using npm`).option("--use-pnpm", `Explicitly tell the CLI to bootstrap the app using pnpm`).option(
@@ -44887,6 +44890,10 @@ ${import_chalk4.default.bold(import_chalk4.default.red(`Please pick a different
44887
44890
  import_fs.default.mkdirSync(resolvedProjectPath);
44888
44891
  console.log(import_chalk4.default.green(`${projectName} folder created.`));
44889
44892
  try {
44893
+ let gitInit2 = function() {
44894
+ return $`git init`;
44895
+ };
44896
+ var gitInit = gitInit2;
44890
44897
  const home = (0, import_os.homedir)();
44891
44898
  const tamaguiDir = (0, import_path.join)(home, ".tamagui");
44892
44899
  const repoRoot = (0, import_path.join)(__dirname, "..", "..", "..");
@@ -44894,6 +44901,12 @@ ${import_chalk4.default.bold(import_chalk4.default.red(`Please pick a different
44894
44901
  async function setupTamaguiDotDir(isRetry = false) {
44895
44902
  console.log(`Setting up ${import_chalk4.default.blueBright(tamaguiDir)}...`);
44896
44903
  cd(repoRoot);
44904
+ if (process.env.GITHUB_HEAD_REF) {
44905
+ try {
44906
+ await $`git switch -c ${process.env.GITHUB_HEAD_REF}`;
44907
+ } catch {
44908
+ }
44909
+ }
44897
44910
  const branch = IS_TEST ? (await $`git rev-parse --abbrev-ref HEAD`).stdout.trim() : `master`;
44898
44911
  if (IS_TEST) {
44899
44912
  await (0, import_fs_extra.remove)(targetGitDir);
@@ -44954,7 +44967,19 @@ ${err.stack}` : "trying from fresh."}`
44954
44967
  await (0, import_fs_extra.copy)(starterDir, resolvedProjectPath);
44955
44968
  console.log(import_chalk4.default.green(`${projectName} created!`));
44956
44969
  cd(resolvedProjectPath);
44957
- await $`git init`;
44970
+ if (IS_TEST) {
44971
+ await gitInit2();
44972
+ } else {
44973
+ const res2 = await (0, import_prompts.default)({
44974
+ type: "confirm",
44975
+ name: "gitInit",
44976
+ message: "Do you want to use git?",
44977
+ initial: true
44978
+ });
44979
+ if (res2.gitInit) {
44980
+ await gitInit2();
44981
+ }
44982
+ }
44958
44983
  } catch (e) {
44959
44984
  console.error(`[tamagui] Failed to copy example into ${resolvedProjectPath}
44960
44985