hot-updater 0.34.0 → 0.35.0
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.mjs +11 -31
- package/package.json +14 -14
package/dist/index.mjs
CHANGED
|
@@ -30,7 +30,7 @@ import { Buffer as Buffer$1 } from "node:buffer";
|
|
|
30
30
|
import { pipeline } from "stream/promises";
|
|
31
31
|
import { constants as constants$2, createBrotliCompress } from "zlib";
|
|
32
32
|
import { assertNodeStoragePlugin, getContentAddressedAssetStoragePath } from "@hot-updater/plugin-core";
|
|
33
|
-
import { createBundleDiff } from "@hot-updater/server";
|
|
33
|
+
import { createBundleDiff, createMigrator, generateSchema } from "@hot-updater/server/db";
|
|
34
34
|
import net from "node:net";
|
|
35
35
|
import { setTimeout as setTimeout$1 } from "timers/promises";
|
|
36
36
|
import { createJiti } from "jiti";
|
|
@@ -38112,18 +38112,6 @@ var GenerateExit = class extends Error {
|
|
|
38112
38112
|
const requestGenerateExit = (code) => {
|
|
38113
38113
|
throw new GenerateExit(code);
|
|
38114
38114
|
};
|
|
38115
|
-
function ensureMigratorSupport(hotUpdater, adapterName) {
|
|
38116
|
-
if (!("createMigrator" in hotUpdater) || typeof hotUpdater.createMigrator !== "function") {
|
|
38117
|
-
p.log.error(`${adapterName}: createMigrator() is required.`);
|
|
38118
|
-
requestGenerateExit(1);
|
|
38119
|
-
}
|
|
38120
|
-
}
|
|
38121
|
-
function ensureSchemaGeneratorSupport(hotUpdater, adapterName) {
|
|
38122
|
-
if (!("generateSchema" in hotUpdater) || typeof hotUpdater.generateSchema !== "function") {
|
|
38123
|
-
p.log.error(`${adapterName}: generateSchema() is required.`);
|
|
38124
|
-
requestGenerateExit(1);
|
|
38125
|
-
}
|
|
38126
|
-
}
|
|
38127
38115
|
//#endregion
|
|
38128
38116
|
//#region src/commands/utils/prisma-schema-merger.ts
|
|
38129
38117
|
const HOT_UPDATER_BEGIN_MARKER = "// --- BEGIN HOT-UPDATER MODELS (DO NOT EDIT) ---";
|
|
@@ -53534,11 +53522,15 @@ async function generateStandaloneSQL(options) {
|
|
|
53534
53522
|
const s = p.spinner();
|
|
53535
53523
|
s.start("Generating SQL from database schema");
|
|
53536
53524
|
const db = new Kysely({ dialect: createDialect(dbType) });
|
|
53537
|
-
const [{ createHotUpdater }, { kyselyAdapter }] = await Promise.all([
|
|
53538
|
-
|
|
53525
|
+
const [{ createHotUpdater }, { createMigrator }, { kyselyAdapter }] = await Promise.all([
|
|
53526
|
+
import("@hot-updater/server"),
|
|
53527
|
+
import("@hot-updater/server/db"),
|
|
53528
|
+
import("@hot-updater/server/adapters/kysely")
|
|
53529
|
+
]);
|
|
53530
|
+
const result = await createMigrator(createHotUpdater({ database: kyselyAdapter({
|
|
53539
53531
|
db,
|
|
53540
53532
|
provider: dbType
|
|
53541
|
-
}) })
|
|
53533
|
+
}) })).migrateToLatest({
|
|
53542
53534
|
mode: "from-schema",
|
|
53543
53535
|
updateSettings: false
|
|
53544
53536
|
});
|
|
@@ -53837,8 +53829,7 @@ async function generate(options) {
|
|
|
53837
53829
|
* Generate SQL migration files using createMigrator (for kysely/mongodb)
|
|
53838
53830
|
*/
|
|
53839
53831
|
async function generateWithMigrator(hotUpdater, absoluteOutputDir, skipConfirm, s) {
|
|
53840
|
-
|
|
53841
|
-
const result = await hotUpdater.createMigrator().migrateToLatest({
|
|
53832
|
+
const result = await createMigrator(hotUpdater).migrateToLatest({
|
|
53842
53833
|
mode: "from-schema",
|
|
53843
53834
|
updateSettings: true
|
|
53844
53835
|
});
|
|
@@ -53893,8 +53884,7 @@ async function generateWithMigrator(hotUpdater, absoluteOutputDir, skipConfirm,
|
|
|
53893
53884
|
* Generate TypeScript schema files using generateSchema (for drizzle/prisma/typeorm)
|
|
53894
53885
|
*/
|
|
53895
53886
|
async function generateWithSchemaGenerator(hotUpdater, adapterName, absoluteOutputDir, skipConfirm, s) {
|
|
53896
|
-
|
|
53897
|
-
const schemaResult = hotUpdater.generateSchema("latest");
|
|
53887
|
+
const schemaResult = generateSchema(hotUpdater, "latest");
|
|
53898
53888
|
s.stop("Analysis complete");
|
|
53899
53889
|
const schemaCode = schemaResult.code;
|
|
53900
53890
|
if (!schemaCode || schemaCode.trim() === "") {
|
|
@@ -54204,15 +54194,6 @@ const keysRemove = async (options = {}) => {
|
|
|
54204
54194
|
//#endregion
|
|
54205
54195
|
//#region src/commands/utils/adapter-strategies.ts
|
|
54206
54196
|
/**
|
|
54207
|
-
* Validate that hotUpdater has the createMigrator method
|
|
54208
|
-
*/
|
|
54209
|
-
function validateMigratorSupport(hotUpdater, adapterName) {
|
|
54210
|
-
if (!("createMigrator" in hotUpdater) || typeof hotUpdater.createMigrator !== "function") {
|
|
54211
|
-
p.log.error(`${adapterName}: createMigrator() is required.`);
|
|
54212
|
-
process.exit(1);
|
|
54213
|
-
}
|
|
54214
|
-
}
|
|
54215
|
-
/**
|
|
54216
54197
|
* Show error message for unsupported migrate operation
|
|
54217
54198
|
*/
|
|
54218
54199
|
function showMigrateUnsupportedError(adapterName) {
|
|
@@ -54371,8 +54352,7 @@ async function migrate(options) {
|
|
|
54371
54352
|
* Run migrations using createMigrator (for kysely/mongodb)
|
|
54372
54353
|
*/
|
|
54373
54354
|
async function migrateWithMigrator(hotUpdater, skipConfirm, s) {
|
|
54374
|
-
|
|
54375
|
-
const migrator = hotUpdater.createMigrator();
|
|
54355
|
+
const migrator = createMigrator(hotUpdater);
|
|
54376
54356
|
const currentVersion = await migrator.getVersion();
|
|
54377
54357
|
const result = await migrator.migrateToLatest({
|
|
54378
54358
|
mode: "from-schema",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hot-updater",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.35.0",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20.19.0"
|
|
7
7
|
},
|
|
@@ -49,13 +49,13 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"jiti": "2.6.1",
|
|
52
|
-
"@hot-updater/android-helper": "0.
|
|
53
|
-
"@hot-updater/apple-helper": "0.
|
|
54
|
-
"@hot-updater/
|
|
55
|
-
"@hot-updater/
|
|
56
|
-
"@hot-updater/
|
|
57
|
-
"@hot-updater/plugin-core": "0.
|
|
58
|
-
"@hot-updater/server": "0.
|
|
52
|
+
"@hot-updater/android-helper": "0.35.0",
|
|
53
|
+
"@hot-updater/apple-helper": "0.35.0",
|
|
54
|
+
"@hot-updater/cli-tools": "0.35.0",
|
|
55
|
+
"@hot-updater/console": "0.35.0",
|
|
56
|
+
"@hot-updater/core": "0.35.0",
|
|
57
|
+
"@hot-updater/plugin-core": "0.35.0",
|
|
58
|
+
"@hot-updater/server": "0.35.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@bacons/xcode": "1.0.0-alpha.24",
|
|
@@ -78,12 +78,12 @@
|
|
|
78
78
|
"tsdown": "0.21.6",
|
|
79
79
|
"sql-formatter": "15.6.10",
|
|
80
80
|
"typescript": "6.0.2",
|
|
81
|
-
"@hot-updater/
|
|
82
|
-
"@hot-updater/
|
|
83
|
-
"@hot-updater/
|
|
84
|
-
"@hot-updater/server": "0.
|
|
85
|
-
"@hot-updater/
|
|
86
|
-
"@hot-updater/test-utils": "0.
|
|
81
|
+
"@hot-updater/aws": "0.35.0",
|
|
82
|
+
"@hot-updater/cloudflare": "0.35.0",
|
|
83
|
+
"@hot-updater/firebase": "0.35.0",
|
|
84
|
+
"@hot-updater/server": "0.35.0",
|
|
85
|
+
"@hot-updater/supabase": "0.35.0",
|
|
86
|
+
"@hot-updater/test-utils": "0.35.0"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
89
|
"@expo/fingerprint": "*",
|