build: add production package pipeline - #339
Conversation
Reviewer's GuideThis PR establishes a production package pipeline that generates externally-linked ESM/CJS artifacts, declarations, styles, and docs, then validates the exact npm tarball through isolated consumer, module-resolution, type, runtime, and browser contract checks while aligning public imports and package-facing source APIs. File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Preview is ready. |
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="packages/graph/jest.config.ts" line_range="6" />
<code_context>
testPathIgnorePatterns: ["/node_modules/", "/build/"],
testEnvironment: "jsdom",
- setupFiles: ["<rootDir>/setupJest.js", "jest-canvas-mock"],
+ setupFiles: ["<rootDir>/setupJest.cjs", "jest-canvas-mock"],
transformIgnorePatterns: [],
moduleNameMapper: {
</code_context>
<issue_to_address>
**issue (bug_risk):** Jest now loads `setupJest.cjs` and maps CSS to `styleMock.cjs`, but this diff does not add or rename those files. Unit tests therefore fail during configuration with module-not-found errors.
**Triggers:** When the repository still contains the previously referenced `setupJest.js` and `__mocks__/styleMock.js` files.
**Suggested fix:** Rename the files to `.cjs` or keep the existing `.js` paths and add compatible CommonJS handling for the package's ESM mode.
</issue_to_address>
### Comment 2
<location path="packages/graph/src/plugins/layered/index.ts" line_range="1-2" />
<code_context>
-export { useLayeredLayout } from "./hooks/useLayeredLayout";
-export type { UseLayeredLayoutParams } from "./hooks/useLayeredLayout";
export { layoutGraph, DEFAULT_NODE_WIDTH, DEFAULT_NODE_HEIGHT } from "./layout";
export type { LayoutGraphParams } from "./layout";
</code_context>
<issue_to_address>
**issue (bug_risk):** The public root export of `useLayeredLayout` and `UseLayeredLayoutParams` is removed, so existing consumers importing the hook from `@gravity-ui/graph` fail to compile or resolve after upgrading to this patch release.
**Triggers:** When an existing consumer imports `useLayeredLayout` from the root package entrypoint.
**Suggested fix:** Preserve the root re-export for compatibility, or make the breaking entrypoint move an explicitly versioned API change and update the package version accordingly.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 2 findings to address first, and a faulty build or export map can publish a package that downstream projects cannot import, type-check, bundle, or run, and promoting runtime dependencies changes what consumers install. Reverting the repository restores the pipeline but does not repair an already published broken package; affected consumers need a corrected release.
Blocking findings: packages/graph/jest.config.ts:6, packages/graph/src/plugins/layered/index.ts:2
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| testPathIgnorePatterns: ["/node_modules/", "/build/"], | ||
| testEnvironment: "jsdom", | ||
| setupFiles: ["<rootDir>/setupJest.js", "jest-canvas-mock"], | ||
| setupFiles: ["<rootDir>/setupJest.cjs", "jest-canvas-mock"], |
There was a problem hiding this comment.
issue (bug_risk): Jest now loads setupJest.cjs and maps CSS to styleMock.cjs, but this diff does not add or rename those files. Unit tests therefore fail during configuration with module-not-found errors.
Triggers: When the repository still contains the previously referenced setupJest.js and __mocks__/styleMock.js files.
Suggested fix: Rename the files to .cjs or keep the existing .js paths and add compatible CommonJS handling for the package's ESM mode.
| export { useLayeredLayout } from "./hooks/useLayeredLayout"; | ||
| export type { UseLayeredLayoutParams } from "./hooks/useLayeredLayout"; |
There was a problem hiding this comment.
issue (bug_risk): The public root export of useLayeredLayout and UseLayeredLayoutParams is removed, so existing consumers importing the hook from @gravity-ui/graph fail to compile or resolve after upgrading to this patch release.
Triggers: When an existing consumer imports useLayeredLayout from the root package entrypoint.
Suggested fix: Preserve the root re-export for compatibility, or make the breaking entrypoint move an explicitly versioned API change and update the package version accordingly.
Related issues
Summary
Testing
Summary by Sourcery
Establish a production package pipeline that publishes validated multi-environment bundles and verifies the exact packed package through isolated consumer projects.
New Features:
Bug Fixes:
Enhancements:
Build:
CI:
Documentation:
Tests:
Chores: