Skip to content

Improve library quality gates and package validation #80

Description

@vitormattos

pdf-elements already has automated tests, linting and build checks. Before adding more complex features, we should strengthen the basic quality gates of the library.

pdf-elements is a generic Vue 3 library and should remain usable by applications outside the LibreSign and Nextcloud ecosystems. The changes in this issue must not add framework-specific assumptions or dependencies.

What should be done

Add explicit type checking

Add an npm script using the existing vue-tsc dependency, for example:

"typecheck": "vue-tsc --noEmit"

Run it in CI.

Do not enable TypeScript strict mode in this issue. TypeScript strictness can be improved separately because it may require changes across the existing codebase.

Use deterministic dependency installation

Use npm ci instead of npm i in CI workflows that install dependencies from the committed lock file.

Validate the published package

Add a small automated smoke test for the package generated by npm pack.

The test should use the packed artifact as a consumer would receive it, rather than importing source files directly from the repository.

Verify that:

  • the package can be packed successfully;
  • @libresign/pdf-elements can be imported;
  • the published TypeScript declarations can be resolved;
  • the exported CSS file is included;
  • the public subpath exports currently declared in package.json can be resolved;
  • files required by the public package are present in the tarball.

This is a packaging test, not a component behavior test.

Update CI

Update the existing node.yml and tests.yml workflows instead of creating separate workflows for each new check.

The CI should validate:

  • lint;
  • type checking;
  • unit tests;
  • library build;
  • distribution validation;
  • package smoke test.

Use npm ci for dependency installation from the committed lock file.

The following Nextcloud workflow templates can be used as references for CI practices:

Keep the workflows generic to a Vue/Node library. Do not copy Nextcloud-specific runners, files or app tooling that are not relevant to this package.

Acceptance criteria

  • npm run typecheck exists and passes.
  • Type checking runs in CI.
  • CI uses npm ci when installing from the lock file.
  • An automated smoke test validates the artifact generated by npm pack.
  • The packed package can be imported through its public entry point.
  • Published TypeScript declarations can be resolved.
  • CSS and the current public subpath exports are validated.
  • Existing lint, unit tests, build and distribution checks continue to pass.
  • No public API, element model or component behavior is changed.
  • No Nextcloud-specific dependency or runtime assumption is introduced.

Good first issue

This is a good first issue for contributors interested in JavaScript/TypeScript library tooling and CI. The work is mostly isolated from the PDF editor behavior and can be verified locally before opening a pull request.

If you find a public export that looks unnecessary or incorrect, please mention it in the PR instead of removing it. Changing public exports may be a breaking change and should be discussed separately.

Additional context

  • If you have questions, feel free to ask in this issue.
  • Give a ⭐️ to pdf-elements if you find the package useful.
  • You can also support the project by giving a ⭐️ to LibreSign.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions