fix(core): use regexp to fetch imports in slots patch
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -25,7 +25,7 @@
|
|||||||
"prepare": "ts-patch install -s",
|
"prepare": "ts-patch install -s",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"types": "pnpm prepare && vue-tsc --declaration --emitDeclarationOnly && tsc -p tsconfig.build.json && shx rm -rf tmp && pnpm lint:dist && pnpm run patch",
|
"types": "pnpm prepare && vue-tsc --declaration --emitDeclarationOnly && tsc -p tsconfig.build.json && shx rm -rf tmp && pnpm lint:dist && pnpm run patch",
|
||||||
"patch": "node patch/slots.js && pnpm lint:dist",
|
"patch": "node patch/slots.js",
|
||||||
"theme": "postcss src/style.css -o dist/style.css && postcss src/theme-default.css -o dist/theme-default.css",
|
"theme": "postcss src/style.css -o dist/style.css && postcss src/theme-default.css -o dist/theme-default.css",
|
||||||
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix --ignore-path ../../.gitignore .",
|
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix --ignore-path ../../.gitignore .",
|
||||||
"lint:dist": "eslint --ext \".ts,.tsx\" -c .eslintrc.js --fix ./dist",
|
"lint:dist": "eslint --ext \".ts,.tsx\" -c .eslintrc.js --fix ./dist",
|
||||||
|
|||||||
@@ -12,20 +12,7 @@ async function content(path) {
|
|||||||
|
|
||||||
const filePath = resolve(__dirname, '../dist/container/VueFlow/VueFlow.vue.d.ts')
|
const filePath = resolve(__dirname, '../dist/container/VueFlow/VueFlow.vue.d.ts')
|
||||||
|
|
||||||
const typeImportsString = `import type {
|
const typeImportsString = /import type {\n(.*\n)+} from '\.\.\/\.\.\/types'/
|
||||||
Connection,
|
|
||||||
EdgeChange,
|
|
||||||
EdgeMouseEvent,
|
|
||||||
EdgeUpdateEvent,
|
|
||||||
GraphEdge,
|
|
||||||
GraphNode,
|
|
||||||
NodeChange,
|
|
||||||
NodeDragEvent,
|
|
||||||
NodeMouseEvent,
|
|
||||||
OnConnectStartParams,
|
|
||||||
ViewpaneTransform,
|
|
||||||
VueFlowStore,
|
|
||||||
} from '../../types'`
|
|
||||||
|
|
||||||
const patchedTypeImports = `import type {
|
const patchedTypeImports = `import type {
|
||||||
Connection,
|
Connection,
|
||||||
@@ -41,7 +28,7 @@ const patchedTypeImports = `import type {
|
|||||||
NodeMouseEvent,
|
NodeMouseEvent,
|
||||||
NodeProps,
|
NodeProps,
|
||||||
OnConnectStartParams,
|
OnConnectStartParams,
|
||||||
ViewpaneTransform,
|
ViewportTransform,
|
||||||
VueFlowStore,
|
VueFlowStore,
|
||||||
} from '../../types'`
|
} from '../../types'`
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user