From a83d7105c559c1965e0878be503da8c0825363ba Mon Sep 17 00:00:00 2001 From: Pierre-Etienne Poirot Date: Fri, 13 Oct 2023 10:30:56 +0200 Subject: [PATCH] Generate type declarations This lets the Typescript compiler also generates the types' declarations. --- .gitignore | 1 + .npmignore | 9 +++++++++ package.json | 3 ++- tsconfig.json | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d59973c..1f479a8 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ build/Release # Typescript intermediate files tsconfig.tsbuildinfo +*.d.ts *.js !test/**/*.js diff --git a/.npmignore b/.npmignore index eed324a..5ef5799 100644 --- a/.npmignore +++ b/.npmignore @@ -30,6 +30,10 @@ build/Release node_modules jspm_packages +# Editors +.idea/ +.vscode/ + # Optional npm cache directory .npm @@ -37,8 +41,13 @@ jspm_packages .node_repl_history test +.github/ .node-version .travis.yml .npmignore +data-structure.png +tsconfig.tsbuildinfo webpack.config.js LICENSE +*.ts +!*.d.ts diff --git a/package.json b/package.json index 4ed3f10..7256e3d 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,13 @@ "version": "0.10.8", "description": "A simple library to read/write HLS playlists", "main": "index.js", + "types": "index.d.ts", "browser": "dist/hls-parser.min.js", "scripts": { "lint": "xo", "type-check": "tsc --noEmit", "audit": "npm audit --audit-level high", - "build": "rm -fR ./dist; webpack --mode development ; webpack --mode production", + "build": "rm -fR ./dist; tsc ; webpack --mode development ; webpack --mode production", "test": "npm run lint && npm run build && npm run audit && ava --verbose" }, "repository": { diff --git a/tsconfig.json b/tsconfig.json index 30a7b40..0499b73 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,6 +4,7 @@ "compilerOptions": { "allowJs": true, "checkJs": true, + "declaration": true, "noImplicitAny": false }, "exclude": [