Skip to content

Commit

Permalink
feat(allow-scripts): generate & ship typescript declarations
Browse files Browse the repository at this point in the history
This adds `.d.ts` generation to `@lavamoat/allow-scripts`.

- Many type defs added to `src/types` for those modules which do not have them (nor are there any published to DefinitelyTyped).  In the future, some of these could be submitted to DefinitelyTyped, if we wish.
- Upgrade `yargs`
- Create reusable TS configuration supporting incremental builds
- Declaration files generated at build time and shipped in the `types` folder (which is now in `.gitignore`)
- Created `.depcheckrc`
- Added, updated, removed and/or fixed many docstring types

Note: the uncommon `skipLibCheck = false` setting in this module's `tsconfig.json` enables typechecking of the `.d.ts` files themselves.  These files are not compiled.
  • Loading branch information
boneskull committed Sep 25, 2023
1 parent a8d55b3 commit f9f4cd7
Show file tree
Hide file tree
Showing 19 changed files with 476 additions and 266 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,7 @@ temp/
# JetBrains
.idea

packages/allow-scripts/types

# VScode
.vscode
13 changes: 13 additions & 0 deletions config/tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"checkJs": true,
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"composite": true,
"types": ["node"]
},
"extends": "@tsconfig/node14/tsconfig.json"
}

0 comments on commit f9f4cd7

Please sign in to comment.