Skip to content

Commit e1b3f4f

Browse files
jonrohanlangermank
andauthored
Remove yarn in favor of npm (#2443)
* Remove yarn in favor of npm * Create tame-turkeys-laugh.md * Check in package-lock * Revert * Use auto commit action instead * Cache and run npm ci * Change node version to 18 * config legacy-peer-deps * Update node version * Also legacy peer deps in docs * Ignore yarn.lock * no-audit no-fund * I dont know * re-yarn the docs folder * Update pakage-lock.json * package lock * Removing yarn from docs again * Remove docs preview * don't depend on deploy * put back --------- Co-authored-by: Katie Langerman <[email protected]>
1 parent 2c47020 commit e1b3f4f

22 files changed

+26227
-15925
lines changed

.changeset/tame-turkeys-laugh.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/css": patch
3+
---
4+
5+
Remove yarn in favor of npm

.github/workflows/axe.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@ jobs:
3030
if: steps.changed-files.outputs.any_changed == 'true'
3131
uses: actions/setup-node@v3
3232
with:
33-
node-version: 14
34-
- run: yarn
33+
node-version: 18
34+
cache: 'npm'
35+
- run: npm ci
3536
if: steps.changed-files.outputs.any_changed == 'true'
36-
- run: yarn dist
37+
- run: npm run dist
3738
if: steps.changed-files.outputs.any_changed == 'true'
38-
- name: Run docs site
39+
- name: Run docs site
3940
if: steps.changed-files.outputs.any_changed == 'true'
40-
run: |
41+
run: |
4142
npm run dev & npx wait-on http://localhost:8000
4243
- name: Run axe script
4344
if: steps.changed-files.outputs.any_changed == 'true'

.github/workflows/ci.yml

+21-31
Original file line numberDiff line numberDiff line change
@@ -11,54 +11,44 @@ jobs:
1111
- uses: actions/checkout@v3
1212
- uses: actions/setup-node@v3
1313
with:
14-
node-version: 14
15-
- run: yarn
16-
- run: yarn dist
14+
node-version: 18
15+
cache: 'npm'
16+
- run: npm ci
17+
- run: npm run dist
1718
- name: Lint source files
18-
run: yarn stylelint --fix
19+
run: npx stylelint --fix
1920
- name: Look for unused stylelint:disable lines
20-
run: yarn stylelint -- --report-needless-disables
21+
run: npm run stylelint -- --report-needless-disables
2122
- name: Push up any fixes
2223
if: ${{ github.event_name == 'pull_request' }}
23-
run: |
24-
set +e
25-
git status | grep modified
26-
if [ $? -eq 0 ]
27-
then
28-
set -e
29-
git stash
30-
git remote update
31-
git fetch
32-
git checkout --track origin/$GITHUB_HEAD_REF
33-
git config --local user.email "[email protected]"
34-
git config --local user.name "Actions Auto Build"
35-
git stash pop
36-
git add src
37-
git commit -m "Stylelint auto-fixes"
38-
git push
39-
else
40-
set -e
41-
echo "No changes since last run"
42-
fi
24+
uses: stefanzweifel/git-auto-commit-action@v4
25+
with:
26+
commit_message: Fixing stylelint issues
27+
commit_user_name: GitHub Design Engineering Bot
28+
commit_user_email: [email protected]
29+
commit_author: primer-css <[email protected]>
30+
file_pattern: src/**/*.scss
4331

4432
eslint:
4533
runs-on: ubuntu-latest
4634
steps:
4735
- uses: actions/checkout@v3
4836
- uses: actions/setup-node@v3
4937
with:
50-
node-version: 14
51-
- run: yarn
38+
node-version: 18
39+
cache: 'npm'
40+
- run: npm ci
5241
- name: Lint workflow files
53-
run: yarn eslint
42+
run: npm run eslint
5443

5544
test:
5645
runs-on: ubuntu-latest
5746
steps:
5847
- uses: actions/checkout@v3
5948
- uses: actions/setup-node@v3
6049
with:
61-
node-version: 14
62-
- run: yarn
50+
node-version: 18
51+
cache: 'npm'
52+
- run: npm ci
6353
- name: Jest
64-
run: yarn test
54+
run: npm test

.github/workflows/deploy_preview.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ jobs:
1919
secrets:
2020
gh_token: ${{ secrets.GITHUB_TOKEN }}
2121
with:
22-
node_version: 16
23-
install: yarn && cd docs && yarn && cd ..
24-
build: yarn build:docs:preview
22+
node_version: 18
23+
install: npm ci && cd docs && npm ci && cd ..
24+
build: npm run build:docs:preview
2525
output_dir: docs/public
2626

2727
deploy-storybook:

.github/workflows/deploy_production.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
secrets:
4343
gh_token: ${{ secrets.GITHUB_TOKEN }}
4444
with:
45-
node_version: 16
46-
install: yarn && cd docs && yarn && cd ..
47-
build: yarn build:docs
45+
node_version: 18
46+
install: npm ci && cd docs && npm ci && cd ..
47+
build: npm run build:docs
4848
output_dir: docs/public

.github/workflows/release.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,19 @@ jobs:
2121
- name: Set up Node.js
2222
uses: actions/setup-node@v3
2323
with:
24-
node-version: 14.x
24+
node-version: 18.x
25+
cache: 'npm'
2526

2627
- name: Install dependencies
27-
run: yarn
28+
run: npm ci
2829

2930
- name: Create release pull request or publish to npm
3031
id: changesets
3132
uses: changesets/action@master
3233
with:
3334
title: Release Tracking
3435
# This expects you to have a script called release which does a build for your packages and calls changeset publish
35-
publish: yarn release
36+
publish: npm run release
3637
env:
3738
GITHUB_TOKEN: ${{ secrets.GPR_AUTH_TOKEN_SHARED }}
3839
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN_SHARED }}

.github/workflows/release_canary.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
name: Canary
2121
uses: primer/.github/.github/workflows/release_canary.yml@main
2222
with:
23-
install: yarn
23+
install: npm ci
2424
secrets:
2525
gh_token: ${{ secrets.GITHUB_TOKEN }}
2626
npm_token: ${{ secrets.NPM_AUTH_TOKEN_SHARED }}

.github/workflows/release_candidate.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ jobs:
2020
- name: Set up Node.js
2121
uses: actions/setup-node@v3
2222
with:
23-
node-version: 14.x
23+
node-version: 18.x
24+
cache: 'npm'
2425

2526
- name: Install dependencies
26-
run: yarn
27+
run: npm ci
2728

2829
- name: Create .npmrc
2930
run: |
@@ -37,7 +38,7 @@ jobs:
3738
run: |
3839
version=$(jq -r .version package.json)
3940
echo "$( jq ".version = \"$(echo $version)-rc.$(git rev-parse --short HEAD)\"" package.json )" > package.json
40-
yarn publish --tag next
41+
npm publish --tag next
4142
env:
4243
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4344

.github/workflows/welcome.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ jobs:
1313
- name: Set up Node.js
1414
uses: actions/setup-node@v3
1515
with:
16-
node-version: 14.x
16+
node-version: 18.x
17+
cache: 'npm'
1718

1819
- name: Get or Create Comment
1920
uses: actions/github-script@v6
@@ -45,9 +46,10 @@ jobs:
4546
- uses: actions/checkout@v3
4647
- uses: actions/setup-node@v3
4748
with:
48-
node-version: 14
49-
- run: yarn
50-
- run: yarn pretest
49+
node-version: 18
50+
cache: 'npm'
51+
- run: npm ci
52+
- run: npm run pretest
5153
- name: Reporting bundle sizes
5254
uses: primer/comment-token-update@main
5355
env:

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ docs/dist
1313
node_modules/
1414
public/
1515
searchIndex.js
16-
package-lock.json
1716
tmp
17+
yarn.lock

.npmrc

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
git-tag-version=false
2-
package-lock=false
2+
legacy-peer-deps=true
3+
no-audit=true
4+
no-fund=true

0 commit comments

Comments
 (0)