Draft
Conversation
e9a501b to
b6e0130
Compare
ce4be66 to
67cad5e
Compare
Refs: FRNT-1206
Refs: FRNT-1208
Refs: FRNT-1217
Aligns the pre-commit hook version with the ggshield version bundled by the extension. Refs: FRNT-1205
Refs: FRNT-1203
- Replace yarn.lock with package-lock.json - Add .npmrc: engine-strict=true, min-release-age=3 (supply-chain protection) - Bump @types/node from pinned 20.2.5 to ^22 (FRNT-1204) - Update package.json scripts to use npm run Refs: FRNT-1204
- npm and github-actions ecosystems, monthly schedule - 3-day cooldown on all updates (supply-chain protection) - Groups: typescript-eslint, vscode Refs: FRNT-1207
- Replace actions/setup-node@v4 (hardcoded versions) with mise-action@v2 so CI picks up the Node version from .mise.toml - Switch yarn → npm ci for installs - Update vsce install to @vscode/vsce (current package name) - Remove XQuartz install step (handled in next commit with test-cli) Refs: FRNT-1209
- Add @vscode/test-cli; configure via .vscode-test.mjs - Update test script to use vscode-test binary - Add compile-tests and check scripts; update pretest - Delete manual boilerplate: runTest.ts, suite/index.ts - Delete scripts/xvfb-run-macos.sh (display handled by test-cli) - Remove glob and @types/glob devDeps - Update .vscode/launch.json to use testConfiguration - Exclude package-lock.json from codespell (integrity hashes) Refs: FRNT-1211
simple-mock has been unmaintained since 2018. All 4 affected test files migrated to sinon: stub/restore API is equivalent, property names (called, callCount, lastCall.args) are identical. Refs: FRNT-1212
mocha ^10 → ^11 to attempt resolving serialize-javascript/diff audit vulnerabilities. Production deps are clean (npm audit --omit=dev: 0 vulns). Remaining 4 vulns are dev-only in mocha 11.7.5's own transitive deps (serialize-javascript ≤7.0.4, diff 6.x) — upstream has not released a fix yet. Add @vscode/vsce as an explicit devDependency so the CI no longer needs a separate global install step.
@vscode/vsce is now a devDependency, so npm ci makes the binary available. Drop the separate global install step and invoke via npx instead.
Replace .eslintrc.json with eslint.config.mjs using recommendedTypeChecked preset. Promote critical rules from warn → error; add no-floating-promises and only-throw-error. Fix all resulting violations across source and test files. - fixes FRNT-1214
Replace all explicit any annotations with types imported from existing packages (vscode, sinon, child_process) or TypeScript built-ins (unknown, inline object types, typeof console.log). Enable @typescript-eslint/no-explicit-any as an error in ESLint to prevent regressions.
Split tsconfig.json into a solution-style config referencing tsconfig.src.json (extension source) and tsconfig.test.json (tests, adds mocha types). Explicit types fields ensure @types/node and @types/mocha are reliably resolved by both tsc and VS Code. Update compile, compile-tests, check, and watch scripts accordingly. ESLint parserOptions now reference both concrete configs.
- Add build.mjs esbuild script (outputs dist/extension.js) - Update main entry point to ./dist/extension.js - Replace tsc compile/watch scripts with esbuild equivalents - Keep tsc for type-checking (check) and test compilation (compile-tests) - Remove outDir from tsconfig.src.json; add it explicitly to tsconfig.test.json - Update .vscodeignore: exclude node_modules/, src/, out/; drop **/*.ts, **/*.map, **/tsconfig.json - fixes FRNT-1210
67cad5e to
2a06255
Compare
esbuild's __export helper defines exports via Object.defineProperty with only get/enumerable (non-configurable), which sinon cannot stub. Switch pretest to compile with tsc, which generates writable exports.exports.* assignments that sinon can stub. Also remove compile-tests script (now inlined in pretest), fix .vscodeignore to exclude out/test/ from the vsix package, and update .gitignore to include dist/.
- bundle: true with dist/extension.js as output (single file, tree-shaken) - restore --production flag for minification on publish - tests still compile via tsc into out/ (sinon-compatible writable exports) - clean .gitignore: remove Next.js/CRA leftovers, fix tsbuildinfo glob - fix .vscodeignore: exclude out/ (test artefacts), keep dist/
pretest must run esbuild (dist/extension.js) before vscode-test, since VS Code loads the extension from the main entry point during tests. tsc still compiles test files to out/ for sinon compatibility.
- tsc compiles tests to dist/ (was out/) - vscode-test looks for dist/test/**/*.test.js - .vscodeignore excludes dist/test/ from vsix - .gitignore drops the now-unused out/ entry
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A batch of developer tooling and CI modernisation tasks:
.npmrc; commitpackage-lock.json.mise.toml; declareengines.node >= 20inpackage.json.eslintrc.jsonto ESLint v9 flat config (eslint.config.mjs) +typescript-eslintv8; enforceno-explicit-anyanytypes with proper types acrosssrc/runTest.ts/suite/index.tsto@vscode/test-cli(.vscode-test.mjs); replacesimple-mockwithsinon; upgrade Mocha to v11jdx/mise-action@v2; removexvfb-run-macos.shshim; drop globalvsceinstall in favour ofnpx; add@vscode/vsceas devDependency.MD→.mddoc extensions; ignore.worktrees/in.gitignore; updateggshieldpre-commit pin to v1.49.0Test plan
npm installsucceeds from a clean checkoutnpm run lintpasses with no errorsnpm run compile(or equivalent build) succeeds@vscode/test-clirunner