@tinacms/graphql 1.4.35 → 1.4.37

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
@@ -2874,7 +2874,7 @@ var validateField = async (field) => {
2874
2874
  // package.json
2875
2875
  var package_default = {
2876
2876
  name: "@tinacms/graphql",
2877
- version: "1.4.35",
2877
+ version: "1.4.37",
2878
2878
  main: "dist/index.js",
2879
2879
  module: "dist/index.mjs",
2880
2880
  typings: "dist/index.d.ts",
@@ -2899,8 +2899,8 @@ var package_default = {
2899
2899
  scripts: {
2900
2900
  types: "pnpm tsc",
2901
2901
  build: "tinacms-scripts build",
2902
- docs: "yarn typedoc",
2903
- serve: "yarn nodemon dist/server.js",
2902
+ docs: "pnpm typedoc",
2903
+ serve: "pnpm nodemon dist/server.js",
2904
2904
  test: "jest",
2905
2905
  "test-watch": "jest --watch"
2906
2906
  },
@@ -2909,12 +2909,7 @@ var package_default = {
2909
2909
  "@tinacms/mdx": "workspace:*",
2910
2910
  "@tinacms/schema-tools": "workspace:*",
2911
2911
  "abstract-level": "^1.0.3",
2912
- "body-parser": "^1.19.0",
2913
- cors: "^2.8.5",
2914
- dataloader: "^2.0.0",
2915
2912
  "date-fns": "^2.21.1",
2916
- "encoding-down": "^7.1.0",
2917
- "estree-walker": "^3.0.0",
2918
2913
  "fast-glob": "^3.2.5",
2919
2914
  "fs-extra": "^9.0.1",
2920
2915
  "glob-parent": "^6.0.2",
@@ -2964,7 +2959,7 @@ var package_default = {
2964
2959
  "jest-matcher-utils": "^29.5.0",
2965
2960
  "memory-level": "^1.0.0",
2966
2961
  nodemon: "2.0.19",
2967
- typescript: "4.3.5"
2962
+ typescript: "4.6.4"
2968
2963
  }
2969
2964
  };
2970
2965
 
@@ -4925,7 +4920,7 @@ var Resolver = class {
4925
4920
  const collection = await this.tinaSchema.getCollection(collectionLookup);
4926
4921
  let realPath = import_path3.default.join(collection == null ? void 0 : collection.path, args.relativePath);
4927
4922
  if (isFolderCreation) {
4928
- realPath = `${realPath}/.gitkeep`;
4923
+ realPath = `${realPath}/.gitkeep.${collection.format || "md"}`;
4929
4924
  }
4930
4925
  const alreadyExists = await this.database.documentExists(realPath);
4931
4926
  if (isMutation) {
@@ -5864,7 +5859,6 @@ var Database = class {
5864
5859
  this.put = async (filepath, data, collectionName) => {
5865
5860
  var _a, _b;
5866
5861
  await this.initLevel();
5867
- const isGitKeep = filepath.endsWith(".gitkeep");
5868
5862
  try {
5869
5863
  if (SYSTEM_FILES.includes(filepath)) {
5870
5864
  throw new Error(`Unexpected put for config file ${filepath}`);
@@ -5893,7 +5887,9 @@ var Database = class {
5893
5887
  );
5894
5888
  }
5895
5889
  }
5896
- const stringifiedFile = isGitKeep ? "" : await this.stringifyFile(filepath, dataFields, collection);
5890
+ const stringifiedFile = filepath.endsWith(
5891
+ `.gitkeep.${collection.format || "md"}`
5892
+ ) ? "" : await this.stringifyFile(filepath, dataFields, collection);
5897
5893
  if (!(collection == null ? void 0 : collection.isDetached)) {
5898
5894
  if (this.bridge) {
5899
5895
  await this.bridge.put(normalizedPath, stringifiedFile);
package/dist/index.mjs CHANGED
@@ -2807,7 +2807,7 @@ var validateField = async (field) => {
2807
2807
  // package.json
2808
2808
  var package_default = {
2809
2809
  name: "@tinacms/graphql",
2810
- version: "1.4.35",
2810
+ version: "1.4.37",
2811
2811
  main: "dist/index.js",
2812
2812
  module: "dist/index.mjs",
2813
2813
  typings: "dist/index.d.ts",
@@ -2832,8 +2832,8 @@ var package_default = {
2832
2832
  scripts: {
2833
2833
  types: "pnpm tsc",
2834
2834
  build: "tinacms-scripts build",
2835
- docs: "yarn typedoc",
2836
- serve: "yarn nodemon dist/server.js",
2835
+ docs: "pnpm typedoc",
2836
+ serve: "pnpm nodemon dist/server.js",
2837
2837
  test: "jest",
2838
2838
  "test-watch": "jest --watch"
2839
2839
  },
@@ -2842,12 +2842,7 @@ var package_default = {
2842
2842
  "@tinacms/mdx": "workspace:*",
2843
2843
  "@tinacms/schema-tools": "workspace:*",
2844
2844
  "abstract-level": "^1.0.3",
2845
- "body-parser": "^1.19.0",
2846
- cors: "^2.8.5",
2847
- dataloader: "^2.0.0",
2848
2845
  "date-fns": "^2.21.1",
2849
- "encoding-down": "^7.1.0",
2850
- "estree-walker": "^3.0.0",
2851
2846
  "fast-glob": "^3.2.5",
2852
2847
  "fs-extra": "^9.0.1",
2853
2848
  "glob-parent": "^6.0.2",
@@ -2897,7 +2892,7 @@ var package_default = {
2897
2892
  "jest-matcher-utils": "^29.5.0",
2898
2893
  "memory-level": "^1.0.0",
2899
2894
  nodemon: "2.0.19",
2900
- typescript: "4.3.5"
2895
+ typescript: "4.6.4"
2901
2896
  }
2902
2897
  };
2903
2898
 
@@ -4852,7 +4847,7 @@ var Resolver = class {
4852
4847
  const collection = await this.tinaSchema.getCollection(collectionLookup);
4853
4848
  let realPath = path3.join(collection?.path, args.relativePath);
4854
4849
  if (isFolderCreation) {
4855
- realPath = `${realPath}/.gitkeep`;
4850
+ realPath = `${realPath}/.gitkeep.${collection.format || "md"}`;
4856
4851
  }
4857
4852
  const alreadyExists = await this.database.documentExists(realPath);
4858
4853
  if (isMutation) {
@@ -5785,7 +5780,6 @@ var Database = class {
5785
5780
  };
5786
5781
  this.put = async (filepath, data, collectionName) => {
5787
5782
  await this.initLevel();
5788
- const isGitKeep = filepath.endsWith(".gitkeep");
5789
5783
  try {
5790
5784
  if (SYSTEM_FILES.includes(filepath)) {
5791
5785
  throw new Error(`Unexpected put for config file ${filepath}`);
@@ -5814,7 +5808,9 @@ var Database = class {
5814
5808
  );
5815
5809
  }
5816
5810
  }
5817
- const stringifiedFile = isGitKeep ? "" : await this.stringifyFile(filepath, dataFields, collection);
5811
+ const stringifiedFile = filepath.endsWith(
5812
+ `.gitkeep.${collection.format || "md"}`
5813
+ ) ? "" : await this.stringifyFile(filepath, dataFields, collection);
5818
5814
  if (!collection?.isDetached) {
5819
5815
  if (this.bridge) {
5820
5816
  await this.bridge.put(normalizedPath, stringifiedFile);
@@ -52,9 +52,7 @@ export declare class Resolver {
52
52
  constructor(init: ResolverConfig);
53
53
  resolveCollection: (args: any, collectionName: string, hasDocuments?: boolean) => Promise<{
54
54
  fields: TinaField<true>[];
55
- templates?: undefined; /**
56
- * createDocument, create<Collection>Document
57
- */
55
+ templates?: undefined;
58
56
  label?: string;
59
57
  name: string;
60
58
  path: string;
@@ -63,14 +61,16 @@ export declare class Resolver {
63
61
  fields: {
64
62
  name: string;
65
63
  }[];
66
- }[];
64
+ }[]; /**
65
+ * `collectionName` is passed in:
66
+ * * `addPendingDocument()` has `collection` on `args`
67
+ * * `getDocument()` provides a `collection` on `args`
68
+ * * `get<Collection>Document()` has `collection` on `lookup`
69
+ */
67
70
  format?: "json" | "md" | "markdown" | "mdx" | "yaml" | "yml" | "toml";
68
71
  ui?: import("@tinacms/schema-tools").UICollection<any, any, any>;
69
72
  defaultItem?: import("@tinacms/schema-tools").DefaultItem<Record<string, any>>;
70
73
  frontmatterFormat?: "json" | "yaml" | "toml";
71
- /**
72
- * For generic functions (like `createDocument()` and `updateDocument()`), `collection` is the top key of the `params`
73
- */
74
74
  frontmatterDelimiters?: string | [string, string];
75
75
  match?: {
76
76
  include?: string;
@@ -94,14 +94,16 @@ export declare class Resolver {
94
94
  fields: {
95
95
  name: string;
96
96
  }[];
97
- }[];
97
+ }[]; /**
98
+ * `collectionName` is passed in:
99
+ * * `addPendingDocument()` has `collection` on `args`
100
+ * * `getDocument()` provides a `collection` on `args`
101
+ * * `get<Collection>Document()` has `collection` on `lookup`
102
+ */
98
103
  format?: "json" | "md" | "markdown" | "mdx" | "yaml" | "yml" | "toml";
99
104
  ui?: import("@tinacms/schema-tools").UICollection<any, any, any>;
100
105
  defaultItem?: import("@tinacms/schema-tools").DefaultItem<Record<string, any>>;
101
106
  frontmatterFormat?: "json" | "yaml" | "toml";
102
- /**
103
- * For generic functions (like `createDocument()` and `updateDocument()`), `collection` is the top key of the `params`
104
- */
105
107
  frontmatterDelimiters?: string | [string, string];
106
108
  match?: {
107
109
  include?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/graphql",
3
- "version": "1.4.35",
3
+ "version": "1.4.37",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "typings": "dist/index.d.ts",
@@ -24,15 +24,8 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@iarna/toml": "^2.2.5",
27
- "@tinacms/mdx": "1.3.25",
28
- "@tinacms/schema-tools": "1.4.16",
29
27
  "abstract-level": "^1.0.3",
30
- "body-parser": "^1.19.0",
31
- "cors": "^2.8.5",
32
- "dataloader": "^2.0.0",
33
28
  "date-fns": "^2.21.1",
34
- "encoding-down": "^7.1.0",
35
- "estree-walker": "^3.0.0",
36
29
  "fast-glob": "^3.2.5",
37
30
  "fs-extra": "^9.0.1",
38
31
  "glob-parent": "^6.0.2",
@@ -48,7 +41,9 @@
48
41
  "normalize-path": "^3.0.0",
49
42
  "readable-stream": "^4.3.0",
50
43
  "scmp": "^2.1.0",
51
- "yup": "^0.32.9"
44
+ "yup": "^0.32.9",
45
+ "@tinacms/mdx": "1.3.27",
46
+ "@tinacms/schema-tools": "1.4.18"
52
47
  },
53
48
  "publishConfig": {
54
49
  "registry": "https://registry.npmjs.org"
@@ -58,8 +53,6 @@
58
53
  "directory": "packages/tina-graphql"
59
54
  },
60
55
  "devDependencies": {
61
- "@tinacms/schema-tools": "1.4.16",
62
- "@tinacms/scripts": "1.1.4",
63
56
  "@types/cors": "^2.8.7",
64
57
  "@types/estree": "^0.0.50",
65
58
  "@types/express": "^4.17.8",
@@ -82,13 +75,15 @@
82
75
  "jest-matcher-utils": "^29.5.0",
83
76
  "memory-level": "^1.0.0",
84
77
  "nodemon": "2.0.19",
85
- "typescript": "4.3.5"
78
+ "typescript": "4.6.4",
79
+ "@tinacms/scripts": "1.1.5",
80
+ "@tinacms/schema-tools": "1.4.18"
86
81
  },
87
82
  "scripts": {
88
83
  "types": "pnpm tsc",
89
84
  "build": "tinacms-scripts build",
90
- "docs": "yarn typedoc",
91
- "serve": "yarn nodemon dist/server.js",
85
+ "docs": "pnpm typedoc",
86
+ "serve": "pnpm nodemon dist/server.js",
92
87
  "test": "jest",
93
88
  "test-watch": "jest --watch"
94
89
  }