newspack-scripts 3.1.1-alpha.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.
@@ -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
- console.log(
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
- console.log(
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
- console.log(`Unknown script "${scriptName}".`);
42
+ utils.log(`Unknown script "${scriptName}".`);
42
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "newspack-scripts",
3
- "version": "3.1.1-alpha.1",
3
+ "version": "3.2.0",
4
4
  "description": "",
5
5
  "bin": {
6
6
  "newspack-scripts": "./bin/newspack-scripts.js"
package/post-release.sh CHANGED
@@ -35,7 +35,6 @@ fi
35
35
  echo '[newspack-scripts] Merging the release branch into master'
36
36
  git checkout master
37
37
  # Merge release branch into master branch, prefering the changes from release branch if conflicts arise.
38
- git merge release --strategy-option=theirs
39
- git commit --message "chore(release): merge in release $LATEST_VERSION_TAG"
38
+ git merge --no-ff release --strategy-option=theirs -m "chore(release): merge in release $LATEST_VERSION_TAG"
40
39
  # Push updated master upstream.
41
40
  git push "https://$GITHUB_TOKEN@github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git"
@@ -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
- console.log(`Releasing ${process.env.CIRCLE_PROJECT_REPONAME}…`);
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
- console.log(
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
- console.log(`The last release was "${lastRelease.version}".`);
98
+ utils.log(`The last release was "${lastRelease.version}".`);
98
99
  }
99
100
 
100
101
  for (const release of releases) {
101
- console.log(
102
+ utils.log(
102
103
  `The release was published with plugin "${release.pluginName}".`
103
104
  );
104
105
  }
105
106
  } else {
106
- console.log("No release published.");
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
- console.log("All good!");
13
+ utils.log("All good!");
13
14
  }
14
15
 
15
16
  process.exit(result.status);
@@ -0,0 +1,11 @@
1
+ const { version } = require("../../package.json");
2
+
3
+ const log = (content, type) => {
4
+ console.log(
5
+ `[newspack-scripts@${version}]${type ? `[${type}]` : ""} ${content}`
6
+ );
7
+ };
8
+
9
+ module.exports = {
10
+ log,
11
+ };