Skip to content

Commit 1226c20

Browse files
IlCallomShan0arthurschreiber
authored
feat!: publish first-party type declarations (#1490)
BREAKING CHANGE: `tedious` now includes TypeScript definition files. These definitions might differ in various areas from the definitions published in the `@types/tedious` package. If you notice major differences, please reach out and let us know. --------- Co-authored-by: mShan0 <[email protected]> Co-authored-by: Arthur Schreiber <[email protected]>
1 parent 4a6273c commit 1226c20

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"license": "MIT",
3030
"version": "0.0.0-dev",
3131
"main": "./lib/tedious.js",
32+
"types": "./lib/tedious.d.ts",
3233
"repository": {
3334
"type": "git",
3435
"url": "https://github.com/tediousjs/tedious.git"
@@ -43,6 +44,7 @@
4344
"@azure/identity": "^3.4.1",
4445
"@azure/keyvault-keys": "^4.4.0",
4546
"@js-joda/core": "^5.6.1",
47+
"@types/node": ">=18",
4648
"bl": "^6.0.11",
4749
"iconv-lite": "^0.6.3",
4850
"js-md4": "^0.3.2",
@@ -62,7 +64,6 @@
6264
"@types/depd": "^1.1.36",
6365
"@types/lru-cache": "^5.1.1",
6466
"@types/mocha": "^10.0.6",
65-
"@types/node": ">=18",
6667
"@types/sprintf-js": "^1.1.4",
6768
"@typescript-eslint/eslint-plugin": "^7.0.2",
6869
"@typescript-eslint/parser": "^7.0.2",
@@ -86,7 +87,8 @@
8687
"test": "mocha --forbid-only test/unit test/unit/token test/unit/tracking-buffer",
8788
"test-integration": "mocha --forbid-only test/integration/",
8889
"test-all": "mocha --forbid-only test/unit/ test/unit/token/ test/unit/tracking-buffer test/integration/",
89-
"build": "rimraf lib && babel src --out-dir lib --extensions .js,.ts",
90+
"build:types": "tsc --project tsconfig.build-types.json",
91+
"build": "rimraf lib && babel src --out-dir lib --extensions .js,.ts && npm run build:types",
9092
"prepublish": "npm run build",
9193
"semantic-release": "semantic-release"
9294
},

tsconfig.build-types.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
// Disable features needed by the IDE which harm type declaration generation
5+
"isolatedModules": false,
6+
"noEmit": false,
7+
8+
// Enable features needed for type declaration generation
9+
"declaration": true,
10+
"emitDeclarationOnly": true,
11+
"declarationDir": "lib"
12+
},
13+
14+
"include": ["types/*.d.ts", "src/tedious.ts"]
15+
}

0 commit comments

Comments
 (0)