Mark the package private and declare engines and exports (closes #6) #127

Merged
clawbot merged 1 commits from issue-6-package-metadata into next2 2026-09-23 14:17:53 +02:00
Collaborator

Implements #6 as rescoped in #6 (comment).

What changed

  • "private": true: an accidental npm publish or yarn publish now fails.
  • The files field is removed. It only shapes a published package, and quak is not published.
  • engines.node is >=22, the major version script/bootstrap (Node 22.17.0) and the Dockerfile (node:22-alpine) use.
  • An exports map declares . (types before import) and ./package.json as the only importable paths.

Public API

runBackup, BackupResult and BackupError stay public: src/index.ts already exports them. runMetadataBackup, listMissingThumbnails, fixMissingThumbnails, MissingThumbnailInfo, ThumbnailFixResult and RawMagicMetadata are only used by the CLI and stay internal. The exports map makes them impossible to import (ERR_PACKAGE_PATH_NOT_EXPORTED).

Worth knowing

  • bin/quak.ts imports by relative path, so the map does not affect the CLI. script/build still runs the built CLI with --version.
  • main and types are kept alongside exports for tools that do not read the map. No other field changed.
  • Judgement call: >=22 rather than 22.x. The brief rules out older versions, and pinning to one major would make yarn install refuse newer Node outright.

Model: opus-5-5

Implements https://git.eeqj.de/sneak/quak/issues/6 as rescoped in https://git.eeqj.de/sneak/quak/issues/6#issuecomment-102630. ## What changed - `"private": true`: an accidental `npm publish` or `yarn publish` now fails. - The `files` field is removed. It only shapes a published package, and quak is not published. - `engines.node` is `>=22`, the major version `script/bootstrap` (Node 22.17.0) and the `Dockerfile` (`node:22-alpine`) use. - An `exports` map declares `.` (`types` before `import`) and `./package.json` as the only importable paths. ## Public API `runBackup`, `BackupResult` and `BackupError` stay public: `src/index.ts` already exports them. `runMetadataBackup`, `listMissingThumbnails`, `fixMissingThumbnails`, `MissingThumbnailInfo`, `ThumbnailFixResult` and `RawMagicMetadata` are only used by the CLI and stay internal. The `exports` map makes them impossible to import (`ERR_PACKAGE_PATH_NOT_EXPORTED`). ## Worth knowing - `bin/quak.ts` imports by relative path, so the map does not affect the CLI. `script/build` still runs the built CLI with `--version`. - `main` and `types` are kept alongside `exports` for tools that do not read the map. No other field changed. - Judgement call: `>=22` rather than `22.x`. The brief rules out older versions, and pinning to one major would make `yarn install` refuse newer Node outright. Model: opus-5-5
clawbot added the needs-review label 2026-09-23 13:59:59 +02:00
clawbot self-assigned this 2026-09-23 13:59:59 +02:00
clawbot added 1 commit 2026-09-23 14:00:00 +02:00
quak is not published, so package.json is marked private and loses its
files field. engines.node is >=22, the major version script/bootstrap
and the Dockerfile use. The exports map makes "." and "./package.json"
the only importable paths, so the CLI-only modules stay internal.

Model: opus-5-5
Author
Collaborator

PASS on e1f79d23839d229c0bf57e7606e192cf57cea826 rebased onto next2 6a7a10f489192d2096e2889c1cd7604c19ce763d.

Judgement call: no test was asked for or added for the package.json fields; a test that only reads the manifest back would check the tree rather than behaviour.

Model: opus-5-5

PASS on `e1f79d23839d229c0bf57e7606e192cf57cea826` rebased onto `next2` `6a7a10f489192d2096e2889c1cd7604c19ce763d`. Judgement call: no test was asked for or added for the `package.json` fields; a test that only reads the manifest back would check the tree rather than behaviour. Model: opus-5-5
clawbot merged commit 04094a8cfb into next2 2026-09-23 14:17:53 +02:00
clawbot deleted branch issue-6-package-metadata 2026-09-23 14:17:53 +02:00
Sign in to join this conversation.