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.

Evaluate popular packages that have `exports` fields set but may not be Node ESM-ready for TypeScript

See original GitHub issue

The exports field in package.json - nobody knows how to configure it, which probably means that a negative number of people know how to configure it for TypeScript.

Anyway, a very good way to ensure that 99% of users have no issues with consuming a Node ESM package is to do a sweep of the npm registry to find the most popular packages that have an exports field and a types field set and validate that they have correctly configured their types.

The steps include

  • Generating the list of 150 of the top-depended-on packages that have an rts field and have either a types field set or have a corresponding @types package.
  • Distributing out the list to the team.
  • Having the team manually validate that the packages (or their @types package) are configured correctly.

Last time I tried to do this with all-the-package-names, people told me the list might be too outdated, but the list might serve as a decent guide anyway:

Click here to see the list.

Self-Typed: 18

Package Name Exports Value Assesment
postcss Object ?
babel-jest Object ?
rxjs Object ?
typedoc String ?
ts-node Object ?
projectz Object ?
postcss-custom-properties Object ?
postcss-scss Object ?
uid Object ?
emailjs Object ?
ngrok Object ?
pob-babel Object ?
preact Object ?
assert-helpers Object ?
getmac Object ?
simple-statistics Object ?
discord.js Object ?
editions Object ?

Packages with @types

At-Typed: 121

Package Name Exports Value Assesment
chai Object ?
eslint Object ?
tape Object ?
underscore Object ?
yargs Object ?
socket.io Object ?
js-yaml Object ?
expect Object ?
uuid Object ?
ws Object ?
rollup Object ?
koa Object ?
socket.io-client Object ?
meow String ?
npm Object ?
jest-cli Object ?
highlight.js Object ?
mustache Object ?
dotenv Object ?
d3 Object ?
deep-equal Object ?
jest Object ?
gulp-imagemin String ?
diff Object ?
unique-random-array String ?
globby String ?
ora String ?
acorn Object ?
path-exists String ?
firebase Object ?
vinyl-paths String ?
strip-ansi String ?
strip-json-comments String ?
systemjs Object ?
log-symbols Object ?
escape-string-regexp String ?
get-stdin String ?
stack-trace Object ?
is-promise Object ?
slash String ?
es6-promisify Object ?
imagemin String ?
configstore String ?
figures String ?
strip-bom String ?
mathjs Object ?
baconjs Object ?
engine.io Object ?
is-plain-object Object ?
tempfile String ?
arrify String ?
supports-color Object ?
tildify String ?
is-stream String ?
normalize-url String ?
d3-scale Object ?
temp-write String ?
indent-string String ?
d3-selection Object ?
d3-array Object ?
read-chunk String ?
is-plain-obj String ?
yaml Object ?
engine.io-client Object ?
js-cookie Object ?
ansi-styles String ?
npm-name String ?
pako Object ?
detect-indent String ?
decamelize String ?
stringify-object String ?
ansi-regex String ?
sass Object ?
string-length String ?
get-port String ?
lowdb String ?
js-base64 Object ?
find-up String ?
dargs String ?
array-uniq String ?
humanize-url String ?
repeating String ?
d3-shape Object ?
read-pkg-up String ?
strip-indent String ?
hashids Object ?
junk String ?
istextorbinary Object ?
ansi-escapes String ?
geolib Object ?
yargs-parser Object ?
commonmark Object ?
username String ?
jssha Object ?
latest-version String ?
github-username String ?
string-width String ?
is-root String ?
d3-transition Object ?
trash String ?
js-combinatorics Object ?
socket.io-parser Object ?
d3-dsv Object ?
form-urlencoded Object ?
semver-regex String ?
cli-cursor String ?
internal-ip Object ?
linq String ?
d3-color Object ?
node-hue-api Object ?
d3-interpolate Object ?
elegant-spinner String ?
read-pkg String ?
has-ansi String ?
node-ipc Object ?
leven String ?
d3-axis Object ?
d3-format Object ?
is-obj String ?
boxen String ?
d3-dispatch Object ?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
DanielRosenwassercommented, May 3, 2022

Thank you for sending those PRs!

2reactions
sandersncommented, May 4, 2022

all-the-package-names seems to be updated daily. Not sure why we thought the list was outdated before?

It wasn’t published for two years, then the first publish was 10 hours before your comment. Coincidence?

…Probably.

Edit: looking at https://github.com/nice-registry/all-the-package-names/pull/26, I see that it now depends on all-the-package-repos, which now, surprisingly, includes all packages, even ones without repos. But it’s not sorted by dependent count anymore.

Edit 2 (from May): all-the-package-names stopped updating from mid-March to May. Check to see if it’s current before using it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - ECMAScript Modules in Node.js - TypeScript
This setting controls whether .js files are interpreted as ES modules or CommonJS modules, ... import / export statements and top-level await can...
Read more >
Why doesn't the exports field of npm work in typescript?
Ensure moduleResolution in the consuming library is set to either Node16 or NodeNext in your tsconfig.json file.
Read more >
export - JavaScript - MDN Web Docs
The export declaration is used to export values from a JavaScript module. Exported values can then be imported into other programs with the ......
Read more >
Tree Shaking - webpack
The name and concept have been popularized by the ES2015 module bundler rollup ... noted above does not contain side effects, so we...
Read more >
rollup.js
To make sure your ES modules are immediately usable by tools that work with CommonJS such as Node.js and webpack, you can use...
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