Use this guide when you need to validate the published-package happy path before pushing packages to npm.
This is not a perfect substitute for a real registry publish. It is a local verification layer that answers two practical questions:
- Did
pnpm packrewrite workspace protocol dependencies to concrete semver ranges? - Does the packed
@rawsql-ts/ztd-clitarball still reach a green npm-first standalone smoke run?
- Release builds complete for the packages needed by the published-package path.
- Packed tarballs do not leak
workspace:*,workspace:^, or similar references. - Phase A proves the packaging / npm primary path gate:
- the tarball installs with
npm install npx ztd init --yescompletes- the generated completion message stays on the npm primary path
- follow-up
npm installstill works
- the tarball installs with
- Phase B proves the first test quality gate:
npx ztd ztd-confignpx ztd query lint --helpstill exposes--rulesnpx ztd query lint --rules join-direction <sql-file>parses on the packed CLI pathnpm run test- the generated scaffold reaches a passing first smoke test on the npm-first consumer path
- TypeScript compile checks for both default and Node16 settings as follow-up smoke coverage
- This check does not fully emulate npm registry resolution for every unpublished transitive dependency.
- A real post-publish smoke check is still required.
- Do not use this to claim that every package combination is already registry-valid.
- When Further Reading docs mention
query lint --rules join-direction, a real post-publish smoke check should also confirm thatnpx ztd query lint --helpexposes--rules <list>on the published package.
Run this from the repository root:
pnpm verify:published-package-modeThe script will:
- Run
pnpm build:publish - Pack the publishable packages into
tmp/published-package-check/tarballs - Inspect each packed
package.jsonfor leakedworkspace:references - Create a standalone app under
tmp/published-package-check/packages/npm-primary-path - Run Phase A:
npm install,npx ztd init --yes, completion-message assertions, and follow-upnpm install - Run Phase B:
npx ztd ztd-config,npx ztd query lint --help,npx ztd query lint --rules join-direction <sql-file>,npm run test, and TypeScript compile checks - Write a machine-readable summary to
tmp/published-package-check/summary.json
- Pack inspection fails because a tarball still contains
workspace:references.- Treat this as a packaging/release bug.
- Phase A fails before
ztd-config.- Treat this as a packaging or npm-primary-path regression.
- Phase B fails after the npm-first setup completed.
- Treat this as a first test quality gate regression on the published-package path.
- This now includes command-surface regressions where docs mention
query lint --rules join-directionbut the packed CLI no longer accepts--rules. - The local-source developer path may still be healthy.
- The standalone smoke app passes, but local-source dogfooding fails.
- Treat that as a developer-mode problem, not a packaging problem.
For this verification, first test means the generated scaffold's minimal smoke test passes after the npm-first setup flow.
- It is the test path exercised by
npm install -> ztd init -> npx ztd ztd-config -> npm run test. - It is not a full integration suite.
- It does not require every SQL-backed DB test to pass.
- It exists to prove that consumer onboarding reaches visible value, not just successful command execution.
Use both checks before release work is considered healthy:
Local-source developer mode- Answers: can we dogfood unreleased changes from source?
Published-package verification before release- Answers: are the packed artifacts internally consistent enough for release preparation, and does the first generated test pass on the consumer onboarding path?
Treat this document as the canonical pre-release policy for the npm consumer path.
pnpm verify:published-package-modeis green.- The consumer path confirms
first test passes. - The generated scaffold and the verification path still match the intended onboarding flow.
Only a real npm publish can fully answer the end-user registry path, but this check removes most avoidable surprises before that point.