Skip to content

Commit 8edce23

Browse files
authored
build: upgrade package manager (#142)
* build: upgrade pnpm to 9.7.0 and abandon yarn * chore: remove useless dependencies and upgrade some * ci: update ci.yml * ci: update ci.yml * chore: add packages keywords
1 parent 3e78633 commit 8edce23

File tree

16 files changed

+4558
-11478
lines changed

16 files changed

+4558
-11478
lines changed

.github/workflows/ci.yml

Lines changed: 89 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,98 @@
1-
name: CI
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
23

3-
on: [push, pull_request]
4+
name: Node.js CI
5+
6+
on:
7+
push:
8+
branches: [main, next]
9+
pull_request:
10+
branches: [main, next]
411

512
jobs:
6-
ci:
7-
name: CI
13+
check:
814
runs-on: ubuntu-latest
9-
env:
10-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
strategy:
16+
matrix:
17+
node-version: [18.x, 20.x]
18+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Install pnpm
25+
uses: pnpm/action-setup@v4.0.0
26+
with:
27+
version: 9.7.0
28+
29+
- name: Use Node.js ${{ matrix.node-version }}
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: ${{ matrix.node-version }}
33+
cache: 'pnpm'
34+
35+
- name: Install dependencies
36+
run: pnpm install --frozen-lockfile
37+
38+
- name: Run prettier check
39+
run: pnpm prettier-check
40+
41+
- name: Run tsc check
42+
run: pnpm check-types
43+
44+
test:
45+
runs-on: ubuntu-latest
46+
strategy:
47+
matrix:
48+
node-version: [18.x, 20.x]
49+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
50+
1151
steps:
12-
- uses: actions/checkout@v2
52+
- name: Checkout
53+
uses: actions/checkout@v4
54+
55+
- name: Install pnpm
56+
uses: pnpm/action-setup@v4.0.0
57+
with:
58+
version: 9.7.0
59+
60+
- name: Use Node.js ${{ matrix.node-version }}
61+
uses: actions/setup-node@v4
62+
with:
63+
node-version: ${{ matrix.node-version }}
64+
cache: 'pnpm'
65+
66+
- name: Install dependencies
67+
run: pnpm install --frozen-lockfile
68+
69+
- name: Run Units Test
70+
run: pnpm test
71+
72+
build:
73+
runs-on: ubuntu-latest
74+
strategy:
75+
matrix:
76+
node-version: [18.x, 20.x]
77+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
78+
79+
steps:
80+
- name: Checkout
81+
uses: actions/checkout@v4
82+
83+
- name: Install pnpm
84+
uses: pnpm/action-setup@v4.0.0
85+
with:
86+
version: 9.7.0
1387

14-
- uses: actions/setup-node@v2
88+
- name: Use Node.js ${{ matrix.node-version }}
89+
uses: actions/setup-node@v4
1590
with:
16-
node-version: 18.x
91+
node-version: ${{ matrix.node-version }}
92+
cache: 'pnpm'
1793

18-
- name: npm install
19-
run: npm install
94+
- name: Install dependencies
95+
run: pnpm install --frozen-lockfile
2096

21-
- name: Test
22-
run: npm test
97+
- name: Run Build
98+
run: pnpm build

.npmignore

Lines changed: 0 additions & 18 deletions
This file was deleted.

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
/out/
2+
/esm/
23
/release/
34
/public
45
/docs
56
.history
67
node_modules
78
**/*.md
9+
**/dist
10+
**/pnpm-lock.yaml

babel.config.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

package.json

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@
33
"version": "0.12.2",
44
"description": "SQL languages for the Monaco Editor, based on monaco-languages.",
55
"scripts": {
6-
"build": "mrmdir ./esm && tsc -p ./tsconfig.esm.json",
7-
"build-amd": "mrmdir ./out && tsc -p ./tsconfig.amd.json",
6+
"postinstall": "git config core.hooksPath .git/hooks/ && simple-git-hooks",
7+
"prepublishOnly": "npm run build",
8+
"build": "rm -rf ./esm && tsc -p ./tsconfig.esm.json",
9+
"build-amd": "rm -rf ./out && tsc -p ./tsconfig.amd.json",
810
"watch-esm": "tsc -p ./tsconfig.esm.json --watch",
911
"test": "npm run build-amd && mocha ./test/all.js",
10-
"prepublishOnly": "npm run build",
11-
"prettier": "prettier --write ./src",
12-
"check-types": "tsc -p ./tsconfig.json",
1312
"dev": "node --max_old_space_size=4092 & cd website && npm run dev",
14-
"prod": "mrmdir ./docs && node --max_old_space_size=4092 & cd website && npm run build",
13+
"prod": "rm -rf ./docs && node --max_old_space_size=4092 & cd website && npm run build",
1514
"deploy": "npm run prod && gh-pages -d docs -r git@github.com:DTStack/monaco-sql-languages.git",
15+
"format": "prettier --write .",
16+
"prettier-check": "prettier --check .",
17+
"check-types": "tsc -p ./tsconfig.json",
1618
"release": "node ./scripts/bumpVersion.js"
1719
},
1820
"author": "DTStack Corporation",
@@ -23,47 +25,52 @@
2325
"files": [
2426
"esm"
2527
],
28+
"keywords": [
29+
"monaco-editor",
30+
"SQL",
31+
"code-completion",
32+
"hive",
33+
"spark",
34+
"mysql",
35+
"postgresql",
36+
"flink",
37+
"trino",
38+
"impala"
39+
],
2640
"repository": {
2741
"type": "git",
28-
"url": "https://github.com/DTStack/monaco-sql-languages"
29-
},
30-
"bugs": {
31-
"url": "https://github.com/DTStack/monaco-sql-languages/issues"
42+
"url": "https://github.com/DTStack/monaco-sql-languages.git"
3243
},
3344
"publishConfig": {
3445
"registry": "https://registry.npmjs.org/"
3546
},
3647
"devDependencies": {
3748
"@types/mocha": "^9.1.0",
3849
"@types/node": "^20.4.0",
39-
"eslint": "^7.1.0",
40-
"eslint-config-google": "^0.14.0",
41-
"eslint-config-prettier": "^6.15.0",
42-
"eslint-plugin-react": "^7.20.0",
50+
"fast-glob": "^3.3.2",
4351
"gh-pages": "^3.2.3",
44-
"glob": "^7.1.6",
45-
"husky": "^4.3.8",
4652
"inquirer": "^8.2.2",
4753
"jsdom": "^16.4.0",
4854
"mocha": "^9.2.0",
4955
"monaco-editor": "0.31.0",
50-
"monaco-plugin-helpers": "^1.0.3",
51-
"prettier": "^2.2.1",
52-
"pretty-quick": "^3.1.0",
56+
"prettier": "^3.3.3",
57+
"pretty-quick": "^4.0.0",
5358
"requirejs": "^2.3.6",
59+
"simple-git-hooks": "^2.11.1",
5460
"standard-version": "^9.5.0",
55-
"terser": "^5.5.1",
5661
"typescript": "^5.0.4"
5762
},
58-
"husky": {
59-
"hooks": {
60-
"pre-commit": "pretty-quick --staged --pattern '**/*.*(js|jsx|ts|tsx|json)' --bail"
61-
}
63+
"simple-git-hooks": {
64+
"pre-commit": "pretty-quick --staged --bail"
6265
},
6366
"dependencies": {
6467
"dt-sql-parser": "4.0.2"
6568
},
6669
"peerDependencies": {
6770
"monaco-editor": ">=0.31.0"
68-
}
71+
},
72+
"engines": {
73+
"node": ">=18"
74+
},
75+
"packageManager": "pnpm@9.7.0"
6976
}

0 commit comments

Comments
 (0)