Move the action from Deno to Node.js and Vite+ #20
Reference in New Issue
Block a user
Delete Branch "node-migration"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Moves
commons/bot-agentsoff Deno. The action's TypeScript now runs directly on the job image's Node.js (node src/<phase>.ts, using Node's built-in type stripping), with no build step and still no runtime dependency. Repository checks move to Vite+ (vp check,vp test).What changed
action.ymlrunsprepare.ts,run.ts, andpost.tswithnodeinstead ofdeno run -A.package.json("type": "module",engines.node >=24.2forimport.meta.main) is now copied into the root-owned source copy byscripts/protect-source.sh.profiles.yml→profiles.json, with the same content (encrypted values unchanged), parsed withJSON.parse. This drops the only runtime dependency (@std/yaml).src/command.tswrapschild_process.spawnwith the oldDeno.Commandshapes:output()/spawn(),clearEnv,uid/gid, and Deno's stdio defaults (stdin inherited; stdout/stderr piped foroutput(), inherited forspawn()). A signal exit maps to128 + signo. Status settles on process exit.src/errors.tsmapsNotFoundtoENOENT/ESRCH.makeTempFilebecomes an exclusivewx0600 create.run.tsis split intorun-context.ts,agents.ts, andagent-{claude,codex,opencode}.ts.post.tsis split intopost.tsandpost-artifacts.ts.parseCredentials,readOutcome, andpostRuntimeare broken into helpers.reducechain, so they stay sequential./procstatus reads becamePromise.all.src/json.tsadds type guards in place ofascasts.Deno.testcases were converted to Vitest with the codemod, and its TODOs were finished by hand.src/*.test.ts; the repository-level workflow test istests/workflow.test.ts.test.skipIf(!IS_ROOT), so they show as skipped instead of silently passing.tests/entrypoints.test.tsruns each phase under real Node to prove its whole import graph loads.package.json,tsconfig.json, andvite.config.ts, pluspackage-lock.json.scripts/project-lint.tsholds the rule list. It maps Deno'srecommendedrules that fall outside those categories, adds the template'sid-match,no-disable-comments, andno-non-ts-imports, and maps Deno'sno-window/no-process-global/no-node-globalstono-restricted-globals(soprocess/Buffercome fromnode:imports)..gitea/workflows/check.ymlrunsnode --version,npm ci,npx vp check, andnpx vp testin the default runner image.Deviations / risks
@mainswitch. Six consumer repos usecommons/bot-agents@main, so merging switches all of them at once. Suggested before merging: tag the currentmain(e.g.deno-final) as a rollback target, and canary this branch from one consumer (uses: …/commons/bot-agents@node-migration) on a throwaway PR.post.tsrelies onimport.meta.main, which needs Node ≥ 24.2. DANNYEC's cachednode:24-bookwormminor is unknown (forcePull=false), and the CI job now printsnode --versionto confirm it.denoremains in the action's global npm install because agents still verify Deno-based consumers (memona, memona-home). Remove it once those repos move.prefer-readonly-parameter-typesis off. This pedantic rule is turned off, as in the explicit-types template and the app repos, because Node/web types (Response,Stats,RequestInit) can never satisfy it.scripts/**has one narrow override (no-unsafe-enum-comparison) for AST nodetypecomparisons./userand comment responses are checked.TypeError(same messages).@cunarist/eslint-plugin-*, and CI can pass as is.Verification
vp check: formatting, lint (0 warnings), and type check all pass.vp testas a normal user: 56 passed, 5 root-only skipped.vp testas root innode:24-bookworm(Node v24.22.0, the CI image): all 61 passed, including the UID isolation, process cleanup, andprepare.tscleanup tests.node:24-bookworm, with fakecodex/claude/npxbinaries and a fake Gitea, throughprotect-source.sh→prepare.ts→run.ts→post.ts:/root/.codex/auth.json(0600).🤖 Generated with Claude Code
@bot
✅ Approved
Node/Vite+ migration is ready to merge.
Checks
Verification
npm cinpx vp checknpx vp test— 61 passedCheck / checkpassed on8f23da2@bot
✅ Approved
Node/Vite+ migration is ready to merge.
Checks
Verification
npx vp check— formatting, lint, and type checks passed.npx vp test— 56 passed, 5 root-only tests skipped.Check / check (pull_request)passed onc02ab9b.Strengths
Issues
Alias-target rule docs landed after this merge, so they moved to #21.