feat: add toolbar pkg

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2022-12-05 19:57:02 +01:00
committed by Braks
parent 4103ef60bb
commit 2829f8a92d
6 changed files with 117 additions and 0 deletions

View File

@@ -0,0 +1 @@
# Vue Flow: Toolbar Component

View File

@@ -0,0 +1,44 @@
{
"name": "@vue-flow/toolbar",
"version": "0.0.1",
"private": false,
"license": "MIT",
"author": "Burak Cakmakoglu<78412429+bcakmakoglu@users.noreply.github.com>",
"repository": {
"type": "git",
"url": "git+https://github.com/bcakmakoglu/vue-flow/packages/plugins/toolbar"
},
"homepage": "https://github.com/bcakmakoglu/vue-flow#readme",
"bugs": {
"url": "https://github.com/bcakmakoglu/vue-flow/issues"
},
"main": "./dist/vue-flow-plugin-toolbar.js",
"module": "./dist/vue-flow-toolbar.mjs",
"types": "./dist/index.d.ts",
"unpkg": "./dist/vue-flow-toolbar.iife.js",
"jsdelivr": "./dist/vue-flow-toolbar.iife.js",
"files": [
"dist"
],
"sideEffects": false,
"scripts": {
"build": "vite build",
"types": "tsc && shx rm -rf tmp",
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix --ignore-path ../../../.gitignore .",
"lint:dist": "eslint --ext \".ts,.tsx\" -c .eslintrc.js --fix ./dist",
"test": "exit 0"
},
"peerDependencies": {
"@vue-flow/core": "^1.0.0",
"vue": "^3.2.37"
},
"dependencies": {},
"devDependencies": {
"@vue-flow/core": "workspace:*",
"vite": "^3.2.2"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
}
}

View File

@@ -0,0 +1 @@
export * from './types'

View File

@@ -0,0 +1,8 @@
import type dagre from 'dagre'
export type Direction = 'TB' | 'BT' | 'LR' | 'RL'
export interface UseDagreState {
layout: (direction: Direction) => void
dagreGraph: dagre.graphlib.Graph
}

View File

@@ -0,0 +1,31 @@
{
"compilerOptions": {
"baseUrl": ".",
"module": "ESNext",
"target": "es2017",
"lib": [
"DOM",
"ESNext"
],
"strict": true,
"esModuleInterop": true,
"incremental": false,
"skipLibCheck": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"noUnusedLocals": false,
"strictNullChecks": true,
"forceConsistentCasingInFileNames": true,
"declaration": true,
"declarationDir": "./dist",
"emitDeclarationOnly": true,
"types": [],
},
"include": [
"./src",
],
"exclude": [
"node_modules",
"dist"
]
}

View File

@@ -0,0 +1,32 @@
import { resolve } from 'path'
import { defineConfig } from 'vite'
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
extensions: ['.ts', '.vue'],
},
build: {
emptyOutDir: false,
lib: {
formats: ['es', 'cjs', 'iife'],
entry: resolve(__dirname, 'src/index.ts'),
fileName: 'vue-flow-toolbar',
name: 'vueFlowToolbar',
},
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
// into your library
external: ['vue', '@vue-flow/core'],
output: {
dir: './dist',
// Provide global variables to use in the UMD build
// for externalized deps
globals: {
'vue': 'Vue',
'@vue-flow/core': 'VueFlow',
},
},
},
},
})