@tinacms/cli 1.5.52 → 1.6.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 +87 -68
- package/dist/next/vite/tailwind.d.ts +1 -1
- package/package.json +8 -10
package/dist/index.js
CHANGED
|
@@ -31,12 +31,12 @@ module.exports = __toCommonJS(src_exports);
|
|
|
31
31
|
var import_clipanion8 = require("clipanion");
|
|
32
32
|
|
|
33
33
|
// package.json
|
|
34
|
-
var version = "1.
|
|
34
|
+
var version = "1.6.0";
|
|
35
35
|
|
|
36
36
|
// src/next/commands/dev-command/index.ts
|
|
37
37
|
var import_clipanion2 = require("clipanion");
|
|
38
38
|
var import_fs_extra6 = __toESM(require("fs-extra"));
|
|
39
|
-
var
|
|
39
|
+
var import_path6 = __toESM(require("path"));
|
|
40
40
|
var import_chokidar = __toESM(require("chokidar"));
|
|
41
41
|
var import_graphql10 = require("@tinacms/graphql");
|
|
42
42
|
|
|
@@ -607,7 +607,7 @@ var CONFIRMATION_TEXT = import_chalk3.default.dim("enter to confirm");
|
|
|
607
607
|
var import_vite3 = require("vite");
|
|
608
608
|
|
|
609
609
|
// src/next/vite/index.ts
|
|
610
|
-
var
|
|
610
|
+
var import_path2 = __toESM(require("path"));
|
|
611
611
|
var import_fs_extra2 = __toESM(require("fs-extra"));
|
|
612
612
|
var import_vite = require("vite");
|
|
613
613
|
var import_plugin_react = __toESM(require("@vitejs/plugin-react"));
|
|
@@ -617,14 +617,14 @@ var import_tailwindcss = __toESM(require("tailwindcss"));
|
|
|
617
617
|
var import_defaultTheme = __toESM(require("tailwindcss/defaultTheme.js"));
|
|
618
618
|
var import_typography = __toESM(require("@tailwindcss/typography"));
|
|
619
619
|
var import_aspect_ratio = __toESM(require("@tailwindcss/aspect-ratio"));
|
|
620
|
-
var
|
|
620
|
+
var import_node_path = __toESM(require("path"));
|
|
621
621
|
var tinaTailwind = (spaPath, prebuildFilePath) => {
|
|
622
622
|
return {
|
|
623
623
|
name: "vite-plugin-tina",
|
|
624
624
|
config: (viteConfig) => {
|
|
625
625
|
const plugins = [];
|
|
626
626
|
const content = [
|
|
627
|
-
|
|
627
|
+
import_node_path.default.join(spaPath, "src/**/*.{vue,js,ts,jsx,tsx,svelte}"),
|
|
628
628
|
prebuildFilePath,
|
|
629
629
|
require.resolve("tinacms")
|
|
630
630
|
];
|
|
@@ -815,7 +815,26 @@ var tinaTailwind = (spaPath, prebuildFilePath) => {
|
|
|
815
815
|
400: "#EB6337",
|
|
816
816
|
500: "#EC4815",
|
|
817
817
|
600: "#DC4419"
|
|
818
|
-
}
|
|
818
|
+
},
|
|
819
|
+
background: "#FFFFFF",
|
|
820
|
+
foreground: "#0A0A0A",
|
|
821
|
+
muted: "#F5F5F5",
|
|
822
|
+
"muted-foreground": "#737373",
|
|
823
|
+
popover: "#FFFFFF",
|
|
824
|
+
"popover-foreground": "#0A0A0A",
|
|
825
|
+
card: "#FFFFFF",
|
|
826
|
+
"card-foreground": "#0A0A0A",
|
|
827
|
+
border: "#E5E5E5",
|
|
828
|
+
input: "#E5E5E5",
|
|
829
|
+
primary: "#171717",
|
|
830
|
+
"primary-foreground": "#FAFAFA",
|
|
831
|
+
secondary: "#F5F5F5",
|
|
832
|
+
"secondary-foreground": "#171717",
|
|
833
|
+
accent: "#F5F5F5",
|
|
834
|
+
"accent-foreground": "#171717",
|
|
835
|
+
destructive: "#FF3B3B",
|
|
836
|
+
"destructive-foreground": "#FAFAFA",
|
|
837
|
+
ring: "#0A0A0A"
|
|
819
838
|
},
|
|
820
839
|
fontFamily: {
|
|
821
840
|
sans: ["Inter", ...import_defaultTheme.default.fontFamily.sans]
|
|
@@ -863,7 +882,7 @@ async function listFilesRecursively({
|
|
|
863
882
|
config: config2,
|
|
864
883
|
roothPath
|
|
865
884
|
}) {
|
|
866
|
-
const fullDirectoryPath =
|
|
885
|
+
const fullDirectoryPath = import_path2.default.join(
|
|
867
886
|
roothPath,
|
|
868
887
|
config2.publicFolder,
|
|
869
888
|
directoryPath
|
|
@@ -875,23 +894,23 @@ async function listFilesRecursively({
|
|
|
875
894
|
const items = await import_fs_extra2.default.readdir(fullDirectoryPath);
|
|
876
895
|
const staticMediaItems = [];
|
|
877
896
|
for (const item of items) {
|
|
878
|
-
const itemPath =
|
|
897
|
+
const itemPath = import_path2.default.join(fullDirectoryPath, item);
|
|
879
898
|
const stats = await import_fs_extra2.default.promises.lstat(itemPath);
|
|
880
899
|
const staticMediaItem = {
|
|
881
900
|
id: item,
|
|
882
901
|
filename: item,
|
|
883
902
|
type: stats.isDirectory() ? "dir" : "file",
|
|
884
903
|
directory: `${directoryPath.replace(config2.mediaRoot, "")}`,
|
|
885
|
-
src: `/${
|
|
904
|
+
src: `/${import_path2.default.join(directoryPath, item)}`,
|
|
886
905
|
thumbnails: {
|
|
887
|
-
"75x75": `/${
|
|
888
|
-
"400x400": `/${
|
|
889
|
-
"1000x1000": `/${
|
|
906
|
+
"75x75": `/${import_path2.default.join(directoryPath, item)}`,
|
|
907
|
+
"400x400": `/${import_path2.default.join(directoryPath, item)}`,
|
|
908
|
+
"1000x1000": `/${import_path2.default.join(directoryPath, item)}`
|
|
890
909
|
}
|
|
891
910
|
};
|
|
892
911
|
if (stats.isDirectory()) {
|
|
893
912
|
staticMediaItem.children = await listFilesRecursively({
|
|
894
|
-
directoryPath:
|
|
913
|
+
directoryPath: import_path2.default.join(directoryPath, item),
|
|
895
914
|
config: config2,
|
|
896
915
|
roothPath
|
|
897
916
|
});
|
|
@@ -934,7 +953,7 @@ var createConfig = async ({
|
|
|
934
953
|
}
|
|
935
954
|
}
|
|
936
955
|
});
|
|
937
|
-
const staticMediaPath =
|
|
956
|
+
const staticMediaPath = import_path2.default.join(
|
|
938
957
|
configManager.generatedFolderPath,
|
|
939
958
|
"static-media.json"
|
|
940
959
|
);
|
|
@@ -954,7 +973,7 @@ var createConfig = async ({
|
|
|
954
973
|
STATIC_MEDIA_IMPORT: staticMediaPath
|
|
955
974
|
};
|
|
956
975
|
if (configManager.shouldSkipSDK()) {
|
|
957
|
-
alias["CLIENT_IMPORT"] =
|
|
976
|
+
alias["CLIENT_IMPORT"] = import_path2.default.join(
|
|
958
977
|
configManager.spaRootPath,
|
|
959
978
|
"src",
|
|
960
979
|
"dummy-client.ts"
|
|
@@ -1026,17 +1045,17 @@ var import_pluginutils = require("@rollup/pluginutils");
|
|
|
1026
1045
|
var import_fs = __toESM(require("fs"));
|
|
1027
1046
|
var import_vite2 = require("vite");
|
|
1028
1047
|
var import_esbuild = require("esbuild");
|
|
1029
|
-
var
|
|
1048
|
+
var import_path4 = __toESM(require("path"));
|
|
1030
1049
|
var import_body_parser = __toESM(require("body-parser"));
|
|
1031
1050
|
var import_cors = __toESM(require("cors"));
|
|
1032
1051
|
var import_graphql = require("@tinacms/graphql");
|
|
1033
1052
|
|
|
1034
1053
|
// src/next/commands/dev-command/server/media.ts
|
|
1035
1054
|
var import_fs_extra3 = __toESM(require("fs-extra"));
|
|
1036
|
-
var
|
|
1055
|
+
var import_path3 = __toESM(require("path"));
|
|
1037
1056
|
var import_busboy = __toESM(require("busboy"));
|
|
1038
1057
|
var createMediaRouter = (config2) => {
|
|
1039
|
-
const mediaFolder =
|
|
1058
|
+
const mediaFolder = import_path3.default.join(
|
|
1040
1059
|
config2.rootPath,
|
|
1041
1060
|
config2.publicFolder,
|
|
1042
1061
|
config2.mediaRoot
|
|
@@ -1064,8 +1083,8 @@ var createMediaRouter = (config2) => {
|
|
|
1064
1083
|
bb.on("file", async (_name, file, _info) => {
|
|
1065
1084
|
var _a;
|
|
1066
1085
|
const fullPath = decodeURI((_a = req.url) == null ? void 0 : _a.slice("/media/upload/".length));
|
|
1067
|
-
const saveTo =
|
|
1068
|
-
await import_fs_extra3.default.ensureDir(
|
|
1086
|
+
const saveTo = import_path3.default.join(mediaFolder, ...fullPath.split("/"));
|
|
1087
|
+
await import_fs_extra3.default.ensureDir(import_path3.default.dirname(saveTo));
|
|
1069
1088
|
file.pipe(import_fs_extra3.default.createWriteStream(saveTo));
|
|
1070
1089
|
});
|
|
1071
1090
|
bb.on("error", (error) => {
|
|
@@ -1100,7 +1119,7 @@ var MediaModel = class {
|
|
|
1100
1119
|
}
|
|
1101
1120
|
async listMedia(args) {
|
|
1102
1121
|
try {
|
|
1103
|
-
const folderPath = (0,
|
|
1122
|
+
const folderPath = (0, import_path3.join)(
|
|
1104
1123
|
this.rootPath,
|
|
1105
1124
|
this.publicFolder,
|
|
1106
1125
|
this.mediaRoot,
|
|
@@ -1115,7 +1134,7 @@ var MediaModel = class {
|
|
|
1115
1134
|
}
|
|
1116
1135
|
const filesStr = await import_fs_extra3.default.readdir(folderPath);
|
|
1117
1136
|
const filesProm = filesStr.map(async (file) => {
|
|
1118
|
-
const filePath = (0,
|
|
1137
|
+
const filePath = (0, import_path3.join)(folderPath, file);
|
|
1119
1138
|
const stat = await import_fs_extra3.default.stat(filePath);
|
|
1120
1139
|
let src = `/${file}`;
|
|
1121
1140
|
const isFile = stat.isFile();
|
|
@@ -1172,7 +1191,7 @@ var MediaModel = class {
|
|
|
1172
1191
|
}
|
|
1173
1192
|
async deleteMedia(args) {
|
|
1174
1193
|
try {
|
|
1175
|
-
const file = (0,
|
|
1194
|
+
const file = (0, import_path3.join)(
|
|
1176
1195
|
this.rootPath,
|
|
1177
1196
|
this.publicFolder,
|
|
1178
1197
|
this.mediaRoot,
|
|
@@ -1237,7 +1256,7 @@ var transformTsxPlugin = ({
|
|
|
1237
1256
|
const plug = {
|
|
1238
1257
|
name: "transform-tsx",
|
|
1239
1258
|
async transform(code, id) {
|
|
1240
|
-
const extName =
|
|
1259
|
+
const extName = import_path4.default.extname(id);
|
|
1241
1260
|
if (extName.startsWith(".tsx") || extName.startsWith(".ts")) {
|
|
1242
1261
|
const result = await (0, import_esbuild.transform)(code, { loader: "tsx" });
|
|
1243
1262
|
return {
|
|
@@ -1383,7 +1402,7 @@ var createDevServer = async (configManager, database, searchIndex, apiURL, noWat
|
|
|
1383
1402
|
|
|
1384
1403
|
// src/next/codegen/index.ts
|
|
1385
1404
|
var import_fs_extra4 = __toESM(require("fs-extra"));
|
|
1386
|
-
var
|
|
1405
|
+
var import_path5 = __toESM(require("path"));
|
|
1387
1406
|
var import_graphql6 = require("graphql");
|
|
1388
1407
|
|
|
1389
1408
|
// src/next/codegen/codegen/index.ts
|
|
@@ -1626,11 +1645,11 @@ var Codegen = class {
|
|
|
1626
1645
|
this.lookup = lookup;
|
|
1627
1646
|
}
|
|
1628
1647
|
async writeConfigFile(fileName, data) {
|
|
1629
|
-
const filePath =
|
|
1648
|
+
const filePath = import_path5.default.join(this.configManager.generatedFolderPath, fileName);
|
|
1630
1649
|
await import_fs_extra4.default.ensureFile(filePath);
|
|
1631
1650
|
await import_fs_extra4.default.outputFile(filePath, data);
|
|
1632
1651
|
if (this.configManager.hasSeparateContentRoot()) {
|
|
1633
|
-
const filePath2 =
|
|
1652
|
+
const filePath2 = import_path5.default.join(
|
|
1634
1653
|
this.configManager.generatedFolderPathContentRepo,
|
|
1635
1654
|
fileName
|
|
1636
1655
|
);
|
|
@@ -2277,14 +2296,14 @@ var DevCommand = class extends BaseCommand {
|
|
|
2277
2296
|
graphql: graphqlSchemaObject
|
|
2278
2297
|
});
|
|
2279
2298
|
import_fs_extra6.default.writeFileSync(
|
|
2280
|
-
|
|
2299
|
+
import_path6.default.join(configManager.tinaFolderPath, tinaLockFilename),
|
|
2281
2300
|
tinaLockContent
|
|
2282
2301
|
);
|
|
2283
2302
|
if (configManager.hasSeparateContentRoot()) {
|
|
2284
2303
|
const rootPath = await configManager.getTinaFolderPath(
|
|
2285
2304
|
configManager.contentRootPath
|
|
2286
2305
|
);
|
|
2287
|
-
const filePath =
|
|
2306
|
+
const filePath = import_path6.default.join(rootPath, tinaLockFilename);
|
|
2288
2307
|
await import_fs_extra6.default.ensureFile(filePath);
|
|
2289
2308
|
await import_fs_extra6.default.outputFile(filePath, tinaLockContent);
|
|
2290
2309
|
}
|
|
@@ -2431,7 +2450,7 @@ ${dangerText(e.message)}
|
|
|
2431
2450
|
watchContentFiles(configManager, database, searchIndexer) {
|
|
2432
2451
|
const collectionContentFiles = [];
|
|
2433
2452
|
configManager.config.schema.collections.forEach((collection) => {
|
|
2434
|
-
const collectionGlob = `${
|
|
2453
|
+
const collectionGlob = `${import_path6.default.join(
|
|
2435
2454
|
configManager.contentRootPath,
|
|
2436
2455
|
collection.path
|
|
2437
2456
|
)}/**/*.${collection.format || "md"}`;
|
|
@@ -3409,25 +3428,25 @@ var import_clipanion6 = require("clipanion");
|
|
|
3409
3428
|
|
|
3410
3429
|
// src/cmds/init/detectEnvironment.ts
|
|
3411
3430
|
var import_fs_extra8 = __toESM(require("fs-extra"));
|
|
3412
|
-
var
|
|
3431
|
+
var import_path7 = __toESM(require("path"));
|
|
3413
3432
|
var checkGitignoreForItem = async ({
|
|
3414
3433
|
baseDir,
|
|
3415
3434
|
line
|
|
3416
3435
|
}) => {
|
|
3417
|
-
const gitignoreContent = import_fs_extra8.default.readFileSync(
|
|
3436
|
+
const gitignoreContent = import_fs_extra8.default.readFileSync(import_path7.default.join(baseDir, ".gitignore")).toString();
|
|
3418
3437
|
return gitignoreContent.split("\n").some((item) => item === line);
|
|
3419
3438
|
};
|
|
3420
3439
|
var makeGeneratedFile = async (name2, generatedFileType, parentPath, opts) => {
|
|
3421
3440
|
const result = {
|
|
3422
|
-
fullPathTS:
|
|
3441
|
+
fullPathTS: import_path7.default.join(
|
|
3423
3442
|
parentPath,
|
|
3424
3443
|
`${name2}.${(opts == null ? void 0 : opts.typescriptSuffix) || (opts == null ? void 0 : opts.extensionOverride) || "ts"}`
|
|
3425
3444
|
),
|
|
3426
|
-
fullPathJS:
|
|
3445
|
+
fullPathJS: import_path7.default.join(
|
|
3427
3446
|
parentPath,
|
|
3428
3447
|
`${name2}.${(opts == null ? void 0 : opts.extensionOverride) || "js"}`
|
|
3429
3448
|
),
|
|
3430
|
-
fullPathOverride: (opts == null ? void 0 : opts.extensionOverride) ?
|
|
3449
|
+
fullPathOverride: (opts == null ? void 0 : opts.extensionOverride) ? import_path7.default.join(parentPath, `${name2}.${opts == null ? void 0 : opts.extensionOverride}`) : "",
|
|
3431
3450
|
generatedFileType,
|
|
3432
3451
|
name: name2,
|
|
3433
3452
|
parentPath,
|
|
@@ -3457,16 +3476,16 @@ var detectEnvironment = async ({
|
|
|
3457
3476
|
}) => {
|
|
3458
3477
|
var _a;
|
|
3459
3478
|
const hasForestryConfig = await import_fs_extra8.default.pathExists(
|
|
3460
|
-
|
|
3479
|
+
import_path7.default.join(pathToForestryConfig, ".forestry", "settings.yml")
|
|
3461
3480
|
);
|
|
3462
|
-
const sampleContentPath =
|
|
3481
|
+
const sampleContentPath = import_path7.default.join(
|
|
3463
3482
|
baseDir,
|
|
3464
3483
|
"content",
|
|
3465
3484
|
"posts",
|
|
3466
3485
|
"hello-world.md"
|
|
3467
3486
|
);
|
|
3468
|
-
const usingSrc = import_fs_extra8.default.pathExistsSync(
|
|
3469
|
-
const tinaFolder =
|
|
3487
|
+
const usingSrc = import_fs_extra8.default.pathExistsSync(import_path7.default.join(baseDir, "src")) && (import_fs_extra8.default.pathExistsSync(import_path7.default.join(baseDir, "src", "app")) || import_fs_extra8.default.pathExistsSync(import_path7.default.join(baseDir, "src", "pages")));
|
|
3488
|
+
const tinaFolder = import_path7.default.join(baseDir, "tina");
|
|
3470
3489
|
const tinaConfigExists = Boolean(
|
|
3471
3490
|
await import_fs_extra8.default.pathExists(tinaFolder) && (await import_fs_extra8.default.readdir(tinaFolder)).find((x) => x.includes("config"))
|
|
3472
3491
|
);
|
|
@@ -3480,12 +3499,12 @@ var detectEnvironment = async ({
|
|
|
3480
3499
|
"next-api-handler": await makeGeneratedFile(
|
|
3481
3500
|
"[...routes]",
|
|
3482
3501
|
"next-api-handler",
|
|
3483
|
-
|
|
3502
|
+
import_path7.default.join(...pagesDir, "api", "tina")
|
|
3484
3503
|
),
|
|
3485
3504
|
"reactive-example": await makeGeneratedFile(
|
|
3486
3505
|
"[filename]",
|
|
3487
3506
|
"reactive-example",
|
|
3488
|
-
|
|
3507
|
+
import_path7.default.join(...pagesDir, "demo", "blog"),
|
|
3489
3508
|
{
|
|
3490
3509
|
typescriptSuffix: "tsx"
|
|
3491
3510
|
}
|
|
@@ -3493,13 +3512,13 @@ var detectEnvironment = async ({
|
|
|
3493
3512
|
"users-json": await makeGeneratedFile(
|
|
3494
3513
|
"index",
|
|
3495
3514
|
"users-json",
|
|
3496
|
-
|
|
3515
|
+
import_path7.default.join(baseDir, "content", "users"),
|
|
3497
3516
|
{ extensionOverride: "json" }
|
|
3498
3517
|
),
|
|
3499
3518
|
"sample-content": await makeGeneratedFile(
|
|
3500
3519
|
"hello-world",
|
|
3501
3520
|
"sample-content",
|
|
3502
|
-
|
|
3521
|
+
import_path7.default.join(baseDir, "content", "posts"),
|
|
3503
3522
|
{ extensionOverride: "md" }
|
|
3504
3523
|
)
|
|
3505
3524
|
};
|
|
@@ -3525,13 +3544,13 @@ var detectEnvironment = async ({
|
|
|
3525
3544
|
);
|
|
3526
3545
|
}
|
|
3527
3546
|
}
|
|
3528
|
-
const hasGitIgnore = await import_fs_extra8.default.pathExists(
|
|
3547
|
+
const hasGitIgnore = await import_fs_extra8.default.pathExists(import_path7.default.join(".gitignore"));
|
|
3529
3548
|
const hasGitIgnoreNodeModules = hasGitIgnore && await checkGitignoreForItem({ baseDir, line: "node_modules" });
|
|
3530
3549
|
const hasEnvTina = hasGitIgnore && await checkGitignoreForItem({ baseDir, line: ".env.tina" });
|
|
3531
3550
|
const hasGitIgnoreEnv = hasGitIgnore && await checkGitignoreForItem({ baseDir, line: ".env" });
|
|
3532
3551
|
let frontMatterFormat;
|
|
3533
3552
|
if (hasForestryConfig) {
|
|
3534
|
-
const hugoConfigPath =
|
|
3553
|
+
const hugoConfigPath = import_path7.default.join(rootPath, "config.toml");
|
|
3535
3554
|
if (await import_fs_extra8.default.pathExists(hugoConfigPath)) {
|
|
3536
3555
|
const hugoConfig = await import_fs_extra8.default.readFile(hugoConfigPath, "utf8");
|
|
3537
3556
|
const metaDataFormat = (_a = hugoConfig.match(/metaDataFormat = "(.*)"/)) == null ? void 0 : _a[1];
|
|
@@ -4139,18 +4158,18 @@ var CLICommand = class {
|
|
|
4139
4158
|
};
|
|
4140
4159
|
|
|
4141
4160
|
// src/cmds/init/apply.ts
|
|
4142
|
-
var
|
|
4161
|
+
var import_path11 = __toESM(require("path"));
|
|
4143
4162
|
|
|
4144
4163
|
// src/cmds/forestry-migrate/index.ts
|
|
4145
4164
|
var import_fs_extra10 = __toESM(require("fs-extra"));
|
|
4146
|
-
var
|
|
4165
|
+
var import_path9 = __toESM(require("path"));
|
|
4147
4166
|
var import_js_yaml2 = __toESM(require("js-yaml"));
|
|
4148
4167
|
var import_minimatch = __toESM(require("minimatch"));
|
|
4149
4168
|
var import_graphql16 = require("@tinacms/graphql");
|
|
4150
4169
|
|
|
4151
4170
|
// src/cmds/forestry-migrate/util/index.ts
|
|
4152
4171
|
var import_fs_extra9 = __toESM(require("fs-extra"));
|
|
4153
|
-
var
|
|
4172
|
+
var import_path8 = __toESM(require("path"));
|
|
4154
4173
|
var import_js_yaml = __toESM(require("js-yaml"));
|
|
4155
4174
|
var import_zod = __toESM(require("zod"));
|
|
4156
4175
|
|
|
@@ -4561,7 +4580,7 @@ var transformForestryFieldsToTinaFields = ({
|
|
|
4561
4580
|
return tinaFields;
|
|
4562
4581
|
};
|
|
4563
4582
|
var getFieldsFromTemplates = ({ tem, pathToForestryConfig, skipBlocks = false }) => {
|
|
4564
|
-
const templatePath =
|
|
4583
|
+
const templatePath = import_path8.default.join(
|
|
4565
4584
|
pathToForestryConfig,
|
|
4566
4585
|
".forestry",
|
|
4567
4586
|
"front_matter",
|
|
@@ -4636,8 +4655,8 @@ var generateAllTemplates = async ({
|
|
|
4636
4655
|
pathToForestryConfig
|
|
4637
4656
|
}) => {
|
|
4638
4657
|
const allTemplates = (await import_fs_extra10.default.readdir(
|
|
4639
|
-
|
|
4640
|
-
)).map((tem) =>
|
|
4658
|
+
import_path9.default.join(pathToForestryConfig, ".forestry", "front_matter", "templates")
|
|
4659
|
+
)).map((tem) => import_path9.default.basename(tem, ".yml"));
|
|
4641
4660
|
const templateMap = /* @__PURE__ */ new Map();
|
|
4642
4661
|
const proms = allTemplates.map(async (tem) => {
|
|
4643
4662
|
try {
|
|
@@ -4779,9 +4798,9 @@ var generateCollectionFromForestrySection = (args) => {
|
|
|
4779
4798
|
return c;
|
|
4780
4799
|
} else if (section.type === "document") {
|
|
4781
4800
|
const filePath = section.path;
|
|
4782
|
-
const extname =
|
|
4783
|
-
const fileName =
|
|
4784
|
-
const dir =
|
|
4801
|
+
const extname = import_path9.default.extname(filePath);
|
|
4802
|
+
const fileName = import_path9.default.basename(filePath, extname);
|
|
4803
|
+
const dir = import_path9.default.dirname(filePath);
|
|
4785
4804
|
const ext = checkExt(extname);
|
|
4786
4805
|
if (ext) {
|
|
4787
4806
|
const fields = [];
|
|
@@ -4844,7 +4863,7 @@ var generateCollections = async ({
|
|
|
4844
4863
|
usingTypescript
|
|
4845
4864
|
});
|
|
4846
4865
|
const forestryConfig = await import_fs_extra10.default.readFile(
|
|
4847
|
-
|
|
4866
|
+
import_path9.default.join(pathToForestryConfig, ".forestry", "settings.yml")
|
|
4848
4867
|
);
|
|
4849
4868
|
rewriteTemplateKeysInDocs({
|
|
4850
4869
|
templateMap,
|
|
@@ -4875,11 +4894,11 @@ var rewriteTemplateKeysInDocs = (args) => {
|
|
|
4875
4894
|
const { templateObj } = templateMap.get(templateKey);
|
|
4876
4895
|
(_a = templateObj == null ? void 0 : templateObj.pages) == null ? void 0 : _a.forEach((page) => {
|
|
4877
4896
|
try {
|
|
4878
|
-
const filePath =
|
|
4897
|
+
const filePath = import_path9.default.join(page);
|
|
4879
4898
|
if (import_fs_extra10.default.lstatSync(filePath).isDirectory()) {
|
|
4880
4899
|
return;
|
|
4881
4900
|
}
|
|
4882
|
-
const extname =
|
|
4901
|
+
const extname = import_path9.default.extname(filePath);
|
|
4883
4902
|
const fileContent = import_fs_extra10.default.readFileSync(filePath).toString();
|
|
4884
4903
|
const content = (0, import_graphql16.parseFile)(
|
|
4885
4904
|
fileContent,
|
|
@@ -4911,7 +4930,7 @@ var import_fs_extra13 = __toESM(require("fs-extra"));
|
|
|
4911
4930
|
// src/next/commands/codemod-command/index.ts
|
|
4912
4931
|
var import_clipanion5 = require("clipanion");
|
|
4913
4932
|
var import_fs_extra11 = __toESM(require("fs-extra"));
|
|
4914
|
-
var
|
|
4933
|
+
var import_path10 = __toESM(require("path"));
|
|
4915
4934
|
var CodemodCommand = class extends import_clipanion5.Command {
|
|
4916
4935
|
constructor() {
|
|
4917
4936
|
super(...arguments);
|
|
@@ -4955,7 +4974,7 @@ var moveTinaFolder = async (rootPath = process.cwd()) => {
|
|
|
4955
4974
|
logger.error(e.message);
|
|
4956
4975
|
process.exit(1);
|
|
4957
4976
|
}
|
|
4958
|
-
const tinaDestination =
|
|
4977
|
+
const tinaDestination = import_path10.default.join(configManager.rootPath, "tina");
|
|
4959
4978
|
if (await import_fs_extra11.default.existsSync(tinaDestination)) {
|
|
4960
4979
|
logger.info(
|
|
4961
4980
|
`Folder already exists at ${tinaDestination}. Either delete this folder to complete the codemod, or ensure you have properly copied your config from the ".tina" folder.`
|
|
@@ -4970,7 +4989,7 @@ var moveTinaFolder = async (rootPath = process.cwd()) => {
|
|
|
4970
4989
|
};
|
|
4971
4990
|
var writeGitignore = async (rootPath) => {
|
|
4972
4991
|
await import_fs_extra11.default.outputFileSync(
|
|
4973
|
-
|
|
4992
|
+
import_path10.default.join(rootPath, "tina", ".gitignore"),
|
|
4974
4993
|
"__generated__"
|
|
4975
4994
|
);
|
|
4976
4995
|
};
|
|
@@ -5806,8 +5825,8 @@ async function apply({
|
|
|
5806
5825
|
await addConfigFile({
|
|
5807
5826
|
configArgs: {
|
|
5808
5827
|
config: config2,
|
|
5809
|
-
publicFolder:
|
|
5810
|
-
|
|
5828
|
+
publicFolder: import_path11.default.join(
|
|
5829
|
+
import_path11.default.relative(process.cwd(), pathToForestryConfig),
|
|
5811
5830
|
config2.publicFolder
|
|
5812
5831
|
),
|
|
5813
5832
|
collections,
|
|
@@ -5874,18 +5893,18 @@ var createPackageJSON = async () => {
|
|
|
5874
5893
|
};
|
|
5875
5894
|
var createGitignore = async ({ baseDir }) => {
|
|
5876
5895
|
logger.info(logText("No .gitignore found, creating one"));
|
|
5877
|
-
import_fs_extra13.default.outputFileSync(
|
|
5896
|
+
import_fs_extra13.default.outputFileSync(import_path11.default.join(baseDir, ".gitignore"), "node_modules");
|
|
5878
5897
|
};
|
|
5879
5898
|
var updateGitIgnore = async ({
|
|
5880
5899
|
baseDir,
|
|
5881
5900
|
items
|
|
5882
5901
|
}) => {
|
|
5883
5902
|
logger.info(logText(`Adding ${items.join(",")} to .gitignore`));
|
|
5884
|
-
const gitignoreContent = import_fs_extra13.default.readFileSync(
|
|
5903
|
+
const gitignoreContent = import_fs_extra13.default.readFileSync(import_path11.default.join(baseDir, ".gitignore")).toString();
|
|
5885
5904
|
const newGitignoreContent = [...gitignoreContent.split("\n"), ...items].join(
|
|
5886
5905
|
"\n"
|
|
5887
5906
|
);
|
|
5888
|
-
await import_fs_extra13.default.writeFile(
|
|
5907
|
+
await import_fs_extra13.default.writeFile(import_path11.default.join(baseDir, ".gitignore"), newGitignoreContent);
|
|
5889
5908
|
};
|
|
5890
5909
|
var addDependencies = async (config2, env, params) => {
|
|
5891
5910
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
@@ -6053,7 +6072,7 @@ var addContentFile = async ({
|
|
|
6053
6072
|
return () => ({
|
|
6054
6073
|
exists: env.sampleContentExists,
|
|
6055
6074
|
path: env.sampleContentPath,
|
|
6056
|
-
parentPath:
|
|
6075
|
+
parentPath: import_path11.default.dirname(env.sampleContentPath)
|
|
6057
6076
|
});
|
|
6058
6077
|
}
|
|
6059
6078
|
},
|
|
@@ -6076,7 +6095,7 @@ ${titleText(" TinaCMS ")} backend initialized!`));
|
|
|
6076
6095
|
return `${x.key}=${x.value || "***"}`;
|
|
6077
6096
|
}).join("\n") + `
|
|
6078
6097
|
TINA_PUBLIC_IS_LOCAL=true`;
|
|
6079
|
-
const envFile =
|
|
6098
|
+
const envFile = import_path11.default.join(process.cwd(), ".env");
|
|
6080
6099
|
if (!import_fs_extra13.default.existsSync(envFile)) {
|
|
6081
6100
|
logger.info(`Adding .env file to your project... \u2705`);
|
|
6082
6101
|
import_fs_extra13.default.writeFileSync(envFile, envFileText);
|
|
@@ -6140,7 +6159,7 @@ var addReactiveFile = {
|
|
|
6140
6159
|
dataLayer
|
|
6141
6160
|
}) => {
|
|
6142
6161
|
var _a, _b;
|
|
6143
|
-
const packageJsonPath =
|
|
6162
|
+
const packageJsonPath = import_path11.default.join(baseDir, "package.json");
|
|
6144
6163
|
await writeGeneratedFile({
|
|
6145
6164
|
generatedFile,
|
|
6146
6165
|
typescript: config2.typescript,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Plugin } from 'vite';
|
|
1
|
+
import type { Plugin } from 'vite';
|
|
2
2
|
export declare const tinaTailwind: (spaPath: string, prebuildFilePath: string) => Plugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinacms/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -32,15 +32,13 @@
|
|
|
32
32
|
"@types/jest": "26.0.4",
|
|
33
33
|
"@types/js-yaml": "^4.0.0",
|
|
34
34
|
"@types/listr": "0.14.2",
|
|
35
|
-
"@types/lodash": "^4.14.157",
|
|
36
|
-
"@types/lodash.get": "^4.4.6",
|
|
37
35
|
"@types/log4js": "^2.3.5",
|
|
38
36
|
"@types/multer": "^1.4.7",
|
|
39
37
|
"@types/progress": "^2.0.3",
|
|
40
38
|
"@types/prompts": "^2.0.13",
|
|
41
39
|
"@types/yup": "^0.29.11",
|
|
42
40
|
"jest": "^29.5.0",
|
|
43
|
-
"@tinacms/scripts": "1.
|
|
41
|
+
"@tinacms/scripts": "1.2.0"
|
|
44
42
|
},
|
|
45
43
|
"dependencies": {
|
|
46
44
|
"@graphql-codegen/core": "^2.1.0",
|
|
@@ -83,16 +81,16 @@
|
|
|
83
81
|
"readable-stream": "^4.3.0",
|
|
84
82
|
"tailwindcss": "^3.4.4",
|
|
85
83
|
"typanion": "3.13.0",
|
|
86
|
-
"typescript": "^5.5.
|
|
84
|
+
"typescript": "^5.5.4",
|
|
87
85
|
"vite": "^4.3.9",
|
|
88
86
|
"yup": "^0.32.9",
|
|
89
87
|
"zod": "^3.14.3",
|
|
90
|
-
"@tinacms/
|
|
91
|
-
"@tinacms/
|
|
88
|
+
"@tinacms/app": "2.1.0",
|
|
89
|
+
"@tinacms/graphql": "1.5.0",
|
|
92
90
|
"@tinacms/metrics": "1.0.5",
|
|
93
|
-
"@tinacms/
|
|
94
|
-
"tinacms": "2.
|
|
95
|
-
"@tinacms/
|
|
91
|
+
"@tinacms/schema-tools": "1.6.0",
|
|
92
|
+
"tinacms": "2.2.0",
|
|
93
|
+
"@tinacms/search": "1.0.26"
|
|
96
94
|
},
|
|
97
95
|
"publishConfig": {
|
|
98
96
|
"registry": "https://registry.npmjs.org"
|