Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove yarn in favor of npm #2443

Merged
merged 23 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tame-turkeys-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/css": patch
---

Remove yarn in favor of npm
11 changes: 6 additions & 5 deletions .github/workflows/axe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ jobs:
if: steps.changed-files.outputs.any_changed == 'true'
uses: actions/setup-node@v3
with:
node-version: 14
- run: yarn
node-version: 18
cache: 'npm'
- run: npm ci
if: steps.changed-files.outputs.any_changed == 'true'
- run: yarn dist
- run: npm run dist
if: steps.changed-files.outputs.any_changed == 'true'
- name: Run docs site
- name: Run docs site
if: steps.changed-files.outputs.any_changed == 'true'
run: |
run: |
npm run dev & npx wait-on http://localhost:8000
- name: Run axe script
if: steps.changed-files.outputs.any_changed == 'true'
Expand Down
52 changes: 21 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,54 +11,44 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
- run: yarn
- run: yarn dist
node-version: 18
cache: 'npm'
- run: npm ci
- run: npm run dist
- name: Lint source files
run: yarn stylelint --fix
run: npx stylelint --fix
- name: Look for unused stylelint:disable lines
run: yarn stylelint -- --report-needless-disables
run: npm run stylelint -- --report-needless-disables
- name: Push up any fixes
if: ${{ github.event_name == 'pull_request' }}
run: |
set +e
git status | grep modified
if [ $? -eq 0 ]
then
set -e
git stash
git remote update
git fetch
git checkout --track origin/$GITHUB_HEAD_REF
git config --local user.email "actions@github.com"
git config --local user.name "Actions Auto Build"
git stash pop
git add src
git commit -m "Stylelint auto-fixes"
git push
else
set -e
echo "No changes since last run"
fi
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Fixing stylelint issues
commit_user_name: GitHub Design Engineering Bot
commit_user_email: primer-css@users.noreply.github.com
commit_author: primer-css <primer-css@users.noreply.github.com>
file_pattern: src/**/*.scss

eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
- run: yarn
node-version: 18
cache: 'npm'
- run: npm ci
- name: Lint workflow files
run: yarn eslint
run: npm run eslint

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
- run: yarn
node-version: 18
cache: 'npm'
- run: npm ci
- name: Jest
run: yarn test
run: npm test
6 changes: 3 additions & 3 deletions .github/workflows/deploy_preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
secrets:
gh_token: ${{ secrets.GITHUB_TOKEN }}
with:
node_version: 14
install: yarn && cd docs && yarn && cd ..
build: yarn build:docs:preview
node_version: 18
install: npm ci && cd docs && npm ci && cd ..
build: npm run build:docs:preview
output_dir: docs/public

deploy-storybook:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
secrets:
gh_token: ${{ secrets.GITHUB_TOKEN }}
with:
node_version: 14
install: yarn && cd docs && yarn && cd ..
build: yarn build:docs
node_version: 18
install: npm ci && cd docs && npm ci && cd ..
build: npm run build:docs
output_dir: docs/public
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,19 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18.x
cache: 'npm'

- name: Install dependencies
run: yarn
run: npm ci

- name: Create release pull request or publish to npm
id: changesets
uses: changesets/action@master
with:
title: Release Tracking
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: yarn release
publish: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GPR_AUTH_TOKEN_SHARED }}
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN_SHARED }}
2 changes: 1 addition & 1 deletion .github/workflows/release_canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
name: Canary
uses: primer/.github/.github/workflows/release_canary.yml@main
with:
install: yarn
install: npm ci
secrets:
gh_token: ${{ secrets.GITHUB_TOKEN }}
npm_token: ${{ secrets.NPM_AUTH_TOKEN_SHARED }}
7 changes: 4 additions & 3 deletions .github/workflows/release_candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18.x
cache: 'npm'

- name: Install dependencies
run: yarn
run: npm ci

- name: Create .npmrc
run: |
Expand All @@ -37,7 +38,7 @@ jobs:
run: |
version=$(jq -r .version package.json)
echo "$( jq ".version = \"$(echo $version)-rc.$(git rev-parse --short HEAD)\"" package.json )" > package.json
yarn publish --tag next
npm publish --tag next
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the correct publish command?

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/welcome.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18.x
cache: 'npm'

- name: Get or Create Comment
uses: actions/github-script@v6
Expand Down Expand Up @@ -45,9 +46,10 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
- run: yarn
- run: yarn pretest
node-version: 18
cache: 'npm'
- run: npm ci
- run: npm run pretest
- name: Reporting bundle sizes
uses: primer/comment-token-update@main
env:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ docs/dist
node_modules/
public/
searchIndex.js
package-lock.json
tmp
yarn.lock
4 changes: 3 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
git-tag-version=false
package-lock=false
legacy-peer-deps=true
no-audit=true
no-fund=true
3 changes: 3 additions & 0 deletions docs/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
legacy-peer-deps=true
no-audit=true
no-fund=true
Loading