@tinacms/cli 0.0.0-8a702b8-20241010053417 → 0.0.0-9b91b31-20241023063504
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 +78 -75
- package/dist/next/vite/index.d.ts +3 -3
- package/package.json +7 -7
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.10";
|
|
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,18 +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
|
|
621
|
-
var import_tailwindcss = __toESM(require("tailwindcss"));
|
|
622
|
-
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
622
|
var import_node_path = __toESM(require("path"));
|
|
623
|
+
var import_aspect_ratio = __toESM(require("@tailwindcss/aspect-ratio"));
|
|
626
624
|
var import_container_queries = __toESM(require("@tailwindcss/container-queries"));
|
|
625
|
+
var import_typography = __toESM(require("@tailwindcss/typography"));
|
|
626
|
+
var import_tailwindcss = __toESM(require("tailwindcss"));
|
|
627
|
+
var import_defaultTheme = __toESM(require("tailwindcss/defaultTheme.js"));
|
|
627
628
|
var tinaTailwind = (spaPath, prebuildFilePath) => {
|
|
628
629
|
return {
|
|
629
630
|
name: "vite-plugin-tina",
|
|
@@ -886,13 +887,12 @@ var tinaTailwind = (spaPath, prebuildFilePath) => {
|
|
|
886
887
|
};
|
|
887
888
|
|
|
888
889
|
// src/next/vite/index.ts
|
|
889
|
-
var import_normalize_path2 = __toESM(require("normalize-path"));
|
|
890
890
|
async function listFilesRecursively({
|
|
891
891
|
directoryPath,
|
|
892
892
|
config: config2,
|
|
893
893
|
roothPath
|
|
894
894
|
}) {
|
|
895
|
-
const fullDirectoryPath =
|
|
895
|
+
const fullDirectoryPath = import_node_path2.default.join(
|
|
896
896
|
roothPath,
|
|
897
897
|
config2.publicFolder,
|
|
898
898
|
directoryPath
|
|
@@ -904,23 +904,23 @@ async function listFilesRecursively({
|
|
|
904
904
|
const items = await import_fs_extra2.default.readdir(fullDirectoryPath);
|
|
905
905
|
const staticMediaItems = [];
|
|
906
906
|
for (const item of items) {
|
|
907
|
-
const itemPath =
|
|
907
|
+
const itemPath = import_node_path2.default.join(fullDirectoryPath, item);
|
|
908
908
|
const stats = await import_fs_extra2.default.promises.lstat(itemPath);
|
|
909
909
|
const staticMediaItem = {
|
|
910
910
|
id: item,
|
|
911
911
|
filename: item,
|
|
912
912
|
type: stats.isDirectory() ? "dir" : "file",
|
|
913
913
|
directory: `${directoryPath.replace(config2.mediaRoot, "")}`,
|
|
914
|
-
src: `/${
|
|
914
|
+
src: `/${import_node_path2.default.join(directoryPath, item)}`,
|
|
915
915
|
thumbnails: {
|
|
916
|
-
"75x75": `/${
|
|
917
|
-
"400x400": `/${
|
|
918
|
-
"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)}`
|
|
919
919
|
}
|
|
920
920
|
};
|
|
921
921
|
if (stats.isDirectory()) {
|
|
922
922
|
staticMediaItem.children = await listFilesRecursively({
|
|
923
|
-
directoryPath:
|
|
923
|
+
directoryPath: import_node_path2.default.join(directoryPath, item),
|
|
924
924
|
config: config2,
|
|
925
925
|
roothPath
|
|
926
926
|
});
|
|
@@ -963,7 +963,7 @@ var createConfig = async ({
|
|
|
963
963
|
}
|
|
964
964
|
}
|
|
965
965
|
});
|
|
966
|
-
const staticMediaPath =
|
|
966
|
+
const staticMediaPath = import_node_path2.default.join(
|
|
967
967
|
configManager.generatedFolderPath,
|
|
968
968
|
"static-media.json"
|
|
969
969
|
);
|
|
@@ -977,17 +977,20 @@ var createConfig = async ({
|
|
|
977
977
|
} else {
|
|
978
978
|
await import_fs_extra2.default.outputFile(staticMediaPath, `[]`);
|
|
979
979
|
}
|
|
980
|
+
const isBrowser = typeof window !== "undefined";
|
|
980
981
|
const alias = {
|
|
981
982
|
TINA_IMPORT: configManager.prebuildFilePath,
|
|
982
983
|
SCHEMA_IMPORT: configManager.generatedGraphQLJSONPath,
|
|
983
984
|
STATIC_MEDIA_IMPORT: staticMediaPath,
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
985
|
+
...isBrowser && {
|
|
986
|
+
crypto: import_node_path2.default.join(configManager.spaRootPath, "src", "dummy-client.ts"),
|
|
987
|
+
fs: import_node_path2.default.join(configManager.spaRootPath, "src", "dummy-client.ts"),
|
|
988
|
+
os: import_node_path2.default.join(configManager.spaRootPath, "src", "dummy-client.ts"),
|
|
989
|
+
path: import_node_path2.default.join(configManager.spaRootPath, "src", "dummy-client.ts")
|
|
990
|
+
}
|
|
988
991
|
};
|
|
989
992
|
if (configManager.shouldSkipSDK()) {
|
|
990
|
-
alias["CLIENT_IMPORT"] =
|
|
993
|
+
alias["CLIENT_IMPORT"] = import_node_path2.default.join(
|
|
991
994
|
configManager.spaRootPath,
|
|
992
995
|
"src",
|
|
993
996
|
"dummy-client.ts"
|
|
@@ -1059,17 +1062,17 @@ var import_pluginutils = require("@rollup/pluginutils");
|
|
|
1059
1062
|
var import_fs = __toESM(require("fs"));
|
|
1060
1063
|
var import_vite2 = require("vite");
|
|
1061
1064
|
var import_esbuild = require("esbuild");
|
|
1062
|
-
var
|
|
1065
|
+
var import_path3 = __toESM(require("path"));
|
|
1063
1066
|
var import_body_parser = __toESM(require("body-parser"));
|
|
1064
1067
|
var import_cors = __toESM(require("cors"));
|
|
1065
1068
|
var import_graphql = require("@tinacms/graphql");
|
|
1066
1069
|
|
|
1067
1070
|
// src/next/commands/dev-command/server/media.ts
|
|
1068
1071
|
var import_fs_extra3 = __toESM(require("fs-extra"));
|
|
1069
|
-
var
|
|
1072
|
+
var import_path2 = __toESM(require("path"));
|
|
1070
1073
|
var import_busboy = __toESM(require("busboy"));
|
|
1071
1074
|
var createMediaRouter = (config2) => {
|
|
1072
|
-
const mediaFolder =
|
|
1075
|
+
const mediaFolder = import_path2.default.join(
|
|
1073
1076
|
config2.rootPath,
|
|
1074
1077
|
config2.publicFolder,
|
|
1075
1078
|
config2.mediaRoot
|
|
@@ -1097,8 +1100,8 @@ var createMediaRouter = (config2) => {
|
|
|
1097
1100
|
bb.on("file", async (_name, file, _info) => {
|
|
1098
1101
|
var _a;
|
|
1099
1102
|
const fullPath = decodeURI((_a = req.url) == null ? void 0 : _a.slice("/media/upload/".length));
|
|
1100
|
-
const saveTo =
|
|
1101
|
-
await import_fs_extra3.default.ensureDir(
|
|
1103
|
+
const saveTo = import_path2.default.join(mediaFolder, ...fullPath.split("/"));
|
|
1104
|
+
await import_fs_extra3.default.ensureDir(import_path2.default.dirname(saveTo));
|
|
1102
1105
|
file.pipe(import_fs_extra3.default.createWriteStream(saveTo));
|
|
1103
1106
|
});
|
|
1104
1107
|
bb.on("error", (error) => {
|
|
@@ -1133,7 +1136,7 @@ var MediaModel = class {
|
|
|
1133
1136
|
}
|
|
1134
1137
|
async listMedia(args) {
|
|
1135
1138
|
try {
|
|
1136
|
-
const folderPath = (0,
|
|
1139
|
+
const folderPath = (0, import_path2.join)(
|
|
1137
1140
|
this.rootPath,
|
|
1138
1141
|
this.publicFolder,
|
|
1139
1142
|
this.mediaRoot,
|
|
@@ -1148,7 +1151,7 @@ var MediaModel = class {
|
|
|
1148
1151
|
}
|
|
1149
1152
|
const filesStr = await import_fs_extra3.default.readdir(folderPath);
|
|
1150
1153
|
const filesProm = filesStr.map(async (file) => {
|
|
1151
|
-
const filePath = (0,
|
|
1154
|
+
const filePath = (0, import_path2.join)(folderPath, file);
|
|
1152
1155
|
const stat = await import_fs_extra3.default.stat(filePath);
|
|
1153
1156
|
let src = `/${file}`;
|
|
1154
1157
|
const isFile = stat.isFile();
|
|
@@ -1205,7 +1208,7 @@ var MediaModel = class {
|
|
|
1205
1208
|
}
|
|
1206
1209
|
async deleteMedia(args) {
|
|
1207
1210
|
try {
|
|
1208
|
-
const file = (0,
|
|
1211
|
+
const file = (0, import_path2.join)(
|
|
1209
1212
|
this.rootPath,
|
|
1210
1213
|
this.publicFolder,
|
|
1211
1214
|
this.mediaRoot,
|
|
@@ -1270,7 +1273,7 @@ var transformTsxPlugin = ({
|
|
|
1270
1273
|
const plug = {
|
|
1271
1274
|
name: "transform-tsx",
|
|
1272
1275
|
async transform(code, id) {
|
|
1273
|
-
const extName =
|
|
1276
|
+
const extName = import_path3.default.extname(id);
|
|
1274
1277
|
if (extName.startsWith(".tsx") || extName.startsWith(".ts")) {
|
|
1275
1278
|
const result = await (0, import_esbuild.transform)(code, { loader: "tsx" });
|
|
1276
1279
|
return {
|
|
@@ -1422,7 +1425,7 @@ var createDevServer = async (configManager, database, searchIndex, apiURL, noWat
|
|
|
1422
1425
|
|
|
1423
1426
|
// src/next/codegen/index.ts
|
|
1424
1427
|
var import_fs_extra4 = __toESM(require("fs-extra"));
|
|
1425
|
-
var
|
|
1428
|
+
var import_path4 = __toESM(require("path"));
|
|
1426
1429
|
var import_graphql6 = require("graphql");
|
|
1427
1430
|
|
|
1428
1431
|
// src/next/codegen/codegen/index.ts
|
|
@@ -1668,11 +1671,11 @@ var Codegen = class {
|
|
|
1668
1671
|
this.noClientBuildCache = noClientBuildCache;
|
|
1669
1672
|
}
|
|
1670
1673
|
async writeConfigFile(fileName, data) {
|
|
1671
|
-
const filePath =
|
|
1674
|
+
const filePath = import_path4.default.join(this.configManager.generatedFolderPath, fileName);
|
|
1672
1675
|
await import_fs_extra4.default.ensureFile(filePath);
|
|
1673
1676
|
await import_fs_extra4.default.outputFile(filePath, data);
|
|
1674
1677
|
if (this.configManager.hasSeparateContentRoot()) {
|
|
1675
|
-
const filePath2 =
|
|
1678
|
+
const filePath2 = import_path4.default.join(
|
|
1676
1679
|
this.configManager.generatedFolderPathContentRepo,
|
|
1677
1680
|
fileName
|
|
1678
1681
|
);
|
|
@@ -2324,14 +2327,14 @@ var DevCommand = class extends BaseCommand {
|
|
|
2324
2327
|
graphql: graphqlSchemaObject
|
|
2325
2328
|
});
|
|
2326
2329
|
import_fs_extra6.default.writeFileSync(
|
|
2327
|
-
|
|
2330
|
+
import_path5.default.join(configManager.tinaFolderPath, tinaLockFilename),
|
|
2328
2331
|
tinaLockContent
|
|
2329
2332
|
);
|
|
2330
2333
|
if (configManager.hasSeparateContentRoot()) {
|
|
2331
2334
|
const rootPath = await configManager.getTinaFolderPath(
|
|
2332
2335
|
configManager.contentRootPath
|
|
2333
2336
|
);
|
|
2334
|
-
const filePath =
|
|
2337
|
+
const filePath = import_path5.default.join(rootPath, tinaLockFilename);
|
|
2335
2338
|
await import_fs_extra6.default.ensureFile(filePath);
|
|
2336
2339
|
await import_fs_extra6.default.outputFile(filePath, tinaLockContent);
|
|
2337
2340
|
}
|
|
@@ -2478,7 +2481,7 @@ ${dangerText(e.message)}
|
|
|
2478
2481
|
watchContentFiles(configManager, database, searchIndexer) {
|
|
2479
2482
|
const collectionContentFiles = [];
|
|
2480
2483
|
configManager.config.schema.collections.forEach((collection) => {
|
|
2481
|
-
const collectionGlob = `${
|
|
2484
|
+
const collectionGlob = `${import_path5.default.join(
|
|
2482
2485
|
configManager.contentRootPath,
|
|
2483
2486
|
collection.path
|
|
2484
2487
|
)}/**/*.${collection.format || "md"}`;
|
|
@@ -3469,25 +3472,25 @@ var import_clipanion6 = require("clipanion");
|
|
|
3469
3472
|
|
|
3470
3473
|
// src/cmds/init/detectEnvironment.ts
|
|
3471
3474
|
var import_fs_extra8 = __toESM(require("fs-extra"));
|
|
3472
|
-
var
|
|
3475
|
+
var import_path6 = __toESM(require("path"));
|
|
3473
3476
|
var checkGitignoreForItem = async ({
|
|
3474
3477
|
baseDir,
|
|
3475
3478
|
line
|
|
3476
3479
|
}) => {
|
|
3477
|
-
const gitignoreContent = import_fs_extra8.default.readFileSync(
|
|
3480
|
+
const gitignoreContent = import_fs_extra8.default.readFileSync(import_path6.default.join(baseDir, ".gitignore")).toString();
|
|
3478
3481
|
return gitignoreContent.split("\n").some((item) => item === line);
|
|
3479
3482
|
};
|
|
3480
3483
|
var makeGeneratedFile = async (name2, generatedFileType, parentPath, opts) => {
|
|
3481
3484
|
const result = {
|
|
3482
|
-
fullPathTS:
|
|
3485
|
+
fullPathTS: import_path6.default.join(
|
|
3483
3486
|
parentPath,
|
|
3484
3487
|
`${name2}.${(opts == null ? void 0 : opts.typescriptSuffix) || (opts == null ? void 0 : opts.extensionOverride) || "ts"}`
|
|
3485
3488
|
),
|
|
3486
|
-
fullPathJS:
|
|
3489
|
+
fullPathJS: import_path6.default.join(
|
|
3487
3490
|
parentPath,
|
|
3488
3491
|
`${name2}.${(opts == null ? void 0 : opts.extensionOverride) || "js"}`
|
|
3489
3492
|
),
|
|
3490
|
-
fullPathOverride: (opts == null ? void 0 : opts.extensionOverride) ?
|
|
3493
|
+
fullPathOverride: (opts == null ? void 0 : opts.extensionOverride) ? import_path6.default.join(parentPath, `${name2}.${opts == null ? void 0 : opts.extensionOverride}`) : "",
|
|
3491
3494
|
generatedFileType,
|
|
3492
3495
|
name: name2,
|
|
3493
3496
|
parentPath,
|
|
@@ -3517,16 +3520,16 @@ var detectEnvironment = async ({
|
|
|
3517
3520
|
}) => {
|
|
3518
3521
|
var _a;
|
|
3519
3522
|
const hasForestryConfig = await import_fs_extra8.default.pathExists(
|
|
3520
|
-
|
|
3523
|
+
import_path6.default.join(pathToForestryConfig, ".forestry", "settings.yml")
|
|
3521
3524
|
);
|
|
3522
|
-
const sampleContentPath =
|
|
3525
|
+
const sampleContentPath = import_path6.default.join(
|
|
3523
3526
|
baseDir,
|
|
3524
3527
|
"content",
|
|
3525
3528
|
"posts",
|
|
3526
3529
|
"hello-world.md"
|
|
3527
3530
|
);
|
|
3528
|
-
const usingSrc = import_fs_extra8.default.pathExistsSync(
|
|
3529
|
-
const tinaFolder =
|
|
3531
|
+
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")));
|
|
3532
|
+
const tinaFolder = import_path6.default.join(baseDir, "tina");
|
|
3530
3533
|
const tinaConfigExists = Boolean(
|
|
3531
3534
|
await import_fs_extra8.default.pathExists(tinaFolder) && (await import_fs_extra8.default.readdir(tinaFolder)).find((x) => x.includes("config"))
|
|
3532
3535
|
);
|
|
@@ -3540,12 +3543,12 @@ var detectEnvironment = async ({
|
|
|
3540
3543
|
"next-api-handler": await makeGeneratedFile(
|
|
3541
3544
|
"[...routes]",
|
|
3542
3545
|
"next-api-handler",
|
|
3543
|
-
|
|
3546
|
+
import_path6.default.join(...pagesDir, "api", "tina")
|
|
3544
3547
|
),
|
|
3545
3548
|
"reactive-example": await makeGeneratedFile(
|
|
3546
3549
|
"[filename]",
|
|
3547
3550
|
"reactive-example",
|
|
3548
|
-
|
|
3551
|
+
import_path6.default.join(...pagesDir, "demo", "blog"),
|
|
3549
3552
|
{
|
|
3550
3553
|
typescriptSuffix: "tsx"
|
|
3551
3554
|
}
|
|
@@ -3553,13 +3556,13 @@ var detectEnvironment = async ({
|
|
|
3553
3556
|
"users-json": await makeGeneratedFile(
|
|
3554
3557
|
"index",
|
|
3555
3558
|
"users-json",
|
|
3556
|
-
|
|
3559
|
+
import_path6.default.join(baseDir, "content", "users"),
|
|
3557
3560
|
{ extensionOverride: "json" }
|
|
3558
3561
|
),
|
|
3559
3562
|
"sample-content": await makeGeneratedFile(
|
|
3560
3563
|
"hello-world",
|
|
3561
3564
|
"sample-content",
|
|
3562
|
-
|
|
3565
|
+
import_path6.default.join(baseDir, "content", "posts"),
|
|
3563
3566
|
{ extensionOverride: "md" }
|
|
3564
3567
|
)
|
|
3565
3568
|
};
|
|
@@ -3585,13 +3588,13 @@ var detectEnvironment = async ({
|
|
|
3585
3588
|
);
|
|
3586
3589
|
}
|
|
3587
3590
|
}
|
|
3588
|
-
const hasGitIgnore = await import_fs_extra8.default.pathExists(
|
|
3591
|
+
const hasGitIgnore = await import_fs_extra8.default.pathExists(import_path6.default.join(".gitignore"));
|
|
3589
3592
|
const hasGitIgnoreNodeModules = hasGitIgnore && await checkGitignoreForItem({ baseDir, line: "node_modules" });
|
|
3590
3593
|
const hasEnvTina = hasGitIgnore && await checkGitignoreForItem({ baseDir, line: ".env.tina" });
|
|
3591
3594
|
const hasGitIgnoreEnv = hasGitIgnore && await checkGitignoreForItem({ baseDir, line: ".env" });
|
|
3592
3595
|
let frontMatterFormat;
|
|
3593
3596
|
if (hasForestryConfig) {
|
|
3594
|
-
const hugoConfigPath =
|
|
3597
|
+
const hugoConfigPath = import_path6.default.join(rootPath, "config.toml");
|
|
3595
3598
|
if (await import_fs_extra8.default.pathExists(hugoConfigPath)) {
|
|
3596
3599
|
const hugoConfig = await import_fs_extra8.default.readFile(hugoConfigPath, "utf8");
|
|
3597
3600
|
const metaDataFormat = (_a = hugoConfig.match(/metaDataFormat = "(.*)"/)) == null ? void 0 : _a[1];
|
|
@@ -4199,18 +4202,18 @@ var CLICommand = class {
|
|
|
4199
4202
|
};
|
|
4200
4203
|
|
|
4201
4204
|
// src/cmds/init/apply.ts
|
|
4202
|
-
var
|
|
4205
|
+
var import_path10 = __toESM(require("path"));
|
|
4203
4206
|
|
|
4204
4207
|
// src/cmds/forestry-migrate/index.ts
|
|
4205
4208
|
var import_fs_extra10 = __toESM(require("fs-extra"));
|
|
4206
|
-
var
|
|
4209
|
+
var import_path8 = __toESM(require("path"));
|
|
4207
4210
|
var import_js_yaml2 = __toESM(require("js-yaml"));
|
|
4208
4211
|
var import_minimatch = __toESM(require("minimatch"));
|
|
4209
4212
|
var import_graphql16 = require("@tinacms/graphql");
|
|
4210
4213
|
|
|
4211
4214
|
// src/cmds/forestry-migrate/util/index.ts
|
|
4212
4215
|
var import_fs_extra9 = __toESM(require("fs-extra"));
|
|
4213
|
-
var
|
|
4216
|
+
var import_path7 = __toESM(require("path"));
|
|
4214
4217
|
var import_js_yaml = __toESM(require("js-yaml"));
|
|
4215
4218
|
var import_zod = __toESM(require("zod"));
|
|
4216
4219
|
|
|
@@ -4621,7 +4624,7 @@ var transformForestryFieldsToTinaFields = ({
|
|
|
4621
4624
|
return tinaFields;
|
|
4622
4625
|
};
|
|
4623
4626
|
var getFieldsFromTemplates = ({ tem, pathToForestryConfig, skipBlocks = false }) => {
|
|
4624
|
-
const templatePath =
|
|
4627
|
+
const templatePath = import_path7.default.join(
|
|
4625
4628
|
pathToForestryConfig,
|
|
4626
4629
|
".forestry",
|
|
4627
4630
|
"front_matter",
|
|
@@ -4696,8 +4699,8 @@ var generateAllTemplates = async ({
|
|
|
4696
4699
|
pathToForestryConfig
|
|
4697
4700
|
}) => {
|
|
4698
4701
|
const allTemplates = (await import_fs_extra10.default.readdir(
|
|
4699
|
-
|
|
4700
|
-
)).map((tem) =>
|
|
4702
|
+
import_path8.default.join(pathToForestryConfig, ".forestry", "front_matter", "templates")
|
|
4703
|
+
)).map((tem) => import_path8.default.basename(tem, ".yml"));
|
|
4701
4704
|
const templateMap = /* @__PURE__ */ new Map();
|
|
4702
4705
|
const proms = allTemplates.map(async (tem) => {
|
|
4703
4706
|
try {
|
|
@@ -4839,9 +4842,9 @@ var generateCollectionFromForestrySection = (args) => {
|
|
|
4839
4842
|
return c;
|
|
4840
4843
|
} else if (section.type === "document") {
|
|
4841
4844
|
const filePath = section.path;
|
|
4842
|
-
const extname =
|
|
4843
|
-
const fileName =
|
|
4844
|
-
const dir =
|
|
4845
|
+
const extname = import_path8.default.extname(filePath);
|
|
4846
|
+
const fileName = import_path8.default.basename(filePath, extname);
|
|
4847
|
+
const dir = import_path8.default.dirname(filePath);
|
|
4845
4848
|
const ext = checkExt(extname);
|
|
4846
4849
|
if (ext) {
|
|
4847
4850
|
const fields = [];
|
|
@@ -4904,7 +4907,7 @@ var generateCollections = async ({
|
|
|
4904
4907
|
usingTypescript
|
|
4905
4908
|
});
|
|
4906
4909
|
const forestryConfig = await import_fs_extra10.default.readFile(
|
|
4907
|
-
|
|
4910
|
+
import_path8.default.join(pathToForestryConfig, ".forestry", "settings.yml")
|
|
4908
4911
|
);
|
|
4909
4912
|
rewriteTemplateKeysInDocs({
|
|
4910
4913
|
templateMap,
|
|
@@ -4935,11 +4938,11 @@ var rewriteTemplateKeysInDocs = (args) => {
|
|
|
4935
4938
|
const { templateObj } = templateMap.get(templateKey);
|
|
4936
4939
|
(_a = templateObj == null ? void 0 : templateObj.pages) == null ? void 0 : _a.forEach((page) => {
|
|
4937
4940
|
try {
|
|
4938
|
-
const filePath =
|
|
4941
|
+
const filePath = import_path8.default.join(page);
|
|
4939
4942
|
if (import_fs_extra10.default.lstatSync(filePath).isDirectory()) {
|
|
4940
4943
|
return;
|
|
4941
4944
|
}
|
|
4942
|
-
const extname =
|
|
4945
|
+
const extname = import_path8.default.extname(filePath);
|
|
4943
4946
|
const fileContent = import_fs_extra10.default.readFileSync(filePath).toString();
|
|
4944
4947
|
const content = (0, import_graphql16.parseFile)(
|
|
4945
4948
|
fileContent,
|
|
@@ -4971,7 +4974,7 @@ var import_fs_extra13 = __toESM(require("fs-extra"));
|
|
|
4971
4974
|
// src/next/commands/codemod-command/index.ts
|
|
4972
4975
|
var import_clipanion5 = require("clipanion");
|
|
4973
4976
|
var import_fs_extra11 = __toESM(require("fs-extra"));
|
|
4974
|
-
var
|
|
4977
|
+
var import_path9 = __toESM(require("path"));
|
|
4975
4978
|
var CodemodCommand = class extends import_clipanion5.Command {
|
|
4976
4979
|
constructor() {
|
|
4977
4980
|
super(...arguments);
|
|
@@ -5015,7 +5018,7 @@ var moveTinaFolder = async (rootPath = process.cwd()) => {
|
|
|
5015
5018
|
logger.error(e.message);
|
|
5016
5019
|
process.exit(1);
|
|
5017
5020
|
}
|
|
5018
|
-
const tinaDestination =
|
|
5021
|
+
const tinaDestination = import_path9.default.join(configManager.rootPath, "tina");
|
|
5019
5022
|
if (await import_fs_extra11.default.existsSync(tinaDestination)) {
|
|
5020
5023
|
logger.info(
|
|
5021
5024
|
`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.`
|
|
@@ -5030,7 +5033,7 @@ var moveTinaFolder = async (rootPath = process.cwd()) => {
|
|
|
5030
5033
|
};
|
|
5031
5034
|
var writeGitignore = async (rootPath) => {
|
|
5032
5035
|
await import_fs_extra11.default.outputFileSync(
|
|
5033
|
-
|
|
5036
|
+
import_path9.default.join(rootPath, "tina", ".gitignore"),
|
|
5034
5037
|
"__generated__"
|
|
5035
5038
|
);
|
|
5036
5039
|
};
|
|
@@ -5868,8 +5871,8 @@ async function apply({
|
|
|
5868
5871
|
await addConfigFile({
|
|
5869
5872
|
configArgs: {
|
|
5870
5873
|
config: config2,
|
|
5871
|
-
publicFolder:
|
|
5872
|
-
|
|
5874
|
+
publicFolder: import_path10.default.join(
|
|
5875
|
+
import_path10.default.relative(process.cwd(), pathToForestryConfig),
|
|
5873
5876
|
config2.publicFolder
|
|
5874
5877
|
),
|
|
5875
5878
|
collections,
|
|
@@ -5936,18 +5939,18 @@ var createPackageJSON = async () => {
|
|
|
5936
5939
|
};
|
|
5937
5940
|
var createGitignore = async ({ baseDir }) => {
|
|
5938
5941
|
logger.info(logText("No .gitignore found, creating one"));
|
|
5939
|
-
import_fs_extra13.default.outputFileSync(
|
|
5942
|
+
import_fs_extra13.default.outputFileSync(import_path10.default.join(baseDir, ".gitignore"), "node_modules");
|
|
5940
5943
|
};
|
|
5941
5944
|
var updateGitIgnore = async ({
|
|
5942
5945
|
baseDir,
|
|
5943
5946
|
items
|
|
5944
5947
|
}) => {
|
|
5945
5948
|
logger.info(logText(`Adding ${items.join(",")} to .gitignore`));
|
|
5946
|
-
const gitignoreContent = import_fs_extra13.default.readFileSync(
|
|
5949
|
+
const gitignoreContent = import_fs_extra13.default.readFileSync(import_path10.default.join(baseDir, ".gitignore")).toString();
|
|
5947
5950
|
const newGitignoreContent = [...gitignoreContent.split("\n"), ...items].join(
|
|
5948
5951
|
"\n"
|
|
5949
5952
|
);
|
|
5950
|
-
await import_fs_extra13.default.writeFile(
|
|
5953
|
+
await import_fs_extra13.default.writeFile(import_path10.default.join(baseDir, ".gitignore"), newGitignoreContent);
|
|
5951
5954
|
};
|
|
5952
5955
|
var addDependencies = async (config2, env, params) => {
|
|
5953
5956
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
@@ -6115,7 +6118,7 @@ var addContentFile = async ({
|
|
|
6115
6118
|
return () => ({
|
|
6116
6119
|
exists: env.sampleContentExists,
|
|
6117
6120
|
path: env.sampleContentPath,
|
|
6118
|
-
parentPath:
|
|
6121
|
+
parentPath: import_path10.default.dirname(env.sampleContentPath)
|
|
6119
6122
|
});
|
|
6120
6123
|
}
|
|
6121
6124
|
},
|
|
@@ -6138,7 +6141,7 @@ ${titleText(" TinaCMS ")} backend initialized!`));
|
|
|
6138
6141
|
return `${x.key}=${x.value || "***"}`;
|
|
6139
6142
|
}).join("\n") + `
|
|
6140
6143
|
TINA_PUBLIC_IS_LOCAL=true`;
|
|
6141
|
-
const envFile =
|
|
6144
|
+
const envFile = import_path10.default.join(process.cwd(), ".env");
|
|
6142
6145
|
if (!import_fs_extra13.default.existsSync(envFile)) {
|
|
6143
6146
|
logger.info(`Adding .env file to your project... \u2705`);
|
|
6144
6147
|
import_fs_extra13.default.writeFileSync(envFile, envFileText);
|
|
@@ -6202,7 +6205,7 @@ var addReactiveFile = {
|
|
|
6202
6205
|
dataLayer
|
|
6203
6206
|
}) => {
|
|
6204
6207
|
var _a, _b;
|
|
6205
|
-
const packageJsonPath =
|
|
6208
|
+
const packageJsonPath = import_path10.default.join(baseDir, "package.json");
|
|
6206
6209
|
await writeGeneratedFile({
|
|
6207
6210
|
generatedFile,
|
|
6208
6211
|
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": "0.0.0-
|
|
3
|
+
"version": "0.0.0-9b91b31-20241023063504",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@types/prompts": "^2.4.9",
|
|
39
39
|
"@types/yup": "^0.29.14",
|
|
40
40
|
"jest": "^29.7.0",
|
|
41
|
-
"@tinacms/scripts": "
|
|
41
|
+
"@tinacms/scripts": "1.3.0"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@graphql-codegen/core": "^2.6.8",
|
|
@@ -85,12 +85,12 @@
|
|
|
85
85
|
"vite": "^4.5.5",
|
|
86
86
|
"yup": "^0.32.11",
|
|
87
87
|
"zod": "^3.23.8",
|
|
88
|
-
"@tinacms/app": "0.0.0-
|
|
88
|
+
"@tinacms/app": "0.0.0-9b91b31-20241023063504",
|
|
89
|
+
"@tinacms/graphql": "1.5.6",
|
|
89
90
|
"@tinacms/metrics": "1.0.7",
|
|
90
|
-
"@tinacms/
|
|
91
|
-
"@tinacms/
|
|
92
|
-
"tinacms": "0.0.0-
|
|
93
|
-
"@tinacms/graphql": "0.0.0-8a702b8-20241010053417"
|
|
91
|
+
"@tinacms/search": "1.0.33",
|
|
92
|
+
"@tinacms/schema-tools": "1.6.6",
|
|
93
|
+
"tinacms": "0.0.0-9b91b31-20241023063504"
|
|
94
94
|
},
|
|
95
95
|
"publishConfig": {
|
|
96
96
|
"registry": "https://registry.npmjs.org"
|