newspack-scripts 4.3.5-alpha.2 → 4.3.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "newspack-scripts",
3
- "version": "4.3.5-alpha.2",
3
+ "version": "4.3.5",
4
4
  "description": "",
5
5
  "bin": {
6
6
  "newspack-scripts": "./bin/newspack-scripts.js"
package/scripts/build.js CHANGED
@@ -4,27 +4,29 @@ const spawn = require("cross-spawn");
4
4
  const modules = require("./utils/modules");
5
5
  const utils = require("./utils/index.js");
6
6
 
7
- utils.log("Starting to build…");
8
-
7
+ // HACK: For some reason, `@automattic/calypso-build` is erroring with a cryptic
8
+ // `HookWebpackError: error:0308010C:digital envelope routines::unsupported` error.
9
+ // Reinstalling the package in the newspack-scripts directory fixes the issue. No idea how.
10
+ // Downside is longer build times, but maybe this will be fixed in the future.
11
+ utils.log("Reinstalling @automattic/calypso-build…");
9
12
  const calypsoReinstallResult = spawn.sync(
10
- process.execPath,
11
- [
12
- "cd",
13
- "node_modules/newspack-scripts",
14
- "&&",
15
- "npm",
16
- "install",
17
- "--legacy-peer-deps",
18
- ],
13
+ "cd node_modules/newspack-scripts && npm i @automattic/calypso-build --legacy-peer-deps",
14
+ [],
19
15
  {
16
+ shell: true,
20
17
  cwd: modules.rootDirectory,
21
18
  stdio: "inherit",
22
19
  }
23
20
  );
24
21
  if (calypsoReinstallResult.status === 0) {
25
22
  utils.log("Calypso reinstall successful.");
23
+ } else {
24
+ utils.log("Calypso reinstall failed:");
25
+ console.log(calypsoReinstallResult);
26
26
  }
27
27
 
28
+ utils.log("Starting to build…");
29
+
28
30
  const buildResult = spawn.sync(process.execPath, [modules.calypsoBuild], {
29
31
  cwd: modules.rootDirectory,
30
32
  stdio: "inherit",
package/scripts/test.js CHANGED
@@ -7,6 +7,9 @@ const jest = require("jest");
7
7
  const path = require("path");
8
8
 
9
9
  const modules = require("./utils/modules");
10
+ const utils = require("./utils/index.js");
11
+
12
+ utils.log("Starting tests…");
10
13
 
11
14
  let argv = process.argv.slice(2);
12
15
 
@@ -5,6 +5,8 @@ const path = require("path");
5
5
  const modules = require("./utils/modules");
6
6
  const utils = require("./utils/index.js");
7
7
 
8
+ utils.log("Starting TypeScript check…");
9
+
8
10
  const result = spawn.sync(`${process.cwd()}/node_modules/.bin/tsc`, [], {
9
11
  stdio: "inherit",
10
12
  });
package/scripts/watch.js CHANGED
@@ -2,9 +2,12 @@
2
2
 
3
3
  const spawn = require("cross-spawn");
4
4
  const modules = require("./utils/modules");
5
+ const utils = require("./utils/index.js");
6
+
7
+ utils.log("Starting to watch…");
5
8
 
6
9
  spawn.sync(process.execPath, [modules.calypsoBuild, "--watch"], {
7
10
  cwd: modules.rootDirectory,
8
11
  stdio: "inherit",
9
- env: { ...process.env, NODE_ENV: "development" }
12
+ env: { ...process.env, NODE_ENV: "development" },
10
13
  });