Skip to content

Commit

Permalink
Switch to pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
skovhus committed Jul 15, 2023
1 parent 697099d commit 0db41ed
Show file tree
Hide file tree
Showing 17 changed files with 3,531 additions and 3,715 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
with:
version: 8

- uses: actions/setup-node@v3
with:
node-version: 14
node-version: 20
registry-url: https://registry.npmjs.org/

- run: |
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/upgrade-tree-sitter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Use Node.js 14
uses: actions/setup-node@v3
- uses: pnpm/action-setup@v2
with:
node-version: 14
version: 8

- name: Install dependencies
run: yarn install
- uses: actions/setup-node@v3
with:
node-version: 20
cache: "pnpm"
cache-dependency-path: '**/pnpm-lock.yaml'

- run: pnpm install --frozen-lockfile

- name: Upgrade tree-sitter wasm
run: bash scripts/upgrade-tree-sitter.sh
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,33 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [14.x, 16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v3

- name: Install shellcheck (used for testing)
run: sudo apt-get install -y shellcheck

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
cache: "pnpm"
cache-dependency-path: '**/pnpm-lock.yaml'
node-version: ${{ matrix.node-version }}

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

- run: yarn verify:bail
name: Verify changes
- name: Verify changes
run: pnpn verify:bail

- name: Publish coverage to codecov.io
uses: codecov/codecov-action@v3
if: success() && matrix.node-version == '12.x'
if: success() && matrix.node-version == '20.x'
with:
token: ${{ secrets.CODECOV_TOKEN }}
yml: ./codecov.yml
files: ./codecov.yml
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
save-exact = true
hoist = false
8 changes: 0 additions & 8 deletions Makefile

This file was deleted.

22 changes: 10 additions & 12 deletions docs/development-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,15 @@ convenience - it proxies to the `package.json` files in the `vscode-client` and

This guide presumes you have the following dependencies installed:

- [`yarn`][yarn].
- [`pnpm`][pnpm].
- [`node`][node] (v14 or newer)
- `g++`
- `make` (optional)

## Initial setup

Run the following in the root of the project

```
yarn install
pnpm install
```

This uses the `postinstall` hook to install the dependencies in each of the
Expand All @@ -35,7 +33,7 @@ To make sure that everything is configured correctly run the following command
to compile both the client and the server once

```
yarn run compile
pnpm compile
```

Now, depending on which part you want to work on follow the relevant section
Expand All @@ -45,10 +43,10 @@ below.

To support a good develop workflow we set up [eslint][eslint], [Prettier][prettier] and integration tests using [Jest][jest]:

yarn verify # (runs lint, prettier and tests)
yarn lint
yarn test
yarn test:coverage
pnpm verify # (runs lint, prettier and tests)
pnpm lint
pnpm test
pnpm test:coverage

## Working on the client

Expand All @@ -70,7 +68,7 @@ As the server is embedded into the VS Code client, you can link any server
changes into the local installation of your VS Code client by running this once:

```
yarn link-server
pnpm link-server
```

After that follow the steps above to work on the client.
Expand All @@ -82,7 +80,7 @@ and install the server globally whenever you've made a change, and then
reload your vscode window to re-launch the server.

```
yarn run reinstall-server
pnpm reinstall-server
```

If you for some reason cannot get access to logs through the client,
Expand Down Expand Up @@ -111,5 +109,5 @@ To analyze the performance of the extension or server using the Chrome inspector
[jest]: https://facebook.github.io/jest/
[prettier]: https://prettier.io/
[eslint]: https://eslint.org/
[yarn]: https://yarnpkg.com/lang/en/docs/install/
[pnpm]: https://pnpm.io/installation
[node]: https://nodejs.org/en/download/
23 changes: 13 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
"private": true,
"scripts": {
"clean": "rm -rf *.log */*.log */out node_modules vscode-client/node_modules server/node_modules",
"postinstall": "cd server && yarn install && cd ../vscode-client && yarn install && cd ..",
"preinstall": "npx only-allow pnpm",
"compile": "tsc -b",
"watch": "tsc -b -w",
"lint": "yarn lint:bail --fix",
"lint": "pnpm lint:bail --fix",
"lint:bail": "eslint . --ext js,ts,tsx --cache",
"test": "jest --runInBand",
"test:coverage": "yarn run test --coverage",
"test:watch": "yarn run test --watch",
"verify": "yarn run lint && yarn run compile && yarn run test",
"verify:bail": "yarn run lint:bail && yarn run compile && yarn run test:coverage",
"reinstall-server": "npm uninstall -g bash-language-server && yarn compile && npm i -g ./server",
"link-server": "npm uninstall -g bash-language-server && yarn compile && yarn unlink bash-language-server && cd server && yarn link && cd ../vscode-client && yarn link bash-language-server"
"test:coverage": "pnpm test --coverage",
"test:watch": "pnpm test --watch",
"verify": "pnpm lint && pnpm compile && pnpm test",
"verify:bail": "pnpm lint:bail && pnpm compile && pnpm test:coverage",
"reinstall-server": "npm uninstall -g bash-language-server && pnpm compile && npm i -g ./server",
"link-server": "npm uninstall -g bash-language-server && pnpm compile && pnpm unlink --dir=vscode-client bash-language-server && cd server && pnpm link . && cd ../vscode-client && pnpm link bash-language-server"
},
"devDependencies": {
"@types/jest": "29.5.3",
Expand All @@ -33,9 +33,12 @@
"vscode-languageserver": "8.0.2",
"vscode-languageserver-textdocument": "1.0.8"
},
"dependencies": {},
"resolutions": {
"sane": "^5.0.0"
"@types/vscode": "1.67.0"
},
"engines": {
"node": ">=14",
"pnpm": "8.x"
},
"jest": {
"preset": "ts-jest",
Expand Down
Loading

0 comments on commit 0db41ed

Please sign in to comment.