@tinacms/cli 0.60.19 → 0.60.20

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # tinacms-cli
2
2
 
3
+ ## 0.60.20
4
+
5
+ ### Patch Changes
6
+
7
+ - f71f55ac3: Fixd issue where --dev caused a breaking change
8
+ - Updated dependencies [57f09bdd7]
9
+ - @tinacms/graphql@0.60.5
10
+
3
11
  ## 0.60.19
4
12
 
5
13
  ### Patch Changes
@@ -20,5 +20,6 @@ export declare const compileClient: (ctx: any, next: any, options: {
20
20
  export declare const compileSchema: (_ctx: any, _next: any, options: {
21
21
  schemaFileType?: string;
22
22
  verbose?: boolean;
23
+ dev?: boolean;
23
24
  }) => Promise<void>;
24
25
  export declare const defineSchema: (config: TinaCloudSchema) => TinaCloudSchema;
package/dist/index.js CHANGED
@@ -348,7 +348,7 @@ var commander = __toModule(require("commander"));
348
348
 
349
349
  // pnp:/home/runner/work/tinacms/tinacms/packages/@tinacms/cli/package.json
350
350
  var name = "@tinacms/cli";
351
- var version = "0.60.19";
351
+ var version = "0.60.20";
352
352
 
353
353
  // pnp:/home/runner/work/tinacms/tinacms/packages/@tinacms/cli/src/cmds/query-gen/attachSchema.ts
354
354
  var import_graphql = __toModule(require("@tinacms/graphql"));
@@ -1673,9 +1673,6 @@ var cleanup = async ({ tinaTempPath }) => {
1673
1673
  await import_fs_extra4.default.remove(tinaTempPath);
1674
1674
  };
1675
1675
  var compileClient = async (ctx, next, options) => {
1676
- if (!process.env.NODE_ENV) {
1677
- process.env.NODE_ENV = options.dev ? "development" : "production";
1678
- }
1679
1676
  const tinaTempPath = import_path5.default.join(tinaGeneratedPath, "temp_client");
1680
1677
  if (!options.clientFileType)
1681
1678
  options = __spreadProps(__spreadValues({}, options), { clientFileType: "ts" });
@@ -1703,8 +1700,12 @@ var compileClient = async (ctx, next, options) => {
1703
1700
  return next();
1704
1701
  }
1705
1702
  try {
1703
+ const define = {};
1704
+ if (!process.env.NODE_ENV) {
1705
+ define["process.env.NODE_ENV"] = options.dev ? '"development"' : '"production"';
1706
+ }
1706
1707
  const inputFile = getClientPath({ projectDir: tinaPath });
1707
- await transpile(inputFile, "client.js", tinaTempPath, options.verbose);
1708
+ await transpile(inputFile, "client.js", tinaTempPath, options.verbose, define);
1708
1709
  } catch (e) {
1709
1710
  await cleanup({ tinaTempPath });
1710
1711
  throw new BuildSchemaError(e);
@@ -1761,8 +1762,12 @@ var compileSchema = async (_ctx, _next, options) => {
1761
1762
  await import_fs_extra4.default.writeFile(file, defaultSchema);
1762
1763
  }
1763
1764
  try {
1765
+ const define = {};
1766
+ if (!process.env.NODE_ENV) {
1767
+ define["process.env.NODE_ENV"] = options.dev ? '"development"' : '"production"';
1768
+ }
1764
1769
  const inputFile = getSchemaPath({ projectDir: tinaPath });
1765
- await transpile(inputFile, "schema.js", tinaTempPath, options.verbose);
1770
+ await transpile(inputFile, "schema.js", tinaTempPath, options.verbose, define);
1766
1771
  } catch (e) {
1767
1772
  await cleanup({ tinaTempPath });
1768
1773
  throw new BuildSchemaError(e);
@@ -1787,7 +1792,7 @@ var compileSchema = async (_ctx, _next, options) => {
1787
1792
  throw new ExecuteSchemaError(e);
1788
1793
  }
1789
1794
  };
1790
- var transpile = async (inputFile, outputFile, tempDir, verbose) => {
1795
+ var transpile = async (inputFile, outputFile, tempDir, verbose, define) => {
1791
1796
  if (verbose)
1792
1797
  logger.info(logText("Building javascript..."));
1793
1798
  const packageJSON = JSON.parse(import_fs_extra4.default.readFileSync(packageJSONFilePath).toString() || "{}");
@@ -1804,7 +1809,8 @@ var transpile = async (inputFile, outputFile, tempDir, verbose) => {
1804
1809
  treeShaking: true,
1805
1810
  external: [...external, "./node_modules/*"],
1806
1811
  loader: loaders,
1807
- outfile: outputPath
1812
+ outfile: outputPath,
1813
+ define
1808
1814
  });
1809
1815
  if (verbose)
1810
1816
  logger.info(logText(`Javascript built`));
@@ -1883,9 +1889,6 @@ async function startServer(_ctx, next, {
1883
1889
  if (!process.env.CI && !noWatch) {
1884
1890
  await resetGeneratedFolder();
1885
1891
  }
1886
- if (!process.env.NODE_ENV) {
1887
- process.env.NODE_ENV = dev ? "development" : "production";
1888
- }
1889
1892
  const bridge = new import_datalayer3.FilesystemBridge(rootPath2);
1890
1893
  const store = experimentalData ? new import_datalayer3.LevelStore(rootPath2) : new import_datalayer3.FilesystemStore({ rootPath: rootPath2 });
1891
1894
  const shouldBuild = bridge.supportsBuilding();
@@ -1906,7 +1909,7 @@ async function startServer(_ctx, next, {
1906
1909
  cliFlags.push("tinaCloudMediaStore");
1907
1910
  }
1908
1911
  const database2 = await (0, import_graphql10.createDatabase)({ store, bridge });
1909
- await compileSchema(null, null, { verbose });
1912
+ await compileSchema(null, null, { verbose, dev });
1910
1913
  const schema = await (0, import_graphql10.buildSchema)(rootPath2, database2, cliFlags);
1911
1914
  await genTypes({ schema }, () => {
1912
1915
  }, { noSDK: noSDK2, verbose });
@@ -2199,7 +2202,7 @@ var baseCmds = [
2199
2202
  verboseOption,
2200
2203
  developmentOption
2201
2204
  ],
2202
- action: (options) => chain([compileClient, waitForDB, startServer, startSubprocess], options)
2205
+ action: (options) => chain([startServer, startSubprocess], options)
2203
2206
  },
2204
2207
  {
2205
2208
  command: CMD_WAIT_FOR_DB,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/cli",
3
- "version": "0.60.19",
3
+ "version": "0.60.20",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "files": [
@@ -59,7 +59,7 @@
59
59
  "@graphql-tools/graphql-file-loader": "^7.2.0",
60
60
  "@graphql-tools/load": "^7.3.2",
61
61
  "@tinacms/datalayer": "0.1.1",
62
- "@tinacms/graphql": "0.60.4",
62
+ "@tinacms/graphql": "0.60.5",
63
63
  "@tinacms/metrics": "0.0.3",
64
64
  "@tinacms/schema-tools": "0.0.4",
65
65
  "@yarnpkg/esbuild-plugin-pnp": "^2.0.1-rc.3",