@tinacms/cli 1.10.3 → 1.12.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.
- package/README.md +5 -5
- package/dist/cmds/init/prompts/index.d.ts +1 -1
- package/dist/cmds/init/prompts/types.d.ts +1 -1
- package/dist/index.js +142 -122
- package/dist/server/server.d.ts +1 -1
- package/dist/utils/path.d.ts +3 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
The _TinaCloud CLI_ can be used to set up your project with TinaCloud configuration, and run a local version of the TinaCloud content-api (using your file system's content). For a real-world example of how this is being used checkout the [TinaCloud Starter](https://github.com/tinacms/tina-
|
|
1
|
+
The _TinaCloud CLI_ can be used to set up your project with TinaCloud configuration, and run a local version of the TinaCloud content-api (using your file system's content). For a real-world example of how this is being used checkout the [TinaCloud Starter](https://github.com/tinacms/tina-nextjs-starter).
|
|
2
2
|
|
|
3
3
|
## Installation
|
|
4
4
|
|
|
@@ -24,7 +24,7 @@ Usage: @tinacms/cli command [options]
|
|
|
24
24
|
Options:
|
|
25
25
|
-V, --version output the version number
|
|
26
26
|
-h, --help display help for command
|
|
27
|
-
-v, --verbose increase verbosity of console output
|
|
27
|
+
-v, --verbose increase verbosity of console output
|
|
28
28
|
|
|
29
29
|
Commands:
|
|
30
30
|
server:start [options] Start Filesystem Graphql Server
|
|
@@ -137,7 +137,7 @@ The top-level key in the schema is an array of _collections_, a `collection` inf
|
|
|
137
137
|
|
|
138
138
|
### `templates`
|
|
139
139
|
|
|
140
|
-
Templates are responsible for defining the shape of your content, you'll see in the schema for [the starter](https://github.com/tinacms/tina-
|
|
140
|
+
Templates are responsible for defining the shape of your content, you'll see in the schema for [the starter](https://github.com/tinacms/tina-nextjs-starter) that we use `templates` for `collections` as well as `blocks`. One important thing to note is that since a `collection` can have multiple `templates`, each file in your collection must store a `_template` key in it's frontmatter:
|
|
141
141
|
|
|
142
142
|
```markdown
|
|
143
143
|
---
|
|
@@ -151,7 +151,7 @@ When you use Tina's GraphQL forms, we know about all of the relationships in you
|
|
|
151
151
|
|
|
152
152
|
### `fields`
|
|
153
153
|
|
|
154
|
-
For the most part, you can think of `fields` as the backend equivalent to [Tina field plugins](https://tina.io/docs/plugins/fields/). You might notice that we're defining a `type` on each field, rather than a `component`. This is because the backend isn't concerned with `component`s, only the shape of your content. By default we use the built-in Tina fields, to customize your `component` read the [field customization](https://tina.io/docs/
|
|
154
|
+
For the most part, you can think of `fields` as the backend equivalent to [Tina field plugins](https://tina.io/docs/plugins/fields/). You might notice that we're defining a `type` on each field, rather than a `component`. This is because the backend isn't concerned with `component`s, only the shape of your content. By default we use the built-in Tina fields, to customize your `component` read the [field customization](https://tina.io/docs/tinacloud/client/#field-customization) instructions.
|
|
155
155
|
|
|
156
156
|
#### `reference` & `reference-list`
|
|
157
157
|
|
|
@@ -229,7 +229,7 @@ getPostsDocument(relativePath: "voteForPedro.md") {
|
|
|
229
229
|
}
|
|
230
230
|
```
|
|
231
231
|
|
|
232
|
-
To learn how to work with this data on a Tina-enabled site, check out the [client documentation](https://tina.io/docs/
|
|
232
|
+
To learn how to work with this data on a Tina-enabled site, check out the [client documentation](https://tina.io/docs/tinacloud/client/)
|
|
233
233
|
|
|
234
234
|
> This API is currently somewhat limited. Specifically there's no support for filtering and sorting "list" queries. We have plans to tackle that in upcoming cycles
|
|
235
235
|
|
|
@@ -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.12.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,9 @@ var tinaTailwind = (spaPath, prebuildFilePath) => {
|
|
|
1681
1693
|
500: "#EC4815",
|
|
1682
1694
|
600: "#DC4419"
|
|
1683
1695
|
},
|
|
1696
|
+
"tina-orange": "#EC4815",
|
|
1697
|
+
"tina-orange-dark": "#C2410C",
|
|
1698
|
+
"tina-orange-light": "#FFF7ED",
|
|
1684
1699
|
background: "#FFFFFF",
|
|
1685
1700
|
foreground: "#0A0A0A",
|
|
1686
1701
|
muted: "#F5F5F5",
|
|
@@ -1942,17 +1957,17 @@ var import_pluginutils = require("@rollup/pluginutils");
|
|
|
1942
1957
|
var import_fs = __toESM(require("fs"));
|
|
1943
1958
|
var import_vite2 = require("vite");
|
|
1944
1959
|
var import_esbuild2 = require("esbuild");
|
|
1945
|
-
var
|
|
1960
|
+
var import_path6 = __toESM(require("path"));
|
|
1946
1961
|
var import_body_parser = __toESM(require("body-parser"));
|
|
1947
1962
|
var import_cors = __toESM(require("cors"));
|
|
1948
1963
|
var import_graphql9 = require("@tinacms/graphql");
|
|
1949
1964
|
|
|
1950
1965
|
// src/next/commands/dev-command/server/media.ts
|
|
1951
1966
|
var import_fs_extra5 = __toESM(require("fs-extra"));
|
|
1952
|
-
var
|
|
1967
|
+
var import_path5 = __toESM(require("path"));
|
|
1953
1968
|
var import_busboy = __toESM(require("busboy"));
|
|
1954
1969
|
var createMediaRouter = (config2) => {
|
|
1955
|
-
const mediaFolder =
|
|
1970
|
+
const mediaFolder = import_path5.default.join(
|
|
1956
1971
|
config2.rootPath,
|
|
1957
1972
|
config2.publicFolder,
|
|
1958
1973
|
config2.mediaRoot
|
|
@@ -1979,8 +1994,8 @@ var createMediaRouter = (config2) => {
|
|
|
1979
1994
|
const bb = (0, import_busboy.default)({ headers: req.headers });
|
|
1980
1995
|
bb.on("file", async (_name, file, _info) => {
|
|
1981
1996
|
const fullPath = decodeURI(req.url?.slice("/media/upload/".length));
|
|
1982
|
-
const saveTo =
|
|
1983
|
-
await import_fs_extra5.default.ensureDir(
|
|
1997
|
+
const saveTo = import_path5.default.join(mediaFolder, ...fullPath.split("/"));
|
|
1998
|
+
await import_fs_extra5.default.ensureDir(import_path5.default.dirname(saveTo));
|
|
1984
1999
|
file.pipe(import_fs_extra5.default.createWriteStream(saveTo));
|
|
1985
2000
|
});
|
|
1986
2001
|
bb.on("error", (error) => {
|
|
@@ -2014,7 +2029,7 @@ var MediaModel = class {
|
|
|
2014
2029
|
}
|
|
2015
2030
|
async listMedia(args) {
|
|
2016
2031
|
try {
|
|
2017
|
-
const folderPath = (0,
|
|
2032
|
+
const folderPath = (0, import_path5.join)(
|
|
2018
2033
|
this.rootPath,
|
|
2019
2034
|
this.publicFolder,
|
|
2020
2035
|
this.mediaRoot,
|
|
@@ -2029,7 +2044,7 @@ var MediaModel = class {
|
|
|
2029
2044
|
}
|
|
2030
2045
|
const filesStr = await import_fs_extra5.default.readdir(folderPath);
|
|
2031
2046
|
const filesProm = filesStr.map(async (file) => {
|
|
2032
|
-
const filePath = (0,
|
|
2047
|
+
const filePath = (0, import_path5.join)(folderPath, file);
|
|
2033
2048
|
const stat = await import_fs_extra5.default.stat(filePath);
|
|
2034
2049
|
let src = `/${file}`;
|
|
2035
2050
|
const isFile = stat.isFile();
|
|
@@ -2086,7 +2101,7 @@ var MediaModel = class {
|
|
|
2086
2101
|
}
|
|
2087
2102
|
async deleteMedia(args) {
|
|
2088
2103
|
try {
|
|
2089
|
-
const file = (0,
|
|
2104
|
+
const file = (0, import_path5.join)(
|
|
2090
2105
|
this.rootPath,
|
|
2091
2106
|
this.publicFolder,
|
|
2092
2107
|
this.mediaRoot,
|
|
@@ -2151,7 +2166,7 @@ var transformTsxPlugin = ({
|
|
|
2151
2166
|
const plug = {
|
|
2152
2167
|
name: "transform-tsx",
|
|
2153
2168
|
async transform(code, id) {
|
|
2154
|
-
const extName =
|
|
2169
|
+
const extName = import_path6.default.extname(id);
|
|
2155
2170
|
if (extName.startsWith(".tsx") || extName.startsWith(".ts")) {
|
|
2156
2171
|
const result = await (0, import_esbuild2.transform)(code, { loader: "tsx" });
|
|
2157
2172
|
return {
|
|
@@ -2415,14 +2430,14 @@ var DevCommand = class extends BaseCommand {
|
|
|
2415
2430
|
graphql: graphqlSchemaObject
|
|
2416
2431
|
});
|
|
2417
2432
|
import_fs_extra6.default.writeFileSync(
|
|
2418
|
-
|
|
2433
|
+
import_path7.default.join(configManager.tinaFolderPath, tinaLockFilename),
|
|
2419
2434
|
tinaLockContent
|
|
2420
2435
|
);
|
|
2421
2436
|
if (configManager.hasSeparateContentRoot()) {
|
|
2422
2437
|
const rootPath = await configManager.getTinaFolderPath(
|
|
2423
2438
|
configManager.contentRootPath
|
|
2424
2439
|
);
|
|
2425
|
-
const filePath =
|
|
2440
|
+
const filePath = import_path7.default.join(rootPath, tinaLockFilename);
|
|
2426
2441
|
await import_fs_extra6.default.ensureFile(filePath);
|
|
2427
2442
|
await import_fs_extra6.default.outputFile(filePath, tinaLockContent);
|
|
2428
2443
|
}
|
|
@@ -2582,11 +2597,11 @@ ${dangerText(e.message)}
|
|
|
2582
2597
|
// subItems: [
|
|
2583
2598
|
// {
|
|
2584
2599
|
// key: 'Custom queries',
|
|
2585
|
-
// value: 'https://tina.io/
|
|
2600
|
+
// value: 'https://tina.io/docs/r/content-api-overview',
|
|
2586
2601
|
// },
|
|
2587
2602
|
// {
|
|
2588
2603
|
// key: 'Visual editing',
|
|
2589
|
-
// value: 'https://tina.io/visual-editing',
|
|
2604
|
+
// value: 'https://tina.io/docs/r/visual-editing-setup',
|
|
2590
2605
|
// },
|
|
2591
2606
|
// ],
|
|
2592
2607
|
// },
|
|
@@ -2597,7 +2612,7 @@ ${dangerText(e.message)}
|
|
|
2597
2612
|
watchContentFiles(configManager, database, databaseLock, searchIndexer) {
|
|
2598
2613
|
const collectionContentFiles = [];
|
|
2599
2614
|
configManager.config.schema.collections.forEach((collection) => {
|
|
2600
|
-
const collectionGlob = `${
|
|
2615
|
+
const collectionGlob = `${import_path7.default.join(
|
|
2601
2616
|
configManager.contentRootPath,
|
|
2602
2617
|
collection.path
|
|
2603
2618
|
)}/**/*.${collection.format || "md"}`;
|
|
@@ -2647,7 +2662,7 @@ ${dangerText(e.message)}
|
|
|
2647
2662
|
|
|
2648
2663
|
// src/next/commands/build-command/index.ts
|
|
2649
2664
|
var import_crypto = __toESM(require("crypto"));
|
|
2650
|
-
var
|
|
2665
|
+
var import_path8 = __toESM(require("path"));
|
|
2651
2666
|
var import_core3 = require("@graphql-inspector/core");
|
|
2652
2667
|
var import_graphql11 = require("@tinacms/graphql");
|
|
2653
2668
|
var import_schema_tools2 = require("@tinacms/schema-tools");
|
|
@@ -2662,7 +2677,7 @@ var import_core2 = require("@graphql-inspector/core");
|
|
|
2662
2677
|
var getFaqLink = (type) => {
|
|
2663
2678
|
switch (type) {
|
|
2664
2679
|
case import_core2.ChangeType.FieldRemoved: {
|
|
2665
|
-
return "https://tina.io/docs/
|
|
2680
|
+
return "https://tina.io/docs/r/FAQ/#2-how-do-i-resolve-the-local-graphql-schema-doesnt-match-the-remote-graphql-schema-error";
|
|
2666
2681
|
}
|
|
2667
2682
|
default:
|
|
2668
2683
|
return null;
|
|
@@ -3369,7 +3384,7 @@ Additional info: Branch: ${config2.branch}, Client ID: ${config2.clientId} `;
|
|
|
3369
3384
|
}
|
|
3370
3385
|
const localTinaSchema = JSON.parse(
|
|
3371
3386
|
await database.bridge.get(
|
|
3372
|
-
|
|
3387
|
+
import_path8.default.join(database.tinaDirectory, "__generated__", "_schema.json")
|
|
3373
3388
|
)
|
|
3374
3389
|
);
|
|
3375
3390
|
localTinaSchema.version = void 0;
|
|
@@ -3424,12 +3439,12 @@ async function request(args) {
|
|
|
3424
3439
|
Message from server: ${json.message}`;
|
|
3425
3440
|
}
|
|
3426
3441
|
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/
|
|
3442
|
+
`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
3443
|
);
|
|
3429
3444
|
}
|
|
3430
3445
|
if (json.errors) {
|
|
3431
3446
|
throw new Error(
|
|
3432
|
-
`Unable to fetch, please see our FAQ for more information: https://tina.io/docs/
|
|
3447
|
+
`Unable to fetch, please see our FAQ for more information: https://tina.io/docs/r/FAQ/
|
|
3433
3448
|
|
|
3434
3449
|
Errors:
|
|
3435
3450
|
${json.errors.map((error) => error.message).join("\n")}`
|
|
@@ -3740,25 +3755,25 @@ var import_clipanion6 = require("clipanion");
|
|
|
3740
3755
|
|
|
3741
3756
|
// src/cmds/init/detectEnvironment.ts
|
|
3742
3757
|
var import_fs_extra8 = __toESM(require("fs-extra"));
|
|
3743
|
-
var
|
|
3758
|
+
var import_path9 = __toESM(require("path"));
|
|
3744
3759
|
var checkGitignoreForItem = async ({
|
|
3745
3760
|
baseDir,
|
|
3746
3761
|
line
|
|
3747
3762
|
}) => {
|
|
3748
|
-
const gitignoreContent = import_fs_extra8.default.readFileSync(
|
|
3763
|
+
const gitignoreContent = import_fs_extra8.default.readFileSync(import_path9.default.join(baseDir, ".gitignore")).toString();
|
|
3749
3764
|
return gitignoreContent.split("\n").some((item) => item === line);
|
|
3750
3765
|
};
|
|
3751
3766
|
var makeGeneratedFile = async (name2, generatedFileType, parentPath, opts) => {
|
|
3752
3767
|
const result = {
|
|
3753
|
-
fullPathTS:
|
|
3768
|
+
fullPathTS: import_path9.default.join(
|
|
3754
3769
|
parentPath,
|
|
3755
3770
|
`${name2}.${opts?.typescriptSuffix || opts?.extensionOverride || "ts"}`
|
|
3756
3771
|
),
|
|
3757
|
-
fullPathJS:
|
|
3772
|
+
fullPathJS: import_path9.default.join(
|
|
3758
3773
|
parentPath,
|
|
3759
3774
|
`${name2}.${opts?.extensionOverride || "js"}`
|
|
3760
3775
|
),
|
|
3761
|
-
fullPathOverride: opts?.extensionOverride ?
|
|
3776
|
+
fullPathOverride: opts?.extensionOverride ? import_path9.default.join(parentPath, `${name2}.${opts?.extensionOverride}`) : "",
|
|
3762
3777
|
generatedFileType,
|
|
3763
3778
|
name: name2,
|
|
3764
3779
|
parentPath,
|
|
@@ -3787,16 +3802,16 @@ var detectEnvironment = async ({
|
|
|
3787
3802
|
debug = false
|
|
3788
3803
|
}) => {
|
|
3789
3804
|
const hasForestryConfig = await import_fs_extra8.default.pathExists(
|
|
3790
|
-
|
|
3805
|
+
import_path9.default.join(pathToForestryConfig, ".forestry", "settings.yml")
|
|
3791
3806
|
);
|
|
3792
|
-
const sampleContentPath =
|
|
3807
|
+
const sampleContentPath = import_path9.default.join(
|
|
3793
3808
|
baseDir,
|
|
3794
3809
|
"content",
|
|
3795
3810
|
"posts",
|
|
3796
3811
|
"hello-world.md"
|
|
3797
3812
|
);
|
|
3798
|
-
const usingSrc = import_fs_extra8.default.pathExistsSync(
|
|
3799
|
-
const tinaFolder =
|
|
3813
|
+
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")));
|
|
3814
|
+
const tinaFolder = import_path9.default.join(baseDir, "tina");
|
|
3800
3815
|
const tinaConfigExists = Boolean(
|
|
3801
3816
|
// Does the tina folder exist?
|
|
3802
3817
|
await import_fs_extra8.default.pathExists(tinaFolder) && // Does the tina folder contain a config file?
|
|
@@ -3812,12 +3827,12 @@ var detectEnvironment = async ({
|
|
|
3812
3827
|
"next-api-handler": await makeGeneratedFile(
|
|
3813
3828
|
"[...routes]",
|
|
3814
3829
|
"next-api-handler",
|
|
3815
|
-
|
|
3830
|
+
import_path9.default.join(...pagesDir, "api", "tina")
|
|
3816
3831
|
),
|
|
3817
3832
|
"reactive-example": await makeGeneratedFile(
|
|
3818
3833
|
"[filename]",
|
|
3819
3834
|
"reactive-example",
|
|
3820
|
-
|
|
3835
|
+
import_path9.default.join(...pagesDir, "demo", "blog"),
|
|
3821
3836
|
{
|
|
3822
3837
|
typescriptSuffix: "tsx"
|
|
3823
3838
|
}
|
|
@@ -3825,13 +3840,13 @@ var detectEnvironment = async ({
|
|
|
3825
3840
|
"users-json": await makeGeneratedFile(
|
|
3826
3841
|
"index",
|
|
3827
3842
|
"users-json",
|
|
3828
|
-
|
|
3843
|
+
import_path9.default.join(baseDir, "content", "users"),
|
|
3829
3844
|
{ extensionOverride: "json" }
|
|
3830
3845
|
),
|
|
3831
3846
|
"sample-content": await makeGeneratedFile(
|
|
3832
3847
|
"hello-world",
|
|
3833
3848
|
"sample-content",
|
|
3834
|
-
|
|
3849
|
+
import_path9.default.join(baseDir, "content", "posts"),
|
|
3835
3850
|
{ extensionOverride: "md" }
|
|
3836
3851
|
)
|
|
3837
3852
|
};
|
|
@@ -3857,13 +3872,13 @@ var detectEnvironment = async ({
|
|
|
3857
3872
|
);
|
|
3858
3873
|
}
|
|
3859
3874
|
}
|
|
3860
|
-
const hasGitIgnore = await import_fs_extra8.default.pathExists(
|
|
3875
|
+
const hasGitIgnore = await import_fs_extra8.default.pathExists(import_path9.default.join(".gitignore"));
|
|
3861
3876
|
const hasGitIgnoreNodeModules = hasGitIgnore && await checkGitignoreForItem({ baseDir, line: "node_modules" });
|
|
3862
3877
|
const hasEnvTina = hasGitIgnore && await checkGitignoreForItem({ baseDir, line: ".env.tina" });
|
|
3863
3878
|
const hasGitIgnoreEnv = hasGitIgnore && await checkGitignoreForItem({ baseDir, line: ".env" });
|
|
3864
3879
|
let frontMatterFormat;
|
|
3865
3880
|
if (hasForestryConfig) {
|
|
3866
|
-
const hugoConfigPath =
|
|
3881
|
+
const hugoConfigPath = import_path9.default.join(rootPath, "config.toml");
|
|
3867
3882
|
if (await import_fs_extra8.default.pathExists(hugoConfigPath)) {
|
|
3868
3883
|
const hugoConfig = await import_fs_extra8.default.readFile(hugoConfigPath, "utf8");
|
|
3869
3884
|
const metaDataFormat = hugoConfig.toString().match(/metaDataFormat = "(.*)"/)?.[1];
|
|
@@ -3965,7 +3980,7 @@ var chooseGitProvider = async ({ config: config2 }) => {
|
|
|
3965
3980
|
${logText(
|
|
3966
3981
|
"Learn more here: "
|
|
3967
3982
|
)}${linkText(
|
|
3968
|
-
"https://tina.io/docs/self-
|
|
3983
|
+
"https://tina.io/docs/r/self-hosting-nextjs/#github-personal-access-token"
|
|
3969
3984
|
)}`,
|
|
3970
3985
|
initial: process.env.GITHUB_PERSONAL_ACCESS_TOKEN
|
|
3971
3986
|
},
|
|
@@ -4226,7 +4241,8 @@ var askCommonSetUp = async () => {
|
|
|
4226
4241
|
choices: [
|
|
4227
4242
|
{ title: "PNPM", value: "pnpm" },
|
|
4228
4243
|
{ title: "Yarn", value: "yarn" },
|
|
4229
|
-
{ title: "NPM", value: "npm" }
|
|
4244
|
+
{ title: "NPM", value: "npm" },
|
|
4245
|
+
{ title: "Bun", value: "bun" }
|
|
4230
4246
|
]
|
|
4231
4247
|
}
|
|
4232
4248
|
]);
|
|
@@ -4287,7 +4303,7 @@ var askTinaSetupPrompts = async (params) => {
|
|
|
4287
4303
|
message: `Where are public assets stored? (default: "public")
|
|
4288
4304
|
` + logText(
|
|
4289
4305
|
`Not sure what value to use? Refer to our "Frameworks" doc: ${linkText(
|
|
4290
|
-
"https://tina.io/docs/
|
|
4306
|
+
"https://tina.io/docs/r/framework-guides-overview"
|
|
4291
4307
|
)}`
|
|
4292
4308
|
)
|
|
4293
4309
|
});
|
|
@@ -4477,11 +4493,11 @@ var CLICommand = class {
|
|
|
4477
4493
|
};
|
|
4478
4494
|
|
|
4479
4495
|
// src/cmds/init/apply.ts
|
|
4480
|
-
var
|
|
4496
|
+
var import_path13 = __toESM(require("path"));
|
|
4481
4497
|
|
|
4482
4498
|
// src/cmds/forestry-migrate/index.ts
|
|
4483
4499
|
var import_fs_extra10 = __toESM(require("fs-extra"));
|
|
4484
|
-
var
|
|
4500
|
+
var import_path11 = __toESM(require("path"));
|
|
4485
4501
|
var import_js_yaml2 = __toESM(require("js-yaml"));
|
|
4486
4502
|
var import_minimatch = __toESM(require("minimatch"));
|
|
4487
4503
|
var import_graphql16 = require("@tinacms/graphql");
|
|
@@ -4489,7 +4505,7 @@ var import_schema_tools3 = require("@tinacms/schema-tools");
|
|
|
4489
4505
|
|
|
4490
4506
|
// src/cmds/forestry-migrate/util/index.ts
|
|
4491
4507
|
var import_fs_extra9 = __toESM(require("fs-extra"));
|
|
4492
|
-
var
|
|
4508
|
+
var import_path10 = __toESM(require("path"));
|
|
4493
4509
|
var import_js_yaml = __toESM(require("js-yaml"));
|
|
4494
4510
|
var import_zod = __toESM(require("zod"));
|
|
4495
4511
|
|
|
@@ -4914,7 +4930,7 @@ var transformForestryFieldsToTinaFields = ({
|
|
|
4914
4930
|
return tinaFields;
|
|
4915
4931
|
};
|
|
4916
4932
|
var getFieldsFromTemplates = ({ tem, pathToForestryConfig, skipBlocks = false }) => {
|
|
4917
|
-
const templatePath =
|
|
4933
|
+
const templatePath = import_path10.default.join(
|
|
4918
4934
|
pathToForestryConfig,
|
|
4919
4935
|
".forestry",
|
|
4920
4936
|
"front_matter",
|
|
@@ -4989,8 +5005,8 @@ var generateAllTemplates = async ({
|
|
|
4989
5005
|
pathToForestryConfig
|
|
4990
5006
|
}) => {
|
|
4991
5007
|
const allTemplates = (await import_fs_extra10.default.readdir(
|
|
4992
|
-
|
|
4993
|
-
)).map((tem) =>
|
|
5008
|
+
import_path11.default.join(pathToForestryConfig, ".forestry", "front_matter", "templates")
|
|
5009
|
+
)).map((tem) => import_path11.default.basename(tem, ".yml"));
|
|
4994
5010
|
const templateMap = /* @__PURE__ */ new Map();
|
|
4995
5011
|
const proms = allTemplates.map(async (tem) => {
|
|
4996
5012
|
try {
|
|
@@ -5135,9 +5151,9 @@ var generateCollectionFromForestrySection = (args) => {
|
|
|
5135
5151
|
return c;
|
|
5136
5152
|
} else if (section.type === "document") {
|
|
5137
5153
|
const filePath = section.path;
|
|
5138
|
-
const extname =
|
|
5139
|
-
const fileName =
|
|
5140
|
-
const dir =
|
|
5154
|
+
const extname = import_path11.default.extname(filePath);
|
|
5155
|
+
const fileName = import_path11.default.basename(filePath, extname);
|
|
5156
|
+
const dir = import_path11.default.dirname(filePath);
|
|
5141
5157
|
const ext = checkExt(extname);
|
|
5142
5158
|
if (ext) {
|
|
5143
5159
|
const fields = [];
|
|
@@ -5157,7 +5173,7 @@ var generateCollectionFromForestrySection = (args) => {
|
|
|
5157
5173
|
name: "dummy",
|
|
5158
5174
|
label: "Dummy field",
|
|
5159
5175
|
type: "string",
|
|
5160
|
-
description: "This is a dummy field, please replace it with the fields you want to edit. See https://tina.io/docs/
|
|
5176
|
+
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
5177
|
});
|
|
5162
5178
|
logger.warn(
|
|
5163
5179
|
warnText(
|
|
@@ -5200,7 +5216,7 @@ var generateCollections = async ({
|
|
|
5200
5216
|
usingTypescript
|
|
5201
5217
|
});
|
|
5202
5218
|
const forestryConfig = await import_fs_extra10.default.readFile(
|
|
5203
|
-
|
|
5219
|
+
import_path11.default.join(pathToForestryConfig, ".forestry", "settings.yml")
|
|
5204
5220
|
);
|
|
5205
5221
|
rewriteTemplateKeysInDocs({
|
|
5206
5222
|
templateMap,
|
|
@@ -5230,11 +5246,11 @@ var rewriteTemplateKeysInDocs = (args) => {
|
|
|
5230
5246
|
const { templateObj } = templateMap.get(templateKey);
|
|
5231
5247
|
templateObj?.pages?.forEach((page) => {
|
|
5232
5248
|
try {
|
|
5233
|
-
const filePath =
|
|
5249
|
+
const filePath = import_path11.default.join(page);
|
|
5234
5250
|
if (import_fs_extra10.default.lstatSync(filePath).isDirectory()) {
|
|
5235
5251
|
return;
|
|
5236
5252
|
}
|
|
5237
|
-
const extname =
|
|
5253
|
+
const extname = import_path11.default.extname(filePath);
|
|
5238
5254
|
const fileContent = import_fs_extra10.default.readFileSync(filePath).toString();
|
|
5239
5255
|
const content = (0, import_graphql16.parseFile)(
|
|
5240
5256
|
fileContent,
|
|
@@ -5266,7 +5282,7 @@ var import_fs_extra13 = __toESM(require("fs-extra"));
|
|
|
5266
5282
|
// src/next/commands/codemod-command/index.ts
|
|
5267
5283
|
var import_clipanion5 = require("clipanion");
|
|
5268
5284
|
var import_fs_extra11 = __toESM(require("fs-extra"));
|
|
5269
|
-
var
|
|
5285
|
+
var import_path12 = __toESM(require("path"));
|
|
5270
5286
|
var CodemodCommand = class extends import_clipanion5.Command {
|
|
5271
5287
|
constructor() {
|
|
5272
5288
|
super(...arguments);
|
|
@@ -5314,7 +5330,7 @@ var moveTinaFolder = async (rootPath = process.cwd()) => {
|
|
|
5314
5330
|
logger.error(e.message);
|
|
5315
5331
|
process.exit(1);
|
|
5316
5332
|
}
|
|
5317
|
-
const tinaDestination =
|
|
5333
|
+
const tinaDestination = import_path12.default.join(configManager.rootPath, "tina");
|
|
5318
5334
|
if (await import_fs_extra11.default.existsSync(tinaDestination)) {
|
|
5319
5335
|
logger.info(
|
|
5320
5336
|
`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 +5345,7 @@ var moveTinaFolder = async (rootPath = process.cwd()) => {
|
|
|
5329
5345
|
};
|
|
5330
5346
|
var writeGitignore = async (rootPath) => {
|
|
5331
5347
|
await import_fs_extra11.default.outputFileSync(
|
|
5332
|
-
|
|
5348
|
+
import_path12.default.join(rootPath, "tina", ".gitignore"),
|
|
5333
5349
|
"__generated__"
|
|
5334
5350
|
);
|
|
5335
5351
|
};
|
|
@@ -5382,7 +5398,7 @@ const BlogPage = (props) => {
|
|
|
5382
5398
|
<div className='bg-green-100 text-center'>
|
|
5383
5399
|
Lost and looking for a place to start?
|
|
5384
5400
|
<a
|
|
5385
|
-
href='https://tina.io/
|
|
5401
|
+
href='https://tina.io/docs/r/beginner-series'
|
|
5386
5402
|
className='text-blue-500 underline'
|
|
5387
5403
|
>
|
|
5388
5404
|
{' '}
|
|
@@ -5664,7 +5680,7 @@ import { LocalAuthProvider } from "tinacms";`;
|
|
|
5664
5680
|
publicFolder: "${args.publicFolder}",
|
|
5665
5681
|
},
|
|
5666
5682
|
},
|
|
5667
|
-
// See docs on content modeling for more info on how to setup new content models: https://tina.io/docs/
|
|
5683
|
+
// See docs on content modeling for more info on how to setup new content models: https://tina.io/docs/r/content-modelling-collections/
|
|
5668
5684
|
schema: {
|
|
5669
5685
|
collections: ${generateCollectionString(args)},
|
|
5670
5686
|
},
|
|
@@ -6165,8 +6181,8 @@ async function apply({
|
|
|
6165
6181
|
await addConfigFile({
|
|
6166
6182
|
configArgs: {
|
|
6167
6183
|
config: config2,
|
|
6168
|
-
publicFolder:
|
|
6169
|
-
|
|
6184
|
+
publicFolder: import_path13.default.join(
|
|
6185
|
+
import_path13.default.relative(process.cwd(), pathToForestryConfig),
|
|
6170
6186
|
config2.publicFolder
|
|
6171
6187
|
),
|
|
6172
6188
|
collections,
|
|
@@ -6239,18 +6255,18 @@ var createPackageJSON = async () => {
|
|
|
6239
6255
|
};
|
|
6240
6256
|
var createGitignore = async ({ baseDir }) => {
|
|
6241
6257
|
logger.info(logText("No .gitignore found, creating one"));
|
|
6242
|
-
import_fs_extra13.default.outputFileSync(
|
|
6258
|
+
import_fs_extra13.default.outputFileSync(import_path13.default.join(baseDir, ".gitignore"), "node_modules");
|
|
6243
6259
|
};
|
|
6244
6260
|
var updateGitIgnore = async ({
|
|
6245
6261
|
baseDir,
|
|
6246
6262
|
items
|
|
6247
6263
|
}) => {
|
|
6248
6264
|
logger.info(logText(`Adding ${items.join(",")} to .gitignore`));
|
|
6249
|
-
const gitignoreContent = import_fs_extra13.default.readFileSync(
|
|
6265
|
+
const gitignoreContent = import_fs_extra13.default.readFileSync(import_path13.default.join(baseDir, ".gitignore")).toString();
|
|
6250
6266
|
const newGitignoreContent = [...gitignoreContent.split("\n"), ...items].join(
|
|
6251
6267
|
"\n"
|
|
6252
6268
|
);
|
|
6253
|
-
await import_fs_extra13.default.writeFile(
|
|
6269
|
+
await import_fs_extra13.default.writeFile(import_path13.default.join(baseDir, ".gitignore"), newGitignoreContent);
|
|
6254
6270
|
};
|
|
6255
6271
|
var addDependencies = async (config2, env, params) => {
|
|
6256
6272
|
const { packageManager } = config2;
|
|
@@ -6291,7 +6307,8 @@ var addDependencies = async (config2, env, params) => {
|
|
|
6291
6307
|
let packageManagers = {
|
|
6292
6308
|
pnpm: process.env.USE_WORKSPACE ? `pnpm add ${deps.join(" ")} --workspace` : `pnpm add ${deps.join(" ")}`,
|
|
6293
6309
|
npm: `npm install ${deps.join(" ")}`,
|
|
6294
|
-
yarn: `yarn add ${deps.join(" ")}
|
|
6310
|
+
yarn: `yarn add ${deps.join(" ")}`,
|
|
6311
|
+
bun: `bun add ${deps.join(" ")}`
|
|
6295
6312
|
};
|
|
6296
6313
|
if (packageManagers[packageManager] && deps.length > 0) {
|
|
6297
6314
|
logger.info(logText("Adding dependencies, this might take a moment..."));
|
|
@@ -6302,7 +6319,8 @@ var addDependencies = async (config2, env, params) => {
|
|
|
6302
6319
|
packageManagers = {
|
|
6303
6320
|
pnpm: process.env.USE_WORKSPACE ? `pnpm add -D ${devDeps.join(" ")} --workspace` : `pnpm add -D ${devDeps.join(" ")}`,
|
|
6304
6321
|
npm: `npm install -D ${devDeps.join(" ")}`,
|
|
6305
|
-
yarn: `yarn add -D ${devDeps.join(" ")}
|
|
6322
|
+
yarn: `yarn add -D ${devDeps.join(" ")}`,
|
|
6323
|
+
bun: `bun add -D ${devDeps.join(" ")}`
|
|
6306
6324
|
};
|
|
6307
6325
|
if (packageManagers[packageManager]) {
|
|
6308
6326
|
logger.info(
|
|
@@ -6319,22 +6337,22 @@ var writeGeneratedFile = async ({
|
|
|
6319
6337
|
content,
|
|
6320
6338
|
typescript
|
|
6321
6339
|
}) => {
|
|
6322
|
-
const { exists, path:
|
|
6340
|
+
const { exists, path: path15, parentPath } = generatedFile.resolve(typescript);
|
|
6323
6341
|
if (exists) {
|
|
6324
6342
|
if (overwrite) {
|
|
6325
|
-
logger.info(`Overwriting file at ${
|
|
6326
|
-
import_fs_extra13.default.outputFileSync(
|
|
6343
|
+
logger.info(`Overwriting file at ${path15}... \u2705`);
|
|
6344
|
+
import_fs_extra13.default.outputFileSync(path15, content);
|
|
6327
6345
|
} else {
|
|
6328
|
-
logger.info(`Not overwriting file at ${
|
|
6346
|
+
logger.info(`Not overwriting file at ${path15}.`);
|
|
6329
6347
|
logger.info(
|
|
6330
|
-
logText(`Please add the following to ${
|
|
6348
|
+
logText(`Please add the following to ${path15}:
|
|
6331
6349
|
${indentText(content)}}`)
|
|
6332
6350
|
);
|
|
6333
6351
|
}
|
|
6334
6352
|
} else {
|
|
6335
|
-
logger.info(`Adding file at ${
|
|
6353
|
+
logger.info(`Adding file at ${path15}... \u2705`);
|
|
6336
6354
|
await import_fs_extra13.default.ensureDir(parentPath);
|
|
6337
|
-
import_fs_extra13.default.outputFileSync(
|
|
6355
|
+
import_fs_extra13.default.outputFileSync(path15, content);
|
|
6338
6356
|
}
|
|
6339
6357
|
};
|
|
6340
6358
|
var addConfigFile = async ({
|
|
@@ -6412,7 +6430,7 @@ var addContentFile = async ({
|
|
|
6412
6430
|
return () => ({
|
|
6413
6431
|
exists: env.sampleContentExists,
|
|
6414
6432
|
path: env.sampleContentPath,
|
|
6415
|
-
parentPath:
|
|
6433
|
+
parentPath: import_path13.default.dirname(env.sampleContentPath)
|
|
6416
6434
|
});
|
|
6417
6435
|
}
|
|
6418
6436
|
},
|
|
@@ -6435,7 +6453,7 @@ ${titleText(" TinaCMS ")} backend initialized!`));
|
|
|
6435
6453
|
return `${x.key}=${x.value || "***"}`;
|
|
6436
6454
|
}).join("\n") + `
|
|
6437
6455
|
TINA_PUBLIC_IS_LOCAL=true`;
|
|
6438
|
-
const envFile =
|
|
6456
|
+
const envFile = import_path13.default.join(process.cwd(), ".env");
|
|
6439
6457
|
if (!import_fs_extra13.default.existsSync(envFile)) {
|
|
6440
6458
|
logger.info(`Adding .env file to your project... \u2705`);
|
|
6441
6459
|
import_fs_extra13.default.writeFileSync(envFile, envFileText);
|
|
@@ -6481,7 +6499,8 @@ var other = ({ packageManager }) => {
|
|
|
6481
6499
|
pnpm: `pnpm`,
|
|
6482
6500
|
npm: `npx`,
|
|
6483
6501
|
// npx is the way to run executables that aren't in your "scripts"
|
|
6484
|
-
yarn: `yarn
|
|
6502
|
+
yarn: `yarn`,
|
|
6503
|
+
bun: `bun run`
|
|
6485
6504
|
};
|
|
6486
6505
|
return `${packageManagers[packageManager]} tinacms dev -c "<your dev command>"`;
|
|
6487
6506
|
};
|
|
@@ -6494,7 +6513,8 @@ var frameworkDevCmds = {
|
|
|
6494
6513
|
pnpm: `pnpm`,
|
|
6495
6514
|
npm: `npm run`,
|
|
6496
6515
|
// npx is the way to run executables that aren't in your "scripts"
|
|
6497
|
-
yarn: `yarn
|
|
6516
|
+
yarn: `yarn`,
|
|
6517
|
+
bun: `bun run`
|
|
6498
6518
|
};
|
|
6499
6519
|
return `${packageManagers[packageManager]} dev`;
|
|
6500
6520
|
}
|
|
@@ -6507,7 +6527,7 @@ var addReactiveFile = {
|
|
|
6507
6527
|
baseDir,
|
|
6508
6528
|
dataLayer
|
|
6509
6529
|
}) => {
|
|
6510
|
-
const packageJsonPath =
|
|
6530
|
+
const packageJsonPath = import_path13.default.join(baseDir, "package.json");
|
|
6511
6531
|
await writeGeneratedFile({
|
|
6512
6532
|
generatedFile,
|
|
6513
6533
|
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.12.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/app": "2.3.5",
|
|
93
94
|
"@tinacms/graphql": "1.6.1",
|
|
94
95
|
"@tinacms/metrics": "1.1.0",
|
|
95
96
|
"@tinacms/schema-tools": "1.9.1",
|
|
96
97
|
"@tinacms/search": "1.1.1",
|
|
97
|
-
"tinacms": "2.
|
|
98
|
+
"tinacms": "2.9.1"
|
|
98
99
|
},
|
|
99
100
|
"publishConfig": {
|
|
100
101
|
"registry": "https://registry.npmjs.org"
|