From 4f7cb1a4ada04cb0c1424b1280d6529a34c48a4f Mon Sep 17 00:00:00 2001 From: jannikac Date: Fri, 12 Apr 2024 12:52:31 +0200 Subject: [PATCH] add barebones typescript config --- package-lock.json | 10 +++++----- package.json | 1 + tsconfig.json | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 tsconfig.json diff --git a/package-lock.json b/package-lock.json index 48bf106b..22908ad1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "ical.js", - "version": "2.0.0", + "version": "2.0.1", "license": "MPL-2.0", "devDependencies": { "@babel/preset-env": "^7.24.3", @@ -29,6 +29,7 @@ "mocha": "^10.3.0", "node-fetch": "^3.3.2", "rollup-plugin-terser": "^7.0.2", + "typescript": "^5.4.5", "yauzl-promise": "^4.0.0" } }, @@ -10489,11 +10490,10 @@ } }, "node_modules/typescript": { - "version": "5.4.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.4.tgz", - "integrity": "sha512-dGE2Vv8cpVvw28v8HCPqyb08EzbBURxDpuhJvTrusShUfGnhHBafDsLdS1EhhxyL6BJQE+2cT3dDPAv+MQ6oLw==", + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", "dev": true, - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/package.json b/package.json index 63f46c0e..1a15c876 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "mocha": "^10.3.0", "node-fetch": "^3.3.2", "rollup-plugin-terser": "^7.0.2", + "typescript": "^5.4.5", "yauzl-promise": "^4.0.0" }, "license": "MPL-2.0", diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..265a4034 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,15 @@ +{ + "include": ["dist/ical.js"], + "compilerOptions": { + // Tells TypeScript to read JS files, as + // normally they are ignored as source files + "allowJs": true, + // Generate d.ts files + "declaration": true, + // only output d.ts files + "emitDeclarationOnly": true, + // go to js file when using IDE functions like + // "Go to Definition" in VSCode + "declarationMap": true + } +} \ No newline at end of file