create-tina-app 1.6.2 → 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,95 +1,8 @@
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 __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
- // If the importer is in node compatibility mode or this is not an ESM
20
- // file that has been converted to a CommonJS file using a Babel-
21
- // compatible transform (i.e. "__esModule" has not been set), then set
22
- // "default" to the CommonJS "module.exports" for node compatibility.
23
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
- mod
25
- ));
26
-
27
- // package.json
28
- var require_package = __commonJS({
29
- "package.json"(exports, module) {
30
- module.exports = {
31
- name: "create-tina-app",
32
- version: "1.6.2",
33
- main: "dist/index.js",
34
- files: [
35
- "dist",
36
- "examples",
37
- "bin/*"
38
- ],
39
- bin: "bin/create-tina-app",
40
- typings: "dist/index.d.ts",
41
- license: "Apache-2.0",
42
- buildConfig: {
43
- entryPoints: [
44
- {
45
- name: "src/index.ts",
46
- target: "node"
47
- }
48
- ]
49
- },
50
- engines: {
51
- node: ">=18.18.0"
52
- },
53
- scripts: {
54
- types: "pnpm tsc",
55
- build: "tinacms-scripts build",
56
- "test-run-bin": "pnpm create-tina-app"
57
- },
58
- publishConfig: {
59
- registry: "https://registry.npmjs.org"
60
- },
61
- repository: {
62
- url: "https://github.com/tinacms/tinacms.git",
63
- directory: "packages/create-tina-app"
64
- },
65
- devDependencies: {
66
- "@tinacms/scripts": "workspace:*",
67
- "@types/cross-spawn": "catalog:",
68
- "@types/fs-extra": "^11.0.4",
69
- "@types/node": "^22.13.1",
70
- "@types/prompts": "catalog:",
71
- "@types/tar": "catalog:",
72
- typescript: "^5.7.3"
73
- },
74
- dependencies: {
75
- "@tinacms/metrics": "workspace:*",
76
- chalk: "4.1.2",
77
- commander: "^12.1.0",
78
- "cross-spawn": "catalog:",
79
- "fs-extra": "catalog:",
80
- ora: "catalog:",
81
- prompts: "catalog:",
82
- tar: "catalog:",
83
- "validate-npm-package-name": "catalog:"
84
- }
85
- };
86
- }
87
- });
88
-
89
1
  // src/index.ts
90
2
  import { Telemetry } from "@tinacms/metrics";
91
3
  import prompts from "prompts";
92
4
  import path4 from "node:path";
5
+ import { createRequire } from "node:module";
93
6
 
94
7
  // src/util/fileUtil.ts
95
8
  import fs from "fs-extra";
@@ -440,17 +353,20 @@ async function checkPackageExists(name2) {
440
353
  import { exit } from "node:process";
441
354
 
442
355
  // src/util/options.ts
443
- var import_package = __toESM(require_package());
444
356
  import { Command } from "commander";
445
357
 
358
+ // package.json
359
+ var name = "create-tina-app";
360
+ var version = "2.0.0";
361
+
446
362
  // src/util/packageManagers.ts
447
363
  var PKG_MANAGERS = ["npm", "yarn", "pnpm", "bun"];
448
364
 
449
365
  // src/util/options.ts
450
366
  function extractOptions(args) {
451
367
  let projectName = "";
452
- const program = new Command(import_package.name);
453
- program.version(import_package.version).option(
368
+ const program = new Command(name);
369
+ program.version(version).option(
454
370
  "-t, --template <template>",
455
371
  `Choose which template to start from. Valid templates are: ${TEMPLATES.map(
456
372
  (x2) => x2.value
@@ -526,7 +442,8 @@ async function run() {
526
442
  } else {
527
443
  console.log(TextStyles.tinaOrange(`\u{1F999} TinaCMS`));
528
444
  }
529
- const version2 = require_package().version;
445
+ const require2 = createRequire(import.meta.url);
446
+ const version2 = require2("../package.json").version;
530
447
  console.log(`Create Tina App v${version2}`);
531
448
  const spinner = ora();
532
449
  preRunChecks(spinner);
@@ -674,7 +591,9 @@ async function run() {
674
591
  `);
675
592
  if (template.value === "tina-hugo-starter") {
676
593
  spinner.warn(
677
- `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
+ )}
678
597
  `
679
598
  );
680
599
  }
@@ -683,21 +602,31 @@ async function run() {
683
602
 
684
603
  ${padCommand(`cd ${appName}`)}# move into your project directory${packageManagerInstallationHadError ? `
685
604
  ${padCommand(`${pkgManager} install`)}# install dependencies` : ""}
686
- ${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)}
687
608
  ${padCommand(`${pkgManager} run build`)}# build the app for production
688
609
  `);
689
610
  console.log("Next steps:");
690
611
  console.log(
691
- ` \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
+ )}`
692
615
  );
693
616
  console.log(
694
- ` \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
+ )}`
695
620
  );
696
621
  console.log(
697
- ` \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
+ )}`
698
625
  );
699
626
  console.log(
700
- ` \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
+ )}`
701
630
  );
702
631
  }
703
632
  run().catch((error) => {
@@ -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.2",
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": "2.0.0"
50
+ "@tinacms/metrics": "2.0.1"
50
51
  },
51
52
  "scripts": {
52
53
  "types": "pnpm tsc",