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

"typings" field in package.json is broken #273

Closed
alexeagle opened this issue Sep 6, 2017 · 6 comments
Closed

"typings" field in package.json is broken #273

alexeagle opened this issue Sep 6, 2017 · 6 comments

Comments

@alexeagle
Copy link

the typings field was added by
6f5d594
which also added source-map.d.ts, however that file wasn't included in the published package:
https://unpkg.com/source-map@0.5.7/

foo.ts(1,21): error TS7016: Could not find a declaration file for module 'source-map'. '/usr/local/google/home/alexeagle/Projects/repro_source-map/node_modules/source-map/source-map.js' implicitly has an 'any' type.
  Try `npm install @types/source-map` if it exists or add a new declaration (.d.ts) file containing `declare module 'source-map';`

/cc @tbosch

@tromey
Copy link
Contributor

tromey commented Sep 22, 2017

Is it sufficient to add source-map.d.ts to the files array in package.json?

@tromey
Copy link
Contributor

tromey commented Sep 22, 2017

If I npm install source-map, what's installed includes everything from files, so I think it's fine to just list it.

tromey added a commit to tromey/source-map that referenced this issue Sep 22, 2017
Add source-map.d.ts to files in package.json, to ensure it ends up in
the published package.
Fixes mozilla#273
@alexeagle
Copy link
Author

It doesn't matter what npm install does if the file isn't published to NPM

@tromey
Copy link
Contributor

tromey commented Sep 22, 2017

I don't understand. The idea of the patch is that the things in files are published, so (1) fix up the file list, and then (2) publish to npm. https://docs.npmjs.com/files/package.json claims that this should be sufficient. Or is there some other scenario that's important that I don't know of?

@alexeagle
Copy link
Author

Yes, that sounds right. I'm not familiar with the publishing steps here - in some of our repos we run npm publish from the dist folder so that would be broken. Also there could be .npmignore to control what is published, but don't have one here. The real test is to run npm publish in dry-run mode, which seems to be npm pack

@tromey
Copy link
Contributor

tromey commented Sep 22, 2017

Thanks for mentioning npm pack. I confirmed that this works.

alexeagle added a commit to alexeagle/platform that referenced this issue Feb 18, 2018
This should build the npm distribution for @ngrx/store.

Requires a bunch of fixes:
- angular/compiler-cli later than 6.0.0-beta.4 - it's unreleased, plus there's a problem with the snapshot published (missing stuff) so this points to my fork
  alexeagle/compiler-cli-builds
- angular/bazel-builds doesn't have ng_package yet because it hasn't landed. I crafted a distributable version on
  alexeagle/bazel-builds
  but this includes some fixes that need to be upstreamed
- rules_typescript needs minor fixes to pick up fix for mozilla/source-map#273
alexeagle added a commit to alexeagle/platform that referenced this issue Feb 18, 2018
This should build the npm distribution for @ngrx/store.

Requires a bunch of fixes:
- angular/compiler-cli later than 6.0.0-beta.4 - it's unreleased, plus there's a problem with the snapshot published (missing stuff) so this points to my fork
  alexeagle/compiler-cli-builds
- angular/bazel-builds doesn't have ng_package yet because it hasn't landed. I crafted a distributable version on
  alexeagle/bazel-builds
  but this includes some fixes that need to be upstreamed
- rules_typescript needs minor fixes to pick up fix for mozilla/source-map#273
alexeagle added a commit to alexeagle/tsickle that referenced this issue Feb 19, 2018
This is needed to pick up the fix for mozilla/source-map#273

Closes angular#750
alexeagle added a commit to alexeagle/tsickle that referenced this issue Feb 19, 2018
This is needed to pick up the fix for mozilla/source-map#273

Closes angular#750
alexeagle added a commit to alexeagle/tsickle that referenced this issue Feb 19, 2018
This is needed to pick up the fix for mozilla/source-map#273

Closes angular#750
alexeagle added a commit to alexeagle/tsickle that referenced this issue Feb 19, 2018
This is needed to pick up the fix for mozilla/source-map#273

Closes angular#750
alexeagle added a commit to angular/tsickle that referenced this issue Feb 19, 2018
* Update source-map dependency.

This is needed to pick up the fix for mozilla/source-map#273

Closes #750
alexeagle added a commit to alexeagle/rules_typescript that referenced this issue Feb 19, 2018
Also update tsickle to latest
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

No branches or pull requests

2 participants