question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing typescript types in scoped packages

See original GitHub issue

Describe the bug @theme-ui/* packages have missing typescript types.

To Reproduce

Inspect the latest version of @theme-ui/color@0.3.1:

$ npm view @theme-ui/color                       

@theme-ui/color@0.3.1 | MIT | deps: 2 | versions: 14
Color manipulation utilities for Theme UI

dist
.tarball: https://registry.npmjs.org/@theme-ui/color/-/color-0.3.1.tgz
.shasum: fceffc0be305ad6ca6be9755ac9cafc955b1e6f5
.integrity: sha512-Bgew6etspp087AdrKuMpcWjIQDQ8UTp28wtHCXgi1Ip5ClFn9i91DvaKgqXk9UwQJFL/IwydX8Bks/+u9tf0WA==
.unpackedSize: 26.9 kB

dependencies:
@theme-ui/css: ^0.3.1 polished: ^3.4.1      

maintainers:
- johno <johnotander@gmail.com>
- jxnblk <jxnblk@gmail.com>

dist-tags:
latest: 0.3.1        next: 0.3.0-alpha.6  

published a month ago by jxnblk <jxnblk@gmail.com>

If we download the package: https://registry.npmjs.org/@theme-ui/color/-/color-0.3.1.tgz

We found out that types are missing:

{
  "name": "@theme-ui/color",
  "version": "0.3.1",
  "main": "dist/index.js",
  "module": "dist/index.esm.js",
  "scripts": {
    "prepare": "microbundle --no-compress",
    "watch": "microbundle watch --no-compress"
  },
  "dependencies": {
    "@theme-ui/css": "^0.3.1",
    "polished": "^3.4.1"
  },
  "publishConfig": {
    "access": "public"
  },
  "license": "MIT",
  "gitHead": "f6380fc356ce97e64bf50ba60e0bc6f38a25dabe"
}

This is quite weird since I’m able to build the project locally and I can confirm that types are being outputted to /dist and the relevant entry shows up in the package.json file.

I can’t see the build process (ci) but I’m guessing there’s something happening during ci/build that is dropping or not considering typescript types, maybe something to do with missing .npmignore file or a missing files entry in package.json

Expected behavior Output packages should have typescript type definitions

Screenshots

Additional context I can confirm this is also happening with other packages like @theme-ui/core

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
hasparuscommented, Mar 17, 2020
1reaction
jxnblkcommented, Mar 20, 2020

Going to close this issue in favor of tracking in #668

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rules for scoped packages with local definitions differs from ...
Actual behavior: When the module is in node_modules/@types it can be resolved via the magic rename of scope__scoped to @scope/ ...
Read more >
add typings for missing method (from a npm package)
P.S. I already opened an issue with the updated definitions on github (no pull request, because at the time had almost no knowledge...
Read more >
Typescript Typings: The Complete Guide: @types Compiler ...
The @types scope package contains type definitions for a lot of libraries, like Express, Sequelize, JQuery, and many others. So definitively ...
Read more >
Documentation - TypeScript 4.5
When deciding which lib files TypeScript should include, it will first look for a scoped @typescript/lib-* package in node_modules . For example, when...
Read more >
type-fest - npm
GlobalThis - Declare locally scoped properties on globalThis . · PackageJson - Type for npm's package.json file. It also includes support for TypeScript...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found