@hot-updater/plugin-core 0.21.9 → 0.21.11
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/createBlobDatabasePlugin.d.cts +2 -2
- package/dist/createBlobDatabasePlugin.d.ts +2 -2
- package/dist/createDatabasePlugin.cjs +1 -1
- package/dist/createDatabasePlugin.d.cts +3 -6
- package/dist/createDatabasePlugin.d.ts +3 -6
- package/dist/createDatabasePlugin.js +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DatabasePlugin, DatabasePluginHooks } from "./types/index.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/createBlobDatabasePlugin.d.ts
|
|
4
4
|
|
|
@@ -33,6 +33,6 @@ declare const createBlobDatabasePlugin: <TContext = object>({
|
|
|
33
33
|
invalidatePaths: (context: TContext, paths: string[]) => Promise<void>;
|
|
34
34
|
hooks?: DatabasePluginHooks;
|
|
35
35
|
apiBasePath: string;
|
|
36
|
-
}) => (
|
|
36
|
+
}) => () => DatabasePlugin;
|
|
37
37
|
//#endregion
|
|
38
38
|
export { createBlobDatabasePlugin };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DatabasePlugin, DatabasePluginHooks } from "./types/index.js";
|
|
2
2
|
|
|
3
3
|
//#region src/createBlobDatabasePlugin.d.ts
|
|
4
4
|
|
|
@@ -33,6 +33,6 @@ declare const createBlobDatabasePlugin: <TContext = object>({
|
|
|
33
33
|
invalidatePaths: (context: TContext, paths: string[]) => Promise<void>;
|
|
34
34
|
hooks?: DatabasePluginHooks;
|
|
35
35
|
apiBasePath: string;
|
|
36
|
-
}) => (
|
|
36
|
+
}) => () => DatabasePlugin;
|
|
37
37
|
//#endregion
|
|
38
38
|
export { createBlobDatabasePlugin };
|
|
@@ -45,7 +45,7 @@ function createDatabasePlugin(name, abstractPlugin, hooks) {
|
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
47
|
const memoizedContext = (0, es_toolkit.memoize)(abstractPlugin?.getContext ?? (() => {}));
|
|
48
|
-
return (
|
|
48
|
+
return () => ({
|
|
49
49
|
name,
|
|
50
50
|
async getBundleById(bundleId) {
|
|
51
51
|
const context = memoizedContext();
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DatabasePlugin, DatabasePluginHooks, PaginationInfo } from "./types/index.cjs";
|
|
2
2
|
import { Bundle } from "@hot-updater/core";
|
|
3
3
|
|
|
4
4
|
//#region src/createDatabasePlugin.d.ts
|
|
5
|
-
interface BaseDatabaseUtils {
|
|
6
|
-
cwd: string;
|
|
7
|
-
}
|
|
8
5
|
interface AbstractDatabasePlugin<TContext = object> {
|
|
9
6
|
getContext?: () => TContext;
|
|
10
7
|
getBundleById: (context: TContext, bundleId: string) => Promise<Bundle | null>;
|
|
@@ -63,6 +60,6 @@ interface AbstractDatabasePlugin<TContext = object> {
|
|
|
63
60
|
* @param hooks - Optional hooks for plugin lifecycle events
|
|
64
61
|
* @returns A function that creates a database plugin instance
|
|
65
62
|
*/
|
|
66
|
-
declare function createDatabasePlugin<TContext = object>(name: string, abstractPlugin: AbstractDatabasePlugin<TContext>, hooks?: DatabasePluginHooks): (
|
|
63
|
+
declare function createDatabasePlugin<TContext = object>(name: string, abstractPlugin: AbstractDatabasePlugin<TContext>, hooks?: DatabasePluginHooks): () => DatabasePlugin;
|
|
67
64
|
//#endregion
|
|
68
|
-
export { AbstractDatabasePlugin,
|
|
65
|
+
export { AbstractDatabasePlugin, createDatabasePlugin };
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DatabasePlugin, DatabasePluginHooks, PaginationInfo } from "./types/index.js";
|
|
2
2
|
import { Bundle } from "@hot-updater/core";
|
|
3
3
|
|
|
4
4
|
//#region src/createDatabasePlugin.d.ts
|
|
5
|
-
interface BaseDatabaseUtils {
|
|
6
|
-
cwd: string;
|
|
7
|
-
}
|
|
8
5
|
interface AbstractDatabasePlugin<TContext = object> {
|
|
9
6
|
getContext?: () => TContext;
|
|
10
7
|
getBundleById: (context: TContext, bundleId: string) => Promise<Bundle | null>;
|
|
@@ -63,6 +60,6 @@ interface AbstractDatabasePlugin<TContext = object> {
|
|
|
63
60
|
* @param hooks - Optional hooks for plugin lifecycle events
|
|
64
61
|
* @returns A function that creates a database plugin instance
|
|
65
62
|
*/
|
|
66
|
-
declare function createDatabasePlugin<TContext = object>(name: string, abstractPlugin: AbstractDatabasePlugin<TContext>, hooks?: DatabasePluginHooks): (
|
|
63
|
+
declare function createDatabasePlugin<TContext = object>(name: string, abstractPlugin: AbstractDatabasePlugin<TContext>, hooks?: DatabasePluginHooks): () => DatabasePlugin;
|
|
67
64
|
//#endregion
|
|
68
|
-
export { AbstractDatabasePlugin,
|
|
65
|
+
export { AbstractDatabasePlugin, createDatabasePlugin };
|
|
@@ -43,7 +43,7 @@ function createDatabasePlugin(name, abstractPlugin, hooks) {
|
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
45
|
const memoizedContext = memoize(abstractPlugin?.getContext ?? (() => {}));
|
|
46
|
-
return (
|
|
46
|
+
return () => ({
|
|
47
47
|
name,
|
|
48
48
|
async getBundleById(bundleId) {
|
|
49
49
|
const context = memoizedContext();
|
package/dist/index.d.cts
CHANGED
|
@@ -3,10 +3,10 @@ import { BasePluginArgs, BuildPlugin, BuildPluginConfig, Bundle, ConfigInput, Da
|
|
|
3
3
|
import { PaginatedResult, PaginationOptions, calculatePagination } from "./calculatePagination.cjs";
|
|
4
4
|
import { CompressionFormat, CompressionFormatInfo, detectCompressionFormat, getCompressionMimeType, getContentType } from "./compressionFormat.cjs";
|
|
5
5
|
import { createBlobDatabasePlugin } from "./createBlobDatabasePlugin.cjs";
|
|
6
|
-
import { AbstractDatabasePlugin,
|
|
6
|
+
import { AbstractDatabasePlugin, createDatabasePlugin } from "./createDatabasePlugin.cjs";
|
|
7
7
|
import { createStorageKeyBuilder } from "./createStorageKeyBuilder.cjs";
|
|
8
8
|
import { filterCompatibleAppVersions } from "./filterCompatibleAppVersions.cjs";
|
|
9
9
|
import { generateMinBundleId } from "./generateMinBundleId.cjs";
|
|
10
10
|
import { ParsedStorageUri, parseStorageUri } from "./parseStorageUri.cjs";
|
|
11
11
|
import { semverSatisfies } from "./semverSatisfies.cjs";
|
|
12
|
-
export { AbstractDatabasePlugin,
|
|
12
|
+
export { AbstractDatabasePlugin, BasePluginArgs, BuildPlugin, BuildPluginConfig, BuiltIns, Bundle, CompressionFormat, CompressionFormatInfo, ConfigInput, DatabasePlugin, DatabasePluginHooks, HasMultipleCallSignatures, NativeBuildArgs, PaginatedResult, PaginationInfo, PaginationOptions, ParsedStorageUri, Platform, PlatformConfig, Primitive, RequiredDeep, StoragePlugin, StoragePluginHooks, calculatePagination, createBlobDatabasePlugin, createDatabasePlugin, createStorageKeyBuilder, detectCompressionFormat, filterCompatibleAppVersions, generateMinBundleId, getCompressionMimeType, getContentType, parseStorageUri, semverSatisfies };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,10 +3,10 @@ import { BasePluginArgs, BuildPlugin, BuildPluginConfig, Bundle, ConfigInput, Da
|
|
|
3
3
|
import { PaginatedResult, PaginationOptions, calculatePagination } from "./calculatePagination.js";
|
|
4
4
|
import { CompressionFormat, CompressionFormatInfo, detectCompressionFormat, getCompressionMimeType, getContentType } from "./compressionFormat.js";
|
|
5
5
|
import { createBlobDatabasePlugin } from "./createBlobDatabasePlugin.js";
|
|
6
|
-
import { AbstractDatabasePlugin,
|
|
6
|
+
import { AbstractDatabasePlugin, createDatabasePlugin } from "./createDatabasePlugin.js";
|
|
7
7
|
import { createStorageKeyBuilder } from "./createStorageKeyBuilder.js";
|
|
8
8
|
import { filterCompatibleAppVersions } from "./filterCompatibleAppVersions.js";
|
|
9
9
|
import { generateMinBundleId } from "./generateMinBundleId.js";
|
|
10
10
|
import { ParsedStorageUri, parseStorageUri } from "./parseStorageUri.js";
|
|
11
11
|
import { semverSatisfies } from "./semverSatisfies.js";
|
|
12
|
-
export { AbstractDatabasePlugin,
|
|
12
|
+
export { AbstractDatabasePlugin, BasePluginArgs, BuildPlugin, BuildPluginConfig, BuiltIns, Bundle, CompressionFormat, CompressionFormatInfo, ConfigInput, DatabasePlugin, DatabasePluginHooks, HasMultipleCallSignatures, NativeBuildArgs, PaginatedResult, PaginationInfo, PaginationOptions, ParsedStorageUri, Platform, PlatformConfig, Primitive, RequiredDeep, StoragePlugin, StoragePluginHooks, calculatePagination, createBlobDatabasePlugin, createDatabasePlugin, createStorageKeyBuilder, detectCompressionFormat, filterCompatibleAppVersions, generateMinBundleId, getCompressionMimeType, getContentType, parseStorageUri, semverSatisfies };
|
package/dist/types/index.d.cts
CHANGED
|
@@ -194,8 +194,8 @@ type ConfigInput = {
|
|
|
194
194
|
platform?: PlatformConfig;
|
|
195
195
|
nativeBuild?: NativeBuildArgs;
|
|
196
196
|
build: (args: BasePluginArgs) => Promise<BuildPlugin> | BuildPlugin;
|
|
197
|
-
storage: (
|
|
198
|
-
database: (
|
|
197
|
+
storage: () => Promise<StoragePlugin> | StoragePlugin;
|
|
198
|
+
database: () => Promise<DatabasePlugin> | DatabasePlugin;
|
|
199
199
|
};
|
|
200
200
|
//#endregion
|
|
201
201
|
export { BasePluginArgs, BuildPlugin, BuildPluginConfig, type Bundle$1 as Bundle, ConfigInput, DatabasePlugin, DatabasePluginHooks, NativeBuildArgs, PaginationInfo, type Platform$1 as Platform, PlatformConfig, StoragePlugin, StoragePluginHooks };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -194,8 +194,8 @@ type ConfigInput = {
|
|
|
194
194
|
platform?: PlatformConfig;
|
|
195
195
|
nativeBuild?: NativeBuildArgs;
|
|
196
196
|
build: (args: BasePluginArgs) => Promise<BuildPlugin> | BuildPlugin;
|
|
197
|
-
storage: (
|
|
198
|
-
database: (
|
|
197
|
+
storage: () => Promise<StoragePlugin> | StoragePlugin;
|
|
198
|
+
database: () => Promise<DatabasePlugin> | DatabasePlugin;
|
|
199
199
|
};
|
|
200
200
|
//#endregion
|
|
201
201
|
export { BasePluginArgs, BuildPlugin, BuildPluginConfig, type Bundle$1 as Bundle, ConfigInput, DatabasePlugin, DatabasePluginHooks, NativeBuildArgs, PaginationInfo, type Platform$1 as Platform, PlatformConfig, StoragePlugin, StoragePluginHooks };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/plugin-core",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "React Native OTA solution for self-hosted",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"es-toolkit": "^1.32.0",
|
|
43
43
|
"mime": "^4.0.4",
|
|
44
44
|
"semver": "^7.7.2",
|
|
45
|
-
"@hot-updater/core": "0.21.
|
|
45
|
+
"@hot-updater/core": "0.21.11"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/semver": "^7.5.8",
|
|
49
49
|
"typescript": "5.8.2",
|
|
50
|
-
"@hot-updater/test-utils": "0.21.
|
|
50
|
+
"@hot-updater/test-utils": "0.21.11"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"build": "tsdown",
|