@tinacms/cli 1.6.9 → 1.6.11
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 +80 -75
- package/dist/next/vite/index.d.ts +3 -3
- package/package.json +11 -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.6.
|
|
34
|
+
var version = "1.6.11";
|
|
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_path5 = __toESM(require("path"));
|
|
40
40
|
var import_chokidar = __toESM(require("chokidar"));
|
|
41
41
|
var import_graphql10 = require("@tinacms/graphql");
|
|
42
42
|
|
|
@@ -612,17 +612,19 @@ var CONFIRMATION_TEXT = import_chalk3.default.dim("enter to confirm");
|
|
|
612
612
|
var import_vite3 = require("vite");
|
|
613
613
|
|
|
614
614
|
// src/next/vite/index.ts
|
|
615
|
-
var
|
|
615
|
+
var import_node_path2 = __toESM(require("path"));
|
|
616
|
+
var import_plugin_react = __toESM(require("@vitejs/plugin-react"));
|
|
616
617
|
var import_fs_extra2 = __toESM(require("fs-extra"));
|
|
618
|
+
var import_normalize_path2 = __toESM(require("normalize-path"));
|
|
617
619
|
var import_vite = require("vite");
|
|
618
|
-
var import_plugin_react = __toESM(require("@vitejs/plugin-react"));
|
|
619
620
|
|
|
620
621
|
// src/next/vite/tailwind.ts
|
|
622
|
+
var import_node_path = __toESM(require("path"));
|
|
623
|
+
var import_aspect_ratio = __toESM(require("@tailwindcss/aspect-ratio"));
|
|
624
|
+
var import_container_queries = __toESM(require("@tailwindcss/container-queries"));
|
|
625
|
+
var import_typography = __toESM(require("@tailwindcss/typography"));
|
|
621
626
|
var import_tailwindcss = __toESM(require("tailwindcss"));
|
|
622
627
|
var import_defaultTheme = __toESM(require("tailwindcss/defaultTheme.js"));
|
|
623
|
-
var import_typography = __toESM(require("@tailwindcss/typography"));
|
|
624
|
-
var import_aspect_ratio = __toESM(require("@tailwindcss/aspect-ratio"));
|
|
625
|
-
var import_node_path = __toESM(require("path"));
|
|
626
628
|
var tinaTailwind = (spaPath, prebuildFilePath) => {
|
|
627
629
|
return {
|
|
628
630
|
name: "vite-plugin-tina",
|
|
@@ -866,7 +868,11 @@ var tinaTailwind = (spaPath, prebuildFilePath) => {
|
|
|
866
868
|
}
|
|
867
869
|
},
|
|
868
870
|
content,
|
|
869
|
-
plugins: [
|
|
871
|
+
plugins: [
|
|
872
|
+
(0, import_typography.default)({ className: "tina-prose" }),
|
|
873
|
+
import_aspect_ratio.default,
|
|
874
|
+
import_container_queries.default
|
|
875
|
+
]
|
|
870
876
|
});
|
|
871
877
|
plugins.push(tw);
|
|
872
878
|
return {
|
|
@@ -881,13 +887,12 @@ var tinaTailwind = (spaPath, prebuildFilePath) => {
|
|
|
881
887
|
};
|
|
882
888
|
|
|
883
889
|
// src/next/vite/index.ts
|
|
884
|
-
var import_normalize_path2 = __toESM(require("normalize-path"));
|
|
885
890
|
async function listFilesRecursively({
|
|
886
891
|
directoryPath,
|
|
887
892
|
config: config2,
|
|
888
893
|
roothPath
|
|
889
894
|
}) {
|
|
890
|
-
const fullDirectoryPath =
|
|
895
|
+
const fullDirectoryPath = import_node_path2.default.join(
|
|
891
896
|
roothPath,
|
|
892
897
|
config2.publicFolder,
|
|
893
898
|
directoryPath
|
|
@@ -899,23 +904,23 @@ async function listFilesRecursively({
|
|
|
899
904
|
const items = await import_fs_extra2.default.readdir(fullDirectoryPath);
|
|
900
905
|
const staticMediaItems = [];
|
|
901
906
|
for (const item of items) {
|
|
902
|
-
const itemPath =
|
|
907
|
+
const itemPath = import_node_path2.default.join(fullDirectoryPath, item);
|
|
903
908
|
const stats = await import_fs_extra2.default.promises.lstat(itemPath);
|
|
904
909
|
const staticMediaItem = {
|
|
905
910
|
id: item,
|
|
906
911
|
filename: item,
|
|
907
912
|
type: stats.isDirectory() ? "dir" : "file",
|
|
908
913
|
directory: `${directoryPath.replace(config2.mediaRoot, "")}`,
|
|
909
|
-
src: `/${
|
|
914
|
+
src: `/${import_node_path2.default.join(directoryPath, item)}`,
|
|
910
915
|
thumbnails: {
|
|
911
|
-
"75x75": `/${
|
|
912
|
-
"400x400": `/${
|
|
913
|
-
"1000x1000": `/${
|
|
916
|
+
"75x75": `/${import_node_path2.default.join(directoryPath, item)}`,
|
|
917
|
+
"400x400": `/${import_node_path2.default.join(directoryPath, item)}`,
|
|
918
|
+
"1000x1000": `/${import_node_path2.default.join(directoryPath, item)}`
|
|
914
919
|
}
|
|
915
920
|
};
|
|
916
921
|
if (stats.isDirectory()) {
|
|
917
922
|
staticMediaItem.children = await listFilesRecursively({
|
|
918
|
-
directoryPath:
|
|
923
|
+
directoryPath: import_node_path2.default.join(directoryPath, item),
|
|
919
924
|
config: config2,
|
|
920
925
|
roothPath
|
|
921
926
|
});
|
|
@@ -958,7 +963,7 @@ var createConfig = async ({
|
|
|
958
963
|
}
|
|
959
964
|
}
|
|
960
965
|
});
|
|
961
|
-
const staticMediaPath =
|
|
966
|
+
const staticMediaPath = import_node_path2.default.join(
|
|
962
967
|
configManager.generatedFolderPath,
|
|
963
968
|
"static-media.json"
|
|
964
969
|
);
|
|
@@ -976,13 +981,13 @@ var createConfig = async ({
|
|
|
976
981
|
TINA_IMPORT: configManager.prebuildFilePath,
|
|
977
982
|
SCHEMA_IMPORT: configManager.generatedGraphQLJSONPath,
|
|
978
983
|
STATIC_MEDIA_IMPORT: staticMediaPath,
|
|
979
|
-
crypto:
|
|
980
|
-
fs:
|
|
981
|
-
os:
|
|
982
|
-
path:
|
|
984
|
+
crypto: import_node_path2.default.join(configManager.spaRootPath, "src", "dummy-client.ts"),
|
|
985
|
+
fs: import_node_path2.default.join(configManager.spaRootPath, "src", "dummy-client.ts"),
|
|
986
|
+
os: import_node_path2.default.join(configManager.spaRootPath, "src", "dummy-client.ts"),
|
|
987
|
+
path: import_node_path2.default.join(configManager.spaRootPath, "src", "dummy-client.ts")
|
|
983
988
|
};
|
|
984
989
|
if (configManager.shouldSkipSDK()) {
|
|
985
|
-
alias["CLIENT_IMPORT"] =
|
|
990
|
+
alias["CLIENT_IMPORT"] = import_node_path2.default.join(
|
|
986
991
|
configManager.spaRootPath,
|
|
987
992
|
"src",
|
|
988
993
|
"dummy-client.ts"
|
|
@@ -1054,17 +1059,17 @@ var import_pluginutils = require("@rollup/pluginutils");
|
|
|
1054
1059
|
var import_fs = __toESM(require("fs"));
|
|
1055
1060
|
var import_vite2 = require("vite");
|
|
1056
1061
|
var import_esbuild = require("esbuild");
|
|
1057
|
-
var
|
|
1062
|
+
var import_path3 = __toESM(require("path"));
|
|
1058
1063
|
var import_body_parser = __toESM(require("body-parser"));
|
|
1059
1064
|
var import_cors = __toESM(require("cors"));
|
|
1060
1065
|
var import_graphql = require("@tinacms/graphql");
|
|
1061
1066
|
|
|
1062
1067
|
// src/next/commands/dev-command/server/media.ts
|
|
1063
1068
|
var import_fs_extra3 = __toESM(require("fs-extra"));
|
|
1064
|
-
var
|
|
1069
|
+
var import_path2 = __toESM(require("path"));
|
|
1065
1070
|
var import_busboy = __toESM(require("busboy"));
|
|
1066
1071
|
var createMediaRouter = (config2) => {
|
|
1067
|
-
const mediaFolder =
|
|
1072
|
+
const mediaFolder = import_path2.default.join(
|
|
1068
1073
|
config2.rootPath,
|
|
1069
1074
|
config2.publicFolder,
|
|
1070
1075
|
config2.mediaRoot
|
|
@@ -1092,8 +1097,8 @@ var createMediaRouter = (config2) => {
|
|
|
1092
1097
|
bb.on("file", async (_name, file, _info) => {
|
|
1093
1098
|
var _a;
|
|
1094
1099
|
const fullPath = decodeURI((_a = req.url) == null ? void 0 : _a.slice("/media/upload/".length));
|
|
1095
|
-
const saveTo =
|
|
1096
|
-
await import_fs_extra3.default.ensureDir(
|
|
1100
|
+
const saveTo = import_path2.default.join(mediaFolder, ...fullPath.split("/"));
|
|
1101
|
+
await import_fs_extra3.default.ensureDir(import_path2.default.dirname(saveTo));
|
|
1097
1102
|
file.pipe(import_fs_extra3.default.createWriteStream(saveTo));
|
|
1098
1103
|
});
|
|
1099
1104
|
bb.on("error", (error) => {
|
|
@@ -1128,7 +1133,7 @@ var MediaModel = class {
|
|
|
1128
1133
|
}
|
|
1129
1134
|
async listMedia(args) {
|
|
1130
1135
|
try {
|
|
1131
|
-
const folderPath = (0,
|
|
1136
|
+
const folderPath = (0, import_path2.join)(
|
|
1132
1137
|
this.rootPath,
|
|
1133
1138
|
this.publicFolder,
|
|
1134
1139
|
this.mediaRoot,
|
|
@@ -1143,7 +1148,7 @@ var MediaModel = class {
|
|
|
1143
1148
|
}
|
|
1144
1149
|
const filesStr = await import_fs_extra3.default.readdir(folderPath);
|
|
1145
1150
|
const filesProm = filesStr.map(async (file) => {
|
|
1146
|
-
const filePath = (0,
|
|
1151
|
+
const filePath = (0, import_path2.join)(folderPath, file);
|
|
1147
1152
|
const stat = await import_fs_extra3.default.stat(filePath);
|
|
1148
1153
|
let src = `/${file}`;
|
|
1149
1154
|
const isFile = stat.isFile();
|
|
@@ -1200,7 +1205,7 @@ var MediaModel = class {
|
|
|
1200
1205
|
}
|
|
1201
1206
|
async deleteMedia(args) {
|
|
1202
1207
|
try {
|
|
1203
|
-
const file = (0,
|
|
1208
|
+
const file = (0, import_path2.join)(
|
|
1204
1209
|
this.rootPath,
|
|
1205
1210
|
this.publicFolder,
|
|
1206
1211
|
this.mediaRoot,
|
|
@@ -1265,7 +1270,7 @@ var transformTsxPlugin = ({
|
|
|
1265
1270
|
const plug = {
|
|
1266
1271
|
name: "transform-tsx",
|
|
1267
1272
|
async transform(code, id) {
|
|
1268
|
-
const extName =
|
|
1273
|
+
const extName = import_path3.default.extname(id);
|
|
1269
1274
|
if (extName.startsWith(".tsx") || extName.startsWith(".ts")) {
|
|
1270
1275
|
const result = await (0, import_esbuild.transform)(code, { loader: "tsx" });
|
|
1271
1276
|
return {
|
|
@@ -1417,7 +1422,7 @@ var createDevServer = async (configManager, database, searchIndex, apiURL, noWat
|
|
|
1417
1422
|
|
|
1418
1423
|
// src/next/codegen/index.ts
|
|
1419
1424
|
var import_fs_extra4 = __toESM(require("fs-extra"));
|
|
1420
|
-
var
|
|
1425
|
+
var import_path4 = __toESM(require("path"));
|
|
1421
1426
|
var import_graphql6 = require("graphql");
|
|
1422
1427
|
|
|
1423
1428
|
// src/next/codegen/codegen/index.ts
|
|
@@ -1663,11 +1668,11 @@ var Codegen = class {
|
|
|
1663
1668
|
this.noClientBuildCache = noClientBuildCache;
|
|
1664
1669
|
}
|
|
1665
1670
|
async writeConfigFile(fileName, data) {
|
|
1666
|
-
const filePath =
|
|
1671
|
+
const filePath = import_path4.default.join(this.configManager.generatedFolderPath, fileName);
|
|
1667
1672
|
await import_fs_extra4.default.ensureFile(filePath);
|
|
1668
1673
|
await import_fs_extra4.default.outputFile(filePath, data);
|
|
1669
1674
|
if (this.configManager.hasSeparateContentRoot()) {
|
|
1670
|
-
const filePath2 =
|
|
1675
|
+
const filePath2 = import_path4.default.join(
|
|
1671
1676
|
this.configManager.generatedFolderPathContentRepo,
|
|
1672
1677
|
fileName
|
|
1673
1678
|
);
|
|
@@ -2319,14 +2324,14 @@ var DevCommand = class extends BaseCommand {
|
|
|
2319
2324
|
graphql: graphqlSchemaObject
|
|
2320
2325
|
});
|
|
2321
2326
|
import_fs_extra6.default.writeFileSync(
|
|
2322
|
-
|
|
2327
|
+
import_path5.default.join(configManager.tinaFolderPath, tinaLockFilename),
|
|
2323
2328
|
tinaLockContent
|
|
2324
2329
|
);
|
|
2325
2330
|
if (configManager.hasSeparateContentRoot()) {
|
|
2326
2331
|
const rootPath = await configManager.getTinaFolderPath(
|
|
2327
2332
|
configManager.contentRootPath
|
|
2328
2333
|
);
|
|
2329
|
-
const filePath =
|
|
2334
|
+
const filePath = import_path5.default.join(rootPath, tinaLockFilename);
|
|
2330
2335
|
await import_fs_extra6.default.ensureFile(filePath);
|
|
2331
2336
|
await import_fs_extra6.default.outputFile(filePath, tinaLockContent);
|
|
2332
2337
|
}
|
|
@@ -2473,7 +2478,7 @@ ${dangerText(e.message)}
|
|
|
2473
2478
|
watchContentFiles(configManager, database, searchIndexer) {
|
|
2474
2479
|
const collectionContentFiles = [];
|
|
2475
2480
|
configManager.config.schema.collections.forEach((collection) => {
|
|
2476
|
-
const collectionGlob = `${
|
|
2481
|
+
const collectionGlob = `${import_path5.default.join(
|
|
2477
2482
|
configManager.contentRootPath,
|
|
2478
2483
|
collection.path
|
|
2479
2484
|
)}/**/*.${collection.format || "md"}`;
|
|
@@ -3464,25 +3469,25 @@ var import_clipanion6 = require("clipanion");
|
|
|
3464
3469
|
|
|
3465
3470
|
// src/cmds/init/detectEnvironment.ts
|
|
3466
3471
|
var import_fs_extra8 = __toESM(require("fs-extra"));
|
|
3467
|
-
var
|
|
3472
|
+
var import_path6 = __toESM(require("path"));
|
|
3468
3473
|
var checkGitignoreForItem = async ({
|
|
3469
3474
|
baseDir,
|
|
3470
3475
|
line
|
|
3471
3476
|
}) => {
|
|
3472
|
-
const gitignoreContent = import_fs_extra8.default.readFileSync(
|
|
3477
|
+
const gitignoreContent = import_fs_extra8.default.readFileSync(import_path6.default.join(baseDir, ".gitignore")).toString();
|
|
3473
3478
|
return gitignoreContent.split("\n").some((item) => item === line);
|
|
3474
3479
|
};
|
|
3475
3480
|
var makeGeneratedFile = async (name2, generatedFileType, parentPath, opts) => {
|
|
3476
3481
|
const result = {
|
|
3477
|
-
fullPathTS:
|
|
3482
|
+
fullPathTS: import_path6.default.join(
|
|
3478
3483
|
parentPath,
|
|
3479
3484
|
`${name2}.${(opts == null ? void 0 : opts.typescriptSuffix) || (opts == null ? void 0 : opts.extensionOverride) || "ts"}`
|
|
3480
3485
|
),
|
|
3481
|
-
fullPathJS:
|
|
3486
|
+
fullPathJS: import_path6.default.join(
|
|
3482
3487
|
parentPath,
|
|
3483
3488
|
`${name2}.${(opts == null ? void 0 : opts.extensionOverride) || "js"}`
|
|
3484
3489
|
),
|
|
3485
|
-
fullPathOverride: (opts == null ? void 0 : opts.extensionOverride) ?
|
|
3490
|
+
fullPathOverride: (opts == null ? void 0 : opts.extensionOverride) ? import_path6.default.join(parentPath, `${name2}.${opts == null ? void 0 : opts.extensionOverride}`) : "",
|
|
3486
3491
|
generatedFileType,
|
|
3487
3492
|
name: name2,
|
|
3488
3493
|
parentPath,
|
|
@@ -3512,16 +3517,16 @@ var detectEnvironment = async ({
|
|
|
3512
3517
|
}) => {
|
|
3513
3518
|
var _a;
|
|
3514
3519
|
const hasForestryConfig = await import_fs_extra8.default.pathExists(
|
|
3515
|
-
|
|
3520
|
+
import_path6.default.join(pathToForestryConfig, ".forestry", "settings.yml")
|
|
3516
3521
|
);
|
|
3517
|
-
const sampleContentPath =
|
|
3522
|
+
const sampleContentPath = import_path6.default.join(
|
|
3518
3523
|
baseDir,
|
|
3519
3524
|
"content",
|
|
3520
3525
|
"posts",
|
|
3521
3526
|
"hello-world.md"
|
|
3522
3527
|
);
|
|
3523
|
-
const usingSrc = import_fs_extra8.default.pathExistsSync(
|
|
3524
|
-
const tinaFolder =
|
|
3528
|
+
const usingSrc = import_fs_extra8.default.pathExistsSync(import_path6.default.join(baseDir, "src")) && (import_fs_extra8.default.pathExistsSync(import_path6.default.join(baseDir, "src", "app")) || import_fs_extra8.default.pathExistsSync(import_path6.default.join(baseDir, "src", "pages")));
|
|
3529
|
+
const tinaFolder = import_path6.default.join(baseDir, "tina");
|
|
3525
3530
|
const tinaConfigExists = Boolean(
|
|
3526
3531
|
await import_fs_extra8.default.pathExists(tinaFolder) && (await import_fs_extra8.default.readdir(tinaFolder)).find((x) => x.includes("config"))
|
|
3527
3532
|
);
|
|
@@ -3535,12 +3540,12 @@ var detectEnvironment = async ({
|
|
|
3535
3540
|
"next-api-handler": await makeGeneratedFile(
|
|
3536
3541
|
"[...routes]",
|
|
3537
3542
|
"next-api-handler",
|
|
3538
|
-
|
|
3543
|
+
import_path6.default.join(...pagesDir, "api", "tina")
|
|
3539
3544
|
),
|
|
3540
3545
|
"reactive-example": await makeGeneratedFile(
|
|
3541
3546
|
"[filename]",
|
|
3542
3547
|
"reactive-example",
|
|
3543
|
-
|
|
3548
|
+
import_path6.default.join(...pagesDir, "demo", "blog"),
|
|
3544
3549
|
{
|
|
3545
3550
|
typescriptSuffix: "tsx"
|
|
3546
3551
|
}
|
|
@@ -3548,13 +3553,13 @@ var detectEnvironment = async ({
|
|
|
3548
3553
|
"users-json": await makeGeneratedFile(
|
|
3549
3554
|
"index",
|
|
3550
3555
|
"users-json",
|
|
3551
|
-
|
|
3556
|
+
import_path6.default.join(baseDir, "content", "users"),
|
|
3552
3557
|
{ extensionOverride: "json" }
|
|
3553
3558
|
),
|
|
3554
3559
|
"sample-content": await makeGeneratedFile(
|
|
3555
3560
|
"hello-world",
|
|
3556
3561
|
"sample-content",
|
|
3557
|
-
|
|
3562
|
+
import_path6.default.join(baseDir, "content", "posts"),
|
|
3558
3563
|
{ extensionOverride: "md" }
|
|
3559
3564
|
)
|
|
3560
3565
|
};
|
|
@@ -3580,13 +3585,13 @@ var detectEnvironment = async ({
|
|
|
3580
3585
|
);
|
|
3581
3586
|
}
|
|
3582
3587
|
}
|
|
3583
|
-
const hasGitIgnore = await import_fs_extra8.default.pathExists(
|
|
3588
|
+
const hasGitIgnore = await import_fs_extra8.default.pathExists(import_path6.default.join(".gitignore"));
|
|
3584
3589
|
const hasGitIgnoreNodeModules = hasGitIgnore && await checkGitignoreForItem({ baseDir, line: "node_modules" });
|
|
3585
3590
|
const hasEnvTina = hasGitIgnore && await checkGitignoreForItem({ baseDir, line: ".env.tina" });
|
|
3586
3591
|
const hasGitIgnoreEnv = hasGitIgnore && await checkGitignoreForItem({ baseDir, line: ".env" });
|
|
3587
3592
|
let frontMatterFormat;
|
|
3588
3593
|
if (hasForestryConfig) {
|
|
3589
|
-
const hugoConfigPath =
|
|
3594
|
+
const hugoConfigPath = import_path6.default.join(rootPath, "config.toml");
|
|
3590
3595
|
if (await import_fs_extra8.default.pathExists(hugoConfigPath)) {
|
|
3591
3596
|
const hugoConfig = await import_fs_extra8.default.readFile(hugoConfigPath, "utf8");
|
|
3592
3597
|
const metaDataFormat = (_a = hugoConfig.match(/metaDataFormat = "(.*)"/)) == null ? void 0 : _a[1];
|
|
@@ -4194,18 +4199,18 @@ var CLICommand = class {
|
|
|
4194
4199
|
};
|
|
4195
4200
|
|
|
4196
4201
|
// src/cmds/init/apply.ts
|
|
4197
|
-
var
|
|
4202
|
+
var import_path10 = __toESM(require("path"));
|
|
4198
4203
|
|
|
4199
4204
|
// src/cmds/forestry-migrate/index.ts
|
|
4200
4205
|
var import_fs_extra10 = __toESM(require("fs-extra"));
|
|
4201
|
-
var
|
|
4206
|
+
var import_path8 = __toESM(require("path"));
|
|
4202
4207
|
var import_js_yaml2 = __toESM(require("js-yaml"));
|
|
4203
4208
|
var import_minimatch = __toESM(require("minimatch"));
|
|
4204
4209
|
var import_graphql16 = require("@tinacms/graphql");
|
|
4205
4210
|
|
|
4206
4211
|
// src/cmds/forestry-migrate/util/index.ts
|
|
4207
4212
|
var import_fs_extra9 = __toESM(require("fs-extra"));
|
|
4208
|
-
var
|
|
4213
|
+
var import_path7 = __toESM(require("path"));
|
|
4209
4214
|
var import_js_yaml = __toESM(require("js-yaml"));
|
|
4210
4215
|
var import_zod = __toESM(require("zod"));
|
|
4211
4216
|
|
|
@@ -4616,7 +4621,7 @@ var transformForestryFieldsToTinaFields = ({
|
|
|
4616
4621
|
return tinaFields;
|
|
4617
4622
|
};
|
|
4618
4623
|
var getFieldsFromTemplates = ({ tem, pathToForestryConfig, skipBlocks = false }) => {
|
|
4619
|
-
const templatePath =
|
|
4624
|
+
const templatePath = import_path7.default.join(
|
|
4620
4625
|
pathToForestryConfig,
|
|
4621
4626
|
".forestry",
|
|
4622
4627
|
"front_matter",
|
|
@@ -4691,8 +4696,8 @@ var generateAllTemplates = async ({
|
|
|
4691
4696
|
pathToForestryConfig
|
|
4692
4697
|
}) => {
|
|
4693
4698
|
const allTemplates = (await import_fs_extra10.default.readdir(
|
|
4694
|
-
|
|
4695
|
-
)).map((tem) =>
|
|
4699
|
+
import_path8.default.join(pathToForestryConfig, ".forestry", "front_matter", "templates")
|
|
4700
|
+
)).map((tem) => import_path8.default.basename(tem, ".yml"));
|
|
4696
4701
|
const templateMap = /* @__PURE__ */ new Map();
|
|
4697
4702
|
const proms = allTemplates.map(async (tem) => {
|
|
4698
4703
|
try {
|
|
@@ -4834,9 +4839,9 @@ var generateCollectionFromForestrySection = (args) => {
|
|
|
4834
4839
|
return c;
|
|
4835
4840
|
} else if (section.type === "document") {
|
|
4836
4841
|
const filePath = section.path;
|
|
4837
|
-
const extname =
|
|
4838
|
-
const fileName =
|
|
4839
|
-
const dir =
|
|
4842
|
+
const extname = import_path8.default.extname(filePath);
|
|
4843
|
+
const fileName = import_path8.default.basename(filePath, extname);
|
|
4844
|
+
const dir = import_path8.default.dirname(filePath);
|
|
4840
4845
|
const ext = checkExt(extname);
|
|
4841
4846
|
if (ext) {
|
|
4842
4847
|
const fields = [];
|
|
@@ -4899,7 +4904,7 @@ var generateCollections = async ({
|
|
|
4899
4904
|
usingTypescript
|
|
4900
4905
|
});
|
|
4901
4906
|
const forestryConfig = await import_fs_extra10.default.readFile(
|
|
4902
|
-
|
|
4907
|
+
import_path8.default.join(pathToForestryConfig, ".forestry", "settings.yml")
|
|
4903
4908
|
);
|
|
4904
4909
|
rewriteTemplateKeysInDocs({
|
|
4905
4910
|
templateMap,
|
|
@@ -4930,11 +4935,11 @@ var rewriteTemplateKeysInDocs = (args) => {
|
|
|
4930
4935
|
const { templateObj } = templateMap.get(templateKey);
|
|
4931
4936
|
(_a = templateObj == null ? void 0 : templateObj.pages) == null ? void 0 : _a.forEach((page) => {
|
|
4932
4937
|
try {
|
|
4933
|
-
const filePath =
|
|
4938
|
+
const filePath = import_path8.default.join(page);
|
|
4934
4939
|
if (import_fs_extra10.default.lstatSync(filePath).isDirectory()) {
|
|
4935
4940
|
return;
|
|
4936
4941
|
}
|
|
4937
|
-
const extname =
|
|
4942
|
+
const extname = import_path8.default.extname(filePath);
|
|
4938
4943
|
const fileContent = import_fs_extra10.default.readFileSync(filePath).toString();
|
|
4939
4944
|
const content = (0, import_graphql16.parseFile)(
|
|
4940
4945
|
fileContent,
|
|
@@ -4966,7 +4971,7 @@ var import_fs_extra13 = __toESM(require("fs-extra"));
|
|
|
4966
4971
|
// src/next/commands/codemod-command/index.ts
|
|
4967
4972
|
var import_clipanion5 = require("clipanion");
|
|
4968
4973
|
var import_fs_extra11 = __toESM(require("fs-extra"));
|
|
4969
|
-
var
|
|
4974
|
+
var import_path9 = __toESM(require("path"));
|
|
4970
4975
|
var CodemodCommand = class extends import_clipanion5.Command {
|
|
4971
4976
|
constructor() {
|
|
4972
4977
|
super(...arguments);
|
|
@@ -5010,7 +5015,7 @@ var moveTinaFolder = async (rootPath = process.cwd()) => {
|
|
|
5010
5015
|
logger.error(e.message);
|
|
5011
5016
|
process.exit(1);
|
|
5012
5017
|
}
|
|
5013
|
-
const tinaDestination =
|
|
5018
|
+
const tinaDestination = import_path9.default.join(configManager.rootPath, "tina");
|
|
5014
5019
|
if (await import_fs_extra11.default.existsSync(tinaDestination)) {
|
|
5015
5020
|
logger.info(
|
|
5016
5021
|
`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.`
|
|
@@ -5025,7 +5030,7 @@ var moveTinaFolder = async (rootPath = process.cwd()) => {
|
|
|
5025
5030
|
};
|
|
5026
5031
|
var writeGitignore = async (rootPath) => {
|
|
5027
5032
|
await import_fs_extra11.default.outputFileSync(
|
|
5028
|
-
|
|
5033
|
+
import_path9.default.join(rootPath, "tina", ".gitignore"),
|
|
5029
5034
|
"__generated__"
|
|
5030
5035
|
);
|
|
5031
5036
|
};
|
|
@@ -5863,8 +5868,8 @@ async function apply({
|
|
|
5863
5868
|
await addConfigFile({
|
|
5864
5869
|
configArgs: {
|
|
5865
5870
|
config: config2,
|
|
5866
|
-
publicFolder:
|
|
5867
|
-
|
|
5871
|
+
publicFolder: import_path10.default.join(
|
|
5872
|
+
import_path10.default.relative(process.cwd(), pathToForestryConfig),
|
|
5868
5873
|
config2.publicFolder
|
|
5869
5874
|
),
|
|
5870
5875
|
collections,
|
|
@@ -5931,18 +5936,18 @@ var createPackageJSON = async () => {
|
|
|
5931
5936
|
};
|
|
5932
5937
|
var createGitignore = async ({ baseDir }) => {
|
|
5933
5938
|
logger.info(logText("No .gitignore found, creating one"));
|
|
5934
|
-
import_fs_extra13.default.outputFileSync(
|
|
5939
|
+
import_fs_extra13.default.outputFileSync(import_path10.default.join(baseDir, ".gitignore"), "node_modules");
|
|
5935
5940
|
};
|
|
5936
5941
|
var updateGitIgnore = async ({
|
|
5937
5942
|
baseDir,
|
|
5938
5943
|
items
|
|
5939
5944
|
}) => {
|
|
5940
5945
|
logger.info(logText(`Adding ${items.join(",")} to .gitignore`));
|
|
5941
|
-
const gitignoreContent = import_fs_extra13.default.readFileSync(
|
|
5946
|
+
const gitignoreContent = import_fs_extra13.default.readFileSync(import_path10.default.join(baseDir, ".gitignore")).toString();
|
|
5942
5947
|
const newGitignoreContent = [...gitignoreContent.split("\n"), ...items].join(
|
|
5943
5948
|
"\n"
|
|
5944
5949
|
);
|
|
5945
|
-
await import_fs_extra13.default.writeFile(
|
|
5950
|
+
await import_fs_extra13.default.writeFile(import_path10.default.join(baseDir, ".gitignore"), newGitignoreContent);
|
|
5946
5951
|
};
|
|
5947
5952
|
var addDependencies = async (config2, env, params) => {
|
|
5948
5953
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
@@ -6110,7 +6115,7 @@ var addContentFile = async ({
|
|
|
6110
6115
|
return () => ({
|
|
6111
6116
|
exists: env.sampleContentExists,
|
|
6112
6117
|
path: env.sampleContentPath,
|
|
6113
|
-
parentPath:
|
|
6118
|
+
parentPath: import_path10.default.dirname(env.sampleContentPath)
|
|
6114
6119
|
});
|
|
6115
6120
|
}
|
|
6116
6121
|
},
|
|
@@ -6133,7 +6138,7 @@ ${titleText(" TinaCMS ")} backend initialized!`));
|
|
|
6133
6138
|
return `${x.key}=${x.value || "***"}`;
|
|
6134
6139
|
}).join("\n") + `
|
|
6135
6140
|
TINA_PUBLIC_IS_LOCAL=true`;
|
|
6136
|
-
const envFile =
|
|
6141
|
+
const envFile = import_path10.default.join(process.cwd(), ".env");
|
|
6137
6142
|
if (!import_fs_extra13.default.existsSync(envFile)) {
|
|
6138
6143
|
logger.info(`Adding .env file to your project... \u2705`);
|
|
6139
6144
|
import_fs_extra13.default.writeFileSync(envFile, envFileText);
|
|
@@ -6197,7 +6202,7 @@ var addReactiveFile = {
|
|
|
6197
6202
|
dataLayer
|
|
6198
6203
|
}) => {
|
|
6199
6204
|
var _a, _b;
|
|
6200
|
-
const packageJsonPath =
|
|
6205
|
+
const packageJsonPath = import_path10.default.join(baseDir, "package.json");
|
|
6201
6206
|
await writeGeneratedFile({
|
|
6202
6207
|
generatedFile,
|
|
6203
6208
|
typescript: config2.typescript,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { ConfigManager } from '../config-manager';
|
|
1
|
+
import type { Database } from '@tinacms/graphql';
|
|
2
|
+
import { type BuildOptions, type InlineConfig, type Plugin } from 'vite';
|
|
3
|
+
import type { ConfigManager } from '../config-manager';
|
|
4
4
|
/**
|
|
5
5
|
* This type is duplicated in he `TinaMediaStore`
|
|
6
6
|
* It represents the files that are available at build time
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinacms/cli",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.11",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@types/express": "^4.17.21",
|
|
29
29
|
"@types/express-graphql": "^0.9.0",
|
|
30
30
|
"@types/figlet": "1.2.0",
|
|
31
|
-
"@types/fs-extra": "^
|
|
31
|
+
"@types/fs-extra": "^11.0.4",
|
|
32
32
|
"@types/jest": "26.0.4",
|
|
33
33
|
"@types/js-yaml": "^4.0.9",
|
|
34
34
|
"@types/listr": "0.14.2",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"@types/multer": "^1.4.12",
|
|
37
37
|
"@types/progress": "^2.0.7",
|
|
38
38
|
"@types/prompts": "^2.4.9",
|
|
39
|
-
"@types/yup": "^0.
|
|
39
|
+
"@types/yup": "^0.32.0",
|
|
40
40
|
"jest": "^29.7.0",
|
|
41
|
-
"@tinacms/scripts": "1.
|
|
41
|
+
"@tinacms/scripts": "1.3.0"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@graphql-codegen/core": "^2.6.8",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"@rollup/pluginutils": "^5.1.2",
|
|
53
53
|
"@svgr/core": "8.1.0",
|
|
54
54
|
"@tailwindcss/aspect-ratio": "^0.4.2",
|
|
55
|
+
"@tailwindcss/container-queries": "^0.1.1",
|
|
55
56
|
"@tailwindcss/typography": "^0.5.15",
|
|
56
57
|
"@vitejs/plugin-react": "3.1.0",
|
|
57
58
|
"altair-express-middleware": "^7.3.6",
|
|
@@ -82,14 +83,14 @@
|
|
|
82
83
|
"typanion": "3.13.0",
|
|
83
84
|
"typescript": "^5.6.2",
|
|
84
85
|
"vite": "^4.5.5",
|
|
85
|
-
"yup": "^
|
|
86
|
+
"yup": "^1.4.0",
|
|
86
87
|
"zod": "^3.23.8",
|
|
87
|
-
"@tinacms/app": "2.1.
|
|
88
|
+
"@tinacms/app": "2.1.11",
|
|
89
|
+
"@tinacms/graphql": "1.5.7",
|
|
88
90
|
"@tinacms/metrics": "1.0.7",
|
|
89
|
-
"@tinacms/
|
|
90
|
-
"@tinacms/
|
|
91
|
-
"tinacms": "2.
|
|
92
|
-
"@tinacms/search": "1.0.32"
|
|
91
|
+
"@tinacms/schema-tools": "1.6.7",
|
|
92
|
+
"@tinacms/search": "1.0.34",
|
|
93
|
+
"tinacms": "2.4.0"
|
|
93
94
|
},
|
|
94
95
|
"publishConfig": {
|
|
95
96
|
"registry": "https://registry.npmjs.org"
|