Skip to content

Commit

Permalink
replace typescript with @rollup/plugin-typescript, integrate into bui…
Browse files Browse the repository at this point in the history
…ld and add types to package.json
  • Loading branch information
jannikac committed Apr 12, 2024
1 parent 822b5c0 commit 8307e14
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 5 deletions.
29 changes: 28 additions & 1 deletion package-lock.json

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

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
],
"description": "Javascript parser for ics (rfc5545) and vcard (rfc6350) data",
"main": "dist/ical.js",
"types": "dist/types/module.d.ts",
"type": "module",
"repository": {
"type": "git",
Expand All @@ -25,6 +26,7 @@
"@eslint/js": "^9.0.0",
"@octokit/core": "^6.0.1",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-typescript": "^11.1.6",
"@stylistic/eslint-plugin": "^1.7.0",
"benchmark": "^2.1.4",
"c8": "^9.1.0",
Expand All @@ -41,7 +43,6 @@
"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",
Expand Down Expand Up @@ -70,6 +71,7 @@
"dist/ical.min.js",
"dist/ical.es5.cjs",
"dist/ical.es5.min.cjs",
"dist/types/*.d.ts",
"lib/ical/*.js"
],
"mocha": {
Expand Down
4 changes: 3 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { babel } from '@rollup/plugin-babel';
import typescript from '@rollup/plugin-typescript';
import { terser } from 'rollup-plugin-terser';

const LICENSE =
Expand Down Expand Up @@ -50,6 +51,7 @@ export default [{
}
],
plugins: [
babel({ babelHelpers: 'bundled', presets: ['@babel/preset-env'] })
babel({ babelHelpers: 'bundled', presets: ['@babel/preset-env'] }),
typescript({ include: ["lib/ical/*.js"], noForceEmit: true })
]
}];
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"include": ["dist/ical.js"],
"compilerOptions": {
// Tells TypeScript to read JS files, as
// normally they are ignored as source files
Expand All @@ -10,6 +9,7 @@
"emitDeclarationOnly": true,
// go to js file when using IDE functions like
// "Go to Definition" in VSCode
"declarationMap": true
"declarationMap": true,
"declarationDir": "dist/types"
}
}

0 comments on commit 8307e14

Please sign in to comment.