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

Built types importing from codes file not in build folder #52

Closed
Benno007 opened this issue Aug 23, 2020 · 1 comment · Fixed by #53
Closed

Built types importing from codes file not in build folder #52

Benno007 opened this issue Aug 23, 2020 · 1 comment · Fixed by #53

Comments

@Benno007
Copy link

Benno007 commented Aug 23, 2020

Version 2.1.0:

The build output of this package contains import { StatusCodes, ReasonPhrases } from './codes'; in index.d.ts but the build.sh moves the content of codes.d.ts into index.d.ts, so there's no codes.ts/codes.d.ts in the build folder to import from, and for some reason that import isn't removed (unlike the const exports)

This breaks our typescript build. Would it break anything else if you just moved the codes.d.ts file into the build directory as well as the index.d.ts and didn't concatenate them?

$ tsc --project tsconfig.json --declaration --outDir ./dist
node_modules/http-status-codes/build/index.d.ts:1:44 - error TS2307: Cannot find module './codes' or its corresponding type declarations.

1 import { StatusCodes, ReasonPhrases } from './codes';
                                             ~~~~~~~~~


Found 1 error.
@prettymuchbryce
Copy link
Owner

Thank you for reporting this @Benno007. I'll merge a fix and publish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants