@tinacms/cli 1.6.0 → 1.6.2

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
@@ -31,7 +31,7 @@ module.exports = __toCommonJS(src_exports);
31
31
  var import_clipanion8 = require("clipanion");
32
32
 
33
33
  // package.json
34
- var version = "1.6.0";
34
+ var version = "1.6.2";
35
35
 
36
36
  // src/next/commands/dev-command/index.ts
37
37
  var import_clipanion2 = require("clipanion");
@@ -209,6 +209,11 @@ var ConfigManager = class {
209
209
  import_path.default.join(this.tinaFolderPath, "database")
210
210
  );
211
211
  this.generatedFolderPath = import_path.default.join(this.tinaFolderPath, GENERATED_FOLDER);
212
+ this.generatedCachePath = import_path.default.join(
213
+ this.generatedFolderPath,
214
+ ".cache",
215
+ String(new Date().getTime())
216
+ );
212
217
  this.generatedGraphQLGQLPath = import_path.default.join(
213
218
  this.generatedFolderPath,
214
219
  GRAPHQL_GQL_FILE
@@ -1394,7 +1399,13 @@ var createDevServer = async (configManager, database, searchIndex, apiURL, noWat
1394
1399
  plugins,
1395
1400
  noWatch,
1396
1401
  rollupOptions: {
1397
- input: configManager.spaMainPath
1402
+ input: configManager.spaMainPath,
1403
+ onwarn(warning, warn) {
1404
+ if (warning.code === "MODULE_LEVEL_DIRECTIVE") {
1405
+ return;
1406
+ }
1407
+ warn(warning);
1408
+ }
1398
1409
  }
1399
1410
  })
1400
1411
  );
@@ -1632,7 +1643,8 @@ var Codegen = class {
1632
1643
  isLocal,
1633
1644
  graphqlSchemaDoc,
1634
1645
  tinaSchema,
1635
- lookup
1646
+ lookup,
1647
+ noClientBuildCache
1636
1648
  }) {
1637
1649
  this.isLocal = isLocal;
1638
1650
  this.graphqlSchemaDoc = graphqlSchemaDoc;
@@ -1643,6 +1655,7 @@ var Codegen = class {
1643
1655
  this.queryDoc = queryDoc;
1644
1656
  this.fragDoc = fragDoc;
1645
1657
  this.lookup = lookup;
1658
+ this.noClientBuildCache = noClientBuildCache;
1646
1659
  }
1647
1660
  async writeConfigFile(fileName, data) {
1648
1661
  const filePath = import_path5.default.join(this.configManager.generatedFolderPath, fileName);
@@ -1671,6 +1684,8 @@ var Codegen = class {
1671
1684
  "_graphql.json",
1672
1685
  JSON.stringify(this.graphqlSchemaDoc)
1673
1686
  );
1687
+ const { search, ...rest } = this.tinaSchema.schema.config;
1688
+ this.tinaSchema.schema.config = rest;
1674
1689
  await this.writeConfigFile(
1675
1690
  "_schema.json",
1676
1691
  JSON.stringify(this.tinaSchema.schema)
@@ -1890,7 +1905,7 @@ export default databaseClient;
1890
1905
  const apiURL = this.getApiURL();
1891
1906
  const clientString = `import { createClient } from "tinacms/dist/client";
1892
1907
  import { queries } from "./types";
1893
- export const client = createClient({ url: '${apiURL}', token: '${token}', queries, ${errorPolicy ? `errorPolicy: '${errorPolicy}'` : ""} });
1908
+ export const client = createClient({ ${this.noClientBuildCache === false ? `cacheDir: '${this.configManager.generatedCachePath}', ` : ""}url: '${apiURL}', token: '${token}', queries, ${errorPolicy ? `errorPolicy: '${errorPolicy}'` : ""} });
1894
1909
  export default client;
1895
1910
  `;
1896
1911
  return { apiURL, clientString };
@@ -2279,7 +2294,8 @@ var DevCommand = class extends BaseCommand {
2279
2294
  fragDoc,
2280
2295
  graphqlSchemaDoc: graphQLSchema2,
2281
2296
  tinaSchema: tinaSchema2,
2282
- lookup
2297
+ lookup,
2298
+ noClientBuildCache: true
2283
2299
  });
2284
2300
  const apiURL2 = await codegen2.execute();
2285
2301
  if (!configManager.isUsingLegacyFolder) {
@@ -2537,7 +2553,15 @@ var buildProductionSpa = async (configManager, database, apiURL) => {
2537
2553
  configManager,
2538
2554
  database,
2539
2555
  apiURL,
2540
- noWatch: true
2556
+ noWatch: true,
2557
+ rollupOptions: {
2558
+ onwarn(warning, warn) {
2559
+ if (warning.code === "MODULE_LEVEL_DIRECTIVE") {
2560
+ return;
2561
+ }
2562
+ warn(warning);
2563
+ }
2564
+ }
2541
2565
  });
2542
2566
  return (0, import_vite5.build)(config2);
2543
2567
  };
@@ -2678,6 +2702,9 @@ var BuildCommand = class extends BaseCommand {
2678
2702
  this.previewName = import_clipanion3.Option.String("--preview-name", {
2679
2703
  description: "The name of the preview branch"
2680
2704
  });
2705
+ this.noClientBuildCache = import_clipanion3.Option.Boolean("--no-client-build-cache", false, {
2706
+ description: "Disables the client build cache"
2707
+ });
2681
2708
  }
2682
2709
  async catch(error) {
2683
2710
  console.error(error);
@@ -2733,7 +2760,8 @@ ${dangerText(e.message)}`);
2733
2760
  fragDoc,
2734
2761
  graphqlSchemaDoc: graphQLSchema,
2735
2762
  tinaSchema,
2736
- lookup
2763
+ lookup,
2764
+ noClientBuildCache: this.noClientBuildCache
2737
2765
  });
2738
2766
  const apiURL = await codegen2.execute();
2739
2767
  if ((configManager.hasSelfHostedConfig() || this.localOption) && !this.skipIndexing) {
@@ -18,7 +18,8 @@ export declare class Codegen {
18
18
  };
19
19
  tinaSchema: TinaSchema;
20
20
  lookup: any;
21
- constructor({ configManager, port, queryDoc, fragDoc, isLocal, graphqlSchemaDoc, tinaSchema, lookup, }: {
21
+ noClientBuildCache: boolean;
22
+ constructor({ configManager, port, queryDoc, fragDoc, isLocal, graphqlSchemaDoc, tinaSchema, lookup, noClientBuildCache, }: {
22
23
  configManager: ConfigManager;
23
24
  port?: number;
24
25
  queryDoc: string;
@@ -30,6 +31,7 @@ export declare class Codegen {
30
31
  };
31
32
  tinaSchema: TinaSchema;
32
33
  lookup: any;
34
+ noClientBuildCache: boolean;
33
35
  });
34
36
  writeConfigFile(fileName: string, data: string): Promise<void>;
35
37
  removeGeneratedFilesIfExists(): Promise<void>;
@@ -15,6 +15,7 @@ export declare class BuildCommand extends BaseCommand {
15
15
  upstreamBranch: string;
16
16
  previewBaseBranch: string;
17
17
  previewName: string;
18
+ noClientBuildCache: boolean;
18
19
  static usage: import("clipanion").Usage;
19
20
  catch(error: any): Promise<void>;
20
21
  execute(): Promise<number | void>;
@@ -12,6 +12,7 @@ export declare class ConfigManager {
12
12
  tinaSpaPackagePath: string;
13
13
  contentRootPath?: string;
14
14
  envFilePath: string;
15
+ generatedCachePath: string;
15
16
  generatedFolderPath: string;
16
17
  generatedFolderPathContentRepo: string;
17
18
  generatedGraphQLGQLPath: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/cli",
3
- "version": "1.6.0",
3
+ "version": "1.6.2",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "files": [
@@ -38,7 +38,7 @@
38
38
  "@types/prompts": "^2.0.13",
39
39
  "@types/yup": "^0.29.11",
40
40
  "jest": "^29.5.0",
41
- "@tinacms/scripts": "1.2.0"
41
+ "@tinacms/scripts": "1.2.1"
42
42
  },
43
43
  "dependencies": {
44
44
  "@graphql-codegen/core": "^2.1.0",
@@ -85,12 +85,12 @@
85
85
  "vite": "^4.3.9",
86
86
  "yup": "^0.32.9",
87
87
  "zod": "^3.14.3",
88
- "@tinacms/app": "2.1.0",
89
- "@tinacms/graphql": "1.5.0",
88
+ "@tinacms/app": "2.1.2",
90
89
  "@tinacms/metrics": "1.0.5",
91
- "@tinacms/schema-tools": "1.6.0",
92
- "tinacms": "2.2.0",
93
- "@tinacms/search": "1.0.26"
90
+ "@tinacms/schema-tools": "1.6.2",
91
+ "@tinacms/graphql": "1.5.2",
92
+ "tinacms": "2.2.2",
93
+ "@tinacms/search": "1.0.28"
94
94
  },
95
95
  "publishConfig": {
96
96
  "registry": "https://registry.npmjs.org"