Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.data.json
.temp
CHANGELOG/*
26 changes: 24 additions & 2 deletions docs/src/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Components from 'unplugin-vue-components/vite'
import AutoImport from 'unplugin-auto-import/vite'
import { useVueFlow } from '@vue-flow/core'
import head from './head'
import { copyVueFlowPlugin } from './copy-plugin'
import { copyVueFlowPlugin, files } from './plugins'

const { vueFlowVersion } = useVueFlow()

Expand Down Expand Up @@ -38,6 +38,27 @@ const typedocSidebarEntries = (): DefaultTheme.SidebarGroup[] => {
})
}

const changelogSidebarEntries = (): DefaultTheme.SidebarGroup[] => {
return [
{
text: 'CHANGELOG',
collapsible: true,
items: files.map((file) => {
const name = file.pkgName.replace('.md', '')
const isCore = name === 'core'

return {
text: name
.split('-')
.map((s) => capitalize(s))
.join(' '),
link: `/changelog/${isCore ? '' : name}`,
}
}),
},
]
}

export default defineConfigWithTheme<DefaultTheme.Config>({
title: 'Vue Flow',
description: 'Visualize your ideas with Vue Flow, a highly customizable Vue3 Flowchart library.',
Expand Down Expand Up @@ -91,7 +112,7 @@ export default defineConfigWithTheme<DefaultTheme.Config>({
indexName: 'vueflow',
},
nav: [
{ text: `v${vueFlowVersion.value}`, link: '/' },
{ text: `v${vueFlowVersion.value}`, link: '/changelog/', activeMatch: '^/changelog' },
{ text: 'Guide', link: '/guide/', activeMatch: '^/guide/' },
{
text: 'Examples',
Expand Down Expand Up @@ -200,6 +221,7 @@ export default defineConfigWithTheme<DefaultTheme.Config>({
},
],
'/typedocs/': typedocSidebarEntries(),
'/changelog/': changelogSidebarEntries(),
},
},
})
43 changes: 43 additions & 0 deletions docs/src/.vitepress/plugins/changelog.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { copyFile, existsSync, mkdirSync, readdirSync, statSync } from 'fs'
import { resolve } from 'path'

interface ChangelogFile {
path: string
pkgName: string
}

const skip = ['node_modules', 'dist', 'turbo']

const getAllFiles = function (dirPath: string, needle?: string, arrayOfFiles: ChangelogFile[] = [], pkgName?: string) {
readdirSync(dirPath).forEach((file) => {
if (skip.includes(file)) return

if (statSync(`${dirPath}/${file}`).isDirectory()) {
getAllFiles(`${dirPath}/${file}`, needle, arrayOfFiles, file)
} else {
if (file.includes('CHANGELOG')) {
arrayOfFiles.push({ path: `${dirPath}/${file}`, pkgName })
}
}
})

return arrayOfFiles
}

export const files = getAllFiles(resolve(__dirname, '../../../../packages'), 'CHANGELOG')

const changelogDirPath = resolve(__dirname, `../../changelog/`)

if (!existsSync(changelogDirPath)) {
mkdirSync(changelogDirPath)
}

files.forEach(({ path, pkgName }) => {
const isCore = pkgName === 'core'

const filePath = resolve(__dirname, `${path}`)

copyFile(filePath, `${changelogDirPath}/${isCore ? 'index' : pkgName}.md`, () => {})

console.log(`Copied ${filePath} to ${changelogDirPath}/${isCore ? 'index' : pkgName}.md`)
})
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ export function copyVueFlowPlugin(): Plugin {
name: 'copy-vue-flow',
generateBundle() {
;[
{ path: '../../node_modules/@vue-flow/core/dist/', pkgName: 'vue-flow-core.es.js' },
{ path: '../../../node_modules/@vue-flow/core/dist/', pkgName: 'vue-flow-core.es.js' },
{
path: '../../node_modules/@vue-flow/additional-components/dist/',
path: '../../../node_modules/@vue-flow/additional-components/dist/',
pkgName: 'vue-flow-additional-components.es.js',
},
].forEach(({ path, pkgName }) => {
Expand All @@ -23,7 +23,11 @@ export function copyVueFlowPlugin(): Plugin {
fileName: pkgName,
source: readFileSync(filePath, 'utf-8'),
})

console.log(`Copied ${filePath} to ${resolve(__dirname, `../../src/public/${pkgName}`)}`)
})

console.log('Copied vue-flow files')
},
}
}
2 changes: 2 additions & 0 deletions docs/src/.vitepress/plugins/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './changelog'
export * from './copy'
4 changes: 2 additions & 2 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### Minor Changes

- [#123](https://github.com/bcakmakoglu/vue-flow/pull/123) [`3105bd0`](https://github.com/bcakmakoglu/vue-flow/commit/3105bd051ab4ac72c95e524dcb5c551ee4f812f6) Thanks [@bcakmakoglu](https://github.com/bcakmakoglu)! - Disable console warnings for production node-envs (can be set using process.env.NODE_ENV to `production` or `prod`)
- [#123](https://github.com/bcakmakoglu/vue-flow/pull/123) [`3105bd0`](https://github.com/bcakmakoglu/vue-flow/commit/3105bd051ab4ac72c95e524dcb5c551ee4f812f6) Thanks [@bcakmakoglu](https://github.com/bcakmakoglu)! - Disable console warnings for production node-envs

## 1.1.4

Expand Down Expand Up @@ -70,7 +70,7 @@

Example:

```html
```vue
<script lang="ts" setup>
import { Handle, HandleConnectable } from '@vue-flow/core'

Expand Down