Update maidr w/ npm auto-update - #2205
Open
jooyoungseo wants to merge 1 commit into
Open
jooyoungseo wants to merge 1 commit into
jooyoungseo wants to merge 1 commit into
Conversation
Mirror the eight locale packs maidr.js loads from beside itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 28, 2026
jooyoungseo
added a commit
to xability/maidr-skill
that referenced
this pull request
Sep 28, 2026
Since maidr.js 4.8.0 only English is in the bundle; ko, ja, zh, es, de, fr, it and hi are dist/locale-<code>.js packs that maidr.js fetches from beside its own URL, or from window.maidrLocaleBaseUrl when set (Dc() in the vendored 4.11.0 bundle; maidr docs/LOCALIZATION.md). The skill's offline paths never reached them: - inline bundle: no URL, so "[maidr] Cannot locate the locale pack" and English. javascript.md, python.md's one-file recipe and the template comment now put a jsDelivr maidrLocaleBaseUrl declaration before the bundle (a maidr@X.Y.Z pin, so update-bundle.sh and the pin check cover it), and say to paste the reader's pack too for an offline file. - vendored ./maidr.js: ./locale-ko.js 404s. New scripts/fetch_locale_packs.py puts the packs beside it (from jsDelivr, or --from a local dist), checking each is the pack for its code. The packs are not vendored into assets/. - cdnjs: mirrors no packs (4.8.0-4.10.0; cdnjs/packages#2205). Documented in SKILL.md, javascript.md and to_artifact.py. The template loader sets no base URL: it would override packs beside whichever copy loads. check_maidr_html.py warns when maidr.js is inline or relative and the page has no declaration, no locale-*.js script or pasted pack, and no packs beside the local file. Its loader detection, and to_artifact.py's LOADER, now require the bundle's own URL, so the declaration is not taken for a loader (to_artifact would have replaced it with a second maidr.js tag). troubleshooting.md covers both console warnings. Checked in Chromium with locale ko-KR: the inline page fetches maidr@4.11.0/dist/locale-ko.js (200) and announces "Quarter는 Q1, ..."; a vendored page with locale-ko.js beside it does so with the network blocked; en-US requests no pack. Closes #9 Claude-Session: https://claude.ai/code/session_01NozAnjR3Ymjh9RQM8oXkAR Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds maidr's eight locale packs to its file map (#2181 added the library).
Why
Since v4.8.0, maidr ships every language but English as a separate locale pack,
dist/locale-<code>.js, rather than building every dictionary intomaidr.js(xability/maidr#1252). When a reader picks a language, or the browser reports one,maidr.jsloads the pack from beside its own URL, the same way it already loadsmaidr-math.css.On a page served from cdnjs, that resolves to, for example,
https://cdnjs.cloudflare.com/ajax/libs/maidr/4.10.0/locale-ko.js. That URL is a 404 today, so the page stays in English. The file map lists onlymaidr.js,maidr.cssandmaidr-math.css, so 4.8.0 through 4.10.0 on cdnjs each have 6 files and no packs.Files added
locale-ko.jslocale-ja.jslocale-zh.jslocale-es.jslocale-de.jslocale-fr.jslocale-it.jslocale-hi.jsThe list is still explicit rather than a glob, as in #2181 (per #186):
locale-<code>.mjstwins are ES modules for bundlers.maidr.jsnever requests them.locale-<code>.js, and nothing else indist/is loaded relative tomaidr.js. I checked the 4.11.0 bundle: its only relative loads aremaidr-math.cssand these packs.All eight are in the published tarball of every release since 4.8.0, e.g. https://cdn.jsdelivr.net/npm/maidr@4.11.0/dist/.
Checks
filesarray changes; every other field is byte-identical.schema_human.jsonfromcdnjs/tools.cdnjs/maidr.json, with a test that fails if a pack is missing from it. This PR brings the live config in line with it.Versions already on cdnjs keep their current files; releases processed after this change will include the packs.
🤖 Generated with Claude Code