Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// ['flowchart']
// ],
extraWatchFiles: [
'.vuepress/nav/en.js',
'.vuepress/nav/zh.js'
]
})
// function getApiSidebar () {
// return [
// 'cli',
// 'node'
// ]
// }
const componentDocs = fs
.readdirSync(path.resolve(__dirname, '../guide/components'))
.map(filename => '/guide/components/' + filename.slice(0, -3))
.sort()
const extendsDocs = fs
.readdirSync(path.resolve(__dirname, '../guide/extends'))
.map(filename => '/guide/extends/' + filename.slice(0, -3))
.sort()
console.log('----------------')
console.log(componentDocs)
console.log('----------------')
function getGuideSidebar (groupA, groupB,groupC) {
return [
{
title: groupA,
collapsable: false,
sidebarDepth: 3,
const { fs, path } = require('@vuepress/shared-utils')
const App = require('../../App')
const docsBaseDir = path.resolve(__dirname, 'fixtures')
const docsModeNames = fs.readdirSync(docsBaseDir)
const docsModes = docsModeNames.map(name => {
const docsPath = path.resolve(docsBaseDir, name)
const docsTempPath = path.resolve(docsPath, '.vuepress/.temp')
return { name, docsPath, docsTempPath }
})
describe('App', () => {
test('should not throw error', async () => {
await Promise.all(docsModes.map(async ({ name, docsPath, docsTempPath }) => {
await fs.ensureDir(docsTempPath)
const app = new App({
sourceDir: docsPath,
theme: '@vuepress/default',
emp: docsTempPath
})
expect(app.sourceDir).toBe(docsPath)
'signing-data',
]
},
{
title: groupC,
collapsable: false,
children: [
'registering-function-names',
'registering-your-token',
'defining-your-icon',
]
}
]
}
const officalPlugins = fs
.readdirSync(path.resolve(__dirname, '../plugin/official'))
.map(filename => 'official/' + filename.slice(0, -3))
.sort()
const readdirSync = dir => (fs.existsSync(dir) && fs.readdirSync(dir)) || []
const localThemePath = resolve(vuepressDir, 'theme')
theme = theme || siteConfig.theme || options.theme
let path
let name
let shortcut
let entry = {}
/**
* 1. From `.vuepress/theme` directory.
*/
if (
!ignoreLocal
&& !fs.existsSync(theme)
&& fs.existsSync(localThemePath)
&& fs.readdirSync(localThemePath).length > 0
) {
path = localThemePath
name = shortcut = 'local'
logger.tip(`Apply local theme at ${chalk.gray(path)}...`)
/**
* 2. From deps or custom local path.
* - vuepress-plugin-foo
* - /path/to/a-theme/index.js
*/
} else if (isString(theme)) {
/**
* To let theme resolver get the correct theme name.
*/
if (theme.endsWith('/index.js')) {
theme = theme.replace(/\/index\.js$/, '')
]
},
{
title: groupB,
collapsable: false,
children: [
'frontmatter',
'permalinks',
'markdown-slot',
'global-computed'
]
}
]
}
const officalPlugins = fs
.readdirSync(path.resolve(__dirname, '../plugin/official'))
.map(filename => 'official/' + filename.slice(0, -3))
.sort()
function getPluginSidebar (pluginTitle, pluginIntro, officialPluginTitle) {
return [
{
title: pluginTitle,
collapsable: false,
children: [
['', pluginIntro],
'using-a-plugin',
'writing-a-plugin',
'life-cycle',
'option-api',
'context-api'