Skip to content

Commit 086aa8c

Browse files
author
Weffe
committed
feat(types): expose custom axios types and bundle in a "types" folder
Bundle in a types folder for easier consumption for TypeScript users. This exposes all the types this project uses but as long as you import the right thing then you should be fine.
1 parent bfe5606 commit 086aa8c

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
"scripts": {
1212
"prestart": "run-s clean",
1313
"start": "tsc --watch",
14-
"build": "run-s clean build:cjs build:esm",
14+
"build": "run-s clean build:cjs build:esm build:types",
1515
"build:cjs": "tsc",
1616
"build:esm": "tsc -p tsconfig.esm.json",
17+
"build:types": "tsc -p tsconfig.types.json",
1718
"sandbox": "tsc -p sandbox/tsconfig.sandbox.json",
1819
"clean": "rimraf dist/",
1920
"release": "standard-version",
@@ -73,4 +74,4 @@
7374
},
7475
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.ts$"
7576
}
76-
}
77+
}

tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
66
"lib": [
77
"es2015",
8-
"dom"
98
], /* Specify library files to be included in the compilation. */
109
// "allowJs": true, /* Allow javascript files to be compiled. */
1110
// "checkJs": true, /* Report errors in .js files. */

tsconfig.types.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"compilerOptions": {
3+
/* Basic Options */
4+
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
5+
"module": "es2015", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
6+
"lib": [
7+
"es2015",
8+
], /* Specify library files to be included in the compilation. */
9+
"declaration": true, /* Generates corresponding '.d.ts' file. */
10+
"declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
11+
"sourceMap": true, /* Generates corresponding '.map' file. */
12+
"outDir": "./dist/types", /* Redirect output structure to the directory. */
13+
"rootDir": "./src/types", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
14+
// "noEmit": true,
15+
"moduleResolution": "node",
16+
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
17+
},
18+
"include": [
19+
"src/types/**/*"
20+
],
21+
"exclude": [
22+
"src/__tests__"
23+
]
24+
}

0 commit comments

Comments
 (0)