valaxy 0.28.8 → 0.28.10

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.
@@ -1,7 +1,7 @@
1
1
  import 'node:process';
2
2
  import 'yargs';
3
3
  import 'yargs/helpers';
4
- export { c as cli, J as registerDevCommand, X as run, _ as startValaxyDev } from '../../shared/valaxy.DidkCApI.mjs';
4
+ export { c as cli, J as registerDevCommand, X as run, _ as startValaxyDev } from '../../shared/valaxy.DbAZGdnY.mjs';
5
5
  import 'node:os';
6
6
  import 'node:path';
7
7
  import 'consola';
@@ -1,4 +1,4 @@
1
- export { A as ALL_ROUTE, E as EXCERPT_SEPARATOR, G as GLOBAL_STATE, P as PATHNAME_PROTOCOL_RE, V as ViteValaxyPlugins, b as build, c as cli, a as createServer, d as createValaxyPlugin, e as customElements, f as defaultSiteConfig, g as defaultValaxyConfig, h as defaultViteConfig, i as defineAddon, j as defineConfig, k as defineSiteConfig, l as defineTheme, m as defineValaxyAddon, n as defineValaxyConfig, o as defineValaxyTheme, p as encryptContent, q as fixViteSsgHtml, r as generateClientRedirects, s as getGitTimestamp, t as getIndexHtml, u as getServerInfoText, v as isExternal, w as isInstalledGlobally, x as isKatexEnabled, y as isKatexPluginNeeded, z as isMathJaxEnabled, B as isPath, C as loadConfigFromFile, D as mergeValaxyConfig, F as mergeViteConfigs, H as postProcessForSSG, I as processValaxyOptions, J as registerDevCommand, K as resolveAddonsConfig, L as resolveImportPath, M as resolveImportUrl, N as resolveOptions, O as resolveSiteConfig, Q as resolveSiteConfigFromRoot, R as resolveThemeConfigFromRoot, S as resolveThemeValaxyConfig, T as resolveUserThemeConfig, U as resolveValaxyConfig, W as resolveValaxyConfigFromRoot, X as run, Y as ssgBuild, Z as ssgBuildLegacy, _ as startValaxyDev, $ as toAtFS, a0 as transformObject, a1 as version } from '../shared/valaxy.DidkCApI.mjs';
1
+ export { A as ALL_ROUTE, E as EXCERPT_SEPARATOR, G as GLOBAL_STATE, P as PATHNAME_PROTOCOL_RE, V as ViteValaxyPlugins, b as build, c as cli, a as createServer, d as createValaxyPlugin, e as customElements, f as defaultSiteConfig, g as defaultValaxyConfig, h as defaultViteConfig, i as defineAddon, j as defineConfig, k as defineSiteConfig, l as defineTheme, m as defineValaxyAddon, n as defineValaxyConfig, o as defineValaxyTheme, p as encryptContent, q as fixViteSsgHtml, r as generateClientRedirects, s as getGitTimestamp, t as getIndexHtml, u as getServerInfoText, v as isExternal, w as isInstalledGlobally, x as isKatexEnabled, y as isKatexPluginNeeded, z as isMathJaxEnabled, B as isPath, C as loadConfigFromFile, D as mergeValaxyConfig, F as mergeViteConfigs, H as postProcessForSSG, I as processValaxyOptions, J as registerDevCommand, K as resolveAddonsConfig, L as resolveImportPath, M as resolveImportUrl, N as resolveOptions, O as resolveSiteConfig, Q as resolveSiteConfigFromRoot, R as resolveThemeConfigFromRoot, S as resolveThemeValaxyConfig, T as resolveUserThemeConfig, U as resolveValaxyConfig, W as resolveValaxyConfigFromRoot, X as run, Y as ssgBuild, Z as ssgBuildLegacy, _ as startValaxyDev, $ as toAtFS, a0 as transformObject, a1 as version } from '../shared/valaxy.DbAZGdnY.mjs';
2
2
  import 'node:path';
3
3
  import 'consola';
4
4
  import 'fs-extra';
@@ -1751,7 +1751,7 @@ async function setupMarkdownPlugins(md, options, base = "/") {
1751
1751
  return md;
1752
1752
  }
1753
1753
 
1754
- const version = "0.28.8";
1754
+ const version = "0.28.10";
1755
1755
 
1756
1756
  const GLOBAL_STATE = {
1757
1757
  valaxyApp: void 0,
@@ -2429,7 +2429,13 @@ function createConfigPlugin(options) {
2429
2429
  define: mergedDefine,
2430
2430
  resolve: {
2431
2431
  alias: await getAlias(options),
2432
- dedupe: ["vue"]
2432
+ // Dedupe the shared singletons that valaxy owns (it calls `createApp`,
2433
+ // `createRouter`, `createPinia`, `createI18n`) but themes/addons also
2434
+ // import. A second physical copy — e.g. resolved from a theme/addon that
2435
+ // doesn't surface valaxy's copy under pnpm — would mean `useI18n()` /
2436
+ // stores read a different instance than the one valaxy registered,
2437
+ // breaking translations / state. Forcing a single instance avoids that.
2438
+ dedupe: ["vue", "vue-router", "vue-i18n", "pinia"]
2433
2439
  },
2434
2440
  optimizeDeps: {
2435
2441
  // do not entry node file
@@ -2489,6 +2495,9 @@ async function getAlias(options) {
2489
2495
  { find: /^vue$/, replacement: await resolveImportPath("vue/dist/vue.esm-bundler.js", true) }
2490
2496
  );
2491
2497
  }
2498
+ const vueRouterPkg = await resolveImportPath("vue-router/package.json");
2499
+ if (vueRouterPkg)
2500
+ alias.push({ find: /^vue-router$/, replacement: dirname(vueRouterPkg) });
2492
2501
  options.addons.forEach((addon) => {
2493
2502
  alias.push({
2494
2503
  find: `${addon.name}/client/`,
@@ -4939,6 +4948,9 @@ function routesToPaths(routes) {
4939
4948
  function defaultIncludedRoutes(paths) {
4940
4949
  return paths.filter((i) => !i.includes(":") && !i.includes("*"));
4941
4950
  }
4951
+ function getSsgSsrConfig() {
4952
+ return { noExternal: true };
4953
+ }
4942
4954
  async function ssgBuild(valaxyApp, viteConfig = {}, userSsgOptions = {}) {
4943
4955
  const { options } = valaxyApp;
4944
4956
  if (!process.env.__VALAXY_SSG_NO_RESPAWN__) {
@@ -4975,16 +4987,15 @@ async function ssgBuild(valaxyApp, viteConfig = {}, userSsgOptions = {}) {
4975
4987
  }
4976
4988
  }
4977
4989
  }
4978
- const cdnModuleNames = (options.config.cdn?.modules || []).map((m) => m.name);
4979
4990
  const configOutDir = viteConfig.build?.outDir || "dist";
4980
4991
  const outDir = isAbsolute(configOutDir) ? configOutDir : resolve$1(options.userRoot, configOutDir);
4981
4992
  const ssgTemp = resolve$1(outDir, ".vite-ssg-temp");
4982
4993
  const defaultConfig = {
4983
4994
  ...defaultViteConfig,
4984
4995
  plugins: await ViteValaxyPlugins(valaxyApp),
4985
- ssr: {
4986
- noExternal: ["workbox-window", /vue-i18n/, "@vue/devtools-api", ...cdnModuleNames]
4987
- },
4996
+ // `ssr.noExternal` only affects the server build (step 2) — the client build
4997
+ // ignores it. See `getSsgSsrConfig` for why everything is bundled.
4998
+ ssr: getSsgSsrConfig(),
4988
4999
  build: {
4989
5000
  sourcemap: false,
4990
5001
  // Explicitly disable watch to prevent chokidar from opening too many
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "valaxy",
3
3
  "type": "module",
4
- "version": "0.28.8",
4
+ "version": "0.28.10",
5
5
  "description": "📄 Vite & Vue powered static blog generator.",
6
6
  "author": {
7
7
  "email": "me@yunyoujun.cn",
@@ -59,6 +59,10 @@
59
59
  "engines": {
60
60
  "node": "^18.0.0 || >=20.0.0"
61
61
  },
62
+ "peerDependencies": {
63
+ "vue": "^3.5.0",
64
+ "vue-router": "^5.0.0"
65
+ },
62
66
  "dependencies": {
63
67
  "@antfu/install-pkg": "^1.1.0",
64
68
  "@antfu/utils": "^9.3.0",
@@ -135,12 +139,10 @@
135
139
  "vite-ssg": "^28.3.0",
136
140
  "vite-ssg-sitemap": "^0.10.0",
137
141
  "vitepress-plugin-group-icons": "^1.7.5",
138
- "vue": "3.5.22",
139
142
  "vue-i18n": "^11.4.2",
140
- "vue-router": "^5.0.6",
141
143
  "yargs": "^18.0.0",
142
- "@valaxyjs/devtools": "0.28.8",
143
- "@valaxyjs/utils": "0.28.8"
144
+ "@valaxyjs/devtools": "0.28.10",
145
+ "@valaxyjs/utils": "0.28.10"
144
146
  },
145
147
  "devDependencies": {
146
148
  "@mdit-vue/plugin-component": "^3.0.2",
@@ -165,7 +167,9 @@
165
167
  "https-localhost": "^4.7.1",
166
168
  "nanoid": "^5.1.11",
167
169
  "rollup-plugin-visualizer": "^7.0.1",
168
- "unbuild": "^3.6.1"
170
+ "unbuild": "^3.6.1",
171
+ "vue": "3.5.22",
172
+ "vue-router": "^5.0.6"
169
173
  },
170
174
  "scripts": {
171
175
  "clean": "rimraf dist",