Skip to content

Commit

Permalink
feat: migrate from yarn v1 to npm v8 (#825)
Browse files Browse the repository at this point in the history
* build: remove yarn from engines
* build: remove yarn lock file
* chore: npm install
* build: use npm command instead of yarn
* ci(gh-actions): use ubuntu-latest host runner
  • Loading branch information
nogic1008 committed Apr 3, 2023
1 parent aebed30 commit bbc4046
Show file tree
Hide file tree
Showing 8 changed files with 7,522 additions and 2,417 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
]
}
},
"postCreateCommand": "yarn install",
"postCreateCommand": "npm ci",
"remoteUser": "node"
}
10 changes: 5 additions & 5 deletions .github/workflows/compare-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
compare-build-assets:
name: Compare Build Assets
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
# Build on PR branch
- name: Checkout PR branch
Expand All @@ -18,11 +18,11 @@ jobs:
uses: actions/setup-node@v3.6.0
with:
node-version: 16
cache: yarn
cache: npm
- name: Install PR branch dependencies
run: yarn
run: npm ci --ignore-scripts
- name: Build on PR branch
run: yarn build -o current
run: npm run build -o current

# Compare
- name: Checkout main branch
Expand All @@ -31,7 +31,7 @@ jobs:
ref: main
clean: false
- name: Install main branch dependencies
run: yarn
run: npm ci --ignore-scripts
- name: Build on main branch
run: npm run build
- name: Setup js-beautify to compare minified js files
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ jobs:
uses: actions/setup-node@v3.6.0
with:
node-version: 16
cache: yarn
cache: npm

- name: Install Dependencies
run: yarn --frozen-lockfile --ignore-scripts
run: npm ci --ignore-scripts
- name: Lint
run: yarn lint
run: npm run lint
- name: Build
run: yarn build
run: npm run build
- name: Test
run: yarn test --coverage
run: npm test -- --coverage
- name: Report Code Coverage to codecov
uses: codecov/codecov-action@v3.1.1
- name: GitHub Actions Build Test
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ on:
jobs:
release:
name: Release
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Release for GitHub Actions
uses: technote-space/release-github-actions@v8.0.3
with:
BRANCH_NAME: releases/${MAJOR}
BUILD_COMMAND: yarn install --frozen-lockfile --ignore-scripts && yarn build
CLEAN_TARGETS: .[!.]*,__tests__,coverage,lib,node_modules,src,*.js,*.ts,*.json,*.lock,_config.yml
BUILD_COMMAND: npm ci --ignore-scripts && npm run build
CLEAN_TARGETS: .[!.]*,__tests__,coverage,node_modules,src,*.js,*.ts,*.json,*.lock,_config.yml
COMMIT_MESSAGE: 'build: release ${{ github.event.release.tag_name }} via ${{ github.sha }}'
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
npx lint-staged
Loading

0 comments on commit bbc4046

Please sign in to comment.