From 4af7c2d36e149e00113ac446127a1fd9b15f90d9 Mon Sep 17 00:00:00 2001 From: Andrey Rychkov Date: Wed, 2 Dec 2026 12:26:18 -0500 Subject: [PATCH 1/2] Add a changelog, changesets and contributor docs Reconstruct CHANGELOG.md for 0.1.0 to 0.4.0 from the GitHub releases and pull requests, and ship it in the package. Set up Changesets, with @changesets/cli and @changesets/changelog-github pinned like the other dev dependencies, so that a release pull request made with `changeset version` raises the version and writes the changelog. The manual "Publish to npm" workflow is unchanged and still publishes. Add CONTRIBUTING.md (commands, layout, changesets, releases, dependencies), SECURITY.md, an issue form for wrong scan results, a pull request template and AGENTS.md for coding agents. --- .changeset/README.md | 7 + .changeset/config.json | 7 + .github/ISSUE_TEMPLATE/config.yml | 4 + .github/ISSUE_TEMPLATE/scan-result-wrong.yml | 50 ++ .github/pull_request_template.md | 10 + AGENTS.md | 43 ++ CHANGELOG.md | 53 ++ CONTRIBUTING.md | 115 +++++ README.md | 2 + SECURITY.md | 21 + THIRD_PARTY.md | 1 + package-lock.json | 498 ++++++++++++++++++- package.json | 6 +- 13 files changed, 814 insertions(+), 3 deletions(-) create mode 100644 .changeset/README.md create mode 100644 .changeset/config.json create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/scan-result-wrong.yml create mode 100644 .github/pull_request_template.md create mode 100644 AGENTS.md create mode 100644 CHANGELOG.md create mode 100644 CONTRIBUTING.md create mode 100644 SECURITY.md diff --git a/.changeset/README.md b/.changeset/README.md new file mode 100644 index 0000000..43be09b --- /dev/null +++ b/.changeset/README.md @@ -0,0 +1,7 @@ +# Changesets + +Each Markdown file in this folder describes one change for users of the package. `npx changeset` writes one; the +release pull request turns them into the next version and its `CHANGELOG.md` entry and deletes them. + +How to choose between `minor` and `patch`, and how a release is made, is in +[CONTRIBUTING.md](../CONTRIBUTING.md#changesets). diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 0000000..e50b940 --- /dev/null +++ b/.changeset/config.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://unpkg.com/@changesets/config@4/schema.json", + "changelog": ["@changesets/changelog-github", { "repo": "Huldoser/code-inventory", "disableThanks": true }], + "commit": false, + "access": "public", + "baseBranch": "main" +} diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..5780a9b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,4 @@ +contact_links: + - name: Report a vulnerability + url: https://github.com/Huldoser/code-inventory/security/advisories/new + about: Privately, as SECURITY.md describes, not in a public issue. diff --git a/.github/ISSUE_TEMPLATE/scan-result-wrong.yml b/.github/ISSUE_TEMPLATE/scan-result-wrong.yml new file mode 100644 index 0000000..7016e1d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/scan-result-wrong.yml @@ -0,0 +1,50 @@ +name: The scan reports something wrong +description: A reference, call, caller, entry path or changed declaration is missing, extra or in the wrong place. +labels: [bug] +body: + - type: markdown + attributes: + value: >- + A small project that shows the problem is the most useful part of a report. Rename what you can't share, but + keep the imports, exports and calls that lead to the wrong result. + - type: textarea + id: source + attributes: + label: Source files + description: >- + The smallest set of files that shows the problem, each with its path, and the tsconfig.json or package.json + that the scan reads, if it matters. + render: ts + validations: + required: true + - type: input + id: command + attributes: + label: Command + description: The command you ran, or the library call and its options. + placeholder: npx code-inventory . --symbol normalize --format json + validations: + required: true + - type: textarea + id: output + attributes: + label: What the scan reports + description: The part of the output that is wrong, and any diagnostics the scan printed. + render: json + validations: + required: true + - type: textarea + id: expected + attributes: + label: What you expected + description: The reference, call or path you expected, and why, for example the line that calls the declaration. + validations: + required: true + - type: input + id: versions + attributes: + label: Versions + description: Of code-inventory and Node.js. + placeholder: code-inventory 0.4.0, Node.js 26 + validations: + required: true diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..07781b3 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,10 @@ +## What changed + + + +## Checklist + +- [ ] `npm run check` passes, and tests cover the change. +- [ ] The docs describe the change: the README, or the guide or reference pages in `docs/`. +- [ ] No docs change is needed. +- [ ] A changeset describes the change for users (`npx changeset`), or the change does not affect them. diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..a727a42 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,43 @@ +# AGENTS.md + +Notes for coding agents working in this repository. People should read CONTRIBUTING.md. + +## Commands + +- `npm ci --ignore-scripts --no-audit` to install, with the Node.js version in `.node-version`. +- `npm run check` runs every project check: typecheck, build, lint, tests and formatting. It must pass. +- `npm test` alone needs a fresh `npm run build`: the CLI tests run `dist/cli.js`. +- There is no format script; rewrite a file with `npx prettier --write ` and review the diff. + +## Layout + +- `src/index.ts`: the public library API. `src/cli.ts`: the command line, a thin layer over the library. +- `src/model.ts`: the inventory format. `docs/report-schema.json` is its JSON Schema and ships with the package. +- `src/compiler.ts`: builds the inventory with the TypeScript compiler API. `src/projects.ts` and + `src/discovery.ts`: TypeScript projects and source files. +- `src/query.ts`, `src/reachability.ts`, `src/change-impact.ts`: usage queries, entry paths and the `--changed-since` + report. `src/package-entries.ts` and `src/next-routes.ts`: entry points from manifests, workspaces and Next.js routes. +- `test/fixtures/`: projects the tests scan; never run, linted or formatted. `test/fixtures/saved-reports/`: reports + written by published versions, which the current library must still read. +- `docs/`: the static documentation website (HTML and CSS, relative links), published with the package. + +## Conventions that are easy to get wrong + +- Scanning reads files and never runs the scanned project's code. Only `--changed-since` runs a command, `git`. +- The CLI never overwrites a file: `--output` must name a new path. +- Output must be deterministic: no timestamps or absolute paths, paths relative to the scanned root with `/`, and + stable sorting. +- Reports are `schemaVersion` 1. Readers follow the compatibility rules in `docs/reference.html#compatibility`; a + change that breaks them is a breaking change, and a JSON shape change also updates `docs/report-schema.json`. +- Code problems in the scanned project become diagnostics and make the result `partial`; `--strict` turns that into + exit code 2. Don't throw for them; errors are for invalid options and inputs the scan can't use at all. +- Relative imports in `src/` end in `.ts`; the build rewrites them. Type-only imports use `import type`. +- `no-console` is on; the CLI writes with `process.stdout.write`. +- The only runtime dependency is the TypeScript 6 compiler under the `typescript` alias. Every dependency is pinned to + an exact version. Ask before adding one, and list it in `THIRD_PARTY.md`. +- A change users can see updates `README.md` and the matching page in `docs/` in the same pull request. +- Changesets: a change that affects users carries one (`npx changeset`). Breaking changes are `minor` before 1.0; + never `major`. +- Releases follow CONTRIBUTING.md, Releases: a release pull request made with `npx changeset version`, then the manual + "Publish to npm" workflow. Prepare or publish a release only when a maintainer asks for it, and if a step fails, + stop and report rather than publishing by hand. diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..69e3c95 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,53 @@ +# code-inventory + +## 0.4.0 + +### Minor Changes + +- [#20](https://github.com/Huldoser/code-inventory/pull/20) - Trace the tests affected by a change. With `--changed-since` and `--format json`, the change-impact report is versioned and lists direct references, notes on the diff, and one shortest chain of call sites from each candidate test to each changed declaration. The library exports it as `changeImpact`. + +- [#20](https://github.com/Huldoser/code-inventory/pull/20) - Add `--workspace-entries`, which traces the explicit package entries of npm workspaces and reports the manifest that selected each file, and `--next-routes`, which traces the HTTP handlers exported by Next.js route files. The library exports them as `workspaceEntries` and `nextRouteEntries`. + +## 0.3.3 + +### Patch Changes + +- [#19](https://github.com/Huldoser/code-inventory/pull/19) - Fix two wrong paths in entry reports: a callback parameter named `require` no longer loads a module, and inline type-only imports that the compiler erases no longer trace module initialization. + +## 0.3.2 + +### Patch Changes + +- [#17](https://github.com/Huldoser/code-inventory/pull/17) - No change to the CLI or the library. Reports saved by 0.2.1 and 0.3.0 are now checked against the current schema and replayed with the current library in every test run. + +## 0.3.1 + +### Patch Changes + +- [#15](https://github.com/Huldoser/code-inventory/pull/15) - The package includes the compatibility reference for saved inventories, symbol queries and entry-path reports, and documents the CLI exit codes for successful, failed and strict partial scans. + +## 0.3.0 + +### Minor Changes + +- [#14](https://github.com/Huldoser/code-inventory/pull/14) - Add `--changed-since `. In a Git checkout it lists the declarations that tracked changes touch, their exports, and their references grouped by caller or test file, with source locations for calls and callback reads. Deleted files and removed base lines appear separately. The query uses the current checkout and accepts the summary format. + +## 0.2.1 + +### Patch Changes + +- [#13](https://github.com/Huldoser/code-inventory/pull/13) - Usage and entry-point reports follow explicit relative JavaScript imports to their implementation when a matching TypeScript declaration file is present. This recovers calls through namespace exports, including calls in tests. TypeScript diagnostics still use the declared types, and 0.2.0 snapshots remain readable. + +## 0.2.0 + +### Minor Changes + +- [#11](https://github.com/Huldoser/code-inventory/pull/11) - Trace paths from package entry points with `--package-entries`. The CLI reads explicit `exports`, `main` and `bin` targets and, for compiled packages, maps output files back to source through the selected TypeScript configuration. The library exports `packageEntries` and `entryPath`, the reference includes a JSON Schema for inventory, symbol and entry reports, and the scan summary groups diagnostics by cause. + +- [#12](https://github.com/Huldoser/code-inventory/pull/12) - Resolve wildcard package exports, honoring private and remapped subpaths. Select entry files with `--entry-glob` and model an external call with `--entry-symbol`: a file entry traces module initialization, and a selected handler traces the calls from that declaration. Saved reports record the analyzer version of the installed package. + +## 0.1.0 + +### Minor Changes + +- [#8](https://github.com/Huldoser/code-inventory/pull/8) - First release on npm. Inventory the declarations of a JavaScript or TypeScript project and inspect their references, direct calls, construction sites and distinct callers. Select TypeScript projects and project references, exclude files, and label production, test and tooling code. Trace paths from explicit source entry points, and write terminal, Markdown or versioned JSON reports. Scanning reads the project without running its code. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..aec5bc7 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,115 @@ +# Contributing + +Thanks for helping. Bug reports with a short source file that shows the problem are the most useful contribution. + +## Setup + +Use the Node.js version in [.node-version](.node-version), which CI uses too, then: + +```sh +npm ci --ignore-scripts --no-audit +npm run check +``` + +No dependency needs an install script, so installs skip them. + +| Command | Does | +| -------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `npm run check` | Everything CI checks in the project: typecheck, build, lint, tests and formatting. | +| `npm run typecheck` | Type checks `src/`, the tests and the Vitest config. | +| `npm run build` | Compiles `src/` to `dist/`. | +| `npm run lint` | Checks ESLint rules on `src/` and the tests. | +| `npm test` | Runs the Vitest suite. The CLI tests run `dist/cli.js`, so build first. | +| `npm run format:check` | Checks formatting without rewriting files. `npx prettier --write ` rewrites them. | +| `npm pack --dry-run --ignore-scripts` | Lists the files the package would publish, as CI does. | +| `osv-scanner scan source --offline -L package-lock.json` | Checks the lockfile for known vulnerabilities, if you have osv-scanner installed. | +| `npx changeset` | Writes a changeset for your change. | + +CI also checks the workflows in `.github/workflows/` with actionlint and zizmor. + +## How the code is laid out + +- `src/index.ts` is the library's public API and `src/cli.ts` the command line. `src/model.ts` defines the inventory + format; `docs/report-schema.json` is its JSON Schema and is published with the package. +- `src/discovery.ts` finds source files, `src/projects.ts` loads TypeScript projects, and `src/compiler.ts` builds the + inventory with the TypeScript compiler API. +- `src/query.ts` answers usage queries and `src/reachability.ts` traces paths from entry points. + `src/package-entries.ts` and `src/next-routes.ts` select entry points from package manifests, npm workspaces and + Next.js route files. `src/change-impact.ts` reports the declarations a Git diff touches. +- `src/report.ts` writes the summary and Markdown reports. +- `test/*.test.ts` are the tests. `test/fixtures/` holds the projects they scan; the scanner reads them and never runs + them. `test/fixtures/saved-reports/` holds reports written by published versions, which the current library must + still read. +- `docs/` is the documentation website: static HTML and CSS with relative links, published with the package. + +## Tests + +- Name tests by the behaviour they check. A project that a test scans belongs in `test/fixtures/`; a test that needs + to change files, such as a Git history, builds them in a temporary directory. +- A change to the report format keeps the saved reports in `test/fixtures/saved-reports/` readable, as the + [compatibility rules](docs/reference.html#compatibility) describe, and keeps every report valid against + `docs/report-schema.json`. + +## Docs + +A change that users can see updates the docs with it: `README.md`, and the guide or reference page in `docs/` that +describes the behaviour. Search both for the old behaviour, such as an option, a default, a diagnostic code or a +version, and update each place, not only one. The docs describe the code on `main`. + +## Changesets + +Every change that affects users of the package carries a changeset. Run `npx changeset`, select `code-inventory`, and +describe the change in a sentence or two, for users rather than for reviewers. Changes to tests, CI or development +dependencies don't need one. + +Before 1.0: + +- A breaking change is `minor`. Never choose `major`: it would release 1.0.0. The + [compatibility rules](docs/reference.html#compatibility) say which changes to reports and exit codes are breaking. +- A new feature is `minor`. +- A fix is `patch`. + +## Releases + +Releases are made from `main`. Changesets collect there until a maintainer releases them; merging a pull request +publishes nothing. + +1. Read each pending changeset in `.changeset/` and check that the docs describe it. Fix what's missing in a pull + request first. +2. From an up-to-date `main`, make a branch such as `release-0.5.0` and run + `GITHUB_TOKEN=$(gh auth token) npx changeset version`. It raises the version in `package.json`, writes the + `CHANGELOG.md` entry with a link to each pull request, and deletes the changesets it used. The token is set for this + one command and stored nowhere. +3. Run `npm install --package-lock-only --ignore-scripts --no-audit` so that `package-lock.json` has the new version + too, then `npm run check`. +4. Commit as "Release x.y.z", push, and open a pull request. Review the `CHANGELOG.md` entry and the version, and + squash merge it when the checks pass. +5. Run the "Publish to npm" workflow from the Actions tab on `main`, with the bootstrap box left unticked. It builds, + checks and packs the package, then publishes that tarball from the `npm` environment, which only `main` may use and + which waits for a maintainer's approval. npm's trusted publisher for the package names this repository, + `release.yml` and the `npm` environment, so no npm token is involved. +6. Check that npm lists the version with `npm view code-inventory@x.y.z --prefer-online`; it can take a few minutes. + Then create the `vx.y.z` tag and the GitHub release on the release commit, with the version's `CHANGELOG.md` entry + as its notes. + +### When a release goes wrong + +- **The workflow fails before publishing.** Nothing reached npm. Fix the problem in a pull request and run the workflow + again. +- **A release is broken.** Deprecate it first, so that new installs warn, with a message that says what is wrong and + which version to use: `npm deprecate code-inventory@x.y.z ""`. Then release the fix as a patch. +- **Unpublishing** is only possible for 72 hours after a publish, and a version number can never be used again, even + after it is unpublished. Prefer deprecating. + +## Dependencies + +Every dependency in `package.json` is pinned to an exact version, so a version changes only in a pull request. Update +them after reading their changelogs, with `npm install --save-exact --ignore-scripts`, and run `npm audit`. The only runtime +dependency is the TypeScript 6 compiler, installed as an npm alias; ask before adding another one. + +When a dependency is added, add it to [THIRD_PARTY.md](THIRD_PARTY.md) with its license. + +## Pull requests + +Keep a pull request to one change and fill in the template. Pull requests are squash merged, and the title becomes the +commit message, so write it as a sentence that says what the change does. diff --git a/README.md b/README.md index 8535dd5..ff39338 100644 --- a/README.md +++ b/README.md @@ -82,4 +82,6 @@ osv-scanner scan source --offline -L package-lock.json The project check type-checks source and tests, builds the CLI and library, runs ESLint and Vitest, and checks formatting. CI also validates its workflows with actionlint and zizmor. +[CONTRIBUTING.md](CONTRIBUTING.md) explains the layout, changesets and releases. Changes in each version are listed in [CHANGELOG.md](CHANGELOG.md). Report vulnerabilities privately as [SECURITY.md](SECURITY.md) describes. + [MIT license](LICENSE) ยท [Dependency licenses](THIRD_PARTY.md) diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..05bf18c --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,21 @@ +# Security policy + +## Supported versions + +Security fixes go into the latest release on npm. Before 1.0 there are no maintenance branches, so a fix comes out as +a patch of the latest minor version. + +## Reporting a vulnerability + +Report it privately through +[GitHub's private vulnerability reporting](https://github.com/Huldoser/code-inventory/security/advisories/new), not +in a public issue. Say which version is affected and how to reproduce it; a small project that triggers it helps most. + +code-inventory reads the source and configuration files it scans and never runs them; `--changed-since` only runs +`git` to read the diff. A scanned project that makes a scan run its code or another command, write a file other than +the requested output, overwrite an existing file, or reach the network is a vulnerability, and so is a problem in a +dependency that a scan exposes. A wrong count, path or diagnostic is a bug; report it with the +[issue form](https://github.com/Huldoser/code-inventory/issues/new?template=scan-result-wrong.yml) instead. + +You get a first reply within 14 days. Once the problem is confirmed, the fix is released as soon as it is ready, with a +GitHub security advisory that credits you unless you prefer not to be named. diff --git a/THIRD_PARTY.md b/THIRD_PARTY.md index 8e2d58f..d63fd6c 100644 --- a/THIRD_PARTY.md +++ b/THIRD_PARTY.md @@ -8,6 +8,7 @@ | vitest and its workspace packages | MIT | https://github.com/vitest-dev/vitest | | prettier | MIT | https://github.com/prettier/prettier | | eslint and typescript-eslint | MIT | https://github.com/eslint/eslint; https://github.com/typescript-eslint/typescript-eslint | +| @changesets/cli and @changesets/changelog-github | MIT | https://github.com/changesets/changesets | The lockfile records exact versions, integrity hashes and licenses for transitive dependencies. Installation uses `--ignore-scripts`. The optional macOS-only fsevents package declares an install script and is not installed on Linux. diff --git a/package-lock.json b/package-lock.json index 764e960..a253bf1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,8 @@ "code-inventory": "dist/cli.js" }, "devDependencies": { + "@changesets/changelog-github": "2.0.0", + "@changesets/cli": "3.1.0", "@types/node": "26.6.11", "ajv": "8.20.0", "eslint": "10.16.0", @@ -50,6 +52,308 @@ "keyv": "^5.6.0" } }, + "node_modules/@changesets/apply-release-plan": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-8.2.0.tgz", + "integrity": "sha512-ZtItaDXkswepcTn4U8smOs66iRvsIzqhTLAe3YmMA7rgmqr2DYsIFk83PZP8mbjGRtDQS8FQLskYwle17VLA7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@changesets/config": "^4.1.0", + "@changesets/format": "^0.1.3", + "@changesets/git": "^4.0.2", + "@changesets/should-skip-package": "^1.0.1", + "@changesets/types": "^7.1.0", + "import-meta-resolve": "^4.2.0", + "jsonc-parser": "^3.3.1", + "semver": "^7.8.1" + }, + "engines": { + "node": "^22.11 || ^24 || >=26" + } + }, + "node_modules/@changesets/assemble-release-plan": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@changesets/assemble-release-plan/-/assemble-release-plan-7.1.0.tgz", + "integrity": "sha512-n76HJimMhHsB2ILp4yom0teNOtBBhU1qu5z/ni0+TdB52Ogkh1i1xnBfGPQv2Kd3b6TrPfvzg1M+Wg8Sdh7AgA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@changesets/errors": "^1.0.0", + "@changesets/get-dependents-graph": "^3.0.1", + "@changesets/should-skip-package": "^1.0.1", + "@changesets/types": "^7.1.0", + "semver": "^7.8.1" + }, + "engines": { + "node": "^22.11 || ^24 || >=26" + } + }, + "node_modules/@changesets/changelog-git": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@changesets/changelog-git/-/changelog-git-1.0.1.tgz", + "integrity": "sha512-FdS99KzRb4fVUCeMcXcIyUCa6wkUHVyIqFEd1joVERZ+dOVHV77Aq4owRKnfb5LDJ1Ank1ZY+9b0qJG6jGHDIg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@changesets/types": "^7.1.0" + }, + "engines": { + "node": "^22.11 || ^24 || >=26" + } + }, + "node_modules/@changesets/changelog-github": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@changesets/changelog-github/-/changelog-github-2.0.0.tgz", + "integrity": "sha512-i2c9rub+cYmgzYZ+xc6cFP/mOXRkd0pgcINOdsjC2rVGBWw95Kds7Nfpl9PHIB7QSmTfQdvkThVaUeYsW9tI8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@changesets/get-github-info": "^1.0.1", + "@changesets/types": "^7.1.0" + }, + "engines": { + "node": "^22.11 || ^24 || >=26" + } + }, + "node_modules/@changesets/cli": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@changesets/cli/-/cli-3.1.0.tgz", + "integrity": "sha512-5kiOk7//PkF2M0kdSR/cAlGVSCRH7BGTLjoR3KL/AVUw5/mnT0xFsCh1atajczKbup8tKDnG4UIW2ZpFHn62fw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@changesets/apply-release-plan": "^8.2.0", + "@changesets/assemble-release-plan": "^7.1.0", + "@changesets/changelog-git": "^1.0.1", + "@changesets/config": "^4.1.0", + "@changesets/errors": "^1.0.0", + "@changesets/get-dependents-graph": "^3.0.1", + "@changesets/git": "^4.0.2", + "@changesets/pre": "^3.0.1", + "@changesets/read": "^1.1.0", + "@changesets/should-skip-package": "^1.0.1", + "@changesets/types": "^7.1.0", + "@changesets/write": "^1.1.0", + "@clack/prompts": "^1.8.1", + "@manypkg/get-packages": "^3.1.0", + "@pnpm/deps.graph-sequencer": "^1100.0.1", + "cac": "^7.0.0", + "import-meta-resolve": "^4.2.0", + "launch-editor": "^2.14.2", + "package-manager-detector": "^1.6.0", + "semver": "^7.8.1", + "tinyexec": "^1.3.1" + }, + "bin": { + "changeset": "bin.js" + }, + "engines": { + "node": "^22.11 || ^24 || >=26", + "npm": ">=10.9.0", + "pnpm": ">=10.0.0", + "yarn": ">=4.5.2" + } + }, + "node_modules/@changesets/config": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@changesets/config/-/config-4.1.0.tgz", + "integrity": "sha512-uS45o0lR2ZcfTIIzFkYJbcYnftXgBuGMcqAf7oQhw+6MUvKh2BkP/Ohqjm01ewmxuCPAtaPjO1w8blyGqVPeEw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@changesets/get-dependents-graph": "^3.0.1", + "@changesets/should-skip-package": "^1.0.1", + "@changesets/types": "^7.1.0", + "@manypkg/get-packages": "^3.1.0", + "picomatch": "^4.0.7" + }, + "engines": { + "node": "^22.11 || ^24 || >=26" + } + }, + "node_modules/@changesets/errors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@changesets/errors/-/errors-1.0.0.tgz", + "integrity": "sha512-ElN/mEzn6zmETgjwf5MclCMa9ef59sAR0lfO8VSYIsiRvbC2FbLB/92EoYw10Sl0kGixxHFiJZUSv7dA+YpR8g==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^22.11 || ^24 || >=26" + } + }, + "node_modules/@changesets/format": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@changesets/format/-/format-0.1.3.tgz", + "integrity": "sha512-zTZrJbfY81+/MsXsey6i3jQjpApz4PqRQ+nouHGDJhCa5sKCExwR9mZFQ/67lMsqZDNy2G2v3wTbzOmZ56EtaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "package-manager-detector": "^1.8.0", + "tinyexec": "^1.3.1" + }, + "engines": { + "node": "^22.11 || ^24 || >=26" + } + }, + "node_modules/@changesets/get-dependents-graph": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@changesets/get-dependents-graph/-/get-dependents-graph-3.0.1.tgz", + "integrity": "sha512-aQRU6496Fr+oqs1YuPUvCI8IxLksbsNuPCil6D3KyObYNiDh1TH9vGde3KZw+rfseLEJcmFlx6UsOcxi4ZUx2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@changesets/types": "^7.1.0", + "semver": "^7.8.1" + }, + "engines": { + "node": "^22.11 || ^24 || >=26" + } + }, + "node_modules/@changesets/get-github-info": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@changesets/get-github-info/-/get-github-info-1.0.1.tgz", + "integrity": "sha512-ifLQCky/ZtDgZ4xCiUMjnLZSJ8xk52iIzMJbBBPlZWjr2CiTNTaTDddIVWKicrUAdWuLWL7PUw2fNa1yPwLpIg==", + "dev": true, + "license": "MIT", + "dependencies": { + "dataloader": "^2.2.3" + }, + "engines": { + "node": "^22.11 || ^24 || >=26" + } + }, + "node_modules/@changesets/git": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@changesets/git/-/git-4.0.2.tgz", + "integrity": "sha512-xvmmbY4+qI3VnbBKbMEUECpiIKN6DL1HSDRQgTpm/yyZIuqDrhktSAWfdFwIitPD5psTZG44tNxNUnebkqjIOw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@changesets/errors": "^1.0.0", + "@changesets/types": "^7.1.0", + "@manypkg/get-packages": "^3.1.0", + "picomatch": "^4.0.7", + "tinyexec": "^1.3.1" + }, + "engines": { + "node": "^22.11 || ^24 || >=26" + } + }, + "node_modules/@changesets/parse": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@changesets/parse/-/parse-1.1.0.tgz", + "integrity": "sha512-1c3Y1Xjw3z+DZrHuzV6qZjZE1GnyWswOkVWzhB0MkyY6s/WZb7HdckmMMvrFXVj0Fx7gwFsPyZDHa1Gsag+2EQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@changesets/types": "^7.1.0", + "yaml": "^2.9.0" + }, + "engines": { + "node": "^22.11 || ^24 || >=26" + } + }, + "node_modules/@changesets/pre": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-3.0.1.tgz", + "integrity": "sha512-4LXYgB0jPeL/NRLzuDDFW+cTrPmr+9HJM0bV9baRlDvoy5Lt+dTxArg9SMfqeKkWKNMxDNg2RcZI2vw4BJAJLw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@changesets/errors": "^1.0.0", + "@changesets/types": "^7.1.0", + "@manypkg/get-packages": "^3.1.0" + }, + "engines": { + "node": "^22.11 || ^24 || >=26" + } + }, + "node_modules/@changesets/read": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@changesets/read/-/read-1.1.0.tgz", + "integrity": "sha512-kIvkNosIN/qsv63ik9nlL0tr15faYbQFY/qPG73RpOfhvXQ3E/xdqzvtRQXEtNp0G5JW8KOV+1p7M/xT8fFf1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@changesets/git": "^4.0.2", + "@changesets/parse": "^1.1.0", + "@changesets/types": "^7.1.0" + }, + "engines": { + "node": "^22.11 || ^24 || >=26" + } + }, + "node_modules/@changesets/should-skip-package": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@changesets/should-skip-package/-/should-skip-package-1.0.1.tgz", + "integrity": "sha512-dWyV0BrdwMYEhUYOa/qqjiXak/G/YKNJJj9bJQXFW9mwar0edWf/IZUmNpFqjKB/lEopbepvrQkXdR6Gx0jgWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@changesets/types": "^7.1.0" + }, + "engines": { + "node": "^22.11 || ^24 || >=26" + } + }, + "node_modules/@changesets/types": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@changesets/types/-/types-7.1.0.tgz", + "integrity": "sha512-UmpOTft7EIMCJRpLy5oy8rLNXdyhTBMMOaNi5t4B/2zEiluyys3pKc1jBXDE22SXmmwMgKtJ/m2qxgD/w1iJJA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^22.11 || ^24 || >=26" + } + }, + "node_modules/@changesets/write": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@changesets/write/-/write-1.1.0.tgz", + "integrity": "sha512-kB0RCF6bybhXpkCi9Gc9gGksYRN/txIrTt6zJwMxhlcr1lCdZvhJz7QaMVLDaLPHBn+Jnr0CPivPPHfez5kLDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@changesets/format": "^0.1.3", + "@changesets/types": "^7.1.0", + "human-id": "^4.2.2", + "yaml": "^2.9.0" + }, + "engines": { + "node": "^22.11 || ^24 || >=26" + } + }, + "node_modules/@clack/core": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@clack/core/-/core-1.6.0.tgz", + "integrity": "sha512-4GZynIB2IIe431odxesswvWTCP6orvqd6e2b07b3VFWBQRqUqIHc/EPIZwFoKS692QBp+ooPuXKaJV8g4kXuYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-string-width": "^3.0.2", + "fast-wrap-ansi": "^0.2.0", + "sisteransi": "^2.0.0" + }, + "engines": { + "node": ">= 20.12.0" + } + }, + "node_modules/@clack/prompts": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@clack/prompts/-/prompts-1.9.0.tgz", + "integrity": "sha512-tEj8X2No2A1c9NDnZECxiiJ8TP3vmFlN9tLlLeSaMqVW4tUmVG2R4qpv/eP4zymWxnymYLkLcIYVV0VcWj3RCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@clack/core": "1.6.0", + "fast-string-width": "^3.0.2", + "fast-wrap-ansi": "^0.2.0", + "sisteransi": "^2.0.0" + }, + "engines": { + "node": ">= 20.12.0" + } + }, "node_modules/@emnapi/core": { "version": "2.0.0-beta.2", "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-2.0.0-beta.2.tgz", @@ -319,6 +623,48 @@ "dev": true, "license": "MIT" }, + "node_modules/@manypkg/find-root": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@manypkg/find-root/-/find-root-3.1.0.tgz", + "integrity": "sha512-BcSqCyKhBVZ5YkSzOiheMCV41kqAFptW6xGqYSTjkVTl9XQpr+pqHhwgGCOHQtjDCv7Is6EFyA14Sm5GVbVABA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@manypkg/tools": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@manypkg/get-packages": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@manypkg/get-packages/-/get-packages-3.1.0.tgz", + "integrity": "sha512-0TbBVyvPrP7xGYBI/cP8UP+yl/z+HtbTttAD7FMAJgn/kXOTwh5/60TsqP9ZYY710forNfyV0N8P/IE/ujGZJg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@manypkg/find-root": "^3.1.0", + "@manypkg/tools": "^2.1.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@manypkg/tools": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@manypkg/tools/-/tools-2.1.2.tgz", + "integrity": "sha512-6QEf6yqFbETdwGITKq57aYoPfX/3K8XFNwsAlx0C1M7o8cb79sv1M3w+tWuWvIcSbNqrLF7OD7YpZMVVz335hQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "jju": "^1.4.0", + "tinyglobby": "^0.2.13", + "yaml": "^2.9.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, "node_modules/@napi-rs/wasm-runtime": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.6.tgz", @@ -353,6 +699,19 @@ "url": "https://github.com/sponsors/oxc-project" } }, + "node_modules/@pnpm/deps.graph-sequencer": { + "version": "1100.0.1", + "resolved": "https://registry.npmjs.org/@pnpm/deps.graph-sequencer/-/deps.graph-sequencer-1100.0.1.tgz", + "integrity": "sha512-pOr5+q1fLYKwFN3LAJuGZEnfXDcQ73zqgDHMtGy+K+uIoUqyY+6MeDCWFwfu+4EFuq76I5EPFofoNAI+Bmmq4A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=22.13" + }, + "funding": { + "url": "https://opencollective.com/pnpm" + } + }, "node_modules/@rolldown/binding-android-arm-eabi": { "version": "1.2.19", "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.19.tgz", @@ -1091,6 +1450,16 @@ "node": "20 || >=22" } }, + "node_modules/cac": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/cac/-/cac-7.1.1.tgz", + "integrity": "sha512-8zc+h51HxpodKsA7L4PpBNd+9qlrfuUcyUDE5a793BJfN4NZgwk7v9NmrY3ptZ+Sk0+ToigxSzkb47AsEgyizw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.19.0" + } + }, "node_modules/cacheable": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/cacheable/-/cacheable-2.5.0.tgz", @@ -1130,6 +1499,13 @@ "node": ">= 8" } }, + "node_modules/dataloader": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/dataloader/-/dataloader-2.2.3.tgz", + "integrity": "sha512-y2krtASINtPFS1rSDjacrFgn1dcUuoREVabwlOGOe4SdxenREqwjwjElAdwvbGM7kgZz9a3KVicWR7vcz8rnzA==", + "dev": true, + "license": "MIT" + }, "node_modules/debug": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", @@ -1406,6 +1782,23 @@ "dev": true, "license": "MIT" }, + "node_modules/fast-string-truncated-width": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/fast-string-truncated-width/-/fast-string-truncated-width-3.0.3.tgz", + "integrity": "sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-string-width": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/fast-string-width/-/fast-string-width-3.0.2.tgz", + "integrity": "sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-string-truncated-width": "^3.0.2" + } + }, "node_modules/fast-uri": { "version": "3.1.9", "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.9.tgz", @@ -1423,6 +1816,16 @@ ], "license": "BSD-3-Clause" }, + "node_modules/fast-wrap-ansi": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/fast-wrap-ansi/-/fast-wrap-ansi-0.2.2.tgz", + "integrity": "sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-string-width": "^3.0.2" + } + }, "node_modules/fdir": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", @@ -1536,6 +1939,16 @@ "dev": true, "license": "MIT" }, + "node_modules/human-id": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/human-id/-/human-id-4.2.2.tgz", + "integrity": "sha512-Z+8unD6em/MJwyrkWQ2M3wygRGI1+MztbutiNwk1DCuEPXOZRWGjtcMPZYP1exY9iNZMhd7ZOSMQSo9WYtiQRw==", + "dev": true, + "license": "MIT", + "bin": { + "human-id": "dist/cli.js" + } + }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -1546,6 +1959,17 @@ "node": ">= 4" } }, + "node_modules/import-meta-resolve": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.2.0.tgz", + "integrity": "sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -1586,6 +2010,13 @@ "dev": true, "license": "ISC" }, + "node_modules/jju": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", + "integrity": "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==", + "dev": true, + "license": "MIT" + }, "node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", @@ -1600,6 +2031,13 @@ "dev": true, "license": "MIT" }, + "node_modules/jsonc-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz", + "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==", + "dev": true, + "license": "MIT" + }, "node_modules/keyv": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/keyv/-/keyv-5.6.0.tgz", @@ -1610,6 +2048,17 @@ "@keyv/serialize": "^1.1.1" } }, + "node_modules/launch-editor": { + "version": "2.14.2", + "resolved": "https://registry.npmjs.org/launch-editor/-/launch-editor-2.14.2.tgz", + "integrity": "sha512-NHJEb30MGBCkmZXLZwz25t37QR4aY03ZzPYUJXOJaOa92uWwExI9SBQUuIznBYc1xkD7cJNGX7oc3Nl3sq2kQQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "picocolors": "^1.1.1", + "shell-quote": "^1.10.0" + } + }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -2050,6 +2499,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/package-manager-detector": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-1.10.0.tgz", + "integrity": "sha512-FlC7wr4YYRfVyk1E3u3qwi7Vh6qVvPowYkHQSDEoSKCN0o0F7w0TzNfJSBb/1rwEQbU3c96Exx/2vMYiCIx+wQ==", + "dev": true, + "license": "MIT" + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -2075,8 +2531,7 @@ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true, - "license": "ISC", - "peer": true + "license": "ISC" }, "node_modules/picomatch": { "version": "4.0.7", @@ -2259,6 +2714,29 @@ "node": ">=8" } }, + "node_modules/shell-quote": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.12.0.tgz", + "integrity": "sha512-PcByqNyT/38F2kDNi006HAMRJaULuBzq/FOsw3qdZvX/GA9W/jamDaRskgHjubHiftXK5sIFxLNkvrXUwcof6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/sisteransi": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-2.0.1.tgz", + "integrity": "sha512-Xeg0ma58PRiVJnAZKotI4Re8LKcjRIvle3ynYviPguyb7NVYgMqnhCf0zQxxkKj26vxL0ZPsC9cicDyRDeZbwA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + } + }, "node_modules/source-map-js": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.4.tgz", @@ -2604,6 +3082,22 @@ "node": ">=0.10.0" } }, + "node_modules/yaml": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.1.tgz", + "integrity": "sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw==", + "dev": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/package.json b/package.json index 054354b..78f7745 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "dist", "docs", "README.md", + "CHANGELOG.md", "THIRD_PARTY.md" ], "bin": { @@ -46,12 +47,15 @@ "test": "vitest run", "format:check": "prettier --check .", "lint": "eslint src test/*.test.ts", - "check": "npm run typecheck && npm run build && npm run lint && npm test && npm run format:check" + "check": "npm run typecheck && npm run build && npm run lint && npm test && npm run format:check", + "changeset": "changeset" }, "dependencies": { "typescript": "npm:@typescript/typescript6@6.0.2" }, "devDependencies": { + "@changesets/changelog-github": "2.0.0", + "@changesets/cli": "3.1.0", "@types/node": "26.6.11", "ajv": "8.20.0", "eslint": "10.16.0", From 56bb0d6a68b717857ca2b1c6b85dad7f6d7fc0b5 Mon Sep 17 00:00:00 2001 From: Andrey Rychkov Date: Wed, 2 Dec 2026 15:42:45 -0500 Subject: [PATCH 2/2] Rerun checks