Skip to content

Commit a2b5969

Browse files
authored
Merge branch 'main' into refactor-text-stories
2 parents 9aa577b + b520531 commit a2b5969

18 files changed

+59
-40
lines changed

.changeset/chilled-crabs-bow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@primer/react': minor
3+
---
4+
5+
Modules under an internal export pattern are not able to be imported from outside @primer/react

contributor-docs/adrs/adr-016-internal-modules.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@
55
| Stage | Status |
66
| -------- | ------ |
77
| Approved ||
8-
| Adopted | 🚧 |
8+
| Adopted | |
99

1010
## Context
1111

1212
Currently all files live under the `src` directory. In the `npm` package for `@primer/react`, we specify the following export pattern:
1313

1414
```json5
1515
{
16-
"exports": {
16+
exports: {
1717
// ...
18-
"./lib-esm/*": {
19-
"import": [
18+
'./lib-esm/*': {
19+
import: [
2020
// ...
2121
],
22-
"require": [
22+
require: [
2323
// ...
24-
]
25-
}
26-
}
24+
],
25+
},
26+
},
2727
}
2828
```
2929

@@ -37,10 +37,10 @@ In the `"exports"` field of our `npm` package, we can then add the following pat
3737

3838
```json5
3939
{
40-
"exports": {
40+
exports: {
4141
// ...
42-
"./lib-esm/internal/*": null
43-
}
42+
'./lib-esm/internal/*': null,
43+
},
4444
}
4545
```
4646

@@ -57,7 +57,6 @@ This pattern would remove any files and folders within `src/internal` from the p
5757
}
5858
```
5959

60-
6160
### Impact
6261

6362
- Update the `"exports"` field in `package.json` to exclude `./lib-esm/internal` from usage

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"./lib/*.js",
2727
"./lib/*/index.js"
2828
]
29-
}
29+
},
30+
"./lib-esm/internal/*": null
3031
},
3132
"typings": "lib/index.d.ts",
3233
"sideEffects": false,

0 commit comments

Comments
 (0)