Skip to content

Incorrect package.json exports for ./utils/* #360

@luojiyin1987

Description

@luojiyin1987

Issue: Incorrect package.json exports for ./utils/*

The package.json file currently has an export for ./utils/* that points to ./dist/utils/*.d.ts and ./dist/utils/*.js. However, the actual utility files are located in:

  • dist/client/utils/
  • dist/server/utils/
  • dist/vite/utils/

This export is invalid because the dist/utils directory does not exist. The build process preserves the directory structure of the source files, so the utils are placed in their respective subdirectories.

Steps to reproduce:

  1. Run bun run build
  2. Check the dist directory structure - there is no utils folder at the top level

Expected behavior:

The package.json should not export a ./utils/* path since the files are not in that location. If the utils are intended to be exported, they should be exported from their respective directories (e.g., ./client/utils/*, ./server/utils/*, ./vite/utils/*).

Current exports in package.json:

{
  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "import": "./dist/index.js"
    },
    "./types": {
      "types": "./dist/types.d.ts",
      "import": "./dist/types.js"
    },
    "./factory": {
      "types": "./dist/factory/index.d.ts",
      "import": "./dist/factory/index.js"
    },
    "./server": {
      "types": "./dist/server/index.d.ts",
      "import": "./dist/server/index.js"
    },
    "./server/base": {
      "types": "./dist/server/base.d.ts",
      "import": "./dist/server/base.js"
    },
    "./client": {
      "types": "./dist/client/index.d.ts",
      "import": "./dist/client/index.js"
    },
    "./utils/*": {
      "types": "./dist/utils/*.d.ts",
      "import": "./dist/utils/*.js"
    },
    "./vite": {
      "types": "./dist/vite/index.d.ts",
      "import": "./dist/vite/index.js"
    },
    "./vite/client": {
      "types": "./dist/vite/client.d.ts",
      "import": "./dist/vite/client.js"
    },
    "./vite/components": {
      "types": "./dist/vite/components/index.d.ts",
      "import": "./dist/vite/components/index.js"
    }
  },
  "typesVersions": {
    "*": {
      "types": [
        "./dist/types"
      ],
      "factory": [
        "./dist/factory"
      ],
      "server": [
        "./dist/server"
      ],
      "server/base": [
        "./dist/server/base"
      ],
      "client": [
        "./dist/client"
      ],
      "utils/*": [
        "./dist/utils/*"
      ],
      "vite": [
        "./dist/vite"
      ],
      "vite/client": [
        "./dist/vite/client"
      ],
      "vite/components": [
        "./dist/vite/components"
      ]
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions