Skip to content

Commit

Permalink
build: generate declaration files via tsc (#58)
Browse files Browse the repository at this point in the history
* build: generate declaration files via tsc

* fix: remove unnecessary browser-side code

* chore: change output dir for dts files

* refactor: remove not relevant entries from gitignore

* refactor: remove unnessary config attribute
  • Loading branch information
nugaon committed Dec 29, 2020
1 parent c162097 commit 5930948
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
lib

# Logs
logs
*.log
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
"browser": {
"stream": "readable-stream"
},
"types": "dist/index.d.ts",
"scripts": {
"postinstall": "patch-package",
"compile:node": "webpack --progress --mode development --env target=node",
"compile:types": "tsc --project tsconfig.d.json",
"compile:browser": "webpack --progress --mode development --env target=web",
"compile:window": "webpack --progress --mode development --env target=web --env globalWindow=true",
"docs": "typedoc --mode modules --excludeNotExported --readme none --out docs src",
Expand Down Expand Up @@ -56,7 +58,6 @@
"@types/readable-stream": "^2.3.9",
"@types/tar-stream": "^2.1.0",
"@types/terser-webpack-plugin": "^5.0.2",
"@types/webpack": "^4.41.25",
"@types/webpack-bundle-analyzer": "^3.9.0",
"@types/yargs-parser": "^15.0.0",
"@typescript-eslint/eslint-plugin": "^4.8.2",
Expand All @@ -78,7 +79,7 @@
"ts-node": "^9.0.0",
"typedoc": "^0.19.2",
"typedoc-plugin-markdown": "^3.0.11",
"typescript": "^4.1.2",
"typescript": "^4.1.3",
"webpack": "^5.5.0",
"webpack-bundle-analyzer": "^4.1.0",
"webpack-cli": "^4.2.0",
Expand Down
10 changes: 0 additions & 10 deletions src/utils/data.browser.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/utils/data.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Readable } from 'stream'
import type { Readable } from 'stream'

// eslint-disable-next-line require-await
export async function prepareData(data: string | Uint8Array | Readable): Promise<Uint8Array | Readable> {
Expand Down
12 changes: 12 additions & 0 deletions tsconfig.d.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "./tsconfig",
"compilerOptions": {
"strictNullChecks": false,
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "dist",
"rootDirs": ["src"],
"skipLibCheck": true
},
"include": ["src"]
}

0 comments on commit 5930948

Please sign in to comment.