fix(packaging): make npm package publishable - #36
Open
gmenher wants to merge 1 commit into
Open
Conversation
Address the packaging issues blocking the automated publish pipeline (Gkrumbach07#11): - Add root '.' entry to exports map so bare 'import from openshell-dashboard' resolves correctly under modern bundlers. - Fix types field: point at dist/pages/index.d.ts to match main/module (was dist/types/index.d.ts, causing type/runtime mismatch for consumers). - Remove 9 peerDependencies duplicated in dependencies (react, react-dom, react-router-dom, @patternfly/*, @tanstack/react-query). Consumers were getting a second copy of React in their tree, breaking context hooks. - Add build:lib step to CI so publishability cannot silently break. - Add exports resolution verification step (npm pack + require.resolve). Note: 'type: module' deliberately NOT added. The tsconfig emits extensionless relative imports (ESNext with node moduleResolution). Node ESM requires explicit extensions, so type:module would break Node-direct usage. Since the sole consumer is a bundler (webpack/rspack in odh-dashboard), this is unnecessary. Closes Gkrumbach07#30
danreed-rh
self-requested a review
August 12, 2026 17:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ref: #30
Summary
Fixes the packaging issues that block the automated publish pipeline (#11).
Changes
.export — Add entry so bareimport from 'openshell-dashboard'resolves correctly under modern bundlers.typesfield — Point atdist/pages/index.d.tsto matchmain/module(wasdist/types/index.d.ts, causing type/runtime mismatch for consumers).peerDependenciesanddependencies. Consumers got a second copy of React in their tree, breaking context hooks.build:libto CI — Catches packaging breakage before merge.build:lib, CI doesnpm pack+ installs in a temp dir +require.resolveon all export entries. Catches broken exports maps.NOT included (deliberate)
"type": "module"is not added. The tsconfig emits extensionless relative imports (ESNext withmoduleResolution: node). Node ESM requires explicit.jsextensions, sotype: modulewould break Node-direct usage. Since the sole consumer is a bundler (webpack/rspack in odh-dashboard), this is unnecessary and would be harmful.Testing
Verified locally:
Also verified
go build ./...andgo test ./...pass (backend unchanged).