Skip to content
Open
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
25 changes: 12 additions & 13 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ When submitting a PR, please fill out the template that is presented by GitHub w
1. Install prerequisites:
- [Visual Studio Code](https://code.visualstudio.com/), latest stable or insiders
- [Node.js](https://nodejs.org/) v20.x or higher
- [Yarn](https://classic.yarnpkg.com/) v1.x
- [pnpm](https://pnpm.io/installation) v10.x or higher
- _Optional_: [Docker Community Edition](https://store.docker.com/search?type=edition&offering=community) 🐋

2. Fork and clone repository:
Expand All @@ -47,15 +47,15 @@ When submitting a PR, please fill out the template that is presented by GitHub w

```bash
# Install the dependencies
yarn install
pnpm install

# Open in VS Code
code .

# Build with one of these...
yarn build-dev # Fast build for development
yarn build # Slow build for release
yarn watch # Fast build whenever a file changes
pnpm build-dev # Fast build for development
pnpm build # Slow build for release
pnpm watch # Fast build whenever a file changes
```

4. Run extension using VS Code's "Run and Debug" menu
Expand All @@ -64,21 +64,20 @@ When submitting a PR, please fill out the template that is presented by GitHub w

```bash
# If Docker is installed and running:
npx gulp test # Run tests inside Docker container
npx gulp test --grep <REGEX> # Run only tests/suites matching <REGEX> inside Docker container
pnpm gulp test # Run tests inside Docker container
pnpm gulp test --grep <REGEX> # Run only tests/suites matching <REGEX> inside Docker container

# Otherwise, build and run the tests locally:
yarn build # Build
yarn build-test # Build tests
yarn test # Test (must close all instances of VS Code)
pnpm build-test # Build tests
pnpm test # Test (must close all instances of VS Code)
```

6. Package and install extension:

```bash
# Package extension into `vim-<MAJOR>.<MINOR>.<PATCH>.vsix`
# (This can be opened and inspected like a .zip file)
yarn package
pnpm package

# Install packaged extension to your local VS Code installation
code --install-extension vim-<MAJOR>.<MINOR>.<PATCH>.vsix --force
Expand Down Expand Up @@ -126,7 +125,7 @@ Before you push a release, be sure to make sure the changelog is updated!
To push a release:

```bash
npx gulp release --semver [SEMVER]
pnpm gulp release --semver [SEMVER]
git push --follow-tags
```

Expand All @@ -142,7 +141,7 @@ In addition to building and testing the extension, when a tag is applied to the

### VS Code Slowdown

If you notice a slowdown and have ever run `yarn test` in the past instead of running tests through VSCode, you might find a `.vscode-test/` folder, which VSCode is continually consuming CPU cycles to index. Long story short, you can speed up VSCode by:
If you notice a slowdown and have ever run `pnpm test` in the past instead of running tests through VSCode, you might find a `.vscode-test/` folder, which VSCode is continually consuming CPU cycles to index. Long story short, you can speed up VSCode by:

```bash
rm -rf .vscode-test/
Expand Down
4 changes: 2 additions & 2 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

## Developer Workflows

- **Build:** Use `yarn build-dev` (or the VS Code task) to build the extension. See `package.json` and `gulpfile.js` for all tasks.
- **Test:** Run tests with `yarn build-test` then `yarn test`. Tests are in `test/` and mirror the structure of `src/`.
- **Build:** Use `pnpm build-dev` (or the VS Code task) to build the extension. See `package.json` and `gulpfile.js` for all tasks.
- **Test:** Run tests with `pnpm build-test` then `pnpm test`. Tests are in `test/` and mirror the structure of `src/`.
- **Debug:** Launch the extension in the Extension Development Host via VS Code's debugger. Use breakpoints in TypeScript files.
- **Release:** Versioning and release tasks are managed via Gulp (`gulpfile.js`).

Expand Down
23 changes: 14 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,38 @@ jobs:
- name: Checkout VSCodeVim
uses: actions/checkout@v6

- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 20
cache: yarn
cache: pnpm

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

- name: Prettier
if: matrix.os != 'windows-latest'
run: yarn prettier:check
run: pnpm prettier:check

- name: Lint
run: yarn lint
run: pnpm lint

- name: Build
run: yarn build
run: pnpm build

- name: Test on ubuntu-latest
if: matrix.os != 'windows-latest'
run: |
yarn build-test
xvfb-run -a yarn test
pnpm build-test
xvfb-run -a pnpm test

- name: Test on windows-latest
if: matrix.os == 'windows-latest'
run: |
yarn build-test
yarn test
pnpm build-test
pnpm test
19 changes: 12 additions & 7 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,30 @@ jobs:
- name: Checkout VSCodeVim
uses: actions/checkout@v6

- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 20
cache: yarn
cache: pnpm

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

- name: Prettier
run: yarn prettier:check
run: pnpm prettier:check

- name: Lint
run: yarn lint
run: pnpm lint

- name: Build
run: yarn build
run: pnpm build

- name: Test
run: |
yarn build-test
xvfb-run -a yarn test
pnpm build-test
xvfb-run -a pnpm test
21 changes: 13 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,35 @@ jobs:
- name: Checkout VSCodeVim
uses: actions/checkout@v6

- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 20
cache: yarn
cache: pnpm

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

- name: Lint
run: yarn lint
run: pnpm lint

- name: Build
run: yarn build
run: pnpm build

- name: Test
run: |
yarn build-test
xvfb-run -a yarn test
pnpm build-test
xvfb-run -a pnpm test

- name: Build extension package
id: build_vsix
run: |
yarn package;
pnpm package;
echo ::set-output name=vsix_path::$(ls *.vsix);

- name: Create release on GitHub
Expand All @@ -60,7 +65,7 @@ jobs:
asset_content_type: application/zip

- name: Publish to VSCode Extension Marketplace
run: yarn run vsce publish --yarn
run: pnpm vsce publish
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}

Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
npx lint-staged
pnpm lint-staged
1 change: 1 addition & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ tsconfig.json
webpack.*.js
gulpfile.js
renovate.json
pnpm-lock.yaml
4 changes: 2 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function updateVersion(done) {
var options = minimist(process.argv.slice(2), releaseOptions);

return gulp
.src(['./package.json', './yarn.lock'])
.src(['./package.json', './pnpm-lock.yaml'])
.pipe(bump({ type: options.semver }))
.pipe(gulp.dest('./'))
.on('end', () => {
Expand Down Expand Up @@ -157,4 +157,4 @@ gulp.task(
createGitTag,
),
);
gulp.task('default', shell.task('yarn build-dev'));
gulp.task('default', shell.task('pnpm build-dev'));
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1178,18 +1178,18 @@
]
},
"scripts": {
"vscode:prepublish": "yarn build",
"vscode:prepublish": "pnpm build",
"build": "webpack -c webpack.config.js && npm run commit-hash",
"build-dev": "webpack -c webpack.dev.js && npm run commit-hash",
"build-test": "gulp prepare-test",
"commit-hash": "git rev-parse HEAD > out/version.txt",
"test": "node ./out/test/runTest.js",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"prettier": "npx prettier --write .",
"prettier:check": "npx prettier --check .",
"prettier": "prettier --write .",
"prettier:check": "prettier --check .",
"watch": "webpack -c webpack.dev.js --watch",
"package": "yarn run vsce package --yarn --allow-star-activation",
"package": "vsce package --allow-star-activation",
"prepare": "husky"
},
"dependencies": {
Expand Down
Loading
Loading