Skip to content

test: add library quality gates and package validation - #81

Open
terminalchai wants to merge 1 commit into
LibreSign:mainfrom
terminalchai:test/80-package-quality-gates
Open

test: add library quality gates and package validation#81
terminalchai wants to merge 1 commit into
LibreSign:mainfrom
terminalchai:test/80-package-quality-gates

Conversation

@terminalchai

Copy link
Copy Markdown

Closes #80.

Adds explicit vue-tsc --noEmit checking and a smoke test that packs the library, installs the tarball in a temporary consumer, imports the public entry point, resolves every current public subpath, checks required tarball files including CSS, and typechecks a consumer import. The existing CI workflows now use npm ci, with typechecking, distribution validation, and package validation added to the build workflow.

The consumer test exposed missing Vue component declarations in the packed artifact. Explicitly selecting the Vue declaration processor and declaring its @vue/language-core peer makes those declarations available. Node types are also declared directly, and two existing render-task mocks now include the required promise so the new typecheck passes. Public exports and component behavior are unchanged; repository strict mode is unchanged.

Validation after a clean npm ci, using Node 24.20.0 and npm 11.19.1:

  • Lint and typecheck pass.
  • All 79 unit tests pass.
  • Library build, distribution validation, and packed-package consumer test pass.
  • Demo build passes.
  • REUSE lint passes for all 53 files.

Vite still prints its existing advisory about future native config loading; all checks exit successfully.

Signed-off-by: terminalchai <terminalchai@gmail.com>
@terminalchai
terminalchai force-pushed the test/80-package-quality-gates branch from 069b9f7 to 28978c6 Compare September 5, 2026 22:06
Comment thread scripts/test-package.mjs
await Promise.all([mkdir(packDir), mkdir(consumerDir)])

const { stdout } = await runNpm(
['pack', '--json', '--ignore-scripts', '--pack-destination', packDir],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need --ignore-scripts here?

The goal of this test is to validate the artifact produced by npm pack as a consumer would receive it. Since the package has a prepack script, using --ignore-scripts means this test depends on npm run build and npm run validate:dist having already been executed by the workflow instead of validating the real packing lifecycle.

I think it would be safer to run npm pack normally here, so this smoke test also catches problems in prepack or cases where test:package is executed directly.

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.

Improve library quality gates and package validation

2 participants