Modernize aw-watcher-vscode to v0.6.0 (Node 18+, VS Code 1.85, TS 5.6, ESLint, CI)

Open
#55 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
eslint, github-actions, nodejs, typescript, vscode
Domain
ci-cd, release, tooling

Research direction

Start from the diff of PR #52 (branch modernize/v0.6.0), which already carries most of the change: package.json, src/extension.ts (enabled/serverUrl settings, null-safe initGit, branch in heartbeats), tsconfig.json, .eslintrc.json and .github/workflows/ci.yml. What is left is maintainer-level: smoke-test against aw-server --testing to confirm project, file, language and branch fields arrive, clear the brace-expansion advisory in the devDependency tree, and settle the engine-floor, tagging and publishing decisions. Done means green CI plus those checks, not a newcomer patch.

Written by the indexing model from the issue text.

Description

Tracking issue for the aw-watcher-vscode v0.6.0 modernization.

Goal

Bring the extension up to current toolchains. It hasn't had a release since 2020 (last release was v0.5.0, which was never even tagged in git), so the modernization covers Node 18+, VS Code 1.85, TypeScript 5.6, ESLint replacing deprecated TSLint, @vscode/test-cli, and CI.

Implementation: PR #52

ActivityWatch/aw-watcher-vscode#52 — branch modernize/v0.6.0.

Summary of changes in that PR:

Manifest

  • version: 0.5.0 → 0.6.0
  • engines.vscode: ^1.23.0 → ^1.85.0
  • engines.node: added >=18
  • activationEvents: ["*"] → ["onStartupFinished"]
  • New settings: aw-watcher-vscode.enabled, aw-watcher-vscode.serverUrl

Dependencies

  • typescript ^4.1.3 → ^5.6.0
  • tslint (deprecated) → eslint ^8.57.0 + @typescript-eslint ^8 + prettier ^3.3.0
  • vscode-test (deprecated) → @vscode/test-cli + @vscode/test-electron
  • axios ^0.21.1 (CVE-2021-3749, CVE-2023-45857) → removed
  • mocha ^8.2.1 → ^10.7.0, @types/mocha → ^10.0.0, @types/node → ^22.0.0
  • Added @vscode/vsce for npm run package

Source

  • src/extension.ts: heartbeat catch no longer destructures { err } (new aw-client-js throws FetchError); initGit() is null-safe when the built-in Git extension isn't installed; honors enabled and serverUrl settings.
  • src/test/extension.test.ts: real smoke test that the compiled entry point exists.
  • tsconfig.json: target es6 → es2022, added noUnusedParameters, noImplicitReturns, noFallthroughCasesInSwitch, forceConsistentCasingInFileNames, esModuleInterop. paths mapping so aw-client resolves to the submodule source (it's not on npm).

Tooling

  • tslint.json removed.
  • Added .eslintrc.json, .eslintignore, .prettierrc.json, .vscode-test.js.
  • Added .github/workflows/ci.yml (lint + compile + test + .vsix artifact on Ubuntu with xvfb-run).

Submodules

  • aw-client-js: 11a7f066 → 6093fbb (Bearer-token auth, drops axios for native fetch).
  • media: cb597f7c → a45151.

Behavior change worth calling out

  • branch is now included in heartbeats via _getCurrentBranch() from the VS Code git extension — closes #41.

Open sub-tasks

  • Maintainer smoke-test against aw-server --testing (headless envs can't do this) — confirm heartbeats arrive with project, file, language, branch fields
  • Resolve brace-expansion CVE in devDependency chain (transitive, not shipped, but npm audit will keep flagging)
  • Decide on engine floor policy (vscode ^1.85.0 drops VS Code < 1.85, released Dec 2023)
  • Tag v0.6.0 after merge (no v0.5.0 tag exists upstream — adding the tag retroactively is a separate decision)
  • Publish to VS Marketplace and/or Open VSX (activitywatch publisher)

Risk

  • Low for downstream users — bucket ID unchanged (aw-watcher-vscode_<hostname>), event schema additive (new branch key), settings additions default to existing behavior.
  • Medium for binary shipping — the new aw-client-js works against the current aw-server API. Older aw-server instances will surface FetchError as a toast on every heartbeat; set aw-watcher-vscode.enabled: false to silence.
Dominant language
TypeScript
Stars
285
Forks
50
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ActivityWatch/aw-watcher-vscode

All issues in ActivityWatch/aw-watcher-vscode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.