Skip to content

Commit

Permalink
refactor: refactor plugin help to typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
gene9831 committed Feb 25, 2025
1 parent 7812d62 commit a6fdf93
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 8 deletions.
10 changes: 9 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default defineConfigWithVueTs(
...globals.worker,
...globals.node,
...globals.jest
},
}
},
rules: {
'no-console': 'error',
Expand All @@ -57,6 +57,14 @@ export default defineConfigWithVueTs(
]
}
},
{
files: ['**/*.{ts,tsx}'],
languageOptions: {
parserOptions: {
project: './tsconfig.app.json'
}
}
},
{
files: ['scripts/**/*'],
rules: {
Expand Down
2 changes: 1 addition & 1 deletion jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@opentiny/tiny-engine-plugin-state": ["packages/plugins/state/index"],
"@opentiny/tiny-engine-plugin-script": ["packages/plugins/script/index"],
"@opentiny/tiny-engine-plugin-tree": ["packages/plugins/tree/index"],
"@opentiny/tiny-engine-plugin-help": ["packages/plugins/help/index"],
"@opentiny/tiny-engine-plugin-help": ["packages/plugins/help/index.ts"],
"@opentiny/tiny-engine-plugin-schema": ["packages/plugins/schema/index"],
"@opentiny/tiny-engine-plugin-page": ["packages/plugins/page/index"],
"@opentiny/tiny-engine-plugin-i18n": ["packages/plugins/i18n/index"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const getDevAlias = (useSourceAlias) => {
'@opentiny/tiny-engine-plugin-datasource': path.resolve(basePath, 'packages/plugins/datasource/index.js'),
'@opentiny/tiny-engine-plugin-script': path.resolve(basePath, 'packages/plugins/script/index.js'),
'@opentiny/tiny-engine-plugin-tree': path.resolve(basePath, 'packages/plugins/tree/index.js'),
'@opentiny/tiny-engine-plugin-help': path.resolve(basePath, 'packages/plugins/help/index.js'),
'@opentiny/tiny-engine-plugin-help': path.resolve(basePath, 'packages/plugins/help/index.ts'),
'@opentiny/tiny-engine-plugin-schema': path.resolve(basePath, 'packages/plugins/schema/index.js'),
'@opentiny/tiny-engine-plugin-page': path.resolve(basePath, 'packages/plugins/page/index.js'),
'@opentiny/tiny-engine-plugin-i18n': path.resolve(basePath, 'packages/plugins/i18n/index.js'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
*/

import metaData from './meta.js'
import metaData from './meta'
import { HelpService } from './src/composable'
import './src/styles/vars.less'

Expand Down
File renamed without changes.
Empty file removed packages/plugins/help/mock/test.js
Empty file.
2 changes: 1 addition & 1 deletion packages/plugins/help/src/HelpIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</div>
</template>

<script>
<script lang="ts">
import { reactive, onMounted, ref } from 'vue'
import { Guide, Popover } from '@opentiny/vue'
import { IconFilletExternalLink } from '@opentiny/vue-icon'
Expand Down
Empty file removed packages/plugins/help/test/test.js
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export default defineConfig({
resolve: {},
build: {
lib: {
entry: path.resolve(__dirname, './index.js'),
entry: path.resolve(__dirname, './index.ts'),
name: 'plugin-help',
fileName: () => 'index.js',
fileName: (_format, entryName) => `${entryName}.js`,
formats: ['es']
},
rollupOptions: {
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,

"allowJs": true,
"baseUrl": "./",
"jsx": "react-jsx",
"paths": {
Expand All @@ -20,7 +21,7 @@
"@opentiny/tiny-engine-plugin-state": ["packages/plugins/state/index"],
"@opentiny/tiny-engine-plugin-script": ["packages/plugins/script/index"],
"@opentiny/tiny-engine-plugin-tree": ["packages/plugins/tree/index"],
"@opentiny/tiny-engine-plugin-help": ["packages/plugins/help/index"],
"@opentiny/tiny-engine-plugin-help": ["packages/plugins/help/index.ts"],
"@opentiny/tiny-engine-plugin-schema": ["packages/plugins/schema/index"],
"@opentiny/tiny-engine-plugin-page": ["packages/plugins/page/index"],
"@opentiny/tiny-engine-plugin-i18n": ["packages/plugins/i18n/index"],
Expand Down

0 comments on commit a6fdf93

Please sign in to comment.