ubean 0.1.6 → 0.1.8
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 +2 -2
- package/dist/index.js +2 -2
- package/dist/vite.d.ts +7 -13
- package/dist/vite.js +10 -37
- package/package.json +29 -29
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InternalFetchOptions, PageAssetTags, PageRenderer, defineDataKey } from "@ubean/pages";
|
|
2
2
|
import { rawSql as sqlRawAlias } from "@ubean/server";
|
|
3
3
|
import { useRouter } from "@ubean/routing";
|
|
4
|
-
import { AppPluginConfig, CreateUbeanRouterOptions, DataCacheStore, DefineAppOptions, Head, HeadClient, HydrateIslandsOptions, IslandHydrateOptions, IslandRecord, Link, LinkProps, PageView, ResolvedAppConfig, RouteLocation, RouteLocationRaw, TypedLinkProps, UbeanAppInstance, UbeanVueContext, UseAsyncDataOptions, UseAsyncDataReturn, UseCacheViewsReturn, UsePageTransitionReturn, UseReloadSignalReturn, ViewTransitionOptions, VueHeadClient, VueI18nInstance, addLocale as addVueLocale, applyAppConfig, clearCache, clearLocales as clearVueLocales, clearPageTransition, collectIslands, createDataCacheStore, createDefaultAppConfig, createLinkHandler, createUbeanRouter, createUbeanSSRApp, createUseAsyncData, defineApp, defineLocale as defineVueLocale, defineMeta, definePage, detectBrowserLocale as detectVueBrowserLocale, detectLocale as detectVueLocale, disablePageCache, enablePageCache, excludePageCache, extractLocaleFromPath as extractVueLocaleFromPath, extractPageData, getCacheEnabled, getCachedViewNames, getDefaultLocale as getDefaultVueLocale, getExcludedViewNames, getI18nConfig as getVueI18nConfig, getInitialPageData, getLocale as getVueLocale, getLocaleDir as getVueLocaleDir, getLocaleName as getVueLocaleName, getNavigationType, getPageTransitionName, getRegisteredLocales as getVueRegisteredLocales, getReloadCounter, hydrateIsland, hydrateIslands, includePageCache, initCachedViewsFromRoutes, injectHead, invalidateCache, invalidatePageCache, isActiveRoute, isCacheEnabled, isPageCached, isPageExcluded, isReloading, localizePath as localizeVuePath, mergeLocale as mergeVueLocale, onLocaleChange as onVueLocaleChange, reloadPage, resetRouteCache, resolveRoute, setI18nConfig as setVueI18nConfig, setLocale as setVueLocale, setPageTransition, supportsViewTransitions, switchLocalePath as switchVueLocalePath, t as tVue, useCacheViews, useHead, useHeadInstance, useI18n as useVueI18n, useLocalePath, usePage, usePageTransition, useReloadSignal, useServerData, useSwitchLocalePath, useViewTransition, useViewTransitionState, withViewTransition } from "@ubean/runtime";
|
|
4
|
+
import { AppPluginConfig, CreateUbeanRouterOptions, DataCacheStore, DefineAppOptions, Head, HeadClient, HydrateIslandsOptions, IslandHydrateOptions, IslandRecord, Link, LinkProps, PageView, ResolvedAppConfig, RouteLocation, RouteLocationRaw, TypedLinkProps, UbeanAppInstance, UbeanVueContext, UseAsyncDataOptions, UseAsyncDataReturn, UseCacheViewsReturn, UsePageTransitionReturn, UseReloadSignalReturn, ViewTransitionOptions, VueHeadClient, VueI18nInstance, addLocale as addVueLocale, applyAppConfig, clearCache, clearLocales as clearVueLocales, clearPageTransition, collectIslands, createDataCacheStore, createDefaultAppConfig, createLinkHandler, createUbeanRouter, createUbeanSSRApp, createUseAsyncData, defineApp, defineLocale as defineVueLocale, defineMeta, definePage, detectBrowserLocale as detectVueBrowserLocale, detectLocale as detectVueLocale, disablePageCache, enablePageCache, excludePageCache, extractLocaleFromPath as extractVueLocaleFromPath, extractPageData, getCacheEnabled, getCachedViewNames, getDefaultLocale as getDefaultVueLocale, getExcludedViewNames, getI18nConfig as getVueI18nConfig, getInitialPageData, getInitialState, getLocale as getVueLocale, getLocaleDir as getVueLocaleDir, getLocaleName as getVueLocaleName, getNavigationType, getPageTransitionName, getRegisteredLocales as getVueRegisteredLocales, getReloadCounter, hydrateIsland, hydrateIslands, includePageCache, initCachedViewsFromRoutes, injectHead, invalidateCache, invalidatePageCache, isActiveRoute, isCacheEnabled, isPageCached, isPageExcluded, isReloading, localizePath as localizeVuePath, mergeAppConfig, mergeLocale as mergeVueLocale, onLocaleChange as onVueLocaleChange, reloadPage, resetRouteCache, resolveRoute, setI18nConfig as setVueI18nConfig, setLocale as setVueLocale, setPageTransition, supportsViewTransitions, switchLocalePath as switchVueLocalePath, t as tVue, useCacheViews, useHead, useHeadInstance, useI18n as useVueI18n, useLocalePath, usePage, usePageTransition, useReloadSignal, useServerData, useSwitchLocalePath, useViewTransition, useViewTransitionState, withViewTransition } from "@ubean/runtime";
|
|
5
5
|
import { UbeanPluginOptions as UbeanCorePluginOptions, ubeanPlugin, ubeanPlugin as ubeanCorePlugin } from "@ubean/build/vite";
|
|
6
6
|
import { UbeanVuePluginOptions, VUE_PLUGIN_INCLUDE, ubeanVuePlugin } from "@ubean/vite";
|
|
7
7
|
import { ubeanIslandsPlugin } from "@ubean/islands/vite";
|
|
@@ -32,4 +32,4 @@ export * from "@ubean/routing";
|
|
|
32
32
|
//#region src/index.d.ts
|
|
33
33
|
declare const logger: import("consola").ConsolaInstance;
|
|
34
34
|
//#endregion
|
|
35
|
-
export { type AppPluginConfig, type BackupOptions, type CreateUbeanRouterOptions, type DataCacheStore, type DefineAppOptions, type DevToolsTabDefinition, type FsOps, type FsOpsOptions, Head, type HeadClient, type HydrateIslandsOptions, type I18nRoutingOptions, type I18nRoutingStrategy, type InternalFetchOptions, type IslandHydrateOptions, type IslandRecord, Link, type LinkProps, type PageAssetTags, type PageRenderer, PageView, type ResolvedAppConfig, type RouteLocation, type RouteLocationRaw, type ScaffoldOptions, type ScaffoldResult, type ScaffoldType, type TypedLinkProps, type UbeanAppInstance, type UbeanCorePluginOptions, type UbeanVueContext, type UbeanVuePluginOptions, type UseAsyncDataOptions, type UseAsyncDataReturn, type UseCacheViewsReturn, type UsePageTransitionReturn, type UseReloadSignalReturn, VUE_PLUGIN_INCLUDE, type ViewTransitionOptions, type VueHeadClient, type VueI18nInstance, type VueRendererOptions, type VueRendererRouterOptions, type VueRendererSimpleOptions, addVueLocale, applyAppConfig, clearCache, clearCustomTabs, clearPageTransition, clearVueLocales, collectIslands, createDataCacheStore, createDefaultAppConfig, createFsOps, createI18nMiddleware, createLinkHandler, createUbeanRouter, createUbeanSSRApp, createUseAsyncData, createVueRenderer, defineApp, defineDataKey, defineDevToolsTab, defineMeta, definePage, defineVueLocale, deleteScaffold, describeRoute, detectVueBrowserLocale, detectVueLocale, disablePageCache, enablePageCache, excludePageCache, extractPageData, extractVueLocaleFromPath, getCacheEnabled, getCachedViewNames, getCustomTabs, getDefaultVueLocale, getExcludedViewNames, getInitialPageData, getIslandsBootstrapScript, getLocalePath, getNavigationType, getPageTransitionName, getPathWithoutLocale, getReloadCounter, getVueI18nConfig, getVueLocale, getVueLocaleDir, getVueLocaleName, getVueRegisteredLocales, hydrateIsland, hydrateIslands, includePageCache, initCachedViewsFromRoutes, injectHead, invalidateCache, invalidatePageCache, isActiveRoute, isCacheEnabled, isPageCached, isPageExcluded, isReloading, listScaffoldableFiles, localeRoutes, localizeVuePath, logger, mergeVueLocale, onVueLocaleChange, openAPIRouteHandler, recoverScaffold, reloadPage, resetRouteCache, resolveRoute, resolver, scaffold, setPageTransition, setVueI18nConfig, setVueLocale, sqlRawAlias, supportsViewTransitions, switchLocalePath, switchVueLocalePath, tVue, ubeanCorePlugin, ubeanIslandsPlugin, ubeanPlugin, ubeanVuePlugin, useCacheViews, useHead, useHeadInstance, useLocalePath, usePage, usePageTransition, useReloadSignal, useRouter, useServerData, useSwitchLocalePath, useViewTransition, useViewTransitionState, useVueI18n, validator, withViewTransition };
|
|
35
|
+
export { type AppPluginConfig, type BackupOptions, type CreateUbeanRouterOptions, type DataCacheStore, type DefineAppOptions, type DevToolsTabDefinition, type FsOps, type FsOpsOptions, Head, type HeadClient, type HydrateIslandsOptions, type I18nRoutingOptions, type I18nRoutingStrategy, type InternalFetchOptions, type IslandHydrateOptions, type IslandRecord, Link, type LinkProps, type PageAssetTags, type PageRenderer, PageView, type ResolvedAppConfig, type RouteLocation, type RouteLocationRaw, type ScaffoldOptions, type ScaffoldResult, type ScaffoldType, type TypedLinkProps, type UbeanAppInstance, type UbeanCorePluginOptions, type UbeanVueContext, type UbeanVuePluginOptions, type UseAsyncDataOptions, type UseAsyncDataReturn, type UseCacheViewsReturn, type UsePageTransitionReturn, type UseReloadSignalReturn, VUE_PLUGIN_INCLUDE, type ViewTransitionOptions, type VueHeadClient, type VueI18nInstance, type VueRendererOptions, type VueRendererRouterOptions, type VueRendererSimpleOptions, addVueLocale, applyAppConfig, clearCache, clearCustomTabs, clearPageTransition, clearVueLocales, collectIslands, createDataCacheStore, createDefaultAppConfig, createFsOps, createI18nMiddleware, createLinkHandler, createUbeanRouter, createUbeanSSRApp, createUseAsyncData, createVueRenderer, defineApp, defineDataKey, defineDevToolsTab, defineMeta, definePage, defineVueLocale, deleteScaffold, describeRoute, detectVueBrowserLocale, detectVueLocale, disablePageCache, enablePageCache, excludePageCache, extractPageData, extractVueLocaleFromPath, getCacheEnabled, getCachedViewNames, getCustomTabs, getDefaultVueLocale, getExcludedViewNames, getInitialPageData, getInitialState, getIslandsBootstrapScript, getLocalePath, getNavigationType, getPageTransitionName, getPathWithoutLocale, getReloadCounter, getVueI18nConfig, getVueLocale, getVueLocaleDir, getVueLocaleName, getVueRegisteredLocales, hydrateIsland, hydrateIslands, includePageCache, initCachedViewsFromRoutes, injectHead, invalidateCache, invalidatePageCache, isActiveRoute, isCacheEnabled, isPageCached, isPageExcluded, isReloading, listScaffoldableFiles, localeRoutes, localizeVuePath, logger, mergeAppConfig, mergeVueLocale, onVueLocaleChange, openAPIRouteHandler, recoverScaffold, reloadPage, resetRouteCache, resolveRoute, resolver, scaffold, setPageTransition, setVueI18nConfig, setVueLocale, sqlRawAlias, supportsViewTransitions, switchLocalePath, switchVueLocalePath, tVue, ubeanCorePlugin, ubeanIslandsPlugin, ubeanPlugin, ubeanVuePlugin, useCacheViews, useHead, useHeadInstance, useLocalePath, usePage, usePageTransition, useReloadSignal, useRouter, useServerData, useSwitchLocalePath, useViewTransition, useViewTransitionState, useVueI18n, validator, withViewTransition };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineDataKey } from "@ubean/pages";
|
|
2
2
|
import { rawSql as sqlRawAlias } from "@ubean/server";
|
|
3
3
|
import { useRouter } from "@ubean/routing";
|
|
4
|
-
import { Head, Link, PageView, addLocale as addVueLocale, applyAppConfig, clearCache, clearLocales as clearVueLocales, clearPageTransition, collectIslands, createDataCacheStore, createDefaultAppConfig, createLinkHandler, createUbeanRouter, createUbeanSSRApp, createUseAsyncData, defineApp, defineLocale as defineVueLocale, defineMeta, definePage, detectBrowserLocale as detectVueBrowserLocale, detectLocale as detectVueLocale, disablePageCache, enablePageCache, excludePageCache, extractLocaleFromPath as extractVueLocaleFromPath, extractPageData, getCacheEnabled, getCachedViewNames, getDefaultLocale as getDefaultVueLocale, getExcludedViewNames, getI18nConfig as getVueI18nConfig, getInitialPageData, getLocale as getVueLocale, getLocaleDir as getVueLocaleDir, getLocaleName as getVueLocaleName, getNavigationType, getPageTransitionName, getRegisteredLocales as getVueRegisteredLocales, getReloadCounter, hydrateIsland, hydrateIslands, includePageCache, initCachedViewsFromRoutes, injectHead, invalidateCache, invalidatePageCache, isActiveRoute, isCacheEnabled, isPageCached, isPageExcluded, isReloading, localizePath as localizeVuePath, mergeLocale as mergeVueLocale, onLocaleChange as onVueLocaleChange, reloadPage, resetRouteCache, resolveRoute, setI18nConfig as setVueI18nConfig, setLocale as setVueLocale, setPageTransition, supportsViewTransitions, switchLocalePath as switchVueLocalePath, t as tVue, useCacheViews, useHead, useHeadInstance, useI18n as useVueI18n, useLocalePath, usePage, usePageTransition, useReloadSignal, useServerData, useSwitchLocalePath, useViewTransition, useViewTransitionState, withViewTransition } from "@ubean/runtime";
|
|
4
|
+
import { Head, Link, PageView, addLocale as addVueLocale, applyAppConfig, clearCache, clearLocales as clearVueLocales, clearPageTransition, collectIslands, createDataCacheStore, createDefaultAppConfig, createLinkHandler, createUbeanRouter, createUbeanSSRApp, createUseAsyncData, defineApp, defineLocale as defineVueLocale, defineMeta, definePage, detectBrowserLocale as detectVueBrowserLocale, detectLocale as detectVueLocale, disablePageCache, enablePageCache, excludePageCache, extractLocaleFromPath as extractVueLocaleFromPath, extractPageData, getCacheEnabled, getCachedViewNames, getDefaultLocale as getDefaultVueLocale, getExcludedViewNames, getI18nConfig as getVueI18nConfig, getInitialPageData, getInitialState, getLocale as getVueLocale, getLocaleDir as getVueLocaleDir, getLocaleName as getVueLocaleName, getNavigationType, getPageTransitionName, getRegisteredLocales as getVueRegisteredLocales, getReloadCounter, hydrateIsland, hydrateIslands, includePageCache, initCachedViewsFromRoutes, injectHead, invalidateCache, invalidatePageCache, isActiveRoute, isCacheEnabled, isPageCached, isPageExcluded, isReloading, localizePath as localizeVuePath, mergeAppConfig, mergeLocale as mergeVueLocale, onLocaleChange as onVueLocaleChange, reloadPage, resetRouteCache, resolveRoute, setI18nConfig as setVueI18nConfig, setLocale as setVueLocale, setPageTransition, supportsViewTransitions, switchLocalePath as switchVueLocalePath, t as tVue, useCacheViews, useHead, useHeadInstance, useI18n as useVueI18n, useLocalePath, usePage, usePageTransition, useReloadSignal, useServerData, useSwitchLocalePath, useViewTransition, useViewTransitionState, withViewTransition } from "@ubean/runtime";
|
|
5
5
|
import { ubeanPlugin, ubeanPlugin as ubeanCorePlugin } from "@ubean/build/vite";
|
|
6
6
|
import { VUE_PLUGIN_INCLUDE, ubeanVuePlugin } from "@ubean/vite";
|
|
7
7
|
import { ubeanIslandsPlugin } from "@ubean/islands/vite";
|
|
@@ -33,4 +33,4 @@ export * from "@ubean/routing";
|
|
|
33
33
|
//#region src/index.ts
|
|
34
34
|
const logger = consola.withTag("ubean");
|
|
35
35
|
//#endregion
|
|
36
|
-
export { Head, Link, PageView, VUE_PLUGIN_INCLUDE, addVueLocale, applyAppConfig, clearCache, clearCustomTabs, clearPageTransition, clearVueLocales, collectIslands, createDataCacheStore, createDefaultAppConfig, createFsOps, createI18nMiddleware, createLinkHandler, createUbeanRouter, createUbeanSSRApp, createUseAsyncData, createVueRenderer, defineApp, defineDataKey, defineDevToolsTab, defineMeta, definePage, defineVueLocale, deleteScaffold, describeRoute, detectVueBrowserLocale, detectVueLocale, disablePageCache, enablePageCache, excludePageCache, extractPageData, extractVueLocaleFromPath, getCacheEnabled, getCachedViewNames, getCustomTabs, getDefaultVueLocale, getExcludedViewNames, getInitialPageData, getIslandsBootstrapScript, getLocalePath, getNavigationType, getPageTransitionName, getPathWithoutLocale, getReloadCounter, getVueI18nConfig, getVueLocale, getVueLocaleDir, getVueLocaleName, getVueRegisteredLocales, hydrateIsland, hydrateIslands, includePageCache, initCachedViewsFromRoutes, injectHead, invalidateCache, invalidatePageCache, isActiveRoute, isCacheEnabled, isPageCached, isPageExcluded, isReloading, listScaffoldableFiles, localeRoutes, localizeVuePath, logger, mergeVueLocale, onVueLocaleChange, openAPIRouteHandler, recoverScaffold, reloadPage, resetRouteCache, resolveRoute, resolver, scaffold, setPageTransition, setVueI18nConfig, setVueLocale, sqlRawAlias, supportsViewTransitions, switchLocalePath, switchVueLocalePath, tVue, ubeanCorePlugin, ubeanIslandsPlugin, ubeanPlugin, ubeanVuePlugin, useCacheViews, useHead, useHeadInstance, useLocalePath, usePage, usePageTransition, useReloadSignal, useRouter, useServerData, useSwitchLocalePath, useViewTransition, useViewTransitionState, useVueI18n, validator, withViewTransition };
|
|
36
|
+
export { Head, Link, PageView, VUE_PLUGIN_INCLUDE, addVueLocale, applyAppConfig, clearCache, clearCustomTabs, clearPageTransition, clearVueLocales, collectIslands, createDataCacheStore, createDefaultAppConfig, createFsOps, createI18nMiddleware, createLinkHandler, createUbeanRouter, createUbeanSSRApp, createUseAsyncData, createVueRenderer, defineApp, defineDataKey, defineDevToolsTab, defineMeta, definePage, defineVueLocale, deleteScaffold, describeRoute, detectVueBrowserLocale, detectVueLocale, disablePageCache, enablePageCache, excludePageCache, extractPageData, extractVueLocaleFromPath, getCacheEnabled, getCachedViewNames, getCustomTabs, getDefaultVueLocale, getExcludedViewNames, getInitialPageData, getInitialState, getIslandsBootstrapScript, getLocalePath, getNavigationType, getPageTransitionName, getPathWithoutLocale, getReloadCounter, getVueI18nConfig, getVueLocale, getVueLocaleDir, getVueLocaleName, getVueRegisteredLocales, hydrateIsland, hydrateIslands, includePageCache, initCachedViewsFromRoutes, injectHead, invalidateCache, invalidatePageCache, isActiveRoute, isCacheEnabled, isPageCached, isPageExcluded, isReloading, listScaffoldableFiles, localeRoutes, localizeVuePath, logger, mergeAppConfig, mergeVueLocale, onVueLocaleChange, openAPIRouteHandler, recoverScaffold, reloadPage, resetRouteCache, resolveRoute, resolver, scaffold, setPageTransition, setVueI18nConfig, setVueLocale, sqlRawAlias, supportsViewTransitions, switchLocalePath, switchVueLocalePath, tVue, ubeanCorePlugin, ubeanIslandsPlugin, ubeanPlugin, ubeanVuePlugin, useCacheViews, useHead, useHeadInstance, useLocalePath, usePage, usePageTransition, useReloadSignal, useRouter, useServerData, useSwitchLocalePath, useViewTransition, useViewTransitionState, useVueI18n, validator, withViewTransition };
|
package/dist/vite.d.ts
CHANGED
|
@@ -3,21 +3,15 @@ import { UbeanVuePluginOptions } from "@ubean/vite";
|
|
|
3
3
|
import { Plugin } from "vite";
|
|
4
4
|
//#region src/vite.d.ts
|
|
5
5
|
/**
|
|
6
|
-
* ubean 默认 Vite
|
|
6
|
+
* ubean 默认 Vite 插件组合(无参数版本)。
|
|
7
7
|
*
|
|
8
|
-
* 返回一个扁平的 `Plugin[]
|
|
9
|
-
* 1. `ubeanCorePlugin` —
|
|
10
|
-
* 2. `ubeanVuePlugin` — Vue
|
|
11
|
-
* 3. `ubeanIslandsPlugin` — Islands
|
|
8
|
+
* 返回一个扁平的 `Plugin[]`,包含:
|
|
9
|
+
* 1. `ubeanCorePlugin` — 框架无关的核心插件(路由扫描、虚拟模块、宏转换)
|
|
10
|
+
* 2. `ubeanVuePlugin` — Vue 专属插件(页面/入口虚拟模块、自动导入、组件解析)
|
|
11
|
+
* 3. `ubeanIslandsPlugin` — Islands 架构插件(SFC 中 `client:*` 指令转换)
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
* 1. 显式传入的 `options.config`
|
|
15
|
-
* 2. `tryGetConfig()` 返回的全局缓存(CLI `dev`/`build` 命令已加载时可用)
|
|
16
|
-
* 3. 同步 `loadUbeanConfig()`(仅在以上两者均未命中时调用)
|
|
17
|
-
*
|
|
18
|
-
* 注意:此函数返回 `Plugin[]`,消费者可直接展开使用 `...ubeanPlugin()`,
|
|
19
|
-
* 也可以整体作为一个数组传入 `plugins` 字段。
|
|
13
|
+
* 配置来源:始终从 `ubean.config.ts` 加载(同步),不接受 `config` 参数。
|
|
20
14
|
*/
|
|
21
|
-
declare function ubeanPlugin(
|
|
15
|
+
declare function ubeanPlugin(): Plugin[];
|
|
22
16
|
//#endregion
|
|
23
17
|
export { type UbeanPluginOptions, type UbeanVuePluginOptions, ubeanPlugin };
|
package/dist/vite.js
CHANGED
|
@@ -1,52 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { loadUbeanConfigSync } from "@ubean/config";
|
|
2
2
|
import { ubeanPlugin as ubeanPlugin$1 } from "@ubean/build/vite";
|
|
3
3
|
import { ubeanVuePlugin } from "@ubean/vite";
|
|
4
4
|
import { ubeanIslandsPlugin } from "@ubean/islands/vite";
|
|
5
5
|
//#region src/vite.ts
|
|
6
6
|
/**
|
|
7
|
-
* ubean 默认 Vite
|
|
7
|
+
* ubean 默认 Vite 插件组合(无参数版本)。
|
|
8
8
|
*
|
|
9
|
-
* 返回一个扁平的 `Plugin[]
|
|
10
|
-
* 1. `ubeanCorePlugin` —
|
|
11
|
-
* 2. `ubeanVuePlugin` — Vue
|
|
12
|
-
* 3. `ubeanIslandsPlugin` — Islands
|
|
9
|
+
* 返回一个扁平的 `Plugin[]`,包含:
|
|
10
|
+
* 1. `ubeanCorePlugin` — 框架无关的核心插件(路由扫描、虚拟模块、宏转换)
|
|
11
|
+
* 2. `ubeanVuePlugin` — Vue 专属插件(页面/入口虚拟模块、自动导入、组件解析)
|
|
12
|
+
* 3. `ubeanIslandsPlugin` — Islands 架构插件(SFC 中 `client:*` 指令转换)
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
* 1. 显式传入的 `options.config`
|
|
16
|
-
* 2. `tryGetConfig()` 返回的全局缓存(CLI `dev`/`build` 命令已加载时可用)
|
|
17
|
-
* 3. 同步 `loadUbeanConfig()`(仅在以上两者均未命中时调用)
|
|
18
|
-
*
|
|
19
|
-
* 注意:此函数返回 `Plugin[]`,消费者可直接展开使用 `...ubeanPlugin()`,
|
|
20
|
-
* 也可以整体作为一个数组传入 `plugins` 字段。
|
|
14
|
+
* 配置来源:始终从 `ubean.config.ts` 加载(同步),不接受 `config` 参数。
|
|
21
15
|
*/
|
|
22
|
-
function ubeanPlugin(
|
|
23
|
-
|
|
24
|
-
if (!config) config = loadUbeanConfigSync();
|
|
25
|
-
if (!config) throw new Error("[ubean] ubeanPlugin requires a resolved config. Pass it explicitly: `ubeanPlugin({ config: await loadUbeanConfig() })`, or use the individual plugins from @ubean/build/vite (auto-loads config in buildStart).");
|
|
16
|
+
function ubeanPlugin() {
|
|
17
|
+
const config = loadUbeanConfigSync();
|
|
26
18
|
return [
|
|
27
19
|
ubeanPlugin$1({ config }),
|
|
28
|
-
...ubeanVuePlugin({
|
|
29
|
-
config,
|
|
30
|
-
ssr: options.ssr
|
|
31
|
-
}),
|
|
20
|
+
...ubeanVuePlugin({ config }),
|
|
32
21
|
ubeanIslandsPlugin()
|
|
33
22
|
];
|
|
34
23
|
}
|
|
35
|
-
/**
|
|
36
|
-
* 同步加载 ubean 配置的兜底工具。
|
|
37
|
-
*
|
|
38
|
-
* `loadUbeanConfig` 是异步的,但在大多数场景下 c12 已经缓存了配置
|
|
39
|
-
* (CLI 命令在调用 vite 之前已加载),`tryGetConfig` 会命中。
|
|
40
|
-
* 此函数仅在 `tryGetConfig` 未命中时尝试同步触发加载并返回缓存结果,
|
|
41
|
-
* 若仍不可用则返回 undefined(由调用方决定是否抛错)。
|
|
42
|
-
*/
|
|
43
|
-
function loadUbeanConfigSync() {
|
|
44
|
-
try {
|
|
45
|
-
loadUbeanConfig();
|
|
46
|
-
return tryGetConfig();
|
|
47
|
-
} catch {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
24
|
//#endregion
|
|
52
25
|
export { ubeanPlugin };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ubean",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Vue-first full-stack meta-framework built on Vite-Plus with Hono (aggregator of all @ubean/* subpackages)",
|
|
5
5
|
"bin": {
|
|
6
6
|
"ubean": "./bin/ubean.mjs"
|
|
@@ -46,36 +46,36 @@
|
|
|
46
46
|
"consola": "^3.4.2",
|
|
47
47
|
"hono": "4.12.32",
|
|
48
48
|
"hono-openapi": "^1.3.1",
|
|
49
|
-
"@ubean/api-routes": "0.1.
|
|
50
|
-
"@ubean/
|
|
51
|
-
"@ubean/
|
|
52
|
-
"@ubean/
|
|
53
|
-
"@ubean/
|
|
54
|
-
"@ubean/config": "0.1.
|
|
55
|
-
"@ubean/dev-server": "0.1.
|
|
56
|
-
"@ubean/
|
|
57
|
-
"@ubean/
|
|
58
|
-
"@ubean/
|
|
59
|
-
"@ubean/
|
|
60
|
-
"@ubean/islands": "0.1.
|
|
61
|
-
"@ubean/
|
|
62
|
-
"@ubean/modules": "0.1.
|
|
63
|
-
"@ubean/
|
|
64
|
-
"@ubean/pages": "0.1.
|
|
65
|
-
"@ubean/
|
|
66
|
-
"@ubean/
|
|
67
|
-
"@ubean/
|
|
68
|
-
"@ubean/runtime": "0.1.
|
|
69
|
-
"@ubean/
|
|
70
|
-
"@ubean/
|
|
71
|
-
"@ubean/
|
|
72
|
-
"@ubean/types": "0.1.
|
|
73
|
-
"@ubean/
|
|
74
|
-
"@ubean/vite": "0.1.
|
|
49
|
+
"@ubean/api-routes": "0.1.8",
|
|
50
|
+
"@ubean/build": "0.1.8",
|
|
51
|
+
"@ubean/cli": "0.1.8",
|
|
52
|
+
"@ubean/codegen": "0.1.8",
|
|
53
|
+
"@ubean/auto-imports": "0.1.8",
|
|
54
|
+
"@ubean/config": "0.1.8",
|
|
55
|
+
"@ubean/dev-server": "0.1.8",
|
|
56
|
+
"@ubean/devtools": "0.1.8",
|
|
57
|
+
"@ubean/error": "0.1.8",
|
|
58
|
+
"@ubean/app": "0.1.8",
|
|
59
|
+
"@ubean/i18n": "0.1.8",
|
|
60
|
+
"@ubean/islands": "0.1.8",
|
|
61
|
+
"@ubean/env": "0.1.8",
|
|
62
|
+
"@ubean/modules": "0.1.8",
|
|
63
|
+
"@ubean/markdown": "0.1.8",
|
|
64
|
+
"@ubean/pages": "0.1.8",
|
|
65
|
+
"@ubean/preset": "0.1.8",
|
|
66
|
+
"@ubean/routing": "0.1.8",
|
|
67
|
+
"@ubean/prerender": "0.1.8",
|
|
68
|
+
"@ubean/runtime": "0.1.8",
|
|
69
|
+
"@ubean/ssr": "0.1.8",
|
|
70
|
+
"@ubean/seo": "0.1.8",
|
|
71
|
+
"@ubean/utils": "0.1.8",
|
|
72
|
+
"@ubean/types": "0.1.8",
|
|
73
|
+
"@ubean/server": "0.1.8",
|
|
74
|
+
"@ubean/vite": "0.1.8"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@types/node": "^26.1.
|
|
78
|
-
"typescript": "
|
|
77
|
+
"@types/node": "^26.1.2",
|
|
78
|
+
"typescript": "7.0.2",
|
|
79
79
|
"vite": "npm:@voidzero-dev/vite-plus-core@0.2.6",
|
|
80
80
|
"vite-plus": "0.2.6",
|
|
81
81
|
"vue": "^3.5.40"
|