Skip to content

Commit

Permalink
Declare package exports (#6648)
Browse files Browse the repository at this point in the history
  • Loading branch information
cschroeter committed Sep 20, 2022
1 parent 82edc72 commit 9de3992
Show file tree
Hide file tree
Showing 273 changed files with 2,175 additions and 655 deletions.
88 changes: 88 additions & 0 deletions .changeset/gold-weeks-unite.md
@@ -0,0 +1,88 @@
---
"@chakra-ui/accordion": patch
"@chakra-ui/alert": patch
"@chakra-ui/anatomy": patch
"@chakra-ui/avatar": patch
"@chakra-ui/breadcrumb": patch
"@chakra-ui/button": patch
"@chakra-ui/checkbox": patch
"@chakra-ui/clickable": patch
"@chakra-ui/close-button": patch
"@chakra-ui/color-mode": patch
"@chakra-ui/control-box": patch
"@chakra-ui/counter": patch
"@chakra-ui/css-reset": patch
"@chakra-ui/descendant": patch
"@chakra-ui/editable": patch
"@chakra-ui/react-env": patch
"@chakra-ui/focus-lock": patch
"@chakra-ui/form-control": patch
"@chakra-ui/icon": patch
"@chakra-ui/icons": patch
"@chakra-ui/image": patch
"@chakra-ui/input": patch
"@chakra-ui/layout": patch
"@chakra-ui/live-region": patch
"@chakra-ui/media-query": patch
"@chakra-ui/menu": patch
"@chakra-ui/modal": patch
"@chakra-ui/number-input": patch
"@chakra-ui/pin-input": patch
"@chakra-ui/popover": patch
"@chakra-ui/popper": patch
"@chakra-ui/portal": patch
"@chakra-ui/progress": patch
"@chakra-ui/provider": patch
"@chakra-ui/radio": patch
"@chakra-ui/react": patch
"@chakra-ui/select": patch
"@chakra-ui/skeleton": patch
"@chakra-ui/skip-nav": patch
"@chakra-ui/slider": patch
"@chakra-ui/spinner": patch
"@chakra-ui/stat": patch
"@chakra-ui/styled-system": patch
"@chakra-ui/switch": patch
"@chakra-ui/system": patch
"@chakra-ui/table": patch
"@chakra-ui/tabs": patch
"@chakra-ui/tag": patch
"@chakra-ui/textarea": patch
"@chakra-ui/theme": patch
"@chakra-ui/theme-tools": patch
"@chakra-ui/toast": patch
"@chakra-ui/tooltip": patch
"@chakra-ui/transition": patch
"@chakra-ui/visually-hidden": patch
"@chakra-ui/react-context": patch
"@chakra-ui/react-use-animation-state": patch
"@chakra-ui/react-use-callback-ref": patch
"@chakra-ui/react-use-controllable-state": patch
"@chakra-ui/react-use-disclosure": patch
"@chakra-ui/react-use-event-listener": patch
"@chakra-ui/react-use-focus-effect": patch
"@chakra-ui/react-use-focus-on-pointer-down": patch
"@chakra-ui/react-use-interval": patch
"@chakra-ui/react-use-merge-refs": patch
"@chakra-ui/react-use-outside-click": patch
"@chakra-ui/react-use-pan-event": patch
"@chakra-ui/react-use-previous": patch
"@chakra-ui/react-use-safe-layout-effect": patch
"@chakra-ui/react-use-size": patch
"@chakra-ui/react-use-timeout": patch
"@chakra-ui/react-use-update-effect": patch
"@chakra-ui/hooks": patch
"@chakra-ui/react-utils": patch
"@chakra-ui/utils": patch
"@chakra-ui/breakpoint-utils": patch
"@chakra-ui/dom-utils": patch
"@chakra-ui/event-utils": patch
"@chakra-ui/lazy-utils": patch
"@chakra-ui/merge-utils": patch
"@chakra-ui/number-utils": patch
"@chakra-ui/object-utils": patch
"@chakra-ui/react-children-utils": patch
"@chakra-ui/shared-utils": patch
---

Declare package exports @see https://webpack.js.org/guides/package-exports/
2 changes: 1 addition & 1 deletion .codesandbox/ci.json
@@ -1,5 +1,5 @@
{
"node": "14",
"node": "16",
"sandboxes": ["/examples/create-react-app"],
"packages": [
"packages/components/accordion",
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -97,3 +97,4 @@ yarn-error.log
.yarn-integrity

report.*
*.backup
5 changes: 1 addition & 4 deletions package.json
Expand Up @@ -19,7 +19,6 @@
"dev": "turbo run dev --filter=!./examples/*",
"typecheck": "tsc --noEmit",
"build:theme": "cd packages/components/theme && pnpm build:fast",
"pretest": "pnpm build:theme",
"test": "jest",
"lint": "eslint packages/**/**/src --ext .ts,.tsx --config .eslintrc",
"format:check": "prettier --check packages/**/**/src",
Expand Down Expand Up @@ -63,6 +62,7 @@
"@changesets/types": "5.1.0",
"@commitlint/cli": "14.1.0",
"@commitlint/config-conventional": "14.1.0",
"@octokit/rest": "^19.0.4",
"@storybook/addon-a11y": "^6.5.9",
"@storybook/addon-essentials": "^6.5.9",
"@storybook/addon-storysource": "^6.5.9",
Expand Down Expand Up @@ -126,8 +126,5 @@
},
"engines": {
"node": "16.x"
},
"devDependencies": {
"@octokit/rest": "^19.0.4"
}
}
14 changes: 14 additions & 0 deletions packages/components/accordion/clean-package.config.json
@@ -0,0 +1,14 @@
{
"replace": {
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.esm.js",
"require": "./dist/index.cjs.js"
},
"./package.json": "./package.json"
}
}
}
1 change: 0 additions & 1 deletion packages/components/accordion/index.ts

This file was deleted.

13 changes: 7 additions & 6 deletions packages/components/accordion/package.json
Expand Up @@ -18,9 +18,7 @@
"author": "Segun Adebayo <sage@adebayosegun.com>",
"homepage": "https://github.com/chakra-ui/chakra-ui#readme",
"license": "MIT",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"main": "src/index.ts",
"files": [
"dist"
],
Expand Down Expand Up @@ -52,7 +50,8 @@
"@chakra-ui/system": "workspace:*",
"@chakra-ui/modal": "workspace:*",
"framer-motion": "^6.2.9",
"react": "^18.0.0"
"react": "^18.0.0",
"clean-package": "2.1.1"
},
"peerDependencies": {
"@chakra-ui/system": ">=2.0.0",
Expand All @@ -62,8 +61,10 @@
"scripts": {
"build": "JSX=1 tsup src/index.ts --dts",
"build:fast": "JSX=1 tsup src/index.ts",
"dev": "pnpm build -- --watch",
"dev": "pnpm build:fast -- --watch",
"clean": "rimraf dist .turbo",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"prepack": "clean-package",
"postpack": "clean-package restore"
}
}
14 changes: 14 additions & 0 deletions packages/components/alert/clean-package.config.json
@@ -0,0 +1,14 @@
{
"replace": {
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.esm.js",
"require": "./dist/index.cjs.js"
},
"./package.json": "./package.json"
}
}
}
1 change: 0 additions & 1 deletion packages/components/alert/index.ts

This file was deleted.

13 changes: 7 additions & 6 deletions packages/components/alert/package.json
Expand Up @@ -14,9 +14,7 @@
"author": "Segun Adebayo <sage@adebayosegun.com>",
"homepage": "https://github.com/chakra-ui/chakra-ui#readme",
"license": "MIT",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"main": "src/index.ts",
"files": [
"dist"
],
Expand All @@ -40,17 +38,20 @@
"@chakra-ui/system": "workspace:*",
"@chakra-ui/layout": "workspace:*",
"@chakra-ui/shared-utils": "workspace:*",
"react": "^18.0.0"
"react": "^18.0.0",
"clean-package": "2.1.1"
},
"peerDependencies": {
"@chakra-ui/system": ">=2.0.0",
"react": ">=18"
},
"scripts": {
"build": "JSX=1 tsup src/index.ts --dts",
"dev": "pnpm build -- --watch",
"dev": "pnpm build:fast -- --watch",
"clean": "rimraf dist .turbo",
"typecheck": "tsc --noEmit",
"build:fast": "JSX=1 tsup src/index.ts"
"build:fast": "JSX=1 tsup src/index.ts",
"prepack": "clean-package",
"postpack": "clean-package restore"
}
}
14 changes: 14 additions & 0 deletions packages/components/anatomy/clean-package.config.json
@@ -0,0 +1,14 @@
{
"replace": {
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.esm.js",
"require": "./dist/index.cjs.js"
},
"./package.json": "./package.json"
}
}
}
1 change: 0 additions & 1 deletion packages/components/anatomy/index.ts

This file was deleted.

13 changes: 8 additions & 5 deletions packages/components/anatomy/package.json
Expand Up @@ -11,9 +11,7 @@
"author": "Segun Adebayo <sage@adebayosegun.com>",
"homepage": "https://github.com/chakra-ui/chakra-ui#readme",
"license": "MIT",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"main": "src/index.ts",
"sideEffects": false,
"files": [
"dist"
Expand All @@ -31,9 +29,14 @@
},
"scripts": {
"build": "tsup src/index.ts --dts",
"dev": "pnpm build -- --watch",
"dev": "pnpm build:fast -- --watch",
"clean": "rimraf dist .turbo",
"typecheck": "tsc --noEmit",
"build:fast": "tsup src/index.ts"
"build:fast": "tsup src/index.ts",
"prepack": "clean-package",
"postpack": "clean-package restore"
},
"devDependencies": {
"clean-package": "2.1.1"
}
}
14 changes: 14 additions & 0 deletions packages/components/avatar/clean-package.config.json
@@ -0,0 +1,14 @@
{
"replace": {
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.esm.js",
"require": "./dist/index.cjs.js"
},
"./package.json": "./package.json"
}
}
}
1 change: 0 additions & 1 deletion packages/components/avatar/index.ts

This file was deleted.

13 changes: 7 additions & 6 deletions packages/components/avatar/package.json
Expand Up @@ -16,9 +16,7 @@
"author": "Segun Adebayo <sage@adebayosegun.com>",
"homepage": "https://github.com/chakra-ui/chakra-ui#readme",
"license": "MIT",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"main": "src/index.ts",
"files": [
"dist"
],
Expand All @@ -43,17 +41,20 @@
"@chakra-ui/shared-utils": "workspace:*",
"@chakra-ui/system": "workspace:*",
"@chakra-ui/layout": "workspace:*",
"react": "^18.0.0"
"react": "^18.0.0",
"clean-package": "2.1.1"
},
"peerDependencies": {
"@chakra-ui/system": ">=2.0.0",
"react": ">=18"
},
"scripts": {
"build": "JSX=1 tsup src/index.ts --dts",
"dev": "pnpm build -- --watch",
"dev": "pnpm build:fast -- --watch",
"clean": "rimraf dist .turbo",
"typecheck": "tsc --noEmit",
"build:fast": "JSX=1 tsup src/index.ts"
"build:fast": "JSX=1 tsup src/index.ts",
"prepack": "clean-package",
"postpack": "clean-package restore"
}
}
14 changes: 14 additions & 0 deletions packages/components/breadcrumb/clean-package.config.json
@@ -0,0 +1,14 @@
{
"replace": {
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.esm.js",
"require": "./dist/index.cjs.js"
},
"./package.json": "./package.json"
}
}
}
1 change: 0 additions & 1 deletion packages/components/breadcrumb/index.ts

This file was deleted.

13 changes: 7 additions & 6 deletions packages/components/breadcrumb/package.json
Expand Up @@ -14,9 +14,7 @@
"author": "Segun Adebayo <sage@adebayosegun.com>",
"homepage": "https://github.com/chakra-ui/chakra-ui#readme",
"license": "MIT",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"main": "src/index.ts",
"files": [
"dist"
],
Expand All @@ -40,17 +38,20 @@
"@chakra-ui/shared-utils": "workspace:*",
"@chakra-ui/system": "workspace:*",
"react-router-dom": "6.0.0",
"react": "^18.0.0"
"react": "^18.0.0",
"clean-package": "2.1.1"
},
"peerDependencies": {
"@chakra-ui/system": ">=2.0.0",
"react": ">=18"
},
"scripts": {
"build": "JSX=1 tsup src/index.ts --dts",
"dev": "pnpm build -- --watch",
"dev": "pnpm build:fast -- --watch",
"clean": "rimraf dist .turbo",
"typecheck": "tsc --noEmit",
"build:fast": "JSX=1 tsup src/index.ts"
"build:fast": "JSX=1 tsup src/index.ts",
"prepack": "clean-package",
"postpack": "clean-package restore"
}
}
14 changes: 14 additions & 0 deletions packages/components/button/clean-package.config.json
@@ -0,0 +1,14 @@
{
"replace": {
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.esm.js",
"require": "./dist/index.cjs.js"
},
"./package.json": "./package.json"
}
}
}
1 change: 0 additions & 1 deletion packages/components/button/index.ts

This file was deleted.

1 comment on commit 9de3992

@vercel
Copy link

@vercel vercel bot commented on 9de3992 Sep 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.