@hot-updater/cli-tools 1.0.0-rc.46 → 1.0.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.d.mts +1 -5
- package/dist/index.mjs +2 -39
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -369,17 +369,13 @@ declare const writeHotUpdaterConfig: (scaffold: HotUpdaterConfigScaffold, filePa
|
|
|
369
369
|
/**
|
|
370
370
|
* Writes hot-updater.config.ts and says what it did. `settings` names the
|
|
371
371
|
* provider in messages, such as "Supabase". A config it cannot merge is
|
|
372
|
-
* kept, with what to add to it.
|
|
373
|
-
* removed only after a successful config write and when the config no longer
|
|
374
|
-
* references it. A file the project wrote is kept with a cleanup notice.
|
|
372
|
+
* kept, with what to add to it.
|
|
375
373
|
*/
|
|
376
374
|
declare const writeHotUpdaterFiles: (scaffold: HotUpdaterConfigScaffold, { cwd, settings }: {
|
|
377
375
|
cwd?: string;
|
|
378
376
|
settings: string;
|
|
379
377
|
}) => Promise<{
|
|
380
378
|
readonly config: WriteHotUpdaterConfigResult;
|
|
381
|
-
/** What became of hotUpdater.plugins.ts, when there was one. */
|
|
382
|
-
readonly pluginsFile?: "removed" | "kept";
|
|
383
379
|
}>;
|
|
384
380
|
//#endregion
|
|
385
381
|
//#region src/hotUpdaterEnv.d.ts
|
package/dist/index.mjs
CHANGED
|
@@ -44797,20 +44797,10 @@ const renderServerSettings = (scaffold) => {
|
|
|
44797
44797
|
].join("\n")
|
|
44798
44798
|
].filter(Boolean).join("\n\n");
|
|
44799
44799
|
};
|
|
44800
|
-
/** Where an older init wrote a managed server's plugins, which the config lists now. */
|
|
44801
|
-
const PLUGINS_FILE_PATH = "hotUpdater.plugins.ts";
|
|
44802
|
-
/**
|
|
44803
|
-
* Whether `text` is the plugins file an older init wrote: comments and a
|
|
44804
|
-
* re-export of a provider package's former `plugins`, which the config's
|
|
44805
|
-
* `plugins` list replaces.
|
|
44806
|
-
*/
|
|
44807
|
-
const isGeneratedPluginsFile = (text) => /^export\{plugins\}from(["'])@hot-updater\/[\w-]+\1;?$/u.test(text.replace(/^\s*\/\/.*$/gmu, "").replace(/\s+/gu, ""));
|
|
44808
44800
|
/**
|
|
44809
44801
|
* Writes hot-updater.config.ts and says what it did. `settings` names the
|
|
44810
44802
|
* provider in messages, such as "Supabase". A config it cannot merge is
|
|
44811
|
-
* kept, with what to add to it.
|
|
44812
|
-
* removed only after a successful config write and when the config no longer
|
|
44813
|
-
* references it. A file the project wrote is kept with a cleanup notice.
|
|
44803
|
+
* kept, with what to add to it.
|
|
44814
44804
|
*/
|
|
44815
44805
|
const writeHotUpdaterFiles = async (scaffold, { cwd = process.cwd(), settings }) => {
|
|
44816
44806
|
const config = await writeHotUpdaterConfig(scaffold, path.join(cwd, HOT_UPDATER_CONFIG_PATH));
|
|
@@ -44822,33 +44812,7 @@ const writeHotUpdaterFiles = async (scaffold, { cwd = process.cwd(), settings })
|
|
|
44822
44812
|
"",
|
|
44823
44813
|
renderServerSettings(scaffold)
|
|
44824
44814
|
].join("\n"));
|
|
44825
|
-
|
|
44826
|
-
const pluginsText = await readTextFile(pluginsPath);
|
|
44827
|
-
if (pluginsText === null) return { config };
|
|
44828
|
-
if (config.status === "skipped") return {
|
|
44829
|
-
config,
|
|
44830
|
-
pluginsFile: "kept"
|
|
44831
|
-
};
|
|
44832
|
-
if ((await fs$1.readFile(config.path, "utf-8")).includes("./hotUpdater.plugins")) {
|
|
44833
|
-
p.log.warn(`Kept '${PLUGINS_FILE_PATH}': '${HOT_UPDATER_CONFIG_PATH}' still references it.`);
|
|
44834
|
-
return {
|
|
44835
|
-
config,
|
|
44836
|
-
pluginsFile: "kept"
|
|
44837
|
-
};
|
|
44838
|
-
}
|
|
44839
|
-
if (isGeneratedPluginsFile(pluginsText)) {
|
|
44840
|
-
await fs$1.rm(pluginsPath);
|
|
44841
|
-
p.log.success(`Removed '${PLUGINS_FILE_PATH}': \`plugins\` in '${HOT_UPDATER_CONFIG_PATH}' lists the plugins the server runs.`);
|
|
44842
|
-
return {
|
|
44843
|
-
config,
|
|
44844
|
-
pluginsFile: "removed"
|
|
44845
|
-
};
|
|
44846
|
-
}
|
|
44847
|
-
p.log.warn(`Nothing reads '${pluginsPath}' anymore: \`plugins\` in '${HOT_UPDATER_CONFIG_PATH}' lists the plugins the server runs. Delete it.`);
|
|
44848
|
-
return {
|
|
44849
|
-
config,
|
|
44850
|
-
pluginsFile: "kept"
|
|
44851
|
-
};
|
|
44815
|
+
return { config };
|
|
44852
44816
|
};
|
|
44853
44817
|
//#endregion
|
|
44854
44818
|
//#region src/initOptions.ts
|
|
@@ -45276,7 +45240,6 @@ const isServerDefinition = (value) => isRecord(value) && isRecord(value.database
|
|
|
45276
45240
|
*/
|
|
45277
45241
|
const serverDefinitionOf = (value, source = "The server definition") => {
|
|
45278
45242
|
if (isServerDefinition(value)) return value;
|
|
45279
|
-
if (isRecord(value) && "handlers" in value) throw new ServerDefinitionError(`${source} exports a hotUpdater from an older @hot-updater/server. Upgrade @hot-updater/server to the version of hot-updater.`);
|
|
45280
45243
|
throw new ServerDefinitionError(`${source} must export hotUpdater: the server createHotUpdater({ database, storage, plugins }) returns.`);
|
|
45281
45244
|
};
|
|
45282
45245
|
const fail = (message) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/cli-tools",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20.19.0"
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"oxc-parser": "0.141.0",
|
|
50
50
|
"oxc-transform": "0.141.0",
|
|
51
51
|
"unconfig": "7.5.0",
|
|
52
|
-
"@hot-updater/protocol": "1.0.0
|
|
53
|
-
"@hot-updater/plugin-core": "1.0.0
|
|
54
|
-
"@hot-updater/server": "1.0.0
|
|
52
|
+
"@hot-updater/protocol": "1.0.0",
|
|
53
|
+
"@hot-updater/plugin-core": "1.0.0",
|
|
54
|
+
"@hot-updater/server": "1.0.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@clack/prompts": "1.7.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"tar": "^7.5.16",
|
|
66
66
|
"verkit": "0.4.0",
|
|
67
67
|
"workspace-tools": "^0.41.7",
|
|
68
|
-
"@hot-updater/test-utils": "1.0.0
|
|
68
|
+
"@hot-updater/test-utils": "1.0.0"
|
|
69
69
|
},
|
|
70
70
|
"inlinedDependencies": {
|
|
71
71
|
"@babel/code-frame": "7.29.0",
|