@bndynet/vue-site 0.1.5 → 0.1.7

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/bin/vue-site.mjs CHANGED
@@ -175,6 +175,8 @@ function buildEntryCode(siteConfig) {
175
175
  : ''
176
176
  return [
177
177
  bootstrapImport,
178
+ `import 'element-plus/dist/index.css'`,
179
+ `import 'element-plus/theme-chalk/dark/css-vars.css'`,
178
180
  `import { createSiteApp } from '${pkgDir.replace(/\\/g, '/')}/dist/index.es.js'`,
179
181
  `import '${pkgDir.replace(/\\/g, '/')}/dist/style.css'`,
180
182
  `import siteConfig from '/${foundConfig}'`,
@@ -386,6 +388,23 @@ async function buildViteConfig(options = {}) {
386
388
  'vue-router': resolve(vueRouterPath, 'dist/vue-router.mjs'),
387
389
  },
388
390
  },
391
+ optimizeDeps: {
392
+ // dayjs ships a UMD browser build (dayjs.min.js) which has no ESM default
393
+ // export. Listing it here forces Vite to pre-bundle it into a proper ESM
394
+ // module before the browser requests it — preventing the
395
+ // "does not provide an export named 'default'" SyntaxError from Element Plus.
396
+ include: [
397
+ 'dayjs',
398
+ 'dayjs/plugin/localeData',
399
+ 'dayjs/plugin/advancedFormat',
400
+ 'dayjs/plugin/customParseFormat',
401
+ 'dayjs/plugin/weekOfYear',
402
+ 'dayjs/plugin/weekYear',
403
+ 'dayjs/plugin/dayOfYear',
404
+ 'dayjs/plugin/isSameOrAfter',
405
+ 'dayjs/plugin/isSameOrBefore',
406
+ ],
407
+ },
389
408
  server: {
390
409
  open: true,
391
410
  ...(port != null && { port }),
@@ -433,7 +452,9 @@ async function run() {
433
452
  <body>
434
453
  <div id="app"></div>
435
454
  <script type="module">
436
- ${bootstrapImport}import { createSiteApp } from '${pkgDir.replace(/\\/g, '/')}/dist/index.es.js'
455
+ ${bootstrapImport}import 'element-plus/dist/index.css'
456
+ import 'element-plus/theme-chalk/dark/css-vars.css'
457
+ import { createSiteApp } from '${pkgDir.replace(/\\/g, '/')}/dist/index.es.js'
437
458
  import '${pkgDir.replace(/\\/g, '/')}/dist/style.css'
438
459
  import siteConfig from './${foundConfig}'
439
460
  import { repositoryUrl } from '${VIRTUAL_PACKAGE}'
@@ -7,8 +7,9 @@ export declare const themeRefKey: InjectionKey<Ref<string>>;
7
7
  * @param themeIds — full list of allowed ids (built-in `light`/`dark` plus any `extraThemes`)
8
8
  * @param palettes — resolved CSS variable maps per id
9
9
  * @param overlay — optional `:root` overrides applied after the active palette
10
+ * @param darkThemeIds — set of theme ids considered "dark" (toggles `html.dark` for Element Plus)
10
11
  */
11
- export declare function initTheme(themeRef: Ref<string>, defaultMode?: string, themeIds?: readonly string[], palettes?: Record<string, Record<string, string>>, overlay?: Record<string, string>): void;
12
+ export declare function initTheme(themeRef: Ref<string>, defaultMode?: string, themeIds?: readonly string[], palettes?: Record<string, Record<string, string>>, overlay?: Record<string, string>, darkThemeIds?: ReadonlySet<string>): void;
12
13
  export declare function useTheme(): {
13
14
  theme: Ref<string, string>;
14
15
  setTheme: (mode: string) => void;
package/dist/index.d.ts CHANGED
@@ -3,5 +3,6 @@ export { createSiteApp } from './create-app';
3
3
  export { useTheme, themeRefKey } from './composables/useTheme';
4
4
  export { useSiteConfig } from './composables/useSiteConfig';
5
5
  export { builtinThemePalettes } from './theme/presets';
6
+ export { ElMessage, ElMessageBox, ElNotification, } from 'element-plus';
6
7
  export type { SiteConfig, SiteEnvConfig, SiteViteConfig, SiteExternalLink, NavItem, ThemeConfig, ThemeOption, ThemePaletteVars, ResolvedNavItem, } from './types';
7
8
  export declare function defineConfig(config: SiteConfig): SiteConfig;