@hot-updater/plugin-core 0.19.5 → 0.19.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.
package/dist/index.cjs CHANGED
@@ -18890,6 +18890,11 @@ const defaultConfig = {
18890
18890
  ignorePaths: []
18891
18891
  },
18892
18892
  console: { port: 1422 },
18893
+ nativeBuild: { android: {
18894
+ aab: true,
18895
+ variant: "Release",
18896
+ appModuleName: "app"
18897
+ } },
18893
18898
  build: () => {
18894
18899
  throw new Error("build plugin is required");
18895
18900
  },
package/dist/index.d.cts CHANGED
@@ -13,6 +13,17 @@ declare const log: {
13
13
  //#region src/cwd.d.ts
14
14
  declare const getCwd: () => string;
15
15
  //#endregion
16
+ //#region src/types/utils.d.ts
17
+ type Primitive = null | undefined | string | number | boolean | symbol | bigint;
18
+ type BuiltIns = Primitive | void | Date | RegExp;
19
+ type ExcludeUndefined<T> = Exclude<T, undefined>;
20
+ type HasMultipleCallSignatures<T extends (...arguments_: any[]) => unknown> = T extends {
21
+ (...arguments_: infer A): unknown;
22
+ (...arguments_: infer B): unknown;
23
+ } ? B extends A ? A extends B ? false : true : true : false;
24
+ type RequiredDeep<T, E extends ExcludeUndefined<T> = ExcludeUndefined<T>> = E extends BuiltIns ? E : E extends Map<infer KeyType, infer ValueType> ? Map<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : E extends Set<infer ItemType> ? Set<RequiredDeep<ItemType>> : E extends ReadonlyMap<infer KeyType, infer ValueType> ? ReadonlyMap<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : E extends ReadonlySet<infer ItemType> ? ReadonlySet<RequiredDeep<ItemType>> : E extends WeakMap<infer KeyType, infer ValueType> ? WeakMap<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : E extends WeakSet<infer ItemType> ? WeakSet<RequiredDeep<ItemType>> : E extends Promise<infer ValueType> ? Promise<RequiredDeep<ValueType>> : E extends ((...arguments_: any[]) => unknown) ? {} extends RequiredObjectDeep<E> ? E : HasMultipleCallSignatures<E> extends true ? E : ((...arguments_: Parameters<E>) => ReturnType<E>) & RequiredObjectDeep<E> : E extends object ? E extends Array<infer ItemType> ? ItemType[] extends E ? Array<RequiredDeep<ItemType>> : RequiredObjectDeep<E> : RequiredObjectDeep<E> : unknown;
25
+ type RequiredObjectDeep<ObjectType extends object> = { [KeyType in keyof ObjectType]-?: RequiredDeep<ObjectType[KeyType]> };
26
+ //#endregion
16
27
  //#region src/types/index.d.ts
17
28
  interface BasePluginArgs {
18
29
  cwd: string;
@@ -52,6 +63,14 @@ interface DatabasePluginHooks {
52
63
  onDatabaseUpdated?: () => Promise<void>;
53
64
  }
54
65
  interface BuildPlugin {
66
+ nativeBuild?: {
67
+ prebuild?: (args: {
68
+ platform: Platform$1;
69
+ }) => Promise<void>;
70
+ postbuild?: (args: {
71
+ platform: Platform$1;
72
+ }) => Promise<void>;
73
+ };
55
74
  build: (args: {
56
75
  platform: Platform$1;
57
76
  }) => Promise<{
@@ -61,6 +80,35 @@ interface BuildPlugin {
61
80
  }>;
62
81
  name: string;
63
82
  }
83
+ interface NativeBuildArgs {
84
+ /**
85
+ * Android specific configuration.
86
+ */
87
+ android?: {
88
+ /**
89
+ * Android application module build variant.
90
+ *
91
+ * @example Debug, Release
92
+ * @default Release
93
+ */
94
+ variant?: string;
95
+ /**
96
+ * Artifact type.
97
+ *
98
+ * If `true`, the generated artifact type is `.aab`.
99
+ * If `flase`, the generated artifact type is `apk`.
100
+ *
101
+ * @default true
102
+ */
103
+ aab?: boolean;
104
+ /**
105
+ * Android application module name.
106
+ *
107
+ * @default app
108
+ */
109
+ appModuleName?: string;
110
+ };
111
+ }
64
112
  interface StoragePlugin {
65
113
  uploadBundle: (bundleId: string, bundlePath: string) => Promise<{
66
114
  storageUri: string;
@@ -119,22 +167,12 @@ type ConfigInput = {
119
167
  */
120
168
  port?: number;
121
169
  };
170
+ nativeBuild?: NativeBuildArgs;
122
171
  build: (args: BasePluginArgs) => Promise<BuildPlugin> | BuildPlugin;
123
172
  storage: (args: BasePluginArgs) => Promise<StoragePlugin> | StoragePlugin;
124
173
  database: (args: BasePluginArgs) => Promise<DatabasePlugin> | DatabasePlugin;
125
174
  };
126
175
  //#endregion
127
- //#region src/types/utils.d.ts
128
- type Primitive = null | undefined | string | number | boolean | symbol | bigint;
129
- type BuiltIns = Primitive | void | Date | RegExp;
130
- type ExcludeUndefined<T> = Exclude<T, undefined>;
131
- type HasMultipleCallSignatures<T extends (...arguments_: any[]) => unknown> = T extends {
132
- (...arguments_: infer A): unknown;
133
- (...arguments_: infer B): unknown;
134
- } ? B extends A ? A extends B ? false : true : true : false;
135
- type RequiredDeep<T, E extends ExcludeUndefined<T> = ExcludeUndefined<T>> = E extends BuiltIns ? E : E extends Map<infer KeyType, infer ValueType> ? Map<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : E extends Set<infer ItemType> ? Set<RequiredDeep<ItemType>> : E extends ReadonlyMap<infer KeyType, infer ValueType> ? ReadonlyMap<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : E extends ReadonlySet<infer ItemType> ? ReadonlySet<RequiredDeep<ItemType>> : E extends WeakMap<infer KeyType, infer ValueType> ? WeakMap<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : E extends WeakSet<infer ItemType> ? WeakSet<RequiredDeep<ItemType>> : E extends Promise<infer ValueType> ? Promise<RequiredDeep<ValueType>> : E extends ((...arguments_: any[]) => unknown) ? {} extends RequiredObjectDeep<E> ? E : HasMultipleCallSignatures<E> extends true ? E : ((...arguments_: Parameters<E>) => ReturnType<E>) & RequiredObjectDeep<E> : E extends object ? E extends Array<infer ItemType> ? ItemType[] extends E ? Array<RequiredDeep<ItemType>> : RequiredObjectDeep<E> : RequiredObjectDeep<E> : unknown;
136
- type RequiredObjectDeep<ObjectType extends object> = { [KeyType in keyof ObjectType]-?: RequiredDeep<ObjectType[KeyType]> };
137
- //#endregion
138
176
  //#region src/loadConfig.d.ts
139
177
  type HotUpdaterConfigOptions = {
140
178
  platform: Platform;
@@ -354,4 +392,4 @@ interface PaginatedResult {
354
392
  */
355
393
  declare function calculatePagination(total: number, options: PaginationOptions): PaginationInfo;
356
394
  //#endregion
357
- export { AbstractDatabasePlugin, BaseDatabaseUtils, BasePluginArgs, BuildPlugin, BuildPluginConfig, BuildType, Bundle, ConfigBuilder, ConfigInput, ConfigResponse, DatabasePlugin, DatabasePluginHooks, HotUpdaterConfigOptions, IConfigBuilder, ImportInfo, PaginatedResult, PaginationInfo, PaginationOptions, Platform, ProviderConfig, StoragePlugin, StoragePluginHooks, banner, calculatePagination, copyDirToTmp, createBlobDatabasePlugin, createDatabasePlugin, createZip, createZipTargetFiles, getCwd, link, loadConfig, loadConfigSync, log, makeEnv, printBanner, transformEnv, transformTemplate };
395
+ export { AbstractDatabasePlugin, BaseDatabaseUtils, BasePluginArgs, BuildPlugin, BuildPluginConfig, BuildType, BuiltIns, Bundle, ConfigBuilder, ConfigInput, ConfigResponse, DatabasePlugin, DatabasePluginHooks, HasMultipleCallSignatures, HotUpdaterConfigOptions, IConfigBuilder, ImportInfo, NativeBuildArgs, PaginatedResult, PaginationInfo, PaginationOptions, Platform, Primitive, ProviderConfig, RequiredDeep, StoragePlugin, StoragePluginHooks, banner, calculatePagination, copyDirToTmp, createBlobDatabasePlugin, createDatabasePlugin, createZip, createZipTargetFiles, getCwd, link, loadConfig, loadConfigSync, log, makeEnv, printBanner, transformEnv, transformTemplate };
package/dist/index.d.ts CHANGED
@@ -13,6 +13,17 @@ declare const log: {
13
13
  //#region src/cwd.d.ts
14
14
  declare const getCwd: () => string;
15
15
  //#endregion
16
+ //#region src/types/utils.d.ts
17
+ type Primitive = null | undefined | string | number | boolean | symbol | bigint;
18
+ type BuiltIns = Primitive | void | Date | RegExp;
19
+ type ExcludeUndefined<T> = Exclude<T, undefined>;
20
+ type HasMultipleCallSignatures<T extends (...arguments_: any[]) => unknown> = T extends {
21
+ (...arguments_: infer A): unknown;
22
+ (...arguments_: infer B): unknown;
23
+ } ? B extends A ? A extends B ? false : true : true : false;
24
+ type RequiredDeep<T, E extends ExcludeUndefined<T> = ExcludeUndefined<T>> = E extends BuiltIns ? E : E extends Map<infer KeyType, infer ValueType> ? Map<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : E extends Set<infer ItemType> ? Set<RequiredDeep<ItemType>> : E extends ReadonlyMap<infer KeyType, infer ValueType> ? ReadonlyMap<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : E extends ReadonlySet<infer ItemType> ? ReadonlySet<RequiredDeep<ItemType>> : E extends WeakMap<infer KeyType, infer ValueType> ? WeakMap<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : E extends WeakSet<infer ItemType> ? WeakSet<RequiredDeep<ItemType>> : E extends Promise<infer ValueType> ? Promise<RequiredDeep<ValueType>> : E extends ((...arguments_: any[]) => unknown) ? {} extends RequiredObjectDeep<E> ? E : HasMultipleCallSignatures<E> extends true ? E : ((...arguments_: Parameters<E>) => ReturnType<E>) & RequiredObjectDeep<E> : E extends object ? E extends Array<infer ItemType> ? ItemType[] extends E ? Array<RequiredDeep<ItemType>> : RequiredObjectDeep<E> : RequiredObjectDeep<E> : unknown;
25
+ type RequiredObjectDeep<ObjectType extends object> = { [KeyType in keyof ObjectType]-?: RequiredDeep<ObjectType[KeyType]> };
26
+ //#endregion
16
27
  //#region src/types/index.d.ts
17
28
  interface BasePluginArgs {
18
29
  cwd: string;
@@ -52,6 +63,14 @@ interface DatabasePluginHooks {
52
63
  onDatabaseUpdated?: () => Promise<void>;
53
64
  }
54
65
  interface BuildPlugin {
66
+ nativeBuild?: {
67
+ prebuild?: (args: {
68
+ platform: Platform$1;
69
+ }) => Promise<void>;
70
+ postbuild?: (args: {
71
+ platform: Platform$1;
72
+ }) => Promise<void>;
73
+ };
55
74
  build: (args: {
56
75
  platform: Platform$1;
57
76
  }) => Promise<{
@@ -61,6 +80,35 @@ interface BuildPlugin {
61
80
  }>;
62
81
  name: string;
63
82
  }
83
+ interface NativeBuildArgs {
84
+ /**
85
+ * Android specific configuration.
86
+ */
87
+ android?: {
88
+ /**
89
+ * Android application module build variant.
90
+ *
91
+ * @example Debug, Release
92
+ * @default Release
93
+ */
94
+ variant?: string;
95
+ /**
96
+ * Artifact type.
97
+ *
98
+ * If `true`, the generated artifact type is `.aab`.
99
+ * If `flase`, the generated artifact type is `apk`.
100
+ *
101
+ * @default true
102
+ */
103
+ aab?: boolean;
104
+ /**
105
+ * Android application module name.
106
+ *
107
+ * @default app
108
+ */
109
+ appModuleName?: string;
110
+ };
111
+ }
64
112
  interface StoragePlugin {
65
113
  uploadBundle: (bundleId: string, bundlePath: string) => Promise<{
66
114
  storageUri: string;
@@ -119,22 +167,12 @@ type ConfigInput = {
119
167
  */
120
168
  port?: number;
121
169
  };
170
+ nativeBuild?: NativeBuildArgs;
122
171
  build: (args: BasePluginArgs) => Promise<BuildPlugin> | BuildPlugin;
123
172
  storage: (args: BasePluginArgs) => Promise<StoragePlugin> | StoragePlugin;
124
173
  database: (args: BasePluginArgs) => Promise<DatabasePlugin> | DatabasePlugin;
125
174
  };
126
175
  //#endregion
127
- //#region src/types/utils.d.ts
128
- type Primitive = null | undefined | string | number | boolean | symbol | bigint;
129
- type BuiltIns = Primitive | void | Date | RegExp;
130
- type ExcludeUndefined<T> = Exclude<T, undefined>;
131
- type HasMultipleCallSignatures<T extends (...arguments_: any[]) => unknown> = T extends {
132
- (...arguments_: infer A): unknown;
133
- (...arguments_: infer B): unknown;
134
- } ? B extends A ? A extends B ? false : true : true : false;
135
- type RequiredDeep<T, E extends ExcludeUndefined<T> = ExcludeUndefined<T>> = E extends BuiltIns ? E : E extends Map<infer KeyType, infer ValueType> ? Map<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : E extends Set<infer ItemType> ? Set<RequiredDeep<ItemType>> : E extends ReadonlyMap<infer KeyType, infer ValueType> ? ReadonlyMap<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : E extends ReadonlySet<infer ItemType> ? ReadonlySet<RequiredDeep<ItemType>> : E extends WeakMap<infer KeyType, infer ValueType> ? WeakMap<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : E extends WeakSet<infer ItemType> ? WeakSet<RequiredDeep<ItemType>> : E extends Promise<infer ValueType> ? Promise<RequiredDeep<ValueType>> : E extends ((...arguments_: any[]) => unknown) ? {} extends RequiredObjectDeep<E> ? E : HasMultipleCallSignatures<E> extends true ? E : ((...arguments_: Parameters<E>) => ReturnType<E>) & RequiredObjectDeep<E> : E extends object ? E extends Array<infer ItemType> ? ItemType[] extends E ? Array<RequiredDeep<ItemType>> : RequiredObjectDeep<E> : RequiredObjectDeep<E> : unknown;
136
- type RequiredObjectDeep<ObjectType extends object> = { [KeyType in keyof ObjectType]-?: RequiredDeep<ObjectType[KeyType]> };
137
- //#endregion
138
176
  //#region src/loadConfig.d.ts
139
177
  type HotUpdaterConfigOptions = {
140
178
  platform: Platform;
@@ -354,4 +392,4 @@ interface PaginatedResult {
354
392
  */
355
393
  declare function calculatePagination(total: number, options: PaginationOptions): PaginationInfo;
356
394
  //#endregion
357
- export { AbstractDatabasePlugin, BaseDatabaseUtils, BasePluginArgs, BuildPlugin, BuildPluginConfig, BuildType, Bundle, ConfigBuilder, ConfigInput, ConfigResponse, DatabasePlugin, DatabasePluginHooks, HotUpdaterConfigOptions, IConfigBuilder, ImportInfo, PaginatedResult, PaginationInfo, PaginationOptions, Platform, ProviderConfig, StoragePlugin, StoragePluginHooks, banner, calculatePagination, copyDirToTmp, createBlobDatabasePlugin, createDatabasePlugin, createZip, createZipTargetFiles, getCwd, link, loadConfig, loadConfigSync, log, makeEnv, printBanner, transformEnv, transformTemplate };
395
+ export { AbstractDatabasePlugin, BaseDatabaseUtils, BasePluginArgs, BuildPlugin, BuildPluginConfig, BuildType, BuiltIns, Bundle, ConfigBuilder, ConfigInput, ConfigResponse, DatabasePlugin, DatabasePluginHooks, HasMultipleCallSignatures, HotUpdaterConfigOptions, IConfigBuilder, ImportInfo, NativeBuildArgs, PaginatedResult, PaginationInfo, PaginationOptions, Platform, Primitive, ProviderConfig, RequiredDeep, StoragePlugin, StoragePluginHooks, banner, calculatePagination, copyDirToTmp, createBlobDatabasePlugin, createDatabasePlugin, createZip, createZipTargetFiles, getCwd, link, loadConfig, loadConfigSync, log, makeEnv, printBanner, transformEnv, transformTemplate };
package/dist/index.js CHANGED
@@ -18892,6 +18892,11 @@ const defaultConfig = {
18892
18892
  ignorePaths: []
18893
18893
  },
18894
18894
  console: { port: 1422 },
18895
+ nativeBuild: { android: {
18896
+ aab: true,
18897
+ variant: "Release",
18898
+ appModuleName: "app"
18899
+ } },
18895
18900
  build: () => {
18896
18901
  throw new Error("build plugin is required");
18897
18902
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hot-updater/plugin-core",
3
- "version": "0.19.5",
3
+ "version": "0.19.6",
4
4
  "type": "module",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "sideEffects": false,
@@ -45,7 +45,7 @@
45
45
  "cosmiconfig": "9.0.0",
46
46
  "cosmiconfig-typescript-loader": "5.0.0",
47
47
  "oxc-transform": "0.72.0",
48
- "@hot-updater/core": "0.19.5"
48
+ "@hot-updater/core": "0.19.6"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@types/node": "^22.7.5",
@@ -55,7 +55,7 @@
55
55
  "picocolors": "^1.0.0",
56
56
  "typescript": "5.8.2",
57
57
  "workspace-tools": "^0.36.4",
58
- "@hot-updater/plugin-core": "0.19.5"
58
+ "@hot-updater/plugin-core": "0.19.6"
59
59
  },
60
60
  "scripts": {
61
61
  "build": "tsdown",