@weapp-core/shared 3.0.5 → 3.0.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.
@@ -1,6 +1,5 @@
1
1
  import { Dirent, OpenMode, PathLike, Stats, closeSync, constants, existsSync, mkdirSync, openSync, promises, readFileSync, unlinkSync, utimesSync, watch, writeFileSync } from "node:fs";
2
2
  import { FileHandle } from "node:fs/promises";
3
-
4
3
  //#region src/fs/index.d.ts
5
4
  interface JsonReadOptions {
6
5
  encoding?: BufferEncoding;
package/dist/index.d.ts CHANGED
@@ -1,12 +1,11 @@
1
1
  import get from "get-value";
2
2
  import set from "set-value";
3
-
4
3
  //#region ../../node_modules/.pnpm/defu@6.1.7/node_modules/defu/dist/defu.d.mts
5
4
  type Input = Record<string | number | symbol, any>;
6
5
  type IgnoredInput = boolean | number | null | any[] | Record<never, any> | undefined;
7
6
  type Merger = <T extends Input, K extends keyof T>(object: T, key: keyof T, value: T[K], namespace: string) => any;
8
7
  type nullish = null | undefined | void;
9
- type MergeObjects<Destination extends Input, Defaults extends Input> = Destination extends Defaults ? Destination : Omit<Destination, keyof Destination & keyof Defaults> & Omit<Defaults, keyof Destination & keyof Defaults> & { -readonly [Key in keyof Destination & keyof Defaults]: Destination[Key] extends nullish ? Defaults[Key] extends nullish ? nullish : Defaults[Key] : Defaults[Key] extends nullish ? Destination[Key] : Merge<Destination[Key], Defaults[Key]> };
8
+ type MergeObjects<Destination extends Input, Defaults extends Input> = Destination extends Defaults ? Destination : Omit<Destination, keyof Destination & keyof Defaults> & Omit<Defaults, keyof Destination & keyof Defaults> & { -readonly [Key in keyof Destination & keyof Defaults]: Destination[Key] extends nullish ? Defaults[Key] extends nullish ? nullish : Defaults[Key] : Defaults[Key] extends nullish ? Destination[Key] : Merge<Destination[Key], Defaults[Key]>; };
10
9
  type Defu<S extends Input, D extends Array<Input | IgnoredInput>> = D extends [infer F, ...infer Rest] ? F extends Input ? Rest extends Array<Input | IgnoredInput> ? Defu<MergeObjects<S, F>, Rest> : MergeObjects<S, F> : F extends IgnoredInput ? Rest extends Array<Input | IgnoredInput> ? Defu<S, Rest> : S : S : S;
11
10
  type DefuFn = <Source extends Input, Defaults extends Array<Input | IgnoredInput>>(source: Source, ...defaults: Defaults) => Defu<Source, Defaults>;
12
11
  interface DefuInstance {
@@ -350,6 +349,50 @@ declare function supportsMiniProgramRuntimeCapability(platform: MpPlatform | und
350
349
  */
351
350
  declare function resolveMiniProgramPageKeys(page?: Record<string, any>, platform?: MpPlatform): string[];
352
351
  //#endregion
352
+ //#region src/runtimeProviders.d.ts
353
+ type RuntimeProviderBackend = 'miniprogram' | 'web';
354
+ type RuntimeProviderCompilation = 'native' | 'vue' | 'web';
355
+ type RuntimeProviderModuleKind = 'runtime' | 'reactivity' | 'template';
356
+ type RuntimeProviderVariant = 'development' | 'production';
357
+ type RuntimeProviderInjectionMode = 'none' | 'virtual-module';
358
+ type RuntimeProviderHmrMode = 'none' | 'host-reload' | 'module-accept';
359
+ /**
360
+ * 运行时 provider 的开发与生产入口。
361
+ */
362
+ interface RuntimeProviderEntry {
363
+ development: string;
364
+ production: string;
365
+ }
366
+ /**
367
+ * 运行时 provider 的声明式能力。
368
+ */
369
+ interface RuntimeProviderCapabilities {
370
+ framework: boolean;
371
+ hmr: boolean;
372
+ nativeHost: boolean;
373
+ webHost: boolean;
374
+ }
375
+ /**
376
+ * 运行时 provider 的 HMR 契约。
377
+ */
378
+ interface RuntimeProviderHmrDescriptor {
379
+ mode: RuntimeProviderHmrMode;
380
+ acceptCode?: string;
381
+ }
382
+ /**
383
+ * 跨包共享的运行时 provider 描述契约。
384
+ */
385
+ interface RuntimeProviderDescriptorContract {
386
+ id: string;
387
+ backend: RuntimeProviderBackend;
388
+ compilation: RuntimeProviderCompilation;
389
+ injection: RuntimeProviderInjectionMode;
390
+ entries: Readonly<Partial<Record<RuntimeProviderModuleKind, RuntimeProviderEntry>>>;
391
+ capabilities: Readonly<RuntimeProviderCapabilities>;
392
+ hmr: Readonly<RuntimeProviderHmrDescriptor>;
393
+ contractVersion: number;
394
+ }
395
+ //#endregion
353
396
  //#region src/index.d.ts
354
397
  /**
355
398
  * @description 转义字符串中的正则特殊字符
@@ -384,4 +427,4 @@ declare function isObject(x: unknown): x is Record<string | symbol | number, unk
384
427
  */
385
428
  declare function isEmptyObject(obj: unknown): boolean;
386
429
  //#endregion
387
- export { MINI_PROGRAM_PLATFORM_ALIASES, MINI_PROGRAM_PLATFORM_DESCRIPTORS, MiniProgramLayoutHostResolver, MiniProgramLayoutHostWaitOptions, type MiniProgramPageIdentityRule, type MiniProgramPlatformDescriptor, type MiniProgramPlatformFamily, type MiniProgramRuntimeCapabilities, type MiniProgramRuntimeCapabilityName, type MiniProgramTemplatePreset, type MpPlatform, type OutputExtensions, addExtension, arrify, createMiniProgramLayoutHostRegistry, defu, defuOverrideArray, escapeStringRegexp, get, getDefaultMiniProgramPlatform, getDefaultMiniProgramRuntimeGlobalKey, getMiniProgramAppTypesPackage, getMiniProgramDefaultBuildTarget, getMiniProgramDirectivePrefix, getMiniProgramPlatformByRuntimeGlobalKey, getMiniProgramPlatformDescriptor, getMiniProgramRouteRuntimeGlobalKeys, getMiniProgramRuntimeCapabilities, getMiniProgramRuntimeGlobalKey, getMiniProgramRuntimeGlobalKeys, getMiniProgramRuntimeGlobalKeysByResolvePriority, getMiniProgramRuntimeHostConfigKey, getMiniProgramTemplatePreset, getSupportedMiniProgramDirectivePrefixes, getSupportedMiniProgramPlatforms, isEmptyObject, isObject, normalizeMiniProgramLayoutHostKeys, normalizeMiniProgramPlatform, removeExtension, removeExtensionDeep, resolveMiniProgramPageKeys, resolveMiniProgramPlatform, set, supportsMiniProgramAutoTouchAppStyle, supportsMiniProgramRuntimeCapability };
430
+ export { MINI_PROGRAM_PLATFORM_ALIASES, MINI_PROGRAM_PLATFORM_DESCRIPTORS, MiniProgramLayoutHostResolver, MiniProgramLayoutHostWaitOptions, type MiniProgramPageIdentityRule, type MiniProgramPlatformDescriptor, type MiniProgramPlatformFamily, type MiniProgramRuntimeCapabilities, type MiniProgramRuntimeCapabilityName, type MiniProgramTemplatePreset, type MpPlatform, type OutputExtensions, RuntimeProviderBackend, RuntimeProviderCapabilities, RuntimeProviderCompilation, RuntimeProviderDescriptorContract, RuntimeProviderEntry, RuntimeProviderHmrDescriptor, RuntimeProviderHmrMode, RuntimeProviderInjectionMode, RuntimeProviderModuleKind, RuntimeProviderVariant, addExtension, arrify, createMiniProgramLayoutHostRegistry, defu, defuOverrideArray, escapeStringRegexp, get, getDefaultMiniProgramPlatform, getDefaultMiniProgramRuntimeGlobalKey, getMiniProgramAppTypesPackage, getMiniProgramDefaultBuildTarget, getMiniProgramDirectivePrefix, getMiniProgramPlatformByRuntimeGlobalKey, getMiniProgramPlatformDescriptor, getMiniProgramRouteRuntimeGlobalKeys, getMiniProgramRuntimeCapabilities, getMiniProgramRuntimeGlobalKey, getMiniProgramRuntimeGlobalKeys, getMiniProgramRuntimeGlobalKeysByResolvePriority, getMiniProgramRuntimeHostConfigKey, getMiniProgramTemplatePreset, getSupportedMiniProgramDirectivePrefixes, getSupportedMiniProgramPlatforms, isEmptyObject, isObject, normalizeMiniProgramLayoutHostKeys, normalizeMiniProgramPlatform, removeExtension, removeExtensionDeep, resolveMiniProgramPageKeys, resolveMiniProgramPlatform, set, supportsMiniProgramAutoTouchAppStyle, supportsMiniProgramRuntimeCapability };
package/dist/node.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { CopyOptions, FsDirent, FsStats, JsonReadOptions, JsonWriteOptions, MoveOptions, fs } from "./fs/index.js";
2
-
3
2
  //#region src/node.d.ts
4
3
  /**
5
4
  * @description 生成稳定对象哈希,避免依赖已被禁用的 object-hash 包。
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@weapp-core/shared",
3
3
  "type": "module",
4
- "version": "3.0.5",
4
+ "version": "3.0.6",
5
5
  "description": "@weapp-core/shared",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",