From 31c896edb5c420bcf811e0da14453d17e6daee39 Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Thu, 21 Oct 2021 00:05:37 +0200 Subject: [PATCH] update: replace vue version when rolling bundle * remove vue jsx --- package.json | 3 - pnpm-lock.yaml | 197 -------------------------------------------- rollup.ts | 11 ++- src/components.d.ts | 26 ------ src/custom.d.ts | 2 +- src/store/index.ts | 2 +- vite.config.ts | 6 -- 7 files changed, 11 insertions(+), 236 deletions(-) delete mode 100644 src/components.d.ts diff --git a/package.json b/package.json index f06dfdc83..5e1e7fcad 100644 --- a/package.json +++ b/package.json @@ -52,8 +52,6 @@ "@rollup/plugin-node-resolve": "^13.0.6", "@rollup/plugin-replace": "^2.4.2", "@vitejs/plugin-vue": "^1.9.3", - "@vitejs/plugin-vue-jsx": "^1.2.0", - "@vue/babel-plugin-jsx": "^1.1.1", "autoprefixer": "^10.3.7", "esbuild-register": "^2.6.0", "eslint": "^7.32.0", @@ -73,7 +71,6 @@ "tslib": "^2.3.1", "typescript": "^4.4.4", "unplugin-auto-import": "^0.4.12", - "unplugin-vue-components": "^0.16.0", "vite": "^2.6.10", "vite-svg-loader": "^2.2.0", "vue": "^3.2.20", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 055694536..77a7180fc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,8 +10,6 @@ specifiers: '@rollup/plugin-replace': ^2.4.2 '@types/d3': ^7.1.0 '@vitejs/plugin-vue': ^1.9.3 - '@vitejs/plugin-vue-jsx': ^1.2.0 - '@vue/babel-plugin-jsx': ^1.1.1 '@vueuse/core': ^6.6.2 autoprefixer: ^10.3.7 d3: ^7.1.1 @@ -37,7 +35,6 @@ specifiers: tslib: ^2.3.1 typescript: ^4.4.4 unplugin-auto-import: ^0.4.12 - unplugin-vue-components: ^0.16.0 vite: ^2.6.10 vite-svg-loader: ^2.2.0 vue: ^3.2.20 @@ -62,8 +59,6 @@ devDependencies: '@rollup/plugin-node-resolve': 13.0.6_rollup@2.58.0 '@rollup/plugin-replace': 2.4.2_rollup@2.58.0 '@vitejs/plugin-vue': 1.9.3_vite@2.6.10 - '@vitejs/plugin-vue-jsx': 1.2.0 - '@vue/babel-plugin-jsx': 1.1.1_@babel+core@7.15.8 autoprefixer: 10.3.7_postcss@8.3.9 esbuild-register: 2.6.0 eslint: 7.32.0 @@ -83,7 +78,6 @@ devDependencies: tslib: 2.3.1 typescript: 4.4.4 unplugin-auto-import: 0.4.12_770af16b425e6697fb95c3f275416500 - unplugin-vue-components: 0.16.0_5526dbcc4fc39ff4d6a8525c3fd94908 vite: 2.6.10 vite-svg-loader: 2.2.0 vue: 3.2.20 @@ -251,13 +245,6 @@ packages: source-map: 0.5.7 dev: true - /@babel/helper-annotate-as-pure/7.15.4: - resolution: {integrity: sha512-QwrtdNvUNsPCj2lfNQacsGSQvGX8ee1ttrBrcozUP2Sv/jylewBP/8QFe6ZkBsC8T/GYWonNAWJV4aRR9AL2DA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.15.6 - dev: true - /@babel/helper-compilation-targets/7.15.4_@babel+core@7.15.8: resolution: {integrity: sha512-rMWPCirulnPSe4d+gwdWXLfAXTTBj8M3guAf5xFQJ0nvFY7tfNAFnWdqaHegHlgDZOCT4qvhF3BYlSJag8yhqQ==} engines: {node: '>=6.9.0'} @@ -271,23 +258,6 @@ packages: semver: 6.3.0 dev: true - /@babel/helper-create-class-features-plugin/7.15.4_@babel+core@7.15.8: - resolution: {integrity: sha512-7ZmzFi+DwJx6A7mHRwbuucEYpyBwmh2Ca0RvI6z2+WLZYCqV0JOaLb+u0zbtmDicebgKBZgqbYfLaKNqSgv5Pw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - dependencies: - '@babel/core': 7.15.8 - '@babel/helper-annotate-as-pure': 7.15.4 - '@babel/helper-function-name': 7.15.4 - '@babel/helper-member-expression-to-functions': 7.15.4 - '@babel/helper-optimise-call-expression': 7.15.4 - '@babel/helper-replace-supers': 7.15.4 - '@babel/helper-split-export-declaration': 7.15.4 - transitivePeerDependencies: - - supports-color - dev: true - /@babel/helper-function-name/7.15.4: resolution: {integrity: sha512-Z91cOMM4DseLIGOnog+Z8OI6YseR9bua+HpvLAQ2XayUGU+neTtX+97caALaLdyu53I/fjhbeCnWnRH1O3jFOw==} engines: {node: '>=6.9.0'} @@ -348,11 +318,6 @@ packages: '@babel/types': 7.15.6 dev: true - /@babel/helper-plugin-utils/7.14.5: - resolution: {integrity: sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ==} - engines: {node: '>=6.9.0'} - dev: true - /@babel/helper-replace-supers/7.15.4: resolution: {integrity: sha512-/ztT6khaXF37MS47fufrKvIsiQkx1LBRvSJNzRqmbyeZnTwU9qBxXYLaaT/6KaxfKhjs2Wy8kG8ZdsFUuWBjzw==} engines: {node: '>=6.9.0'} @@ -415,49 +380,6 @@ packages: hasBin: true dev: true - /@babel/plugin-syntax-import-meta/7.10.4_@babel+core@7.15.8: - resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.15.8 - '@babel/helper-plugin-utils': 7.14.5 - dev: true - - /@babel/plugin-syntax-jsx/7.14.5_@babel+core@7.15.8: - resolution: {integrity: sha512-ohuFIsOMXJnbOMRfX7/w7LocdR6R7whhuRD4ax8IipLcLPlZGJKkBxgHp++U4N/vKyU16/YDQr2f5seajD3jIw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.15.8 - '@babel/helper-plugin-utils': 7.14.5 - dev: true - - /@babel/plugin-syntax-typescript/7.14.5_@babel+core@7.15.8: - resolution: {integrity: sha512-u6OXzDaIXjEstBRRoBCQ/uKQKlbuaeE5in0RvWdA4pN6AhqxTIwUsnHPU1CFZA/amYObMsuWhYfRl3Ch90HD0Q==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.15.8 - '@babel/helper-plugin-utils': 7.14.5 - dev: true - - /@babel/plugin-transform-typescript/7.15.8_@babel+core@7.15.8: - resolution: {integrity: sha512-ZXIkJpbaf6/EsmjeTbiJN/yMxWPFWvlr7sEG1P95Xb4S4IBcrf2n7s/fItIhsAmOf8oSh3VJPDppO6ExfAfKRQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.15.8 - '@babel/helper-create-class-features-plugin': 7.15.4_@babel+core@7.15.8 - '@babel/helper-plugin-utils': 7.14.5 - '@babel/plugin-syntax-typescript': 7.14.5_@babel+core@7.15.8 - transitivePeerDependencies: - - supports-color - dev: true - /@babel/template/7.15.4: resolution: {integrity: sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg==} engines: {node: '>=6.9.0'} @@ -1059,20 +981,6 @@ packages: eslint-visitor-keys: 2.1.0 dev: true - /@vitejs/plugin-vue-jsx/1.2.0: - resolution: {integrity: sha512-Y4Er2bn8bHNiUziJizcVT1yQKTq6oOJeBrKkxvjo2yKT/RTSK1ZlkP/qnzchxxuBkx0tYG4Aaxbb9xuVnNNDEA==} - engines: {node: '>=12.0.0'} - dependencies: - '@babel/core': 7.15.8 - '@babel/plugin-syntax-import-meta': 7.10.4_@babel+core@7.15.8 - '@babel/plugin-transform-typescript': 7.15.8_@babel+core@7.15.8 - '@rollup/pluginutils': 4.1.1 - '@vue/babel-plugin-jsx': 1.1.1_@babel+core@7.15.8 - hash-sum: 2.0.0 - transitivePeerDependencies: - - supports-color - dev: true - /@vitejs/plugin-vue/1.9.3_vite@2.6.10: resolution: {integrity: sha512-yW6H/q+4Mc2PcVjSOelcsMrg/k15DnMUz8jyCFsI04emc3aLwo4AoofUfGnjHUkgirrDxSJLVqQVGhonQ3yykA==} engines: {node: '>=12.0.0'} @@ -1130,27 +1038,6 @@ packages: vscode-uri: 2.1.2 dev: true - /@vue/babel-helper-vue-transform-on/1.0.2: - resolution: {integrity: sha512-hz4R8tS5jMn8lDq6iD+yWL6XNB699pGIVLk7WSJnn1dbpjaazsjZQkieJoRX6gW5zpYSCFqQ7jUquPNY65tQYA==} - dev: true - - /@vue/babel-plugin-jsx/1.1.1_@babel+core@7.15.8: - resolution: {integrity: sha512-j2uVfZjnB5+zkcbc/zsOc0fSNGCMMjaEXP52wdwdIfn0qjFfEYpYZBFKFg+HHnQeJCVrjOeO0YxgaL7DMrym9w==} - dependencies: - '@babel/helper-module-imports': 7.15.4 - '@babel/plugin-syntax-jsx': 7.14.5_@babel+core@7.15.8 - '@babel/template': 7.15.4 - '@babel/traverse': 7.15.4 - '@babel/types': 7.15.6 - '@vue/babel-helper-vue-transform-on': 1.0.2 - camelcase: 6.2.0 - html-tags: 3.1.0 - svg-tags: 1.0.0 - transitivePeerDependencies: - - '@babel/core' - - supports-color - dev: true - /@vue/compiler-core/3.2.20: resolution: {integrity: sha512-vcEXlKXoPwBXFP5aUTHN9GTZaDfwCofa9Yu9bbW2C5O/QSa9Esdt7OG4+0RRd3EHEMxUvEdj4RZrd/KpQeiJbA==} dependencies: @@ -1413,14 +1300,6 @@ packages: rxjs: 6.6.7 dev: true - /anymatch/3.1.2: - resolution: {integrity: sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==} - engines: {node: '>= 8'} - dependencies: - normalize-path: 3.0.0 - picomatch: 2.3.0 - dev: true - /argparse/1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} dependencies: @@ -1515,11 +1394,6 @@ packages: resolution: {integrity: sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==} dev: true - /binary-extensions/2.2.0: - resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} - engines: {node: '>=8'} - dev: true - /boolbase/1.0.0: resolution: {integrity: sha1-aN/1++YMUes3cl6p4+0xDcwed24=} dev: true @@ -1699,21 +1573,6 @@ packages: resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} dev: true - /chokidar/3.5.2: - resolution: {integrity: sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==} - engines: {node: '>= 8.10.0'} - dependencies: - anymatch: 3.1.2 - braces: 3.0.2 - glob-parent: 5.1.2 - is-binary-path: 2.1.0 - is-glob: 4.0.3 - normalize-path: 3.0.0 - readdirp: 3.6.0 - optionalDependencies: - fsevents: 2.3.2 - dev: true - /ci-info/2.0.0: resolution: {integrity: sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==} dev: true @@ -3457,10 +3316,6 @@ packages: function-bind: 1.1.1 dev: true - /hash-sum/2.0.0: - resolution: {integrity: sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==} - dev: true - /hosted-git-info/2.8.9: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} dev: true @@ -3479,11 +3334,6 @@ packages: lru-cache: 6.0.0 dev: true - /html-tags/3.1.0: - resolution: {integrity: sha512-1qYz89hW3lFDEazhjW0yVAV87lw8lVkrJocr72XmBkMKsoSVJCQx3W8BXsC7hO2qAt8BoVjYjtAcZ9perqGnNg==} - engines: {node: '>=8'} - dev: true - /htmlparser2/7.1.2: resolution: {integrity: sha512-d6cqsbJba2nRdg8WW2okyD4ceonFHn9jLFxhwlNcLhQWcFPdxXeJulgOLjLKtAK9T6ahd+GQNZwG9fjmGW7lyg==} dependencies: @@ -3701,13 +3551,6 @@ packages: has-bigints: 1.0.1 dev: true - /is-binary-path/2.1.0: - resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} - engines: {node: '>=8'} - dependencies: - binary-extensions: 2.2.0 - dev: true - /is-boolean-object/1.1.2: resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} engines: {node: '>= 0.4'} @@ -4491,11 +4334,6 @@ packages: validate-npm-package-license: 3.0.4 dev: true - /normalize-path/3.0.0: - resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} - engines: {node: '>=0.10.0'} - dev: true - /normalize-range/0.1.2: resolution: {integrity: sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=} engines: {node: '>=0.10.0'} @@ -5562,13 +5400,6 @@ packages: type-fest: 0.6.0 dev: true - /readdirp/3.6.0: - resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} - engines: {node: '>=8.10.0'} - dependencies: - picomatch: 2.3.0 - dev: true - /redent/3.0.0: resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} engines: {node: '>=8'} @@ -6128,10 +5959,6 @@ packages: supports-color: 7.2.0 dev: true - /svg-tags/1.0.0: - resolution: {integrity: sha1-WPcc7jvVGbWdSyqEO2x95krAR2Q=} - dev: true - /svgo/2.7.0: resolution: {integrity: sha512-aDLsGkre4fTDCWvolyW+fs8ZJFABpzLXbtdK1y71CKnHzAnpDxKXPj2mNKj+pyOXUCzFHzuxRJ94XOFygOWV3w==} engines: {node: '>=10.13.0'} @@ -6368,30 +6195,6 @@ packages: - webpack dev: true - /unplugin-vue-components/0.16.0_5526dbcc4fc39ff4d6a8525c3fd94908: - resolution: {integrity: sha512-BM/5p6/btLgDjUxf290cKbzbaGow95NFibhp+TSQhL0wyb1Q6sP0nmlqOvGnpLANFq0+urXxXDloMLlTJH6Fww==} - engines: {node: '>=14'} - peerDependencies: - vue: 2 || 3 - dependencies: - '@antfu/utils': 0.3.0 - '@rollup/pluginutils': 4.1.1 - chokidar: 3.5.2 - debug: 4.3.2 - fast-glob: 3.2.7 - local-pkg: 0.1.0 - magic-string: 0.25.7 - minimatch: 3.0.4 - resolve: 1.20.0 - unplugin: 0.2.16_rollup@2.58.0+vite@2.6.10 - vue: 3.2.20 - transitivePeerDependencies: - - rollup - - supports-color - - vite - - webpack - dev: true - /unplugin/0.2.16_rollup@2.58.0+vite@2.6.10: resolution: {integrity: sha512-KkXatHba0baJszSHW+2e8EQU/5Bz7rYwzYXu8wUeq97tE6K3wvub+7OWSuRv04LttvzNLsJ2jXEyR35gofv74Q==} peerDependencies: diff --git a/rollup.ts b/rollup.ts index 50b966ff2..227efec60 100644 --- a/rollup.ts +++ b/rollup.ts @@ -3,13 +3,16 @@ import { terser } from 'rollup-plugin-terser' import dts from 'rollup-plugin-dts' import commonjs from '@rollup/plugin-commonjs' import resolve from '@rollup/plugin-node-resolve' -import babel from '@rollup/plugin-babel' +import { babel } from '@rollup/plugin-babel' +import replace from '@rollup/plugin-replace' // @ts-ignore import svg from 'rollup-plugin-svg' import postcss from 'rollup-plugin-postcss' // @ts-ignore import { DEFAULT_EXTENSIONS as DEFAULT_BABEL_EXTENSIONS } from '@babel/core' +import pkg from './package.json' + const configs: any[] = [] const activePackages = [ @@ -88,10 +91,14 @@ for (const { external, iife } of activePackages) { }), commonjs({ include: 'node_modules/**' }), babel({ - extensions: [...DEFAULT_BABEL_EXTENSIONS, '.ts', '.tsx'], + extensions: [...DEFAULT_BABEL_EXTENSIONS, '.ts'], exclude: 'node_modules/**', babelHelpers: 'bundled', }), + replace({ + __REACT_FLOW_VERSION__: JSON.stringify(pkg.version), + preventAssignment: true, + }), ], external: ['vue', ...(external || [])], }) diff --git a/src/components.d.ts b/src/components.d.ts deleted file mode 100644 index 1a1c66e00..000000000 --- a/src/components.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -// generated by unplugin-vue-components -// We suggest you to commit this file into source control -// Read more: https://github.com/vuejs/vue-next/pull/3399 - -declare module 'vue' { - export interface GlobalComponents { - BezierEdge: typeof import('./components/Edges/BezierEdge.vue')['default'] - ConnectionLine: typeof import('./components/ConnectionLine/ConnectionLine.vue')['default'] - DefaultNode: typeof import('./components/Nodes/DefaultNode.vue')['default'] - Edge: typeof import('./components/Edges/Edge.vue')['default'] - EdgeAnchor: typeof import('./components/Edges/EdgeAnchor.vue')['default'] - EdgeText: typeof import('./components/Edges/EdgeText.vue')['default'] - Handle: typeof import('./components/Handle/Handle.vue')['default'] - InputNode: typeof import('./components/Nodes/InputNode.vue')['default'] - Node: typeof import('./components/Nodes/Node.vue')['default'] - NodesSelection: typeof import('./components/NodesSelection/NodesSelection.vue')['default'] - OutputNode: typeof import('./components/Nodes/OutputNode.vue')['default'] - SelectionRect: typeof import('./components/UserSelection/SelectionRect.vue')['default'] - SmoothStepEdge: typeof import('./components/Edges/SmoothStepEdge.vue')['default'] - StepEdge: typeof import('./components/Edges/StepEdge.vue')['default'] - StraightEdge: typeof import('./components/Edges/StraightEdge.vue')['default'] - UserSelection: typeof import('./components/UserSelection/UserSelection.vue')['default'] - } -} - -export { } diff --git a/src/custom.d.ts b/src/custom.d.ts index c75864ea8..950539347 100644 --- a/src/custom.d.ts +++ b/src/custom.d.ts @@ -1,2 +1,2 @@ -declare const __REVUE_FLOW_VERSION__: string +declare const __VUE_FLOW_VERSION__: string declare const __ENV__: string diff --git a/src/store/index.ts b/src/store/index.ts index 01414e7f3..614f6c33d 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -53,7 +53,7 @@ export const initialState = (): FlowState => ({ multiSelectionActive: false, - revueFlowVersion: typeof __REVUE_FLOW_VERSION__ !== 'undefined' ? __REVUE_FLOW_VERSION__ : '-', + revueFlowVersion: typeof __VUE_FLOW_VERSION__ !== 'undefined' ? __VUE_FLOW_VERSION__ : '-', }) export { default as useFlowStore } from './useFlowStore' diff --git a/vite.config.ts b/vite.config.ts index 8abf17c5d..56038cba8 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,10 +1,8 @@ import { resolve } from 'path' import { defineConfig } from 'vite' -import vueJsx from '@vitejs/plugin-vue-jsx' import vue from '@vitejs/plugin-vue' import svgLoader from 'vite-svg-loader' import AutoImport from 'unplugin-auto-import/vite' -import Components from 'unplugin-vue-components/vite' // https://vitejs.dev/config/ export default defineConfig({ @@ -19,14 +17,10 @@ export default defineConfig({ }, plugins: [ vue(), - vueJsx(), svgLoader(), // https://github.com/antfu/unplugin-auto-import AutoImport({ imports: ['vue', '@vueuse/core'], dts: 'src/auto-imports.d.ts', }), - Components({ - dts: 'src/components.d.ts', - }), ], })