Modernize: Node 24, jscpd 5, .NET 10, Biome, node:test#116
Merged
Conversation
GitHub Actions removed the node16 runtime, so the action no longer starts on current runners. Move runs.using to node24. Claude-Session: https://claude.ai/code/session_01JxEe85CyGm5rCeoLFdUZed
- Move to ESM ("type": "module") with nodenext + rewriteRelativeImportExtensions
and verbatimModuleSyntax so the source runs under node --test natively.
- Replace ESLint 8 + Prettier with Biome (biome.json mirrors prior style).
- Replace Jest/ts-jest/babel with Node's built-in test runner.
- Bump @types/node 24, TypeScript 5.9, @vercel/ncc 0.44; devcontainer node 24
+ .NET 10; CI setup-node 24. finalize-dist.mjs copies the problem matcher.
Claude-Session: https://claude.ai/code/session_01JxEe85CyGm5rCeoLFdUZed
jscpd 5 is a Rust CLI with no in-process Node API and @jscpd/* libs stopped exposing detectClones. duplicated.ts now prefers a jscpd/cpd binary on PATH and falls back to `npx --yes jscpd@5`, then parses the JSON report (same schema). @jscpd/core types are replaced with local interfaces in modals.ts. Claude-Session: https://claude.ai/code/session_01JxEe85CyGm5rCeoLFdUZed
- Drop node-fetch (native fetch); replace shelled rm -rf with io.rmRF. - Accept both isEnabled and legacy isEabled; resolve defaults without masking. - Fix --include builder (no literal "undefined"); drop duplicate git status. - ESM: .ts import extensions, import.meta.url for __dirname, enum (not const enum). Claude-Session: https://claude.ai/code/session_01JxEe85CyGm5rCeoLFdUZed
Rewrite the four test files for node:test + node:assert. Avoid module mocking: readConfig uses real temp files; dotnet captures stdout for the setFailed case. Adds a legacy-isEabled backward-compat case. Claude-Session: https://claude.ai/code/session_01JxEe85CyGm5rCeoLFdUZed
Bump test projects to net10.0, pin the SDK via global.json, and add actions/setup-dotnet@v4 (10.0.x) to the test workflow. Read the real hasChanges/hasDuplicates outputs via env vars. Claude-Session: https://claude.ai/code/session_01JxEe85CyGm5rCeoLFdUZed
Document Node 24 / jscpd 5 / .NET 10 requirements, the isEnabled key, and the Biome + node:test dev workflow. Fix the "Aknowledgements" typo. Claude-Session: https://claude.ai/code/session_01JxEe85CyGm5rCeoLFdUZed
Regenerate the ncc ESM bundle for the modernized source and remove stale jscpd-v3 reporter assets (main.pug, public/, code-split chunk). Claude-Session: https://claude.ai/code/session_01JxEe85CyGm5rCeoLFdUZed
Integrate main's switch from yarn to pnpm and keep the modernized stack: - packageManager pnpm@11.9.0; regenerate pnpm-lock.yaml for the new deps; drop yarn.lock - CI: pnpm/action-setup@v6 + setup-node cache "pnpm"; scripts 'all' use pnpm - adopt main's js-yaml named import (load as yamlLoad) - keep node24 runtime (supersedes main's node20), Biome, node:test, jscpd 5 CLI - rebuild dist; docs/devcontainer reference pnpm Claude-Session: https://claude.ai/code/session_01JxEe85CyGm5rCeoLFdUZed
❌ DUPLICATED CODE FOUND - /home/runner/work/dotnet-format-plus/dotnet-format-plus/tests/dotnet/ConfigConsoleApp
JSCPD Details
|
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.
Why
The action was effectively broken:
action.ymldeclaredruns.using: "node16", a runtime GitHub Actions has removed. This PR fixes that and modernizes the whole stack (requested: dotnet 10 + jscpd 5), on top of the recent pnpm migration (#115, merged in).What changed
action.ymlnode16→node24.@jscpd/*libs droppeddetectClones).duplicated.tsnow shells out: it prefers ajscpd/cpdbinary already onPATH, otherwise falls back tonpx --yes jscpd@5, then parses the JSON report (schema verified to match the previous shape). All@jscpd/*deps removed.net10.0,global.jsonpins the SDK,actions/setup-dotnet@v4(10.0.x) added to the test workflow.type: module), TS 5.9,@types/node24; Biome replaces ESLint + Prettier;node:testreplaces Jest/ts-jest/babel; nativefetch(droppednode-fetch); octokit v22;io.rmRFinstead of shelledrm -rf. Stays on pnpm (from chore: migrate from yarn to pnpm #115).Bug fixes folded in
isEabled→isEnabled(both accepted; defaults no longer mask a user value), so enabling sub-options via config actually works.--includeno longer emits a literalundefined.git status -scall.hasChanges/hasDuplicatesoutputs (was a nonexistentoutput).Verification
pnpm allgreen: tsc typecheck, Biome (lint+format), ncc bundle, 16/16node:test, finalize.git diff dist/after a fresh deterministic rebuild.dotnet formatpath against thenet10.0fixtures and the live jscpd 5 CLI are exercised bytest-dotnet-format.ymlon CI.See WALKTHROUGH.md for design rationale and migration notes (module system, jscpd 5 reality, node:test specifics).
https://claude.ai/code/session_01JxEe85CyGm5rCeoLFdUZed