@vuepress/core 2.0.0-rc.27 → 2.0.0-rc.28
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/dist/index.d.ts +18 -4
- package/dist/index.js +17 -8
- package/package.json +20 -20
package/dist/index.d.ts
CHANGED
|
@@ -183,7 +183,7 @@ interface Hooks {
|
|
|
183
183
|
onInitialized: LifeCycleHook;
|
|
184
184
|
onPrepared: LifeCycleHook;
|
|
185
185
|
onWatched: LifeCycleHook<[watchers: Closable[], restart: () => Promise<void>]>;
|
|
186
|
-
onPageUpdated: LifeCycleHook<[type: 'create' | 'delete' | 'update',
|
|
186
|
+
onPageUpdated: LifeCycleHook<[type: 'create', newPage: Page, oldPage: null] | [type: 'delete', newPage: null, oldPage: Page] | [type: 'update', newPage: Page, oldPage: Page]>;
|
|
187
187
|
onGenerated: LifeCycleHook;
|
|
188
188
|
extendsMarkdownOptions: ExtendsHook<MarkdownOptions>;
|
|
189
189
|
extendsMarkdown: ExtendsHook<Markdown>;
|
|
@@ -405,7 +405,7 @@ interface AppConfigCommon extends Partial<SiteData$1> {
|
|
|
405
405
|
/**
|
|
406
406
|
* Patterns to match the markdown files as pages
|
|
407
407
|
*
|
|
408
|
-
* @default ['**\/*.md', '!.vuepress'
|
|
408
|
+
* @default ['**\/*.md', '!.vuepress']
|
|
409
409
|
*/
|
|
410
410
|
pagePatterns?: string[];
|
|
411
411
|
/**
|
|
@@ -560,7 +560,18 @@ interface AppEnv {
|
|
|
560
560
|
/**
|
|
561
561
|
* Write temp file util
|
|
562
562
|
*/
|
|
563
|
-
|
|
563
|
+
interface AppWriteTemp {
|
|
564
|
+
(file: string, content: string): Promise<string>;
|
|
565
|
+
/**
|
|
566
|
+
* Clean up the internal write temp cache.
|
|
567
|
+
*
|
|
568
|
+
* This should be called when the dev server restarts
|
|
569
|
+
* to avoid stale cache and to release references to any
|
|
570
|
+
* in-memory write state so that pending write promises can
|
|
571
|
+
* complete and be garbage-collected naturally.
|
|
572
|
+
*/
|
|
573
|
+
cleanup: () => void;
|
|
574
|
+
}
|
|
564
575
|
//#endregion
|
|
565
576
|
//#region src/types/app/app.d.ts
|
|
566
577
|
/**
|
|
@@ -707,4 +718,7 @@ declare const createPage: (app: App, options: PageOptions) => Promise<Page>;
|
|
|
707
718
|
*/
|
|
708
719
|
declare const renderPageToVue: (app: App, page: Page) => string;
|
|
709
720
|
//#endregion
|
|
710
|
-
|
|
721
|
+
//#region src/constants.d.ts
|
|
722
|
+
declare const DEFAULT_IGNORE_PATTERNS: string[];
|
|
723
|
+
//#endregion
|
|
724
|
+
export { AliasHook, App, AppConfig, AppConfigBuild, AppConfigCommon, AppConfigDev, AppDir, AppDirFunction, AppEnv, AppOptions, AppPropertiesBase, AppPropertiesInitialized, AppWriteTemp, BuildApp, Bundler, BundlerOptions, ClientConfigFileHook, DEFAULT_IGNORE_PATTERNS, DefineHook, DevApp, ExtendsHook, type HeadAttrsConfig, type HeadConfig, type HeadTag, type HeadTagEmpty, type HeadTagNonEmpty, Hook, HookItem, HookQueue, Hooks, HooksExposed, HooksName, HooksNormalized, HooksResult, LifeCycleHook, type LocaleConfig, type LocaleData, Page, type PageData, type PageFrontmatter, type PageHeader, PageOptions, Plugin, PluginApi, PluginConfig, PluginFunction, PluginObject, type SiteData, type SiteLocaleConfig, Theme, ThemeFunction, ThemeInfo, ThemeObject, createBuildApp, createDevApp, createPage, preparePageChunk, prepareRoutes, renderPageToVue, resolveAppDir };
|
package/dist/index.js
CHANGED
|
@@ -513,6 +513,15 @@ const resolveAppMarkdown = async (app) => {
|
|
|
513
513
|
return markdown;
|
|
514
514
|
};
|
|
515
515
|
//#endregion
|
|
516
|
+
//#region src/constants.ts
|
|
517
|
+
const DEFAULT_IGNORE_PATTERNS = [
|
|
518
|
+
"**/node_modules",
|
|
519
|
+
"**/.yarn",
|
|
520
|
+
"**/.git",
|
|
521
|
+
"**/.svn",
|
|
522
|
+
"**/.hg"
|
|
523
|
+
];
|
|
524
|
+
//#endregion
|
|
516
525
|
//#region src/app/resolveAppPages.ts
|
|
517
526
|
const log$4 = debug("vuepress:core/app");
|
|
518
527
|
/**
|
|
@@ -524,7 +533,8 @@ const resolveAppPages = async (app) => {
|
|
|
524
533
|
log$4("resolveAppPages start");
|
|
525
534
|
const pageFilePaths = await tinyglobby.glob(app.options.pagePatterns, {
|
|
526
535
|
absolute: true,
|
|
527
|
-
cwd: app.dir.source()
|
|
536
|
+
cwd: app.dir.source(),
|
|
537
|
+
ignore: DEFAULT_IGNORE_PATTERNS
|
|
528
538
|
});
|
|
529
539
|
let hasNotFoundPage = false;
|
|
530
540
|
const pagesMap = {};
|
|
@@ -799,11 +809,7 @@ const require$1 = createRequire(import.meta.url);
|
|
|
799
809
|
*
|
|
800
810
|
* @internal
|
|
801
811
|
*/
|
|
802
|
-
const resolveAppOptions = ({ base = "/", lang = "en-US", title = "", description = "", head = [], locales = {}, source, dest = path.resolve(source, ".vuepress/dist"), temp = path.resolve(source, ".vuepress/.temp"), cache = path.resolve(source, ".vuepress/.cache"), public: publicDir = path.resolve(source, ".vuepress/public"), host = "0.0.0.0", port = 8080, open = false, templateDev = path.normalize(require$1.resolve("@vuepress/client/templates/dev.html")), shouldPreload = true, shouldPrefetch = true, templateBuild = path.normalize(require$1.resolve("@vuepress/client/templates/build.html")), templateBuildRenderer = templateRenderer, bundler, debug = false, markdown = {}, pagePatterns = [
|
|
803
|
-
"**/*.md",
|
|
804
|
-
"!.vuepress",
|
|
805
|
-
"!node_modules"
|
|
806
|
-
], permalinkPattern = null, plugins = [], theme }) => {
|
|
812
|
+
const resolveAppOptions = ({ base = "/", lang = "en-US", title = "", description = "", head = [], locales = {}, source, dest = path.resolve(source, ".vuepress/dist"), temp = path.resolve(source, ".vuepress/.temp"), cache = path.resolve(source, ".vuepress/.cache"), public: publicDir = path.resolve(source, ".vuepress/public"), host = "0.0.0.0", port = 8080, open = false, templateDev = path.normalize(require$1.resolve("@vuepress/client/templates/dev.html")), shouldPreload = true, shouldPrefetch = true, templateBuild = path.normalize(require$1.resolve("@vuepress/client/templates/build.html")), templateBuildRenderer = templateRenderer, bundler, debug = false, markdown = {}, pagePatterns = ["**/*.md", "!.vuepress"], permalinkPattern = null, plugins = [], theme }) => {
|
|
807
813
|
locales["/"] ??= {
|
|
808
814
|
lang,
|
|
809
815
|
title,
|
|
@@ -875,7 +881,7 @@ const resolveAppVersion = () => {
|
|
|
875
881
|
*/
|
|
876
882
|
const resolveAppWriteTemp = (dir) => {
|
|
877
883
|
const cache = /* @__PURE__ */ new Map();
|
|
878
|
-
const writeTemp = async (file, content) => {
|
|
884
|
+
const writeTemp = (async (file, content) => {
|
|
879
885
|
const filePath = dir.temp(file);
|
|
880
886
|
const contentHash = hash(content);
|
|
881
887
|
let item = cache.get(filePath);
|
|
@@ -894,6 +900,9 @@ const resolveAppWriteTemp = (dir) => {
|
|
|
894
900
|
};
|
|
895
901
|
await item.current;
|
|
896
902
|
return filePath;
|
|
903
|
+
});
|
|
904
|
+
writeTemp.cleanup = () => {
|
|
905
|
+
cache.clear();
|
|
897
906
|
};
|
|
898
907
|
return writeTemp;
|
|
899
908
|
};
|
|
@@ -990,4 +999,4 @@ const createDevApp = (config) => {
|
|
|
990
999
|
return app;
|
|
991
1000
|
};
|
|
992
1001
|
//#endregion
|
|
993
|
-
export { appInit, appPrepare, appUse, createAppDirFunction, createBaseApp, createBuildApp, createDevApp, createHookQueue, createPage, createPluginApi, createPluginApiHooks, createPluginApiRegisterHooks, inferPagePath, normalizeAliasDefineHook, normalizeClientConfigFileHook, parsePageContent, prepareClientConfigs, preparePageChunk, prepareRoutes, prepareSiteData, renderPageToVue, resolveAppDir, resolveAppEnv, resolveAppOptions, resolveAppPages, resolveAppSiteData, resolveAppVersion, resolveAppWriteTemp, resolvePageChunkInfo, resolvePageContent, resolvePageDate, resolvePageFilePath, resolvePageHtmlInfo, resolvePageLang, resolvePagePath, resolvePagePermalink, resolvePageRouteMeta, resolvePageSlug, resolvePluginObject, resolveThemeInfo };
|
|
1002
|
+
export { DEFAULT_IGNORE_PATTERNS, appInit, appPrepare, appUse, createAppDirFunction, createBaseApp, createBuildApp, createDevApp, createHookQueue, createPage, createPluginApi, createPluginApiHooks, createPluginApiRegisterHooks, inferPagePath, normalizeAliasDefineHook, normalizeClientConfigFileHook, parsePageContent, prepareClientConfigs, preparePageChunk, prepareRoutes, prepareSiteData, renderPageToVue, resolveAppDir, resolveAppEnv, resolveAppOptions, resolveAppPages, resolveAppSiteData, resolveAppVersion, resolveAppWriteTemp, resolvePageChunkInfo, resolvePageContent, resolvePageDate, resolvePageFilePath, resolvePageHtmlInfo, resolvePageLang, resolvePagePath, resolvePagePermalink, resolvePageRouteMeta, resolvePageSlug, resolvePluginObject, resolveThemeInfo };
|
package/package.json
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuepress/core",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.28",
|
|
4
4
|
"description": "Core package of VuePress",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"
|
|
7
|
-
"
|
|
6
|
+
"core",
|
|
7
|
+
"vuepress"
|
|
8
8
|
],
|
|
9
9
|
"homepage": "https://github.com/vuepress",
|
|
10
10
|
"bugs": {
|
|
11
11
|
"url": "https://github.com/vuepress/core/issues"
|
|
12
12
|
},
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"author": "meteorlxy",
|
|
13
15
|
"repository": {
|
|
14
16
|
"type": "git",
|
|
15
17
|
"url": "git+https://github.com/vuepress/core.git"
|
|
16
18
|
},
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
19
22
|
"type": "module",
|
|
20
|
-
"exports": {
|
|
21
|
-
".": "./dist/index.js",
|
|
22
|
-
"./package.json": "./package.json"
|
|
23
|
-
},
|
|
24
23
|
"main": "./dist/index.js",
|
|
25
24
|
"module": "./dist/index.js",
|
|
26
25
|
"types": "./dist/index.d.ts",
|
|
27
|
-
"
|
|
28
|
-
"dist"
|
|
29
|
-
|
|
30
|
-
"dependencies": {
|
|
31
|
-
"vue": "^3.5.29",
|
|
32
|
-
"@vuepress/client": "2.0.0-rc.27",
|
|
33
|
-
"@vuepress/markdown": "2.0.0-rc.27",
|
|
34
|
-
"@vuepress/utils": "2.0.0-rc.27",
|
|
35
|
-
"@vuepress/shared": "2.0.0-rc.27"
|
|
26
|
+
"exports": {
|
|
27
|
+
".": "./dist/index.js",
|
|
28
|
+
"./package.json": "./package.json"
|
|
36
29
|
},
|
|
37
30
|
"publishConfig": {
|
|
38
31
|
"access": "public"
|
|
39
32
|
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"vue": "^3.5.31",
|
|
35
|
+
"@vuepress/client": "2.0.0-rc.28",
|
|
36
|
+
"@vuepress/markdown": "2.0.0-rc.28",
|
|
37
|
+
"@vuepress/shared": "2.0.0-rc.28",
|
|
38
|
+
"@vuepress/utils": "2.0.0-rc.28"
|
|
39
|
+
},
|
|
40
40
|
"tsdown": {
|
|
41
|
-
"entry": "./src/index.ts",
|
|
42
41
|
"dts": true,
|
|
42
|
+
"entry": "./src/index.ts",
|
|
43
|
+
"fixedExtension": false,
|
|
43
44
|
"format": "esm",
|
|
44
45
|
"target": "es2023",
|
|
45
|
-
"fixedExtension": false,
|
|
46
46
|
"tsconfig": "../../tsconfig.dts.json"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|