Skip to content

Commit

Permalink
feat(allow-scripts): generate & ship typescript declarations (#675)
Browse files Browse the repository at this point in the history
* feat(allow-scripts): generate & ship typescript declarations

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.

* chore(deps): upgrade base tsconfig for node 16
  • Loading branch information
boneskull committed Oct 5, 2023
1 parent b026356 commit 3f7c381
Show file tree
Hide file tree
Showing 19 changed files with 583 additions and 453 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/node16/tsconfig.json"
}

0 comments on commit 3f7c381

Please sign in to comment.