Correctness, security and packaging overhaul — release 0.4.0 - #3
Merged
Merged
Conversation
…i 15. So it works on my v.old ipad air 2
…onfigurations Added `dist-smoke.test.ts` to validate packaged build artifacts including module formats, export maps, and syntax compatibility. Updated `package.json` and documentation to better support package consumers. Adjusted test resolver to ensure examples use source files during development.
… integrate freezing and cloning improvements, and update `package.json` with browser compatibility and build settings adjustments.
…async operations, proxy conformance, and advanced value handling. Introduced ESLint configuration for consistent code quality.
…ersions, and release automation Configured `.github/workflows/ci.yml` to run quality checks (lint, typecheck) and tests on Node.js versions 20, 22, and 24. Updated `release.yml` to streamline version handling, artifact publishing, and npm releases. Adjusted `package.json` to include `pnpm` package manager specification.
Configured `LayeredConfig` to warn and resolve missing keys to `undefined` by default. Updated tests and documentation to reflect this behavior and added the ability to customize the handler for different use cases. Integrated performance guard tests and adjusted CI workflow to exclude them from coverage runs.
Documents the correctness, security and packaging work in CHANGELOG.md, and ships it in the published package (`files` is an allowlist, and npm's always-included set does not cover it). Released as 0.4.0 rather than 0.3.0: that version is already on npm from a separate line of work, so it cannot be republished. The changelog records the gap so 0.2.1 upgraders are not left wondering. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EKcR1Xs7sAKKYYgn5vs69q
`cache: pnpm` and `pnpm install --frozen-lockfile` both require a committed lockfile. This repository deliberately ignores one - the note at the top of .gitignore says libraries should not impose specific versions - so setup-node failed with "Dependencies lock file is not found" before any step could run. Drops both, with a comment recording why, so the constraint is not reintroduced by someone tidying up. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EKcR1Xs7sAKKYYgn5vs69q
pnpm 12 refuses to run a dependency's install script unless it is approved, and this project's approval for esbuild lives in pnpm-workspace.yaml - which, like pnpm-lock.yaml, is gitignored. CI therefore failed with ERR_PNPM_IGNORED_BUILDS. Skipping dependency install scripts sidesteps the approval entirely and is the safer default for CI anyway; esbuild's binary comes from its platform package, so the build is unaffected. Verified on a tree with neither file present: install, lint, typecheck, build and all 290 tests pass. Also drops a `pnpm.onlyBuiltDependencies` field added while diagnosing this - pnpm 12 reads that setting from pnpm-workspace.yaml, not package.json, so it had no effect. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EKcR1Xs7sAKKYYgn5vs69q
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.
Seven commits of correctness, security and packaging work, released as 0.4.0. Full detail in
CHANGELOG.md; this is the summary.Security
Object.prototypevia__proto__orconstructor.prototype— reachable in practice, since a layer parsed from JSON carries__proto__as a real own property thathasOwnPropertydoes not filter out.Breaking
undefinedinstead of throwing.cfg['a.b']andcfg.a.bwere separate resolvers that disagreed — inverted layer precedence, one-level-deep merging, arrays returned as{"0":"a"}, array merge strategies invisible. They are now one resolver.cfg['constructor.name']and friends no longer resolve.freeze: trueno longer freezes objects you still hold.toJSON,toString, unknown symbols,$$/@@sentinels) resolve toundefinedinstead of throwing.Config Layers→ConfigLayers;typescorrected todist/index.d.ts.Notable fixes
new RegExp("…"), which parses and then throws on the first key lookup. The splitter is now hand-written and the bundle contains no regexes at all.Date,Bufferand class instances, and threw when a layer overrode a scalar with an object.__derivedropped symbol-named layers and reordered numeric-looking ones, inverting precedence.String(config),JSON.stringify(config),config.nameandObject.getOwnPropertyDescriptorall misbehaved or threw.Performance
Measured against 0.2.1, both in one process:
config['a.b.c.d']config('a.b.c.d')config.flatfromLayers(...)Construction pays for the deep copy that makes the ownership guarantees real — microseconds, once at startup. Read paths are guarded against regressing by
tests/performance.test.ts.Tooling
sideEffects: falseadded.Why 0.4.0 and not 0.3.0
config-layers@0.3.0is already on npm (published 2026-04-21) from a separate line of work not in this history, and npm does not allow republishing a version. The changelog records the gap.Releasing
After merge, tag from
main— that firesrelease.yml, which verifies, builds, packs, creates the GitHub Release and publishes to npm with provenance:Requires
NPM_TOKENin Actions secrets; without it the workflow completes but skips publishing with a notice rather than failing.🤖 Generated with Claude Code
https://claude.ai/code/session_01EKcR1Xs7sAKKYYgn5vs69q