From 92caccfd6e4caa69c740005b974663fbe8f9abbf Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Sat, 10 Jul 2021 11:51:01 +0200 Subject: [PATCH] update: use vue-demi again to add compatability to vue2 * add vite.config.app.ts for demo generation --- .gitignore | 2 ++ package.json | 13 ++++++++++--- rollup.config.js | 2 +- src/App.vue | 2 +- src/Basic.tsx | 2 +- src/additional-components/Background/index.tsx | 2 +- src/additional-components/Controls/index.tsx | 2 +- .../MiniMap/MiniMapNode.tsx | 2 +- src/additional-components/MiniMap/index.tsx | 2 +- src/components/ConnectionLine/index.tsx | 2 +- src/components/Edges/BezierEdge.tsx | 2 +- src/components/Edges/EdgeAnchor.tsx | 2 +- src/components/Edges/EdgeText.tsx | 2 +- src/components/Edges/SmoothStepEdge.tsx | 2 +- src/components/Edges/StepEdge.tsx | 2 +- src/components/Edges/StraightEdge.tsx | 2 +- src/components/Edges/wrapEdge.tsx | 2 +- src/components/Handle/index.tsx | 2 +- src/components/Nodes/DefaultNode.tsx | 2 +- src/components/Nodes/InputNode.tsx | 2 +- src/components/Nodes/OutputNode.tsx | 2 +- src/components/Nodes/wrapNode.tsx | 2 +- src/components/UserSelection/index.tsx | 2 +- src/container/EdgeRenderer/MarkerDefinitions.tsx | 2 +- src/container/EdgeRenderer/index.tsx | 2 +- src/container/EdgeRenderer/utils.ts | 2 +- src/container/FlowRenderer/index.tsx | 2 +- src/container/GraphView/index.tsx | 2 +- src/container/NodeRenderer/index.tsx | 2 +- src/container/RevueFlow/index.tsx | 2 +- src/container/ZoomPane/index.tsx | 2 +- src/hooks/useGlobalKeyHandler.ts | 2 +- src/hooks/useKeyPress.ts | 2 +- src/main.ts | 2 +- src/shims-vue.d.ts | 2 +- src/types/index.ts | 2 +- vite.config.app.ts | 16 ++++++++++++++++ vite.config.ts | 6 +++--- yarn.lock | 4 ++-- 39 files changed, 67 insertions(+), 42 deletions(-) create mode 100644 vite.config.app.ts diff --git a/.gitignore b/.gitignore index 52eadcb1..d718f84d 100644 --- a/.gitignore +++ b/.gitignore @@ -95,3 +95,5 @@ hasura/db_data/ # Codegen types types/types.ts + +build diff --git a/package.json b/package.json index eec99509..c7852894 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ }, "license": "MIT", "author": "Burak Cakmakoglu", - "main": "dist/revue-flow.es.js", + "main": "dist/index.js", + "module": "dist/revue-flow.es.js", "types": "dist/index.d.ts", "files": [ "dist", @@ -18,6 +19,7 @@ "dev": "vite", "build": "vue-tsc --noEmit && vite build && yarn build:dist", "build:dist": "rollup -c --environment NODE_ENV:production", + "build:app": "vite build -c vite.config.app.ts", "serve": "vite preview", "prepublishOnly": "yarn build", "test": "exit 0;", @@ -31,7 +33,7 @@ "d3-zoom": "^3.0.0", "fast-deep-equal": "^3.1.3", "pinia": "^2.0.0-beta.3", - "vue": "^3.0.5" + "vue-demi": "latest" }, "devDependencies": { "@babel/core": "^7.14.6", @@ -67,7 +69,12 @@ "rollup-plugin-typescript2": "^0.30.0", "typescript": "^4.3.5", "vite": "^2.3.8", - "vue-tsc": "^0.0.24" + "vue-tsc": "^0.0.24", + "vue": "^3.0.5" + }, + "peerDependencies": { + "@vue/composition-api": "^1.0.0-rc.13", + "vue": "^2.6.0 || >=3.0.5" }, "publishConfig": { "access": "public", diff --git a/rollup.config.js b/rollup.config.js index 524a1428..7a5e7fa0 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -14,7 +14,7 @@ const processEnv = isProd || isTesting ? 'production' : 'development'; export const baseConfig = ({ injectCSS = true } = {}) => ({ input: 'src/index.ts', - external: ['vue', (id) => id.includes('@babel/runtime')], + external: ['vue-demi', (id) => id.includes('@babel/runtime')], onwarn(warning, rollupWarn) { if (warning.code !== 'CIRCULAR_DEPENDENCY') { rollupWarn(warning); diff --git a/src/App.vue b/src/App.vue index 06efe323..9392ce97 100644 --- a/src/App.vue +++ b/src/App.vue @@ -6,7 +6,7 @@