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

No types field in package.json exports entries #983

Closed
2 tasks done
xnuk opened this issue Feb 1, 2023 · 0 comments · Fixed by #1335
Closed
2 tasks done

No types field in package.json exports entries #983

xnuk opened this issue Feb 1, 2023 · 0 comments · Fixed by #1335
Labels
type issue Issue related to a type

Comments

@xnuk
Copy link
Contributor

xnuk commented Feb 1, 2023

Describe the bug

In @vanilla-extract/css@1.9.3 package.json file uploaded in npm, there's only top-level types field, not in exports fields:

{
  "name": "@vanilla-extract/css",
  "version": "1.9.3",
  "exports": {
    "./package.json": "./package.json",
    ".": {
      "browser": {
        "module": "./dist/vanilla-extract-css.browser.esm.js",
        "default": "./dist/vanilla-extract-css.browser.cjs.js"
      },
      "module": "./dist/vanilla-extract-css.esm.js",
      "default": "./dist/vanilla-extract-css.cjs.js"
    },
    "./recipe": {
      "browser": {
        "module": "./recipe/dist/vanilla-extract-css-recipe.browser.esm.js",
        "default": "./recipe/dist/vanilla-extract-css-recipe.browser.cjs.js"
      },
      "module": "./recipe/dist/vanilla-extract-css-recipe.esm.js",
      "default": "./recipe/dist/vanilla-extract-css-recipe.cjs.js"
    },
    ...
  },
  "types": "./dist/vanilla-extract-css.cjs.d.ts",
  ...
}

That should look like this:

 {
   "name": "@vanilla-extract/css",
   "version": "1.9.3",
   "exports": {
     "./package.json": "./package.json",
     ".": {
       "browser": {
         "module": "./dist/vanilla-extract-css.browser.esm.js",
         "default": "./dist/vanilla-extract-css.browser.cjs.js"
       },
       "module": "./dist/vanilla-extract-css.esm.js",
       "default": "./dist/vanilla-extract-css.cjs.js",
+      "types": "./dist/vanilla-extract-css.cjs.d.ts"
     },
     "./recipe": {
       "browser": {
         "module": "./recipe/dist/vanilla-extract-css-recipe.browser.esm.js",
         "default": "./recipe/dist/vanilla-extract-css-recipe.browser.cjs.js"
       },
       "module": "./recipe/dist/vanilla-extract-css-recipe.esm.js",
       "default": "./recipe/dist/vanilla-extract-css-recipe.cjs.js",
+      "types": "./recipe/dist/vanilla-extract-css-recipe.cjs.d.ts"
     },
     ...
   },
   "types": "./dist/vanilla-extract-css.cjs.d.ts",
   ...
 }

For specific use case: I'm about to use this library in Deno, with https://esm.sh, but https://esm.sh/@vanilla-extract/css@1.9.3/transformCss does not exposes x-typescript-types, because of this issue.

Reproduction

See https://registry.npmjs.org/@vanilla-extract/css/1.9.3

System Info

N/A. Firefox 110?

Used Package Manager

npm

Logs

No response

Validations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type issue Issue related to a type
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants