-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a script that moves the declaration files we have in `./types` to `./dist` relative to the files they intend to type. This is the first step, we still need to change what we declare in `package.json`, add the script to the CI pipeline if we're happy with it and figure out how to type `next-auth/jwt`.
- Loading branch information
Showing
2 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const fs = require("fs") | ||
const path = require("path") | ||
|
||
const BUILD_TARGETS = [ | ||
"index.d.ts", | ||
"client.d.ts", | ||
"adapters.d.ts", | ||
"providers.d.ts", | ||
"jwt.d.ts", | ||
"_next.d.ts", | ||
"_utils.d.ts", | ||
] | ||
|
||
BUILD_TARGETS.forEach((target) => { | ||
fs.copyFile( | ||
path.resolve("types", target), | ||
path.join(process.cwd(), target), | ||
(err) => { | ||
if (err) throw err | ||
console.log(`[build-types] copying "${target}" to root folder`) | ||
} | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters