@vuepress/core 2.0.0-beta.67 → 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
@@ -823,7 +823,7 @@ var resolveAppEnv = (options, isBuild) => ({
823
823
 
824
824
  // src/app/resolveAppOptions.ts
825
825
  import { createRequire as createRequire2 } from "module";
826
- import { path as path8 } from "@vuepress/utils";
826
+ import { path as path8, templateRenderer } from "@vuepress/utils";
827
827
  var require3 = createRequire2(import.meta.url);
828
828
  var resolveAppOptions = ({
829
829
  // site config
@@ -879,6 +879,7 @@ var resolveAppOptions = ({
879
879
  shouldPreload,
880
880
  shouldPrefetch,
881
881
  templateBuild,
882
+ templateBuildRenderer: templateRenderer,
882
883
  bundler,
883
884
  debug: debug7,
884
885
  markdown,
@@ -926,6 +927,7 @@ var resolveThemeInfo = (app, theme) => {
926
927
  const themeInfo = {
927
928
  plugins: [...themeObject.plugins ?? [], themeObject],
928
929
  templateBuild: themeObject.templateBuild,
930
+ templateBuildRenderer: themeObject.templateBuildRenderer,
929
931
  templateDev: themeObject.templateDev
930
932
  };
931
933
  if (!themeObject.extends) {
@@ -935,6 +937,7 @@ var resolveThemeInfo = (app, theme) => {
935
937
  return {
936
938
  plugins: [...parentThemeInfo.plugins, ...themeInfo.plugins],
937
939
  templateBuild: themeObject.templateBuild ?? parentThemeInfo.templateBuild,
940
+ templateBuildRenderer: themeObject.templateBuildRenderer ?? parentThemeInfo.templateBuildRenderer,
938
941
  templateDev: themeObject.templateDev ?? parentThemeInfo.templateDev
939
942
  };
940
943
  };
@@ -944,6 +947,7 @@ var setupAppThemeAndPlugins = (app, config) => {
944
947
  const themeInfo = resolveThemeInfo(app, app.options.theme);
945
948
  app.options.templateDev = config.templateDev ?? themeInfo.templateDev ?? app.options.templateDev;
946
949
  app.options.templateBuild = config.templateBuild ?? themeInfo.templateBuild ?? app.options.templateBuild;
950
+ app.options.templateBuildRenderer = config.templateBuildRenderer ?? themeInfo.templateBuildRenderer ?? app.options.templateBuildRenderer;
947
951
  [...themeInfo.plugins, ...app.options.plugins].flat().forEach((plugin) => app.use(plugin));
948
952
  };
949
953
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/core",
3
- "version": "2.0.0-beta.67",
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.67",
32
- "@vuepress/markdown": "2.0.0-beta.67",
33
- "@vuepress/utils": "2.0.0-beta.67",
34
- "@vuepress/shared": "2.0.0-beta.67"
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": {