create-tina-app 0.0.0-ec43c87-20250804021103 → 0.0.0-f2577b9-20251119082459
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 +86 -11
- package/dist/templates.d.ts +1 -2
- package/dist/themes.d.ts +7 -0
- package/dist/util/fileUtil.d.ts +1 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -34,7 +34,7 @@ var require_package = __commonJS({
|
|
|
34
34
|
"package.json"(exports2, module2) {
|
|
35
35
|
module2.exports = {
|
|
36
36
|
name: "create-tina-app",
|
|
37
|
-
version: "1.
|
|
37
|
+
version: "1.6.0",
|
|
38
38
|
main: "dist/index.js",
|
|
39
39
|
files: [
|
|
40
40
|
"dist",
|
|
@@ -82,7 +82,7 @@ var require_package = __commonJS({
|
|
|
82
82
|
commander: "^12.1.0",
|
|
83
83
|
"cross-spawn": "catalog:",
|
|
84
84
|
"fs-extra": "catalog:",
|
|
85
|
-
ora: "
|
|
85
|
+
ora: "catalog:",
|
|
86
86
|
prompts: "catalog:",
|
|
87
87
|
tar: "catalog:",
|
|
88
88
|
"validate-npm-package-name": "catalog:"
|
|
@@ -188,6 +188,19 @@ function updateProjectPackageVersion(dir, version2) {
|
|
|
188
188
|
packageJson.version = version2;
|
|
189
189
|
import_fs_extra.default.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
|
|
190
190
|
}
|
|
191
|
+
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);
|
|
195
|
+
let config = {};
|
|
196
|
+
try {
|
|
197
|
+
const existingConfig = await import_fs_extra.default.readFile(configPath, "utf8");
|
|
198
|
+
config = JSON.parse(existingConfig);
|
|
199
|
+
} catch (error) {
|
|
200
|
+
}
|
|
201
|
+
config.selectedTheme = selectedTheme;
|
|
202
|
+
await import_fs_extra.default.writeFile(configPath, JSON.stringify(config, null, 2));
|
|
203
|
+
}
|
|
191
204
|
|
|
192
205
|
// src/util/install.ts
|
|
193
206
|
var import_cross_spawn = __toESM(require("cross-spawn"));
|
|
@@ -324,10 +337,18 @@ var import_path3 = __toESM(require("path"));
|
|
|
324
337
|
var TEMPLATES = [
|
|
325
338
|
{
|
|
326
339
|
title: "\u2B50 NextJS starter",
|
|
327
|
-
description: "Kickstart your project with
|
|
328
|
-
value: "tina-
|
|
340
|
+
description: "Kickstart your project with Next.js \u2013 our top recommendation for a seamless, performant, and versatile web experience.",
|
|
341
|
+
value: "tina-nextjs-starter",
|
|
342
|
+
isInternal: false,
|
|
343
|
+
gitURL: "https://github.com/tinacms/tina-nextjs-starter",
|
|
344
|
+
devUrl: "http://localhost:3000"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
title: "\u2B50\uFE0F TinaDocs",
|
|
348
|
+
description: "Get your documentation site up and running with TinaCMS and Next.js in minutes.",
|
|
349
|
+
value: "tina-docs",
|
|
329
350
|
isInternal: false,
|
|
330
|
-
gitURL: "https://github.com/tinacms/tina-
|
|
351
|
+
gitURL: "https://github.com/tinacms/tina-docs",
|
|
331
352
|
devUrl: "http://localhost:3000"
|
|
332
353
|
},
|
|
333
354
|
{
|
|
@@ -427,7 +448,6 @@ async function checkPackageExists(name2) {
|
|
|
427
448
|
|
|
428
449
|
// src/index.ts
|
|
429
450
|
var import_node_process = require("node:process");
|
|
430
|
-
var import_ora = __toESM(require("ora"));
|
|
431
451
|
|
|
432
452
|
// src/util/options.ts
|
|
433
453
|
var import_commander = require("commander");
|
|
@@ -472,8 +492,44 @@ var import_validate_npm_package_name = __toESM(require("validate-npm-package-nam
|
|
|
472
492
|
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 -==- :===- :====. ";
|
|
473
493
|
var tinaCms = "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\n\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\n \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\n \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\n \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\n \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D";
|
|
474
494
|
|
|
495
|
+
// src/themes.ts
|
|
496
|
+
var THEMES = [
|
|
497
|
+
{
|
|
498
|
+
title: "Default",
|
|
499
|
+
description: "The default monochromatic theme for your documentation site",
|
|
500
|
+
value: "default"
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
title: "Tina",
|
|
504
|
+
description: "The warm color scheme of TinaCMS for your documentation",
|
|
505
|
+
value: "tina"
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
title: "Blossom",
|
|
509
|
+
value: "blossom",
|
|
510
|
+
description: "A Blossom theme for your project"
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
title: "Lake",
|
|
514
|
+
value: "lake",
|
|
515
|
+
description: "A Lake theme for your project"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
title: "Pine",
|
|
519
|
+
value: "pine",
|
|
520
|
+
description: "A Pine theme for your project"
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
title: "Indigo",
|
|
524
|
+
value: "indigo",
|
|
525
|
+
description: "An Indigo theme for your project"
|
|
526
|
+
}
|
|
527
|
+
];
|
|
528
|
+
|
|
475
529
|
// src/index.ts
|
|
476
530
|
async function run() {
|
|
531
|
+
const ora = (await import("ora")).default;
|
|
532
|
+
let packageManagerInstallationHadError = false;
|
|
477
533
|
if (process.stdout.columns >= 60) {
|
|
478
534
|
console.log(TextStyles.tinaOrange(`${llama}`));
|
|
479
535
|
console.log(TextStyles.tinaOrange(`${tinaCms}`));
|
|
@@ -482,7 +538,7 @@ async function run() {
|
|
|
482
538
|
}
|
|
483
539
|
const version2 = require_package().version;
|
|
484
540
|
console.log(`Create Tina App v${version2}`);
|
|
485
|
-
const spinner = (
|
|
541
|
+
const spinner = ora();
|
|
486
542
|
preRunChecks(spinner);
|
|
487
543
|
const opts = extractOptions(process.argv);
|
|
488
544
|
const telemetry = new import_metrics.Telemetry({ disabled: opts?.noTelemetry });
|
|
@@ -559,6 +615,17 @@ async function run() {
|
|
|
559
615
|
if (!Object.hasOwn(res, "template")) (0, import_node_process.exit)(1);
|
|
560
616
|
template = TEMPLATES.find((_template) => _template.value === res.template);
|
|
561
617
|
}
|
|
618
|
+
let themeChoice;
|
|
619
|
+
if (template.value === "tina-docs") {
|
|
620
|
+
const res = await (0, import_prompts.default)({
|
|
621
|
+
name: "theme",
|
|
622
|
+
type: "select",
|
|
623
|
+
message: "What theme would you like to use?",
|
|
624
|
+
choices: THEMES
|
|
625
|
+
});
|
|
626
|
+
if (!Object.hasOwn(res, "theme")) (0, import_node_process.exit)(1);
|
|
627
|
+
themeChoice = res.theme;
|
|
628
|
+
}
|
|
562
629
|
await telemetry.submitRecord({
|
|
563
630
|
event: {
|
|
564
631
|
name: "create-tina-app:invoke",
|
|
@@ -581,6 +648,10 @@ async function run() {
|
|
|
581
648
|
(0, import_node_process.exit)(1);
|
|
582
649
|
}
|
|
583
650
|
try {
|
|
651
|
+
await downloadTemplate(template, rootDir, spinner);
|
|
652
|
+
if (themeChoice) {
|
|
653
|
+
await updateThemeSettings(rootDir, themeChoice);
|
|
654
|
+
}
|
|
584
655
|
spinner.start("Downloading template...");
|
|
585
656
|
await downloadTemplate(template, rootDir, spinner);
|
|
586
657
|
spinner.succeed();
|
|
@@ -598,7 +669,7 @@ async function run() {
|
|
|
598
669
|
spinner.succeed();
|
|
599
670
|
} catch (err) {
|
|
600
671
|
spinner.fail(`Failed to install packages: ${err.message}`);
|
|
601
|
-
|
|
672
|
+
packageManagerInstallationHadError = true;
|
|
602
673
|
}
|
|
603
674
|
spinner.start("Initializing git repository.");
|
|
604
675
|
try {
|
|
@@ -620,7 +691,8 @@ async function run() {
|
|
|
620
691
|
const padCommand = (cmd, width = 20) => TextStyles.cmd(cmd) + " ".repeat(Math.max(0, width - cmd.length));
|
|
621
692
|
spinner.info(`${TextStyles.bold("To get started:")}
|
|
622
693
|
|
|
623
|
-
${padCommand(`cd ${appName}`)}# move into your project directory
|
|
694
|
+
${padCommand(`cd ${appName}`)}# move into your project directory${packageManagerInstallationHadError ? `
|
|
695
|
+
${padCommand(`${pkgManager} install`)}# install dependencies` : ""}
|
|
624
696
|
${padCommand(`${pkgManager} run dev`)}# start the dev server ${TextStyles.link(template.devUrl)}
|
|
625
697
|
${padCommand(`${pkgManager} run build`)}# build the app for production
|
|
626
698
|
`);
|
|
@@ -635,10 +707,13 @@ async function run() {
|
|
|
635
707
|
` \u2022 \u{1F58C}\uFE0F Extend Tina with custom field components: ${TextStyles.link("https://tina.io/docs/advanced/extending-tina/")}`
|
|
636
708
|
);
|
|
637
709
|
console.log(
|
|
638
|
-
` \u2022 \u{1F680} Deploy to Production: ${TextStyles.link("https://tina.io/docs/
|
|
710
|
+
` \u2022 \u{1F680} Deploy to Production: ${TextStyles.link("https://tina.io/docs/tinacloud/")}`
|
|
639
711
|
);
|
|
640
712
|
}
|
|
641
|
-
run()
|
|
713
|
+
run().catch((error) => {
|
|
714
|
+
console.error("Error running create-tina-app:", error);
|
|
715
|
+
process.exit(1);
|
|
716
|
+
});
|
|
642
717
|
// Annotate the CommonJS export names for ESM import in node:
|
|
643
718
|
0 && (module.exports = {
|
|
644
719
|
run
|
package/dist/templates.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Ora } from 'ora';
|
|
2
|
-
type BaseExample = {
|
|
2
|
+
export type BaseExample = {
|
|
3
3
|
title: string;
|
|
4
4
|
description?: string;
|
|
5
5
|
value: string;
|
|
@@ -15,4 +15,3 @@ export type ExternalTemplate = BaseExample & {
|
|
|
15
15
|
export type Template = InternalTemplate | ExternalTemplate;
|
|
16
16
|
export declare const TEMPLATES: Template[];
|
|
17
17
|
export declare function downloadTemplate(template: Template, root: string, spinner: Ora): Promise<void>;
|
|
18
|
-
export {};
|
package/dist/themes.d.ts
ADDED
package/dist/util/fileUtil.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ export declare function folderContainsInstallConflicts(root: string): string[];
|
|
|
3
3
|
export declare function setupProjectDirectory(dir: string): Promise<string>;
|
|
4
4
|
export declare function updateProjectPackageName(dir: string, name: string): void;
|
|
5
5
|
export declare function updateProjectPackageVersion(dir: string, version: string): void;
|
|
6
|
+
export declare function updateThemeSettings(dir: string, selectedTheme: string): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-tina-app",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-f2577b9-20251119082459",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -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": "
|
|
38
|
+
"@tinacms/scripts": "0.0.0-f2577b9-20251119082459"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"chalk": "4.1.2",
|