build(scripts): convert the last 14 standalone .mjs scripts to real .ts - #7751
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
loopover-ui | 284beb8 | Commit Preview URL Branch Preview URL |
Jul 21 2026, 02:21 PM |
Bundle ReportChanges will decrease total bundle size by 10 bytes (-0.0%) ⬇️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: loopover-uiAssets Changed:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7751 +/- ##
=======================================
Coverage 91.37% 91.37%
=======================================
Files 729 729
Lines 74671 74671
Branches 22791 22791
=======================================
Hits 68229 68229
Misses 5396 5396
Partials 1046 1046
Flags with carried forward coverage won't be shown. Click here to find out more.
|
e14217c to
430b033
Compare
|
Warning ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-21 14:39:08 UTC
Review summary Nits — 5 non-blocking
Concerns raised — review before merging
📋 Copy for AI agents — paste into your coding agentDecision drivers
Context & advisory signals — never blocks the verdict
Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. Visual preview
Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. Scroll preview
A short scroll-through clip (desktop) — click either thumbnail to open the full animation. Evidence for scroll-linked behavior a single screenshot can't show. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
430b033 to
fce38af
Compare
fce38af to
330d684
Compare
74c0ec6 to
4ac3aff
Compare
330d684 to
37bbea1
Compare
4ac3aff to
2e1249b
Compare
37bbea1 to
461e065
Compare
Same motivation as the prior commit, extended to scripts/: a hand-maintained .d.mts alongside a .mjs is exactly the duplicated-declaration problem the TypeScript migration was supposed to eliminate, and it can silently drift from the real implementation with no compiler ever checking it. Converts all 39 remaining scripts/*.mjs files that had one -- the mcp-release/ orb-release family, every docs/settings/schema drift checker, and the rest of the standalone generators -- to real .ts, inferring each function's types from its actual behavior rather than trusting the old declaration, per the pattern proven out on the miner/mcp packages. Nothing in scripts/ was ever part of Codecov's coverage surface, so this adds no coverage obligation; it's a straight type-safety and drift-elimination win. Real drift the old .d.mts files had already accumulated, found while converting: - check-schema-drift.ts read a table's name via SQLiteTable.Symbol.Name, an @internal drizzle-orm symbol never in its public type exports (which is exactly why the old hand-written declaration typed it without complaint) -- switched to the public getTableName(). - ci-duration-report.ts's WorkflowRun type was missing the `event` field the code actually filters on. - orb-release-core.ts's IMAGE_RELEVANT_PREFIXES still named two sibling scripts by their old .mjs filenames, now renamed here too -- a commit touching either file under its real name would have silently stopped counting as image-relevant. Every consumer updated to match: .js-suffixed import specifiers (Vite/ esbuild/Wrangler already resolve these to the sibling .ts, same as the prior commit), test imports, and every real invocation site. A script whose own file stays .mjs but now imports something converted here (e.g. check-mcp-package.mjs importing forbidden-content.ts) needs tsx instead of plain node, since only tsx (not node --experimental-strip-types) resolves a same-directory .ts import transitively; a script with zero local imports uses --experimental-strip-types directly, cheaper than spawning tsx. Covers every affected npm script, the three release-watch GitHub workflows (which previously needed no npm install at all -- added ./.github/actions/setup-workspace to each), the Dockerfile, and deploy-selfhost-prebuilt.sh. That last category caught two live regressions already sitting on this branch from the prior commit, beyond the one this commit's own check-miner-deployment-docs.ts conversion fixes (that one's what's been failing this PR's own CI): packages/loopover-miner/scripts/ generate-env-reference.mjs (npm run miner:env-reference, part of test:ci) and the Dockerfile/deploy-selfhost-prebuilt.sh's validate-selfhost-sourcemap invocations were both silently broken the same way -- caught by grepping for every remaining literal .mjs reference to a converted filename repo-wide, not by any test, since the one existing test for the miner env-reference generator imports it through Vite (which already tolerates the mismatch) rather than spawning it as the real subprocess the npm script actually runs.
Closes out the scripts/ TypeScript migration this branch's base commit
started: every remaining scripts/*.mjs file that had no paired .d.mts
(so wasn't covered by the prior "convert every .mjs/.d.mts pair"
commit) is now real .ts, type-checked against its actual behavior
instead of running untyped. Covers the actionlint/build-selfhost/
check-migrations/compute-test-shards/rees-coverage/smoke-observability-
{metrics,traces}/smoke-ui-browser/check-{mcp,miner}-package/
check-mcp-release-candidate/check-orb-{release,stable-release}-due/
check-changelog families.
Every consumer updated to match: package.json scripts, GitHub
workflows (orb-beta-release, orb-stable-release-pr, publish-miner,
release-selfhost, selfhost, test-timing-refresh), the Dockerfile and
.dockerignore, deploy-selfhost-prebuilt.sh, and comment-only references
across src/queue/processors.ts, packages/loopover-engine's deny-hooks,
the selfhost stub files, and the self-hosting docs pages. A script
invoked directly as a subprocess (not a same-directory .ts import)
keeps plain `node --experimental-strip-types`; one that imports another
local .ts file (e.g. check-orb-release-due.ts importing
orb-release-core.ts) needs tsx instead, since only tsx -- not node's
native strip-types -- resolves a `.js`-suffixed specifier to a sibling
.ts transitively.
Real invocations verified for every converted script against this
repo's own state (migrations, git tags, the packed npm tarballs, a
live loopover.ai smoke check, actionlint/composite-action lint), not
just typecheck -- including reproducing rees-coverage.ts's one
pre-existing, already-tolerated (`|| true` in ci.yml) analyzer-metadata
ENOENT quirk against the original .mjs to confirm it predates this
conversion rather than being introduced by it.
# Conflicts:
# scripts/check-changelog.ts
461e065 to
284beb8
Compare


Summary
Stacked on #7705 (needs that one merged/rebased first — this branch depends on its
orb-release-core.ts,mcp-release-candidate-core.ts,forbidden-content.ts, and the "compiled miner/mcp output is no longer committed" model).Closes out the
scripts/TypeScript migration #7705 started: that PR converted everyscripts/*.mjsfile that had a paired hand-maintained*.d.mtsdeclaration, but 14 files had no.d.mtstwin (so were out of that PR's stated scope) and were left running as untyped.mjs. This PR converts the rest, soscripts/is now 100% real.tswith zero untyped files.Converted:
actionlint,build-selfhost,check-migrations,compute-test-shards,rees-coverage,smoke-observability-{metrics,traces},smoke-ui-browser,check-{mcp,miner}-package,check-mcp-release-candidate,check-orb-{release,stable-release}-due,check-changelog.Every consumer updated to match:
package.jsonscripts, theorb-beta-release/orb-stable-release-pr/publish-miner/release-selfhost/selfhost/test-timing-refreshworkflows, theDockerfileand.dockerignore,deploy-selfhost-prebuilt.sh, and comment-only references insrc/queue/processors.ts, the miner deny-hooks, the selfhost stub files, and the self-hosting docs pages.A script invoked directly as a subprocess (no same-directory
.tsimport) keeps plainnode --experimental-strip-types; one that imports another local.tsfile (e.g.check-orb-release-due.ts→orb-release-core.ts) needstsxinstead, since onlytsx— notnode's native strip-types — resolves a.js-suffixed specifier to a sibling.tstransitively.Also includes one fix picked up from #7705's own CI (rebased on top of it here):
validate-testsonly ever built@loopover/enginebefore running tests, never@loopover/mcp/@loopover/miner, so once compiled output stopped being committed, everymcp-cli-*/miner-*test that spawns the real CLI binary failed withMODULE_NOT_FOUNDacross all 3 shards. Fixed by mirroringvalidate-code's own "Build MCP"/"Build miner CLI" steps.Test plan
npm run typecheckcleannpm run actionlint/npm run lint:composite-actionscleannpm run db:migrations:check/npm run db:schema-drift:checkclean (touched by thecheck-migrations/check-schema-driftconversion)compute-test-shards,codecov-policy,check-{mcp,miner}-package,generate-mcp-changelog-script,orb-release,docs-selfhost-update-rollback,selfhost-sentry-release,observability-release-fetch-timeout,selfhost-observability-config,ci-engine-miner-filters,forbidden-content— 12 files, 129/129 testscheck-migrations/check-schema-driftagainst realmigrations/;check-orb-release-due/check-orb-stable-release-dueagainst real git tags;check-mcp-release-candidate/rees:coverage(fullrees:testbuild + coverage harvest, 1346/1346 REES tests);build-selfhost.ts --all(real esbuild bundle);smoke-ui-browser.tsagainst the live production site (read-only)describe()titles) — zero leftrees-coverage.tsanalyzer-metadata.jsonENOENT (root cwd vs. relative-path read) is pre-existing on the original.mjs(byte-diffed) and already tolerated via|| trueinci.yml— not introduced by this conversion