Skip to content

Move from Deno to Node.js and Vite+ - #2

Merged
temeddix merged 3 commits into
mainfrom
node-migration
Oct 20, 2026
Merged

temeddix merged 3 commits into
mainfrom
node-migration

Conversation

@temeddix

Copy link
Copy Markdown
Member

Summary

Moves the repo from Deno to Node.js + Vite+ (vp), like the other cunarist repos. The published package keeps its name (thin-scrollbars-everywhere), its import/require entry points, and its behavior. The dnt build (scripts/build-npm.ts, npm/) is replaced by vp pack (tsdown).

What changed

  • Config: deno.json/deno.lock are gone. Config now lives only in package.json, tsconfig.json, and vite.config.ts, plus a committed package-lock.json. engines.node is >=22.18.
  • Build: vp pack builds src/index.ts (was src/mod.ts) into dist/index.js (ESM) and dist/index.cjs (CommonJS), each with its own declaration file. The target is es2022, the same as the dnt lib. exports["."] keeps the import/require pair, and main/module/types point at dist/. The tarball ships only dist/, README.md, and LICENSE.
  • Lint: every Oxlint category except nursery is on, plus eslint-plugin-explicit-types and eslint-plugin-import-structure through their all configs. Repo-wide offs, each with a reason, and the projectOverrides array live in scripts/project-lint*.ts, along with the hugoalh ports (including no-nan). Every rule from the Deno config is still covered: the full table is in .agents/memory/lint-parity-with-deno.md.
  • Format: Oxfmt (printWidth: 80, quoteProps: "preserve", embeddedLanguageFormatting: "off"), so example/index.html gets reindented.
  • Source: two lint fixes in src/index.ts. The native attachShadow is now read through a function-typed property (typescript/unbound-method), and the patched function is named attachShadow (func-names). As a side effect, Element.prototype.attachShadow.name is now "attachShadow" instead of "". Nothing else changes.
  • Tests: new Vitest tests in src/index.test.ts run in happy-dom. They cover the document and existing, open, and closed shadow roots, restoring the sheet after it is overwritten, repeat calls, and the patched method's name.
  • CI: new ci.yml runs vp check, vp pack, and npm pack --dry-run, then vp test on Node 22.18.0 and latest. publish.yml now publishes when a GitHub release is published (it used to run on tag push). It first runs the full CI, checks that the tag matches the package.json version, then runs vp pack and npm publish --provenance with OIDC and no token.
  • Docs: AGENTS.md and .agents/ notes (including lint-config.md), plus the release and review-cycle skills. npm run example replaces deno task example. README unchanged.

Risks

  • Publishing: the trigger moved from a v* tag push to a published GitHub release. The workflow file is still publish.yml, so npm's trusted publisher should still match, but the first release from it will confirm that. The version now comes from package.json (0.1.6, the latest on npm), not the tag.
  • Package shape: there are no more esm//script/ folders and no src/ copy in the tarball. Deep imports into those paths stop working, but they were never part of exports. The package root now has "type": "module", which is safe because the CommonJS file uses .cjs.
  • Open PR: Framed pages #1 ("Framed pages") needs main merged in after this lands. Expect conflicts in src/mod.ts (now src/index.ts), the reformatted example/index.html, and scripts/build-npm.ts (deleted). Its frame code will also have to pass the new lint rules.

🤖 Generated with Claude Code

@temeddix
temeddix merged commit e4cc6a5 into main Oct 20, 2026
3 checks passed
@temeddix
temeddix deleted the node-migration branch October 20, 2026 14:15
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