arethetypeswrong / arethetypeswrong.github.io

Tool for analyzing TypeScript types of npm packages
https://arethetypeswrong.github.io
MIT License
1.12k stars 38 forks source link

v16 fails when packing a directory #179

Closed jamesgpearce closed 2 months ago

jamesgpearce commented 2 months ago

(using NPM)

v0.15.3:

% npx attw --pack dist
No problems found 🌟

0.16.0:

% npx attw --pack dist
error while checking file:
Command failed: npm pack dist/tinybase-5.0.0-beta.27.tgz
srenatus commented 2 months ago

Same here, without an explicit directory arg:


Run npx -w packages/opa-react attw --pack
  npx -w packages/opa-react attw --pack
  shell: /usr/bin/bash -e {0}
error while checking file:
Command failed: npm pack styra-opa-react-0.2.1.tgz
ericcornelissen commented 2 months ago

The problem seems to stem from this change, where ${filename} causes the error. Omitting it makes the error go away, restoring the previous behavior. From the npm-pack docs it seems that the named argument should be the name of a package rather than a filename, but in either case I don't think this is needed at all for npm.

RobinTail commented 2 months ago

@andrewbranch , the letter v is missing in the filename being looked up

$ attw --pack
...
ENOENT: no such file or directory, open 'express-zod-api-20.1.0.tgz'

$ ls
express-zod-api-v20.1.0.tgz

I'm using yarn v1.22.22

RobinTail commented 2 months ago

Workaround for yarn attw --pack:

yarn pack # or npm pack
yarn attw *.tgz
rm *.tgz
andrewbranch commented 2 months ago

Thanks all. I’ve deprecated v0.16.0 and pointed latest back to v0.15.3.