Repository navigation
Repo polish: Node-compatible ESM build, shared scoring engine, CI, docs and licenses - #4
Merged
Merged
Conversation
…rball The build used moduleResolution "bundler" with extensionless relative imports, so dist/index.js failed to load under Node ESM (ERR_MODULE_NOT_FOUND) and only worked through a bundler. Switch to NodeNext and add .js extensions. tsc also compiled *.test.ts into dist/ and failed on node:crypto for lack of @types/node. Split the emitting config into tsconfig.build.json (excludes tests), add @types/node, and add typecheck/format/check:package scripts with Prettier, publint and @arethetypeswrong/cli. package.json: list "types" first in exports, add "default", expose ./package.json, mark sideEffects false, exclude tests from "files", declare engines and publishConfig. Stop tracking .claude/settings.local.json. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FGXjqn5CZbnVLNtHjkp45t
scoring.ts and purrjungScoring.ts carried three copies of the same sum / threshold / percentage logic that differed only in question IDs, score range and pole letters. Move that into an internal scale.ts and express each test as a ScaleSpec. Results are unchanged; the existing 212 tests pass without modification. Add SUPPORTED_LOCALES, PURRJUNG_LOCALES, DEFAULT_LOCALE, the Locale type and getLocalizedText() so consumers stop hand-maintaining the locale list. Rename BilingualText to MultilingualText and keep the old name as a deprecated alias. Type quickTestQuestionIds as DimensionQuestions. New tests: locale coverage on every question, PurrJung scoring (it had none), and a pinned list of public runtime exports so removals are loud. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FGXjqn5CZbnVLNtHjkp45t
CI runs typecheck, Prettier, tests, build, a Node ESM import smoke test and publint/attw on Node 20, 22 and 24 for every push and PR. The publish workflow now triggers on a published release (not a created draft), refuses to publish when the tag does not match package.json, and no longer bumps versions or pushes to main from CI. prepublishOnly runs the full check. Issue forms: bug report and translation correction (the fields TRANSLATIONS.md asks reporters for). PR template carries the contract checklist. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FGXjqn5CZbnVLNtHjkp45t
…E-DATA README now documents every public area (full, quick, single-dimension, quality metrics, locales, PurrJung) with a scoring-model table that makes the PurrJung TF inversion explicit, and carries CI/license badges. LICENSE is plain MIT so GitHub detects it; LICENSE-DATA restates the CC BY-NC-SA 4.0 terms on the questionnaire content. CONTRIBUTING lists the contracts that must not change silently and the release steps. CHANGELOG seeds Unreleased with everything since @openmbti/core@1.0.1. TRANSLATIONS.md and the skill docs are only reformatted by Prettier. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FGXjqn5CZbnVLNtHjkp45t
…de 20 TRANSLATIONS.md only says the five original locales were unchanged by the 39-locale expansion, not that they were reviewed. Say "original" instead. Node 18 is EOL and untested here; engines now says >=20 to match the CI matrix. Date the TF Q2 fix to 1.0.1 (published one minute after that commit). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FGXjqn5CZbnVLNtHjkp45t
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.
What
A pass over packaging, code structure, CI and documentation so the package is publishable as
@openjung/coreand the repository reads like a maintained open-source project. No scoring result changes; the 212 existing tests pass with no assertion changes (only import extensions and Prettier formatting), with 24 added.Build and packaging
dist/index.jscould not be loaded by Node ESM (extensionless relative imports undermoduleResolution: bundler). Switched toNodeNextwith.jsextensions. CI now smoke-imports the built package under Node.tscfailed onnode:cryptoin a test and compiled*.test.tsintodist/. Addedtsconfig.build.json,@types/node, and excluded tests from the tarball.exportsliststypesfirst, addsdefaultand./package.json;sideEffects: false,engines,publishConfigwith provenance.publintand@arethetypeswrong/clipass..editorconfig+.node-version;.claude/settings.local.jsonuntracked.Code
src/scale.ts) replaces three copies of the sum / threshold / percentage logic. Each test is aScaleSpec(question IDs, range, pole letters).SUPPORTED_LOCALES,PURRJUNG_LOCALES,DEFAULT_LOCALE,Locale,getLocalizedText().MultilingualTextreplacesBilingualText(kept as a deprecated alias).quickTestQuestionIdsis typedDimensionQuestions.Repo
package.json, and no longer bumps or pushes from CI.LICENSE(MIT) so GitHub detects it,LICENSE-DATAfor the CC BY-NC-SA questionnaire content,CONTRIBUTING.mdwith the contracts that must not change silently,CHANGELOG.md, README rewrite covering every public API area.Contracts
src/index.test.ts)npm run checkpasses locallyNotes for review
npm run buildthennpm test --workspace=@openjung/core; both scripts keep their names anddist/index.js/dist/index.d.tsstay where they were.src/questions.tsandsrc/purrjungQuestions.ts(one-line objects become multi-line). This will conflict with feat: weighted question scoring with deterministic tie-breaking #2; that PR needs a rebase either way.@openjung/corehas never been published to npm. The first publish needs an npm login with rights on the@openjungscope and theNPM_TOKENsecret; see the Releasing section of CONTRIBUTING.md.🤖 Generated with Claude Code
https://claude.ai/code/session_01FGXjqn5CZbnVLNtHjkp45t