fix: replace moonbitlang/core/strconv with core/string - #32
Conversation
`moonbitlang/core` 0.10.12 removed `moonbitlang/core/strconv`; only
`core/internal/strconv` remains. Any module that depends on mocket now
fails package solving before a single file is compiled:
Cannot find import 'moonbitlang/core/strconv' in oboard/mocket@0.9.1
`core/string` carries the same API on both 0.10.11 and 0.10.12, so this
builds on the current stable toolchain and on nightly.
- root `moon.pkg` imported `core/strconv` but nothing in the package
referenced `@strconv`; it already imports `core/string`. Dropped.
- the three packages that do parse a port switch to
`@string.from_str`, which is the same `FromStr` trait method exposed
as a free function, so the call sites keep their inferred-type form.
Verified with moonc v0.10.11+6ff76a5f9 (stable) and
v0.10.11+9de356786-nightly:
before, nightly moon check -> exit 255, cannot find core/strconv
after, nightly moon check -> exit 0
after, stable moon check js and native -> exit 0
after, stable moon test js,native -> 105 and 100 passed
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmoyPMELemz5hdNNdXyAkm
|
CI on this PR is red, but not because of anything it changes — it fails at step 6 of 10:
I confirmed it is pre-existing by stashing this branch and running the same gate against I've opened #33 with the two fixes that restore green CI (the So this should go green on a rebase once #33 lands, with no changes needed here. Ordering is the only dependency. 🤖 Generated with Claude Code |
moonbitlang/core0.10.12 removedmoonbitlang/core/strconv— onlycore/internal/strconvremains. Any module depending on mocket now fails package solving before a single file is compiled:I hit this from downstream — an example in rabbita that depends on mocket stopped resolving on the nightly toolchain.
core/stringcarries the same API on both 0.10.11 and 0.10.12, so this builds on current stable and nightly.Changes
moon.pkg(root) importedcore/strconv, but nothing in the package references@strconv— the import was dead. The package already importscore/string, so this is just a deletion.benchmarks/mocket,benchmarks/mocket_middleware,examples/routeeach parse a port. They switch to@string.from_str, which is the sameFromStrtrait method exposed as a free function (#as_free_fn), so the call sites keep their inferred-type form:7 files, +6/−7.
Verification
moon check --target nativev0.10.11+9de356786-nightlymainCannot find import 'moonbitlang/core/strconv'v0.10.11+9de356786-nightlyv0.10.11+6ff76a5f9moon test --target js,nativeon this branch: 105 passed (js), 100 passed (native).Heads-up, unrelated to this PR
While running your CI steps locally on the current stable toolchain (
moon 0.1.20260827/moonc v0.10.11+6ff76a5f9), two of them fail onmainitself, with this branch stashed:moon check --deny-warn— exit 255:moon fmt+git diff --exit-code— the formatter rewrites a number of files (content_type.mbt,cookie.mbt,dispatch.mbt,middleware.mbt,mocket.js.mbt, …).Your last green run was 2026-08-22, so I think the toolchain has moved since. I deliberately left both alone to keep this PR reviewable rather than burying a 7-line fix under unrelated reformatting — happy to send either as a separate PR if useful.
🤖 Generated with Claude Code
https://claude.ai/code/session_01AmoyPMELemz5hdNNdXyAkm