refactor(react-router): use ts rollup plugin

This commit is contained in:
Liam DeBeasi
2023-11-01 13:20:10 -04:00
parent 9721d3d877
commit 5ac163e4bd
4 changed files with 107 additions and 6 deletions

View File

@@ -16,6 +16,7 @@
"@ionic/eslint-config": "^0.3.0",
"@ionic/prettier-config": "^2.0.0",
"@rollup/plugin-node-resolve": "^8.1.0",
"@rollup/plugin-typescript": "^11.1.5",
"@types/node": "^14.0.14",
"@types/react": "16.14.0",
"@types/react-dom": "^16.9.0",
@@ -449,6 +450,66 @@
"rollup": "^1.20.0||^2.0.0"
}
},
"node_modules/@rollup/plugin-typescript": {
"version": "11.1.5",
"resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-11.1.5.tgz",
"integrity": "sha512-rnMHrGBB0IUEv69Q8/JGRD/n4/n6b3nfpufUu26axhUcboUzv/twfZU8fIBbTOphRAe0v8EyxzeDpKXqGHfyDA==",
"dev": true,
"dependencies": {
"@rollup/pluginutils": "^5.0.1",
"resolve": "^1.22.1"
},
"engines": {
"node": ">=14.0.0"
},
"peerDependencies": {
"rollup": "^2.14.0||^3.0.0||^4.0.0",
"tslib": "*",
"typescript": ">=3.7.0"
},
"peerDependenciesMeta": {
"rollup": {
"optional": true
},
"tslib": {
"optional": true
}
}
},
"node_modules/@rollup/plugin-typescript/node_modules/@rollup/pluginutils": {
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.5.tgz",
"integrity": "sha512-6aEYR910NyP73oHiJglti74iRyOwgFU4x3meH/H8OJx6Ry0j6cOVZ5X/wTvub7G7Ao6qaHBEaNsV3GLJkSsF+Q==",
"dev": true,
"dependencies": {
"@types/estree": "^1.0.0",
"estree-walker": "^2.0.2",
"picomatch": "^2.3.1"
},
"engines": {
"node": ">=14.0.0"
},
"peerDependencies": {
"rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0"
},
"peerDependenciesMeta": {
"rollup": {
"optional": true
}
}
},
"node_modules/@rollup/plugin-typescript/node_modules/@types/estree": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.4.tgz",
"integrity": "sha512-2JwWnHK9H+wUZNorf2Zr6ves96WHoWDJIftkcxPKsS7Djta6Zu519LarhRNljPXkpsZR2ZMwNCPeW7omW07BJw==",
"dev": true
},
"node_modules/@rollup/plugin-typescript/node_modules/estree-walker": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
"dev": true
},
"node_modules/@rollup/pluginutils": {
"version": "3.1.0",
"dev": true,
@@ -3785,6 +3846,41 @@
"resolve": "^1.17.0"
}
},
"@rollup/plugin-typescript": {
"version": "11.1.5",
"resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-11.1.5.tgz",
"integrity": "sha512-rnMHrGBB0IUEv69Q8/JGRD/n4/n6b3nfpufUu26axhUcboUzv/twfZU8fIBbTOphRAe0v8EyxzeDpKXqGHfyDA==",
"dev": true,
"requires": {
"@rollup/pluginutils": "^5.0.1",
"resolve": "^1.22.1"
},
"dependencies": {
"@rollup/pluginutils": {
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.5.tgz",
"integrity": "sha512-6aEYR910NyP73oHiJglti74iRyOwgFU4x3meH/H8OJx6Ry0j6cOVZ5X/wTvub7G7Ao6qaHBEaNsV3GLJkSsF+Q==",
"dev": true,
"requires": {
"@types/estree": "^1.0.0",
"estree-walker": "^2.0.2",
"picomatch": "^2.3.1"
}
},
"@types/estree": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.4.tgz",
"integrity": "sha512-2JwWnHK9H+wUZNorf2Zr6ves96WHoWDJIftkcxPKsS7Djta6Zu519LarhRNljPXkpsZR2ZMwNCPeW7omW07BJw==",
"dev": true
},
"estree-walker": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
"dev": true
}
}
},
"@rollup/pluginutils": {
"version": "3.1.0",
"dev": true,

View File

@@ -21,14 +21,13 @@
},
"scripts": {
"build": "npm run clean && npm run compile",
"clean": "rimraf dist dist-transpiled",
"compile": "npm run tsc && rollup -c",
"clean": "rimraf dist",
"compile": "rollup -c",
"release": "np --any-branch --no-cleanup",
"eslint": "eslint src",
"prettier": "prettier \"./src/**/*.{html,ts,tsx,js,jsx}\"",
"lint": "npm run eslint && npm run prettier -- --write --cache",
"lint.fix": "npm run eslint -- --fix && npm run prettier -- --write --cache",
"tsc": "tsc -p .",
"sync": "sh ./scripts/sync.sh"
},
"main": "dist/index.js",
@@ -50,6 +49,7 @@
"@ionic/eslint-config": "^0.3.0",
"@ionic/prettier-config": "^2.0.0",
"@rollup/plugin-node-resolve": "^8.1.0",
"@rollup/plugin-typescript": "^11.1.5",
"@types/node": "^14.0.14",
"@types/react": "16.14.0",
"@types/react-dom": "^16.9.0",

View File

@@ -1,8 +1,9 @@
import sourcemaps from 'rollup-plugin-sourcemaps';
import resolve from '@rollup/plugin-node-resolve';
import typescript from '@rollup/plugin-typescript';
export default {
input: 'dist-transpiled/index.js',
input: 'src/index.ts',
output: [
{
file: 'dist/index.js',
@@ -11,5 +12,9 @@ export default {
}
],
external: (id) => !/^(\.|\/)/.test(id),
plugins: [resolve(), sourcemaps()],
plugins: [
typescript(),
resolve(),
sourcemaps()
],
};

View File

@@ -15,7 +15,7 @@
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"outDir": "dist-transpiled",
"outDir": "dist",
"declarationDir": "dist/types",
"removeComments": false,
"inlineSources": true,