@tinacms/cli 0.0.0-c8b1d84-20241003015733 → 0.0.0-e0ddb8c-20241004065742
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 +70 -70
- package/dist/next/vite/index.d.ts +3 -3
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ var version = "1.6.8";
|
|
|
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,10 +612,11 @@ 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
622
|
var import_tailwindcss = __toESM(require("tailwindcss"));
|
|
@@ -881,13 +882,12 @@ var tinaTailwind = (spaPath, prebuildFilePath) => {
|
|
|
881
882
|
};
|
|
882
883
|
|
|
883
884
|
// src/next/vite/index.ts
|
|
884
|
-
var import_normalize_path2 = __toESM(require("normalize-path"));
|
|
885
885
|
async function listFilesRecursively({
|
|
886
886
|
directoryPath,
|
|
887
887
|
config: config2,
|
|
888
888
|
roothPath
|
|
889
889
|
}) {
|
|
890
|
-
const fullDirectoryPath =
|
|
890
|
+
const fullDirectoryPath = import_node_path2.default.join(
|
|
891
891
|
roothPath,
|
|
892
892
|
config2.publicFolder,
|
|
893
893
|
directoryPath
|
|
@@ -899,23 +899,23 @@ async function listFilesRecursively({
|
|
|
899
899
|
const items = await import_fs_extra2.default.readdir(fullDirectoryPath);
|
|
900
900
|
const staticMediaItems = [];
|
|
901
901
|
for (const item of items) {
|
|
902
|
-
const itemPath =
|
|
902
|
+
const itemPath = import_node_path2.default.join(fullDirectoryPath, item);
|
|
903
903
|
const stats = await import_fs_extra2.default.promises.lstat(itemPath);
|
|
904
904
|
const staticMediaItem = {
|
|
905
905
|
id: item,
|
|
906
906
|
filename: item,
|
|
907
907
|
type: stats.isDirectory() ? "dir" : "file",
|
|
908
908
|
directory: `${directoryPath.replace(config2.mediaRoot, "")}`,
|
|
909
|
-
src: `/${
|
|
909
|
+
src: `/${import_node_path2.default.join(directoryPath, item)}`,
|
|
910
910
|
thumbnails: {
|
|
911
|
-
"75x75": `/${
|
|
912
|
-
"400x400": `/${
|
|
913
|
-
"1000x1000": `/${
|
|
911
|
+
"75x75": `/${import_node_path2.default.join(directoryPath, item)}`,
|
|
912
|
+
"400x400": `/${import_node_path2.default.join(directoryPath, item)}`,
|
|
913
|
+
"1000x1000": `/${import_node_path2.default.join(directoryPath, item)}`
|
|
914
914
|
}
|
|
915
915
|
};
|
|
916
916
|
if (stats.isDirectory()) {
|
|
917
917
|
staticMediaItem.children = await listFilesRecursively({
|
|
918
|
-
directoryPath:
|
|
918
|
+
directoryPath: import_node_path2.default.join(directoryPath, item),
|
|
919
919
|
config: config2,
|
|
920
920
|
roothPath
|
|
921
921
|
});
|
|
@@ -958,7 +958,7 @@ var createConfig = async ({
|
|
|
958
958
|
}
|
|
959
959
|
}
|
|
960
960
|
});
|
|
961
|
-
const staticMediaPath =
|
|
961
|
+
const staticMediaPath = import_node_path2.default.join(
|
|
962
962
|
configManager.generatedFolderPath,
|
|
963
963
|
"static-media.json"
|
|
964
964
|
);
|
|
@@ -976,13 +976,13 @@ var createConfig = async ({
|
|
|
976
976
|
TINA_IMPORT: configManager.prebuildFilePath,
|
|
977
977
|
SCHEMA_IMPORT: configManager.generatedGraphQLJSONPath,
|
|
978
978
|
STATIC_MEDIA_IMPORT: staticMediaPath,
|
|
979
|
-
crypto:
|
|
980
|
-
fs:
|
|
981
|
-
os:
|
|
982
|
-
path:
|
|
979
|
+
crypto: import_node_path2.default.join(configManager.spaRootPath, "src", "dummy-client.ts"),
|
|
980
|
+
fs: import_node_path2.default.join(configManager.spaRootPath, "src", "dummy-client.ts"),
|
|
981
|
+
os: import_node_path2.default.join(configManager.spaRootPath, "src", "dummy-client.ts"),
|
|
982
|
+
path: import_node_path2.default.join(configManager.spaRootPath, "src", "dummy-client.ts")
|
|
983
983
|
};
|
|
984
984
|
if (configManager.shouldSkipSDK()) {
|
|
985
|
-
alias["CLIENT_IMPORT"] =
|
|
985
|
+
alias["CLIENT_IMPORT"] = import_node_path2.default.join(
|
|
986
986
|
configManager.spaRootPath,
|
|
987
987
|
"src",
|
|
988
988
|
"dummy-client.ts"
|
|
@@ -1054,17 +1054,17 @@ var import_pluginutils = require("@rollup/pluginutils");
|
|
|
1054
1054
|
var import_fs = __toESM(require("fs"));
|
|
1055
1055
|
var import_vite2 = require("vite");
|
|
1056
1056
|
var import_esbuild = require("esbuild");
|
|
1057
|
-
var
|
|
1057
|
+
var import_path3 = __toESM(require("path"));
|
|
1058
1058
|
var import_body_parser = __toESM(require("body-parser"));
|
|
1059
1059
|
var import_cors = __toESM(require("cors"));
|
|
1060
1060
|
var import_graphql = require("@tinacms/graphql");
|
|
1061
1061
|
|
|
1062
1062
|
// src/next/commands/dev-command/server/media.ts
|
|
1063
1063
|
var import_fs_extra3 = __toESM(require("fs-extra"));
|
|
1064
|
-
var
|
|
1064
|
+
var import_path2 = __toESM(require("path"));
|
|
1065
1065
|
var import_busboy = __toESM(require("busboy"));
|
|
1066
1066
|
var createMediaRouter = (config2) => {
|
|
1067
|
-
const mediaFolder =
|
|
1067
|
+
const mediaFolder = import_path2.default.join(
|
|
1068
1068
|
config2.rootPath,
|
|
1069
1069
|
config2.publicFolder,
|
|
1070
1070
|
config2.mediaRoot
|
|
@@ -1092,8 +1092,8 @@ var createMediaRouter = (config2) => {
|
|
|
1092
1092
|
bb.on("file", async (_name, file, _info) => {
|
|
1093
1093
|
var _a;
|
|
1094
1094
|
const fullPath = decodeURI((_a = req.url) == null ? void 0 : _a.slice("/media/upload/".length));
|
|
1095
|
-
const saveTo =
|
|
1096
|
-
await import_fs_extra3.default.ensureDir(
|
|
1095
|
+
const saveTo = import_path2.default.join(mediaFolder, ...fullPath.split("/"));
|
|
1096
|
+
await import_fs_extra3.default.ensureDir(import_path2.default.dirname(saveTo));
|
|
1097
1097
|
file.pipe(import_fs_extra3.default.createWriteStream(saveTo));
|
|
1098
1098
|
});
|
|
1099
1099
|
bb.on("error", (error) => {
|
|
@@ -1128,7 +1128,7 @@ var MediaModel = class {
|
|
|
1128
1128
|
}
|
|
1129
1129
|
async listMedia(args) {
|
|
1130
1130
|
try {
|
|
1131
|
-
const folderPath = (0,
|
|
1131
|
+
const folderPath = (0, import_path2.join)(
|
|
1132
1132
|
this.rootPath,
|
|
1133
1133
|
this.publicFolder,
|
|
1134
1134
|
this.mediaRoot,
|
|
@@ -1143,7 +1143,7 @@ var MediaModel = class {
|
|
|
1143
1143
|
}
|
|
1144
1144
|
const filesStr = await import_fs_extra3.default.readdir(folderPath);
|
|
1145
1145
|
const filesProm = filesStr.map(async (file) => {
|
|
1146
|
-
const filePath = (0,
|
|
1146
|
+
const filePath = (0, import_path2.join)(folderPath, file);
|
|
1147
1147
|
const stat = await import_fs_extra3.default.stat(filePath);
|
|
1148
1148
|
let src = `/${file}`;
|
|
1149
1149
|
const isFile = stat.isFile();
|
|
@@ -1200,7 +1200,7 @@ var MediaModel = class {
|
|
|
1200
1200
|
}
|
|
1201
1201
|
async deleteMedia(args) {
|
|
1202
1202
|
try {
|
|
1203
|
-
const file = (0,
|
|
1203
|
+
const file = (0, import_path2.join)(
|
|
1204
1204
|
this.rootPath,
|
|
1205
1205
|
this.publicFolder,
|
|
1206
1206
|
this.mediaRoot,
|
|
@@ -1265,7 +1265,7 @@ var transformTsxPlugin = ({
|
|
|
1265
1265
|
const plug = {
|
|
1266
1266
|
name: "transform-tsx",
|
|
1267
1267
|
async transform(code, id) {
|
|
1268
|
-
const extName =
|
|
1268
|
+
const extName = import_path3.default.extname(id);
|
|
1269
1269
|
if (extName.startsWith(".tsx") || extName.startsWith(".ts")) {
|
|
1270
1270
|
const result = await (0, import_esbuild.transform)(code, { loader: "tsx" });
|
|
1271
1271
|
return {
|
|
@@ -1417,7 +1417,7 @@ var createDevServer = async (configManager, database, searchIndex, apiURL, noWat
|
|
|
1417
1417
|
|
|
1418
1418
|
// src/next/codegen/index.ts
|
|
1419
1419
|
var import_fs_extra4 = __toESM(require("fs-extra"));
|
|
1420
|
-
var
|
|
1420
|
+
var import_path4 = __toESM(require("path"));
|
|
1421
1421
|
var import_graphql6 = require("graphql");
|
|
1422
1422
|
|
|
1423
1423
|
// src/next/codegen/codegen/index.ts
|
|
@@ -1663,11 +1663,11 @@ var Codegen = class {
|
|
|
1663
1663
|
this.noClientBuildCache = noClientBuildCache;
|
|
1664
1664
|
}
|
|
1665
1665
|
async writeConfigFile(fileName, data) {
|
|
1666
|
-
const filePath =
|
|
1666
|
+
const filePath = import_path4.default.join(this.configManager.generatedFolderPath, fileName);
|
|
1667
1667
|
await import_fs_extra4.default.ensureFile(filePath);
|
|
1668
1668
|
await import_fs_extra4.default.outputFile(filePath, data);
|
|
1669
1669
|
if (this.configManager.hasSeparateContentRoot()) {
|
|
1670
|
-
const filePath2 =
|
|
1670
|
+
const filePath2 = import_path4.default.join(
|
|
1671
1671
|
this.configManager.generatedFolderPathContentRepo,
|
|
1672
1672
|
fileName
|
|
1673
1673
|
);
|
|
@@ -2319,14 +2319,14 @@ var DevCommand = class extends BaseCommand {
|
|
|
2319
2319
|
graphql: graphqlSchemaObject
|
|
2320
2320
|
});
|
|
2321
2321
|
import_fs_extra6.default.writeFileSync(
|
|
2322
|
-
|
|
2322
|
+
import_path5.default.join(configManager.tinaFolderPath, tinaLockFilename),
|
|
2323
2323
|
tinaLockContent
|
|
2324
2324
|
);
|
|
2325
2325
|
if (configManager.hasSeparateContentRoot()) {
|
|
2326
2326
|
const rootPath = await configManager.getTinaFolderPath(
|
|
2327
2327
|
configManager.contentRootPath
|
|
2328
2328
|
);
|
|
2329
|
-
const filePath =
|
|
2329
|
+
const filePath = import_path5.default.join(rootPath, tinaLockFilename);
|
|
2330
2330
|
await import_fs_extra6.default.ensureFile(filePath);
|
|
2331
2331
|
await import_fs_extra6.default.outputFile(filePath, tinaLockContent);
|
|
2332
2332
|
}
|
|
@@ -2473,7 +2473,7 @@ ${dangerText(e.message)}
|
|
|
2473
2473
|
watchContentFiles(configManager, database, searchIndexer) {
|
|
2474
2474
|
const collectionContentFiles = [];
|
|
2475
2475
|
configManager.config.schema.collections.forEach((collection) => {
|
|
2476
|
-
const collectionGlob = `${
|
|
2476
|
+
const collectionGlob = `${import_path5.default.join(
|
|
2477
2477
|
configManager.contentRootPath,
|
|
2478
2478
|
collection.path
|
|
2479
2479
|
)}/**/*.${collection.format || "md"}`;
|
|
@@ -3464,25 +3464,25 @@ var import_clipanion6 = require("clipanion");
|
|
|
3464
3464
|
|
|
3465
3465
|
// src/cmds/init/detectEnvironment.ts
|
|
3466
3466
|
var import_fs_extra8 = __toESM(require("fs-extra"));
|
|
3467
|
-
var
|
|
3467
|
+
var import_path6 = __toESM(require("path"));
|
|
3468
3468
|
var checkGitignoreForItem = async ({
|
|
3469
3469
|
baseDir,
|
|
3470
3470
|
line
|
|
3471
3471
|
}) => {
|
|
3472
|
-
const gitignoreContent = import_fs_extra8.default.readFileSync(
|
|
3472
|
+
const gitignoreContent = import_fs_extra8.default.readFileSync(import_path6.default.join(baseDir, ".gitignore")).toString();
|
|
3473
3473
|
return gitignoreContent.split("\n").some((item) => item === line);
|
|
3474
3474
|
};
|
|
3475
3475
|
var makeGeneratedFile = async (name2, generatedFileType, parentPath, opts) => {
|
|
3476
3476
|
const result = {
|
|
3477
|
-
fullPathTS:
|
|
3477
|
+
fullPathTS: import_path6.default.join(
|
|
3478
3478
|
parentPath,
|
|
3479
3479
|
`${name2}.${(opts == null ? void 0 : opts.typescriptSuffix) || (opts == null ? void 0 : opts.extensionOverride) || "ts"}`
|
|
3480
3480
|
),
|
|
3481
|
-
fullPathJS:
|
|
3481
|
+
fullPathJS: import_path6.default.join(
|
|
3482
3482
|
parentPath,
|
|
3483
3483
|
`${name2}.${(opts == null ? void 0 : opts.extensionOverride) || "js"}`
|
|
3484
3484
|
),
|
|
3485
|
-
fullPathOverride: (opts == null ? void 0 : opts.extensionOverride) ?
|
|
3485
|
+
fullPathOverride: (opts == null ? void 0 : opts.extensionOverride) ? import_path6.default.join(parentPath, `${name2}.${opts == null ? void 0 : opts.extensionOverride}`) : "",
|
|
3486
3486
|
generatedFileType,
|
|
3487
3487
|
name: name2,
|
|
3488
3488
|
parentPath,
|
|
@@ -3512,16 +3512,16 @@ var detectEnvironment = async ({
|
|
|
3512
3512
|
}) => {
|
|
3513
3513
|
var _a;
|
|
3514
3514
|
const hasForestryConfig = await import_fs_extra8.default.pathExists(
|
|
3515
|
-
|
|
3515
|
+
import_path6.default.join(pathToForestryConfig, ".forestry", "settings.yml")
|
|
3516
3516
|
);
|
|
3517
|
-
const sampleContentPath =
|
|
3517
|
+
const sampleContentPath = import_path6.default.join(
|
|
3518
3518
|
baseDir,
|
|
3519
3519
|
"content",
|
|
3520
3520
|
"posts",
|
|
3521
3521
|
"hello-world.md"
|
|
3522
3522
|
);
|
|
3523
|
-
const usingSrc = import_fs_extra8.default.pathExistsSync(
|
|
3524
|
-
const tinaFolder =
|
|
3523
|
+
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")));
|
|
3524
|
+
const tinaFolder = import_path6.default.join(baseDir, "tina");
|
|
3525
3525
|
const tinaConfigExists = Boolean(
|
|
3526
3526
|
await import_fs_extra8.default.pathExists(tinaFolder) && (await import_fs_extra8.default.readdir(tinaFolder)).find((x) => x.includes("config"))
|
|
3527
3527
|
);
|
|
@@ -3535,12 +3535,12 @@ var detectEnvironment = async ({
|
|
|
3535
3535
|
"next-api-handler": await makeGeneratedFile(
|
|
3536
3536
|
"[...routes]",
|
|
3537
3537
|
"next-api-handler",
|
|
3538
|
-
|
|
3538
|
+
import_path6.default.join(...pagesDir, "api", "tina")
|
|
3539
3539
|
),
|
|
3540
3540
|
"reactive-example": await makeGeneratedFile(
|
|
3541
3541
|
"[filename]",
|
|
3542
3542
|
"reactive-example",
|
|
3543
|
-
|
|
3543
|
+
import_path6.default.join(...pagesDir, "demo", "blog"),
|
|
3544
3544
|
{
|
|
3545
3545
|
typescriptSuffix: "tsx"
|
|
3546
3546
|
}
|
|
@@ -3548,13 +3548,13 @@ var detectEnvironment = async ({
|
|
|
3548
3548
|
"users-json": await makeGeneratedFile(
|
|
3549
3549
|
"index",
|
|
3550
3550
|
"users-json",
|
|
3551
|
-
|
|
3551
|
+
import_path6.default.join(baseDir, "content", "users"),
|
|
3552
3552
|
{ extensionOverride: "json" }
|
|
3553
3553
|
),
|
|
3554
3554
|
"sample-content": await makeGeneratedFile(
|
|
3555
3555
|
"hello-world",
|
|
3556
3556
|
"sample-content",
|
|
3557
|
-
|
|
3557
|
+
import_path6.default.join(baseDir, "content", "posts"),
|
|
3558
3558
|
{ extensionOverride: "md" }
|
|
3559
3559
|
)
|
|
3560
3560
|
};
|
|
@@ -3580,13 +3580,13 @@ var detectEnvironment = async ({
|
|
|
3580
3580
|
);
|
|
3581
3581
|
}
|
|
3582
3582
|
}
|
|
3583
|
-
const hasGitIgnore = await import_fs_extra8.default.pathExists(
|
|
3583
|
+
const hasGitIgnore = await import_fs_extra8.default.pathExists(import_path6.default.join(".gitignore"));
|
|
3584
3584
|
const hasGitIgnoreNodeModules = hasGitIgnore && await checkGitignoreForItem({ baseDir, line: "node_modules" });
|
|
3585
3585
|
const hasEnvTina = hasGitIgnore && await checkGitignoreForItem({ baseDir, line: ".env.tina" });
|
|
3586
3586
|
const hasGitIgnoreEnv = hasGitIgnore && await checkGitignoreForItem({ baseDir, line: ".env" });
|
|
3587
3587
|
let frontMatterFormat;
|
|
3588
3588
|
if (hasForestryConfig) {
|
|
3589
|
-
const hugoConfigPath =
|
|
3589
|
+
const hugoConfigPath = import_path6.default.join(rootPath, "config.toml");
|
|
3590
3590
|
if (await import_fs_extra8.default.pathExists(hugoConfigPath)) {
|
|
3591
3591
|
const hugoConfig = await import_fs_extra8.default.readFile(hugoConfigPath, "utf8");
|
|
3592
3592
|
const metaDataFormat = (_a = hugoConfig.match(/metaDataFormat = "(.*)"/)) == null ? void 0 : _a[1];
|
|
@@ -4194,18 +4194,18 @@ var CLICommand = class {
|
|
|
4194
4194
|
};
|
|
4195
4195
|
|
|
4196
4196
|
// src/cmds/init/apply.ts
|
|
4197
|
-
var
|
|
4197
|
+
var import_path10 = __toESM(require("path"));
|
|
4198
4198
|
|
|
4199
4199
|
// src/cmds/forestry-migrate/index.ts
|
|
4200
4200
|
var import_fs_extra10 = __toESM(require("fs-extra"));
|
|
4201
|
-
var
|
|
4201
|
+
var import_path8 = __toESM(require("path"));
|
|
4202
4202
|
var import_js_yaml2 = __toESM(require("js-yaml"));
|
|
4203
4203
|
var import_minimatch = __toESM(require("minimatch"));
|
|
4204
4204
|
var import_graphql16 = require("@tinacms/graphql");
|
|
4205
4205
|
|
|
4206
4206
|
// src/cmds/forestry-migrate/util/index.ts
|
|
4207
4207
|
var import_fs_extra9 = __toESM(require("fs-extra"));
|
|
4208
|
-
var
|
|
4208
|
+
var import_path7 = __toESM(require("path"));
|
|
4209
4209
|
var import_js_yaml = __toESM(require("js-yaml"));
|
|
4210
4210
|
var import_zod = __toESM(require("zod"));
|
|
4211
4211
|
|
|
@@ -4616,7 +4616,7 @@ var transformForestryFieldsToTinaFields = ({
|
|
|
4616
4616
|
return tinaFields;
|
|
4617
4617
|
};
|
|
4618
4618
|
var getFieldsFromTemplates = ({ tem, pathToForestryConfig, skipBlocks = false }) => {
|
|
4619
|
-
const templatePath =
|
|
4619
|
+
const templatePath = import_path7.default.join(
|
|
4620
4620
|
pathToForestryConfig,
|
|
4621
4621
|
".forestry",
|
|
4622
4622
|
"front_matter",
|
|
@@ -4691,8 +4691,8 @@ var generateAllTemplates = async ({
|
|
|
4691
4691
|
pathToForestryConfig
|
|
4692
4692
|
}) => {
|
|
4693
4693
|
const allTemplates = (await import_fs_extra10.default.readdir(
|
|
4694
|
-
|
|
4695
|
-
)).map((tem) =>
|
|
4694
|
+
import_path8.default.join(pathToForestryConfig, ".forestry", "front_matter", "templates")
|
|
4695
|
+
)).map((tem) => import_path8.default.basename(tem, ".yml"));
|
|
4696
4696
|
const templateMap = /* @__PURE__ */ new Map();
|
|
4697
4697
|
const proms = allTemplates.map(async (tem) => {
|
|
4698
4698
|
try {
|
|
@@ -4834,9 +4834,9 @@ var generateCollectionFromForestrySection = (args) => {
|
|
|
4834
4834
|
return c;
|
|
4835
4835
|
} else if (section.type === "document") {
|
|
4836
4836
|
const filePath = section.path;
|
|
4837
|
-
const extname =
|
|
4838
|
-
const fileName =
|
|
4839
|
-
const dir =
|
|
4837
|
+
const extname = import_path8.default.extname(filePath);
|
|
4838
|
+
const fileName = import_path8.default.basename(filePath, extname);
|
|
4839
|
+
const dir = import_path8.default.dirname(filePath);
|
|
4840
4840
|
const ext = checkExt(extname);
|
|
4841
4841
|
if (ext) {
|
|
4842
4842
|
const fields = [];
|
|
@@ -4899,7 +4899,7 @@ var generateCollections = async ({
|
|
|
4899
4899
|
usingTypescript
|
|
4900
4900
|
});
|
|
4901
4901
|
const forestryConfig = await import_fs_extra10.default.readFile(
|
|
4902
|
-
|
|
4902
|
+
import_path8.default.join(pathToForestryConfig, ".forestry", "settings.yml")
|
|
4903
4903
|
);
|
|
4904
4904
|
rewriteTemplateKeysInDocs({
|
|
4905
4905
|
templateMap,
|
|
@@ -4930,11 +4930,11 @@ var rewriteTemplateKeysInDocs = (args) => {
|
|
|
4930
4930
|
const { templateObj } = templateMap.get(templateKey);
|
|
4931
4931
|
(_a = templateObj == null ? void 0 : templateObj.pages) == null ? void 0 : _a.forEach((page) => {
|
|
4932
4932
|
try {
|
|
4933
|
-
const filePath =
|
|
4933
|
+
const filePath = import_path8.default.join(page);
|
|
4934
4934
|
if (import_fs_extra10.default.lstatSync(filePath).isDirectory()) {
|
|
4935
4935
|
return;
|
|
4936
4936
|
}
|
|
4937
|
-
const extname =
|
|
4937
|
+
const extname = import_path8.default.extname(filePath);
|
|
4938
4938
|
const fileContent = import_fs_extra10.default.readFileSync(filePath).toString();
|
|
4939
4939
|
const content = (0, import_graphql16.parseFile)(
|
|
4940
4940
|
fileContent,
|
|
@@ -4966,7 +4966,7 @@ var import_fs_extra13 = __toESM(require("fs-extra"));
|
|
|
4966
4966
|
// src/next/commands/codemod-command/index.ts
|
|
4967
4967
|
var import_clipanion5 = require("clipanion");
|
|
4968
4968
|
var import_fs_extra11 = __toESM(require("fs-extra"));
|
|
4969
|
-
var
|
|
4969
|
+
var import_path9 = __toESM(require("path"));
|
|
4970
4970
|
var CodemodCommand = class extends import_clipanion5.Command {
|
|
4971
4971
|
constructor() {
|
|
4972
4972
|
super(...arguments);
|
|
@@ -5010,7 +5010,7 @@ var moveTinaFolder = async (rootPath = process.cwd()) => {
|
|
|
5010
5010
|
logger.error(e.message);
|
|
5011
5011
|
process.exit(1);
|
|
5012
5012
|
}
|
|
5013
|
-
const tinaDestination =
|
|
5013
|
+
const tinaDestination = import_path9.default.join(configManager.rootPath, "tina");
|
|
5014
5014
|
if (await import_fs_extra11.default.existsSync(tinaDestination)) {
|
|
5015
5015
|
logger.info(
|
|
5016
5016
|
`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 +5025,7 @@ var moveTinaFolder = async (rootPath = process.cwd()) => {
|
|
|
5025
5025
|
};
|
|
5026
5026
|
var writeGitignore = async (rootPath) => {
|
|
5027
5027
|
await import_fs_extra11.default.outputFileSync(
|
|
5028
|
-
|
|
5028
|
+
import_path9.default.join(rootPath, "tina", ".gitignore"),
|
|
5029
5029
|
"__generated__"
|
|
5030
5030
|
);
|
|
5031
5031
|
};
|
|
@@ -5863,8 +5863,8 @@ async function apply({
|
|
|
5863
5863
|
await addConfigFile({
|
|
5864
5864
|
configArgs: {
|
|
5865
5865
|
config: config2,
|
|
5866
|
-
publicFolder:
|
|
5867
|
-
|
|
5866
|
+
publicFolder: import_path10.default.join(
|
|
5867
|
+
import_path10.default.relative(process.cwd(), pathToForestryConfig),
|
|
5868
5868
|
config2.publicFolder
|
|
5869
5869
|
),
|
|
5870
5870
|
collections,
|
|
@@ -5931,18 +5931,18 @@ var createPackageJSON = async () => {
|
|
|
5931
5931
|
};
|
|
5932
5932
|
var createGitignore = async ({ baseDir }) => {
|
|
5933
5933
|
logger.info(logText("No .gitignore found, creating one"));
|
|
5934
|
-
import_fs_extra13.default.outputFileSync(
|
|
5934
|
+
import_fs_extra13.default.outputFileSync(import_path10.default.join(baseDir, ".gitignore"), "node_modules");
|
|
5935
5935
|
};
|
|
5936
5936
|
var updateGitIgnore = async ({
|
|
5937
5937
|
baseDir,
|
|
5938
5938
|
items
|
|
5939
5939
|
}) => {
|
|
5940
5940
|
logger.info(logText(`Adding ${items.join(",")} to .gitignore`));
|
|
5941
|
-
const gitignoreContent = import_fs_extra13.default.readFileSync(
|
|
5941
|
+
const gitignoreContent = import_fs_extra13.default.readFileSync(import_path10.default.join(baseDir, ".gitignore")).toString();
|
|
5942
5942
|
const newGitignoreContent = [...gitignoreContent.split("\n"), ...items].join(
|
|
5943
5943
|
"\n"
|
|
5944
5944
|
);
|
|
5945
|
-
await import_fs_extra13.default.writeFile(
|
|
5945
|
+
await import_fs_extra13.default.writeFile(import_path10.default.join(baseDir, ".gitignore"), newGitignoreContent);
|
|
5946
5946
|
};
|
|
5947
5947
|
var addDependencies = async (config2, env, params) => {
|
|
5948
5948
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
@@ -6110,7 +6110,7 @@ var addContentFile = async ({
|
|
|
6110
6110
|
return () => ({
|
|
6111
6111
|
exists: env.sampleContentExists,
|
|
6112
6112
|
path: env.sampleContentPath,
|
|
6113
|
-
parentPath:
|
|
6113
|
+
parentPath: import_path10.default.dirname(env.sampleContentPath)
|
|
6114
6114
|
});
|
|
6115
6115
|
}
|
|
6116
6116
|
},
|
|
@@ -6133,7 +6133,7 @@ ${titleText(" TinaCMS ")} backend initialized!`));
|
|
|
6133
6133
|
return `${x.key}=${x.value || "***"}`;
|
|
6134
6134
|
}).join("\n") + `
|
|
6135
6135
|
TINA_PUBLIC_IS_LOCAL=true`;
|
|
6136
|
-
const envFile =
|
|
6136
|
+
const envFile = import_path10.default.join(process.cwd(), ".env");
|
|
6137
6137
|
if (!import_fs_extra13.default.existsSync(envFile)) {
|
|
6138
6138
|
logger.info(`Adding .env file to your project... \u2705`);
|
|
6139
6139
|
import_fs_extra13.default.writeFileSync(envFile, envFileText);
|
|
@@ -6197,7 +6197,7 @@ var addReactiveFile = {
|
|
|
6197
6197
|
dataLayer
|
|
6198
6198
|
}) => {
|
|
6199
6199
|
var _a, _b;
|
|
6200
|
-
const packageJsonPath =
|
|
6200
|
+
const packageJsonPath = import_path10.default.join(baseDir, "package.json");
|
|
6201
6201
|
await writeGeneratedFile({
|
|
6202
6202
|
generatedFile,
|
|
6203
6203
|
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-e0ddb8c-20241004065742",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -84,12 +84,12 @@
|
|
|
84
84
|
"vite": "^4.5.5",
|
|
85
85
|
"yup": "^0.32.11",
|
|
86
86
|
"zod": "^3.23.8",
|
|
87
|
+
"@tinacms/app": "0.0.0-e0ddb8c-20241004065742",
|
|
88
|
+
"@tinacms/graphql": "0.0.0-e0ddb8c-20241004065742",
|
|
87
89
|
"@tinacms/metrics": "1.0.7",
|
|
88
|
-
"@tinacms/schema-tools": "0.0.0-
|
|
89
|
-
"@tinacms/
|
|
90
|
-
"
|
|
91
|
-
"@tinacms/search": "0.0.0-c8b1d84-20241003015733",
|
|
92
|
-
"tinacms": "0.0.0-c8b1d84-20241003015733"
|
|
90
|
+
"@tinacms/schema-tools": "0.0.0-e0ddb8c-20241004065742",
|
|
91
|
+
"@tinacms/search": "0.0.0-e0ddb8c-20241004065742",
|
|
92
|
+
"tinacms": "0.0.0-e0ddb8c-20241004065742"
|
|
93
93
|
},
|
|
94
94
|
"publishConfig": {
|
|
95
95
|
"registry": "https://registry.npmjs.org"
|