newspack-scripts 3.1.1 → 3.2.0
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/bin/newspack-scripts.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const spawn = require("cross-spawn");
|
|
4
|
+
const utils = require("../scripts/utils/index.js");
|
|
4
5
|
|
|
5
6
|
const [scriptName, ...nodeArgs] = process.argv.slice(2);
|
|
6
7
|
|
|
@@ -22,13 +23,13 @@ if (
|
|
|
22
23
|
);
|
|
23
24
|
if (result.signal) {
|
|
24
25
|
if (result.signal === "SIGKILL") {
|
|
25
|
-
|
|
26
|
+
utils.log(
|
|
26
27
|
"The build failed because the process exited too early. " +
|
|
27
28
|
"This probably means the system ran out of memory or someone called " +
|
|
28
29
|
"`kill -9` on the process."
|
|
29
30
|
);
|
|
30
31
|
} else if (result.signal === "SIGTERM") {
|
|
31
|
-
|
|
32
|
+
utils.log(
|
|
32
33
|
"The build failed because the process exited too early. " +
|
|
33
34
|
"Someone might have called `kill` or `killall`, or the system could " +
|
|
34
35
|
"be shutting down."
|
|
@@ -38,5 +39,5 @@ if (
|
|
|
38
39
|
}
|
|
39
40
|
process.exit(result.status);
|
|
40
41
|
} else {
|
|
41
|
-
|
|
42
|
+
utils.log(`Unknown script "${scriptName}".`);
|
|
42
43
|
}
|
package/package.json
CHANGED
package/scripts/release.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const spawn = require("cross-spawn");
|
|
4
4
|
const path = require("path");
|
|
5
|
+
const utils = require("./utils/index.js");
|
|
5
6
|
|
|
6
7
|
const semanticRelease = require("semantic-release");
|
|
7
8
|
|
|
@@ -11,7 +12,7 @@ const { files, ...semanticReleaseArgs } = require("yargs/yargs")(
|
|
|
11
12
|
|
|
12
13
|
const filesList = files.split(",");
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
utils.log(`Releasing ${process.env.CIRCLE_PROJECT_REPONAME}…`);
|
|
15
16
|
|
|
16
17
|
const config = {
|
|
17
18
|
dryRun: semanticReleaseArgs.dryRun,
|
|
@@ -89,21 +90,21 @@ const run = async () => {
|
|
|
89
90
|
if (result) {
|
|
90
91
|
const { lastRelease, commits, nextRelease, releases } = result;
|
|
91
92
|
|
|
92
|
-
|
|
93
|
+
utils.log(
|
|
93
94
|
`Published ${nextRelease.type} release version ${nextRelease.version} containing ${commits.length} commits.`
|
|
94
95
|
);
|
|
95
96
|
|
|
96
97
|
if (lastRelease.version) {
|
|
97
|
-
|
|
98
|
+
utils.log(`The last release was "${lastRelease.version}".`);
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
for (const release of releases) {
|
|
101
|
-
|
|
102
|
+
utils.log(
|
|
102
103
|
`The release was published with plugin "${release.pluginName}".`
|
|
103
104
|
);
|
|
104
105
|
}
|
|
105
106
|
} else {
|
|
106
|
-
|
|
107
|
+
utils.log("No release published.");
|
|
107
108
|
}
|
|
108
109
|
} catch (err) {
|
|
109
110
|
console.error("The automated release failed with %O", err);
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
const spawn = require("cross-spawn");
|
|
4
4
|
const path = require("path");
|
|
5
5
|
const modules = require("./utils/modules");
|
|
6
|
+
const utils = require("./utils/index.js");
|
|
6
7
|
|
|
7
8
|
const result = spawn.sync(`${process.cwd()}/node_modules/.bin/tsc`, [], {
|
|
8
9
|
stdio: "inherit",
|
|
9
10
|
});
|
|
10
11
|
|
|
11
12
|
if (result.status === 0) {
|
|
12
|
-
|
|
13
|
+
utils.log("All good!");
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
process.exit(result.status);
|