@tinacms/cli 1.5.30 → 1.5.31

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.
Files changed (2) hide show
  1. package/dist/index.js +37 -24
  2. package/package.json +7 -7
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.5.30";
34
+ var version = "1.5.31";
35
35
 
36
36
  // src/next/commands/dev-command/index.ts
37
37
  var import_clipanion2 = require("clipanion");
@@ -1391,7 +1391,7 @@ const generateRequester = (
1391
1391
  url,
1392
1392
  })
1393
1393
 
1394
- return { data: data?.data, query: doc, variables: vars || {} }
1394
+ return { data: data?.data, errors: data?.errors, query: doc, variables: vars || {} }
1395
1395
  }
1396
1396
 
1397
1397
  return requester
@@ -1464,7 +1464,7 @@ var GenericSdkVisitor = class extends import_visitor_plugin_common.ClientSideBas
1464
1464
  node,
1465
1465
  documentVariableName,
1466
1466
  operationType,
1467
- operationResultType: `{data: ${operationResultType}, variables: ${operationVariablesTypes}, query: string}`,
1467
+ operationResultType: `{data: ${operationResultType}, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: ${operationVariablesTypes}, query: string}`,
1468
1468
  operationVariablesTypes
1469
1469
  });
1470
1470
  }
@@ -1718,12 +1718,13 @@ var Codegen = class {
1718
1718
  return this.apiURL;
1719
1719
  }
1720
1720
  async genClient() {
1721
- var _a;
1721
+ var _a, _b, _c;
1722
1722
  const token = (_a = this.configManager.config) == null ? void 0 : _a.token;
1723
+ const errorPolicy = (_c = (_b = this.configManager.config) == null ? void 0 : _b.client) == null ? void 0 : _c.errorPolicy;
1723
1724
  const apiURL = this.getApiURL();
1724
1725
  const clientString = `import { createClient } from "tinacms/dist/client";
1725
1726
  import { queries } from "./types";
1726
- export const client = createClient({ url: '${apiURL}', token: '${token}', queries });
1727
+ export const client = createClient({ url: '${apiURL}', token: '${token}', queries, ${errorPolicy ? `errorPolicy: '${errorPolicy}'` : ""} });
1727
1728
  export default client;
1728
1729
  `;
1729
1730
  return { apiURL, clientString };
@@ -1877,12 +1878,7 @@ async function localSpin({
1877
1878
  });
1878
1879
  spinner.setSpinnerString("\u280B\u2819\u2839\u2838\u283C\u2834\u2826\u2827\u2807\u280F");
1879
1880
  spinner.start();
1880
- let res;
1881
- try {
1882
- res = await waitFor();
1883
- } catch (e) {
1884
- console.error(e);
1885
- }
1881
+ const res = await waitFor();
1886
1882
  spinner.stop();
1887
1883
  console.log("");
1888
1884
  return res;
@@ -2133,7 +2129,7 @@ var DevCommand = class extends BaseCommand {
2133
2129
  lookup: lookupObject,
2134
2130
  graphql: graphqlSchemaObject
2135
2131
  });
2136
- await import_fs_extra6.default.writeFileSync(
2132
+ import_fs_extra6.default.writeFileSync(
2137
2133
  import_path7.default.join(configManager.tinaFolderPath, tinaLockFilename),
2138
2134
  tinaLockContent
2139
2135
  );
@@ -2160,14 +2156,17 @@ var DevCommand = class extends BaseCommand {
2160
2156
  }
2161
2157
  return { apiURL: apiURL2, database, graphQLSchema: graphQLSchema2, tinaSchema: tinaSchema2 };
2162
2158
  } catch (e) {
2163
- logger.error(dangerText(e.message));
2159
+ logger.error(`
2160
+
2161
+ ${dangerText(e.message)}
2162
+ `);
2164
2163
  if (this.verbose) {
2165
2164
  console.error(e);
2166
2165
  }
2167
2166
  if (firstTime) {
2168
2167
  logger.error(
2169
2168
  warnText(
2170
- "Unable to start dev server, please fix your Tina config and try again"
2169
+ "Unable to start dev server, please fix your Tina config / resolve any errors above and try again"
2171
2170
  )
2172
2171
  );
2173
2172
  process.exit(1);
@@ -2521,8 +2520,11 @@ var BuildCommand = class extends BaseCommand {
2521
2520
  try {
2522
2521
  await configManager.processConfig();
2523
2522
  } catch (e) {
2524
- logger.error(e.message);
2525
- logger.error("Unable to build, please fix your Tina config and try again");
2523
+ logger.error(`
2524
+ ${dangerText(e.message)}`);
2525
+ logger.error(
2526
+ dangerText("Unable to build, please fix your Tina config and try again")
2527
+ );
2526
2528
  process.exit(1);
2527
2529
  }
2528
2530
  let server;
@@ -2545,14 +2547,25 @@ var BuildCommand = class extends BaseCommand {
2545
2547
  const apiURL = await codegen2.execute();
2546
2548
  if ((configManager.hasSelfHostedConfig() || this.localOption) && !this.skipIndexing) {
2547
2549
  const text = this.localOption ? void 0 : "Indexing to self-hosted data layer";
2548
- await this.indexContentWithSpinner({
2549
- text,
2550
- database,
2551
- graphQLSchema,
2552
- tinaSchema,
2553
- configManager,
2554
- partialReindex: this.partialReindex
2555
- });
2550
+ try {
2551
+ await this.indexContentWithSpinner({
2552
+ text,
2553
+ database,
2554
+ graphQLSchema,
2555
+ tinaSchema,
2556
+ configManager,
2557
+ partialReindex: this.partialReindex
2558
+ });
2559
+ } catch (e) {
2560
+ logger.error(`
2561
+
2562
+ ${dangerText(e.message)}
2563
+ `);
2564
+ if (this.verbose) {
2565
+ console.error(e);
2566
+ }
2567
+ process.exit(1);
2568
+ }
2556
2569
  }
2557
2570
  if (this.localOption) {
2558
2571
  server = await createDevServer(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/cli",
3
- "version": "1.5.30",
3
+ "version": "1.5.31",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "files": [
@@ -58,13 +58,13 @@
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.28",
62
- "tinacms": "1.5.21",
63
- "@tinacms/datalayer": "1.2.26",
64
- "@tinacms/graphql": "1.4.26",
61
+ "@tinacms/app": "1.2.29",
62
+ "tinacms": "1.5.22",
63
+ "@tinacms/datalayer": "1.2.27",
64
+ "@tinacms/graphql": "1.4.27",
65
65
  "@tinacms/metrics": "1.0.2",
66
- "@tinacms/schema-tools": "1.4.12",
67
- "@tinacms/search": "1.0.11",
66
+ "@tinacms/schema-tools": "1.4.13",
67
+ "@tinacms/search": "1.0.12",
68
68
  "@vitejs/plugin-react": "3.1.0",
69
69
  "ajv": "^6.12.3",
70
70
  "altair-express-middleware": "4.0.6",