newspack-scripts 5.0.0 → 5.1.1

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
@@ -73,7 +73,7 @@ The following assumes that CI will run:
73
73
  ### Hotfix release flow
74
74
 
75
75
  1. Create a new `hotfix/*` branch off the `release` branch
76
- 1. Push the branch to Github, so the CI can process it – _don't create a PR just yet!*_
76
+ 1. Push the branch to Github, so the CI can process it – _don't create a PR just yet!\*_
77
77
  1. A new "hotfix" pre-release (e.g. `1.2.0-hotfix.1`) will be published
78
78
  1. Merge the hotfix branch into `release` to create a release
79
79
  1. `alpha` & `master` branches will be updated with the changes from the `release` branch
@@ -91,13 +91,13 @@ This package exposes a couple of configuration files.
91
91
  The `webpack.config.js` file should use this package's config-extending function:
92
92
 
93
93
  ```js
94
- const getBaseWebpackConfig = require( 'newspack-scripts/config/getWebpackConfig' );
94
+ const getBaseWebpackConfig = require("newspack-scripts/config/getWebpackConfig");
95
95
 
96
96
  const webpackConfig = getBaseWebpackConfig(
97
97
  { WP: true },
98
98
  {
99
99
  entry: {
100
- 'some-script': './src/some-script.js'
100
+ "some-script": "./src/some-script.js",
101
101
  },
102
102
  }
103
103
  );
@@ -110,10 +110,10 @@ module.exports = webpackConfig;
110
110
  A basic `babel.config.js`:
111
111
 
112
112
  ```js
113
- module.exports = api => {
114
- api.cache( true );
113
+ module.exports = (api) => {
114
+ api.cache(true);
115
115
  return {
116
- extends: 'newspack-scripts/config/babel.config.js',
116
+ extends: "newspack-scripts/config/babel.config.js",
117
117
  };
118
118
  };
119
119
  ```
@@ -123,10 +123,10 @@ module.exports = api => {
123
123
  Because of eslint's [issue](https://github.com/eslint/eslint/issues/3458) with resolving dependencies of extended configurations, a patch has to be used to use this config in a stand-alone fashion: install `@rushstack/eslint-patch` and set up the `.eslintrc.js` like so:
124
124
 
125
125
  ```js
126
- require( '@rushstack/eslint-patch/modern-module-resolution' );
126
+ require("@rushstack/eslint-patch/modern-module-resolution");
127
127
 
128
128
  module.exports = {
129
- extends: [ './node_modules/newspack-scripts/config/eslintrc.js' ],
129
+ extends: ["./node_modules/newspack-scripts/config/eslintrc.js"],
130
130
  // Additional options…
131
131
  };
132
132
  ```
@@ -155,7 +155,7 @@ This repository hosts a [CircleCI Orb](https://circleci.com/docs/2.0/orb-intro),
155
155
  version: 2.1
156
156
 
157
157
  orbs:
158
- newspack: adekbadek/newspack@1.0.0
158
+ newspack: newspack/newspack@1.0.0
159
159
 
160
160
  workflows:
161
161
  version: 2
@@ -170,9 +170,11 @@ To update the Orb, use [CircleCI's CLI's](https://circleci.com/docs/2.0/local-cl
170
170
 
171
171
  ```bash
172
172
  # Replace the `version` at the end (e.g. 1.0.1)
173
- circleci orb pack src/ > orb.yml && circleci orb publish orb.yml adekbadek/newspack@version
173
+ circleci orb pack src/ > orb.yml && circleci orb publish orb.yml newspack/newspack@version
174
174
  ```
175
175
 
176
+ Note that before the first time updating you'll need to set the API key for CircleCI CLI by running `$ circleci setup`.
177
+
176
178
  ---
177
179
 
178
180
  ## Misc
@@ -13,6 +13,7 @@ module.exports = {
13
13
  "at-rule-no-unknown": null,
14
14
  "alpha-value-notation": null,
15
15
  "color-function-notation": null,
16
+ "selector-not-notation": null,
16
17
  "function-no-unknown": [
17
18
  true,
18
19
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "newspack-scripts",
3
- "version": "5.0.0",
3
+ "version": "5.1.1",
4
4
  "description": "",
5
5
  "bin": {
6
6
  "newspack-scripts": "./bin/newspack-scripts.js"
package/post-release.sh CHANGED
@@ -11,24 +11,40 @@ SECOND_TO_LAST_COMMIT_MSG=$(git log -n 1 --skip 1 --pretty=format:"%s")
11
11
 
12
12
  LATEST_VERSION_TAG=$(git describe --tags --abbrev=0)
13
13
 
14
+ git pull origin release
15
+ git checkout alpha
16
+
14
17
  # If the merge was from alpha branch (the basic flow), alpha branch should be reset.
15
18
  if [[ $(echo $SECOND_TO_LAST_COMMIT_MSG | grep '^Merge .*alpha') ]]; then
16
19
  echo '[newspack-scripts] Release was created from the alpha branch. Alpha branch will now be reset.'
17
20
 
18
21
  # Reset the tip of alpha branch to the release branch.
19
- # The alpha brach is single-serving, just for alpha releases. After a release,
22
+ # The alpha branch is single-serving, just for alpha releases. After a release,
20
23
  # we don't care about any alpha changes.
21
- git pull origin release
22
- git checkout alpha
23
24
  git reset --hard release --
24
25
  # Force-push the alpha branch.
25
26
  git push "https://$GITHUB_TOKEN@github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git" --force
26
27
  else
27
28
  echo '[newspack-scripts] Release was created from a different branch than the alpha branch (e.g. a hotfix branch).'
28
29
  echo '[newspack-scripts] Alpha branch will now be updated with the lastest changes from release.'
29
- git checkout alpha
30
- git merge release --strategy-option=theirs --message="Merge release into alpha"
31
- git push "https://$GITHUB_TOKEN@github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git"
30
+ git merge --no-ff release -m "chore(release): merge in release $LATEST_VERSION_TAG"
31
+ if [[ $? == 0 ]]; then
32
+ git push "https://$GITHUB_TOKEN@github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git"
33
+ else
34
+ git merge --abort
35
+ echo '[newspack-scripts] Post-release merge to alpha failed.'
36
+ if [ -z "$SLACK_CHANNEL_ID" ] || [ -z "$SLACK_AUTH_TOKEN" ]; then
37
+ echo '[newspack-scripts] Missing Slack channel ID and/or token. Cannot notify.'
38
+ else
39
+ echo '[newspack-scripts] Notifying the team on Slack.'
40
+ curl \
41
+ --data "{\"channel\":\"$SLACK_CHANNEL_ID\",\"blocks\":[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"⚠️ Post-release merge to alpha failed for: \`$CIRCLE_PROJECT_REPONAME\`. Check <$CIRCLE_BUILD_URL|the build> for details.\"}}]}" \
42
+ -H "Content-type: application/json" \
43
+ -H "Authorization: Bearer $SLACK_AUTH_TOKEN" \
44
+ -X POST https://slack.com/api/chat.postMessage \
45
+ -s > /dev/null
46
+ fi
47
+ fi
32
48
  fi
33
49
 
34
50
  # Update master branch with latest changes from the release branch, so they are in sync.
@@ -48,7 +64,7 @@ else
48
64
  else
49
65
  echo '[newspack-scripts] Notifying the team on Slack.'
50
66
  curl \
51
- --data "{\"channel\":\"$SLACK_CHANNEL_ID\",\"blocks\":[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"⚠️ Post-release merge failed for: \`$CIRCLE_PROJECT_REPONAME\`. Check <$CIRCLE_BUILD_URL|the build> for details.\"}}]}" \
67
+ --data "{\"channel\":\"$SLACK_CHANNEL_ID\",\"blocks\":[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"⚠️ Post-release merge to master failed for: \`$CIRCLE_PROJECT_REPONAME\`. Check <$CIRCLE_BUILD_URL|the build> for details.\"}}]}" \
52
68
  -H "Content-type: application/json" \
53
69
  -H "Authorization: Bearer $SLACK_AUTH_TOKEN" \
54
70
  -X POST https://slack.com/api/chat.postMessage \