@tinacms/cli 0.0.0-d69e892-20241003042309 → 0.0.0-d7c745e-20250102002342
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
CHANGED
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
|
@@ -31,12 +35,12 @@ module.exports = __toCommonJS(src_exports);
|
|
|
31
35
|
var import_clipanion8 = require("clipanion");
|
|
32
36
|
|
|
33
37
|
// package.json
|
|
34
|
-
var version = "1.
|
|
38
|
+
var version = "1.7.0";
|
|
35
39
|
|
|
36
40
|
// src/next/commands/dev-command/index.ts
|
|
37
41
|
var import_clipanion2 = require("clipanion");
|
|
38
42
|
var import_fs_extra6 = __toESM(require("fs-extra"));
|
|
39
|
-
var
|
|
43
|
+
var import_path5 = __toESM(require("path"));
|
|
40
44
|
var import_chokidar = __toESM(require("chokidar"));
|
|
41
45
|
var import_graphql10 = require("@tinacms/graphql");
|
|
42
46
|
|
|
@@ -57,7 +61,10 @@ function isUnicodeSupported() {
|
|
|
57
61
|
if (process.platform !== "win32") {
|
|
58
62
|
return process.env.TERM !== "linux";
|
|
59
63
|
}
|
|
60
|
-
return Boolean(process.env.CI) || Boolean(process.env.WT_SESSION) ||
|
|
64
|
+
return Boolean(process.env.CI) || Boolean(process.env.WT_SESSION) || // Windows Terminal
|
|
65
|
+
Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
|
|
66
|
+
process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
|
|
67
|
+
process.env.TERM_PROGRAM === "Terminus-Sublime" || process.env.TERM_PROGRAM === "vscode" || process.env.TERM === "xterm-256color" || process.env.TERM === "alacritty" || process.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
61
68
|
}
|
|
62
69
|
|
|
63
70
|
// src/logger/index.ts
|
|
@@ -212,7 +219,7 @@ var ConfigManager = class {
|
|
|
212
219
|
this.generatedCachePath = import_path.default.join(
|
|
213
220
|
this.generatedFolderPath,
|
|
214
221
|
".cache",
|
|
215
|
-
String(new Date().getTime())
|
|
222
|
+
String((/* @__PURE__ */ new Date()).getTime())
|
|
216
223
|
);
|
|
217
224
|
this.generatedGraphQLGQLPath = import_path.default.join(
|
|
218
225
|
this.generatedFolderPath,
|
|
@@ -355,17 +362,22 @@ var ConfigManager = class {
|
|
|
355
362
|
);
|
|
356
363
|
}
|
|
357
364
|
getTinaGraphQLVersion() {
|
|
358
|
-
var _a, _b;
|
|
359
365
|
if (this.tinaGraphQLVersionFromCLI) {
|
|
360
|
-
|
|
366
|
+
const version2 = this.tinaGraphQLVersionFromCLI.split(".");
|
|
367
|
+
return {
|
|
368
|
+
fullVersion: this.tinaGraphQLVersionFromCLI,
|
|
369
|
+
major: version2[0] || "x",
|
|
370
|
+
minor: version2[1] || "x",
|
|
371
|
+
patch: version2[2] || "x"
|
|
372
|
+
};
|
|
361
373
|
}
|
|
362
374
|
const generatedSchema = import_fs_extra.default.readJSONSync(this.generatedSchemaJSONPath);
|
|
363
|
-
if (!generatedSchema || !(typeof (generatedSchema == null ? void 0 : generatedSchema.version) !== "undefined")
|
|
375
|
+
if (!generatedSchema || !(typeof (generatedSchema == null ? void 0 : generatedSchema.version) !== "undefined")) {
|
|
364
376
|
throw new Error(
|
|
365
377
|
`Can not find Tina GraphQL version in ${this.generatedSchemaJSONPath}`
|
|
366
378
|
);
|
|
367
379
|
}
|
|
368
|
-
return
|
|
380
|
+
return generatedSchema.version;
|
|
369
381
|
}
|
|
370
382
|
printGeneratedClientFilePath() {
|
|
371
383
|
if (this.isUsingTs()) {
|
|
@@ -394,6 +406,9 @@ var ConfigManager = class {
|
|
|
394
406
|
}
|
|
395
407
|
throw `No path provided to print`;
|
|
396
408
|
}
|
|
409
|
+
/**
|
|
410
|
+
* Given a filepath without an extension, find the first match (eg. tsx, ts, jsx, js)
|
|
411
|
+
*/
|
|
397
412
|
async getPathWithExtension(filepath) {
|
|
398
413
|
const extensions = ["tsx", "ts", "jsx", "js"];
|
|
399
414
|
let result;
|
|
@@ -427,7 +442,10 @@ var ConfigManager = class {
|
|
|
427
442
|
}
|
|
428
443
|
async loadConfigFile(generatedFolderPath, configFilePath) {
|
|
429
444
|
const tmpdir = import_path.default.join(import_os.default.tmpdir(), Date.now().toString());
|
|
430
|
-
const
|
|
445
|
+
const preBuildConfigPath = import_path.default.join(
|
|
446
|
+
this.generatedFolderPath,
|
|
447
|
+
"config.prebuild.jsx"
|
|
448
|
+
);
|
|
431
449
|
const outfile = import_path.default.join(tmpdir, "config.build.jsx");
|
|
432
450
|
const outfile2 = import_path.default.join(tmpdir, "config.build.js");
|
|
433
451
|
const tempTSConfigFile = import_path.default.join(tmpdir, "tsconfig.json");
|
|
@@ -441,7 +459,7 @@ var ConfigManager = class {
|
|
|
441
459
|
logLevel: "silent",
|
|
442
460
|
packages: "external",
|
|
443
461
|
ignoreAnnotations: true,
|
|
444
|
-
outfile:
|
|
462
|
+
outfile: preBuildConfigPath,
|
|
445
463
|
loader: loaders,
|
|
446
464
|
metafile: true
|
|
447
465
|
});
|
|
@@ -464,6 +482,7 @@ var ConfigManager = class {
|
|
|
464
482
|
await esbuild.build({
|
|
465
483
|
entryPoints: [outfile],
|
|
466
484
|
bundle: true,
|
|
485
|
+
// Suppress warning about comparison with -0 from client module
|
|
467
486
|
logLevel: "silent",
|
|
468
487
|
platform: "node",
|
|
469
488
|
outfile: outfile2,
|
|
@@ -481,7 +500,7 @@ var ConfigManager = class {
|
|
|
481
500
|
import_fs_extra.default.removeSync(outfile2);
|
|
482
501
|
return {
|
|
483
502
|
config: result.default,
|
|
484
|
-
prebuildPath:
|
|
503
|
+
prebuildPath: preBuildConfigPath,
|
|
485
504
|
watchList: flattenedList
|
|
486
505
|
};
|
|
487
506
|
}
|
|
@@ -570,19 +589,19 @@ var devHTML = (port) => `<!DOCTYPE html>
|
|
|
570
589
|
window.$RefreshReg$ = () => {}
|
|
571
590
|
window.$RefreshSig$ = () => (type) => type
|
|
572
591
|
window.__vite_plugin_react_preamble_installed__ = true
|
|
573
|
-
|
|
574
|
-
<script type="module" src="http://localhost:${port}/@vite/client"
|
|
592
|
+
</script>
|
|
593
|
+
<script type="module" src="http://localhost:${port}/@vite/client"></script>
|
|
575
594
|
<script>
|
|
576
595
|
function handleLoadError() {
|
|
577
596
|
// Assets have failed to load
|
|
578
597
|
document.getElementById('root').innerHTML = '${errorHTML}';
|
|
579
598
|
}
|
|
580
|
-
|
|
599
|
+
</script>
|
|
581
600
|
<script
|
|
582
601
|
type="module"
|
|
583
602
|
src="http://localhost:${port}/src/main.tsx"
|
|
584
603
|
onerror="handleLoadError()"
|
|
585
|
-
|
|
604
|
+
></script>
|
|
586
605
|
<body class="tina-tailwind">
|
|
587
606
|
<div id="root"></div>
|
|
588
607
|
</body>
|
|
@@ -612,20 +631,23 @@ var CONFIRMATION_TEXT = import_chalk3.default.dim("enter to confirm");
|
|
|
612
631
|
var import_vite3 = require("vite");
|
|
613
632
|
|
|
614
633
|
// src/next/vite/index.ts
|
|
615
|
-
var
|
|
634
|
+
var import_node_path2 = __toESM(require("path"));
|
|
635
|
+
var import_plugin_react = __toESM(require("@vitejs/plugin-react"));
|
|
616
636
|
var import_fs_extra2 = __toESM(require("fs-extra"));
|
|
637
|
+
var import_normalize_path2 = __toESM(require("normalize-path"));
|
|
617
638
|
var import_vite = require("vite");
|
|
618
|
-
var import_plugin_react = __toESM(require("@vitejs/plugin-react"));
|
|
619
639
|
|
|
620
640
|
// src/next/vite/tailwind.ts
|
|
641
|
+
var import_node_path = __toESM(require("path"));
|
|
642
|
+
var import_aspect_ratio = __toESM(require("@tailwindcss/aspect-ratio"));
|
|
643
|
+
var import_container_queries = __toESM(require("@tailwindcss/container-queries"));
|
|
644
|
+
var import_typography = __toESM(require("@tailwindcss/typography"));
|
|
621
645
|
var import_tailwindcss = __toESM(require("tailwindcss"));
|
|
622
646
|
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
647
|
var tinaTailwind = (spaPath, prebuildFilePath) => {
|
|
627
648
|
return {
|
|
628
649
|
name: "vite-plugin-tina",
|
|
650
|
+
// @ts-ignore
|
|
629
651
|
config: (viteConfig) => {
|
|
630
652
|
const plugins = [];
|
|
631
653
|
const content = [
|
|
@@ -866,7 +888,11 @@ var tinaTailwind = (spaPath, prebuildFilePath) => {
|
|
|
866
888
|
}
|
|
867
889
|
},
|
|
868
890
|
content,
|
|
869
|
-
plugins: [
|
|
891
|
+
plugins: [
|
|
892
|
+
(0, import_typography.default)({ className: "tina-prose" }),
|
|
893
|
+
import_aspect_ratio.default,
|
|
894
|
+
import_container_queries.default
|
|
895
|
+
]
|
|
870
896
|
});
|
|
871
897
|
plugins.push(tw);
|
|
872
898
|
return {
|
|
@@ -881,13 +907,12 @@ var tinaTailwind = (spaPath, prebuildFilePath) => {
|
|
|
881
907
|
};
|
|
882
908
|
|
|
883
909
|
// src/next/vite/index.ts
|
|
884
|
-
var import_normalize_path2 = __toESM(require("normalize-path"));
|
|
885
910
|
async function listFilesRecursively({
|
|
886
911
|
directoryPath,
|
|
887
912
|
config: config2,
|
|
888
913
|
roothPath
|
|
889
914
|
}) {
|
|
890
|
-
const fullDirectoryPath =
|
|
915
|
+
const fullDirectoryPath = import_node_path2.default.join(
|
|
891
916
|
roothPath,
|
|
892
917
|
config2.publicFolder,
|
|
893
918
|
directoryPath
|
|
@@ -899,23 +924,23 @@ async function listFilesRecursively({
|
|
|
899
924
|
const items = await import_fs_extra2.default.readdir(fullDirectoryPath);
|
|
900
925
|
const staticMediaItems = [];
|
|
901
926
|
for (const item of items) {
|
|
902
|
-
const itemPath =
|
|
927
|
+
const itemPath = import_node_path2.default.join(fullDirectoryPath, item);
|
|
903
928
|
const stats = await import_fs_extra2.default.promises.lstat(itemPath);
|
|
904
929
|
const staticMediaItem = {
|
|
905
930
|
id: item,
|
|
906
931
|
filename: item,
|
|
907
932
|
type: stats.isDirectory() ? "dir" : "file",
|
|
908
933
|
directory: `${directoryPath.replace(config2.mediaRoot, "")}`,
|
|
909
|
-
src: `/${
|
|
934
|
+
src: `/${import_node_path2.default.join(directoryPath, item)}`,
|
|
910
935
|
thumbnails: {
|
|
911
|
-
"75x75": `/${
|
|
912
|
-
"400x400": `/${
|
|
913
|
-
"1000x1000": `/${
|
|
936
|
+
"75x75": `/${import_node_path2.default.join(directoryPath, item)}`,
|
|
937
|
+
"400x400": `/${import_node_path2.default.join(directoryPath, item)}`,
|
|
938
|
+
"1000x1000": `/${import_node_path2.default.join(directoryPath, item)}`
|
|
914
939
|
}
|
|
915
940
|
};
|
|
916
941
|
if (stats.isDirectory()) {
|
|
917
942
|
staticMediaItem.children = await listFilesRecursively({
|
|
918
|
-
directoryPath:
|
|
943
|
+
directoryPath: import_node_path2.default.join(directoryPath, item),
|
|
919
944
|
config: config2,
|
|
920
945
|
roothPath
|
|
921
946
|
});
|
|
@@ -934,7 +959,6 @@ async function listFilesRecursively({
|
|
|
934
959
|
}
|
|
935
960
|
var createConfig = async ({
|
|
936
961
|
configManager,
|
|
937
|
-
database,
|
|
938
962
|
apiURL,
|
|
939
963
|
plugins = [],
|
|
940
964
|
noWatch,
|
|
@@ -958,7 +982,7 @@ var createConfig = async ({
|
|
|
958
982
|
}
|
|
959
983
|
}
|
|
960
984
|
});
|
|
961
|
-
const staticMediaPath =
|
|
985
|
+
const staticMediaPath = import_node_path2.default.join(
|
|
962
986
|
configManager.generatedFolderPath,
|
|
963
987
|
"static-media.json"
|
|
964
988
|
);
|
|
@@ -976,13 +1000,13 @@ var createConfig = async ({
|
|
|
976
1000
|
TINA_IMPORT: configManager.prebuildFilePath,
|
|
977
1001
|
SCHEMA_IMPORT: configManager.generatedGraphQLJSONPath,
|
|
978
1002
|
STATIC_MEDIA_IMPORT: staticMediaPath,
|
|
979
|
-
crypto:
|
|
980
|
-
fs:
|
|
981
|
-
os:
|
|
982
|
-
path:
|
|
1003
|
+
crypto: import_node_path2.default.join(configManager.spaRootPath, "src", "dummy-client.ts"),
|
|
1004
|
+
fs: import_node_path2.default.join(configManager.spaRootPath, "src", "dummy-client.ts"),
|
|
1005
|
+
os: import_node_path2.default.join(configManager.spaRootPath, "src", "dummy-client.ts"),
|
|
1006
|
+
path: import_node_path2.default.join(configManager.spaRootPath, "src", "dummy-client.ts")
|
|
983
1007
|
};
|
|
984
1008
|
if (configManager.shouldSkipSDK()) {
|
|
985
|
-
alias["CLIENT_IMPORT"] =
|
|
1009
|
+
alias["CLIENT_IMPORT"] = import_node_path2.default.join(
|
|
986
1010
|
configManager.spaRootPath,
|
|
987
1011
|
"src",
|
|
988
1012
|
"dummy-client.ts"
|
|
@@ -994,6 +1018,8 @@ var createConfig = async ({
|
|
|
994
1018
|
if (configManager.config.build.basePath) {
|
|
995
1019
|
basePath = configManager.config.build.basePath;
|
|
996
1020
|
}
|
|
1021
|
+
const fullVersion = configManager.getTinaGraphQLVersion();
|
|
1022
|
+
const version2 = `${fullVersion.major}.${fullVersion.minor}`;
|
|
997
1023
|
const config2 = {
|
|
998
1024
|
root: configManager.spaRootPath,
|
|
999
1025
|
base: `/${basePath ? `${(0, import_normalize_path2.default)(basePath)}/` : ""}${(0, import_normalize_path2.default)(
|
|
@@ -1005,15 +1031,33 @@ var createConfig = async ({
|
|
|
1005
1031
|
dedupe: ["graphql", "tinacms", "react", "react-dom", "react-router-dom"]
|
|
1006
1032
|
},
|
|
1007
1033
|
define: {
|
|
1034
|
+
/**
|
|
1035
|
+
* Since we prebuild the config.ts, it's possible for modules to be loaded which make
|
|
1036
|
+
* use of `process`. The main scenario where this is an issue is when co-locating schema
|
|
1037
|
+
* definitions with source files, and specifically source files which impor from NextJS.
|
|
1038
|
+
*
|
|
1039
|
+
* Some examples of what NextJS uses for `process.env` are:
|
|
1040
|
+
* - `process.env.__NEXT_TRAILING_SLASH`
|
|
1041
|
+
* - `process.env.__NEXT_CROSS_ORIGIN`
|
|
1042
|
+
* - `process.env.__NEXT_I18N_SUPPORT`
|
|
1043
|
+
*
|
|
1044
|
+
* Also, interestingly some of the advice for handling this doesn't work, references to replacing
|
|
1045
|
+
* `process.env` with `{}` are problematic, because browsers don't understand the `{}.` syntax,
|
|
1046
|
+
* but node does. This was a surprise, but using `new Object()` seems to do the trick.
|
|
1047
|
+
*/
|
|
1008
1048
|
"process.env": `new Object(${JSON.stringify(publicEnv)})`,
|
|
1049
|
+
// Used by picomatch https://github.com/micromatch/picomatch/blob/master/lib/utils.js#L4
|
|
1009
1050
|
"process.platform": `"${process.platform}"`,
|
|
1010
1051
|
__API_URL__: `"${apiURL}"`,
|
|
1011
1052
|
__BASE_PATH__: `"${((_e = (_d = configManager.config) == null ? void 0 : _d.build) == null ? void 0 : _e.basePath) || ""}"`,
|
|
1012
|
-
__TINA_GRAPHQL_VERSION__:
|
|
1053
|
+
__TINA_GRAPHQL_VERSION__: version2
|
|
1013
1054
|
},
|
|
1014
1055
|
logLevel: "error",
|
|
1056
|
+
// Vite import warnings are noisy
|
|
1015
1057
|
optimizeDeps: {
|
|
1016
1058
|
force: true,
|
|
1059
|
+
// Not 100% sure why this isn't being picked up automatically, this works from within the monorepo
|
|
1060
|
+
// but breaks externally
|
|
1017
1061
|
include: ["react/jsx-runtime", "react/jsx-dev-runtime"]
|
|
1018
1062
|
},
|
|
1019
1063
|
server: {
|
|
@@ -1021,6 +1065,7 @@ var createConfig = async ({
|
|
|
1021
1065
|
watch: noWatch ? {
|
|
1022
1066
|
ignored: ["**/*"]
|
|
1023
1067
|
} : {
|
|
1068
|
+
// Ignore everything except for the alias fields we specified above
|
|
1024
1069
|
ignored: [
|
|
1025
1070
|
`${configManager.tinaFolderPath}/**/!(config.prebuild.jsx|_graphql.json)`
|
|
1026
1071
|
]
|
|
@@ -1036,8 +1081,13 @@ var createConfig = async ({
|
|
|
1036
1081
|
rollupOptions
|
|
1037
1082
|
},
|
|
1038
1083
|
plugins: [
|
|
1084
|
+
/**
|
|
1085
|
+
* `splitVendorChunkPlugin` is needed because `tinacms` is quite large,
|
|
1086
|
+
* Vite's chunking strategy chokes on memory issues for smaller machines (ie. on CI).
|
|
1087
|
+
*/
|
|
1039
1088
|
(0, import_plugin_react.default)({
|
|
1040
1089
|
babel: {
|
|
1090
|
+
// Supresses the warning [NOTE] babel The code generator has deoptimised the styling of
|
|
1041
1091
|
compact: true
|
|
1042
1092
|
}
|
|
1043
1093
|
}),
|
|
@@ -1054,17 +1104,17 @@ var import_pluginutils = require("@rollup/pluginutils");
|
|
|
1054
1104
|
var import_fs = __toESM(require("fs"));
|
|
1055
1105
|
var import_vite2 = require("vite");
|
|
1056
1106
|
var import_esbuild = require("esbuild");
|
|
1057
|
-
var
|
|
1107
|
+
var import_path3 = __toESM(require("path"));
|
|
1058
1108
|
var import_body_parser = __toESM(require("body-parser"));
|
|
1059
1109
|
var import_cors = __toESM(require("cors"));
|
|
1060
1110
|
var import_graphql = require("@tinacms/graphql");
|
|
1061
1111
|
|
|
1062
1112
|
// src/next/commands/dev-command/server/media.ts
|
|
1063
1113
|
var import_fs_extra3 = __toESM(require("fs-extra"));
|
|
1064
|
-
var
|
|
1114
|
+
var import_path2 = __toESM(require("path"));
|
|
1065
1115
|
var import_busboy = __toESM(require("busboy"));
|
|
1066
1116
|
var createMediaRouter = (config2) => {
|
|
1067
|
-
const mediaFolder =
|
|
1117
|
+
const mediaFolder = import_path2.default.join(
|
|
1068
1118
|
config2.rootPath,
|
|
1069
1119
|
config2.publicFolder,
|
|
1070
1120
|
config2.mediaRoot
|
|
@@ -1092,8 +1142,8 @@ var createMediaRouter = (config2) => {
|
|
|
1092
1142
|
bb.on("file", async (_name, file, _info) => {
|
|
1093
1143
|
var _a;
|
|
1094
1144
|
const fullPath = decodeURI((_a = req.url) == null ? void 0 : _a.slice("/media/upload/".length));
|
|
1095
|
-
const saveTo =
|
|
1096
|
-
await import_fs_extra3.default.ensureDir(
|
|
1145
|
+
const saveTo = import_path2.default.join(mediaFolder, ...fullPath.split("/"));
|
|
1146
|
+
await import_fs_extra3.default.ensureDir(import_path2.default.dirname(saveTo));
|
|
1097
1147
|
file.pipe(import_fs_extra3.default.createWriteStream(saveTo));
|
|
1098
1148
|
});
|
|
1099
1149
|
bb.on("error", (error) => {
|
|
@@ -1114,8 +1164,7 @@ var createMediaRouter = (config2) => {
|
|
|
1114
1164
|
};
|
|
1115
1165
|
var parseMediaFolder = (str) => {
|
|
1116
1166
|
let returnString = str;
|
|
1117
|
-
if (returnString.startsWith("/"))
|
|
1118
|
-
returnString = returnString.substr(1);
|
|
1167
|
+
if (returnString.startsWith("/")) returnString = returnString.substr(1);
|
|
1119
1168
|
if (returnString.endsWith("/"))
|
|
1120
1169
|
returnString = returnString.substr(0, returnString.length - 1);
|
|
1121
1170
|
return returnString;
|
|
@@ -1128,7 +1177,7 @@ var MediaModel = class {
|
|
|
1128
1177
|
}
|
|
1129
1178
|
async listMedia(args) {
|
|
1130
1179
|
try {
|
|
1131
|
-
const folderPath = (0,
|
|
1180
|
+
const folderPath = (0, import_path2.join)(
|
|
1132
1181
|
this.rootPath,
|
|
1133
1182
|
this.publicFolder,
|
|
1134
1183
|
this.mediaRoot,
|
|
@@ -1143,7 +1192,7 @@ var MediaModel = class {
|
|
|
1143
1192
|
}
|
|
1144
1193
|
const filesStr = await import_fs_extra3.default.readdir(folderPath);
|
|
1145
1194
|
const filesProm = filesStr.map(async (file) => {
|
|
1146
|
-
const filePath = (0,
|
|
1195
|
+
const filePath = (0, import_path2.join)(folderPath, file);
|
|
1147
1196
|
const stat = await import_fs_extra3.default.stat(filePath);
|
|
1148
1197
|
let src = `/${file}`;
|
|
1149
1198
|
const isFile = stat.isFile();
|
|
@@ -1200,7 +1249,7 @@ var MediaModel = class {
|
|
|
1200
1249
|
}
|
|
1201
1250
|
async deleteMedia(args) {
|
|
1202
1251
|
try {
|
|
1203
|
-
const file = (0,
|
|
1252
|
+
const file = (0, import_path2.join)(
|
|
1204
1253
|
this.rootPath,
|
|
1205
1254
|
this.publicFolder,
|
|
1206
1255
|
this.mediaRoot,
|
|
@@ -1265,7 +1314,7 @@ var transformTsxPlugin = ({
|
|
|
1265
1314
|
const plug = {
|
|
1266
1315
|
name: "transform-tsx",
|
|
1267
1316
|
async transform(code, id) {
|
|
1268
|
-
const extName =
|
|
1317
|
+
const extName = import_path3.default.extname(id);
|
|
1269
1318
|
if (extName.startsWith(".tsx") || extName.startsWith(".ts")) {
|
|
1270
1319
|
const result = await (0, import_esbuild.transform)(code, { loader: "tsx" });
|
|
1271
1320
|
return {
|
|
@@ -1382,6 +1431,7 @@ function viteTransformExtension({
|
|
|
1382
1431
|
return {
|
|
1383
1432
|
code: res.code,
|
|
1384
1433
|
map: null
|
|
1434
|
+
// TODO:
|
|
1385
1435
|
};
|
|
1386
1436
|
}
|
|
1387
1437
|
}
|
|
@@ -1402,6 +1452,14 @@ var createDevServer = async (configManager, database, searchIndex, apiURL, noWat
|
|
|
1402
1452
|
apiURL,
|
|
1403
1453
|
plugins,
|
|
1404
1454
|
noWatch,
|
|
1455
|
+
/**
|
|
1456
|
+
* Ensure Vite's import scan uses the spaMainPath as the input
|
|
1457
|
+
* so it properly finds everything. This is for dev only, and when
|
|
1458
|
+
* running the server outside of this monorepo vite fails to find
|
|
1459
|
+
* and optimize the imports, so you get errors about it not being
|
|
1460
|
+
* able to find an export from a module, and it's always a CJS
|
|
1461
|
+
* module that Vite would usually transform to an ES module.
|
|
1462
|
+
*/
|
|
1405
1463
|
rollupOptions: {
|
|
1406
1464
|
input: configManager.spaMainPath,
|
|
1407
1465
|
onwarn(warning, warn) {
|
|
@@ -1417,7 +1475,7 @@ var createDevServer = async (configManager, database, searchIndex, apiURL, noWat
|
|
|
1417
1475
|
|
|
1418
1476
|
// src/next/codegen/index.ts
|
|
1419
1477
|
var import_fs_extra4 = __toESM(require("fs-extra"));
|
|
1420
|
-
var
|
|
1478
|
+
var import_path4 = __toESM(require("path"));
|
|
1421
1479
|
var import_graphql6 = require("graphql");
|
|
1422
1480
|
|
|
1423
1481
|
// src/next/codegen/codegen/index.ts
|
|
@@ -1527,6 +1585,7 @@ var GenericSdkVisitor = class extends import_visitor_plugin_common.ClientSideBas
|
|
|
1527
1585
|
node,
|
|
1528
1586
|
documentVariableName,
|
|
1529
1587
|
operationType,
|
|
1588
|
+
// This is the only line that is different
|
|
1530
1589
|
operationResultType: `{data: ${operationResultType}, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: ${operationVariablesTypes}, query: string}`,
|
|
1531
1590
|
operationVariablesTypes
|
|
1532
1591
|
});
|
|
@@ -1575,6 +1634,8 @@ var plugin = (schema, documents, config2) => {
|
|
|
1575
1634
|
const visitor = new GenericSdkVisitor(schema, allFragments, config2);
|
|
1576
1635
|
const visitorResult = (0, import_graphql3.visit)(allAst, { leave: visitor });
|
|
1577
1636
|
return {
|
|
1637
|
+
// We will take care of imports
|
|
1638
|
+
// prepend: visitor.getImports(),
|
|
1578
1639
|
content: [
|
|
1579
1640
|
visitor.fragments,
|
|
1580
1641
|
...visitorResult.definitions.filter((t) => typeof t === "string"),
|
|
@@ -1590,6 +1651,7 @@ var generateTypes = async (schema, queryPathGlob = process.cwd(), fragDocPath =
|
|
|
1590
1651
|
docs = await loadGraphQLDocuments(queryPathGlob);
|
|
1591
1652
|
fragDocs = await loadGraphQLDocuments(fragDocPath);
|
|
1592
1653
|
const res = await (0, import_core.codegen)({
|
|
1654
|
+
// Filename is not used. This is because the typescript plugin returns a string instead of writing to a file.
|
|
1593
1655
|
filename: process.cwd(),
|
|
1594
1656
|
schema: (0, import_graphql5.parse)((0, import_graphql5.printSchema)(schema)),
|
|
1595
1657
|
documents: [...docs, ...fragDocs],
|
|
@@ -1624,9 +1686,12 @@ var loadGraphQLDocuments = async (globPath) => {
|
|
|
1624
1686
|
loaders: [new import_graphql_file_loader.GraphQLFileLoader()]
|
|
1625
1687
|
});
|
|
1626
1688
|
} catch (e) {
|
|
1627
|
-
if (
|
|
1628
|
-
|
|
1629
|
-
|
|
1689
|
+
if (
|
|
1690
|
+
// https://www.graphql-tools.com/docs/documents-loading#no-files-found
|
|
1691
|
+
(e.message || "").includes(
|
|
1692
|
+
"Unable to find any GraphQL type definitions for the following pointers:"
|
|
1693
|
+
)
|
|
1694
|
+
) {
|
|
1630
1695
|
} else {
|
|
1631
1696
|
throw e;
|
|
1632
1697
|
}
|
|
@@ -1663,11 +1728,11 @@ var Codegen = class {
|
|
|
1663
1728
|
this.noClientBuildCache = noClientBuildCache;
|
|
1664
1729
|
}
|
|
1665
1730
|
async writeConfigFile(fileName, data) {
|
|
1666
|
-
const filePath =
|
|
1731
|
+
const filePath = import_path4.default.join(this.configManager.generatedFolderPath, fileName);
|
|
1667
1732
|
await import_fs_extra4.default.ensureFile(filePath);
|
|
1668
1733
|
await import_fs_extra4.default.outputFile(filePath, data);
|
|
1669
1734
|
if (this.configManager.hasSeparateContentRoot()) {
|
|
1670
|
-
const filePath2 =
|
|
1735
|
+
const filePath2 = import_path4.default.join(
|
|
1671
1736
|
this.configManager.generatedFolderPathContentRepo,
|
|
1672
1737
|
fileName
|
|
1673
1738
|
);
|
|
@@ -1783,16 +1848,14 @@ var Codegen = class {
|
|
|
1783
1848
|
const branch = (_a = this.configManager.config) == null ? void 0 : _a.branch;
|
|
1784
1849
|
const clientId = (_b = this.configManager.config) == null ? void 0 : _b.clientId;
|
|
1785
1850
|
const token = (_c = this.configManager.config) == null ? void 0 : _c.token;
|
|
1786
|
-
const
|
|
1851
|
+
const fullVersion = this.configManager.getTinaGraphQLVersion();
|
|
1852
|
+
const version2 = `${fullVersion.major}.${fullVersion.minor}`;
|
|
1787
1853
|
const baseUrl = ((_d = this.configManager.config.tinaioConfig) == null ? void 0 : _d.contentApiUrlOverride) || `https://${TINA_HOST}`;
|
|
1788
1854
|
if ((!branch || !clientId || !token) && !this.port && !this.configManager.config.contentApiUrlOverride) {
|
|
1789
1855
|
const missing = [];
|
|
1790
|
-
if (!branch)
|
|
1791
|
-
|
|
1792
|
-
if (!
|
|
1793
|
-
missing.push("clientId");
|
|
1794
|
-
if (!token)
|
|
1795
|
-
missing.push("token");
|
|
1856
|
+
if (!branch) missing.push("branch");
|
|
1857
|
+
if (!clientId) missing.push("clientId");
|
|
1858
|
+
if (!token) missing.push("token");
|
|
1796
1859
|
throw new Error(
|
|
1797
1860
|
`Client not configured properly. Missing ${missing.join(
|
|
1798
1861
|
", "
|
|
@@ -1946,7 +2009,11 @@ schema {
|
|
|
1946
2009
|
}
|
|
1947
2010
|
};
|
|
1948
2011
|
var maybeWarnFragmentSize = async (filepath) => {
|
|
1949
|
-
if (
|
|
2012
|
+
if (
|
|
2013
|
+
// is the file bigger than 100kb?
|
|
2014
|
+
(await import_fs_extra4.default.stat(filepath)).size > // convert to 100 kb to bytes
|
|
2015
|
+
100 * 1024
|
|
2016
|
+
) {
|
|
1950
2017
|
console.warn(
|
|
1951
2018
|
"Warning: frags.gql is very large (>100kb). Consider setting the reference depth to 1 or 0. See code snippet below."
|
|
1952
2019
|
);
|
|
@@ -1974,6 +2041,7 @@ var import_many_level = require("many-level");
|
|
|
1974
2041
|
var import_memory_level = require("memory-level");
|
|
1975
2042
|
var createDBServer = (port) => {
|
|
1976
2043
|
const levelHost = new import_many_level.ManyLevelHost(
|
|
2044
|
+
// @ts-ignore
|
|
1977
2045
|
new import_memory_level.MemoryLevel({
|
|
1978
2046
|
valueEncoding: "json"
|
|
1979
2047
|
})
|
|
@@ -2204,7 +2272,7 @@ var BaseCommand = class extends import_clipanion.Command {
|
|
|
2204
2272
|
pathFilter
|
|
2205
2273
|
});
|
|
2206
2274
|
const tinaPathUpdates = modified.filter(
|
|
2207
|
-
(
|
|
2275
|
+
(path14) => path14.startsWith(".tina/__generated__/_schema.json") || path14.startsWith("tina/tina-lock.json")
|
|
2208
2276
|
);
|
|
2209
2277
|
if (tinaPathUpdates.length > 0) {
|
|
2210
2278
|
res = await database.indexContent({
|
|
@@ -2248,6 +2316,7 @@ var import_search = require("@tinacms/search");
|
|
|
2248
2316
|
var DevCommand = class extends BaseCommand {
|
|
2249
2317
|
constructor() {
|
|
2250
2318
|
super(...arguments);
|
|
2319
|
+
// NOTE: camelCase commands for string options don't work if there's an `=` used https://github.com/arcanis/clipanion/issues/141
|
|
2251
2320
|
this.watchFolders = import_clipanion2.Option.String("-w,--watchFolders", {
|
|
2252
2321
|
description: "DEPRECATED - a list of folders (relative to where this is being run) that the cli will watch for changes"
|
|
2253
2322
|
});
|
|
@@ -2319,14 +2388,14 @@ var DevCommand = class extends BaseCommand {
|
|
|
2319
2388
|
graphql: graphqlSchemaObject
|
|
2320
2389
|
});
|
|
2321
2390
|
import_fs_extra6.default.writeFileSync(
|
|
2322
|
-
|
|
2391
|
+
import_path5.default.join(configManager.tinaFolderPath, tinaLockFilename),
|
|
2323
2392
|
tinaLockContent
|
|
2324
2393
|
);
|
|
2325
2394
|
if (configManager.hasSeparateContentRoot()) {
|
|
2326
2395
|
const rootPath = await configManager.getTinaFolderPath(
|
|
2327
2396
|
configManager.contentRootPath
|
|
2328
2397
|
);
|
|
2329
|
-
const filePath =
|
|
2398
|
+
const filePath = import_path5.default.join(rootPath, tinaLockFilename);
|
|
2330
2399
|
await import_fs_extra6.default.ensureFile(filePath);
|
|
2331
2400
|
await import_fs_extra6.default.outputFile(filePath, tinaLockContent);
|
|
2332
2401
|
}
|
|
@@ -2466,6 +2535,20 @@ ${dangerText(e.message)}
|
|
|
2466
2535
|
heading: "Tina Dev Server is running...",
|
|
2467
2536
|
items: [
|
|
2468
2537
|
...summaryItems
|
|
2538
|
+
// {
|
|
2539
|
+
// emoji: '📚',
|
|
2540
|
+
// heading: 'Useful links',
|
|
2541
|
+
// subItems: [
|
|
2542
|
+
// {
|
|
2543
|
+
// key: 'Custom queries',
|
|
2544
|
+
// value: 'https://tina.io/querying',
|
|
2545
|
+
// },
|
|
2546
|
+
// {
|
|
2547
|
+
// key: 'Visual editing',
|
|
2548
|
+
// value: 'https://tina.io/visual-editing',
|
|
2549
|
+
// },
|
|
2550
|
+
// ],
|
|
2551
|
+
// },
|
|
2469
2552
|
]
|
|
2470
2553
|
});
|
|
2471
2554
|
await this.startSubCommand();
|
|
@@ -2473,7 +2556,7 @@ ${dangerText(e.message)}
|
|
|
2473
2556
|
watchContentFiles(configManager, database, searchIndexer) {
|
|
2474
2557
|
const collectionContentFiles = [];
|
|
2475
2558
|
configManager.config.schema.collections.forEach((collection) => {
|
|
2476
|
-
const collectionGlob = `${
|
|
2559
|
+
const collectionGlob = `${import_path5.default.join(
|
|
2477
2560
|
configManager.contentRootPath,
|
|
2478
2561
|
collection.path
|
|
2479
2562
|
)}/**/*.${collection.format || "md"}`;
|
|
@@ -2532,6 +2615,8 @@ DevCommand.usage = import_clipanion2.Command.Usage({
|
|
|
2532
2615
|
var import_clipanion3 = require("clipanion");
|
|
2533
2616
|
var import_progress2 = __toESM(require("progress"));
|
|
2534
2617
|
var import_fs_extra7 = __toESM(require("fs-extra"));
|
|
2618
|
+
var import_crypto = __toESM(require("crypto"));
|
|
2619
|
+
var import_path6 = __toESM(require("path"));
|
|
2535
2620
|
var import_graphql11 = require("@tinacms/graphql");
|
|
2536
2621
|
|
|
2537
2622
|
// src/next/commands/build-command/server.ts
|
|
@@ -2575,7 +2660,7 @@ var buildProductionSpa = async (configManager, database, apiURL) => {
|
|
|
2575
2660
|
// src/next/commands/build-command/index.ts
|
|
2576
2661
|
var import_schema_tools2 = require("@tinacms/schema-tools");
|
|
2577
2662
|
var import_graphql12 = require("graphql");
|
|
2578
|
-
var
|
|
2663
|
+
var import_core3 = require("@graphql-inspector/core");
|
|
2579
2664
|
|
|
2580
2665
|
// src/next/commands/build-command/waitForDB.ts
|
|
2581
2666
|
var import_progress = __toESM(require("progress"));
|
|
@@ -2677,6 +2762,20 @@ var waitForDB = async (config2, apiUrl, previewName, verbose) => {
|
|
|
2677
2762
|
|
|
2678
2763
|
// src/next/commands/build-command/index.ts
|
|
2679
2764
|
var import_search2 = require("@tinacms/search");
|
|
2765
|
+
|
|
2766
|
+
// src/utils/index.ts
|
|
2767
|
+
var import_core2 = require("@graphql-inspector/core");
|
|
2768
|
+
var getFaqLink = (type) => {
|
|
2769
|
+
switch (type) {
|
|
2770
|
+
case import_core2.ChangeType.FieldRemoved: {
|
|
2771
|
+
return "https://tina.io/docs/introduction/faq#how-do-i-resolve-the-local-graphql-schema-doesnt-match-the-remote-graphql-schema-errors";
|
|
2772
|
+
}
|
|
2773
|
+
default:
|
|
2774
|
+
return null;
|
|
2775
|
+
}
|
|
2776
|
+
};
|
|
2777
|
+
|
|
2778
|
+
// src/next/commands/build-command/index.ts
|
|
2680
2779
|
var BuildCommand = class extends BaseCommand {
|
|
2681
2780
|
constructor() {
|
|
2682
2781
|
super(...arguments);
|
|
@@ -2692,6 +2791,9 @@ var BuildCommand = class extends BaseCommand {
|
|
|
2692
2791
|
this.tinaGraphQLVersion = import_clipanion3.Option.String("--tina-graphql-version", {
|
|
2693
2792
|
description: "Specify the version of @tinacms/graphql to use (defaults to latest)"
|
|
2694
2793
|
});
|
|
2794
|
+
/**
|
|
2795
|
+
* This option allows the user to skip the tina cloud checks if they want to. This could be useful for mismatched GraphQL versions or if they want to build only using the local client and never connect to Tina Cloud
|
|
2796
|
+
*/
|
|
2695
2797
|
this.skipCloudChecks = import_clipanion3.Option.Boolean("--skip-cloud-checks", false, {
|
|
2696
2798
|
description: "Skips checking the provided cloud config."
|
|
2697
2799
|
});
|
|
@@ -2804,7 +2906,7 @@ ${dangerText(e.message)}
|
|
|
2804
2906
|
}
|
|
2805
2907
|
const skipCloudChecks = this.skipCloudChecks || configManager.hasSelfHostedConfig();
|
|
2806
2908
|
if (!skipCloudChecks) {
|
|
2807
|
-
const { hasUpstream } = await this.checkClientInfo(
|
|
2909
|
+
const { hasUpstream, timestamp } = await this.checkClientInfo(
|
|
2808
2910
|
configManager,
|
|
2809
2911
|
codegen2.productionUrl,
|
|
2810
2912
|
this.previewBaseBranch
|
|
@@ -2832,7 +2934,16 @@ ${dangerText(e.message)}
|
|
|
2832
2934
|
await this.checkGraphqlSchema(
|
|
2833
2935
|
configManager,
|
|
2834
2936
|
database,
|
|
2835
|
-
codegen2.productionUrl
|
|
2937
|
+
codegen2.productionUrl,
|
|
2938
|
+
timestamp
|
|
2939
|
+
);
|
|
2940
|
+
await this.checkTinaSchema(
|
|
2941
|
+
configManager,
|
|
2942
|
+
database,
|
|
2943
|
+
codegen2.productionUrl,
|
|
2944
|
+
this.previewName,
|
|
2945
|
+
this.verbose,
|
|
2946
|
+
timestamp
|
|
2836
2947
|
);
|
|
2837
2948
|
}
|
|
2838
2949
|
await buildProductionSpa(configManager, database, codegen2.productionUrl);
|
|
@@ -2951,11 +3062,13 @@ ${dangerText(e.message)}
|
|
|
2951
3062
|
const bar2 = new import_progress2.default("Checking clientId and token. :prog", 1);
|
|
2952
3063
|
let branchKnown = false;
|
|
2953
3064
|
let hasUpstream = false;
|
|
3065
|
+
let timestamp;
|
|
2954
3066
|
try {
|
|
2955
3067
|
const res = await request({
|
|
2956
3068
|
token,
|
|
2957
3069
|
url
|
|
2958
3070
|
});
|
|
3071
|
+
timestamp = res.timestamp || 0;
|
|
2959
3072
|
bar2.tick({
|
|
2960
3073
|
prog: "\u2705"
|
|
2961
3074
|
});
|
|
@@ -2997,7 +3110,8 @@ ${dangerText(e.message)}
|
|
|
2997
3110
|
prog: "\u2705"
|
|
2998
3111
|
});
|
|
2999
3112
|
return {
|
|
3000
|
-
hasUpstream
|
|
3113
|
+
hasUpstream,
|
|
3114
|
+
timestamp
|
|
3001
3115
|
};
|
|
3002
3116
|
}
|
|
3003
3117
|
for (let i = 0; i <= 5; i++) {
|
|
@@ -3087,14 +3201,14 @@ ${dangerText(e.message)}
|
|
|
3087
3201
|
throw e;
|
|
3088
3202
|
}
|
|
3089
3203
|
}
|
|
3090
|
-
async checkGraphqlSchema(configManager, database, apiURL) {
|
|
3204
|
+
async checkGraphqlSchema(configManager, database, apiURL, timestamp) {
|
|
3091
3205
|
const bar2 = new import_progress2.default(
|
|
3092
3206
|
"Checking local GraphQL Schema matches server. :prog",
|
|
3093
3207
|
1
|
|
3094
3208
|
);
|
|
3095
3209
|
const { config: config2 } = configManager;
|
|
3096
3210
|
const token = config2.token;
|
|
3097
|
-
const remoteSchema = await fetchRemoteGraphqlSchema({
|
|
3211
|
+
const { remoteSchema, remoteProjectVersion } = await fetchRemoteGraphqlSchema({
|
|
3098
3212
|
url: apiURL,
|
|
3099
3213
|
token
|
|
3100
3214
|
});
|
|
@@ -3114,7 +3228,7 @@ Additional info: Branch: ${config2.branch}, Client ID: ${config2.clientId} `;
|
|
|
3114
3228
|
const localSchemaDocument = await database.getGraphQLSchemaFromBridge();
|
|
3115
3229
|
const localGraphqlSchema = (0, import_graphql12.buildASTSchema)(localSchemaDocument);
|
|
3116
3230
|
try {
|
|
3117
|
-
const diffResult = await (0,
|
|
3231
|
+
const diffResult = await (0, import_core3.diff)(localGraphqlSchema, remoteGqlSchema);
|
|
3118
3232
|
if (diffResult.length === 0) {
|
|
3119
3233
|
bar2.tick({
|
|
3120
3234
|
prog: "\u2705"
|
|
@@ -3123,12 +3237,30 @@ Additional info: Branch: ${config2.branch}, Client ID: ${config2.clientId} `;
|
|
|
3123
3237
|
bar2.tick({
|
|
3124
3238
|
prog: "\u274C"
|
|
3125
3239
|
});
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3240
|
+
const type = diffResult[0].type;
|
|
3241
|
+
const reason = diffResult[0].message;
|
|
3242
|
+
const errorLevel = diffResult[0].criticality.level;
|
|
3243
|
+
const faqLink = getFaqLink(type);
|
|
3244
|
+
const tinaGraphQLVersion = configManager.getTinaGraphQLVersion();
|
|
3245
|
+
let errorMessage = `The local GraphQL schema doesn't match the remote GraphQL schema. Please push up your changes to GitHub to update your remote GraphQL schema. ${faqLink && `
|
|
3246
|
+
Check out '${faqLink}' for possible solutions.`}`;
|
|
3247
|
+
errorMessage += `
|
|
3129
3248
|
|
|
3130
|
-
Additional info:
|
|
3249
|
+
Additional info:
|
|
3250
|
+
|
|
3251
|
+
`;
|
|
3252
|
+
if (config2 == null ? void 0 : config2.branch) {
|
|
3253
|
+
errorMessage += ` Branch: ${config2.branch}, Client ID: ${config2.clientId}
|
|
3254
|
+
`;
|
|
3131
3255
|
}
|
|
3256
|
+
errorMessage += ` Local GraphQL version: ${tinaGraphQLVersion.fullVersion} / Remote GraphQL version: ${remoteProjectVersion}
|
|
3257
|
+
`;
|
|
3258
|
+
errorMessage += ` Last indexed at: ${new Date(
|
|
3259
|
+
timestamp
|
|
3260
|
+
).toUTCString()}
|
|
3261
|
+
`;
|
|
3262
|
+
errorMessage += ` Reason: [${errorLevel} - ${type}] ${reason}
|
|
3263
|
+
`;
|
|
3132
3264
|
throw new Error(errorMessage);
|
|
3133
3265
|
}
|
|
3134
3266
|
} catch (e) {
|
|
@@ -3143,6 +3275,71 @@ Additional info: Branch: ${config2.branch}, Client ID: ${config2.clientId} `;
|
|
|
3143
3275
|
}
|
|
3144
3276
|
}
|
|
3145
3277
|
}
|
|
3278
|
+
async checkTinaSchema(configManager, database, apiURL, previewName, verbose, timestamp) {
|
|
3279
|
+
const bar2 = new import_progress2.default(
|
|
3280
|
+
"Checking local Tina Schema matches server. :prog",
|
|
3281
|
+
1
|
|
3282
|
+
);
|
|
3283
|
+
const { config: config2 } = configManager;
|
|
3284
|
+
const token = config2.token;
|
|
3285
|
+
const { clientId, branch, isLocalClient, host } = (0, import_schema_tools2.parseURL)(apiURL);
|
|
3286
|
+
if (isLocalClient || !host || !clientId || !branch) {
|
|
3287
|
+
if (verbose) {
|
|
3288
|
+
logger.info(logText("Not using Tina Cloud, skipping Tina Schema check"));
|
|
3289
|
+
}
|
|
3290
|
+
return;
|
|
3291
|
+
}
|
|
3292
|
+
const { tinaSchema: remoteTinaSchemaSha } = await fetchSchemaSha({
|
|
3293
|
+
url: `https://${host}/db/${clientId}/${previewName || branch}/schemaSha`,
|
|
3294
|
+
token
|
|
3295
|
+
});
|
|
3296
|
+
if (!remoteTinaSchemaSha) {
|
|
3297
|
+
bar2.tick({
|
|
3298
|
+
prog: "\u274C"
|
|
3299
|
+
});
|
|
3300
|
+
let errorMessage = `The remote Tina schema does not exist. Check indexing for this branch.`;
|
|
3301
|
+
if (config2 == null ? void 0 : config2.branch) {
|
|
3302
|
+
errorMessage += `
|
|
3303
|
+
|
|
3304
|
+
Additional info: Branch: ${config2.branch}, Client ID: ${config2.clientId} `;
|
|
3305
|
+
}
|
|
3306
|
+
throw new Error(errorMessage);
|
|
3307
|
+
}
|
|
3308
|
+
if (!database.bridge) {
|
|
3309
|
+
throw new Error(`No bridge configured`);
|
|
3310
|
+
}
|
|
3311
|
+
const localTinaSchema = JSON.parse(
|
|
3312
|
+
await database.bridge.get(
|
|
3313
|
+
import_path6.default.join(database.tinaDirectory, "__generated__", "_schema.json")
|
|
3314
|
+
)
|
|
3315
|
+
);
|
|
3316
|
+
localTinaSchema.version = void 0;
|
|
3317
|
+
const localTinaSchemaSha = import_crypto.default.createHash("sha256").update(JSON.stringify(localTinaSchema)).digest("hex");
|
|
3318
|
+
if (localTinaSchemaSha === remoteTinaSchemaSha) {
|
|
3319
|
+
bar2.tick({
|
|
3320
|
+
prog: "\u2705"
|
|
3321
|
+
});
|
|
3322
|
+
} else {
|
|
3323
|
+
bar2.tick({
|
|
3324
|
+
prog: "\u274C"
|
|
3325
|
+
});
|
|
3326
|
+
let errorMessage = `The local Tina schema doesn't match the remote Tina schema. Please push up your changes to GitHub to update your remote tina schema.`;
|
|
3327
|
+
errorMessage += `
|
|
3328
|
+
|
|
3329
|
+
Additional info:
|
|
3330
|
+
|
|
3331
|
+
`;
|
|
3332
|
+
if (config2 == null ? void 0 : config2.branch) {
|
|
3333
|
+
errorMessage += ` Branch: ${config2.branch}, Client ID: ${config2.clientId}
|
|
3334
|
+
`;
|
|
3335
|
+
}
|
|
3336
|
+
errorMessage += ` Last indexed at: ${new Date(
|
|
3337
|
+
timestamp
|
|
3338
|
+
).toUTCString()}
|
|
3339
|
+
`;
|
|
3340
|
+
throw new Error(errorMessage);
|
|
3341
|
+
}
|
|
3342
|
+
}
|
|
3146
3343
|
};
|
|
3147
3344
|
BuildCommand.paths = [["build"]];
|
|
3148
3345
|
BuildCommand.usage = import_clipanion3.Command.Usage({
|
|
@@ -3209,7 +3406,26 @@ var fetchRemoteGraphqlSchema = async ({
|
|
|
3209
3406
|
body
|
|
3210
3407
|
});
|
|
3211
3408
|
const data = await res.json();
|
|
3212
|
-
return
|
|
3409
|
+
return {
|
|
3410
|
+
remoteSchema: data == null ? void 0 : data.data,
|
|
3411
|
+
remoteRuntimeVersion: res.headers.get("tinacms-grapqhl-version"),
|
|
3412
|
+
remoteProjectVersion: res.headers.get("tinacms-graphql-project-version")
|
|
3413
|
+
};
|
|
3414
|
+
};
|
|
3415
|
+
var fetchSchemaSha = async ({
|
|
3416
|
+
url,
|
|
3417
|
+
token
|
|
3418
|
+
}) => {
|
|
3419
|
+
const headers = new Headers();
|
|
3420
|
+
if (token) {
|
|
3421
|
+
headers.append("X-API-KEY", token);
|
|
3422
|
+
}
|
|
3423
|
+
const res = await fetch(url, {
|
|
3424
|
+
method: "GET",
|
|
3425
|
+
headers,
|
|
3426
|
+
cache: "no-cache"
|
|
3427
|
+
});
|
|
3428
|
+
return res.json();
|
|
3213
3429
|
};
|
|
3214
3430
|
|
|
3215
3431
|
// src/next/commands/audit-command/index.ts
|
|
@@ -3318,6 +3534,7 @@ var auditDocuments = async (args) => {
|
|
|
3318
3534
|
logger.error(import_chalk5.default.red(err.message));
|
|
3319
3535
|
if (err.originalError.originalError) {
|
|
3320
3536
|
logger.error(
|
|
3537
|
+
// @ts-ignore FIXME: this doesn't seem right
|
|
3321
3538
|
import_chalk5.default.red(` ${err.originalError.originalError.message}`)
|
|
3322
3539
|
);
|
|
3323
3540
|
}
|
|
@@ -3523,7 +3740,9 @@ var detectEnvironment = async ({
|
|
|
3523
3740
|
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")));
|
|
3524
3741
|
const tinaFolder = import_path7.default.join(baseDir, "tina");
|
|
3525
3742
|
const tinaConfigExists = Boolean(
|
|
3526
|
-
|
|
3743
|
+
// Does the tina folder exist?
|
|
3744
|
+
await import_fs_extra8.default.pathExists(tinaFolder) && // Does the tina folder contain a config file?
|
|
3745
|
+
(await import_fs_extra8.default.readdir(tinaFolder)).find((x) => x.includes("config"))
|
|
3527
3746
|
);
|
|
3528
3747
|
const pagesDir = [baseDir, usingSrc ? "src" : false, "pages"].filter(
|
|
3529
3748
|
Boolean
|
|
@@ -3758,6 +3977,7 @@ var supportedDatabaseAdapters = {
|
|
|
3758
3977
|
{
|
|
3759
3978
|
from: "mongodb",
|
|
3760
3979
|
imported: [],
|
|
3980
|
+
// not explicitly imported
|
|
3761
3981
|
packageName: "mongodb"
|
|
3762
3982
|
}
|
|
3763
3983
|
]
|
|
@@ -3830,6 +4050,10 @@ var chooseDatabaseAdapter = async ({
|
|
|
3830
4050
|
title: "MongoDB",
|
|
3831
4051
|
value: "mongodb"
|
|
3832
4052
|
}
|
|
4053
|
+
// {
|
|
4054
|
+
// title: "I'll create my own database adapter",
|
|
4055
|
+
// value: 'other',
|
|
4056
|
+
// },
|
|
3833
4057
|
]
|
|
3834
4058
|
}
|
|
3835
4059
|
]);
|
|
@@ -4107,6 +4331,7 @@ async function configure(env, opts) {
|
|
|
4107
4331
|
packageManager,
|
|
4108
4332
|
forestryMigrate: false,
|
|
4109
4333
|
isLocalEnvVarName: "TINA_PUBLIC_IS_LOCAL",
|
|
4334
|
+
// TODO: give this a better default
|
|
4110
4335
|
typescript: false
|
|
4111
4336
|
};
|
|
4112
4337
|
if (config2.framework.name === "next") {
|
|
@@ -4210,15 +4435,25 @@ var import_js_yaml = __toESM(require("js-yaml"));
|
|
|
4210
4435
|
var import_zod = __toESM(require("zod"));
|
|
4211
4436
|
|
|
4212
4437
|
// src/cmds/forestry-migrate/util/errorSingleton.ts
|
|
4213
|
-
var ErrorSingleton = class {
|
|
4438
|
+
var ErrorSingleton = class _ErrorSingleton {
|
|
4439
|
+
/**
|
|
4440
|
+
* The Singleton's constructor should always be private to prevent direct
|
|
4441
|
+
* construction calls with the `new` operator.
|
|
4442
|
+
*/
|
|
4214
4443
|
constructor() {
|
|
4215
4444
|
}
|
|
4445
|
+
/**
|
|
4446
|
+
* The static method that controls the access to the singleton instance.
|
|
4447
|
+
*
|
|
4448
|
+
* This implementation let you subclass the Singleton class while keeping
|
|
4449
|
+
* just one instance of each subclass around.
|
|
4450
|
+
*/
|
|
4216
4451
|
static getInstance() {
|
|
4217
|
-
if (!
|
|
4218
|
-
|
|
4219
|
-
|
|
4452
|
+
if (!_ErrorSingleton.instance) {
|
|
4453
|
+
_ErrorSingleton.instance = new _ErrorSingleton();
|
|
4454
|
+
_ErrorSingleton.instance.collectionNameErrors = [];
|
|
4220
4455
|
}
|
|
4221
|
-
return
|
|
4456
|
+
return _ErrorSingleton.instance;
|
|
4222
4457
|
}
|
|
4223
4458
|
addErrorName(error) {
|
|
4224
4459
|
this.collectionNameErrors.push(error);
|
|
@@ -4261,8 +4496,7 @@ var makeFieldsWithInternalCode = ({
|
|
|
4261
4496
|
if (hasBody) {
|
|
4262
4497
|
return [bodyField, `__TINA_INTERNAL__:::...${field}():::`];
|
|
4263
4498
|
} else {
|
|
4264
|
-
if (spread)
|
|
4265
|
-
return `__TINA_INTERNAL__:::...${field}():::`;
|
|
4499
|
+
if (spread) return `__TINA_INTERNAL__:::...${field}():::`;
|
|
4266
4500
|
return `__TINA_INTERNAL__:::${field}():::`;
|
|
4267
4501
|
}
|
|
4268
4502
|
};
|
|
@@ -4346,6 +4580,7 @@ var forestryConfigSchema = import_zod.default.object({
|
|
|
4346
4580
|
)
|
|
4347
4581
|
});
|
|
4348
4582
|
var forestryFieldWithoutField = import_zod.default.object({
|
|
4583
|
+
// TODO: maybe better type this?
|
|
4349
4584
|
type: import_zod.default.union([
|
|
4350
4585
|
import_zod.default.literal("text"),
|
|
4351
4586
|
import_zod.default.literal("datetime"),
|
|
@@ -4369,6 +4604,7 @@ var forestryFieldWithoutField = import_zod.default.object({
|
|
|
4369
4604
|
default: import_zod.default.any().optional(),
|
|
4370
4605
|
template: import_zod.default.string().optional(),
|
|
4371
4606
|
config: import_zod.default.object({
|
|
4607
|
+
// min and max are used for lists
|
|
4372
4608
|
min: import_zod.default.number().optional().nullable(),
|
|
4373
4609
|
max: import_zod.default.number().optional().nullable(),
|
|
4374
4610
|
required: import_zod.default.boolean().optional().nullable(),
|
|
@@ -4382,6 +4618,7 @@ var forestryFieldWithoutField = import_zod.default.object({
|
|
|
4382
4618
|
import_zod.default.literal("pages"),
|
|
4383
4619
|
import_zod.default.literal("documents"),
|
|
4384
4620
|
import_zod.default.literal("simple"),
|
|
4621
|
+
// TODO: I want to ignore this key if its invalid
|
|
4385
4622
|
import_zod.default.string()
|
|
4386
4623
|
]).optional().nullable(),
|
|
4387
4624
|
section: import_zod.default.string().optional().nullable()
|
|
@@ -4417,6 +4654,7 @@ var transformForestryFieldsToTinaFields = ({
|
|
|
4417
4654
|
}
|
|
4418
4655
|
let field;
|
|
4419
4656
|
switch (forestryField2.type) {
|
|
4657
|
+
// Single filed types
|
|
4420
4658
|
case "text":
|
|
4421
4659
|
field = {
|
|
4422
4660
|
type: "string",
|
|
@@ -4496,6 +4734,7 @@ var transformForestryFieldsToTinaFields = ({
|
|
|
4496
4734
|
);
|
|
4497
4735
|
}
|
|
4498
4736
|
break;
|
|
4737
|
+
// List Types
|
|
4499
4738
|
case "list":
|
|
4500
4739
|
field = {
|
|
4501
4740
|
type: "string",
|
|
@@ -4518,6 +4757,7 @@ var transformForestryFieldsToTinaFields = ({
|
|
|
4518
4757
|
}
|
|
4519
4758
|
};
|
|
4520
4759
|
break;
|
|
4760
|
+
// Object (Group) types
|
|
4521
4761
|
case "field_group":
|
|
4522
4762
|
field = {
|
|
4523
4763
|
type: "object",
|
|
@@ -4558,6 +4798,7 @@ var transformForestryFieldsToTinaFields = ({
|
|
|
4558
4798
|
});
|
|
4559
4799
|
const fieldsString = stringifyLabelWithField(template2.label);
|
|
4560
4800
|
const t = {
|
|
4801
|
+
// @ts-ignore
|
|
4561
4802
|
fields: makeFieldsWithInternalCode({
|
|
4562
4803
|
hasBody: false,
|
|
4563
4804
|
field: fieldsString
|
|
@@ -4595,6 +4836,7 @@ var transformForestryFieldsToTinaFields = ({
|
|
|
4595
4836
|
spread: true
|
|
4596
4837
|
});
|
|
4597
4838
|
tinaFields.push(
|
|
4839
|
+
// @ts-ignore
|
|
4598
4840
|
field2
|
|
4599
4841
|
);
|
|
4600
4842
|
break;
|
|
@@ -4654,6 +4896,7 @@ var parseSections = ({ val }) => {
|
|
|
4654
4896
|
|
|
4655
4897
|
// src/cmds/forestry-migrate/index.ts
|
|
4656
4898
|
var BODY_FIELD = {
|
|
4899
|
+
// This is the body field
|
|
4657
4900
|
type: "rich-text",
|
|
4658
4901
|
name: "body",
|
|
4659
4902
|
label: "Body of Document",
|
|
@@ -4712,8 +4955,7 @@ var generateAllTemplates = async ({
|
|
|
4712
4955
|
};
|
|
4713
4956
|
var generateCollectionFromForestrySection = (args) => {
|
|
4714
4957
|
const { section, templateMap } = args;
|
|
4715
|
-
if (section.read_only)
|
|
4716
|
-
return;
|
|
4958
|
+
if (section.read_only) return;
|
|
4717
4959
|
let format3 = "md";
|
|
4718
4960
|
if (section.new_doc_ext) {
|
|
4719
4961
|
const ext = checkExt(section.new_doc_ext);
|
|
@@ -4780,12 +5022,14 @@ var generateCollectionFromForestrySection = (args) => {
|
|
|
4780
5022
|
if (((forestryTemplates == null ? void 0 : forestryTemplates.length) || 0) > 1) {
|
|
4781
5023
|
c = {
|
|
4782
5024
|
...baseCollection,
|
|
5025
|
+
// @ts-expect-error
|
|
4783
5026
|
templates: forestryTemplates.map((tem) => {
|
|
4784
5027
|
const currentTemplate = templateMap.get(tem);
|
|
4785
5028
|
const fieldsString = stringifyLabelWithField(
|
|
4786
5029
|
currentTemplate.templateObj.label
|
|
4787
5030
|
);
|
|
4788
5031
|
return {
|
|
5032
|
+
// fields: [BODY_FIELD],
|
|
4789
5033
|
fields: makeFieldsWithInternalCode({
|
|
4790
5034
|
hasBody,
|
|
4791
5035
|
field: fieldsString,
|
|
@@ -4803,6 +5047,8 @@ var generateCollectionFromForestrySection = (args) => {
|
|
|
4803
5047
|
const fieldsString = stringifyLabelWithField(template.templateObj.label);
|
|
4804
5048
|
c = {
|
|
4805
5049
|
...baseCollection,
|
|
5050
|
+
// fields: [BODY_FIELD],
|
|
5051
|
+
// @ts-expect-error
|
|
4806
5052
|
fields: makeFieldsWithInternalCode({
|
|
4807
5053
|
field: fieldsString,
|
|
4808
5054
|
hasBody,
|
|
@@ -5550,6 +5796,7 @@ var makeImportsVisitor = (sourceFile, importMap) => (ctx) => (node) => {
|
|
|
5550
5796
|
) : [];
|
|
5551
5797
|
const newImports = [
|
|
5552
5798
|
.../* @__PURE__ */ new Set([
|
|
5799
|
+
// we use Set to remove duplicates
|
|
5553
5800
|
...existingImports,
|
|
5554
5801
|
...imports
|
|
5555
5802
|
])
|
|
@@ -5704,6 +5951,7 @@ var addSelfHostedTinaAuthToConfig = async (config2, configFile) => {
|
|
|
5704
5951
|
);
|
|
5705
5952
|
const { configImports, configAuthProviderClass, extraTinaCollections } = config2.authProvider;
|
|
5706
5953
|
const importMap = {
|
|
5954
|
+
// iterate over configImports and add them to the import map
|
|
5707
5955
|
...configImports.reduce((acc, { from, imported }) => {
|
|
5708
5956
|
acc[from] = imported;
|
|
5709
5957
|
return acc;
|
|
@@ -5878,7 +6126,13 @@ async function apply({
|
|
|
5878
6126
|
config: config2
|
|
5879
6127
|
});
|
|
5880
6128
|
}
|
|
5881
|
-
if (
|
|
6129
|
+
if (
|
|
6130
|
+
// if the config was just generated we do not need to update the config file because it will be generated correctly
|
|
6131
|
+
env.tinaConfigExists && // Are we running tinacms init backend
|
|
6132
|
+
params.isBackendInit && // Do the user choose the 'self-host' option
|
|
6133
|
+
config2.hosting === "self-host" && // the user did not choose the 'tina-cloud' auth provider
|
|
6134
|
+
(((_a = config2.authProvider) == null ? void 0 : _a.name) || "") !== "tina-cloud"
|
|
6135
|
+
) {
|
|
5882
6136
|
await addSelfHostedTinaAuthToConfig(config2, env.generatedFiles["config"]);
|
|
5883
6137
|
}
|
|
5884
6138
|
logNextSteps({
|
|
@@ -6012,22 +6266,22 @@ var writeGeneratedFile = async ({
|
|
|
6012
6266
|
content,
|
|
6013
6267
|
typescript
|
|
6014
6268
|
}) => {
|
|
6015
|
-
const { exists, path:
|
|
6269
|
+
const { exists, path: path14, parentPath } = generatedFile.resolve(typescript);
|
|
6016
6270
|
if (exists) {
|
|
6017
6271
|
if (overwrite) {
|
|
6018
|
-
logger.info(`Overwriting file at ${
|
|
6019
|
-
import_fs_extra13.default.outputFileSync(
|
|
6272
|
+
logger.info(`Overwriting file at ${path14}... \u2705`);
|
|
6273
|
+
import_fs_extra13.default.outputFileSync(path14, content);
|
|
6020
6274
|
} else {
|
|
6021
|
-
logger.info(`Not overwriting file at ${
|
|
6275
|
+
logger.info(`Not overwriting file at ${path14}.`);
|
|
6022
6276
|
logger.info(
|
|
6023
|
-
logText(`Please add the following to ${
|
|
6277
|
+
logText(`Please add the following to ${path14}:
|
|
6024
6278
|
${indentText(content)}}`)
|
|
6025
6279
|
);
|
|
6026
6280
|
}
|
|
6027
6281
|
} else {
|
|
6028
|
-
logger.info(`Adding file at ${
|
|
6282
|
+
logger.info(`Adding file at ${path14}... \u2705`);
|
|
6029
6283
|
await import_fs_extra13.default.ensureDir(parentPath);
|
|
6030
|
-
import_fs_extra13.default.outputFileSync(
|
|
6284
|
+
import_fs_extra13.default.outputFileSync(path14, content);
|
|
6031
6285
|
}
|
|
6032
6286
|
};
|
|
6033
6287
|
var addConfigFile = async ({
|
|
@@ -6171,6 +6425,7 @@ var other = ({ packageManager }) => {
|
|
|
6171
6425
|
const packageManagers = {
|
|
6172
6426
|
pnpm: `pnpm`,
|
|
6173
6427
|
npm: `npx`,
|
|
6428
|
+
// npx is the way to run executables that aren't in your "scripts"
|
|
6174
6429
|
yarn: `yarn`
|
|
6175
6430
|
};
|
|
6176
6431
|
return `${packageManagers[packageManager]} tinacms dev -c "<your dev command>"`;
|
|
@@ -6183,6 +6438,7 @@ var frameworkDevCmds = {
|
|
|
6183
6438
|
const packageManagers = {
|
|
6184
6439
|
pnpm: `pnpm`,
|
|
6185
6440
|
npm: `npm run`,
|
|
6441
|
+
// npx is the way to run executables that aren't in your "scripts"
|
|
6186
6442
|
yarn: `yarn`
|
|
6187
6443
|
};
|
|
6188
6444
|
return `${packageManagers[packageManager]} dev`;
|
|
@@ -6440,5 +6696,3 @@ cli.register(import_clipanion8.Builtins.DefinitionsCommand);
|
|
|
6440
6696
|
cli.register(import_clipanion8.Builtins.HelpCommand);
|
|
6441
6697
|
cli.register(import_clipanion8.Builtins.VersionCommand);
|
|
6442
6698
|
var src_default = cli;
|
|
6443
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
6444
|
-
0 && (module.exports = {});
|
|
@@ -21,15 +21,25 @@ export declare class BuildCommand extends BaseCommand {
|
|
|
21
21
|
execute(): Promise<number | void>;
|
|
22
22
|
checkClientInfo(configManager: ConfigManager, apiURL: string, previewBaseBranch?: string): Promise<{
|
|
23
23
|
hasUpstream: boolean;
|
|
24
|
+
timestamp: number;
|
|
24
25
|
}>;
|
|
25
26
|
syncProject(configManager: ConfigManager, apiURL: string, options?: {
|
|
26
27
|
upstreamBranch?: string;
|
|
27
28
|
previewBaseBranch?: string;
|
|
28
29
|
previewName?: string;
|
|
29
30
|
}): Promise<void>;
|
|
30
|
-
checkGraphqlSchema(configManager: ConfigManager, database: Database, apiURL: string): Promise<void>;
|
|
31
|
+
checkGraphqlSchema(configManager: ConfigManager, database: Database, apiURL: string, timestamp: number): Promise<void>;
|
|
32
|
+
checkTinaSchema(configManager: ConfigManager, database: Database, apiURL: string, previewName: string, verbose: boolean, timestamp: number): Promise<void>;
|
|
31
33
|
}
|
|
32
34
|
export declare const fetchRemoteGraphqlSchema: ({ url, token, }: {
|
|
33
35
|
url: string;
|
|
34
36
|
token?: string;
|
|
37
|
+
}) => Promise<{
|
|
38
|
+
remoteSchema: any;
|
|
39
|
+
remoteRuntimeVersion: string;
|
|
40
|
+
remoteProjectVersion: string;
|
|
41
|
+
}>;
|
|
42
|
+
export declare const fetchSchemaSha: ({ url, token, }: {
|
|
43
|
+
url: string;
|
|
44
|
+
token?: string;
|
|
35
45
|
}) => Promise<any>;
|
|
@@ -55,7 +55,12 @@ export declare class ConfigManager {
|
|
|
55
55
|
shouldSkipSDK(): boolean;
|
|
56
56
|
processConfig(): Promise<void>;
|
|
57
57
|
getTinaFolderPath(rootPath: any): Promise<string>;
|
|
58
|
-
getTinaGraphQLVersion():
|
|
58
|
+
getTinaGraphQLVersion(): {
|
|
59
|
+
fullVersion: string;
|
|
60
|
+
major: string;
|
|
61
|
+
minor: string;
|
|
62
|
+
patch: string;
|
|
63
|
+
};
|
|
59
64
|
printGeneratedClientFilePath(): string;
|
|
60
65
|
printGeneratedTypesFilePath(): string;
|
|
61
66
|
printoutputHTMLFilePath(): string;
|
|
@@ -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
|
|
@@ -22,7 +22,7 @@ interface StaticMediaItem {
|
|
|
22
22
|
export interface StaticMedia {
|
|
23
23
|
[offset: string]: StaticMediaItem[];
|
|
24
24
|
}
|
|
25
|
-
export declare const createConfig: ({ configManager,
|
|
25
|
+
export declare const createConfig: ({ configManager, apiURL, plugins, noWatch, rollupOptions, }: {
|
|
26
26
|
configManager: ConfigManager;
|
|
27
27
|
database: Database;
|
|
28
28
|
apiURL: string;
|
package/dist/server/server.d.ts
CHANGED
package/dist/utils/index.d.ts
CHANGED
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-d7c745e-20250102002342",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -26,9 +26,8 @@
|
|
|
26
26
|
"@types/cors": "2.8.5",
|
|
27
27
|
"@types/crypto-js": "^4.2.2",
|
|
28
28
|
"@types/express": "^4.17.21",
|
|
29
|
-
"@types/express-graphql": "^0.9.0",
|
|
30
29
|
"@types/figlet": "1.2.0",
|
|
31
|
-
"@types/fs-extra": "^
|
|
30
|
+
"@types/fs-extra": "^11.0.4",
|
|
32
31
|
"@types/jest": "26.0.4",
|
|
33
32
|
"@types/js-yaml": "^4.0.9",
|
|
34
33
|
"@types/listr": "0.14.2",
|
|
@@ -36,22 +35,23 @@
|
|
|
36
35
|
"@types/multer": "^1.4.12",
|
|
37
36
|
"@types/progress": "^2.0.7",
|
|
38
37
|
"@types/prompts": "^2.4.9",
|
|
39
|
-
"@types/yup": "^0.
|
|
38
|
+
"@types/yup": "^0.32.0",
|
|
40
39
|
"jest": "^29.7.0",
|
|
41
|
-
"@tinacms/scripts": "1.
|
|
40
|
+
"@tinacms/scripts": "1.3.1"
|
|
42
41
|
},
|
|
43
42
|
"dependencies": {
|
|
44
43
|
"@graphql-codegen/core": "^2.6.8",
|
|
45
44
|
"@graphql-codegen/plugin-helpers": "latest",
|
|
46
|
-
"@graphql-codegen/typescript": "^4.
|
|
47
|
-
"@graphql-codegen/typescript-operations": "^4.
|
|
45
|
+
"@graphql-codegen/typescript": "^4.1.1",
|
|
46
|
+
"@graphql-codegen/typescript-operations": "^4.3.1",
|
|
48
47
|
"@graphql-codegen/visitor-plugin-common": "^4.1.2",
|
|
49
48
|
"@graphql-inspector/core": "^4.2.2",
|
|
50
49
|
"@graphql-tools/graphql-file-loader": "^7.5.17",
|
|
51
50
|
"@graphql-tools/load": "^7.8.14",
|
|
52
|
-
"@rollup/pluginutils": "^5.1.
|
|
51
|
+
"@rollup/pluginutils": "^5.1.3",
|
|
53
52
|
"@svgr/core": "8.1.0",
|
|
54
53
|
"@tailwindcss/aspect-ratio": "^0.4.2",
|
|
54
|
+
"@tailwindcss/container-queries": "^0.1.1",
|
|
55
55
|
"@tailwindcss/typography": "^0.5.15",
|
|
56
56
|
"@vitejs/plugin-react": "3.1.0",
|
|
57
57
|
"altair-express-middleware": "^7.3.6",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"cors": "^2.8.5",
|
|
66
66
|
"crypto-js": "^4.2.0",
|
|
67
67
|
"dotenv": "^16.4.5",
|
|
68
|
-
"esbuild": "^0.
|
|
68
|
+
"esbuild": "^0.24.0",
|
|
69
69
|
"fs-extra": "^11.2.0",
|
|
70
70
|
"graphql": "15.8.0",
|
|
71
71
|
"js-yaml": "^4.1.0",
|
|
@@ -78,18 +78,18 @@
|
|
|
78
78
|
"progress": "^2.0.3",
|
|
79
79
|
"prompts": "^2.4.2",
|
|
80
80
|
"readable-stream": "^4.5.2",
|
|
81
|
-
"tailwindcss": "^3.4.
|
|
81
|
+
"tailwindcss": "^3.4.15",
|
|
82
82
|
"typanion": "3.13.0",
|
|
83
|
-
"typescript": "^5.6.
|
|
83
|
+
"typescript": "^5.6.3",
|
|
84
84
|
"vite": "^4.5.5",
|
|
85
|
-
"yup": "^
|
|
85
|
+
"yup": "^1.4.0",
|
|
86
86
|
"zod": "^3.23.8",
|
|
87
|
-
"@tinacms/
|
|
88
|
-
"@tinacms/
|
|
89
|
-
"@tinacms/schema-tools": "
|
|
90
|
-
"@tinacms/
|
|
91
|
-
"tinacms": "0.0.0-
|
|
92
|
-
"
|
|
87
|
+
"@tinacms/graphql": "0.0.0-d7c745e-20250102002342",
|
|
88
|
+
"@tinacms/app": "0.0.0-d7c745e-20250102002342",
|
|
89
|
+
"@tinacms/schema-tools": "1.6.9",
|
|
90
|
+
"@tinacms/metrics": "1.0.8",
|
|
91
|
+
"@tinacms/search": "0.0.0-d7c745e-20250102002342",
|
|
92
|
+
"tinacms": "0.0.0-d7c745e-20250102002342"
|
|
93
93
|
},
|
|
94
94
|
"publishConfig": {
|
|
95
95
|
"registry": "https://registry.npmjs.org"
|