Skip to content

Modernize: Node 24, jscpd 5, .NET 10, Biome, node:test#116

Merged
maxisam merged 9 commits into
mainfrom
feat/modernize-node24-jscpd5-dotnet10
Jun 26, 2026
Merged

Modernize: Node 24, jscpd 5, .NET 10, Biome, node:test#116
maxisam merged 9 commits into
mainfrom
feat/modernize-node24-jscpd5-dotnet10

Conversation

@maxisam

@maxisam maxisam commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Why

The action was effectively broken: action.yml declared runs.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

  • Node 24 runtimeaction.yml node16node24.
  • jscpd 5 — its npm package is now a Rust CLI with no Node API (and @jscpd/* libs dropped detectClones). duplicated.ts now shells out: it prefers a jscpd/cpd binary already on PATH, otherwise falls back to npx --yes jscpd@5, then parses the JSON report (schema verified to match the previous shape). All @jscpd/* deps removed.
  • .NET 10 — fixtures → net10.0, global.json pins the SDK, actions/setup-dotnet@v4 (10.0.x) added to the test workflow.
  • Toolchain — ESM (type: module), TS 5.9, @types/node 24; Biome replaces ESLint + Prettier; node:test replaces Jest/ts-jest/babel; native fetch (dropped node-fetch); octokit v22; io.rmRF instead of shelled rm -rf. Stays on pnpm (from chore: migrate from yarn to pnpm #115).

Bug fixes folded in

  • isEabledisEnabled (both accepted; defaults no longer mask a user value), so enabling sub-options via config actually works.
  • --include no longer emits a literal undefined.
  • Removed a duplicate git status -s call.
  • Test workflow reads the real hasChanges / hasDuplicates outputs (was a nonexistent output).

Verification

  • pnpm all green: tsc typecheck, Biome (lint+format), ncc bundle, 16/16 node:test, finalize.
  • ESM bundle smoke-tested (loads with no module errors).
  • dist gate clean: 0-line git diff dist/ after a fresh deterministic rebuild.
  • The dotnet format path against the net10.0 fixtures and the live jscpd 5 CLI are exercised by test-dotnet-format.yml on CI.

See WALKTHROUGH.md for design rationale and migration notes (module system, jscpd 5 reality, node:test specifics).

https://claude.ai/code/session_01JxEe85CyGm5rCeoLFdUZed

maxisam added 9 commits June 25, 2026 23:10
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
@github-actions

Copy link
Copy Markdown

❌ DUPLICATED CODE FOUND - /home/runner/work/dotnet-format-plus/dotnet-format-plus/tests/dotnet/ConfigConsoleApp

Duplications detection: Found 1 exact clones with 8(19.05%) duplicated lines in 2 (2 formats) files.

Format Files analyzed Total lines Total tokens Clones found Duplicated lines Duplicated tokens
csharp 1 13 82 1 8 (61.54%) 57 (69.51%)
json 1 29 93 0 0 (0.00%) 0 (0.00%)
Total: 2 42 175 1 8 (19.05%) 57 (32.57%)
Total: 2 42 175 1 8 (19.05%) 57 (32.57%)
JSCPD Details


✏️ updated for commit a5b8f1d by Workflow

@maxisam maxisam merged commit 961eb02 into main Jun 26, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant