Skip to content

Commit

Permalink
add scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
hojas committed Jul 8, 2023
1 parent df72e0f commit 6f4446e
Show file tree
Hide file tree
Showing 7 changed files with 138 additions and 42 deletions.
40 changes: 38 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,47 @@
{
"name": "vue-mermaid-render",
"type": "module",
"version": "0.0.0",
"version": "0.1.1",
"packageManager": "[email protected]",
"license": "MIT",
"repository": "hojas/vue-mermaid-render",
"bugs": "https://github.com/hojas/vue-mermaid-render/issues",
"keywords": [
"vue",
"vue-component",
"component",
"mermaid",
"diagrams"
],
"exports": {
".": {
"types": "./dist/main.d.ts",
"require": "./dist/vue-mermaid-render.umd.cjs",
"import": "./dist/vue-mermaid-render.js"
}
},
"main": "./dist/vue-mermaid-render.umd.cjs",
"module": "./dist/vue-mermaid-render.js",
"types": "./dist/main.d.ts",
"files": [
"dist"
],
"scripts": {
"dev": "node ./scripts/dev.cjs",
"build": "node ./scripts/build.cjs"
},
"dependencies": {
"mermaid": "^10.2.4"
},
"devDependencies": {
"@antfu/eslint-config": "^0.39.7",
"eslint": "^8.44.0"
"@types/node": "^20.4.1",
"@vitejs/plugin-vue": "^4.2.3",
"eslint": "^8.44.0",
"shelljs": "^0.8.5",
"typescript": "^5.1.6",
"vite": "^4.4.2",
"vue": "^3.3.4",
"vue-tsc": "^1.8.4"
}
}
12 changes: 6 additions & 6 deletions packages/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"dev": "vite"
},
"dependencies": {
"vue": "^3.3.4",
"vue": "*",
"vue-mermaid-render": "workspace:*"
},
"devDependencies": {
"@types/node": "^20.4.1",
"@vitejs/plugin-vue": "^4.2.3",
"typescript": "^5.1.6",
"vite": "^4.4.2",
"vue-tsc": "^1.8.4"
"@types/node": "*",
"@vitejs/plugin-vue": "*",
"typescript": "*",
"vite": "*",
"vue-tsc": "*"
}
}
26 changes: 8 additions & 18 deletions packages/vue-mermaid-render/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
{
"name": "vue-mermaid-render",
"type": "module",
"version": "0.1.0",
"private": true,
"packageManager": "[email protected]",
"license": "MIT",
"repository": "hojas/vue-mermaid-render",
"bugs": "https://github.com/hojas/vue-mermaid-render/issues",
"keywords": [
"vue",
"vue-component",
"component",
"mermaid",
"diagrams"
],
"exports": {
".": {
"types": "./dist/main.d.ts",
Expand All @@ -28,14 +18,14 @@
"build": "vite build && vue-tsc --declaration --emitDeclarationOnly"
},
"dependencies": {
"mermaid": "^10.2.4"
"mermaid": "*"
},
"devDependencies": {
"@types/node": "^20.4.1",
"@vitejs/plugin-vue": "^4.2.3",
"typescript": "^5.1.6",
"vite": "^4.4.2",
"vue": "^3.3.4",
"vue-tsc": "^1.8.4"
"@types/node": "*",
"@vitejs/plugin-vue": "*",
"typescript": "*",
"vite": "*",
"vue": "*",
"vue-tsc": "*"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import mermaid from 'mermaid'
const props = defineProps<{ content: string; config?: MermaidConfig }>()
const mounted = ref(false)
const el = ref()
const mounted = ref(false)
const mermaidString = ref('')
function genSvgId() {
Expand Down
77 changes: 62 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions scripts/build.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const path = require('node:path')
const shell = require('shelljs')

const source = path.resolve(__dirname, '../packages/vue-mermaid-render/dist/*')
const target = path.resolve(__dirname, '../dist/')

function build() {
shell.cd(path.resolve(__dirname, '../packages/vue-mermaid-render/'))
shell.exec('pnpm run build')

shell.rm('-rf', target)
shell.mkdir('-p', target)
shell.cp('-R', source, target)
}

build()
7 changes: 7 additions & 0 deletions scripts/dev.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const path = require('node:path')
const shell = require('shelljs')

const demo = path.resolve(__dirname, '../packages/demo/')

shell.cd(demo)
shell.exec('pnpm run dev')

0 comments on commit 6f4446e

Please sign in to comment.