@html-validate/release-scripts 3.3.0 → 3.4.3

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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Various scripts used by release toolchain.
4
4
 
5
- ## `release-prepack` and `release-postpack`
5
+ ## `release-pre{pack,publish}` and `release-post{pack,publish}`
6
6
 
7
7
  `package.json`:
8
8
 
@@ -11,6 +11,8 @@ Various scripts used by release toolchain.
11
11
  "scripts": {
12
12
  "prepack": "release-prepack package.json",
13
13
  "postpack": "release-postpack package.json"
14
+ "prepublishOnly": "release-prepublish package.json",
15
+ "postpublish": "release-postpublish package.json"
14
16
  }
15
17
  }
16
18
  ```
package/lib/postpack.js CHANGED
@@ -3,6 +3,12 @@
3
3
  const path = require("path");
4
4
  const fs = require("fs");
5
5
 
6
+ /* ensure this script runs via the correct lifecycle event */
7
+ const { npm_command: command, npm_lifecycle_event: event } = process.env; // eslint-disable-line camelcase
8
+ if (command === "publish" && event === "postpack") {
9
+ process.exit(0);
10
+ }
11
+
6
12
  const filename = process.argv[2];
7
13
  const filepath = path.resolve(filename);
8
14
  const origfile = `${filepath}.orig`;
package/lib/prepack.js CHANGED
@@ -5,6 +5,12 @@ const fs = require("fs");
5
5
  const { filterDependencies } = require("./filter-dependencies");
6
6
  const { stripFields } = require("./strip-fields");
7
7
 
8
+ /* ensure this script runs via the correct lifecycle event */
9
+ const { npm_command: command, npm_lifecycle_event: event } = process.env; // eslint-disable-line camelcase
10
+ if (command === "publish" && event === "prepack") {
11
+ process.exit(0);
12
+ }
13
+
8
14
  const filename = process.argv[2];
9
15
  const filepath = path.resolve(filename);
10
16
  const tmpfile = `${filepath}.tmp`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@html-validate/release-scripts",
3
- "version": "3.3.0",
3
+ "version": "3.4.3",
4
4
  "description": "Various script used by release toolchain",
5
5
  "keywords": [
6
6
  "release"
@@ -17,8 +17,10 @@
17
17
  "license": "MIT",
18
18
  "author": "David Sveningsson <ext@sidvind.com>",
19
19
  "bin": {
20
+ "release-prepublish": "scripts/prepack",
21
+ "release-prepack": "scripts/prepack",
20
22
  "release-postpack": "scripts/postpack",
21
- "release-prepack": "scripts/prepack"
23
+ "release-postpublish": "scripts/postpack"
22
24
  },
23
25
  "files": [
24
26
  "lib",
@@ -36,5 +38,5 @@
36
38
  "publishConfig": {
37
39
  "access": "public"
38
40
  },
39
- "gitHead": "e0f7962305559737b4ceab5e95e65b6642dbbcb0"
41
+ "gitHead": "f14f12b2be0e76be0ee4436f7a19d9ecb5039186"
40
42
  }
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ require("../lib/postpack");
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ require("../lib/prepack");