@ubean/integrations 0.4.5 → 0.4.6

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.
@@ -2,9 +2,9 @@ import { i as ElectronRendererOptions, n as ElectronOptions, r as ElectronPreloa
2
2
  import { Plugin } from "vite";
3
3
  //#region src/electron/constants.d.ts
4
4
  /** main 进程入口默认值 */
5
- declare const DEFAULT_MAIN_ENTRY = "electron/main.ts";
5
+ export declare const DEFAULT_MAIN_ENTRY = "electron/main.ts";
6
6
  /** preload 脚本入口默认值 */
7
- declare const DEFAULT_PRELOAD_INPUT = "electron/preload.ts";
7
+ export declare const DEFAULT_PRELOAD_INPUT = "electron/preload.ts";
8
8
  //#endregion
9
9
  //#region src/electron/index.d.ts
10
10
  /**
@@ -28,10 +28,10 @@ declare const DEFAULT_PRELOAD_INPUT = "electron/preload.ts";
28
28
  *
29
29
  * 通常由 ubean module 系统自动加载,无需在 vite.config.ts 中手动调用。
30
30
  */
31
- declare function ubeanElectronPlugin(options?: ElectronOptions): Promise<Plugin[]>;
31
+ export declare function ubeanElectronPlugin(options?: ElectronOptions): Promise<Plugin[]>;
32
32
  /**
33
33
  * 类型安全的 Electron 配置定义辅助函数(透传)
34
34
  */
35
- declare function defineElectronConfig(options: ElectronOptions): ElectronOptions;
35
+ export declare function defineElectronConfig(options: ElectronOptions): ElectronOptions;
36
36
  //#endregion
37
- export { DEFAULT_MAIN_ENTRY, DEFAULT_PRELOAD_INPUT, type ElectronMainOptions, type ElectronOptions, type ElectronPreloadOptions, type ElectronRendererOptions, ubeanElectronPlugin as default, ubeanElectronPlugin, defineElectronConfig };
37
+ export { type ElectronMainOptions, type ElectronOptions, type ElectronPreloadOptions, type ElectronRendererOptions, ubeanElectronPlugin as default };
@@ -1,7 +1,7 @@
1
1
  import { a as FontModuleOptions, c as FontStyle, d as GoogleFontsOptions, f as LocalFontOptions, i as FontMetric, l as FontSubset, n as FontFaceDeclaration, o as FontProvider, p as ResolvedFontFace, r as FontFamilyOptions, t as FontDisplay, u as FontWeight } from "../types-CpVZH81i.js";
2
2
  import { Plugin } from "vite";
3
3
  //#region src/fonts/index.d.ts
4
- interface UbeanFontsOptions {
4
+ export interface UbeanFontsOptions {
5
5
  families?: Array<{
6
6
  name: string;
7
7
  provider?: 'google' | 'bunny' | 'local' | 'custom';
@@ -38,6 +38,6 @@ interface UbeanFontsOptions {
38
38
  inject?: boolean;
39
39
  devtools?: boolean;
40
40
  }
41
- declare function ubeanFontsPlugin(userOptions?: UbeanFontsOptions): Plugin;
41
+ export declare function ubeanFontsPlugin(userOptions?: UbeanFontsOptions): Plugin;
42
42
  //#endregion
43
- export { type FontDisplay, type FontFaceDeclaration, type FontFamilyOptions, type FontMetric, type FontModuleOptions, type FontProvider, type FontStyle, type FontSubset, type FontWeight, type GoogleFontsOptions, type LocalFontOptions, type ResolvedFontFace, UbeanFontsOptions, ubeanFontsPlugin as default, ubeanFontsPlugin };
43
+ export { type FontDisplay, type FontFaceDeclaration, type FontFamilyOptions, type FontMetric, type FontModuleOptions, type FontProvider, type FontStyle, type FontSubset, type FontWeight, type GoogleFontsOptions, type LocalFontOptions, type ResolvedFontFace, ubeanFontsPlugin as default };
package/dist/index.d.ts CHANGED
@@ -5,10 +5,10 @@ import { n as UbeanPiniaOptions, t as PiniaSerializedState } from "./types-Qd7x9
5
5
  import { t as UiOptions } from "./types-BXiJV3cm.js";
6
6
  import { App } from "vue";
7
7
  //#region src/pwa/runtime.d.ts
8
- declare function registerSW(swUrl?: string, options?: UsePwaOptions): Promise<ServiceWorkerRegistration | null>;
9
- declare function updateSW(): void;
10
- declare function getSWRegistration(): ServiceWorkerRegistration | null;
11
- declare function usePwa(options?: UsePwaOptions & {
8
+ export declare function registerSW(swUrl?: string, options?: UsePwaOptions): Promise<ServiceWorkerRegistration | null>;
9
+ export declare function updateSW(): void;
10
+ export declare function getSWRegistration(): ServiceWorkerRegistration | null;
11
+ export declare function usePwa(options?: UsePwaOptions & {
12
12
  swUrl?: string;
13
13
  }): {
14
14
  state: import("vue").ComputedRef<PwaState>;
@@ -228,7 +228,7 @@ declare function usePwa(options?: UsePwaOptions & {
228
228
  * @param app Vue app 实例(SSR 渲染用的 app)
229
229
  * @returns 序列化后的状态对象,包含 `pinia.state.value`
230
230
  */
231
- declare function serializePiniaState(app: App): PiniaSerializedState;
231
+ export declare function serializePiniaState(app: App): PiniaSerializedState;
232
232
  /**
233
233
  * 客户端水合:将 SSR 序列化的 state 注入到 Pinia 实例。
234
234
  *
@@ -241,17 +241,17 @@ declare function serializePiniaState(app: App): PiniaSerializedState;
241
241
  * @param app Vue app 实例(客户端 app,已 install pinia 插件)
242
242
  * @param state 从 `__UBEAN_STATE__` 反序列化的状态对象,或 null
243
243
  */
244
- declare function hydratePiniaState(app: App, state: Record<string, unknown> | null): void;
244
+ export declare function hydratePiniaState(app: App, state: Record<string, unknown> | null): void;
245
245
  //#endregion
246
246
  //#region src/fonts/core.d.ts
247
- declare const defaultFontWeights: number[];
248
- declare const defaultFontStyles: FontStyle[];
249
- declare const defaultFontSubsets: FontSubset[];
250
- declare const defaultFontDisplay: FontDisplay;
251
- declare const fallbackFonts: Record<string, string[]>;
252
- declare function normalizeFontName(name: string): string;
253
- declare function weightsToString(weights: (FontWeight | number)[]): string;
254
- declare function getGoogleFontsUrl(options: {
247
+ export declare const defaultFontWeights: number[];
248
+ export declare const defaultFontStyles: FontStyle[];
249
+ export declare const defaultFontSubsets: FontSubset[];
250
+ export declare const defaultFontDisplay: FontDisplay;
251
+ export declare const fallbackFonts: Record<string, string[]>;
252
+ export declare function normalizeFontName(name: string): string;
253
+ export declare function weightsToString(weights: (FontWeight | number)[]): string;
254
+ export declare function getGoogleFontsUrl(options: {
255
255
  family: string;
256
256
  weights?: (FontWeight | number)[];
257
257
  styles?: FontStyle[];
@@ -259,43 +259,43 @@ declare function getGoogleFontsUrl(options: {
259
259
  display?: FontDisplay;
260
260
  text?: string;
261
261
  }): string;
262
- declare function getBunnyFontsUrl(options: {
262
+ export declare function getBunnyFontsUrl(options: {
263
263
  family: string;
264
264
  weights?: (FontWeight | number)[];
265
265
  styles?: FontStyle[];
266
266
  subsets?: FontSubset[];
267
267
  display?: FontDisplay;
268
268
  }): string;
269
- declare function getFontshareUrl(family: string, _format?: 'css' | 'json'): string;
270
- declare function generateFontFace(face: ResolvedFontFace): string;
271
- declare function generateFontFallbackCSS(familyName: string, metric: FontMetric, fallbackName: string, isItalic?: boolean): string;
272
- declare function generatePreloadLink(url: string, type?: string, crossorigin?: boolean): string;
273
- declare function generatePreconnectLink(href: string, crossorigin?: boolean): string;
274
- declare function generateFontCSSVariable(name: string, family: string): string;
275
- declare function parseFontFamilyCSS(css: string): ResolvedFontFace[];
276
- declare function extractFontUrlsFromCSS(css: string): string[];
277
- declare function createFontHash(config: FontFamilyOptions): string;
278
- declare function normalizeFontFamily(family: FontFamilyOptions, defaults: {
269
+ export declare function getFontshareUrl(family: string, _format?: 'css' | 'json'): string;
270
+ export declare function generateFontFace(face: ResolvedFontFace): string;
271
+ export declare function generateFontFallbackCSS(familyName: string, metric: FontMetric, fallbackName: string, isItalic?: boolean): string;
272
+ export declare function generatePreloadLink(url: string, type?: string, crossorigin?: boolean): string;
273
+ export declare function generatePreconnectLink(href: string, crossorigin?: boolean): string;
274
+ export declare function generateFontCSSVariable(name: string, family: string): string;
275
+ export declare function parseFontFamilyCSS(css: string): ResolvedFontFace[];
276
+ export declare function extractFontUrlsFromCSS(css: string): string[];
277
+ export declare function createFontHash(config: FontFamilyOptions): string;
278
+ export declare function normalizeFontFamily(family: FontFamilyOptions, defaults: {
279
279
  weights: number[];
280
280
  styles: FontStyle[];
281
281
  subsets: FontSubset[];
282
282
  display: FontDisplay;
283
283
  }): Required<FontFamilyOptions>;
284
- declare const googleFontMetrics: Record<string, FontMetric>;
284
+ export declare const googleFontMetrics: Record<string, FontMetric>;
285
285
  //#endregion
286
286
  //#region src/fonts/runtime.d.ts
287
- declare function configureFontsRuntime(options?: Partial<FontModuleOptions>): FontModuleOptions;
288
- declare function getFontsConfig(): FontModuleOptions;
289
- declare function defineFontFamily(options: FontFamilyOptions): FontFamilyOptions;
290
- declare function defineLocalFont(options: LocalFontOptions): LocalFontOptions;
291
- declare function defineGoogleFont(options: GoogleFontsOptions): GoogleFontsOptions;
292
- declare function generateFontLinks(): {
287
+ export declare function configureFontsRuntime(options?: Partial<FontModuleOptions>): FontModuleOptions;
288
+ export declare function getFontsConfig(): FontModuleOptions;
289
+ export declare function defineFontFamily(options: FontFamilyOptions): FontFamilyOptions;
290
+ export declare function defineLocalFont(options: LocalFontOptions): LocalFontOptions;
291
+ export declare function defineGoogleFont(options: GoogleFontsOptions): GoogleFontsOptions;
292
+ export declare function generateFontLinks(): {
293
293
  preconnect: string[];
294
294
  styles: string[];
295
295
  preload: string[];
296
296
  };
297
- declare function generateFontCSS(): string;
298
- declare function getFontFamilies(): Required<FontFamilyOptions>[];
299
- declare function getFontHash(family: FontFamilyOptions): string;
297
+ export declare function generateFontCSS(): string;
298
+ export declare function getFontFamilies(): Required<FontFamilyOptions>[];
299
+ export declare function getFontHash(family: FontFamilyOptions): string;
300
300
  //#endregion
301
- export { CachingStrategy, DisplayMode, ElectronMainOptions, ElectronOptions, ElectronPreloadOptions, ElectronRendererOptions, FontDisplay, FontFaceDeclaration, FontFamilyOptions, FontMetric, FontModuleOptions, FontProvider, FontProviderOptions, FontStyle, FontSubset, FontWeight, GoogleFontsOptions, LocalFontOptions, ManifestIcon, ManifestOrientation, ManifestScreenshot, PiniaSerializedState, PwaOptions, PwaState, ResolvedFontFace, RuntimeCachingRule, UbeanPiniaOptions, UiOptions, UsePwaOptions, WebAppManifest, configureFontsRuntime, createFontHash, defaultFontDisplay, defaultFontStyles, defaultFontSubsets, defaultFontWeights, defineFontFamily, defineGoogleFont, defineLocalFont, extractFontUrlsFromCSS, fallbackFonts, generateFontCSS, generateFontCSSVariable, generateFontFace, generateFontFallbackCSS, generateFontLinks, generatePreconnectLink, generatePreloadLink, getBunnyFontsUrl, getFontFamilies, getFontHash, getFontsConfig, getFontshareUrl, getGoogleFontsUrl, getSWRegistration, googleFontMetrics, hydratePiniaState, normalizeFontFamily, normalizeFontName, parseFontFamilyCSS, registerSW, serializePiniaState, updateSW, usePwa, weightsToString };
301
+ export { CachingStrategy, DisplayMode, ElectronMainOptions, ElectronOptions, ElectronPreloadOptions, ElectronRendererOptions, FontDisplay, FontFaceDeclaration, FontFamilyOptions, FontMetric, FontModuleOptions, FontProvider, FontProviderOptions, FontStyle, FontSubset, FontWeight, GoogleFontsOptions, LocalFontOptions, ManifestIcon, ManifestOrientation, ManifestScreenshot, PiniaSerializedState, PwaOptions, PwaState, ResolvedFontFace, RuntimeCachingRule, UbeanPiniaOptions, UiOptions, UsePwaOptions, WebAppManifest };
@@ -7,10 +7,10 @@ import { Plugin } from "vite";
7
7
  * @param options 配置选项(`pinia: true` 时传入 `{}`,`pinia: { ... }` 时传入该对象)
8
8
  * @returns Vite 插件数组
9
9
  */
10
- declare function ubeanPiniaPlugin(options?: UbeanPiniaOptions): Plugin[];
10
+ export declare function ubeanPiniaPlugin(options?: UbeanPiniaOptions): Plugin[];
11
11
  /**
12
12
  * 类型安全的 Pinia 配置定义辅助函数(透传)
13
13
  */
14
- declare function definePiniaConfig(options: UbeanPiniaOptions): UbeanPiniaOptions;
14
+ export declare function definePiniaConfig(options: UbeanPiniaOptions): UbeanPiniaOptions;
15
15
  //#endregion
16
- export { type PiniaSerializedState, type UbeanPiniaOptions, ubeanPiniaPlugin as default, ubeanPiniaPlugin, definePiniaConfig };
16
+ export { type PiniaSerializedState, type UbeanPiniaOptions, ubeanPiniaPlugin as default };
@@ -16,7 +16,7 @@ import { Plugin } from "vite";
16
16
  * - strategies + runtimeCaching → workbox.runtimeCaching
17
17
  * - injectManifest + swSrc → strategies: 'injectManifest' + injectManifest.swSrc
18
18
  */
19
- declare function toVitePwaOptions(options?: PwaOptions): VitePWAOptions;
19
+ export declare function toVitePwaOptions(options?: PwaOptions): VitePWAOptions;
20
20
  /**
21
21
  * ubean PWA Vite 插件(基于 vite-plugin-pwa)
22
22
  *
@@ -38,10 +38,10 @@ declare function toVitePwaOptions(options?: PwaOptions): VitePWAOptions;
38
38
  * 通常由 ubean module 系统在 `ubean.config.ts` 中 `pwa: true | PwaOptions` 自动加载,
39
39
  * 无需在 vite.config.ts 中手动调用。
40
40
  */
41
- declare function ubeanPwaPlugin(options?: PwaOptions): Plugin;
41
+ export declare function ubeanPwaPlugin(options?: PwaOptions): Plugin;
42
42
  /**
43
43
  * 类型安全的 PWA 配置定义辅助函数(透传)
44
44
  */
45
- declare function definePwaConfig(options: PwaOptions): PwaOptions;
45
+ export declare function definePwaConfig(options: PwaOptions): PwaOptions;
46
46
  //#endregion
47
- export { type CachingStrategy, type DisplayMode, type ManifestIcon, type ManifestOrientation, type ManifestScreenshot, type PwaOptions, type PwaState, type RuntimeCachingRule, type UsePwaOptions, type WebAppManifest, ubeanPwaPlugin as default, ubeanPwaPlugin, definePwaConfig, toVitePwaOptions };
47
+ export { type CachingStrategy, type DisplayMode, type ManifestIcon, type ManifestOrientation, type ManifestScreenshot, type PwaOptions, type PwaState, type RuntimeCachingRule, type UsePwaOptions, type WebAppManifest, ubeanPwaPlugin as default };
@@ -17,10 +17,10 @@ import { Plugin } from "vite";
17
17
  *
18
18
  * 通常由 ubean module 系统自动加载,无需在 vite.config.ts 中手动调用。
19
19
  */
20
- declare function ubeanUiPlugin(options?: UiOptions): Plugin[];
20
+ export declare function ubeanUiPlugin(options?: UiOptions): Plugin[];
21
21
  /**
22
22
  * 类型安全的 UI 配置定义辅助函数(透传)
23
23
  */
24
- declare function defineUiConfig(options: UiOptions): UiOptions;
24
+ export declare function defineUiConfig(options: UiOptions): UiOptions;
25
25
  //#endregion
26
- export { type UiOptions, ubeanUiPlugin as default, ubeanUiPlugin, defineUiConfig };
26
+ export { type UiOptions, ubeanUiPlugin as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ubean/integrations",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "Thin integration bundles for ubean (pwa, fonts, electron, ui, pinia)",
5
5
  "files": [
6
6
  "dist"
@@ -36,7 +36,7 @@
36
36
  }
37
37
  },
38
38
  "dependencies": {
39
- "@ubean/build": "0.4.5",
39
+ "@ubean/build": "0.4.6",
40
40
  "defu": "6.1.7",
41
41
  "ohash": "^2.0.12",
42
42
  "vite-plugin-electron": "^1.1.2",
@@ -44,9 +44,9 @@
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/node": "^26.5.0",
47
- "typescript": "7.0.2",
48
- "vite": "npm:@voidzero-dev/vite-plus-core@0.3.0",
49
- "vite-plus": "0.3.0",
47
+ "typescript": "npm:typescript-native-bridge@latest",
48
+ "vite": "npm:@voidzero-dev/vite-plus-core@0.3.1",
49
+ "vite-plus": "0.3.1",
50
50
  "vue": "^3.5.42"
51
51
  },
52
52
  "peerDependencies": {