diff --git a/.changeset/grumpy-maps-appear.md b/.changeset/grumpy-maps-appear.md new file mode 100644 index 00000000000..f3c9ce3cdda --- /dev/null +++ b/.changeset/grumpy-maps-appear.md @@ -0,0 +1,5 @@ +--- +'@primer/react': major +--- + +Remove wildcard exports from `@primer/react` diff --git a/packages/react/package.json b/packages/react/package.json index 39ccb7bb798..69758ea4c00 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -24,18 +24,7 @@ "./test-helpers": { "import": "./lib-esm/test-helpers.js", "require": "./lib/test-helpers.js" - }, - "./lib-esm/*": { - "import": [ - "./lib-esm/*.js", - "./lib-esm/*/index.js" - ], - "require": [ - "./lib/*.js", - "./lib/*/index.js" - ] - }, - "./lib-esm/internal/*": null + } }, "typings": "lib/index.d.ts", "sideEffects": [ diff --git a/packages/react/rollup.config.mjs b/packages/react/rollup.config.mjs index 0264079ae5b..b201e7dbba3 100644 --- a/packages/react/rollup.config.mjs +++ b/packages/react/rollup.config.mjs @@ -1,11 +1,9 @@ import path from 'node:path' -import {fileURLToPath} from 'node:url' import commonjs from '@rollup/plugin-commonjs' import resolve from '@rollup/plugin-node-resolve' import babel from '@rollup/plugin-babel' import replace from '@rollup/plugin-replace' import terser from '@rollup/plugin-terser' -import glob from 'fast-glob' import {visualizer} from 'rollup-plugin-visualizer' import {importCSS} from 'rollup-plugin-import-css' import postcss from 'rollup-plugin-postcss' @@ -13,8 +11,6 @@ import postcssPresetPrimer from 'postcss-preset-primer' import MagicString from 'magic-string' import packageJson from './package.json' with {type: 'json'} -const __dirname = path.dirname(fileURLToPath(import.meta.url)) - const input = new Set([ // "exports" // "." @@ -28,39 +24,6 @@ const input = new Set([ // "./next" 'src/next/index.ts', - - // Make sure all members are exported - 'src/constants.ts', - - ...glob.sync( - [ - // "./lib-esm/hooks/*" - 'src/hooks/*', - - // "./lib-esm/polyfills/*" - 'src/polyfills/*', - - // "./lib-esm/utils/*" - 'src/utils/*', - - // for backward compatbility, see https://github.com/primer/react/pull/3740 - 'src/ActionMenu/index.ts', - ], - { - cwd: __dirname, - ignore: [ - '**/__tests__/**', - '*.stories.tsx', - - // File currently imports from package.json - 'src/utils/test-deprecations.tsx', - - // Files use dependencies which are not listed by package - 'src/utils/testing.tsx', - 'src/utils/test-matchers.tsx', - ], - }, - ), ]) function getEntrypointsFromInput(input) {