create-tina-app 0.0.0-f90ef4d-20241119072342 → 0.0.0-fe34947-20250106225431

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
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -36,7 +40,7 @@ var import_node_path = __toESM(require("path"));
36
40
 
37
41
  // package.json
38
42
  var name = "create-tina-app";
39
- var version = "1.2.3";
43
+ var version = "1.2.5";
40
44
 
41
45
  // src/util/fileUtil.ts
42
46
  var import_fs_extra = __toESM(require("fs-extra"));
@@ -164,11 +168,9 @@ function install(root, dependencies, { packageManager, isOnline, devDependencies
164
168
  switch (packageManager) {
165
169
  case "yarn":
166
170
  args = ["add", "--exact"];
167
- if (!isOnline)
168
- args.push("--offline");
171
+ if (!isOnline) args.push("--offline");
169
172
  args.push("--cwd", root);
170
- if (devDependencies)
171
- args.push("--dev");
173
+ if (devDependencies) args.push("--dev");
172
174
  args.push(...dependencies);
173
175
  break;
174
176
  case "npm":
@@ -178,11 +180,9 @@ function install(root, dependencies, { packageManager, isOnline, devDependencies
178
180
  break;
179
181
  case "pnpm":
180
182
  args = ["add"];
181
- if (!isOnline)
182
- args.push("--offline");
183
+ if (!isOnline) args.push("--offline");
183
184
  args.push("--save-exact");
184
- if (devDependencies)
185
- args.push("-D");
185
+ if (devDependencies) args.push("-D");
186
186
  args.push(...dependencies);
187
187
  break;
188
188
  }
@@ -282,7 +282,14 @@ var import_tar = require("tar");
282
282
  async function getRepoInfo(url, examplePath) {
283
283
  const [, username, name2, t, _branch, ...file] = url.pathname.split("/");
284
284
  const filePath = examplePath ? examplePath.replace(/^\//, "") : file.join("/");
285
- if (t === void 0 || t === "" && _branch === void 0) {
285
+ if (
286
+ // Support repos whose entire purpose is to be a Next.js example, e.g.
287
+ // https://github.com/:username/:my-cool-nextjs-example-repo-name.
288
+ t === void 0 || // Support GitHub URL that ends with a trailing slash, e.g.
289
+ // https://github.com/:username/:my-cool-nextjs-example-repo-name/
290
+ // In this case "t" will be an empty string while the next part "_branch" will be undefined
291
+ t === "" && _branch === void 0
292
+ ) {
286
293
  try {
287
294
  const infoResponse = await fetch(
288
295
  `https://api.github.com/repos/${username}/${name2}`
@@ -383,16 +390,20 @@ async function downloadTemplate(template, root) {
383
390
  }
384
391
 
385
392
  // src/util/preRunChecks.ts
386
- var SUPPORTED_NODE_VERSIONS = ["18", "20", "22"];
393
+ var SUPPORTED_NODE_VERSION_BOUNDS = { oldest: 18, latest: 22 };
394
+ var SUPPORTED_NODE_VERSION_RANGE = [
395
+ ...Array(SUPPORTED_NODE_VERSION_BOUNDS.latest).keys()
396
+ ].map((i) => i + SUPPORTED_NODE_VERSION_BOUNDS.oldest);
397
+ var isSupported = SUPPORTED_NODE_VERSION_RANGE.some(
398
+ (version2) => process.version.startsWith(`v${version2}`)
399
+ );
387
400
  function preRunChecks() {
388
401
  checkSupportedNodeVersion();
389
402
  }
390
403
  function checkSupportedNodeVersion() {
391
- if (!SUPPORTED_NODE_VERSIONS.some(
392
- (version2) => process.version.startsWith(`v${version2}`)
393
- )) {
404
+ if (!isSupported) {
394
405
  log.warn(
395
- `Version ${process.version} of Node.js is not supported in create-tina-app, please update to the latest LTS version. See https://nodejs.org/en/download/ for more details.`
406
+ `Node ${process.version} is not supported by create-tina-app. Please update to be within v${SUPPORTED_NODE_VERSION_BOUNDS.oldest}-v${SUPPORTED_NODE_VERSION_BOUNDS.latest}. See https://nodejs.org/en/download/ for more details.`
396
407
  );
397
408
  }
398
409
  }
@@ -485,8 +496,7 @@ async function run() {
485
496
  return { title: manager, value: manager };
486
497
  })
487
498
  });
488
- if (!Object.hasOwn(res, "packageManager"))
489
- (0, import_node_process.exit)(1);
499
+ if (!Object.hasOwn(res, "packageManager")) (0, import_node_process.exit)(1);
490
500
  pkgManager = res.packageManager;
491
501
  }
492
502
  if (!projectName) {
@@ -499,13 +509,11 @@ async function run() {
499
509
  const { validForNewPackages, errors } = (0, import_validate_npm_package_name.default)(
500
510
  import_node_path.default.basename(import_node_path.default.resolve(name2))
501
511
  );
502
- if (validForNewPackages)
503
- return true;
512
+ if (validForNewPackages) return true;
504
513
  return "Invalid project name: " + errors[0];
505
514
  }
506
515
  });
507
- if (!Object.hasOwn(res, "name"))
508
- (0, import_node_process.exit)(1);
516
+ if (!Object.hasOwn(res, "name")) (0, import_node_process.exit)(1);
509
517
  projectName = res.name;
510
518
  }
511
519
  if (!template) {
@@ -515,8 +523,7 @@ async function run() {
515
523
  message: "What starter code would you like to use?",
516
524
  choices: TEMPLATES
517
525
  });
518
- if (!Object.hasOwn(res, "template"))
519
- (0, import_node_process.exit)(1);
526
+ if (!Object.hasOwn(res, "template")) (0, import_node_process.exit)(1);
520
527
  template = TEMPLATES.find((_template) => _template.value === res.template);
521
528
  }
522
529
  await telemetry.submitRecord({
@@ -1,2 +1 @@
1
- export declare const SUPPORTED_NODE_VERSIONS: string[];
2
1
  export declare function preRunChecks(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-tina-app",
3
- "version": "0.0.0-f90ef4d-20241119072342",
3
+ "version": "0.0.0-fe34947-20250106225431",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist",
@@ -35,18 +35,17 @@
35
35
  "@types/prompts": "^2.4.9",
36
36
  "@types/tar": "6.1.13",
37
37
  "typescript": "^5.6.3",
38
- "@tinacms/scripts": "0.0.0-f90ef4d-20241119072342"
38
+ "@tinacms/scripts": "1.3.1"
39
39
  },
40
40
  "dependencies": {
41
41
  "chalk": "4.1.2",
42
42
  "commander": "^12.1.0",
43
43
  "cross-spawn": "^7.0.5",
44
44
  "fs-extra": "^11.2.0",
45
- "got": "^14.4.4",
46
45
  "prompts": "^2.4.2",
47
46
  "tar": "7.4.0",
48
47
  "validate-npm-package-name": "^5.0.1",
49
- "@tinacms/metrics": "0.0.0-f90ef4d-20241119072342"
48
+ "@tinacms/metrics": "1.0.8"
50
49
  },
51
50
  "scripts": {
52
51
  "types": "pnpm tsc",