Skip to content
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

Changes to pnpm from yarn #3192

Merged
merged 1 commit into from
Sep 19, 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
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",
// "postCreateCommand": "pnpm install",

// Configure tool-specific properties.
// "customizations": {},
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/cd-pre.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,24 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install
run: yarn
run: pnpm install
- name: Apply pre-release patch
run: yarn run patch-pre
run: pnpm run patch-pre
- name: Setup Environment
run: node -e "console.log('PACKAGE_VERSION=' + require('./package.json').version + '\nPACKAGE_NAME=' + require('./package.json').name + '-' + require('./package.json').version)" >> $GITHUB_ENV
- name: Package extension
run: yarn run package --pre-release
run: pnpm run package --pre-release
- name: Publish extension
run: yarn vsce publish --yarn --pre-release --packagePath ./${{ env.PACKAGE_NAME }}.vsix -p ${{ secrets.GITLENS_VSCODE_MARKETPLACE_PAT }}
run: pnpm vsce publish --no-dependencies --pre-release --packagePath ./${{ env.PACKAGE_NAME }}.vsix -p ${{ secrets.GITLENS_VSCODE_MARKETPLACE_PAT }}
- name: Publish artifact
uses: actions/upload-artifact@v4
with:
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/cd-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8
- name: Setup node
uses: actions/setup-node@v4
with:
Expand All @@ -23,11 +27,11 @@ jobs:
- name: Verify versions
run: node -e "if ('refs/tags/v' + '${{ env.PACKAGE_VERSION }}' !== '${{ github.ref }}') { console.log('::error' + 'Version Mismatch. refs/tags/v' + '${{ env.PACKAGE_VERSION }}', '${{ github.ref }}'); throw Error('Version Mismatch')} "
- name: Install
run: yarn
run: pnpm install
- name: Package extension
run: yarn run package
run: pnpm run package
- name: Publish Extension
run: yarn vsce publish --yarn --packagePath ./${{ env.PACKAGE_NAME }}.vsix -p ${{ secrets.GITLENS_VSCODE_MARKETPLACE_PAT }}
run: pnpm vsce publish --no-dependencies --packagePath ./${{ env.PACKAGE_NAME }}.vsix -p ${{ secrets.GITLENS_VSCODE_MARKETPLACE_PAT }}
- name: Generate Changelog
id: changelog
uses: mindsers/changelog-reader-action@v2
Expand Down
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"[html][javascript][json][jsonc][markdown][scss][svg][typescript][typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"npm.packageManager": "yarn",
"search.exclude": {
"**/dist": true
},
Expand Down
1 change: 1 addition & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ CODE_OF_CONDUCT.md
CONTRIBUTING.md
esbuild.mjs
eslint.config.mjs
pnpm-lock.yaml
README.pre.md
svgo.config.js
tsconfig*.json
Expand Down
2 changes: 0 additions & 2 deletions .yarnrc

This file was deleted.

28 changes: 14 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,39 +19,39 @@ git clone https://github.com/gitkraken/vscode-gitlens.git
Prerequisites

- [Git](https://git-scm.com/), `>= 2.7.2`
- [NodeJS](https://nodejs.org/), `>= 20`
- [yarn](https://yarnpkg.com/), `>= 1.22.22`
- [NodeJS](https://nodejs.org/), `>= v20.11.1`
- [pnpm](https://pnpm.io/), `>= 8.x` (install using [corepack](https://nodejs.org/docs/latest-v20.x/api/corepack.html))

### Dependencies

From a terminal, where you have cloned the repository, execute the following command to install the required dependencies:

```
yarn
pnpm install
```

### Build

From a terminal, where you have cloned the repository, execute the following command to re-build the project from scratch:

```
yarn run rebuild
pnpm run rebuild
```

👉 **NOTE!** This will run a complete rebuild of the project.

Or to just run a quick build, use:

```
yarn run build
pnpm run build
```

### Watch

During development you can use a watcher to make builds on changes quick and easy. From a terminal, where you have cloned the repository, execute the following command:

```
yarn run watch
pnpm run watch
```

Or use the provided `watch` task in VS Code, execute the following from the command palette (be sure there is no `>` at the start):
Expand All @@ -68,7 +68,7 @@ This will first do an initial full build and then watch for file changes, compil

### Formatting

This project uses [prettier](https://prettier.io/) for code formatting. You can run prettier across the code by calling `yarn run pretty` from a terminal.
This project uses [prettier](https://prettier.io/) for code formatting. You can run prettier across the code by calling `pnpm run pretty` from a terminal.

To format the code as you make changes you can install the [Prettier - Code formatter](https://marketplace.visualstudio.com/items/esbenp.prettier-vscode) extension.

Expand All @@ -80,7 +80,7 @@ Add the following to your User Settings to run prettier:

### Linting

This project uses [ESLint](https://eslint.org/) for code linting. You can run ESLint across the code by calling `yarn run lint` from a terminal. Warnings from ESLint show up in the `Errors and Warnings` quick box and you can navigate to them from inside VS Code.
This project uses [ESLint](https://eslint.org/) for code linting. You can run ESLint across the code by calling `pnpm run lint` from a terminal. Warnings from ESLint show up in the `Errors and Warnings` quick box and you can navigate to them from inside VS Code.

To lint the code as you make changes you can install the [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) extension.

Expand All @@ -89,13 +89,13 @@ To lint the code as you make changes you can install the [ESLint](https://market
To generate a production bundle (without packaging) run the following from a terminal:

```
yarn run bundle
pnpm run bundle
```

To generate a VSIX (installation package) run the following from a terminal:

```
yarn run package
pnpm run package
```

### Debugging
Expand Down Expand Up @@ -202,13 +202,13 @@ Then, use the [prep-release](scripts/prep-release.js) script to prepare a new re

1. Ensure you are on the `main` branch and have a clean working tree
2. Ensure the [CHANGELOG.md](CHANGELOG.md) has been updated with the release notes
3. Run `yarn run prep-release` and enter the desired `{major}.{minor}.{patch}` version when prompted
3. Run `pnpm run prep-release` and enter the desired `{major}.{minor}.{patch}` version when prompted
4. Review the `Bumps to v{major}.{minor}.{patch}` commit
5. Run `git push --follow-tags` to push the commit and tag

Pushing the `v{major}.{minor}.{patch}` tag will trigger the [Publish Stable workflow](.github/workflows/cd-stable.yml) to automatically package the extension, create a [GitHub release](https://github.com/gitkraken/vscode-gitlens/releases/latest), and deploy it to the [VS Marketplace](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens).

If the action fails and retries are unsuccessful, the VSIX can be built locally with `yarn package` and uploaded manually to the marketplace. A GitHub release can also be [created manually](https://github.com/gitkraken/vscode-gitlens/releases/new) using `v{major}.{minor}.{patch}` as the title and the notes from the [CHANGELOG.md](CHANGELOG.md) with the VSIX attached.
If the action fails and retries are unsuccessful, the VSIX can be built locally with `pnpm run package` and uploaded manually to the marketplace. A GitHub release can also be [created manually](https://github.com/gitkraken/vscode-gitlens/releases/new) using `v{major}.{minor}.{patch}` as the title and the notes from the [CHANGELOG.md](CHANGELOG.md) with the VSIX attached.

#### Preparing a Patch Release

Expand Down Expand Up @@ -240,8 +240,8 @@ To add new icons to the GL Icons font follow the steps below:
- Optimize and build the icons by running the following from a terminal:

```
yarn run icons:svgo
yarn run build:icons
pnpm run icons:svgo
pnpm run build:icons

```

Expand Down
Loading