Skip to content

Commit

Permalink
chore: upgrade to yarn 4
Browse files Browse the repository at this point in the history
  • Loading branch information
nzh63 committed Apr 16, 2024
1 parent 4f31c66 commit 209c653
Show file tree
Hide file tree
Showing 7 changed files with 8,008 additions and 5,452 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/build.yml
Expand Up @@ -21,21 +21,18 @@ jobs:
- uses: actions/checkout@v4

- name: Use Node.js 18.x
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 18

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $ENV:GITHUB_OUTPUT
- name: Enable Corepack
run: corepack enable

- uses: actions/cache@v3
id: yarn-cache
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.arch }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.arch }}-yarn-
node-version: 18
cache: yarn

- run: yarn install --frozen-lockfile

Expand Down
24 changes: 13 additions & 11 deletions .github/workflows/codeql-analysis.yml
Expand Up @@ -30,27 +30,29 @@ jobs:
fetch-depth: 0

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3
if: ${{ matrix.language == 'javascript' }}

- name: Setup
- name: Use Node.js 20.x
if: ${{ matrix.language == 'cpp' }}
run: |
yarn global add node-gyp
yarn global bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
uses: actions/setup-node@v4
with:
node-version: 20

- name: Build
if: ${{ matrix.language == 'cpp' }}
run: |
node-gyp -C native/cli configure --arch=ia32
node-gyp -C native/cli build -j max
node-gyp -C native/addons configure
node-gyp -C native/addons build -j max
corepack enable
yarn install --frozen-lockfile
yarn node-gyp -C native/cli configure --arch=ia32
yarn node-gyp -C native/cli build -j max
yarn node-gyp -C native/addons configure
yarn node-gyp -C native/addons build -j max
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
19 changes: 8 additions & 11 deletions .github/workflows/release.yml
Expand Up @@ -20,21 +20,18 @@ jobs:
- uses: actions/checkout@v4

- name: Use Node.js 18.x
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 18

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $ENV:GITHUB_OUTPUT
- name: Enable Corepack
run: corepack enable

- uses: actions/cache@v3
id: yarn-cache
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.arch }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.arch }}-yarn-
node-version: 18
cache: yarn

- run: yarn install --frozen-lockfile

Expand Down
14 changes: 14 additions & 0 deletions .gitignore
Expand Up @@ -7,3 +7,17 @@ dist-ssr
static/lib
static/lang-data
static/native

.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Swap the comments on the following lines if you wish to use zero-installs
# In that case, don't forget to run `yarn config set enableGlobalCache false`!
# Documentation here: https://yarnpkg.com/features/caching#zero-installs

#!.yarn/cache
.pnp.*
1 change: 1 addition & 0 deletions .yarnrc.yml
@@ -0,0 +1 @@
nodeLinker: node-modules
7 changes: 4 additions & 3 deletions package.json
Expand Up @@ -22,8 +22,7 @@
"dev": "node ./config/build.js dev",
"download:dep": "node ./config/build.js download-dependencies",
"lint": "eslint . --ignore-path .gitignore --ext .ts,.js,.vue --fix",
"pretest": "yarn build:test",
"test": "electron-mocha --colors --require source-map-support/register ./dist/test",
"test": "yarn build:test && electron-mocha --colors --require source-map-support/register ./dist/test",
"type-check": "tsc --noEmit"
},
"dependencies": {
Expand Down Expand Up @@ -75,6 +74,7 @@
"magic-string": "^0.25.7",
"mocha": "^9.2.0",
"node-gyp": "^9.0.0",
"openai": "^4.33.1",
"remove": "^0.1.5",
"rollup": "^2.71.1",
"rollup-plugin-copy": "^3.5.0",
Expand All @@ -94,5 +94,6 @@
"vue": "^3.2.33",
"vue-router": "^4.0.11",
"yauzl": "^2.10.0"
}
},
"packageManager": "yarn@4.1.1"
}

0 comments on commit 209c653

Please sign in to comment.