Skip to content

Commit c6754a7

Browse files
authored
Merge pull request #846 from spotify/release
Release 12.0.0
2 parents 9f95437 + 77170e4 commit c6754a7

File tree

24 files changed

+2679
-4385
lines changed

24 files changed

+2679
-4385
lines changed

.github/workflows/publish-develop.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
2121
- uses: actions/setup-node@v2
2222
with:
23-
node-version: 14
23+
node-version: 16.9
2424
- name: yarn install
25-
run: yarn
25+
run: yarn install --frozen-lockfile
2626
- name: yarn build
2727
run: yarn build
2828
- name: lint

.github/workflows/publish-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
2121
- uses: actions/setup-node@v2
2222
with:
23-
node-version: 14
23+
node-version: 16.9
2424
- name: yarn install
25-
run: yarn
25+
run: yarn install --frozen-lockfile
2626
- name: yarn build
2727
run: yarn build
2828
- name: lint

.github/workflows/publish.yml

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,35 @@ name: Publish
33
on:
44
push:
55
branches:
6-
- master
6+
- master
77

88
jobs:
99
publish:
1010
name: Publish
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v2
15-
- uses: actions/setup-node@v2
16-
with:
17-
node-version: 14
18-
- name: yarn install
19-
run: yarn
20-
- name: yarn build
21-
run: yarn build
22-
- name: lint
23-
run: yarn lint
24-
- name: test
25-
run: yarn test
26-
- name: release
27-
run: yarn release
28-
env:
29-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
30-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
31-
GH_USERNAME: ${{ secrets.GH_USERNAME }}
14+
- uses: actions/checkout@v2
15+
with:
16+
# pulls all commits (needed for lerna / semantic release to correctly version)
17+
fetch-depth: '0'
18+
# pulls all tags (needed for lerna / semantic release to correctly version)
19+
- name: fetch tags
20+
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
21+
- uses: actions/setup-node@v2
22+
with:
23+
node-version: 16.9
24+
- name: yarn install
25+
run: yarn install --frozen-lockfile
26+
- name: yarn build
27+
run: yarn build
28+
- name: lint
29+
run: yarn lint
30+
- name: test
31+
run: yarn test
32+
- name: release
33+
run: yarn release
34+
env:
35+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
36+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
37+
GH_USERNAME: ${{ secrets.GH_USERNAME }}

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
strategy:
1717
matrix:
18-
node-version: [12.x, 14.x]
18+
node-version: [14.17, 16.9]
1919

2020
steps:
2121
- uses: actions/checkout@v2
@@ -26,7 +26,7 @@ jobs:
2626
with:
2727
node-version: ${{ matrix.node-version }}
2828
- name: yarn install
29-
run: yarn
29+
run: yarn install --frozen-lockfile
3030
- name: yarn build
3131
run: yarn build
3232
- name: lint

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn web-scripts commitmsg --edit="$1"

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn web-scripts precommit --no-tests --no-typecheck

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lts/*

README.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ It is intended to be used within a project as a series of npm scripts.
2222
```json
2323
{
2424
"devDependencies": {
25-
"@spotify/web-scripts": "^11.0.0",
26-
"husky": "^4.3.8"
25+
"@spotify/web-scripts": "^12.0.0",
26+
"husky": "^7.0.0"
2727
},
2828
"scripts": {
2929
"build": "web-scripts build",
@@ -32,17 +32,24 @@ It is intended to be used within a project as a series of npm scripts.
3232
"lint": "web-scripts lint",
3333
"commit": "web-scripts commit",
3434
"release": "web-scripts release",
35-
"prepare": "web-scripts audit"
36-
},
37-
"husky": {
38-
"hooks": {
39-
"pre-commit": "web-scripts precommit",
40-
"commit-msg": "web-scripts commitmsg"
41-
}
35+
"prepare": "husky install && web-scripts audit"
4236
}
4337
}
4438
```
4539

40+
Additionally, you'll need to run the following two commands to create the commit and pre-commit hooks:
41+
42+
```shell
43+
npx husky set .husky/pre-commit 'yarn web-scripts precommit --no-tests --no-typecheck'
44+
45+
npx husky set .husky/commit-msg 'yarn web-scripts commitmsg --edit="$1"' && \
46+
sed 's/edit=""/edit="$1"/g' .husky/commit-msg | tee .husky/commit-msg
47+
```
48+
49+
NOTE: the second command uses sed to hack around [this bug in husky](https://github.com/typicode/husky/issues/1019) that removes `$1`.
50+
51+
You'll want to add and commit the `.husky` directory.
52+
4653
View the [full CLI documentation](./packages/web-scripts) for more details on how to get started.
4754

4855
### Create a new library

package.json

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,17 @@
1414
"format": "web-scripts format",
1515
"commit": "web-scripts commit",
1616
"bootstrap": "lerna bootstrap --use-workspaces",
17-
"release": "./release.sh"
17+
"release": "./release.sh",
18+
"prepare": "husky install"
1819
},
1920
"workspaces": [
2021
"packages/*"
2122
],
2223
"devDependencies": {
2324
"@spotify/eslint-config-oss": "^1.0.0",
24-
"@spotify/eslint-plugin": "^10.0.0",
25-
"husky": "^4.0.0",
25+
"@spotify/eslint-plugin": "^11.0.0",
26+
"husky": "^7.0.0",
2627
"lerna": "^4.0.0",
2728
"typescript": "^4.2.3"
28-
},
29-
"husky": {
30-
"hooks": {
31-
"commit-msg": "web-scripts commitmsg",
32-
"pre-commit": "web-scripts precommit --no-tests --no-typecheck"
33-
}
3429
}
3530
}

packages/create-web-scripts-library/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@
4242
},
4343
"devDependencies": {
4444
"@spotify/web-scripts": "^11.0.0",
45-
"@types/fs-extra": "^9.0.1",
45+
"@types/fs-extra": "^9.0.13",
4646
"tempy": "^1.0.1"
4747
},
4848
"publishConfig": {
4949
"access": "public"
5050
},
5151
"engines": {
52-
"node": ">=12.0.0"
52+
"node": ">=14.17.0"
5353
}
5454
}

0 commit comments

Comments
 (0)