Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declare package exports #6648

Merged
merged 26 commits into from Sep 20, 2022
Merged

Declare package exports #6648

merged 26 commits into from Sep 20, 2022

Conversation

cschroeter
Copy link
Member

@vercel
Copy link

vercel bot commented Sep 7, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
chakra-ui-storybook ✅ Ready (Inspect) Visit Preview Sep 20, 2022 at 11:38AM (UTC)

@changeset-bot
Copy link

changeset-bot bot commented Sep 7, 2022

🦋 Changeset detected

Latest commit: ec2d979

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 87 packages
Name Type
@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
@chakra-ui/storybook-addon Patch
@chakra-ui/test-utils Patch
@chakra-ui/props-docs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 7, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit ec2d979:

Sandbox Source
create-react-app-ts Configuration

@segunadebayo segunadebayo merged commit 9de3992 into main Sep 20, 2022
@segunadebayo segunadebayo deleted the feat/package-exports branch September 20, 2022 12:00
@github-actions github-actions bot mentioned this pull request Sep 20, 2022
@cschroeter cschroeter restored the feat/package-exports branch September 20, 2022 12:11
@vadimdemedes
Copy link

I think this change has introduced a regression, because TypeScript can no longer resolve types of @chakra-ui/react package:

Could not find a declaration file for module '@chakra-ui/react'. 'node_modules/@chakra-ui/react/dist/index.cjs.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/chakra-ui__react` if it exists or add a new declaration (.d.ts) file containing `declare module '@chakra-ui/react';`

1 import { Colors, SpaceProps } from "@chakra-ui/react";

Since this PR introduced exports field in package.json, this object should contain a types field too. When exports is present, TypeScript seems to ignore the types field at the root of package.json. I added types to export and TypeScript errors went away:

  "exports": {
    ".": {
      "import": "./dist/index.esm.js",
      "require": "./dist/index.cjs.js"
+     "types": "./dist/index.d.ts"
    },
    "./package.json": "./package.json"
  },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Topic: Build and Workflow ↩️ Issue or PR related to build process and workflow automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants