@vuepress/core 2.0.0-beta.66 → 2.0.0-beta.68

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 CHANGED
@@ -1,6 +1,7 @@
1
1
  import { MarkdownLink, MarkdownSfcBlocks, MarkdownOptions, Markdown, MarkdownHeader } from '@vuepress/markdown';
2
2
  import { PageBase, PageData, PageFrontmatter, SiteData } from '@vuepress/shared';
3
3
  export { HeadAttrsConfig, HeadConfig, HeadTag, HeadTagEmpty, HeadTagNonEmpty, LocaleConfig, LocaleData, PageData, PageFrontmatter, PageHeader, SiteData, SiteLocaleConfig } from '@vuepress/shared';
4
+ import { TemplateRenderer } from '@vuepress/utils';
4
5
 
5
6
  /**
6
7
  * Vuepress bundler
@@ -163,14 +164,14 @@ interface PageOptions {
163
164
  }
164
165
 
165
166
  type PromiseOrNot<T> = Promise<T> | T;
166
- type Closable = {
167
+ interface Closable {
167
168
  close(): void;
168
- };
169
- type Hook<Exposed, Normalized = Exposed, Result = Normalized extends (...args: any) => infer U ? U extends Promise<infer V> ? V : U : void> = {
169
+ }
170
+ interface Hook<Exposed, Normalized = Exposed, Result = Normalized extends (...args: any) => infer U ? U extends Promise<infer V> ? V : U : void> {
170
171
  exposed: Exposed;
171
172
  normalized: Normalized;
172
173
  result: Result;
173
- };
174
+ }
174
175
  type LifeCycleHook<T extends unknown[] = []> = Hook<(app: App, ...args: T) => PromiseOrNot<void>>;
175
176
  type ExtendsHook<T> = Hook<(extendable: T, app: App) => PromiseOrNot<void>>;
176
177
  type ClientConfigFileHook = Hook<string | ((app: App) => PromiseOrNot<string>), (app: App) => Promise<string>>;
@@ -311,6 +312,10 @@ interface ThemeObject extends Omit<PluginObject, 'multiple'> {
311
312
  * Allow overriding default templateBuild
312
313
  */
313
314
  templateBuild?: string;
315
+ /**
316
+ * Allow specifying custom template renderer
317
+ */
318
+ templateBuildRenderer?: TemplateRenderer;
314
319
  /**
315
320
  * Allow overriding default templateDev
316
321
  */
@@ -328,6 +333,10 @@ interface ThemeInfo {
328
333
  * Default build template
329
334
  */
330
335
  templateBuild?: string;
336
+ /**
337
+ * Default build template renderer
338
+ */
339
+ templateBuildRenderer?: TemplateRenderer;
331
340
  /**
332
341
  * Default dev template
333
342
  */
@@ -404,6 +413,12 @@ interface AppConfigBuild {
404
413
  * @default '@vuepress/client/templates/build.html'
405
414
  */
406
415
  templateBuild?: string;
416
+ /**
417
+ * Specify the HTML template renderer to be used for build
418
+ *
419
+ * @default templateRenderer from '@vuepress/utils'
420
+ */
421
+ templateBuildRenderer?: TemplateRenderer;
407
422
  }
408
423
  /**
409
424
  * Vuepress app config
package/dist/index.js CHANGED
@@ -1,8 +1,6 @@
1
1
  // src/app/prepare/prepareClientConfigs.ts
2
2
  var prepareClientConfigs = async (app) => {
3
- const clientConfigFiles = await app.pluginApi.hooks.clientConfigFile.process(
4
- app
5
- );
3
+ const clientConfigFiles = await app.pluginApi.hooks.clientConfigFile.process(app);
6
4
  const content = `${clientConfigFiles.map((filePath, index) => `import clientConfig${index} from '${filePath}'`).join("\n")}
7
5
 
8
6
  export const clientConfigs = [
@@ -825,7 +823,7 @@ var resolveAppEnv = (options, isBuild) => ({
825
823
 
826
824
  // src/app/resolveAppOptions.ts
827
825
  import { createRequire as createRequire2 } from "module";
828
- import { path as path8 } from "@vuepress/utils";
826
+ import { path as path8, templateRenderer } from "@vuepress/utils";
829
827
  var require3 = createRequire2(import.meta.url);
830
828
  var resolveAppOptions = ({
831
829
  // site config
@@ -881,6 +879,7 @@ var resolveAppOptions = ({
881
879
  shouldPreload,
882
880
  shouldPrefetch,
883
881
  templateBuild,
882
+ templateBuildRenderer: templateRenderer,
884
883
  bundler,
885
884
  debug: debug7,
886
885
  markdown,
@@ -928,6 +927,7 @@ var resolveThemeInfo = (app, theme) => {
928
927
  const themeInfo = {
929
928
  plugins: [...themeObject.plugins ?? [], themeObject],
930
929
  templateBuild: themeObject.templateBuild,
930
+ templateBuildRenderer: themeObject.templateBuildRenderer,
931
931
  templateDev: themeObject.templateDev
932
932
  };
933
933
  if (!themeObject.extends) {
@@ -937,6 +937,7 @@ var resolveThemeInfo = (app, theme) => {
937
937
  return {
938
938
  plugins: [...parentThemeInfo.plugins, ...themeInfo.plugins],
939
939
  templateBuild: themeObject.templateBuild ?? parentThemeInfo.templateBuild,
940
+ templateBuildRenderer: themeObject.templateBuildRenderer ?? parentThemeInfo.templateBuildRenderer,
940
941
  templateDev: themeObject.templateDev ?? parentThemeInfo.templateDev
941
942
  };
942
943
  };
@@ -946,6 +947,7 @@ var setupAppThemeAndPlugins = (app, config) => {
946
947
  const themeInfo = resolveThemeInfo(app, app.options.theme);
947
948
  app.options.templateDev = config.templateDev ?? themeInfo.templateDev ?? app.options.templateDev;
948
949
  app.options.templateBuild = config.templateBuild ?? themeInfo.templateBuild ?? app.options.templateBuild;
950
+ app.options.templateBuildRenderer = config.templateBuildRenderer ?? themeInfo.templateBuildRenderer ?? app.options.templateBuildRenderer;
949
951
  [...themeInfo.plugins, ...app.options.plugins].flat().forEach((plugin) => app.use(plugin));
950
952
  };
951
953
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/core",
3
- "version": "2.0.0-beta.66",
3
+ "version": "2.0.0-beta.68",
4
4
  "description": "Core package of VuePress",
5
5
  "keywords": [
6
6
  "vuepress",
@@ -27,11 +27,11 @@
27
27
  "dist"
28
28
  ],
29
29
  "dependencies": {
30
- "vue": "^3.3.4",
31
- "@vuepress/client": "2.0.0-beta.66",
32
- "@vuepress/markdown": "2.0.0-beta.66",
33
- "@vuepress/shared": "2.0.0-beta.66",
34
- "@vuepress/utils": "2.0.0-beta.66"
30
+ "vue": "^3.3.8",
31
+ "@vuepress/markdown": "2.0.0-beta.68",
32
+ "@vuepress/client": "2.0.0-beta.68",
33
+ "@vuepress/utils": "2.0.0-beta.68",
34
+ "@vuepress/shared": "2.0.0-beta.68"
35
35
  },
36
36
  "publishConfig": {
37
37
  "access": "public"
@@ -47,7 +47,7 @@
47
47
  ],
48
48
  "outDir": "./dist",
49
49
  "sourcemap": false,
50
- "target": "es2020",
50
+ "target": "es2022",
51
51
  "tsconfig": "../tsconfig.dts.json"
52
52
  },
53
53
  "scripts": {