Skip to content

fix: expand the types of exports#183

Merged
pi0 merged 2 commits into
unjs:mainfrom
sxzz:fix/exports-type
Jul 1, 2024
Merged

fix: expand the types of exports#183
pi0 merged 2 commits into
unjs:mainfrom
sxzz:fix/exports-type

Conversation

@sxzz

@sxzz sxzz commented Jun 30, 2024

Copy link
Copy Markdown
Member

Refer to Vue's package.json. It also could be an array Type: <Object> | <string> | <string[]>

{
  "exports": {
    ".": {
      "import": {
        "types": "./dist/vue.d.mts",
        "node": "./index.mjs",
        "default": "./dist/vue.runtime.esm-bundler.js"
      },
      "require": {
        "types": "./dist/vue.d.ts",
        "node": {
          "production": "./dist/vue.cjs.prod.js",
          "development": "./dist/vue.cjs.js",
          "default": "./index.js"
        },
        "default": "./index.js"
      }
    },
    "./server-renderer": {
      "import": {
        "types": "./server-renderer/index.d.mts",
        "default": "./server-renderer/index.mjs"
      },
      "require": {
        "types": "./server-renderer/index.d.ts",
        "default": "./server-renderer/index.js"
      }
    },
    "./compiler-sfc": {
      "import": {
        "types": "./compiler-sfc/index.d.mts",
        "browser": "./compiler-sfc/index.browser.mjs",
        "default": "./compiler-sfc/index.mjs"
      },
      "require": {
        "types": "./compiler-sfc/index.d.ts",
        "browser": "./compiler-sfc/index.browser.js",
        "default": "./compiler-sfc/index.js"
      }
    },
    "./jsx-runtime": {
      "types": "./jsx-runtime/index.d.ts",
      "import": "./jsx-runtime/index.mjs",
      "require": "./jsx-runtime/index.js"
    },
    "./jsx-dev-runtime": {
      "types": "./jsx-runtime/index.d.ts",
      "import": "./jsx-runtime/index.mjs",
      "require": "./jsx-runtime/index.js"
    },
    "./jsx": "./jsx.d.ts",
    "./dist/*": "./dist/*",
    "./package.json": "./package.json"
  }
}

@codecov

codecov Bot commented Jun 30, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.53%. Comparing base (afdf7cb) to head (8be67d1).
Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #183      +/-   ##
==========================================
+ Coverage   89.40%   89.53%   +0.13%     
==========================================
  Files           5        5              
  Lines         434      564     +130     
  Branches       37       38       +1     
==========================================
+ Hits          388      505     +117     
- Misses         46       59      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pi0 pi0 changed the title feat: expand the types of exports fix: expand the types of exports Jul 1, 2024
@pi0 pi0 merged commit 0f42884 into unjs:main Jul 1, 2024
@sxzz sxzz deleted the fix/exports-type branch July 1, 2024 10:08
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.

3 participants