@tinacms/cli 1.5.13 → 1.5.15

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_clipanion7 = require("clipanion");
32
32
 
33
33
  // package.json
34
- var version = "1.5.13";
34
+ var version = "1.5.15";
35
35
 
36
36
  // src/next/commands/dev-command/index.ts
37
37
  var import_clipanion2 = require("clipanion");
@@ -1795,8 +1795,10 @@ var BaseCommand = class extends import_clipanion.Command {
1795
1795
  async indexContentWithSpinner({
1796
1796
  database,
1797
1797
  graphQLSchema,
1798
- tinaSchema
1798
+ tinaSchema,
1799
+ text
1799
1800
  }) {
1801
+ const textToUse = text || "Indexing local files";
1800
1802
  const warnings = [];
1801
1803
  await spin({
1802
1804
  waitFor: async () => {
@@ -1806,7 +1808,7 @@ var BaseCommand = class extends import_clipanion.Command {
1806
1808
  });
1807
1809
  warnings.push(...res.warnings);
1808
1810
  },
1809
- text: "Indexing local files"
1811
+ text: textToUse
1810
1812
  });
1811
1813
  if (warnings.length > 0) {
1812
1814
  logger.warn(`Indexing completed with ${warnings.length} warning(s)`);
@@ -2013,13 +2015,13 @@ var DevCommand = class extends BaseCommand {
2013
2015
  return;
2014
2016
  }
2015
2017
  const pathFromRoot = configManager.printContentRelativePath(addedFile);
2016
- database.indexContentByPaths([pathFromRoot]);
2018
+ database.indexContentByPaths([pathFromRoot]).catch(console.error);
2017
2019
  }).on("change", async (changedFile) => {
2018
2020
  const pathFromRoot = configManager.printContentRelativePath(changedFile);
2019
- database.indexContentByPaths([pathFromRoot]);
2021
+ database.indexContentByPaths([pathFromRoot]).catch(console.error);
2020
2022
  }).on("unlink", async (removedFile) => {
2021
2023
  const pathFromRoot = configManager.printContentRelativePath(removedFile);
2022
- database.deleteContentByPaths([pathFromRoot]);
2024
+ database.deleteContentByPaths([pathFromRoot]).catch(console.error);
2023
2025
  });
2024
2026
  }
2025
2027
  watchQueries(configManager, callback) {
@@ -2193,6 +2195,9 @@ var BuildCommand = class extends BaseCommand {
2193
2195
  this.localOption = import_clipanion3.Option.Boolean("--local", {
2194
2196
  description: "Starts local Graphql server and builds the local client instead of production client"
2195
2197
  });
2198
+ this.skipIndexing = import_clipanion3.Option.Boolean("--skip-indexing", false, {
2199
+ description: "Skips indexing the content. This can be used for building the site without indexing the content (defaults to false)"
2200
+ });
2196
2201
  this.tinaGraphQLVersion = import_clipanion3.Option.String("--tina-graphql-version", {
2197
2202
  description: "Specify the version of @tinacms/graphql to use (defaults to latest)"
2198
2203
  });
@@ -2237,12 +2242,16 @@ var BuildCommand = class extends BaseCommand {
2237
2242
  lookup
2238
2243
  });
2239
2244
  const apiURL = await codegen2.execute();
2240
- if (this.localOption) {
2245
+ if ((configManager.hasSelfHostedConfig() || this.localOption) && !this.skipIndexing) {
2246
+ const text = this.localOption ? void 0 : "Indexing to self-hosted data layer";
2241
2247
  await this.indexContentWithSpinner({
2248
+ text,
2242
2249
  database,
2243
2250
  graphQLSchema,
2244
2251
  tinaSchema
2245
2252
  });
2253
+ }
2254
+ if (this.localOption) {
2246
2255
  server = await createDevServer(configManager, database, apiURL, true);
2247
2256
  await server.listen(Number(this.port));
2248
2257
  console.log("server listening on port", this.port);
@@ -2393,6 +2402,18 @@ var BuildCommand = class extends BaseCommand {
2393
2402
  url: apiURL,
2394
2403
  token
2395
2404
  });
2405
+ if (!remoteSchema) {
2406
+ bar2.tick({
2407
+ prog: "\u274C"
2408
+ });
2409
+ let errorMessage = `The remote GraphQL schema does not exist. Check indexing for this branch.`;
2410
+ if (config3 == null ? void 0 : config3.branch) {
2411
+ errorMessage += `
2412
+
2413
+ Additional info: Branch: ${config3.branch}, Client ID: ${config3.clientId} `;
2414
+ }
2415
+ throw new Error(errorMessage);
2416
+ }
2396
2417
  const remoteGqlSchema = (0, import_graphql10.buildClientSchema)(remoteSchema);
2397
2418
  const localSchemaDocument = await database.getGraphQLSchemaFromBridge();
2398
2419
  const localGraphqlSchema = (0, import_graphql10.buildASTSchema)(localSchemaDocument);
@@ -18,9 +18,10 @@ export declare abstract class BaseCommand extends Command {
18
18
  abstract execute(): Promise<number | void>;
19
19
  startSubCommand(): Promise<void>;
20
20
  logDeprecationWarnings(): void;
21
- indexContentWithSpinner({ database, graphQLSchema, tinaSchema, }: {
21
+ indexContentWithSpinner({ database, graphQLSchema, tinaSchema, text, }: {
22
22
  database: Database;
23
23
  graphQLSchema: DocumentNode;
24
24
  tinaSchema: TinaSchema;
25
+ text?: string;
25
26
  }): Promise<void>;
26
27
  }
@@ -4,6 +4,7 @@ import { BaseCommand } from '../baseCommands';
4
4
  export declare class BuildCommand extends BaseCommand {
5
5
  static paths: string[][];
6
6
  localOption: boolean;
7
+ skipIndexing: boolean;
7
8
  tinaGraphQLVersion: string;
8
9
  /**
9
10
  * This option allows the user to skip the tina cloud checks if they want to. This could be useful for mismatched GraphQL versions or if they want to build only using the local client and never connect to Tina Cloud
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/cli",
3
- "version": "1.5.13",
3
+ "version": "1.5.15",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "files": [
@@ -58,9 +58,9 @@
58
58
  "@tailwindcss/aspect-ratio": "^0.4.0",
59
59
  "@tailwindcss/line-clamp": "^0.3.1",
60
60
  "@tailwindcss/typography": "^0.5.9",
61
- "@tinacms/app": "1.2.13",
62
- "@tinacms/datalayer": "1.2.13",
63
- "@tinacms/graphql": "1.4.13",
61
+ "@tinacms/app": "1.2.14",
62
+ "@tinacms/datalayer": "1.2.15",
63
+ "@tinacms/graphql": "1.4.15",
64
64
  "@tinacms/metrics": "1.0.2",
65
65
  "@tinacms/schema-tools": "1.4.4",
66
66
  "@vitejs/plugin-react": "3.1.0",