Skip to content

Commit

Permalink
build: consistently use .cjs and .mjs files for React component b…
Browse files Browse the repository at this point in the history
…uilds
  • Loading branch information
Robbert committed Nov 10, 2024
1 parent 51fb153 commit 46e795c
Show file tree
Hide file tree
Showing 37 changed files with 76 additions and 54 deletions.
22 changes: 22 additions & 0 deletions .changeset/slimy-clocks-exist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
"@utrecht/form-field-error-message-react": patch
"@utrecht/form-field-description-react": patch
"@utrecht/form-field-checkbox-react": patch
"@utrecht/select-combobox-react": patch
"@utrecht/checkbox-group-react": patch
"@utrecht/radio-button-react": patch
"@utrecht/radio-group-react": patch
"@utrecht/form-field-react": patch
"@utrecht/form-label-react": patch
"@utrecht/calendar-react": patch
"@utrecht/checkbox-react": patch
"@utrecht/combobox-react": patch
"@utrecht/fieldset-react": patch
"@utrecht/listbox-react": patch
"@utrecht/textbox-react": patch
"@utrecht/button-react": patch
"@utrecht/link-react": patch
"@utrecht/component-library-react": patch
---

Consistently use `dist/*.cjs` and `dist/*.mjs` files for React components'
4 changes: 2 additions & 2 deletions packages/component-library-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"watch:build": "rollup -c --watch",
"watch:test": "jest --verbose --watch"
},
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/",
Expand Down
2 changes: 1 addition & 1 deletion packages/component-library-react/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default [
input: 'src/css-module/index.ts',
output: [
{
file: 'dist/css-module/index.js',
file: 'dist/css-module/index.cjs',
format: 'cjs',
sourcemap: true,
globals: outputGlobals,
Expand Down
4 changes: 2 additions & 2 deletions packages/components-react/button-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"author": "Community for NL Design System",
"description": "Button component for the Municipality of Utrecht based on the NL Design System architecture",
"license": "EUPL-1.2",
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/",
Expand Down
2 changes: 1 addition & 1 deletion packages/components-react/button-react/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default [
input: './src/css.tsx',
output: [
{
file: './dist/css.js',
file: './dist/css.cjs',
format: 'cjs',
sourcemap: true,
},
Expand Down
4 changes: 2 additions & 2 deletions packages/components-react/calendar-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"author": "Community for NL Design System",
"description": "Calendar component for the Municipality of Utrecht based on the NL Design System architecture",
"license": "EUPL-1.2",
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/",
Expand Down
2 changes: 1 addition & 1 deletion packages/components-react/calendar-react/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default [
input: './src/css.tsx',
output: [
{
file: './dist/css.js',
file: './dist/css.cjs',
format: 'cjs',
sourcemap: true,
},
Expand Down
4 changes: 2 additions & 2 deletions packages/components-react/checkbox-group-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"author": "Community for NL Design System",
"description": "Checkbox Group component for the Municipality of Utrecht based on the NL Design System architecture",
"license": "EUPL-1.2",
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default [
input: './src/css.tsx',
output: [
{
file: './dist/css.js',
file: './dist/css.cjs',
format: 'cjs',
sourcemap: true,
},
Expand Down
4 changes: 2 additions & 2 deletions packages/components-react/checkbox-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"author": "Community for NL Design System",
"description": "Checkbox component for the Municipality of Utrecht based on the NL Design System architecture",
"license": "EUPL-1.2",
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/",
Expand Down
2 changes: 1 addition & 1 deletion packages/components-react/checkbox-react/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default [
input: './src/css.tsx',
output: [
{
file: './dist/css.js',
file: './dist/css.cjs',
format: 'cjs',
sourcemap: true,
},
Expand Down
4 changes: 2 additions & 2 deletions packages/components-react/combobox-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"author": "Community for NL Design System",
"description": "Combobox component for the Municipality of Utrecht based on the NL Design System architecture",
"license": "EUPL-1.2",
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/",
Expand Down
2 changes: 1 addition & 1 deletion packages/components-react/combobox-react/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default [
input: './src/css.tsx',
output: [
{
file: './dist/css.js',
file: './dist/css.cjs',
format: 'cjs',
sourcemap: true,
},
Expand Down
4 changes: 2 additions & 2 deletions packages/components-react/fieldset-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"author": "Community for NL Design System",
"description": "Fieldset component for the Municipality of Utrecht based on the NL Design System architecture",
"license": "EUPL-1.2",
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/",
Expand Down
2 changes: 1 addition & 1 deletion packages/components-react/fieldset-react/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default [
input: './src/css.tsx',
output: [
{
file: './dist/css.js',
file: './dist/css.cjs',
format: 'cjs',
sourcemap: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"author": "Community for NL Design System",
"description": "Form Field Checkbox component for the Municipality of Utrecht based on the NL Design System architecture",
"license": "EUPL-1.2",
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default [
input: './src/css.tsx',
output: [
{
file: './dist/css.js',
file: './dist/css.cjs',
format: 'cjs',
sourcemap: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"author": "Community for NL Design System",
"description": "Form Field Description component for the Municipality of Utrecht based on the NL Design System architecture",
"license": "EUPL-1.2",
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default [
input: './src/css.tsx',
output: [
{
file: './dist/css.js',
file: './dist/css.cjs',
format: 'cjs',
sourcemap: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"author": "Community for NL Design System",
"description": "Form Field Error Message component for the Municipality of Utrecht based on the NL Design System architecture",
"license": "EUPL-1.2",
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default [
input: './src/css.tsx',
output: [
{
file: './dist/css.js',
file: './dist/css.cjs',
format: 'cjs',
sourcemap: true,
},
Expand Down
4 changes: 2 additions & 2 deletions packages/components-react/form-field-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"author": "Community for NL Design System",
"description": "Form Field component for the Municipality of Utrecht based on the NL Design System architecture",
"license": "EUPL-1.2",
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default [
input: './src/css.tsx',
output: [
{
file: './dist/css.js',
file: './dist/css.cjs',
format: 'cjs',
sourcemap: true,
},
Expand Down
4 changes: 2 additions & 2 deletions packages/components-react/form-label-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"author": "Community for NL Design System",
"description": "Form Label component for the Municipality of Utrecht based on the NL Design System architecture",
"license": "EUPL-1.2",
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default [
input: './src/css.tsx',
output: [
{
file: './dist/css.js',
file: './dist/css.cjs',
format: 'cjs',
sourcemap: true,
},
Expand Down
4 changes: 2 additions & 2 deletions packages/components-react/link-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"author": "Community for NL Design System",
"description": "Link component for the Municipality of Utrecht based on the NL Design System architecture",
"license": "EUPL-1.2",
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/",
Expand Down
2 changes: 1 addition & 1 deletion packages/components-react/link-react/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default [
input: './src/css.tsx',
output: [
{
file: './dist/css.js',
file: './dist/css.cjs',
format: 'cjs',
sourcemap: true,
},
Expand Down
4 changes: 2 additions & 2 deletions packages/components-react/listbox-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"author": "Community for NL Design System",
"description": "Listbox component for the Municipality of Utrecht based on the NL Design System architecture",
"license": "EUPL-1.2",
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/",
Expand Down
2 changes: 1 addition & 1 deletion packages/components-react/listbox-react/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default [
input: './src/css.tsx',
output: [
{
file: './dist/css.js',
file: './dist/css.cjs',
format: 'cjs',
sourcemap: true,
},
Expand Down
4 changes: 2 additions & 2 deletions packages/components-react/radio-button-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"author": "Community for NL Design System",
"description": "Radio Button component for the Municipality of Utrecht based on the NL Design System architecture",
"license": "EUPL-1.2",
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default [
input: './src/css.tsx',
output: [
{
file: './dist/css.js',
file: './dist/css.cjs',
format: 'cjs',
sourcemap: true,
},
Expand Down
4 changes: 2 additions & 2 deletions packages/components-react/radio-group-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"author": "Community for NL Design System",
"description": "Radio Group component for the Municipality of Utrecht based on the NL Design System architecture",
"license": "EUPL-1.2",
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default [
input: './src/css.tsx',
output: [
{
file: './dist/css.js',
file: './dist/css.cjs',
format: 'cjs',
sourcemap: true,
},
Expand Down
4 changes: 2 additions & 2 deletions packages/components-react/select-combobox-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"author": "Community for NL Design System",
"description": "Select Combobox component for the Municipality of Utrecht based on the NL Design System architecture",
"license": "EUPL-1.2",
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default [
input: './src/css.tsx',
output: [
{
file: './dist/css.js',
file: './dist/css.cjs',
format: 'cjs',
sourcemap: true,
},
Expand Down
4 changes: 2 additions & 2 deletions packages/components-react/textbox-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"author": "Community for NL Design System",
"description": "Textbox component for the Municipality of Utrecht based on the NL Design System architecture",
"license": "EUPL-1.2",
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/",
Expand Down
2 changes: 1 addition & 1 deletion packages/components-react/textbox-react/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default [
input: './src/css.tsx',
output: [
{
file: './dist/css.js',
file: './dist/css.cjs',
format: 'cjs',
sourcemap: true,
},
Expand Down

0 comments on commit 46e795c

Please sign in to comment.