Skip to content

Commit

Permalink
feat(package): update exports to import/require (#2366)
Browse files Browse the repository at this point in the history
* fix(package): update exports to import/require

* feat: include esm-only modules in CommonJS bundle

* fix: update ordering of import and require

* docs: add nextjs example

* chore: update eslint config

* chore: remove nextjs example from workspaces

* chore: add changeset

* chore: update package.json exports order

* ci: add examples check to ci.yml

* chore: add nextjs example to setup
  • Loading branch information
joshblack committed Sep 28, 2022
1 parent cad2bc0 commit 13b4460
Show file tree
Hide file tree
Showing 14 changed files with 1,880 additions and 56 deletions.
5 changes: 5 additions & 0 deletions .changeset/twenty-pianos-suffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': minor
---

Update "exports" config to use "import" and "require" for ESM and CommonJS bundles
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"types/**/*",
"consumer-test/**/*",
"contributor-docs/adrs/*",
"examples/nextjs/**",
// Note: this file is inlined from an external dependency
"src/utils/polymorphic.ts"
],
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,11 @@ jobs:

- name: Type check
run: npm run test:type-check

- name: Install dependencies for examples
working-directory: examples/nextjs
run: npm ci

- name: Build examples
working-directory: examples/nextjs
run: npm run build
1 change: 1 addition & 0 deletions examples/nextjs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.next
5 changes: 5 additions & 0 deletions examples/nextjs/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
Loading

0 comments on commit 13b4460

Please sign in to comment.