create-tina-app 1.6.1 → 2.0.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.
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- require('../dist')
3
+ import('../dist/index.js');
package/dist/index.js CHANGED
@@ -1,127 +1,30 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __commonJS = (cb, mod) => function __require() {
8
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
- };
10
- var __export = (target, all) => {
11
- for (var name2 in all)
12
- __defProp(target, name2, { get: all[name2], enumerable: true });
13
- };
14
- var __copyProps = (to, from, except, desc) => {
15
- if (from && typeof from === "object" || typeof from === "function") {
16
- for (let key of __getOwnPropNames(from))
17
- if (!__hasOwnProp.call(to, key) && key !== except)
18
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
- }
20
- return to;
21
- };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28
- mod
29
- ));
30
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
-
32
- // package.json
33
- var require_package = __commonJS({
34
- "package.json"(exports2, module2) {
35
- module2.exports = {
36
- name: "create-tina-app",
37
- version: "1.6.1",
38
- main: "dist/index.js",
39
- files: [
40
- "dist",
41
- "examples",
42
- "bin/*"
43
- ],
44
- bin: "bin/create-tina-app",
45
- typings: "dist/index.d.ts",
46
- license: "Apache-2.0",
47
- buildConfig: {
48
- entryPoints: [
49
- {
50
- name: "src/index.ts",
51
- target: "node"
52
- }
53
- ]
54
- },
55
- engines: {
56
- node: ">=18.18.0"
57
- },
58
- scripts: {
59
- types: "pnpm tsc",
60
- build: "tinacms-scripts build",
61
- "test-run-bin": "pnpm create-tina-app"
62
- },
63
- publishConfig: {
64
- registry: "https://registry.npmjs.org"
65
- },
66
- repository: {
67
- url: "https://github.com/tinacms/tinacms.git",
68
- directory: "packages/create-tina-app"
69
- },
70
- devDependencies: {
71
- "@tinacms/scripts": "workspace:*",
72
- "@types/cross-spawn": "catalog:",
73
- "@types/fs-extra": "^11.0.4",
74
- "@types/node": "^22.13.1",
75
- "@types/prompts": "catalog:",
76
- "@types/tar": "catalog:",
77
- typescript: "^5.7.3"
78
- },
79
- dependencies: {
80
- "@tinacms/metrics": "workspace:*",
81
- chalk: "4.1.2",
82
- commander: "^12.1.0",
83
- "cross-spawn": "catalog:",
84
- "fs-extra": "catalog:",
85
- ora: "catalog:",
86
- prompts: "catalog:",
87
- tar: "catalog:",
88
- "validate-npm-package-name": "catalog:"
89
- }
90
- };
91
- }
92
- });
93
-
94
1
  // src/index.ts
95
- var index_exports = {};
96
- __export(index_exports, {
97
- run: () => run
98
- });
99
- module.exports = __toCommonJS(index_exports);
100
- var import_metrics = require("@tinacms/metrics");
101
- var import_prompts = __toESM(require("prompts"));
102
- var import_node_path = __toESM(require("node:path"));
2
+ import { Telemetry } from "@tinacms/metrics";
3
+ import prompts from "prompts";
4
+ import path4 from "node:path";
5
+ import { createRequire } from "node:module";
103
6
 
104
7
  // src/util/fileUtil.ts
105
- var import_fs_extra = __toESM(require("fs-extra"));
106
- var import_path = __toESM(require("path"));
8
+ import fs from "fs-extra";
9
+ import path from "path";
107
10
 
108
11
  // src/util/textstyles.ts
109
- var import_chalk = __toESM(require("chalk"));
12
+ import chalk from "chalk";
110
13
  var TextStyles = {
111
- tinaOrange: import_chalk.default.hex("#EC4816"),
112
- link: (url) => `\x1B]8;;${url}\x07${import_chalk.default.cyan.underline(url)}\x1B]8;;\x07`,
113
- cmd: import_chalk.default.bgBlackBright.bold.white,
114
- info: import_chalk.default.blue,
115
- success: import_chalk.default.green,
116
- warn: import_chalk.default.yellow,
117
- err: import_chalk.default.red,
118
- bold: import_chalk.default.bold
14
+ tinaOrange: chalk.hex("#EC4816"),
15
+ link: (url) => `\x1B]8;;${url}\x07${chalk.cyan.underline(url)}\x1B]8;;\x07`,
16
+ cmd: chalk.bgBlackBright.bold.white,
17
+ info: chalk.blue,
18
+ success: chalk.green,
19
+ warn: chalk.yellow,
20
+ err: chalk.red,
21
+ bold: chalk.bold
119
22
  };
120
23
 
121
24
  // src/util/fileUtil.ts
122
25
  async function isWriteable(directory) {
123
26
  try {
124
- await import_fs_extra.default.promises.access(directory, (import_fs_extra.default.constants || import_fs_extra.default).W_OK);
27
+ await fs.promises.access(directory, (fs.constants || fs).W_OK);
125
28
  return true;
126
29
  } catch (err) {
127
30
  return false;
@@ -148,12 +51,12 @@ function folderContainsInstallConflicts(root) {
148
51
  "yarn-debug.log",
149
52
  "yarn-error.log"
150
53
  ];
151
- const conflicts = import_fs_extra.default.readdirSync(root).filter((file) => !validFiles.includes(file)).filter((file) => !/\.iml$/.test(file));
54
+ const conflicts = fs.readdirSync(root).filter((file) => !validFiles.includes(file)).filter((file) => !/\.iml$/.test(file));
152
55
  return conflicts;
153
56
  }
154
57
  async function setupProjectDirectory(dir) {
155
- const appName = import_path.default.basename(dir);
156
- await import_fs_extra.default.mkdirp(dir);
58
+ const appName = path.basename(dir);
59
+ await fs.mkdirp(dir);
157
60
  process.chdir(dir);
158
61
  const conflicts = folderContainsInstallConflicts(dir);
159
62
  if (conflicts.length > 0) {
@@ -162,7 +65,7 @@ async function setupProjectDirectory(dir) {
162
65
  ];
163
66
  for (const file of conflicts) {
164
67
  try {
165
- const stats = import_fs_extra.default.lstatSync(import_path.default.join(dir, file));
68
+ const stats = fs.lstatSync(path.join(dir, file));
166
69
  if (stats.isDirectory()) {
167
70
  errorMessageLines.push(` - ${TextStyles.info(file)}/`);
168
71
  } else {
@@ -177,36 +80,36 @@ async function setupProjectDirectory(dir) {
177
80
  return appName;
178
81
  }
179
82
  function updateProjectPackageName(dir, name2) {
180
- const packageJsonPath = import_path.default.join(dir, "package.json");
181
- const packageJson = JSON.parse(import_fs_extra.default.readFileSync(packageJsonPath, "utf8"));
83
+ const packageJsonPath = path.join(dir, "package.json");
84
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
182
85
  packageJson.name = name2;
183
- import_fs_extra.default.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
86
+ fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
184
87
  }
185
88
  function updateProjectPackageVersion(dir, version2) {
186
- const packageJsonPath = import_path.default.join(dir, "package.json");
187
- const packageJson = JSON.parse(import_fs_extra.default.readFileSync(packageJsonPath, "utf8"));
89
+ const packageJsonPath = path.join(dir, "package.json");
90
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
188
91
  packageJson.version = version2;
189
- import_fs_extra.default.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
92
+ fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
190
93
  }
191
94
  async function updateThemeSettings(dir, selectedTheme) {
192
- const settingsDir = import_path.default.join(dir, "content", "settings");
193
- const configPath = import_path.default.join(settingsDir, "config.json");
194
- await import_fs_extra.default.mkdirp(settingsDir);
95
+ const settingsDir = path.join(dir, "content", "settings");
96
+ const configPath = path.join(settingsDir, "config.json");
97
+ await fs.mkdirp(settingsDir);
195
98
  let config = {};
196
99
  try {
197
- const existingConfig = await import_fs_extra.default.readFile(configPath, "utf8");
100
+ const existingConfig = await fs.readFile(configPath, "utf8");
198
101
  config = JSON.parse(existingConfig);
199
102
  } catch (error) {
200
103
  }
201
104
  config.selectedTheme = selectedTheme;
202
- await import_fs_extra.default.writeFile(configPath, JSON.stringify(config, null, 2));
105
+ await fs.writeFile(configPath, JSON.stringify(config, null, 2));
203
106
  }
204
107
 
205
108
  // src/util/install.ts
206
- var import_cross_spawn = __toESM(require("cross-spawn"));
109
+ import spawn from "cross-spawn";
207
110
  function install(packageManager, verboseOutput) {
208
111
  return new Promise((resolve, reject) => {
209
- const child = (0, import_cross_spawn.default)(packageManager, ["install"], {
112
+ const child = spawn(packageManager, ["install"], {
210
113
  stdio: verboseOutput ? "inherit" : "ignore",
211
114
  env: { ...process.env, ADBLOCK: "1", DISABLE_OPENCOLLECTIVE: "1" }
212
115
  });
@@ -221,12 +124,12 @@ function install(packageManager, verboseOutput) {
221
124
  }
222
125
 
223
126
  // src/util/git.ts
224
- var import_child_process = require("child_process");
225
- var import_path2 = __toESM(require("path"));
226
- var import_fs_extra2 = __toESM(require("fs-extra"));
127
+ import { execSync } from "child_process";
128
+ import path2 from "path";
129
+ import fs2 from "fs-extra";
227
130
  function isInGitRepository() {
228
131
  try {
229
- (0, import_child_process.execSync)("git rev-parse --is-inside-work-tree", { stdio: "ignore" });
132
+ execSync("git rev-parse --is-inside-work-tree", { stdio: "ignore" });
230
133
  return true;
231
134
  } catch (_) {
232
135
  }
@@ -234,7 +137,7 @@ function isInGitRepository() {
234
137
  }
235
138
  function isInMercurialRepository() {
236
139
  try {
237
- (0, import_child_process.execSync)("hg --cwd . root", { stdio: "ignore" });
140
+ execSync("hg --cwd . root", { stdio: "ignore" });
238
141
  return true;
239
142
  } catch (_) {
240
143
  }
@@ -242,27 +145,27 @@ function isInMercurialRepository() {
242
145
  }
243
146
  function makeFirstCommit(root) {
244
147
  try {
245
- (0, import_child_process.execSync)("git checkout -b main", { stdio: "ignore" });
246
- (0, import_child_process.execSync)("git add -A", { stdio: "ignore" });
247
- (0, import_child_process.execSync)('git commit -m "Initial commit from Create Tina App"', {
148
+ execSync("git checkout -b main", { stdio: "ignore" });
149
+ execSync("git add -A", { stdio: "ignore" });
150
+ execSync('git commit -m "Initial commit from Create Tina App"', {
248
151
  stdio: "ignore"
249
152
  });
250
153
  } catch (err) {
251
- import_fs_extra2.default.removeSync(import_path2.default.join(root, ".git"));
154
+ fs2.removeSync(path2.join(root, ".git"));
252
155
  throw err;
253
156
  }
254
157
  }
255
158
  function initializeGit(spinner) {
256
- (0, import_child_process.execSync)("git --version", { stdio: "ignore" });
159
+ execSync("git --version", { stdio: "ignore" });
257
160
  if (isInGitRepository() || isInMercurialRepository()) {
258
161
  spinner.warn("Already in a Git repository, skipping.");
259
162
  return false;
260
163
  }
261
- if (!import_fs_extra2.default.existsSync(".gitignore")) {
164
+ if (!fs2.existsSync(".gitignore")) {
262
165
  spinner.warn(
263
166
  "There is no .gitignore file in this repository, creating one..."
264
167
  );
265
- import_fs_extra2.default.writeFileSync(
168
+ fs2.writeFileSync(
266
169
  ".gitignore",
267
170
  `node_modules
268
171
  .yarn/*
@@ -272,14 +175,14 @@ function initializeGit(spinner) {
272
175
  `
273
176
  );
274
177
  }
275
- (0, import_child_process.execSync)("git init", { stdio: "ignore" });
178
+ execSync("git init", { stdio: "ignore" });
276
179
  return true;
277
180
  }
278
181
 
279
182
  // src/util/examples.ts
280
- var import_node_stream = require("node:stream");
281
- var import_promises = require("node:stream/promises");
282
- var import_tar = require("tar");
183
+ import { Readable } from "node:stream";
184
+ import { pipeline } from "node:stream/promises";
185
+ import { x } from "tar";
283
186
  async function getRepoInfo(url, examplePath) {
284
187
  const [, username, name2, t, _branch, ...file] = url.pathname.split("/");
285
188
  const filePath = examplePath ? examplePath.replace(/^\//, "") : file.join("/");
@@ -314,14 +217,14 @@ async function downloadTarStream(url) {
314
217
  if (!res.body) {
315
218
  throw new Error(`Failed to download: ${url}`);
316
219
  }
317
- return import_node_stream.Readable.fromWeb(res.body);
220
+ return Readable.fromWeb(res.body);
318
221
  }
319
222
  async function downloadAndExtractRepo(root, { username, name: name2, branch, filePath }) {
320
- await (0, import_promises.pipeline)(
223
+ await pipeline(
321
224
  await downloadTarStream(
322
225
  `https://codeload.github.com/${username}/${name2}/tar.gz/${branch}`
323
226
  ),
324
- (0, import_tar.x)({
227
+ x({
325
228
  cwd: root,
326
229
  strip: filePath ? filePath.split("/").length + 1 : 1,
327
230
  filter: (p) => p.startsWith(
@@ -332,8 +235,8 @@ async function downloadAndExtractRepo(root, { username, name: name2, branch, fil
332
235
  }
333
236
 
334
237
  // src/templates.ts
335
- var import_fs_extra3 = require("fs-extra");
336
- var import_path3 = __toESM(require("path"));
238
+ import { copy } from "fs-extra";
239
+ import path3 from "path";
337
240
  var TEMPLATES = [
338
241
  {
339
242
  title: "\u2B50 NextJS starter",
@@ -404,8 +307,8 @@ async function downloadTemplate(template, root, spinner) {
404
307
  )}`;
405
308
  await downloadAndExtractRepo(root, repoInfo);
406
309
  } else {
407
- const templateFile = import_path3.default.join(__dirname, "..", "examples", template.value);
408
- await (0, import_fs_extra3.copy)(`${templateFile}/`, "./");
310
+ const templateFile = path3.join(__dirname, "..", "examples", template.value);
311
+ await copy(`${templateFile}/`, "./");
409
312
  }
410
313
  }
411
314
 
@@ -429,11 +332,11 @@ function preRunChecks(spinner) {
429
332
  }
430
333
 
431
334
  // src/util/checkPkgManagers.ts
432
- var import_child_process2 = require("child_process");
335
+ import { exec } from "child_process";
433
336
  async function checkPackageExists(name2) {
434
337
  try {
435
338
  await new Promise((resolve, reject) => {
436
- (0, import_child_process2.exec)(`${name2} -v`, (error, stdout, stderr) => {
339
+ exec(`${name2} -v`, (error, stdout, stderr) => {
437
340
  if (error) {
438
341
  reject(stderr);
439
342
  }
@@ -447,11 +350,14 @@ async function checkPackageExists(name2) {
447
350
  }
448
351
 
449
352
  // src/index.ts
450
- var import_node_process = require("node:process");
353
+ import { exit } from "node:process";
451
354
 
452
355
  // src/util/options.ts
453
- var import_commander = require("commander");
454
- var import_package = __toESM(require_package());
356
+ import { Command } from "commander";
357
+
358
+ // package.json
359
+ var name = "create-tina-app";
360
+ var version = "2.0.0";
455
361
 
456
362
  // src/util/packageManagers.ts
457
363
  var PKG_MANAGERS = ["npm", "yarn", "pnpm", "bun"];
@@ -459,8 +365,8 @@ var PKG_MANAGERS = ["npm", "yarn", "pnpm", "bun"];
459
365
  // src/util/options.ts
460
366
  function extractOptions(args) {
461
367
  let projectName = "";
462
- const program = new import_commander.Command(import_package.name);
463
- program.version(import_package.version).option(
368
+ const program = new Command(name);
369
+ program.version(version).option(
464
370
  "-t, --template <template>",
465
371
  `Choose which template to start from. Valid templates are: ${TEMPLATES.map(
466
372
  (x2) => x2.value
@@ -486,7 +392,7 @@ function extractOptions(args) {
486
392
  }
487
393
 
488
394
  // src/index.ts
489
- var import_validate_npm_package_name = __toESM(require("validate-npm-package-name"));
395
+ import validate from "validate-npm-package-name";
490
396
 
491
397
  // src/util/asciiArt.ts
492
398
  var llama = " :--=: \n :-===- \n -=====- \n -=======. \n .=========-. \n :===========--:\n -=============.\n .==========-:. \n :=========-. \n -=========- \n .==========- \n -==========- \n :===========- \n -=============. \n :==============: \n :===============- \n .:-================- \n ..::---==================== \n ....::::::::::-------============================. \n .---=================================================: \n .-=====================================================- \n:=======================================================. \n .-====================================================. \n .-=================================================. \n :=============================================- \n -============================================. \n .============-:. -==========- \n :=========-: .. -==========. \n -========: :-=- -=========- \n .========. .-==== :=========: \n -=======: :=====. -========: \n -======- -====- -=======: \n -=====: -====: :======. \n .=====. -====. .-====- \n :==== -===- -====: \n -==- :===- :====. ";
@@ -536,12 +442,13 @@ async function run() {
536
442
  } else {
537
443
  console.log(TextStyles.tinaOrange(`\u{1F999} TinaCMS`));
538
444
  }
539
- const version2 = require_package().version;
445
+ const require2 = createRequire(import.meta.url);
446
+ const version2 = require2("../package.json").version;
540
447
  console.log(`Create Tina App v${version2}`);
541
448
  const spinner = ora();
542
449
  preRunChecks(spinner);
543
450
  const opts = extractOptions(process.argv);
544
- const telemetry = new import_metrics.Telemetry({ disabled: opts?.noTelemetry });
451
+ const telemetry = new Telemetry({ disabled: opts?.noTelemetry });
545
452
  let template = null;
546
453
  if (opts.template) {
547
454
  template = TEMPLATES.find((_template) => _template.value === opts.template);
@@ -551,7 +458,7 @@ async function run() {
551
458
  (x2) => x2.value
552
459
  )}`
553
460
  );
554
- (0, import_node_process.exit)(1);
461
+ exit(1);
555
462
  }
556
463
  }
557
464
  let pkgManager = opts.pkgManager;
@@ -560,7 +467,7 @@ async function run() {
560
467
  spinner.fail(
561
468
  `The provided package manager '${opts.pkgManager}' is not supported. Please provide one of the following: ${PKG_MANAGERS}`
562
469
  );
563
- (0, import_node_process.exit)(1);
470
+ exit(1);
564
471
  }
565
472
  }
566
473
  if (!pkgManager) {
@@ -574,9 +481,9 @@ async function run() {
574
481
  spinner.fail(
575
482
  `You have no supported package managers installed. Please install one of the following: ${PKG_MANAGERS}`
576
483
  );
577
- (0, import_node_process.exit)(1);
484
+ exit(1);
578
485
  }
579
- const res = await (0, import_prompts.default)({
486
+ const res = await prompts({
580
487
  message: "Which package manager would you like to use?",
581
488
  name: "packageManager",
582
489
  type: "select",
@@ -584,46 +491,46 @@ async function run() {
584
491
  return { title: manager, value: manager };
585
492
  })
586
493
  });
587
- if (!Object.hasOwn(res, "packageManager")) (0, import_node_process.exit)(1);
494
+ if (!Object.hasOwn(res, "packageManager")) exit(1);
588
495
  pkgManager = res.packageManager;
589
496
  }
590
497
  let projectName = opts.projectName;
591
498
  if (!projectName) {
592
- const res = await (0, import_prompts.default)({
499
+ const res = await prompts({
593
500
  name: "name",
594
501
  type: "text",
595
502
  message: "What is your project named?",
596
503
  initial: "my-tina-app",
597
504
  validate: (name2) => {
598
- const { validForNewPackages, errors } = (0, import_validate_npm_package_name.default)(
599
- import_node_path.default.basename(import_node_path.default.resolve(name2))
505
+ const { validForNewPackages, errors } = validate(
506
+ path4.basename(path4.resolve(name2))
600
507
  );
601
508
  if (validForNewPackages) return true;
602
509
  return `Invalid project name: ${errors[0]}`;
603
510
  }
604
511
  });
605
- if (!Object.hasOwn(res, "name")) (0, import_node_process.exit)(1);
512
+ if (!Object.hasOwn(res, "name")) exit(1);
606
513
  projectName = res.name;
607
514
  }
608
515
  if (!template) {
609
- const res = await (0, import_prompts.default)({
516
+ const res = await prompts({
610
517
  name: "template",
611
518
  type: "select",
612
519
  message: "What starter code would you like to use?",
613
520
  choices: TEMPLATES
614
521
  });
615
- if (!Object.hasOwn(res, "template")) (0, import_node_process.exit)(1);
522
+ if (!Object.hasOwn(res, "template")) exit(1);
616
523
  template = TEMPLATES.find((_template) => _template.value === res.template);
617
524
  }
618
525
  let themeChoice;
619
526
  if (template.value === "tina-docs") {
620
- const res = await (0, import_prompts.default)({
527
+ const res = await prompts({
621
528
  name: "theme",
622
529
  type: "select",
623
530
  message: "What theme would you like to use?",
624
531
  choices: THEMES
625
532
  });
626
- if (!Object.hasOwn(res, "theme")) (0, import_node_process.exit)(1);
533
+ if (!Object.hasOwn(res, "theme")) exit(1);
627
534
  themeChoice = res.theme;
628
535
  }
629
536
  await telemetry.submitRecord({
@@ -633,8 +540,8 @@ async function run() {
633
540
  pkgManager
634
541
  }
635
542
  });
636
- const rootDir = import_node_path.default.join(process.cwd(), projectName);
637
- if (!await isWriteable(import_node_path.default.dirname(rootDir))) {
543
+ const rootDir = path4.join(process.cwd(), projectName);
544
+ if (!await isWriteable(path4.dirname(rootDir))) {
638
545
  spinner.fail(
639
546
  "The application path is not writable, please check folder permissions and try again. It is likely you do not have write permissions for this folder."
640
547
  );
@@ -645,7 +552,7 @@ async function run() {
645
552
  appName = await setupProjectDirectory(rootDir);
646
553
  } catch (err) {
647
554
  spinner.fail(err.message);
648
- (0, import_node_process.exit)(1);
555
+ exit(1);
649
556
  }
650
557
  try {
651
558
  await downloadTemplate(template, rootDir, spinner);
@@ -661,7 +568,7 @@ async function run() {
661
568
  spinner.succeed();
662
569
  } catch (err) {
663
570
  spinner.fail(`Failed to download template: ${err.message}`);
664
- (0, import_node_process.exit)(1);
571
+ exit(1);
665
572
  }
666
573
  spinner.start("Installing packages.");
667
574
  try {
@@ -684,7 +591,9 @@ async function run() {
684
591
  `);
685
592
  if (template.value === "tina-hugo-starter") {
686
593
  spinner.warn(
687
- `Hugo is required for this starter. Install it via ${TextStyles.link("https://gohugo.io/installation/")}
594
+ `Hugo is required for this starter. Install it via ${TextStyles.link(
595
+ "https://gohugo.io/installation/"
596
+ )}
688
597
  `
689
598
  );
690
599
  }
@@ -693,28 +602,37 @@ async function run() {
693
602
 
694
603
  ${padCommand(`cd ${appName}`)}# move into your project directory${packageManagerInstallationHadError ? `
695
604
  ${padCommand(`${pkgManager} install`)}# install dependencies` : ""}
696
- ${padCommand(`${pkgManager} run dev`)}# start the dev server ${TextStyles.link(template.devUrl)}
605
+ ${padCommand(
606
+ `${pkgManager} run dev`
607
+ )}# start the dev server ${TextStyles.link(template.devUrl)}
697
608
  ${padCommand(`${pkgManager} run build`)}# build the app for production
698
609
  `);
699
610
  console.log("Next steps:");
700
611
  console.log(
701
- ` \u2022 \u{1F4DD} Edit some content: ${TextStyles.link("https://tina.io/docs/using-tina-editor")}`
612
+ ` \u2022 \u{1F4DD} Edit some content: ${TextStyles.link(
613
+ "https://tina.io/docs/using-tina-editor"
614
+ )}`
702
615
  );
703
616
  console.log(
704
- ` \u2022 \u{1F4D6} Learn the basics: ${TextStyles.link("https://tina.io/docs/schema/")}`
617
+ ` \u2022 \u{1F4D6} Learn the basics: ${TextStyles.link(
618
+ "https://tina.io/docs/schema/"
619
+ )}`
705
620
  );
706
621
  console.log(
707
- ` \u2022 \u{1F58C}\uFE0F Extend Tina with custom field components: ${TextStyles.link("https://tina.io/docs/advanced/extending-tina/")}`
622
+ ` \u2022 \u{1F58C}\uFE0F Extend Tina with custom field components: ${TextStyles.link(
623
+ "https://tina.io/docs/advanced/extending-tina/"
624
+ )}`
708
625
  );
709
626
  console.log(
710
- ` \u2022 \u{1F680} Deploy to Production: ${TextStyles.link("https://tina.io/docs/tinacloud/")}`
627
+ ` \u2022 \u{1F680} Deploy to Production: ${TextStyles.link(
628
+ "https://tina.io/docs/tinacloud/"
629
+ )}`
711
630
  );
712
631
  }
713
632
  run().catch((error) => {
714
633
  console.error("Error running create-tina-app:", error);
715
634
  process.exit(1);
716
635
  });
717
- // Annotate the CommonJS export names for ESM import in node:
718
- 0 && (module.exports = {
636
+ export {
719
637
  run
720
- });
638
+ };
@@ -1,11 +1,10 @@
1
- import chalk from 'chalk';
2
1
  export declare const TextStyles: {
3
- tinaOrange: chalk.Chalk;
2
+ tinaOrange: import("chalk").ChalkInstance;
4
3
  link: (url: string) => string;
5
- cmd: chalk.Chalk;
6
- info: chalk.Chalk;
7
- success: chalk.Chalk;
8
- warn: chalk.Chalk;
9
- err: chalk.Chalk;
10
- bold: chalk.Chalk;
4
+ cmd: import("chalk").ChalkInstance;
5
+ info: import("chalk").ChalkInstance;
6
+ success: import("chalk").ChalkInstance;
7
+ warn: import("chalk").ChalkInstance;
8
+ err: import("chalk").ChalkInstance;
9
+ bold: import("chalk").ChalkInstance;
11
10
  };
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "create-tina-app",
3
- "version": "1.6.1",
3
+ "version": "2.0.0",
4
+ "type": "module",
4
5
  "main": "dist/index.js",
5
6
  "files": [
6
7
  "dist",
@@ -35,10 +36,10 @@
35
36
  "@types/prompts": "^2.4.9",
36
37
  "@types/tar": "6.1.13",
37
38
  "typescript": "^5.7.3",
38
- "@tinacms/scripts": "1.4.1"
39
+ "@tinacms/scripts": "1.4.2"
39
40
  },
40
41
  "dependencies": {
41
- "chalk": "4.1.2",
42
+ "chalk": "^5.4.1",
42
43
  "commander": "^12.1.0",
43
44
  "cross-spawn": "^7.0.6",
44
45
  "fs-extra": "^11.3.0",
@@ -46,7 +47,7 @@
46
47
  "prompts": "^2.4.2",
47
48
  "tar": "7.4.0",
48
49
  "validate-npm-package-name": "^5.0.1",
49
- "@tinacms/metrics": "1.1.0"
50
+ "@tinacms/metrics": "2.0.1"
50
51
  },
51
52
  "scripts": {
52
53
  "types": "pnpm tsc",