Skip to content

CI: pack the SDK and import it from a clean install #107

Closed

Description

@Eras256

Three past releases built and passed tests from source but failed for anyone installing the package: 0.10.0 (require() inside ESM), 0.13.0 (ERR_MODULE_NOT_FOUND) and the undeclared dependency fixed in #68. CI only runs tests from the source tree, so this class of bug can't be caught today.

Proposal, as a new job in sdk-test.yml:

  • npm pack, install the tarball in an empty temp project
  • import it as ESM and require it as CJS, and construct x402Serve() and initX402() with dummy config, no network
  • fail the job on any error

While there: the published 0.16.0 tarball ships test files (dist/*.test.js, .d.ts). Exclude them from the build or from files, and assert in the same job that no *.test.* file is in the tarball.

Disclosure: drafted with AI assistance under my direction and reviewed by hand.

Activity

  1. guptakumarranjeet150 commented on Oct 8, 2026

    @guptakumarranjeet150

    Hello maintainers,

    I am interested in taking up CI: pack the SDK and import it from a clean install.

    Solution overview:

    1. Inspect repository architecture in nirium-protocol/nirium for an idiomatic solution.
    2. Implement the feature/fix with clean modular separation and robust error handling.
    3. Add comprehensive unit and integration test coverage for all edge cases.
    4. Verify that all linters, formatting, and CI checks pass cleanly.

    Please assign this to me if the plan looks good. Thanks!

  2. Eras256 commented on Oct 9, 2026

    @Eras256
    CollaboratorAuthor

    Gracias por el interés. Varios de los comentarios aquí (y en otros issues abiertos esta semana) repiten el mismo texto plantilla palabra por palabra, así que no vamos a asignar por orden de comentario esta vez — si tienes experiencia real con el empaquetado del SDK o con el pipeline de CI, cuéntanos tu enfoque concreto para este caso.

  3. Edgadafi commented on Oct 13, 2026

    @Edgadafi
    Contributor

    I'll take it. A script run by a new clean-install job (Node 22, same install flags as the existing job) packs the SDK, fails on any *.test.* file or a missing entry point, installs the tarball into an empty project outside the monorepo, then runs an ESM import, a CJS require (Agent#initX402() and x402Serve() with dummy config, no network) and a strict tsc --noEmit against the shipped .d.ts. Test files are excluded via "!dist/**/*.test.*" in files, with no tsconfig/ts-jest changes. Verified locally: green with the fix, red without it. From my fork, PR with "Closes #107", AI use declared.

    PR: #132

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions