@tinacms/cli 1.10.3 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,7 +8,7 @@ export * from './databaseAdapter';
|
|
|
8
8
|
export * from './authProvider';
|
|
9
9
|
export declare const askCommonSetUp: () => Promise<{
|
|
10
10
|
framework: Framework;
|
|
11
|
-
packageManager: "pnpm" | "yarn" | "npm";
|
|
11
|
+
packageManager: "pnpm" | "yarn" | "npm" | "bun";
|
|
12
12
|
}>;
|
|
13
13
|
export declare const askForestryMigrate: ({ framework, env, }: {
|
|
14
14
|
framework: Framework;
|
|
@@ -4,7 +4,7 @@ export type Config = {
|
|
|
4
4
|
typescript: boolean;
|
|
5
5
|
publicFolder?: string;
|
|
6
6
|
framework: Framework;
|
|
7
|
-
packageManager: 'pnpm' | 'yarn' | 'npm';
|
|
7
|
+
packageManager: 'pnpm' | 'yarn' | 'npm' | 'bun';
|
|
8
8
|
forestryMigrate: boolean;
|
|
9
9
|
frontMatterFormat?: ContentFrontmatterFormat;
|
|
10
10
|
hosting?: 'tina-cloud' | 'self-host';
|
package/dist/index.js
CHANGED
|
@@ -35,10 +35,10 @@ module.exports = __toCommonJS(index_exports);
|
|
|
35
35
|
var import_clipanion8 = require("clipanion");
|
|
36
36
|
|
|
37
37
|
// package.json
|
|
38
|
-
var version = "1.
|
|
38
|
+
var version = "1.11.0";
|
|
39
39
|
|
|
40
40
|
// src/next/commands/dev-command/index.ts
|
|
41
|
-
var
|
|
41
|
+
var import_path7 = __toESM(require("path"));
|
|
42
42
|
var import_graphql10 = require("@tinacms/graphql");
|
|
43
43
|
var import_search = require("@tinacms/search");
|
|
44
44
|
var import_async_lock = __toESM(require("async-lock"));
|
|
@@ -601,7 +601,7 @@ var Codegen = class {
|
|
|
601
601
|
throw new Error(
|
|
602
602
|
`Client not configured properly. Missing ${missing.join(
|
|
603
603
|
", "
|
|
604
|
-
)}. Please visit https://tina.io/docs/
|
|
604
|
+
)}. Please visit https://tina.io/docs/r/what-is-tinacloud for more information`
|
|
605
605
|
);
|
|
606
606
|
}
|
|
607
607
|
let localUrl = `http://localhost:${this.port}/graphql`;
|
|
@@ -775,12 +775,25 @@ var unlinkIfExists = async (filepath) => {
|
|
|
775
775
|
|
|
776
776
|
// src/next/config-manager.ts
|
|
777
777
|
var import_fs_extra2 = __toESM(require("fs-extra"));
|
|
778
|
-
var
|
|
778
|
+
var import_path3 = __toESM(require("path"));
|
|
779
779
|
var import_os = __toESM(require("os"));
|
|
780
780
|
var esbuild = __toESM(require("esbuild"));
|
|
781
781
|
var dotenv = __toESM(require("dotenv"));
|
|
782
782
|
var import_normalize_path2 = __toESM(require("normalize-path"));
|
|
783
783
|
var import_chalk3 = __toESM(require("chalk"));
|
|
784
|
+
|
|
785
|
+
// src/utils/path.ts
|
|
786
|
+
var import_path2 = __toESM(require("path"));
|
|
787
|
+
function stripNativeTrailingSlash(p) {
|
|
788
|
+
const { root } = import_path2.default.parse(p);
|
|
789
|
+
let str = p;
|
|
790
|
+
while (str.length > root.length && str.endsWith(import_path2.default.sep)) {
|
|
791
|
+
str = str.slice(0, -1);
|
|
792
|
+
}
|
|
793
|
+
return str;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
// src/next/config-manager.ts
|
|
784
797
|
var TINA_FOLDER = "tina";
|
|
785
798
|
var LEGACY_TINA_FOLDER = ".tina";
|
|
786
799
|
var GENERATED_FOLDER = "__generated__";
|
|
@@ -799,7 +812,7 @@ var ConfigManager = class {
|
|
|
799
812
|
this.legacyNoSDK = legacyNoSDK;
|
|
800
813
|
}
|
|
801
814
|
isUsingTs() {
|
|
802
|
-
return [".ts", ".tsx"].includes(
|
|
815
|
+
return [".ts", ".tsx"].includes(import_path3.default.extname(this.tinaConfigFilePath));
|
|
803
816
|
}
|
|
804
817
|
hasSelfHostedConfig() {
|
|
805
818
|
return !!this.selfHostedDatabaseFilePath;
|
|
@@ -815,12 +828,12 @@ var ConfigManager = class {
|
|
|
815
828
|
}
|
|
816
829
|
async processConfig() {
|
|
817
830
|
this.tinaFolderPath = await this.getTinaFolderPath(this.rootPath);
|
|
818
|
-
this.envFilePath =
|
|
819
|
-
|
|
831
|
+
this.envFilePath = import_path3.default.resolve(
|
|
832
|
+
import_path3.default.join(this.tinaFolderPath, "..", ".env")
|
|
820
833
|
);
|
|
821
834
|
dotenv.config({ path: this.envFilePath });
|
|
822
835
|
this.tinaConfigFilePath = await this.getPathWithExtension(
|
|
823
|
-
|
|
836
|
+
import_path3.default.join(this.tinaFolderPath, "config")
|
|
824
837
|
);
|
|
825
838
|
if (!this.tinaConfigFilePath) {
|
|
826
839
|
throw new Error(
|
|
@@ -828,79 +841,79 @@ var ConfigManager = class {
|
|
|
828
841
|
);
|
|
829
842
|
}
|
|
830
843
|
this.selfHostedDatabaseFilePath = await this.getPathWithExtension(
|
|
831
|
-
|
|
844
|
+
import_path3.default.join(this.tinaFolderPath, "database")
|
|
832
845
|
);
|
|
833
|
-
this.generatedFolderPath =
|
|
834
|
-
this.generatedCachePath =
|
|
846
|
+
this.generatedFolderPath = import_path3.default.join(this.tinaFolderPath, GENERATED_FOLDER);
|
|
847
|
+
this.generatedCachePath = import_path3.default.join(
|
|
835
848
|
this.generatedFolderPath,
|
|
836
849
|
".cache",
|
|
837
850
|
String((/* @__PURE__ */ new Date()).getTime())
|
|
838
851
|
);
|
|
839
|
-
this.generatedGraphQLGQLPath =
|
|
852
|
+
this.generatedGraphQLGQLPath = import_path3.default.join(
|
|
840
853
|
this.generatedFolderPath,
|
|
841
854
|
GRAPHQL_GQL_FILE
|
|
842
855
|
);
|
|
843
|
-
this.generatedGraphQLJSONPath =
|
|
856
|
+
this.generatedGraphQLJSONPath = import_path3.default.join(
|
|
844
857
|
this.generatedFolderPath,
|
|
845
858
|
GRAPHQL_JSON_FILE
|
|
846
859
|
);
|
|
847
|
-
this.generatedSchemaJSONPath =
|
|
860
|
+
this.generatedSchemaJSONPath = import_path3.default.join(
|
|
848
861
|
this.generatedFolderPath,
|
|
849
862
|
SCHEMA_JSON_FILE
|
|
850
863
|
);
|
|
851
|
-
this.generatedLookupJSONPath =
|
|
864
|
+
this.generatedLookupJSONPath = import_path3.default.join(
|
|
852
865
|
this.generatedFolderPath,
|
|
853
866
|
LOOKUP_JSON_FILE
|
|
854
867
|
);
|
|
855
|
-
this.generatedQueriesFilePath =
|
|
868
|
+
this.generatedQueriesFilePath = import_path3.default.join(
|
|
856
869
|
this.generatedFolderPath,
|
|
857
870
|
"queries.gql"
|
|
858
871
|
);
|
|
859
|
-
this.generatedFragmentsFilePath =
|
|
872
|
+
this.generatedFragmentsFilePath = import_path3.default.join(
|
|
860
873
|
this.generatedFolderPath,
|
|
861
874
|
"frags.gql"
|
|
862
875
|
);
|
|
863
|
-
this.generatedTypesTSFilePath =
|
|
876
|
+
this.generatedTypesTSFilePath = import_path3.default.join(
|
|
864
877
|
this.generatedFolderPath,
|
|
865
878
|
"types.ts"
|
|
866
879
|
);
|
|
867
|
-
this.generatedTypesJSFilePath =
|
|
880
|
+
this.generatedTypesJSFilePath = import_path3.default.join(
|
|
868
881
|
this.generatedFolderPath,
|
|
869
882
|
"types.js"
|
|
870
883
|
);
|
|
871
|
-
this.generatedTypesDFilePath =
|
|
884
|
+
this.generatedTypesDFilePath = import_path3.default.join(
|
|
872
885
|
this.generatedFolderPath,
|
|
873
886
|
"types.d.ts"
|
|
874
887
|
);
|
|
875
|
-
this.userQueriesAndFragmentsGlob =
|
|
888
|
+
this.userQueriesAndFragmentsGlob = import_path3.default.join(
|
|
876
889
|
this.tinaFolderPath,
|
|
877
890
|
"queries/**/*.{graphql,gql}"
|
|
878
891
|
);
|
|
879
|
-
this.generatedQueriesAndFragmentsGlob =
|
|
892
|
+
this.generatedQueriesAndFragmentsGlob = import_path3.default.join(
|
|
880
893
|
this.generatedFolderPath,
|
|
881
894
|
"*.{graphql,gql}"
|
|
882
895
|
);
|
|
883
|
-
this.generatedClientTSFilePath =
|
|
896
|
+
this.generatedClientTSFilePath = import_path3.default.join(
|
|
884
897
|
this.generatedFolderPath,
|
|
885
898
|
"client.ts"
|
|
886
899
|
);
|
|
887
|
-
this.generatedClientJSFilePath =
|
|
900
|
+
this.generatedClientJSFilePath = import_path3.default.join(
|
|
888
901
|
this.generatedFolderPath,
|
|
889
902
|
"client.js"
|
|
890
903
|
);
|
|
891
|
-
this.generatedClientDFilePath =
|
|
904
|
+
this.generatedClientDFilePath = import_path3.default.join(
|
|
892
905
|
this.generatedFolderPath,
|
|
893
906
|
"client.d.ts"
|
|
894
907
|
);
|
|
895
|
-
this.generatedDatabaseClientDFilePath =
|
|
908
|
+
this.generatedDatabaseClientDFilePath = import_path3.default.join(
|
|
896
909
|
this.generatedFolderPath,
|
|
897
910
|
"databaseClient.d.ts"
|
|
898
911
|
);
|
|
899
|
-
this.generatedDatabaseClientTSFilePath =
|
|
912
|
+
this.generatedDatabaseClientTSFilePath = import_path3.default.join(
|
|
900
913
|
this.generatedFolderPath,
|
|
901
914
|
"databaseClient.ts"
|
|
902
915
|
);
|
|
903
|
-
this.generatedDatabaseClientJSFilePath =
|
|
916
|
+
this.generatedDatabaseClientJSFilePath = import_path3.default.join(
|
|
904
917
|
this.generatedFolderPath,
|
|
905
918
|
"databaseClient.js"
|
|
906
919
|
);
|
|
@@ -920,19 +933,18 @@ var ConfigManager = class {
|
|
|
920
933
|
this.watchList = watchList;
|
|
921
934
|
this.config = config2;
|
|
922
935
|
this.prebuildFilePath = prebuildPath;
|
|
923
|
-
this.publicFolderPath =
|
|
936
|
+
this.publicFolderPath = import_path3.default.join(
|
|
924
937
|
this.rootPath,
|
|
925
938
|
this.config.build.publicFolder
|
|
926
939
|
);
|
|
927
|
-
this.outputFolderPath =
|
|
940
|
+
this.outputFolderPath = import_path3.default.join(
|
|
928
941
|
this.publicFolderPath,
|
|
929
942
|
this.config.build.outputFolder
|
|
930
943
|
);
|
|
931
|
-
this.outputHTMLFilePath =
|
|
932
|
-
this.outputGitignorePath =
|
|
933
|
-
const fullLocalContentPath =
|
|
934
|
-
this.tinaFolderPath,
|
|
935
|
-
this.config.localContentPath || ""
|
|
944
|
+
this.outputHTMLFilePath = import_path3.default.join(this.outputFolderPath, "index.html");
|
|
945
|
+
this.outputGitignorePath = import_path3.default.join(this.outputFolderPath, ".gitignore");
|
|
946
|
+
const fullLocalContentPath = stripNativeTrailingSlash(
|
|
947
|
+
import_path3.default.join(this.tinaFolderPath, this.config.localContentPath || "")
|
|
936
948
|
);
|
|
937
949
|
if (this.config.localContentPath) {
|
|
938
950
|
const localContentPathExists = await import_fs_extra2.default.pathExists(fullLocalContentPath);
|
|
@@ -952,21 +964,21 @@ var ConfigManager = class {
|
|
|
952
964
|
if (!this.contentRootPath) {
|
|
953
965
|
this.contentRootPath = this.rootPath;
|
|
954
966
|
}
|
|
955
|
-
this.generatedFolderPathContentRepo =
|
|
967
|
+
this.generatedFolderPathContentRepo = import_path3.default.join(
|
|
956
968
|
await this.getTinaFolderPath(this.contentRootPath),
|
|
957
969
|
GENERATED_FOLDER
|
|
958
970
|
);
|
|
959
971
|
this.spaMainPath = require.resolve("@tinacms/app");
|
|
960
|
-
this.spaRootPath =
|
|
972
|
+
this.spaRootPath = import_path3.default.join(this.spaMainPath, "..", "..");
|
|
961
973
|
}
|
|
962
974
|
async getTinaFolderPath(rootPath) {
|
|
963
|
-
const tinaFolderPath =
|
|
975
|
+
const tinaFolderPath = import_path3.default.join(rootPath, TINA_FOLDER);
|
|
964
976
|
const tinaFolderExists = await import_fs_extra2.default.pathExists(tinaFolderPath);
|
|
965
977
|
if (tinaFolderExists) {
|
|
966
978
|
this.isUsingLegacyFolder = false;
|
|
967
979
|
return tinaFolderPath;
|
|
968
980
|
}
|
|
969
|
-
const legacyFolderPath =
|
|
981
|
+
const legacyFolderPath = import_path3.default.join(rootPath, LEGACY_TINA_FOLDER);
|
|
970
982
|
const legacyFolderExists = await import_fs_extra2.default.pathExists(legacyFolderPath);
|
|
971
983
|
if (legacyFolderExists) {
|
|
972
984
|
this.isUsingLegacyFolder = true;
|
|
@@ -1042,8 +1054,8 @@ var ConfigManager = class {
|
|
|
1042
1054
|
return result;
|
|
1043
1055
|
}
|
|
1044
1056
|
async loadDatabaseFile() {
|
|
1045
|
-
const tmpdir =
|
|
1046
|
-
const outfile =
|
|
1057
|
+
const tmpdir = import_path3.default.join(import_os.default.tmpdir(), Date.now().toString());
|
|
1058
|
+
const outfile = import_path3.default.join(tmpdir, "database.build.js");
|
|
1047
1059
|
await esbuild.build({
|
|
1048
1060
|
entryPoints: [this.selfHostedDatabaseFilePath],
|
|
1049
1061
|
bundle: true,
|
|
@@ -1056,14 +1068,14 @@ var ConfigManager = class {
|
|
|
1056
1068
|
return result.default;
|
|
1057
1069
|
}
|
|
1058
1070
|
async loadConfigFile(generatedFolderPath, configFilePath) {
|
|
1059
|
-
const tmpdir =
|
|
1060
|
-
const preBuildConfigPath =
|
|
1071
|
+
const tmpdir = import_path3.default.join(import_os.default.tmpdir(), Date.now().toString());
|
|
1072
|
+
const preBuildConfigPath = import_path3.default.join(
|
|
1061
1073
|
this.generatedFolderPath,
|
|
1062
1074
|
"config.prebuild.jsx"
|
|
1063
1075
|
);
|
|
1064
|
-
const outfile =
|
|
1065
|
-
const outfile2 =
|
|
1066
|
-
const tempTSConfigFile =
|
|
1076
|
+
const outfile = import_path3.default.join(tmpdir, "config.build.jsx");
|
|
1077
|
+
const outfile2 = import_path3.default.join(tmpdir, "config.build.js");
|
|
1078
|
+
const tempTSConfigFile = import_path3.default.join(tmpdir, "tsconfig.json");
|
|
1067
1079
|
import_fs_extra2.default.outputFileSync(tempTSConfigFile, "{}");
|
|
1068
1080
|
const result2 = await esbuild.build({
|
|
1069
1081
|
entryPoints: [configFilePath],
|
|
@@ -1350,7 +1362,7 @@ var BaseCommand = class extends import_clipanion.Command {
|
|
|
1350
1362
|
pathFilter
|
|
1351
1363
|
});
|
|
1352
1364
|
const tinaPathUpdates = modified.filter(
|
|
1353
|
-
(
|
|
1365
|
+
(path15) => path15.startsWith(".tina/__generated__/_schema.json") || path15.startsWith("tina/tina-lock.json")
|
|
1354
1366
|
);
|
|
1355
1367
|
if (tinaPathUpdates.length > 0) {
|
|
1356
1368
|
res = await database.indexContent({
|
|
@@ -1428,7 +1440,7 @@ var errorHTML = `<style type="text/css">
|
|
|
1428
1440
|
the assets for this page.
|
|
1429
1441
|
</p>
|
|
1430
1442
|
<p>
|
|
1431
|
-
Please visit <a href="https://tina.io/docs/
|
|
1443
|
+
Please visit <a href="https://tina.io/docs/r/FAQ/#13-how-do-i-resolve-failed-loading-tinacms-assets-error">this doc</a> for help.
|
|
1432
1444
|
</p>
|
|
1433
1445
|
</div>
|
|
1434
1446
|
</div>`.trim().replace(/[\r\n\s]+/g, " ");
|
|
@@ -1681,6 +1693,7 @@ var tinaTailwind = (spaPath, prebuildFilePath) => {
|
|
|
1681
1693
|
500: "#EC4815",
|
|
1682
1694
|
600: "#DC4419"
|
|
1683
1695
|
},
|
|
1696
|
+
"tina-orange": "#EC4815",
|
|
1684
1697
|
background: "#FFFFFF",
|
|
1685
1698
|
foreground: "#0A0A0A",
|
|
1686
1699
|
muted: "#F5F5F5",
|
|
@@ -1942,17 +1955,17 @@ var import_pluginutils = require("@rollup/pluginutils");
|
|
|
1942
1955
|
var import_fs = __toESM(require("fs"));
|
|
1943
1956
|
var import_vite2 = require("vite");
|
|
1944
1957
|
var import_esbuild2 = require("esbuild");
|
|
1945
|
-
var
|
|
1958
|
+
var import_path6 = __toESM(require("path"));
|
|
1946
1959
|
var import_body_parser = __toESM(require("body-parser"));
|
|
1947
1960
|
var import_cors = __toESM(require("cors"));
|
|
1948
1961
|
var import_graphql9 = require("@tinacms/graphql");
|
|
1949
1962
|
|
|
1950
1963
|
// src/next/commands/dev-command/server/media.ts
|
|
1951
1964
|
var import_fs_extra5 = __toESM(require("fs-extra"));
|
|
1952
|
-
var
|
|
1965
|
+
var import_path5 = __toESM(require("path"));
|
|
1953
1966
|
var import_busboy = __toESM(require("busboy"));
|
|
1954
1967
|
var createMediaRouter = (config2) => {
|
|
1955
|
-
const mediaFolder =
|
|
1968
|
+
const mediaFolder = import_path5.default.join(
|
|
1956
1969
|
config2.rootPath,
|
|
1957
1970
|
config2.publicFolder,
|
|
1958
1971
|
config2.mediaRoot
|
|
@@ -1979,8 +1992,8 @@ var createMediaRouter = (config2) => {
|
|
|
1979
1992
|
const bb = (0, import_busboy.default)({ headers: req.headers });
|
|
1980
1993
|
bb.on("file", async (_name, file, _info) => {
|
|
1981
1994
|
const fullPath = decodeURI(req.url?.slice("/media/upload/".length));
|
|
1982
|
-
const saveTo =
|
|
1983
|
-
await import_fs_extra5.default.ensureDir(
|
|
1995
|
+
const saveTo = import_path5.default.join(mediaFolder, ...fullPath.split("/"));
|
|
1996
|
+
await import_fs_extra5.default.ensureDir(import_path5.default.dirname(saveTo));
|
|
1984
1997
|
file.pipe(import_fs_extra5.default.createWriteStream(saveTo));
|
|
1985
1998
|
});
|
|
1986
1999
|
bb.on("error", (error) => {
|
|
@@ -2014,7 +2027,7 @@ var MediaModel = class {
|
|
|
2014
2027
|
}
|
|
2015
2028
|
async listMedia(args) {
|
|
2016
2029
|
try {
|
|
2017
|
-
const folderPath = (0,
|
|
2030
|
+
const folderPath = (0, import_path5.join)(
|
|
2018
2031
|
this.rootPath,
|
|
2019
2032
|
this.publicFolder,
|
|
2020
2033
|
this.mediaRoot,
|
|
@@ -2029,7 +2042,7 @@ var MediaModel = class {
|
|
|
2029
2042
|
}
|
|
2030
2043
|
const filesStr = await import_fs_extra5.default.readdir(folderPath);
|
|
2031
2044
|
const filesProm = filesStr.map(async (file) => {
|
|
2032
|
-
const filePath = (0,
|
|
2045
|
+
const filePath = (0, import_path5.join)(folderPath, file);
|
|
2033
2046
|
const stat = await import_fs_extra5.default.stat(filePath);
|
|
2034
2047
|
let src = `/${file}`;
|
|
2035
2048
|
const isFile = stat.isFile();
|
|
@@ -2086,7 +2099,7 @@ var MediaModel = class {
|
|
|
2086
2099
|
}
|
|
2087
2100
|
async deleteMedia(args) {
|
|
2088
2101
|
try {
|
|
2089
|
-
const file = (0,
|
|
2102
|
+
const file = (0, import_path5.join)(
|
|
2090
2103
|
this.rootPath,
|
|
2091
2104
|
this.publicFolder,
|
|
2092
2105
|
this.mediaRoot,
|
|
@@ -2151,7 +2164,7 @@ var transformTsxPlugin = ({
|
|
|
2151
2164
|
const plug = {
|
|
2152
2165
|
name: "transform-tsx",
|
|
2153
2166
|
async transform(code, id) {
|
|
2154
|
-
const extName =
|
|
2167
|
+
const extName = import_path6.default.extname(id);
|
|
2155
2168
|
if (extName.startsWith(".tsx") || extName.startsWith(".ts")) {
|
|
2156
2169
|
const result = await (0, import_esbuild2.transform)(code, { loader: "tsx" });
|
|
2157
2170
|
return {
|
|
@@ -2415,14 +2428,14 @@ var DevCommand = class extends BaseCommand {
|
|
|
2415
2428
|
graphql: graphqlSchemaObject
|
|
2416
2429
|
});
|
|
2417
2430
|
import_fs_extra6.default.writeFileSync(
|
|
2418
|
-
|
|
2431
|
+
import_path7.default.join(configManager.tinaFolderPath, tinaLockFilename),
|
|
2419
2432
|
tinaLockContent
|
|
2420
2433
|
);
|
|
2421
2434
|
if (configManager.hasSeparateContentRoot()) {
|
|
2422
2435
|
const rootPath = await configManager.getTinaFolderPath(
|
|
2423
2436
|
configManager.contentRootPath
|
|
2424
2437
|
);
|
|
2425
|
-
const filePath =
|
|
2438
|
+
const filePath = import_path7.default.join(rootPath, tinaLockFilename);
|
|
2426
2439
|
await import_fs_extra6.default.ensureFile(filePath);
|
|
2427
2440
|
await import_fs_extra6.default.outputFile(filePath, tinaLockContent);
|
|
2428
2441
|
}
|
|
@@ -2582,11 +2595,11 @@ ${dangerText(e.message)}
|
|
|
2582
2595
|
// subItems: [
|
|
2583
2596
|
// {
|
|
2584
2597
|
// key: 'Custom queries',
|
|
2585
|
-
// value: 'https://tina.io/
|
|
2598
|
+
// value: 'https://tina.io/docs/r/content-api-overview',
|
|
2586
2599
|
// },
|
|
2587
2600
|
// {
|
|
2588
2601
|
// key: 'Visual editing',
|
|
2589
|
-
// value: 'https://tina.io/visual-editing',
|
|
2602
|
+
// value: 'https://tina.io/docs/r/visual-editing-setup',
|
|
2590
2603
|
// },
|
|
2591
2604
|
// ],
|
|
2592
2605
|
// },
|
|
@@ -2597,7 +2610,7 @@ ${dangerText(e.message)}
|
|
|
2597
2610
|
watchContentFiles(configManager, database, databaseLock, searchIndexer) {
|
|
2598
2611
|
const collectionContentFiles = [];
|
|
2599
2612
|
configManager.config.schema.collections.forEach((collection) => {
|
|
2600
|
-
const collectionGlob = `${
|
|
2613
|
+
const collectionGlob = `${import_path7.default.join(
|
|
2601
2614
|
configManager.contentRootPath,
|
|
2602
2615
|
collection.path
|
|
2603
2616
|
)}/**/*.${collection.format || "md"}`;
|
|
@@ -2647,7 +2660,7 @@ ${dangerText(e.message)}
|
|
|
2647
2660
|
|
|
2648
2661
|
// src/next/commands/build-command/index.ts
|
|
2649
2662
|
var import_crypto = __toESM(require("crypto"));
|
|
2650
|
-
var
|
|
2663
|
+
var import_path8 = __toESM(require("path"));
|
|
2651
2664
|
var import_core3 = require("@graphql-inspector/core");
|
|
2652
2665
|
var import_graphql11 = require("@tinacms/graphql");
|
|
2653
2666
|
var import_schema_tools2 = require("@tinacms/schema-tools");
|
|
@@ -2662,7 +2675,7 @@ var import_core2 = require("@graphql-inspector/core");
|
|
|
2662
2675
|
var getFaqLink = (type) => {
|
|
2663
2676
|
switch (type) {
|
|
2664
2677
|
case import_core2.ChangeType.FieldRemoved: {
|
|
2665
|
-
return "https://tina.io/docs/
|
|
2678
|
+
return "https://tina.io/docs/r/FAQ/#2-how-do-i-resolve-the-local-graphql-schema-doesnt-match-the-remote-graphql-schema-error";
|
|
2666
2679
|
}
|
|
2667
2680
|
default:
|
|
2668
2681
|
return null;
|
|
@@ -3369,7 +3382,7 @@ Additional info: Branch: ${config2.branch}, Client ID: ${config2.clientId} `;
|
|
|
3369
3382
|
}
|
|
3370
3383
|
const localTinaSchema = JSON.parse(
|
|
3371
3384
|
await database.bridge.get(
|
|
3372
|
-
|
|
3385
|
+
import_path8.default.join(database.tinaDirectory, "__generated__", "_schema.json")
|
|
3373
3386
|
)
|
|
3374
3387
|
);
|
|
3375
3388
|
localTinaSchema.version = void 0;
|
|
@@ -3424,12 +3437,12 @@ async function request(args) {
|
|
|
3424
3437
|
Message from server: ${json.message}`;
|
|
3425
3438
|
}
|
|
3426
3439
|
throw new Error(
|
|
3427
|
-
`Server responded with status code ${res.status}, ${res.statusText}. ${additionalInfo ? additionalInfo : ""} Please see our FAQ for more information: https://tina.io/docs/
|
|
3440
|
+
`Server responded with status code ${res.status}, ${res.statusText}. ${additionalInfo ? additionalInfo : ""} Please see our FAQ for more information: https://tina.io/docs/r/FAQ/`
|
|
3428
3441
|
);
|
|
3429
3442
|
}
|
|
3430
3443
|
if (json.errors) {
|
|
3431
3444
|
throw new Error(
|
|
3432
|
-
`Unable to fetch, please see our FAQ for more information: https://tina.io/docs/
|
|
3445
|
+
`Unable to fetch, please see our FAQ for more information: https://tina.io/docs/r/FAQ/
|
|
3433
3446
|
|
|
3434
3447
|
Errors:
|
|
3435
3448
|
${json.errors.map((error) => error.message).join("\n")}`
|
|
@@ -3740,25 +3753,25 @@ var import_clipanion6 = require("clipanion");
|
|
|
3740
3753
|
|
|
3741
3754
|
// src/cmds/init/detectEnvironment.ts
|
|
3742
3755
|
var import_fs_extra8 = __toESM(require("fs-extra"));
|
|
3743
|
-
var
|
|
3756
|
+
var import_path9 = __toESM(require("path"));
|
|
3744
3757
|
var checkGitignoreForItem = async ({
|
|
3745
3758
|
baseDir,
|
|
3746
3759
|
line
|
|
3747
3760
|
}) => {
|
|
3748
|
-
const gitignoreContent = import_fs_extra8.default.readFileSync(
|
|
3761
|
+
const gitignoreContent = import_fs_extra8.default.readFileSync(import_path9.default.join(baseDir, ".gitignore")).toString();
|
|
3749
3762
|
return gitignoreContent.split("\n").some((item) => item === line);
|
|
3750
3763
|
};
|
|
3751
3764
|
var makeGeneratedFile = async (name2, generatedFileType, parentPath, opts) => {
|
|
3752
3765
|
const result = {
|
|
3753
|
-
fullPathTS:
|
|
3766
|
+
fullPathTS: import_path9.default.join(
|
|
3754
3767
|
parentPath,
|
|
3755
3768
|
`${name2}.${opts?.typescriptSuffix || opts?.extensionOverride || "ts"}`
|
|
3756
3769
|
),
|
|
3757
|
-
fullPathJS:
|
|
3770
|
+
fullPathJS: import_path9.default.join(
|
|
3758
3771
|
parentPath,
|
|
3759
3772
|
`${name2}.${opts?.extensionOverride || "js"}`
|
|
3760
3773
|
),
|
|
3761
|
-
fullPathOverride: opts?.extensionOverride ?
|
|
3774
|
+
fullPathOverride: opts?.extensionOverride ? import_path9.default.join(parentPath, `${name2}.${opts?.extensionOverride}`) : "",
|
|
3762
3775
|
generatedFileType,
|
|
3763
3776
|
name: name2,
|
|
3764
3777
|
parentPath,
|
|
@@ -3787,16 +3800,16 @@ var detectEnvironment = async ({
|
|
|
3787
3800
|
debug = false
|
|
3788
3801
|
}) => {
|
|
3789
3802
|
const hasForestryConfig = await import_fs_extra8.default.pathExists(
|
|
3790
|
-
|
|
3803
|
+
import_path9.default.join(pathToForestryConfig, ".forestry", "settings.yml")
|
|
3791
3804
|
);
|
|
3792
|
-
const sampleContentPath =
|
|
3805
|
+
const sampleContentPath = import_path9.default.join(
|
|
3793
3806
|
baseDir,
|
|
3794
3807
|
"content",
|
|
3795
3808
|
"posts",
|
|
3796
3809
|
"hello-world.md"
|
|
3797
3810
|
);
|
|
3798
|
-
const usingSrc = import_fs_extra8.default.pathExistsSync(
|
|
3799
|
-
const tinaFolder =
|
|
3811
|
+
const usingSrc = import_fs_extra8.default.pathExistsSync(import_path9.default.join(baseDir, "src")) && (import_fs_extra8.default.pathExistsSync(import_path9.default.join(baseDir, "src", "app")) || import_fs_extra8.default.pathExistsSync(import_path9.default.join(baseDir, "src", "pages")));
|
|
3812
|
+
const tinaFolder = import_path9.default.join(baseDir, "tina");
|
|
3800
3813
|
const tinaConfigExists = Boolean(
|
|
3801
3814
|
// Does the tina folder exist?
|
|
3802
3815
|
await import_fs_extra8.default.pathExists(tinaFolder) && // Does the tina folder contain a config file?
|
|
@@ -3812,12 +3825,12 @@ var detectEnvironment = async ({
|
|
|
3812
3825
|
"next-api-handler": await makeGeneratedFile(
|
|
3813
3826
|
"[...routes]",
|
|
3814
3827
|
"next-api-handler",
|
|
3815
|
-
|
|
3828
|
+
import_path9.default.join(...pagesDir, "api", "tina")
|
|
3816
3829
|
),
|
|
3817
3830
|
"reactive-example": await makeGeneratedFile(
|
|
3818
3831
|
"[filename]",
|
|
3819
3832
|
"reactive-example",
|
|
3820
|
-
|
|
3833
|
+
import_path9.default.join(...pagesDir, "demo", "blog"),
|
|
3821
3834
|
{
|
|
3822
3835
|
typescriptSuffix: "tsx"
|
|
3823
3836
|
}
|
|
@@ -3825,13 +3838,13 @@ var detectEnvironment = async ({
|
|
|
3825
3838
|
"users-json": await makeGeneratedFile(
|
|
3826
3839
|
"index",
|
|
3827
3840
|
"users-json",
|
|
3828
|
-
|
|
3841
|
+
import_path9.default.join(baseDir, "content", "users"),
|
|
3829
3842
|
{ extensionOverride: "json" }
|
|
3830
3843
|
),
|
|
3831
3844
|
"sample-content": await makeGeneratedFile(
|
|
3832
3845
|
"hello-world",
|
|
3833
3846
|
"sample-content",
|
|
3834
|
-
|
|
3847
|
+
import_path9.default.join(baseDir, "content", "posts"),
|
|
3835
3848
|
{ extensionOverride: "md" }
|
|
3836
3849
|
)
|
|
3837
3850
|
};
|
|
@@ -3857,13 +3870,13 @@ var detectEnvironment = async ({
|
|
|
3857
3870
|
);
|
|
3858
3871
|
}
|
|
3859
3872
|
}
|
|
3860
|
-
const hasGitIgnore = await import_fs_extra8.default.pathExists(
|
|
3873
|
+
const hasGitIgnore = await import_fs_extra8.default.pathExists(import_path9.default.join(".gitignore"));
|
|
3861
3874
|
const hasGitIgnoreNodeModules = hasGitIgnore && await checkGitignoreForItem({ baseDir, line: "node_modules" });
|
|
3862
3875
|
const hasEnvTina = hasGitIgnore && await checkGitignoreForItem({ baseDir, line: ".env.tina" });
|
|
3863
3876
|
const hasGitIgnoreEnv = hasGitIgnore && await checkGitignoreForItem({ baseDir, line: ".env" });
|
|
3864
3877
|
let frontMatterFormat;
|
|
3865
3878
|
if (hasForestryConfig) {
|
|
3866
|
-
const hugoConfigPath =
|
|
3879
|
+
const hugoConfigPath = import_path9.default.join(rootPath, "config.toml");
|
|
3867
3880
|
if (await import_fs_extra8.default.pathExists(hugoConfigPath)) {
|
|
3868
3881
|
const hugoConfig = await import_fs_extra8.default.readFile(hugoConfigPath, "utf8");
|
|
3869
3882
|
const metaDataFormat = hugoConfig.toString().match(/metaDataFormat = "(.*)"/)?.[1];
|
|
@@ -3965,7 +3978,7 @@ var chooseGitProvider = async ({ config: config2 }) => {
|
|
|
3965
3978
|
${logText(
|
|
3966
3979
|
"Learn more here: "
|
|
3967
3980
|
)}${linkText(
|
|
3968
|
-
"https://tina.io/docs/self-
|
|
3981
|
+
"https://tina.io/docs/r/self-hosting-nextjs/#github-personal-access-token"
|
|
3969
3982
|
)}`,
|
|
3970
3983
|
initial: process.env.GITHUB_PERSONAL_ACCESS_TOKEN
|
|
3971
3984
|
},
|
|
@@ -4226,7 +4239,8 @@ var askCommonSetUp = async () => {
|
|
|
4226
4239
|
choices: [
|
|
4227
4240
|
{ title: "PNPM", value: "pnpm" },
|
|
4228
4241
|
{ title: "Yarn", value: "yarn" },
|
|
4229
|
-
{ title: "NPM", value: "npm" }
|
|
4242
|
+
{ title: "NPM", value: "npm" },
|
|
4243
|
+
{ title: "Bun", value: "bun" }
|
|
4230
4244
|
]
|
|
4231
4245
|
}
|
|
4232
4246
|
]);
|
|
@@ -4287,7 +4301,7 @@ var askTinaSetupPrompts = async (params) => {
|
|
|
4287
4301
|
message: `Where are public assets stored? (default: "public")
|
|
4288
4302
|
` + logText(
|
|
4289
4303
|
`Not sure what value to use? Refer to our "Frameworks" doc: ${linkText(
|
|
4290
|
-
"https://tina.io/docs/
|
|
4304
|
+
"https://tina.io/docs/r/framework-guides-overview"
|
|
4291
4305
|
)}`
|
|
4292
4306
|
)
|
|
4293
4307
|
});
|
|
@@ -4477,11 +4491,11 @@ var CLICommand = class {
|
|
|
4477
4491
|
};
|
|
4478
4492
|
|
|
4479
4493
|
// src/cmds/init/apply.ts
|
|
4480
|
-
var
|
|
4494
|
+
var import_path13 = __toESM(require("path"));
|
|
4481
4495
|
|
|
4482
4496
|
// src/cmds/forestry-migrate/index.ts
|
|
4483
4497
|
var import_fs_extra10 = __toESM(require("fs-extra"));
|
|
4484
|
-
var
|
|
4498
|
+
var import_path11 = __toESM(require("path"));
|
|
4485
4499
|
var import_js_yaml2 = __toESM(require("js-yaml"));
|
|
4486
4500
|
var import_minimatch = __toESM(require("minimatch"));
|
|
4487
4501
|
var import_graphql16 = require("@tinacms/graphql");
|
|
@@ -4489,7 +4503,7 @@ var import_schema_tools3 = require("@tinacms/schema-tools");
|
|
|
4489
4503
|
|
|
4490
4504
|
// src/cmds/forestry-migrate/util/index.ts
|
|
4491
4505
|
var import_fs_extra9 = __toESM(require("fs-extra"));
|
|
4492
|
-
var
|
|
4506
|
+
var import_path10 = __toESM(require("path"));
|
|
4493
4507
|
var import_js_yaml = __toESM(require("js-yaml"));
|
|
4494
4508
|
var import_zod = __toESM(require("zod"));
|
|
4495
4509
|
|
|
@@ -4914,7 +4928,7 @@ var transformForestryFieldsToTinaFields = ({
|
|
|
4914
4928
|
return tinaFields;
|
|
4915
4929
|
};
|
|
4916
4930
|
var getFieldsFromTemplates = ({ tem, pathToForestryConfig, skipBlocks = false }) => {
|
|
4917
|
-
const templatePath =
|
|
4931
|
+
const templatePath = import_path10.default.join(
|
|
4918
4932
|
pathToForestryConfig,
|
|
4919
4933
|
".forestry",
|
|
4920
4934
|
"front_matter",
|
|
@@ -4989,8 +5003,8 @@ var generateAllTemplates = async ({
|
|
|
4989
5003
|
pathToForestryConfig
|
|
4990
5004
|
}) => {
|
|
4991
5005
|
const allTemplates = (await import_fs_extra10.default.readdir(
|
|
4992
|
-
|
|
4993
|
-
)).map((tem) =>
|
|
5006
|
+
import_path11.default.join(pathToForestryConfig, ".forestry", "front_matter", "templates")
|
|
5007
|
+
)).map((tem) => import_path11.default.basename(tem, ".yml"));
|
|
4994
5008
|
const templateMap = /* @__PURE__ */ new Map();
|
|
4995
5009
|
const proms = allTemplates.map(async (tem) => {
|
|
4996
5010
|
try {
|
|
@@ -5135,9 +5149,9 @@ var generateCollectionFromForestrySection = (args) => {
|
|
|
5135
5149
|
return c;
|
|
5136
5150
|
} else if (section.type === "document") {
|
|
5137
5151
|
const filePath = section.path;
|
|
5138
|
-
const extname =
|
|
5139
|
-
const fileName =
|
|
5140
|
-
const dir =
|
|
5152
|
+
const extname = import_path11.default.extname(filePath);
|
|
5153
|
+
const fileName = import_path11.default.basename(filePath, extname);
|
|
5154
|
+
const dir = import_path11.default.dirname(filePath);
|
|
5141
5155
|
const ext = checkExt(extname);
|
|
5142
5156
|
if (ext) {
|
|
5143
5157
|
const fields = [];
|
|
@@ -5157,7 +5171,7 @@ var generateCollectionFromForestrySection = (args) => {
|
|
|
5157
5171
|
name: "dummy",
|
|
5158
5172
|
label: "Dummy field",
|
|
5159
5173
|
type: "string",
|
|
5160
|
-
description: "This is a dummy field, please replace it with the fields you want to edit. See https://tina.io/docs/
|
|
5174
|
+
description: "This is a dummy field, please replace it with the fields you want to edit. See https://tina.io/docs/r/content-modelling-collections/ for more info"
|
|
5161
5175
|
});
|
|
5162
5176
|
logger.warn(
|
|
5163
5177
|
warnText(
|
|
@@ -5200,7 +5214,7 @@ var generateCollections = async ({
|
|
|
5200
5214
|
usingTypescript
|
|
5201
5215
|
});
|
|
5202
5216
|
const forestryConfig = await import_fs_extra10.default.readFile(
|
|
5203
|
-
|
|
5217
|
+
import_path11.default.join(pathToForestryConfig, ".forestry", "settings.yml")
|
|
5204
5218
|
);
|
|
5205
5219
|
rewriteTemplateKeysInDocs({
|
|
5206
5220
|
templateMap,
|
|
@@ -5230,11 +5244,11 @@ var rewriteTemplateKeysInDocs = (args) => {
|
|
|
5230
5244
|
const { templateObj } = templateMap.get(templateKey);
|
|
5231
5245
|
templateObj?.pages?.forEach((page) => {
|
|
5232
5246
|
try {
|
|
5233
|
-
const filePath =
|
|
5247
|
+
const filePath = import_path11.default.join(page);
|
|
5234
5248
|
if (import_fs_extra10.default.lstatSync(filePath).isDirectory()) {
|
|
5235
5249
|
return;
|
|
5236
5250
|
}
|
|
5237
|
-
const extname =
|
|
5251
|
+
const extname = import_path11.default.extname(filePath);
|
|
5238
5252
|
const fileContent = import_fs_extra10.default.readFileSync(filePath).toString();
|
|
5239
5253
|
const content = (0, import_graphql16.parseFile)(
|
|
5240
5254
|
fileContent,
|
|
@@ -5266,7 +5280,7 @@ var import_fs_extra13 = __toESM(require("fs-extra"));
|
|
|
5266
5280
|
// src/next/commands/codemod-command/index.ts
|
|
5267
5281
|
var import_clipanion5 = require("clipanion");
|
|
5268
5282
|
var import_fs_extra11 = __toESM(require("fs-extra"));
|
|
5269
|
-
var
|
|
5283
|
+
var import_path12 = __toESM(require("path"));
|
|
5270
5284
|
var CodemodCommand = class extends import_clipanion5.Command {
|
|
5271
5285
|
constructor() {
|
|
5272
5286
|
super(...arguments);
|
|
@@ -5314,7 +5328,7 @@ var moveTinaFolder = async (rootPath = process.cwd()) => {
|
|
|
5314
5328
|
logger.error(e.message);
|
|
5315
5329
|
process.exit(1);
|
|
5316
5330
|
}
|
|
5317
|
-
const tinaDestination =
|
|
5331
|
+
const tinaDestination = import_path12.default.join(configManager.rootPath, "tina");
|
|
5318
5332
|
if (await import_fs_extra11.default.existsSync(tinaDestination)) {
|
|
5319
5333
|
logger.info(
|
|
5320
5334
|
`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.`
|
|
@@ -5329,7 +5343,7 @@ var moveTinaFolder = async (rootPath = process.cwd()) => {
|
|
|
5329
5343
|
};
|
|
5330
5344
|
var writeGitignore = async (rootPath) => {
|
|
5331
5345
|
await import_fs_extra11.default.outputFileSync(
|
|
5332
|
-
|
|
5346
|
+
import_path12.default.join(rootPath, "tina", ".gitignore"),
|
|
5333
5347
|
"__generated__"
|
|
5334
5348
|
);
|
|
5335
5349
|
};
|
|
@@ -5382,7 +5396,7 @@ const BlogPage = (props) => {
|
|
|
5382
5396
|
<div className='bg-green-100 text-center'>
|
|
5383
5397
|
Lost and looking for a place to start?
|
|
5384
5398
|
<a
|
|
5385
|
-
href='https://tina.io/
|
|
5399
|
+
href='https://tina.io/docs/r/beginner-series'
|
|
5386
5400
|
className='text-blue-500 underline'
|
|
5387
5401
|
>
|
|
5388
5402
|
{' '}
|
|
@@ -5664,7 +5678,7 @@ import { LocalAuthProvider } from "tinacms";`;
|
|
|
5664
5678
|
publicFolder: "${args.publicFolder}",
|
|
5665
5679
|
},
|
|
5666
5680
|
},
|
|
5667
|
-
// See docs on content modeling for more info on how to setup new content models: https://tina.io/docs/
|
|
5681
|
+
// See docs on content modeling for more info on how to setup new content models: https://tina.io/docs/r/content-modelling-collections/
|
|
5668
5682
|
schema: {
|
|
5669
5683
|
collections: ${generateCollectionString(args)},
|
|
5670
5684
|
},
|
|
@@ -6165,8 +6179,8 @@ async function apply({
|
|
|
6165
6179
|
await addConfigFile({
|
|
6166
6180
|
configArgs: {
|
|
6167
6181
|
config: config2,
|
|
6168
|
-
publicFolder:
|
|
6169
|
-
|
|
6182
|
+
publicFolder: import_path13.default.join(
|
|
6183
|
+
import_path13.default.relative(process.cwd(), pathToForestryConfig),
|
|
6170
6184
|
config2.publicFolder
|
|
6171
6185
|
),
|
|
6172
6186
|
collections,
|
|
@@ -6239,18 +6253,18 @@ var createPackageJSON = async () => {
|
|
|
6239
6253
|
};
|
|
6240
6254
|
var createGitignore = async ({ baseDir }) => {
|
|
6241
6255
|
logger.info(logText("No .gitignore found, creating one"));
|
|
6242
|
-
import_fs_extra13.default.outputFileSync(
|
|
6256
|
+
import_fs_extra13.default.outputFileSync(import_path13.default.join(baseDir, ".gitignore"), "node_modules");
|
|
6243
6257
|
};
|
|
6244
6258
|
var updateGitIgnore = async ({
|
|
6245
6259
|
baseDir,
|
|
6246
6260
|
items
|
|
6247
6261
|
}) => {
|
|
6248
6262
|
logger.info(logText(`Adding ${items.join(",")} to .gitignore`));
|
|
6249
|
-
const gitignoreContent = import_fs_extra13.default.readFileSync(
|
|
6263
|
+
const gitignoreContent = import_fs_extra13.default.readFileSync(import_path13.default.join(baseDir, ".gitignore")).toString();
|
|
6250
6264
|
const newGitignoreContent = [...gitignoreContent.split("\n"), ...items].join(
|
|
6251
6265
|
"\n"
|
|
6252
6266
|
);
|
|
6253
|
-
await import_fs_extra13.default.writeFile(
|
|
6267
|
+
await import_fs_extra13.default.writeFile(import_path13.default.join(baseDir, ".gitignore"), newGitignoreContent);
|
|
6254
6268
|
};
|
|
6255
6269
|
var addDependencies = async (config2, env, params) => {
|
|
6256
6270
|
const { packageManager } = config2;
|
|
@@ -6291,7 +6305,8 @@ var addDependencies = async (config2, env, params) => {
|
|
|
6291
6305
|
let packageManagers = {
|
|
6292
6306
|
pnpm: process.env.USE_WORKSPACE ? `pnpm add ${deps.join(" ")} --workspace` : `pnpm add ${deps.join(" ")}`,
|
|
6293
6307
|
npm: `npm install ${deps.join(" ")}`,
|
|
6294
|
-
yarn: `yarn add ${deps.join(" ")}
|
|
6308
|
+
yarn: `yarn add ${deps.join(" ")}`,
|
|
6309
|
+
bun: `bun add ${deps.join(" ")}`
|
|
6295
6310
|
};
|
|
6296
6311
|
if (packageManagers[packageManager] && deps.length > 0) {
|
|
6297
6312
|
logger.info(logText("Adding dependencies, this might take a moment..."));
|
|
@@ -6302,7 +6317,8 @@ var addDependencies = async (config2, env, params) => {
|
|
|
6302
6317
|
packageManagers = {
|
|
6303
6318
|
pnpm: process.env.USE_WORKSPACE ? `pnpm add -D ${devDeps.join(" ")} --workspace` : `pnpm add -D ${devDeps.join(" ")}`,
|
|
6304
6319
|
npm: `npm install -D ${devDeps.join(" ")}`,
|
|
6305
|
-
yarn: `yarn add -D ${devDeps.join(" ")}
|
|
6320
|
+
yarn: `yarn add -D ${devDeps.join(" ")}`,
|
|
6321
|
+
bun: `bun add -D ${devDeps.join(" ")}`
|
|
6306
6322
|
};
|
|
6307
6323
|
if (packageManagers[packageManager]) {
|
|
6308
6324
|
logger.info(
|
|
@@ -6319,22 +6335,22 @@ var writeGeneratedFile = async ({
|
|
|
6319
6335
|
content,
|
|
6320
6336
|
typescript
|
|
6321
6337
|
}) => {
|
|
6322
|
-
const { exists, path:
|
|
6338
|
+
const { exists, path: path15, parentPath } = generatedFile.resolve(typescript);
|
|
6323
6339
|
if (exists) {
|
|
6324
6340
|
if (overwrite) {
|
|
6325
|
-
logger.info(`Overwriting file at ${
|
|
6326
|
-
import_fs_extra13.default.outputFileSync(
|
|
6341
|
+
logger.info(`Overwriting file at ${path15}... \u2705`);
|
|
6342
|
+
import_fs_extra13.default.outputFileSync(path15, content);
|
|
6327
6343
|
} else {
|
|
6328
|
-
logger.info(`Not overwriting file at ${
|
|
6344
|
+
logger.info(`Not overwriting file at ${path15}.`);
|
|
6329
6345
|
logger.info(
|
|
6330
|
-
logText(`Please add the following to ${
|
|
6346
|
+
logText(`Please add the following to ${path15}:
|
|
6331
6347
|
${indentText(content)}}`)
|
|
6332
6348
|
);
|
|
6333
6349
|
}
|
|
6334
6350
|
} else {
|
|
6335
|
-
logger.info(`Adding file at ${
|
|
6351
|
+
logger.info(`Adding file at ${path15}... \u2705`);
|
|
6336
6352
|
await import_fs_extra13.default.ensureDir(parentPath);
|
|
6337
|
-
import_fs_extra13.default.outputFileSync(
|
|
6353
|
+
import_fs_extra13.default.outputFileSync(path15, content);
|
|
6338
6354
|
}
|
|
6339
6355
|
};
|
|
6340
6356
|
var addConfigFile = async ({
|
|
@@ -6412,7 +6428,7 @@ var addContentFile = async ({
|
|
|
6412
6428
|
return () => ({
|
|
6413
6429
|
exists: env.sampleContentExists,
|
|
6414
6430
|
path: env.sampleContentPath,
|
|
6415
|
-
parentPath:
|
|
6431
|
+
parentPath: import_path13.default.dirname(env.sampleContentPath)
|
|
6416
6432
|
});
|
|
6417
6433
|
}
|
|
6418
6434
|
},
|
|
@@ -6435,7 +6451,7 @@ ${titleText(" TinaCMS ")} backend initialized!`));
|
|
|
6435
6451
|
return `${x.key}=${x.value || "***"}`;
|
|
6436
6452
|
}).join("\n") + `
|
|
6437
6453
|
TINA_PUBLIC_IS_LOCAL=true`;
|
|
6438
|
-
const envFile =
|
|
6454
|
+
const envFile = import_path13.default.join(process.cwd(), ".env");
|
|
6439
6455
|
if (!import_fs_extra13.default.existsSync(envFile)) {
|
|
6440
6456
|
logger.info(`Adding .env file to your project... \u2705`);
|
|
6441
6457
|
import_fs_extra13.default.writeFileSync(envFile, envFileText);
|
|
@@ -6481,7 +6497,8 @@ var other = ({ packageManager }) => {
|
|
|
6481
6497
|
pnpm: `pnpm`,
|
|
6482
6498
|
npm: `npx`,
|
|
6483
6499
|
// npx is the way to run executables that aren't in your "scripts"
|
|
6484
|
-
yarn: `yarn
|
|
6500
|
+
yarn: `yarn`,
|
|
6501
|
+
bun: `bun run`
|
|
6485
6502
|
};
|
|
6486
6503
|
return `${packageManagers[packageManager]} tinacms dev -c "<your dev command>"`;
|
|
6487
6504
|
};
|
|
@@ -6494,7 +6511,8 @@ var frameworkDevCmds = {
|
|
|
6494
6511
|
pnpm: `pnpm`,
|
|
6495
6512
|
npm: `npm run`,
|
|
6496
6513
|
// npx is the way to run executables that aren't in your "scripts"
|
|
6497
|
-
yarn: `yarn
|
|
6514
|
+
yarn: `yarn`,
|
|
6515
|
+
bun: `bun run`
|
|
6498
6516
|
};
|
|
6499
6517
|
return `${packageManagers[packageManager]} dev`;
|
|
6500
6518
|
}
|
|
@@ -6507,7 +6525,7 @@ var addReactiveFile = {
|
|
|
6507
6525
|
baseDir,
|
|
6508
6526
|
dataLayer
|
|
6509
6527
|
}) => {
|
|
6510
|
-
const packageJsonPath =
|
|
6528
|
+
const packageJsonPath = import_path13.default.join(baseDir, "package.json");
|
|
6511
6529
|
await writeGeneratedFile({
|
|
6512
6530
|
generatedFile,
|
|
6513
6531
|
typescript: config2.typescript,
|
package/dist/server/server.d.ts
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
|
|
3
3
|
*/
|
|
4
4
|
import http from 'node:http';
|
|
5
|
-
export declare const gqlServer: (database: any, verbose: boolean) => Promise<http.Server<typeof
|
|
5
|
+
export declare const gqlServer: (database: any, verbose: boolean) => Promise<http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinacms/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"@types/listr": "0.14.2",
|
|
38
38
|
"@types/log4js": "^2.3.5",
|
|
39
39
|
"@types/multer": "^1.4.12",
|
|
40
|
+
"@types/node": "^22.13.1",
|
|
40
41
|
"@types/progress": "^2.0.7",
|
|
41
42
|
"@types/prompts": "^2.4.9",
|
|
42
43
|
"@types/yup": "^0.32.0",
|
|
@@ -89,12 +90,12 @@
|
|
|
89
90
|
"vite": "^4.5.9",
|
|
90
91
|
"yup": "^1.6.1",
|
|
91
92
|
"zod": "^3.24.2",
|
|
92
|
-
"@tinacms/app": "2.3.
|
|
93
|
-
"@tinacms/graphql": "1.6.1",
|
|
94
|
-
"@tinacms/metrics": "1.1.0",
|
|
93
|
+
"@tinacms/app": "2.3.4",
|
|
95
94
|
"@tinacms/schema-tools": "1.9.1",
|
|
96
95
|
"@tinacms/search": "1.1.1",
|
|
97
|
-
"tinacms": "
|
|
96
|
+
"@tinacms/graphql": "1.6.1",
|
|
97
|
+
"@tinacms/metrics": "1.1.0",
|
|
98
|
+
"tinacms": "2.9.0"
|
|
98
99
|
},
|
|
99
100
|
"publishConfig": {
|
|
100
101
|
"registry": "https://registry.npmjs.org"
|