Skip to content
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
8 changes: 5 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm
- run: npm ci
- run: npm run check
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- run: pnpm install --frozen-lockfile
- run: pnpm run check
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"preLaunchTask": "npm: compile:watch",
"preLaunchTask": "pnpm: compile:watch",
"presentation": {
"reveal": "silent",
"focus": false,
Expand Down
11 changes: 6 additions & 5 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
"version": "2.0.0",
"tasks": [
{
"label": "npm: compile:watch",
"type": "npm",
"script": "compile:watch",
"label": "pnpm: compile:watch",
"type": "shell",
"command": "pnpm",
"args": ["run", "compile:watch", "--infrastructure-logging-level", "log"],
"isBackground": true,
"group": "build",
"problemMatcher": {
Expand All @@ -14,8 +15,8 @@
},
"background": {
"activeOnStart": true,
"beginsPattern": "webpack is watching the files",
"endsPattern": "Built at: .*",
"beginsPattern": "\\[webpack-cli\\] Compiler.* starting",
"endsPattern": "webpack .* compiled",
},
},
},
Expand Down
10 changes: 10 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
**/*.map
.git
.git/**
.gitignore
.vscode-test/**
.vscode/**
out/test/**
resources/*.gif
resources/*.psd
resources/**/*.psd
resources/benchmarks/**
resources/test.todo
src/**
scripts/**
syntax/code-languages.json
Expand All @@ -22,4 +27,9 @@ AGENTS.md
CODE_REVIEW.md
CONTRIBUTING.md
node_modules/**
pnpm-lock.yaml
pnpm-workspace.yaml
.npmrc
.pnpmfile.cjs
.pnpm-store/**
.claude/**
22 changes: 14 additions & 8 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,23 @@

TypeScript, VS Code extension (vscode API ^1.36), webpack, moment-mini, mocha+chai.

Development: Node.js 22.12+ on 22.x or Node.js 24; pnpm 10.33.4 is pinned in
`package.json`. Run `corepack enable pnpm` before setup. The extension still
targets VS Code 1.36 / Node 10.11; retain the compiler/API pins.

## Commands

```bash
npm install # install deps
npm run compile # webpack dev build → out/
npm run compile:watch
npm run test # mocha tests in test/
npm run typecheck # TypeScript source and test checks
npm run check # types, tests, development build, formatting
npm run format # prettier --write
npm run format:check
pnpm install --frozen-lockfile # reproducible install
pnpm run compile # webpack dev build → out/
pnpm run compile:watch
pnpm run test # mocha tests in test/
pnpm run typecheck # TypeScript source and test checks
pnpm run check # types, tests, development build, formatting
pnpm run format # prettier --write
pnpm run format:check
pnpm run package # production VSIX, bundled deps, no dependency collection
pnpm run publish # VS Code Marketplace only; never use bare pnpm publish
```

Debug: open in VS Code, F5 launches Extension Dev Host. Sourcemaps active — breakpoints in `src/` work.
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#### Fixes

- Updated file-discovery dependencies to remove vulnerable glob parsers, preserving filesystem casing and symlink rules, and modernized the build and test tooling while retaining VS Code 1.36 support. [#299](https://github.com/vycdev/vscode-todo-plus-two/issues/299)
- Kept checked Markdown tasks out of pending-task results when `-` is the configured todo box symbol.
- Preserved `@due(...)` urgency colors when refreshing planned work windows.
- Rejected malformed planned windows containing inline code in their arguments.
Expand Down
2 changes: 1 addition & 1 deletion CODE_REVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ Final local validation: a clean `npm ci`, all 384 tests, source/test type checki

Regression coverage exercises archive failure/concurrency paths, dirty and hidden documents, symlink traversal including Windows junctions, scan and provider races, command focus/version changes, prototype-like IDs, invalid/empty regexes, lifecycle cleanup, UI refreshes, expression parsing, and time calculations. Existing export, parser, tag, dependency, and view tests remain part of the full suite.

Run `npm run check` for the source/test type check, full Mocha suite, webpack development build, and Prettier check. CI runs this command on Windows and Linux with Node 22 and 24. Production packaging also requires type checking. Third-party declaration internals are skipped because the retained legacy dependencies use older Node definitions; application and test source are checked.
Run `pnpm run check` for the source/test type check, full Mocha suite, webpack development build, and Prettier check. CI runs this command on Windows and Linux with Node 22 and 24. Production packaging also requires type checking. Third-party declaration internals are skipped because the retained legacy dependencies use older Node definitions; application and test source are checked.

Validation limits: unit tests use VS Code API doubles; a full interactive Extension Development Host session and native ag execution were not performed. An actual installed ripgrep search was exercised. External processes editing archive files are outside the in-process transfer queue's coordination boundary.
103 changes: 82 additions & 21 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,56 @@ This document explains how to set up the project locally, install prerequisites,

## Prerequisites

- Node.js 22 or 24 and npm for development and tests
- Node.js 22.12 or newer on the 22.x line, or Node.js 24, for development and tests
- pnpm 10.33.4, pinned by `packageManager` in `package.json`
- Visual Studio Code 1.36 or newer to run the extension
- (Optional) `vsce` if you want to package/publish the extension locally:

Enable pnpm through Corepack (included with the supported Node.js installers):

```powershell
npm install -g vsce
corepack enable pnpm
pnpm --version
```

## Install dependencies

From the repository root run:

```powershell
npm install
pnpm install
```

This installs the runtime and development dependencies, including pinned TypeScript and VS Code API definitions. Use `npm ci` for a reproducible installation from the lockfile.
Corepack selects the repository's pinned pnpm version. If Corepack is unavailable,
install pnpm once with `npm install --global pnpm@10.33.4`.
If Corepack reports outdated signatures after enabling it, run `corepack disable pnpm`
before using that bootstrap command. This removes Corepack's `pnpm`/`pnpx` shims
so npm can install the pinned CLI without an `EEXIST` conflict.

This installs the runtime and development dependencies, including pinned TypeScript and VS Code API definitions. Use `pnpm install --frozen-lockfile` for a reproducible installation from `pnpm-lock.yaml`; CI always uses this mode. When intentionally changing dependencies, use `pnpm add`/`pnpm remove` and commit the updated lockfile. Do not generate a `package-lock.json`.

Development's Node.js requirement does not change the extension runtime: VS Code
1.36 / Node.js 10.11 remains supported. Keep the compiler and API definition pins.

## Validation

Run `npm run check` before submitting changes. It runs type checking, the test suite, the development build, and formatting checks. Run `npm run format` to apply the repository's Prettier configuration. Git stores text files with LF line endings so formatting checks behave consistently on Windows and Unix.
Run `pnpm run check` before submitting changes. It runs type checking, the test suite, the development build, and formatting checks. Run `pnpm run format` to apply the repository's Prettier configuration. Git stores text files with LF line endings so formatting checks behave consistently on Windows and Unix.

Tests run directly through the CommonJS TypeScript loader. They do not need an experimental Node.js ESM loader or a downloaded VS Code installation. VS Code declarations are checked against the declared minimum API version. Type checking skips third-party declaration internals because some pinned legacy dependencies use older Node definitions; application and test code are still checked.

Run `npm run test:e2e` for the separate Extension Development Host suite. It builds
Run `pnpm run test:e2e` for the separate Extension Development Host suite. It builds
the extension and launches VS Code with an isolated temporary workspace, profile,
and extensions directory. Set `VSCODE_EXECUTABLE_PATH` to an existing VS Code
executable to reuse it; otherwise the official test runner downloads VS Code.
The suite covers fenced syntax colors, an installed grammar contribution, task
commands, completion, links, diagnostics, folding, and archive/unarchive. It prints
the directory containing its JSON report and captured workbench syntax tokens.

For scalability changes, run `npx ts-node test/benchmarks/scalability.ts 7000`. It compares incremental edits with forced full cache rebuilds in a simulated editor and reports parsing, project computation, and decoration submission counts. These timings exclude VS Code rendering and IPC.
For scalability changes, run `pnpm exec ts-node test/benchmarks/scalability.ts 7000`. It compares incremental edits with forced full cache rebuilds in a simulated editor and reports parsing, project computation, and decoration submission counts. These timings exclude VS Code rendering and IPC.

An optional check runs inside your installed VS Code in an isolated profile. It exercises tagged tasks, estimates, completion, line insertion/deletion, undo/redo, and split editors in a 7,000-line document:

```powershell
npm run compile
pnpm run compile
$todoTestRoot = Join-Path ([System.IO.Path]::GetTempPath()) ('todo-scalability-' + [guid]::NewGuid())
New-Item -ItemType Directory -Path $todoTestRoot | Out-Null
$env:TODO_SCALABILITY_REPORT = Join-Path $todoTestRoot 'results.json'
Expand All @@ -55,32 +67,32 @@ The Extension Host check verifies edits and reports asynchronous errors and edit

## Build the extension

This project uses webpack to compile the TypeScript source into `out/` (the compiled extension). Build commands from `package.json`:
This project uses webpack 5 to compile the TypeScript source into `out/` (the compiled extension). It cleans the output directory before emitting files, targets Node.js 10.11 (the runtime shipped with VS Code 1.36), and limits minifier output to ES2017 syntax. Development tools use the newer Node.js versions listed above. Build commands from `package.json`:

```powershell
# One-time build (development mode)
npm run compile
pnpm run compile

# Build and watch for changes while you edit
npm run compile:watch
pnpm run compile:watch

# Publish
npm run publish
# Production build (also runs automatically when packaging)
pnpm run vscode:prepublish
```

Note: the `compile:watch` command is handy while debugging; it keeps `out/` updated automatically.

## Debugging the extension in VS Code

1. Open the project folder in VS Code.
2. Make sure the project is compiled at least once (`npm run compile`) or run `npm run compile:watch` in a terminal.
2. Make sure the project is compiled at least once (`pnpm run compile`) or run `pnpm run compile:watch` in a terminal.
3. Open a TypeScript source file in `src/`.
4. Press F5 (or Run > Start Debugging). VS Code will open a new Extension Development Host window with the extension loaded.

Tips:

- Put breakpoints in the TypeScript files under `src/`. With `sourceMap: true` and `out/` present VS Code should hit breakpoints correctly.
- If breakpoints are skipped, stop the debug session, run a full compile (`npm run compile`), and start debugging again.
- If breakpoints are skipped, stop the debug session, run a full compile (`pnpm run compile`), and start debugging again.

## Code-block language catalog

Expand All @@ -89,11 +101,11 @@ Fenced language names, aliases, and TextMate scopes are derived from GitHub Ling
`syntax/linguist-LICENSE.txt` must remain in the packaged extension.

After changing scope overrides in `scripts/generate-code-grammar.js`, run
`npm run generate:code-grammar`. It regenerates `syntax/fenced-code.tmLanguage.json`
`pnpm run generate:code-grammar`. It regenerates `syntax/fenced-code.tmLanguage.json`
and the manifest's embedded-language mappings entirely offline. Tests check that
these outputs match the catalog and generator.

To update the catalog, use `npm run generate:code-grammar -- --update <full-commit-SHA>`
To update the catalog, use `pnpm run generate:code-grammar --update <full-commit-SHA>`
with a reviewed commit from `github-linguist/linguist`. This explicit update downloads
the catalog and license; normal builds and extension use do not access the network.
Language grammars themselves are supplied by VS Code and installed extensions.
Expand All @@ -104,13 +116,62 @@ If you want to generate a `.vsix` to install locally or publish manually:

```powershell
# create a VSIX package
vsce package
pnpm run package

# install the VSIX into your locally installed VS Code
code --install-extension .\vscode-todo-plus-two-<version>.vsix
```

Replace `<version>` with the actual package filename produced by `vsce package`.
Replace `<version>` with the actual package filename produced by `pnpm run package`.
The script runs pinned `@vscode/vsce` 4.1.0 through `pnpm dlx`, so no global
packaging tool is required. It runs `vscode:prepublish` and disables dependency
collection with `--no-dependencies`: webpack bundles the runtime dependencies,
including `moment` aliased to `moment-mini`. The VSIX excludes `node_modules`,
pnpm internals, and lockfiles. VSCE itself invokes the prepublish hook through npm;
the hook's type check and build use the pnpm-installed tools.

## Preparing and publishing a release

Release preparation happens on a `feat/` branch based on the latest `origin/develop`.
Open the preparation PR against `develop` and squash merge it after review.

1. Compare all changes since the latest published GitHub release and tag, including
entries accidentally added beneath an older version in `CHANGELOG.md`. Keep
published release notes unchanged and put every unreleased change in the new
version's section.
2. Update the version in `package.json`. `pnpm-lock.yaml` does not store the root
package version; update it only when dependencies change.
Review README compatibility notes, settings, commands, and screenshots.
3. Run `pnpm install --frozen-lockfile` and `pnpm run check`. Run the Extension Host suites in a desktop
session when validating release behavior: `pnpm run test:e2e` and
`pnpm run test:e2e:tags`.
4. Build the candidate with `pnpm run package --githubBranch v<version>` so packaged
README links refer to the intended release tag. Packaging runs the production
build through `vscode:prepublish`. Inspect the VSIX as a ZIP: verify its version,
bundle, grammars, licenses, icons, and README images; exclude source, tests,
dependencies, source maps, and local Git metadata. Install and smoke-test the
actual VSIX in an isolated VS Code profile. Record its SHA-256 checksum.

The following are separate publication steps for a maintainer after approving the
candidate; preparing the release does not perform them. The 5.3.0 release used a
`develop` to `master` promotion with a merge commit, preserving shared history.
Repeat that promotion after the preparation PR is merged and checks pass, then:

1. Check out and pull `master`; verify it contains the reviewed release changes
and the intended package version. If anything changed after candidate
validation, rebuild and retest the VSIX.
2. Create and push `v<version>` on that stable commit.
3. Publish the approved artifact to the VS Code Marketplace with
`pnpm run publish --packagePath <path-to-approved.vsix>`. This publishes the exact
inspected bytes. `pnpm run publish` without arguments rebuilds and publishes
from the current checkout. Always include `run`: `pnpm publish` is pnpm's
registry-publication command, whereas this script publishes only to the
VS Code Marketplace.
4. Create the GitHub release for the same tag, attach the approved VSIX, and use
the new changelog section for its highlights and migration notes.

There is no automatic tag or Marketplace publishing workflow in this repository;
the GitHub Actions workflow runs validation on `develop` and its pull requests.

## How to contribute (recommended workflow)

Expand All @@ -122,7 +183,7 @@ Replace `<version>` with the actual package filename produced by `vsce package`.
git checkout -b feat/awesome-improvement
```

3. Make your changes and run `npm run check`.
3. Make your changes and run `pnpm run check`.
4. Commit changes with clear messages and push your branch to your fork.
5. Open a Pull Request against the `develop` branch of `vycdev/vscode-todo-plus-two` and describe the change. Pull requests are squash merged.

Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,12 @@ If you found a problem, or have a feature request, please open an [issue](https:

You can find more about contributing here: [CONTRIBUTING.md](CONTRIBUTING.md)

Run `npm run check` for types, unit/integration tests, the development build, and formatting. Run `npm run test:e2e:tags` in a desktop session with Node.js 22 or newer to launch an isolated VS Code Extension Development Host for tag styling. It exercises real task commands, undo/redo, dependencies, archiving, Markdown handling, live settings, and rendered styles in dark and light themes. The runner downloads VS Code through `@vscode/test-electron` and writes a JSON report and screenshots to a temporary artifact directory. The separate `npm run test:e2e` suite covers fenced code notes.
Development uses Node.js 22.12+ on the 22.x line or Node.js 24 and pnpm 10.33.4
(pinned in `package.json`). Enable it with `corepack enable pnpm`, then run
`pnpm install --frozen-lockfile`. See the contributor guide for bootstrap alternatives
and the `pnpm run package` / Marketplace-only `pnpm run publish` scripts.

Run `pnpm run check` for types, unit/integration tests, the development build, and formatting. Run `pnpm run test:e2e:tags` in a desktop session with Node.js 22.12+ or 24 to launch an isolated VS Code Extension Development Host for tag styling. It exercises real task commands, undo/redo, dependencies, archiving, Markdown handling, live settings, and rendered styles in dark and light themes. The runner downloads VS Code through `@vscode/test-electron` and writes a JSON report and screenshots to a temporary artifact directory. The separate `pnpm run test:e2e` suite covers fenced code notes.

Set `VSCODE_EXECUTABLE_PATH` to reuse a VS Code executable, `VSCODE_TEST_VERSION` to select a version, or `TODO_E2E_ARTIFACT_DIR` to choose where reports and screenshots are saved. Tests use a temporary workspace, profile, and extensions directory.

Expand Down
Loading
Loading