@vuepress/core 1.9.2 → 1.9.6
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/lib/node/build/index.js +13 -3
- package/lib/node/internal-plugins/dataBlock/index.js +3 -0
- package/lib/node/internal-plugins/enhanceApp.js +5 -2
- package/lib/node/internal-plugins/frontmatterBlock/index.js +3 -0
- package/lib/node/internal-plugins/layoutComponents.js +3 -0
- package/lib/node/internal-plugins/pageComponents.js +3 -0
- package/lib/node/internal-plugins/palette/index.js +3 -0
- package/lib/node/internal-plugins/rootMixins.js +5 -2
- package/lib/node/internal-plugins/routes.js +3 -0
- package/lib/node/internal-plugins/siteData.js +5 -2
- package/lib/node/internal-plugins/style/index.js +1 -2
- package/lib/node/internal-plugins/transformModule.js +3 -0
- package/package.json +8 -7
package/lib/node/build/index.js
CHANGED
|
@@ -20,6 +20,7 @@ module.exports = class Build extends EventEmitter {
|
|
|
20
20
|
constructor (context) {
|
|
21
21
|
super()
|
|
22
22
|
this.context = context
|
|
23
|
+
this.maxConcurrency = this.context.options.maxConcurrency
|
|
23
24
|
this.outDir = this.context.outDir
|
|
24
25
|
}
|
|
25
26
|
|
|
@@ -91,9 +92,18 @@ module.exports = class Build extends EventEmitter {
|
|
|
91
92
|
// render pages
|
|
92
93
|
logger.wait('Rendering static HTML...')
|
|
93
94
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
)
|
|
95
|
+
// If maxConcurrency is set, instead of rendering all pages concurrently,
|
|
96
|
+
// build task would render pages by smaller group to prevent OOM.
|
|
97
|
+
if (this.maxConcurrency) logger.info(`max concurrency set: ${this.maxConcurrency}`)
|
|
98
|
+
const pagePaths = []
|
|
99
|
+
const maxConcurrency = this.maxConcurrency || 100000
|
|
100
|
+
for (let i = 0; i < this.context.pages.length; i += maxConcurrency) {
|
|
101
|
+
const segmentPaths = await Promise.all(
|
|
102
|
+
this.context.pages.slice(i, i + maxConcurrency)
|
|
103
|
+
.map(page => this.renderPage(page))
|
|
104
|
+
)
|
|
105
|
+
pagePaths.push(...segmentPaths)
|
|
106
|
+
}
|
|
97
107
|
|
|
98
108
|
readline.clearLine(process.stdout, 0)
|
|
99
109
|
readline.cursorTo(process.stdout, 0)
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
const { path } = require('@vuepress/shared-utils')
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @type {import('@vuepress/types').Plugin<{}, import('@vuepress/types').DefaultThemeConfig>}
|
|
5
|
+
*/
|
|
6
|
+
module.exports = (options, ctx) => ({
|
|
4
7
|
name: '@vuepress/internal-enhance-app',
|
|
5
8
|
|
|
6
9
|
enhanceAppFiles () {
|
|
7
|
-
const { sourceDir, themeAPI } =
|
|
10
|
+
const { sourceDir, themeAPI } = ctx
|
|
8
11
|
const enhanceAppPath = path.resolve(sourceDir, '.vuepress/enhanceApp.js')
|
|
9
12
|
const files = [enhanceAppPath]
|
|
10
13
|
if (themeAPI.existsParentTheme) {
|
|
@@ -3,6 +3,9 @@ const {
|
|
|
3
3
|
datatypes: { isPlainObject }
|
|
4
4
|
} = require('@vuepress/shared-utils')
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* @type {import('@vuepress/types').Plugin<{}, import('@vuepress/types').DefaultThemeConfig>}
|
|
8
|
+
*/
|
|
6
9
|
module.exports = (options, ctx) => ({
|
|
7
10
|
name: '@vuepress/internal-palette',
|
|
8
11
|
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
const { codegen: { pathsToModuleCode }} = require('@vuepress/shared-utils')
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @type {import('@vuepress/types').Plugin<{}, import('@vuepress/types').DefaultThemeConfig>}
|
|
5
|
+
*/
|
|
6
|
+
module.exports = (options, ctx, api) => ({
|
|
4
7
|
name: '@vuepress/internal-root-mixins',
|
|
5
8
|
|
|
6
9
|
// @internal/root-mixins
|
|
7
10
|
async clientDynamicModules () {
|
|
8
11
|
const builtInRootMixins = [
|
|
9
|
-
|
|
12
|
+
ctx.getLibFilePath('client/root-mixins/updateMeta.js')
|
|
10
13
|
]
|
|
11
14
|
|
|
12
15
|
const rootMixins = [
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @type {import('@vuepress/types').Plugin<{}, import('@vuepress/types').DefaultThemeConfig>}
|
|
3
|
+
*/
|
|
4
|
+
module.exports = (options, ctx) => ({
|
|
2
5
|
name: '@vuepress/internal-site-data',
|
|
3
6
|
|
|
4
7
|
// @internal/siteData
|
|
5
8
|
async clientDynamicModules () {
|
|
6
|
-
const code = `export const siteData = ${JSON.stringify(
|
|
9
|
+
const code = `export const siteData = ${JSON.stringify(ctx.getSiteData(), null, 2)}`
|
|
7
10
|
return { name: 'siteData.js', content: code, dirname: 'internal' }
|
|
8
11
|
}
|
|
9
12
|
})
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
const { fs, path, logger, chalk } = require('@vuepress/shared-utils')
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @
|
|
5
|
-
* @param {AppContext} ctx
|
|
4
|
+
* @type {import('@vuepress/types').Plugin<{}, import('@vuepress/types').DefaultThemeConfig>}
|
|
6
5
|
*/
|
|
7
6
|
module.exports = (options, ctx) => ({
|
|
8
7
|
name: '@vuepress/internal-style',
|
|
@@ -2,6 +2,9 @@ const { fs, path } = require('@vuepress/shared-utils')
|
|
|
2
2
|
|
|
3
3
|
const DIR = 'transform'
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @type {import('@vuepress/types').Plugin<{}, import('@vuepress/types').DefaultThemeConfig>}
|
|
7
|
+
*/
|
|
5
8
|
module.exports = (options, ctx) => ({
|
|
6
9
|
name: '@vuepress/internal-transform-modules',
|
|
7
10
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuepress/core",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.6",
|
|
4
4
|
"description": "Minimalistic doc generator with Vue component based layout system",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"documentation",
|
|
@@ -25,11 +25,12 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/core": "^7.8.4",
|
|
27
27
|
"@vue/babel-preset-app": "^4.1.2",
|
|
28
|
-
"@vuepress/markdown": "1.9.
|
|
29
|
-
"@vuepress/markdown-loader": "1.9.
|
|
30
|
-
"@vuepress/plugin-last-updated": "1.9.
|
|
31
|
-
"@vuepress/plugin-register-components": "1.9.
|
|
32
|
-
"@vuepress/shared-utils": "1.9.
|
|
28
|
+
"@vuepress/markdown": "1.9.6",
|
|
29
|
+
"@vuepress/markdown-loader": "1.9.6",
|
|
30
|
+
"@vuepress/plugin-last-updated": "1.9.6",
|
|
31
|
+
"@vuepress/plugin-register-components": "1.9.6",
|
|
32
|
+
"@vuepress/shared-utils": "1.9.6",
|
|
33
|
+
"@vuepress/types": "1.9.6",
|
|
33
34
|
"autoprefixer": "^9.5.1",
|
|
34
35
|
"babel-loader": "^8.0.4",
|
|
35
36
|
"bundle-require": "2.1.8",
|
|
@@ -76,5 +77,5 @@
|
|
|
76
77
|
"email": "chl814@foxmail.com"
|
|
77
78
|
}
|
|
78
79
|
],
|
|
79
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "569921636c764f62bb942b72ee30b0610da8a57d"
|
|
80
81
|
}
|