Skip to content

Commit de7dbde

Browse files
authored
refactor(react): remove wildcard imports (#5075)
* refactor(react): remove wildcard imports * chore: add changeset --------- Co-authored-by: Josh Black <joshblack@users.noreply.github.com>
1 parent 4680ce6 commit de7dbde

File tree

3 files changed

+6
-49
lines changed

3 files changed

+6
-49
lines changed

.changeset/grumpy-maps-appear.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@primer/react': major
3+
---
4+
5+
Remove wildcard exports from `@primer/react`

packages/react/package.json

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,7 @@
2424
"./test-helpers": {
2525
"import": "./lib-esm/test-helpers.js",
2626
"require": "./lib/test-helpers.js"
27-
},
28-
"./lib-esm/*": {
29-
"import": [
30-
"./lib-esm/*.js",
31-
"./lib-esm/*/index.js"
32-
],
33-
"require": [
34-
"./lib/*.js",
35-
"./lib/*/index.js"
36-
]
37-
},
38-
"./lib-esm/internal/*": null
27+
}
3928
},
4029
"typings": "lib/index.d.ts",
4130
"sideEffects": [

packages/react/rollup.config.mjs

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
import path from 'node:path'
2-
import {fileURLToPath} from 'node:url'
32
import commonjs from '@rollup/plugin-commonjs'
43
import resolve from '@rollup/plugin-node-resolve'
54
import babel from '@rollup/plugin-babel'
65
import replace from '@rollup/plugin-replace'
76
import terser from '@rollup/plugin-terser'
8-
import glob from 'fast-glob'
97
import {visualizer} from 'rollup-plugin-visualizer'
108
import {importCSS} from 'rollup-plugin-import-css'
119
import postcss from 'rollup-plugin-postcss'
1210
import postcssPresetPrimer from 'postcss-preset-primer'
1311
import MagicString from 'magic-string'
1412
import packageJson from './package.json' with {type: 'json'}
1513

16-
const __dirname = path.dirname(fileURLToPath(import.meta.url))
17-
1814
const input = new Set([
1915
// "exports"
2016
// "."
@@ -28,39 +24,6 @@ const input = new Set([
2824

2925
// "./next"
3026
'src/next/index.ts',
31-
32-
// Make sure all members are exported
33-
'src/constants.ts',
34-
35-
...glob.sync(
36-
[
37-
// "./lib-esm/hooks/*"
38-
'src/hooks/*',
39-
40-
// "./lib-esm/polyfills/*"
41-
'src/polyfills/*',
42-
43-
// "./lib-esm/utils/*"
44-
'src/utils/*',
45-
46-
// for backward compatbility, see https://github.com/primer/react/pull/3740
47-
'src/ActionMenu/index.ts',
48-
],
49-
{
50-
cwd: __dirname,
51-
ignore: [
52-
'**/__tests__/**',
53-
'*.stories.tsx',
54-
55-
// File currently imports from package.json
56-
'src/utils/test-deprecations.tsx',
57-
58-
// Files use dependencies which are not listed by package
59-
'src/utils/testing.tsx',
60-
'src/utils/test-matchers.tsx',
61-
],
62-
},
63-
),
6427
])
6528

6629
function getEntrypointsFromInput(input) {

0 commit comments

Comments
 (0)