Skip to content

Commit

Permalink
Remove yarn in favor of npm (#2443)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
jonrohan and langermank authored Jul 13, 2023
1 parent 2c47020 commit e1b3f4f
Show file tree
Hide file tree
Showing 22 changed files with 26,227 additions and 15,925 deletions.
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 "[email protected]"
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: [email protected]
commit_author: primer-css <[email protected]>
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: 16
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: 16
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
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
Loading

1 comment on commit e1b3f4f

@sapiendummy
Copy link

Choose a reason for hiding this comment

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

CHange the goal of your life

Please sign in to comment.