From 24f48a4c80cdc0a87aa3297bf58a0d6ea7fd334b Mon Sep 17 00:00:00 2001 From: Mattias Hising Date: Fri, 8 Mar 2024 20:42:07 +0100 Subject: [PATCH] First stab at creating typescript defs --- package.json | 11 ++++++++--- tsconfig.json | 11 +++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 tsconfig.json diff --git a/package.json b/package.json index b468394..dff81bf 100644 --- a/package.json +++ b/package.json @@ -23,10 +23,11 @@ "license": "MIT", "scripts": { "start": "react-scripts start", - "build": "rollup -c -o build/react-easy-edit.min.js", + "build": "yarn run tsc && rollup -c -o build/react-easy-edit.min.js", "test": "react-scripts test", "coverage": "react-scripts test --coverage --watchAll=false", - "prepublish": "yarn build" + "prepublish": "yarn build", + "tsc": "tsc" }, "main": "build/react-easy-edit.min.js", "repository": { @@ -68,6 +69,10 @@ "react-scripts": "^5.0.1", "rollup": "2.53.3", "rollup-plugin-postcss": "^4.0.2", - "rollup-plugin-terser": "^7.0.2" + "rollup-plugin-terser": "^7.0.2", + "typescript": "^4.9.5" + }, + "dependencies": { + "@types/estree": "^1.0.5" } } diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..fcde4ef --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,11 @@ +{ + // Change this to match your project + "include": ["src/lib/*"], + "compilerOptions": { + "allowJs": true, + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "build/types", + "declarationMap": true + } +} \ No newline at end of file