prettymuchbryce/http-status-codes

Built types importing from codes file not in build folder

Closed this issue · 1 comments

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.

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