create-tina-app 2.1.10 → 2.2.0

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
@@ -294,9 +294,9 @@ import { copy } from "fs-extra";
294
294
  import path2 from "path";
295
295
  var TEMPLATES = [
296
296
  {
297
- title: "\u2B50 NextJS starter",
298
- description: "Kickstart your project with Next.js \u2013 our top recommendation for a seamless, performant, and versatile web experience.",
299
- value: "tina-nextjs-starter",
297
+ title: "\u2B50 Astro Starter",
298
+ description: "Kickstart your project with Astro, our top recommendation for a fast, lightweight, and flexible web experience.",
299
+ value: "tina-astro-starter",
300
300
  isInternal: false,
301
301
  features: [
302
302
  {
@@ -305,21 +305,21 @@ var TEMPLATES = [
305
305
  },
306
306
  {
307
307
  name: "ISR",
308
- description: "\u2705"
308
+ description: "\u274C"
309
309
  },
310
310
  {
311
311
  name: "SSG",
312
312
  description: "\u2705"
313
313
  }
314
314
  ],
315
- gitURL: "https://github.com/tinacms/tina-nextjs-starter",
315
+ gitURL: "https://github.com/tinacms/tina-astro-starter",
316
316
  branch: "main",
317
- devUrl: "http://localhost:3000"
317
+ devUrl: "http://localhost:4321"
318
318
  },
319
319
  {
320
- title: "\u2B50\uFE0F TinaDocs",
321
- description: "Get your documentation site up and running with TinaCMS and Next.js in minutes.",
322
- value: "tina-docs",
320
+ title: "Next.js Starter",
321
+ description: "Kickstart your project with Next.js, a seamless, performant, and versatile web experience.",
322
+ value: "tina-nextjs-starter",
323
323
  isInternal: false,
324
324
  features: [
325
325
  {
@@ -335,28 +335,32 @@ var TEMPLATES = [
335
335
  description: "\u2705"
336
336
  }
337
337
  ],
338
- gitURL: "https://github.com/tinacms/tina-docs",
338
+ gitURL: "https://github.com/tinacms/tina-nextjs-starter",
339
339
  branch: "main",
340
340
  devUrl: "http://localhost:3000"
341
341
  },
342
342
  {
343
- title: "Astro Starter",
344
- description: "Get started with Astro - a modern static site generator designed for fast, lightweight, and flexible web projects.",
345
- value: "tina-astro-starter",
343
+ title: "TinaDocs",
344
+ description: "Get your documentation site up and running with TinaCMS and Next.js in minutes.",
345
+ value: "tina-docs",
346
346
  isInternal: false,
347
347
  features: [
348
348
  {
349
349
  name: "Visual Editing",
350
350
  description: "\u2705"
351
351
  },
352
+ {
353
+ name: "ISR",
354
+ description: "\u2705"
355
+ },
352
356
  {
353
357
  name: "SSG",
354
358
  description: "\u2705"
355
359
  }
356
360
  ],
357
- gitURL: "https://github.com/tinacms/tina-astro-starter",
361
+ gitURL: "https://github.com/tinacms/tina-docs",
358
362
  branch: "main",
359
- devUrl: "http://localhost:4321"
363
+ devUrl: "http://localhost:3000"
360
364
  },
361
365
  {
362
366
  title: "Hugo Starter",
@@ -428,8 +432,8 @@ var TEMPLATES = [
428
432
  devUrl: "http://localhost:3000"
429
433
  },
430
434
  {
431
- title: "Bare bones starter",
432
- description: "Stripped down to essentials, this starter is the canvas for pure, unadulterated code creativity. Built with Next.js.",
435
+ title: "React Starter",
436
+ description: "Stripped down to essentials, this starter is the canvas for pure, unadulterated code creativity. Built with Vite and React.",
433
437
  value: "basic",
434
438
  isInternal: false,
435
439
  features: [
@@ -446,11 +450,20 @@ var TEMPLATES = [
446
450
  description: "\u2705"
447
451
  }
448
452
  ],
449
- gitURL: "https://github.com/tinacms/tina-barebones-starter",
453
+ gitURL: "https://github.com/tinacms/tina-react-starter",
450
454
  branch: "main",
451
455
  devUrl: "http://localhost:3000"
452
456
  }
453
457
  ];
458
+ var defaultTemplate = TEMPLATES.find(
459
+ (template) => template.value === "tina-astro-starter"
460
+ );
461
+ if (!defaultTemplate) {
462
+ throw new Error(
463
+ 'DEFAULT_TEMPLATE: no template in TEMPLATES has the value "tina-astro-starter"'
464
+ );
465
+ }
466
+ var DEFAULT_TEMPLATE = defaultTemplate;
454
467
  async function downloadTemplate(template, root, spinner) {
455
468
  if (template.isInternal === false) {
456
469
  const repoURL = new URL(template.gitURL);
@@ -529,7 +542,7 @@ import { Command } from "commander";
529
542
 
530
543
  // package.json
531
544
  var name = "create-tina-app";
532
- var version = "2.1.10";
545
+ var version = "2.2.0";
533
546
 
534
547
  // src/util/packageManagers.ts
535
548
  var PKG_MANAGERS = ["pnpm", "yarn", "bun", "npm"];
@@ -1165,30 +1178,37 @@ Need more help? Reach out to the TinaCMS community at ${TextStyles.link(
1165
1178
  projectName = res.name;
1166
1179
  }
1167
1180
  if (!template) {
1168
- const res = await prompts({
1169
- name: "template",
1170
- type: "select",
1171
- message: "What starter code would you like to use?",
1172
- choices: TEMPLATES.map(formatTemplateChoice)
1173
- });
1174
- if (!Object.hasOwn(res, "template")) {
1175
- postHogCaptureError(
1176
- posthogClient,
1177
- userId,
1178
- sessionId,
1179
- new Error("User cancelled template selection"),
1180
- {
1181
- errorCode: ERROR_CODES.ERR_CANCEL_TEMPLATE_PROMPT,
1182
- errorCategory: "user-cancellation",
1183
- step: TRACKING_STEPS.TEMPLATE_SELECT,
1184
- fatal: true,
1185
- additionalProperties: telemetryData
1186
- }
1181
+ if (!process.stdin.isTTY) {
1182
+ template = DEFAULT_TEMPLATE;
1183
+ } else {
1184
+ const res = await prompts({
1185
+ name: "template",
1186
+ type: "select",
1187
+ message: "What starter code would you like to use?",
1188
+ choices: TEMPLATES.map(formatTemplateChoice),
1189
+ initial: TEMPLATES.indexOf(DEFAULT_TEMPLATE)
1190
+ });
1191
+ if (!Object.hasOwn(res, "template")) {
1192
+ postHogCaptureError(
1193
+ posthogClient,
1194
+ userId,
1195
+ sessionId,
1196
+ new Error("User cancelled template selection"),
1197
+ {
1198
+ errorCode: ERROR_CODES.ERR_CANCEL_TEMPLATE_PROMPT,
1199
+ errorCategory: "user-cancellation",
1200
+ step: TRACKING_STEPS.TEMPLATE_SELECT,
1201
+ fatal: true,
1202
+ additionalProperties: telemetryData
1203
+ }
1204
+ );
1205
+ if (posthogClient) await posthogClient.shutdown();
1206
+ exit(1);
1207
+ }
1208
+ template = TEMPLATES.find(
1209
+ (_template) => _template.value === res.template
1187
1210
  );
1188
- if (posthogClient) await posthogClient.shutdown();
1189
- exit(1);
1190
1211
  }
1191
- template = TEMPLATES.find((_template) => _template.value === res.template);
1192
1212
  }
1193
1213
  telemetryData["template"] = template.value;
1194
1214
  let themeChoice;
@@ -20,5 +20,6 @@ export type ExternalTemplate = BaseExample & {
20
20
  };
21
21
  export type Template = InternalTemplate | ExternalTemplate;
22
22
  export declare const TEMPLATES: Template[];
23
+ export declare const DEFAULT_TEMPLATE: Template;
23
24
  export declare function downloadTemplate(template: Template, root: string, spinner: Ora): Promise<void>;
24
25
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-tina-app",
3
- "version": "2.1.10",
3
+ "version": "2.2.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -35,7 +35,7 @@
35
35
  "@types/prompts": "^2.4.9",
36
36
  "@types/tar": "6.1.13",
37
37
  "typescript": "^5.7.3",
38
- "@tinacms/scripts": "1.6.2"
38
+ "@tinacms/scripts": "1.6.3"
39
39
  },
40
40
  "dependencies": {
41
41
  "chalk": "^5.4.1",
@@ -46,7 +46,7 @@
46
46
  "posthog-node": "^5.17.2",
47
47
  "prompts": "^2.4.2",
48
48
  "systeminformation": "^5.27.13",
49
- "tar": "7.4.0"
49
+ "tar": "7.5.21"
50
50
  },
51
51
  "scripts": {
52
52
  "types": "pnpm tsc",