Skip to content

Commit

Permalink
Export type declarations to support use as library (#1081)
Browse files Browse the repository at this point in the history
I'm working on updates to deluan/contentful-migrate right now, and am
finding that I need to recreate a lot of type information that already
exists in this library. In addition to being a lot of work, duplicating
that information makes my work fragile. It can easily become out of sync
when the types inside contentful-migration change.

If you add this flag, the type declarations (.d.ts files) will become
part of the npm package, letting me depend on them without rewriting
them by hand.

In #213, @chrislambe comments:
> It looks like the interface we want is defined [in the source]. Any
> reason we can't just use that instead of duplicating it?

The answer to his question is that the declarations are not made
available in the npm package. This PR will fix his problem as well as
mine.
  • Loading branch information
bgschiller authored Sep 9, 2022
1 parent dc7acba commit bd7f507
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions tsconfig-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"target": "es2017",
"esModuleInterop":true,
"module": "commonjs",
"declaration": true,
"lib": [
"es2015",
"es2016",
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"target": "es2017",
"esModuleInterop":true,
"module": "commonjs",
"declaration": true,
"lib": [
"es2015",
"es2016",
Expand Down

0 comments on commit bd7f507

Please sign in to comment.