Skip to content

Commit

Permalink
feat: support TypeScript #121
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffrich authored and blackfalcon committed Apr 29, 2022
1 parent 00fd0ca commit 6016704
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
11 changes: 9 additions & 2 deletions package-lock.json

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

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"nodemon": "^2.0.15",
"npm-run-all": "^4.1.5",
"semantic-release": "^17.4.7",
"svglint": "^2.1.0"
"svglint": "^2.1.0",
"typescript": "^4.6.3"
},
"scripts": {
"postinstall": "node packageScripts/postinstall.js",
Expand All @@ -39,15 +40,16 @@
"copy:cssJs": "copyfiles -f ./src/tokens/*.js ./dist/tokens",
"svglint": "svglint dist/icons/*.svg dist/icons/alert/*.svg dist/icons/in-flight/*.svg dist/icons/interface/*.svg dist/icons/shop/*.svg dist/icons/social/*.svg dist/icons/terminal/*.svg --ci",
"generator": "node scripts/generate.js",
"generate": "npm-run-all sweep generator build:demo copy:dist",
"generate": "npm-run-all sweep generator build:demo copy:dist types",
"test": "npm-run-all svgjest jsonlint svglint",
"svgjest": "jest",
"sweep": "rm -rf ./dist",
"build:demo": "node scripts/buildDemo.js ",
"build": "npm-run-all sweep generate test copy:styles svgjest build:demo",
"build:dev": "npm-run-all sweep generate build:demo test",
"watch": "nodemon -e svg,js --watch src --exec npm-run-all generate test",
"serve": "web-dev-server --open demo/ --node-resolve --watch"
"serve": "web-dev-server --open demo/ --node-resolve --watch",
"types": "tsc"
},
"husky": {
"hooks": {
Expand Down
18 changes: 18 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"include": ["dist/**/*.js"], // process the generated JS files from the SVGs
"exclude": [],
"compilerOptions": {
// Tells TypeScript to read JS files, as
// normally they are ignored as source files
"allowJs": true,
// Generate d.ts files
"declaration": true,
// This compiler run should
// only output d.ts files
"emitDeclarationOnly": true,
"outDir": "dist",
// go to js file when using IDE functions like
// "Go to Definition" in VSCode
"declarationMap": true
}
}

0 comments on commit 6016704

Please sign in to comment.