@vuepress/core 2.0.0-rc.28 → 2.0.0-rc.29

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
@@ -322,6 +322,10 @@ interface ThemeObject extends Omit<PluginObject, 'multiple'> {
322
322
  * Allow overriding default templateDev
323
323
  */
324
324
  templateDev?: string;
325
+ /**
326
+ * Allow specifying user styles, which will be injected into client at the bottom
327
+ */
328
+ userStyle?: string;
325
329
  }
326
330
  /**
327
331
  * Resolved theme info
@@ -343,6 +347,10 @@ interface ThemeInfo {
343
347
  * Default dev template
344
348
  */
345
349
  templateDev?: string;
350
+ /**
351
+ * Allow specifying user styles, which will be injected into client at the bottom
352
+ */
353
+ userStyle?: string;
346
354
  }
347
355
  //#endregion
348
356
  //#region src/types/app/options.d.ts
@@ -414,6 +422,10 @@ interface AppConfigCommon extends Partial<SiteData$1> {
414
422
  * @default null
415
423
  */
416
424
  permalinkPattern?: string | null;
425
+ /**
426
+ * Allow specifying user styles, which will be injected into client at the bottom
427
+ */
428
+ userStyle?: string | null;
417
429
  /**
418
430
  * Vuepress bundler
419
431
  *
package/dist/index.js CHANGED
@@ -12,6 +12,7 @@ const prepareClientConfigs = async (app) => {
12
12
  const clientConfigFiles = await app.pluginApi.hooks.clientConfigFile.process(app);
13
13
  const content = `\
14
14
  ${clientConfigFiles.map((filePath, index) => `import * as clientConfig${index} from '${filePath}'`).join("\n")}
15
+ ${app.options.userStyle ? `\nimport '${app.options.userStyle}'` : ""}
15
16
 
16
17
  export const clientConfigs = [
17
18
  ${clientConfigFiles.map((_, index) => ` clientConfig${index},`).join("\n")}
@@ -809,7 +810,7 @@ const require$1 = createRequire(import.meta.url);
809
810
  *
810
811
  * @internal
811
812
  */
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 }) => {
813
+ 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, userStyle = null, plugins = [], theme }) => {
813
814
  locales["/"] ??= {
814
815
  lang,
815
816
  title,
@@ -840,6 +841,7 @@ const resolveAppOptions = ({ base = "/", lang = "en-US", title = "", description
840
841
  markdown,
841
842
  pagePatterns,
842
843
  permalinkPattern,
844
+ userStyle,
843
845
  plugins,
844
846
  theme
845
847
  };
@@ -949,7 +951,8 @@ const resolveThemeInfo = (app, theme) => {
949
951
  plugins: [...themeObject.plugins ?? [], themeObject],
950
952
  templateBuild: themeObject.templateBuild,
951
953
  templateBuildRenderer: themeObject.templateBuildRenderer,
952
- templateDev: themeObject.templateDev
954
+ templateDev: themeObject.templateDev,
955
+ userStyle: themeObject.userStyle
953
956
  };
954
957
  if (!themeObject.extends) return themeInfo;
955
958
  const parentThemeInfo = resolveThemeInfo(app, themeObject.extends);
@@ -957,7 +960,8 @@ const resolveThemeInfo = (app, theme) => {
957
960
  plugins: [...parentThemeInfo.plugins, ...themeInfo.plugins],
958
961
  templateBuild: themeObject.templateBuild ?? parentThemeInfo.templateBuild,
959
962
  templateBuildRenderer: themeObject.templateBuildRenderer ?? parentThemeInfo.templateBuildRenderer,
960
- templateDev: themeObject.templateDev ?? parentThemeInfo.templateDev
963
+ templateDev: themeObject.templateDev ?? parentThemeInfo.templateDev,
964
+ userStyle: themeObject.userStyle ?? parentThemeInfo.userStyle
961
965
  };
962
966
  };
963
967
  //#endregion
@@ -972,6 +976,7 @@ const setupAppThemeAndPlugins = (app, config) => {
972
976
  app.options.templateDev = config.templateDev ?? themeInfo.templateDev ?? app.options.templateDev;
973
977
  app.options.templateBuild = config.templateBuild ?? themeInfo.templateBuild ?? app.options.templateBuild;
974
978
  app.options.templateBuildRenderer = config.templateBuildRenderer ?? themeInfo.templateBuildRenderer ?? app.options.templateBuildRenderer;
979
+ app.options.userStyle = config.userStyle ?? themeInfo.userStyle ?? app.options.userStyle;
975
980
  [...themeInfo.plugins, ...app.options.plugins].flat().forEach((plugin) => app.use(plugin));
976
981
  };
977
982
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/core",
3
- "version": "2.0.0-rc.28",
3
+ "version": "2.0.0-rc.29",
4
4
  "description": "Core package of VuePress",
5
5
  "keywords": [
6
6
  "core",
@@ -31,11 +31,11 @@
31
31
  "access": "public"
32
32
  },
33
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"
34
+ "vue": "^3.5.34",
35
+ "@vuepress/client": "2.0.0-rc.29",
36
+ "@vuepress/markdown": "2.0.0-rc.29",
37
+ "@vuepress/shared": "2.0.0-rc.29",
38
+ "@vuepress/utils": "2.0.0-rc.29"
39
39
  },
40
40
  "tsdown": {
41
41
  "dts": true,