Skip to content

Commit

Permalink
[chore]: Upgrade to yarn 4 (#2610)
Browse files Browse the repository at this point in the history
- Upgrade default yarn version to Yarn 4.4.0 https://yarnpkg.com/blog/release/4.0
- Add .yarnrc.yml
- Add volta
- Add packageManager to package.json
- Fix github workflows
- Fix netlify build and deploy
- Future work might needed to fix npm publish workflow

To Update your local master: run yarn cache clean and yarn install and yarn bootstrap for a fresh install
---------

Signed-off-by: Shan He <[email protected]>
  • Loading branch information
heshan0131 authored Aug 23, 2024
1 parent a06d03c commit 7b512cf
Show file tree
Hide file tree
Showing 42 changed files with 68,210 additions and 18,547 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/build-publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Use Node.js 12.x
uses: actions/setup-node@v3
with:
node-version: 18.x
registry-url: https://registry.npmjs.org/
# use Volta to manage yarn/node versions
- uses: volta-cli/action@v4

- name: Set up Python 3.9
uses: actions/setup-python@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm install -g yarn
- run: yarn
- run: yarn bootstrap
- run: npm i -g [email protected]
- run: npm --version && npm publish --workspaces --access public
env:
Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,18 @@ jobs:
node-version: [18.x]

steps:
- uses: actions/[email protected]

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- uses: actions/checkout@v4
# use Volta to manage yarn/node versions
- uses: volta-cli/action@v4

- name: Install XVFB
run: sudo apt-get install xvfb

- name: Install YARN
run: npm install -g yarn
- name: Install Dependencies
run: yarn install && yarn bootstrap

- name: Install Dependecies
run: yarn global add "puppeteer@19.11.1" && yarn
# - name: Install Puppeteer
# run: yarn dlx "puppeteer@23.1.0"

- name: Lint
run: yarn lint
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ umd/

typedoc/

*/**/yarn.lock
examples/**/yarn.lock
!examples/demo-app/yarn.lock

yarn-error.log
*/**/package-lock.json
package-lock.json
Expand Down
4 changes: 4 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# https://yarnpkg.com/configuration/yarnrc
nodeLinker: node-modules
# Define the registry to use when fetching packages.
npmRegistryServer: 'https://registry.yarnpkg.com'
8 changes: 4 additions & 4 deletions babel-register.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ require('@babel/polyfill');
var path = require('path');
var glob = require('glob');

// Requiring mapbox-gl here prevents polyfilling errors during tests.
// Requiring mapbox-gl here prevents polyfill errors during tests.
require('mapbox-gl');

// eslint-disable-next-line func-names
process.argv.slice(2).forEach(function(arg) {
process.argv.slice(2).forEach(function (arg) {
// eslint-disable-next-line func-names
glob(arg, function(er, files) {
glob(arg, function (er, files) {
if (er) throw er;

// eslint-disable-next-line func-names
files.forEach(function(file) {
files.forEach(function (file) {
require(path.resolve(process.cwd(), file));
});
});
Expand Down
1 change: 0 additions & 1 deletion bindings/kepler.gl-jupyter/js/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ dist/
temp.*
babel/

yarn.lock
yarn-error.log
package-lock.json
17 changes: 10 additions & 7 deletions bindings/kepler.gl-jupyter/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,27 @@
"start": "NODE_ENV=development webpack --config ./webpack/dev.js --mode development --watch --progress",
"clean": "rimraf dist/ && rimraf ../keplergl/static/",
"cleanall": "npm run clean && rimraf node_modules/",
"prepublish": "NODE_OPTIONS=--openssl-legacy-provider yarn build && yarn build:lab",
"prepublishOnly": "NODE_OPTIONS=--openssl-legacy-provider yarn build && yarn build:lab",
"build": "NODE_OPTIONS=--openssl-legacy-provider npm run clean && npm run build:lab && webpack --config ./webpack/build.js && jupyter labextension build .",
"build:lab": "NODE_OPTIONS=--openssl-legacy-provider rimraf babel/ && mkdir babel && babel lib --out-dir babel",
"test": "echo \"Error: no test specified\" && exit 1",
"lint": "eslint lib webpack --fix",
"prettier": "prettier --config ./.prettierrc --print-width 80 --single-quote --write lib/**/*.js"
},
"devDependencies": {
"apache-arrow": "^13.0.0",
"@babel/cli": "7.4.4",
"@babel/core": "^7.12.1",
"@babel/plugin-transform-class-properties": "^7.12.1",
"@babel/plugin-transform-export-namespace-from": "^7.12.1",
"@babel/plugin-transform-optional-chaining": "^7.12.1",
"@babel/plugin-transform-modules-commonjs": "^7.12.1",
"@babel/plugin-transform-optional-chaining": "^7.12.1",
"@babel/plugin-transform-runtime": "^7.12.1",
"@babel/plugin-transform-typescript": "^7.16.8",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@babel/preset-typescript": "^7.16.7",
"@jupyterlab/builder": "^4.0.0",
"apache-arrow": "^13.0.0",
"babel-eslint": "^9.0.0",
"babel-loader": "^8.0.0",
"babel-plugin-search-and-replace": "^1.0.0",
Expand Down Expand Up @@ -75,8 +75,8 @@
"@kepler.gl/components": "^3.0.0",
"@kepler.gl/processors": "^3.0.0",
"@kepler.gl/reducers": "^3.0.0",
"@kepler.gl/styles": "^3.0.0",
"@kepler.gl/schemas": "^3.0.0",
"@kepler.gl/styles": "^3.0.0",
"@loaders.gl/arrow": "^4.1.0",
"@loaders.gl/core": "^4.1.0",
"@loaders.gl/csv": "^4.1.0",
Expand Down Expand Up @@ -111,9 +111,12 @@
}
}
},
"packageManager": "[email protected]",
"engines": {
"node": ">=18"
},
"volta": {
"node": "18.18.2",
"yarn": "1.22.17"
}
"yarn": "4.4.0"
},
"packageManager": "[email protected]"
}
Loading

0 comments on commit 7b512cf

Please sign in to comment.