Skip to content

build: upgrade package manager #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 89 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,98 @@
name: CI
# 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
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

on: [push, pull_request]
name: Node.js CI

on:
push:
branches: [main, next]
pull_request:
branches: [main, next]

jobs:
ci:
name: CI
check:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strategy:
matrix:
node-version: [18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4.0.0
with:
version: 9.7.0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run prettier check
run: pnpm prettier-check

- name: Run tsc check
run: pnpm check-types

test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

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

- name: Install pnpm
uses: pnpm/action-setup@v4.0.0
with:
version: 9.7.0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run Units Test
run: pnpm test

build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4.0.0
with:
version: 9.7.0

- uses: actions/setup-node@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: npm install
run: npm install
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Test
run: npm test
- name: Run Build
run: pnpm build
18 changes: 0 additions & 18 deletions .npmignore

This file was deleted.

3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/out/
/esm/
/release/
/public
/docs
.history
node_modules
**/*.md
**/dist
**/pnpm-lock.yaml
10 changes: 0 additions & 10 deletions babel.config.json

This file was deleted.

57 changes: 32 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
"version": "0.12.2",
"description": "SQL languages for the Monaco Editor, based on monaco-languages.",
"scripts": {
"build": "mrmdir ./esm && tsc -p ./tsconfig.esm.json",
"build-amd": "mrmdir ./out && tsc -p ./tsconfig.amd.json",
"postinstall": "git config core.hooksPath .git/hooks/ && simple-git-hooks",
"prepublishOnly": "npm run build",
"build": "rm -rf ./esm && tsc -p ./tsconfig.esm.json",
"build-amd": "rm -rf ./out && tsc -p ./tsconfig.amd.json",
"watch-esm": "tsc -p ./tsconfig.esm.json --watch",
"test": "npm run build-amd && mocha ./test/all.js",
"prepublishOnly": "npm run build",
"prettier": "prettier --write ./src",
"check-types": "tsc -p ./tsconfig.json",
"dev": "node --max_old_space_size=4092 & cd website && npm run dev",
"prod": "mrmdir ./docs && node --max_old_space_size=4092 & cd website && npm run build",
"prod": "rm -rf ./docs && node --max_old_space_size=4092 & cd website && npm run build",
"deploy": "npm run prod && gh-pages -d docs -r git@github.com:DTStack/monaco-sql-languages.git",
"format": "prettier --write .",
"prettier-check": "prettier --check .",
"check-types": "tsc -p ./tsconfig.json",
"release": "node ./scripts/bumpVersion.js"
},
"author": "DTStack Corporation",
Expand All @@ -23,47 +25,52 @@
"files": [
"esm"
],
"keywords": [
"monaco-editor",
"SQL",
"code-completion",
"hive",
"spark",
"mysql",
"postgresql",
"flink",
"trino",
"impala"
],
"repository": {
"type": "git",
"url": "https://github.com/DTStack/monaco-sql-languages"
},
"bugs": {
"url": "https://github.com/DTStack/monaco-sql-languages/issues"
"url": "https://github.com/DTStack/monaco-sql-languages.git"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/"
},
"devDependencies": {
"@types/mocha": "^9.1.0",
"@types/node": "^20.4.0",
"eslint": "^7.1.0",
"eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-react": "^7.20.0",
"fast-glob": "^3.3.2",
"gh-pages": "^3.2.3",
"glob": "^7.1.6",
"husky": "^4.3.8",
"inquirer": "^8.2.2",
"jsdom": "^16.4.0",
"mocha": "^9.2.0",
"monaco-editor": "0.31.0",
"monaco-plugin-helpers": "^1.0.3",
"prettier": "^2.2.1",
"pretty-quick": "^3.1.0",
"prettier": "^3.3.3",
"pretty-quick": "^4.0.0",
"requirejs": "^2.3.6",
"simple-git-hooks": "^2.11.1",
"standard-version": "^9.5.0",
"terser": "^5.5.1",
"typescript": "^5.0.4"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged --pattern '**/*.*(js|jsx|ts|tsx|json)' --bail"
}
"simple-git-hooks": {
"pre-commit": "pretty-quick --staged --bail"
},
"dependencies": {
"dt-sql-parser": "4.0.2"
},
"peerDependencies": {
"monaco-editor": ">=0.31.0"
}
},
"engines": {
"node": ">=18"
},
"packageManager": "pnpm@9.7.0"
}
Loading