Skip to content

Conversation

@mozisan
Copy link

@mozisan mozisan commented Oct 28, 2025

📝 Description

Reorder package.json exports fields for consistency across the @heroui/react package.
This change ensures that types is always placed first and default is always placed last in the exports field ordering, following Node.js package exports best practices.

⛳️ Current behavior (updates)

The exports fields in package.json and related build scripts had inconsistent ordering:

  • Some entries had import before types
  • Some entries had default before style

🚀 New behavior

All exports fields now follow a consistent ordering convention:

  • types always comes first (for better TypeScript resolution)
  • default always comes last (as per Node.js resolution algorithm best practices)
package.json after running cd packages/react && pnpm turbo run build && pnpm run prepack
{
  "name": "@heroui/react",
  "version": "3.0.0-alpha.35",
  "description": "🚀 Beautiful and modern React UI library built with Tailwind CSS 4.0.",
  "license": "MIT",
  "type": "module",
  "sideEffects": false,
  "main": "./dist/index.js",
  "module": "./dist/index.js",
  "types": "./dist/index.d.ts",
  "author": "HeroUI <[email protected]>",
  "homepage": "https://heroui.com",
  "keywords": [
    "next",
    "next ui",
    "hero ui",
    "components",
    "modern components",
    "react components",
    "react ui"
  ],
  "files": [
    "dist"
  ],
  "publishConfig": {
    "access": "public"
  },
  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "import": "./dist/index.js"
    },
    "./styles": {
      "style": "./dist/styles.css",
      "default": "./dist/styles.css"
    },
    "./package.json": "./package.json"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/heroui-inc/heroui.git",
    "directory": "packages/react"
  },
  "bugs": {
    "url": "https://github.com/heroui-inc/heroui/issues"
  },
  "dependencies": {
    "@internationalized/date": "3.10.0",
    "@radix-ui/react-avatar": "1.1.10",
    "@radix-ui/react-slot": "1.2.3",
    "@react-aria/ssr": "3.9.10",
    "@react-aria/utils": "3.31.0",
    "@react-types/shared": "3.32.1",
    "clsx": "2.1.1",
    "input-otp": "1.4.2",
    "react-aria-components": "1.13.0",
    "tailwind-merge": "3.3.1",
    "tailwind-variants": "3.1.1"
  },
  "peerDependencies": {
    "react": ">=19.0.0",
    "react-dom": ">=19.0.0",
    "tailwindcss": ">=4.0.0"
  }
}

💣 Is this a breaking change (Yes/No):

No

📝 Additional Information

This change improves consistency across the codebase and follows the official Node.js package exports best practices as documented at https://nodejs.org/api/packages.html.

  1. types

    "types" - can be used by typing systems to resolve the typing file for the given export. This condition should always be included first.

  2. default

    "default" - the generic fallback that always matches. Can be a CommonJS or ES module file. This condition should always come last.

Ensure 'types' is always placed first and 'default' is always placed
last in exports field ordering across package.json and related scripts.
@mozisan mozisan requested a review from jrgarciadev as a code owner October 28, 2025 21:07
@changeset-bot
Copy link

changeset-bot bot commented Oct 28, 2025

⚠️ No Changeset found

Latest commit: 0df4595

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@vercel
Copy link

vercel bot commented Oct 28, 2025

@mozisan is attempting to deploy a commit to the HeroUI Inc Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 28, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant