Skip to content

build: ship compiled ESM/CJS output and prepare 0.2.0 - #16

Merged
bntvllnt merged 7 commits into
mainfrom
chore/stable-readiness
Oct 31, 2026
Merged

bntvllnt merged 7 commits into
mainfrom
chore/stable-readiness

Conversation

@bntvllnt

Copy link
Copy Markdown
Collaborator

Prepares the next stable (0.2.0) without publishing it.

Package

  • Ships compiled output: 0.1.1 published raw src/*.ts (even for require), so it only worked when the consumer's bundler transpiled node_modules. A tsup build now emits ESM, CJS and type declarations in dist; . and ./react keep their names and peer range; ./package.json is exported. Code splitting keeps one shared analytics state across both entries.
  • getConsentFromCookie matched the cookie name unanchored, so a cookie named evil-vllnt-consent=1 granted consent; now anchored (the old it.fails test is now two real tests).
  • track("") and identify("") are ignored instead of recording junk.
  • New CHANGELOG.md with history from npm (0.1.0 = 2026-03-05, 0.1.1 = 2026-03-10).

Supply chain / CI

  • Actions pinned to SHAs, least-privilege permissions; @latest only from a pushed vX.Y.Z tag on main matching package.json and the CHANGELOG; npm trusted publishing with provenance, no token. Canary still publishes on every push to main (and by manual run). The RELEASE_PAT secret is no longer used.
  • pnpm 10 with a 7-day release-age gate and install scripts blocked by default; low-memory dev defaults (vitest maxWorkers: 2, ESLint cache, incremental tsc --noEmit).

Verification: clean install, lint, typecheck, 123 tests at 100% coverage, build; packed tarball imports via ESM and require and type-checks under bundler and nodenext.

Remaining known advisory: minimatch GHSA-g3hv-75wg-m249 (moderate, dev-only via ESLint plugins; fix only in a new major released this week).

Publish dist built with tsup instead of raw TypeScript sources. Export
subpaths and peer ranges are unchanged. Also move to pnpm 10 with a
7-day minimum release age and no dependency build scripts.
Publish via npm trusted publishing with provenance; @latest only from a
v*.*.* tag on main matching package.json and CHANGELOG.md. Canary on main
push when CANARY_ENABLED is true or by manual dispatch. Add CONTRIBUTING.
…user ids

getConsentFromCookie matched any cookie whose name ended with the consent
cookie name, so a look-alike cookie could grant consent. track() and
identify() now ignore empty or non-string names instead of recording them.
@bntvllnt
bntvllnt merged commit 13db137 into main Oct 31, 2026
8 checks passed
@bntvllnt
bntvllnt deleted the chore/stable-readiness branch October 31, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant