newspack-scripts 5.6.0-alpha.7 → 5.6.0-alpha.8
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 +1 -12
- package/package.json +2 -2
- package/scripts/release.js +28 -23
package/README.md
CHANGED
|
@@ -47,15 +47,6 @@ Will validate TypeScript code in the project. This requires a `tsconfig.json` fi
|
|
|
47
47
|
}
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
### proxy
|
|
51
|
-
|
|
52
|
-
Allows you to proxy NPM CLI commands through this repository's dependencies, so if a repository consumes the `newspack-scripts` NPM package, it can access any executables installed as a dependency in [package.json](https://github.com/Automattic/newspack-scripts/blob/trunk/package.json). e.g. `newspack-scripts proxy semantic-release --dry-run` will run `semantic-release --dry-run` but using the executable from `newspack-scripts` instead of whatever repository you're running the command from. This allows for more flexible use of NPM commands where the prefab configs and scripts this repo provides are too opinionated or aren't sufficient.
|
|
53
|
-
|
|
54
|
-
Other examples:
|
|
55
|
-
|
|
56
|
-
- `newspack-scripts proxy eslint 'src/**/*.{js,jsx,ts,tsx}'` will lint all JS/JSX/TS/TSX files inside the `./src` directory.
|
|
57
|
-
- `newspack-scripts proxy stylelint 'src/**/*.scss'` will lint all SCSS files inside the `./src` directory.
|
|
58
|
-
|
|
59
50
|
---
|
|
60
51
|
|
|
61
52
|
## Semantic Release
|
|
@@ -163,10 +154,8 @@ module.exports = {
|
|
|
163
154
|
|
|
164
155
|
### stylelint
|
|
165
156
|
|
|
166
|
-
Use this package's stylelint executable and config file when running it, e.g.:
|
|
167
|
-
|
|
168
157
|
```shell
|
|
169
|
-
newspack-scripts
|
|
158
|
+
newspack-scripts wp-scripts lint-style '**/*.scss' --customSyntax postcss-scss
|
|
170
159
|
```
|
|
171
160
|
|
|
172
161
|
_Note: Due to issue with dependency resolving, you might end up a different version of `prettier` in project's `node_modules` and `node_modules/newspack-scripts/node_modules`. See https://github.com/Automattic/newspack-scripts/issues/1 for more information._
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "newspack-scripts",
|
|
3
|
-
"version": "5.6.0-alpha.
|
|
3
|
+
"version": "5.6.0-alpha.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"bin": {
|
|
6
6
|
"newspack-scripts": "./bin/newspack-scripts.js"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"postcss": "^8.4.38",
|
|
54
54
|
"postcss-focus-within": "^5.0.4",
|
|
55
55
|
"postcss-scss": "^4.0.9",
|
|
56
|
-
"prettier": "
|
|
56
|
+
"prettier": "npm:wp-prettier@^3.0.3",
|
|
57
57
|
"semantic-release": "^19.0.5",
|
|
58
58
|
"semantic-release-version-bump": "^1.4.1",
|
|
59
59
|
"stylelint": "^14.2.0",
|
package/scripts/release.js
CHANGED
|
@@ -18,8 +18,22 @@ if ( shouldPublishOnNPM ) {
|
|
|
18
18
|
utils.log( `Will publish on npm` );
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
const getConfig = (
|
|
22
|
-
const branchType = gitBranchName.split(
|
|
21
|
+
const getConfig = ({ gitBranchName }) => {
|
|
22
|
+
const branchType = gitBranchName.split("/")[0];
|
|
23
|
+
const githubConfig = {
|
|
24
|
+
assets: [
|
|
25
|
+
{
|
|
26
|
+
path: `./release/${process.env.CIRCLE_PROJECT_REPONAME}.zip`,
|
|
27
|
+
label: `${process.env.CIRCLE_PROJECT_REPONAME}.zip`,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// Only post GH PR comments for alpha, hotfix/*, and release branches.
|
|
33
|
+
if ( ! ["alpha", "hotfix", "release"].includes(branchType) ) {
|
|
34
|
+
githubConfig.successComment = false;
|
|
35
|
+
githubConfig.failComment = false;
|
|
36
|
+
}
|
|
23
37
|
|
|
24
38
|
const config = {
|
|
25
39
|
dryRun: otherArgs.dryRun,
|
|
@@ -28,52 +42,43 @@ const getConfig = ( { gitBranchName } ) => {
|
|
|
28
42
|
|
|
29
43
|
branches: [
|
|
30
44
|
// `release` branch is published on the main distribution channel (a new version on GH).
|
|
31
|
-
|
|
45
|
+
"release",
|
|
32
46
|
// `alpha` branch – for regular pre-releases.
|
|
33
47
|
{
|
|
34
|
-
name:
|
|
48
|
+
name: "alpha",
|
|
35
49
|
prerelease: true,
|
|
36
50
|
},
|
|
37
51
|
// `hotfix/*` branches – for releases outside of the release schedule.
|
|
38
52
|
{
|
|
39
|
-
name:
|
|
53
|
+
name: "hotfix/*",
|
|
40
54
|
// With `prerelease: true`, the `name` would be used for the pre-release tag. A name with a `/`
|
|
41
55
|
// is not valid, though. See https://semver.org/#spec-item-9.
|
|
42
56
|
prerelease: '${name.replace(/\\//g, "-")}',
|
|
43
57
|
},
|
|
44
58
|
// `epic/*` branches – for beta testing/QA pre-release builds.
|
|
45
59
|
{
|
|
46
|
-
name:
|
|
60
|
+
name: "epic/*",
|
|
47
61
|
// With `prerelease: true`, the `name` would be used for the pre-release tag. A name with a `/`
|
|
48
62
|
// is not valid, though. See https://semver.org/#spec-item-9.
|
|
49
63
|
prerelease: '${name.replace(/\\//g, "-")}',
|
|
50
64
|
},
|
|
51
65
|
],
|
|
52
|
-
prepare: [
|
|
66
|
+
prepare: ["@semantic-release/changelog", "@semantic-release/npm"],
|
|
53
67
|
plugins: [
|
|
54
|
-
|
|
55
|
-
|
|
68
|
+
"@semantic-release/commit-analyzer",
|
|
69
|
+
"@semantic-release/release-notes-generator",
|
|
56
70
|
[
|
|
57
71
|
// Whether to publish on npm.
|
|
58
|
-
|
|
72
|
+
"@semantic-release/npm",
|
|
59
73
|
{
|
|
60
74
|
npmPublish: shouldPublishOnNPM,
|
|
61
75
|
},
|
|
62
76
|
],
|
|
63
|
-
|
|
77
|
+
"semantic-release-version-bump",
|
|
64
78
|
// Add the built ZIP archive to GH release.
|
|
65
79
|
[
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
assets: [
|
|
69
|
-
{
|
|
70
|
-
path: `./release/${ process.env.CIRCLE_PROJECT_REPONAME }.zip`,
|
|
71
|
-
label: `${ process.env.CIRCLE_PROJECT_REPONAME }.zip`,
|
|
72
|
-
},
|
|
73
|
-
],
|
|
74
|
-
// Only post GH PR comments for alpha, hotfix/*, and release branches.
|
|
75
|
-
successComment: [ 'alpha', 'hotfix', 'release' ].includes( branchType ),
|
|
76
|
-
},
|
|
80
|
+
"@semantic-release/github",
|
|
81
|
+
githubConfig,
|
|
77
82
|
],
|
|
78
83
|
],
|
|
79
84
|
};
|
|
@@ -109,7 +114,7 @@ const getConfig = ( { gitBranchName } ) => {
|
|
|
109
114
|
path: '@semantic-release/git',
|
|
110
115
|
assets,
|
|
111
116
|
message:
|
|
112
|
-
|
|
117
|
+
'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
|
|
113
118
|
} );
|
|
114
119
|
} else {
|
|
115
120
|
utils.log(
|