@tinacms/cli 1.5.6 → 1.5.8

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 +40 -24
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ module.exports = __toCommonJS(src_exports);
31
31
  var import_clipanion6 = require("clipanion");
32
32
 
33
33
  // package.json
34
- var version = "1.5.6";
34
+ var version = "1.5.8";
35
35
 
36
36
  // src/next/commands/dev-command/index.ts
37
37
  var import_clipanion = require("clipanion");
@@ -731,6 +731,7 @@ var createConfig = async ({
731
731
  noWatch,
732
732
  rollupOptions
733
733
  }) => {
734
+ var _a, _b, _c;
734
735
  const publicEnv = {};
735
736
  Object.keys(process.env).forEach((key) => {
736
737
  if (key.startsWith("TINA_PUBLIC_") || key.startsWith("NEXT_PUBLIC_") || key === "NODE_ENV" || key === "HEAD") {
@@ -781,6 +782,7 @@ var createConfig = async ({
781
782
  include: ["react/jsx-runtime", "react/jsx-dev-runtime"]
782
783
  },
783
784
  server: {
785
+ host: (_c = (_b = (_a = configManager.config) == null ? void 0 : _a.build) == null ? void 0 : _b.host) != null ? _c : false,
784
786
  watch: noWatch ? {
785
787
  ignored: ["**/*"]
786
788
  } : void 0,
@@ -989,7 +991,7 @@ var devServerEndPointsPlugin = ({
989
991
  name: "graphql-endpoints",
990
992
  configureServer(server) {
991
993
  server.middlewares.use((0, import_cors.default)());
992
- server.middlewares.use(import_body_parser.default.json());
994
+ server.middlewares.use(import_body_parser.default.json({ limit: "5mb" }));
993
995
  server.middlewares.use(async (req, res, next) => {
994
996
  var _a;
995
997
  const mediaPaths = (_a = configManager.config.media) == null ? void 0 : _a.tina;
@@ -2110,9 +2112,11 @@ var BuildCommand = class extends import_clipanion2.Command {
2110
2112
  fragDoc
2111
2113
  });
2112
2114
  const apiURL = await codegen2.execute();
2113
- await this.checkClientInfo(configManager, apiURL);
2114
- await waitForDB(configManager.config, apiURL, false);
2115
- await this.checkGraphqlSchema(configManager, database, apiURL);
2115
+ if (!configManager.hasSelfHostedConfig()) {
2116
+ await this.checkClientInfo(configManager, apiURL);
2117
+ await waitForDB(configManager.config, apiURL, false);
2118
+ await this.checkGraphqlSchema(configManager, database, apiURL);
2119
+ }
2116
2120
  await buildProductionSpa(configManager, database, apiURL);
2117
2121
  await import_fs_extra5.default.outputFile(
2118
2122
  configManager.outputGitignorePath,
@@ -2248,22 +2252,34 @@ var BuildCommand = class extends import_clipanion2.Command {
2248
2252
  const remoteGqlSchema = (0, import_graphql10.buildClientSchema)(remoteSchema);
2249
2253
  const localSchemaDocument = await database.getGraphQLSchemaFromBridge();
2250
2254
  const localGraphqlSchema = (0, import_graphql10.buildASTSchema)(localSchemaDocument);
2251
- const diffResult = await (0, import_core2.diff)(localGraphqlSchema, remoteGqlSchema);
2252
- if (diffResult.length === 0) {
2253
- bar2.tick({
2254
- prog: "\u2705"
2255
- });
2256
- } else {
2257
- bar2.tick({
2258
- prog: "\u274C"
2259
- });
2260
- let errorMessage = `The local GraphQL schema doesn't match the remote GraphQL schema. Please push up your changes to Github to update your remote GraphQL schema.`;
2261
- if (config3 == null ? void 0 : config3.branch) {
2262
- errorMessage += `
2255
+ try {
2256
+ const diffResult = await (0, import_core2.diff)(localGraphqlSchema, remoteGqlSchema);
2257
+ if (diffResult.length === 0) {
2258
+ bar2.tick({
2259
+ prog: "\u2705"
2260
+ });
2261
+ } else {
2262
+ bar2.tick({
2263
+ prog: "\u274C"
2264
+ });
2265
+ let errorMessage = `The local GraphQL schema doesn't match the remote GraphQL schema. Please push up your changes to Github to update your remote GraphQL schema.`;
2266
+ if (config3 == null ? void 0 : config3.branch) {
2267
+ errorMessage += `
2263
2268
 
2264
2269
  Additional info: Branch: ${config3.branch}, Client ID: ${config3.clientId} `;
2270
+ }
2271
+ throw new Error(errorMessage);
2272
+ }
2273
+ } catch (e) {
2274
+ if (e.message.startsWith("Cannot use")) {
2275
+ logger.warn(
2276
+ `${warnText(
2277
+ "Skipping schema check due to conflicting GraphQL versions"
2278
+ )}`
2279
+ );
2280
+ } else {
2281
+ throw e;
2265
2282
  }
2266
- throw new Error(errorMessage);
2267
2283
  }
2268
2284
  }
2269
2285
  };
@@ -3790,16 +3806,16 @@ async function initStaticTina({
3790
3806
  );
3791
3807
  let isForestryMigration = false;
3792
3808
  if (hasForestryConfig) {
3793
- const { collectionString, importStatements, templateCodeString } = await forestryMigrate({
3809
+ const res = await forestryMigrate({
3794
3810
  usingTypescript,
3795
3811
  pathToForestryConfig,
3796
3812
  rootPath,
3797
3813
  framework
3798
3814
  });
3799
- if (collectionString) {
3800
- templateCode = templateCodeString;
3801
- collections = collectionString;
3802
- extraText = importStatements;
3815
+ if (res) {
3816
+ templateCode = res.templateCodeString;
3817
+ collections = res.collectionString;
3818
+ extraText = res.importStatements;
3803
3819
  isForestryMigration = true;
3804
3820
  }
3805
3821
  }
@@ -3824,7 +3840,7 @@ async function initStaticTina({
3824
3840
  }
3825
3841
  }
3826
3842
  await addDependencies(packageManager);
3827
- if (hasForestryConfig) {
3843
+ if (isForestryMigration) {
3828
3844
  await addTemplateFile({ baseDir: "", usingTypescript, templateCode });
3829
3845
  }
3830
3846
  await addConfigFile({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/cli",
3
- "version": "1.5.6",
3
+ "version": "1.5.8",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "files": [
@@ -58,11 +58,11 @@
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.6",
62
- "@tinacms/datalayer": "1.2.7",
63
- "@tinacms/graphql": "1.4.7",
61
+ "@tinacms/app": "1.2.8",
62
+ "@tinacms/datalayer": "1.2.8",
63
+ "@tinacms/graphql": "1.4.8",
64
64
  "@tinacms/metrics": "1.0.2",
65
- "@tinacms/schema-tools": "1.4.2",
65
+ "@tinacms/schema-tools": "1.4.3",
66
66
  "@vitejs/plugin-react": "3.1.0",
67
67
  "ajv": "^6.12.3",
68
68
  "altair-express-middleware": "4.0.6",