Skip to content

(#67) Fix package distribution issues from integration review#68

Merged
adriancofie merged 1 commit intodevelopfrom
fix/67-package-distribution
Apr 27, 2026
Merged

(#67) Fix package distribution issues from integration review#68
adriancofie merged 1 commit intodevelopfrom
fix/67-package-distribution

Conversation

@adriancofie
Copy link
Copy Markdown
Contributor

Summary

  • Switch rollup to multi-entry input so the documented ./core and ./ncids subpath exports (and matching .d.ts files) actually emit.
  • Replace the broken ./styles export with a real compiled CSS bundle (USWDS global + usa-pagination, usa-icon, usa-collection) so consumers can import '@nciocpl/react-components/styles' and get the styles the shipped components need.
  • Raise the React peer to >=17.0.0 (the build emits react/jsx-runtime, absent on React <16.14, and React 16 has been EOL since 2024) and declare @nciocpl/ncids-css as the optional peer the existing peerDependenciesMeta was already referencing.
  • README gets a Requirements section plus Vite/Webpack recipes for serving the uswds-img sprite.

Background: these are findings from a downstream integration of v0.1.0 — ./core and ./ncids pointed at non-existent files, ./styles resolved to nothing useful, and consumers on React <16.14 hit a cryptic Can't resolve 'react/jsx-runtime' error.

Test plan

  • CI passes (typecheck, tests, build)
  • After build, inspect dist/:
    • dist/{esm,cjs}/index.js exists
    • dist/{esm,cjs}/components/{core,ncids}/index.js exist
    • dist/types/index.d.ts and per-subpath .d.ts exist
    • dist/styles/index.css contains rules for usa-pagination and usa-collection
  • After publish, install in a sample app and verify these imports all resolve:
    • import { Pager } from '@nciocpl/react-components'
    • import { Pager } from '@nciocpl/react-components/ncids'
    • import '@nciocpl/react-components/styles' (with uswds-img served at /img)
  • Confirm components render with USWDS styling end-to-end

Closes #67

Address findings from downstream integration of v0.1.0:

- Subpath exports (./core, ./ncids): switch rollup to multi-entry input
  so the documented subpath bundles and matching .d.ts files are
  actually emitted.
- Bundled stylesheet (./styles): the export now resolves to a real
  compiled CSS file (uswds-global, usa-pagination, usa-icon,
  usa-collection). README documents the import and the uswds-img
  sprite setup for Vite and Webpack consumers.
- React peer raised to >=17.0.0. The build emits react/jsx-runtime,
  which only exists on React >=16.14, and React 16 has been EOL since
  2024.
- @nciocpl/ncids-css declared as an optional peer (>=3.0.0) so the
  existing peerDependenciesMeta.optional entry has effect.
- Build hygiene: eliminate TS5069 declarationMap warning by overriding
  declarationMap:false alongside declaration:false in rollup-plugin-
  typescript options.

Closes #67
@github-actions
Copy link
Copy Markdown
Contributor

Storybook Preview

This PR includes component changes. A Storybook build was verified successfully.

Once merged, the updated Storybook will be deployed to GitHub Pages automatically.

@adriancofie adriancofie merged commit ce8df68 into develop Apr 27, 2026
10 checks passed
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.

Update shared repo to address findings downstream

1 participant