@abi-software/flatmapvuer 0.6.1-annotator.0 → 0.6.1-annotator.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -4
- package/cypress.config.js +24 -0
- package/dist/flatmapvuer.js +38654 -36980
- package/dist/flatmapvuer.umd.cjs +198 -177
- package/dist/style.css +1 -1
- package/package.json +25 -15
- package/reporter-config.json +10 -0
- package/src/App.vue +2 -10
- package/src/components/AnnotationTool.vue +22 -12
- package/src/components/ConnectionDialog.vue +127 -0
- package/src/components/ExternalResourceCard.vue +1 -0
- package/src/components/FlatmapVuer.vue +848 -356
- package/src/components/MultiFlatmapVuer.vue +163 -45
- package/src/components/ProvenancePopup.vue +13 -8
- package/src/components/Tooltip.vue +2 -2
- package/src/components.d.ts +1 -1
- package/src/icons/yellowstar.js +1 -1
- package/src/main.js +16 -1
- package/src/services/flatmapQueries.js +2 -0
- package/src/store/index.js +24 -0
- package/vite.config.js +35 -28
- package/vuese-generator.js +65 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vuese Generator
|
|
3
|
+
*
|
|
4
|
+
* To generate markdown files from Vue components
|
|
5
|
+
* To watch components changes for Vitepress on Dev Mode
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import fs from 'fs'
|
|
9
|
+
import path from 'path'
|
|
10
|
+
import chokidar from 'chokidar'
|
|
11
|
+
import { parser } from '@vuese/parser'
|
|
12
|
+
import { Render } from '@vuese/markdown-render'
|
|
13
|
+
|
|
14
|
+
const watchMode = process.argv.find((argv) => argv === 'watch')
|
|
15
|
+
|
|
16
|
+
const componentsDir = 'src/components'
|
|
17
|
+
const components = ['FlatmapVuer.vue', 'MultiFlatmapVuer.vue']
|
|
18
|
+
const outputDir = 'docs/components'
|
|
19
|
+
|
|
20
|
+
function generateMarkdown(file) {
|
|
21
|
+
const fileWithPath = `${componentsDir}/${file}`
|
|
22
|
+
const fileContent = fs.readFileSync(fileWithPath, 'utf-8')
|
|
23
|
+
|
|
24
|
+
try {
|
|
25
|
+
const parserResult = parser(fileContent)
|
|
26
|
+
const r = new Render(parserResult)
|
|
27
|
+
const renderResult = r.render()
|
|
28
|
+
const markdownResult = r.renderMarkdown()
|
|
29
|
+
const markdownContent = markdownResult.content
|
|
30
|
+
const componentName = path.basename(fileWithPath, '.vue')
|
|
31
|
+
|
|
32
|
+
if (!fs.existsSync(outputDir)) {
|
|
33
|
+
fs.mkdirSync(outputDir)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
fs.writeFile(`${outputDir}/${componentName}.md`, markdownContent, (err) => {
|
|
37
|
+
if (err) {
|
|
38
|
+
console.error(`Error writing markdown file for ${componentName}`, err)
|
|
39
|
+
} else {
|
|
40
|
+
console.log(`Markdown file for ${componentName} is generated!`)
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
} catch(e) {
|
|
44
|
+
console.error(e)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// To generate markdown files - one time
|
|
49
|
+
components.forEach((component) => {
|
|
50
|
+
console.log(`Write markdown file for ${component} on first load.`)
|
|
51
|
+
generateMarkdown(component)
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
// To watch component changes and generate markdown files
|
|
55
|
+
if (watchMode) {
|
|
56
|
+
const watcher = chokidar.watch(components, {
|
|
57
|
+
cwd: componentsDir,
|
|
58
|
+
ignoreInitial: true,
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
watcher.on('change', (file) => {
|
|
62
|
+
console.log(`The component ${file} has changed!`)
|
|
63
|
+
generateMarkdown(file)
|
|
64
|
+
})
|
|
65
|
+
}
|