@hot-updater/cli-tools 1.0.0-rc.16 → 1.0.0-rc.17
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 +38 -5
- package/dist/index.mjs +45 -5
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -32,8 +32,40 @@ declare class BuildLogger {
|
|
|
32
32
|
private showLogFileLocation;
|
|
33
33
|
}
|
|
34
34
|
//#endregion
|
|
35
|
-
//#region src/
|
|
36
|
-
|
|
35
|
+
//#region src/appSetup.d.ts
|
|
36
|
+
/** The credential init gives an app, through the server's clientAuth plugin. */
|
|
37
|
+
interface AppClientCredential {
|
|
38
|
+
/** Its name in output, such as "API key". */
|
|
39
|
+
readonly label: string;
|
|
40
|
+
/** The request header that carries it. */
|
|
41
|
+
readonly header: string;
|
|
42
|
+
readonly value: string;
|
|
43
|
+
}
|
|
44
|
+
/** A client plugin the server's plugins ask an app to add. */
|
|
45
|
+
interface AppClientPlugin {
|
|
46
|
+
/** The module that exports it. */
|
|
47
|
+
readonly module: string;
|
|
48
|
+
/** The export, which the app calls with no arguments. */
|
|
49
|
+
readonly name: string;
|
|
50
|
+
}
|
|
51
|
+
interface AppSetup {
|
|
52
|
+
readonly credential?: AppClientCredential;
|
|
53
|
+
readonly clientPlugins?: readonly AppClientPlugin[];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The App.tsx code init prints: `HotUpdater.init` with the server's URL,
|
|
57
|
+
* the header that carries the client credential when the server takes one,
|
|
58
|
+
* and the client plugins the server's plugins ask for.
|
|
59
|
+
*/
|
|
60
|
+
declare const renderAppSetup: ({ baseURL, credential, clientPlugins }: AppSetup & {
|
|
61
|
+
readonly baseURL: string;
|
|
62
|
+
}) => string;
|
|
63
|
+
/** Prints the App.tsx code, when the URL is known, and the app's credential. */
|
|
64
|
+
declare const printAppSetup: ({ baseURL, ...setup }: AppSetup & {
|
|
65
|
+
readonly baseURL?: string;
|
|
66
|
+
/** Required, so each init passes its server plugins' client plugins. */
|
|
67
|
+
readonly clientPlugins: readonly AppClientPlugin[];
|
|
68
|
+
}) => void;
|
|
37
69
|
//#endregion
|
|
38
70
|
//#region src/banner.d.ts
|
|
39
71
|
declare const link: (url: string) => string;
|
|
@@ -293,8 +325,9 @@ declare const writeHotUpdaterPlugins: (pkg: string, filePath?: string) => Promis
|
|
|
293
325
|
declare const generateHotUpdaterPlugins: (pkg: string, filePath?: string) => Promise<WriteHotUpdaterPluginsResult>;
|
|
294
326
|
/**
|
|
295
327
|
* The plugins a project's `hotUpdater.plugins.ts` exports, which its server
|
|
296
|
-
* runs; undefined when the project has no such file. The console
|
|
297
|
-
* them in process
|
|
328
|
+
* runs; undefined when the project has no such file. The console and the CLI
|
|
329
|
+
* assemble them in process as the server does, for the features and commands
|
|
330
|
+
* the plugins add.
|
|
298
331
|
*/
|
|
299
332
|
declare const loadHotUpdaterPlugins: (cwd?: string) => Promise<readonly unknown[] | undefined>;
|
|
300
333
|
//#endregion
|
|
@@ -1733,4 +1766,4 @@ type TransformTemplateArgs<T extends string> = { [Key in ExtractPlaceholders<T>]
|
|
|
1733
1766
|
*/
|
|
1734
1767
|
declare function transformTemplate<T extends string>(templateString: T, values: TransformTemplateArgs<T>): string;
|
|
1735
1768
|
//#endregion
|
|
1736
|
-
export { BuildLogger, BuildLoggerConfig, BuildType, BundleSigningSession, ConfigBuilder, ConfigBuilderScaffold, ConfigResponse, CreateHotUpdaterConfigScaffoldFromBuilderOptions, CreateHotUpdaterConfigScaffoldOptions, HOT_UPDATER_PLUGINS_PATH, HOT_UPDATER_SERVER_PACKAGE_VERSION_ENV, HotUpdateDirUtil, HotUpdaterConfigOptions, HotUpdaterConfigScaffold, HotUpdaterInitEnv, HotUpdaterLogWriter, IConfigBuilder, ImportInfo, InitEnvFileError, InitError, InitProviderDefinition, InitProviderInputDefinition, InitProviderInputPersistence, LEGACY_BUNDLE_ERROR, LegacyInfrastructureError, ManagedHelperStatement, ManagedHelperStrategy, MissingInitInputsError, PromptProgress, PromptSpinner, ProviderConfig, ReactNativeMetadata, ReadPackageUpResult, RunInitOptions, WriteHotUpdaterConfigResult, WriteHotUpdaterPluginsResult, assertInfrastructureGenerationAtUrl, assertInfrastructureGenerationPayload, assertInitInputs, assertInitProviderInputs, banner, typedColors as colors, confirmInitInputPersistence, copyDirToTmp, createCopiedBundleArtifacts, createHotUpdaterConfigScaffold, createHotUpdaterConfigScaffoldFromBuilder, createLogWriter, createTarBrTargetFiles, createZip, decryptJson, defineInitProvider, encryptJson, ensureInstallPackages,
|
|
1769
|
+
export { AppClientCredential, AppClientPlugin, BuildLogger, BuildLoggerConfig, BuildType, BundleSigningSession, ConfigBuilder, ConfigBuilderScaffold, ConfigResponse, CreateHotUpdaterConfigScaffoldFromBuilderOptions, CreateHotUpdaterConfigScaffoldOptions, HOT_UPDATER_PLUGINS_PATH, HOT_UPDATER_SERVER_PACKAGE_VERSION_ENV, HotUpdateDirUtil, HotUpdaterConfigOptions, HotUpdaterConfigScaffold, HotUpdaterInitEnv, HotUpdaterLogWriter, IConfigBuilder, ImportInfo, InitEnvFileError, InitError, InitProviderDefinition, InitProviderInputDefinition, InitProviderInputPersistence, LEGACY_BUNDLE_ERROR, LegacyInfrastructureError, ManagedHelperStatement, ManagedHelperStrategy, MissingInitInputsError, PromptProgress, PromptSpinner, ProviderConfig, ReactNativeMetadata, ReadPackageUpResult, RunInitOptions, WriteHotUpdaterConfigResult, WriteHotUpdaterPluginsResult, assertInfrastructureGenerationAtUrl, assertInfrastructureGenerationPayload, assertInitInputs, assertInitProviderInputs, banner, typedColors as colors, confirmInitInputPersistence, copyDirToTmp, createCopiedBundleArtifacts, createHotUpdaterConfigScaffold, createHotUpdaterConfigScaffoldFromBuilder, createLogWriter, createTarBrTargetFiles, createZip, decryptJson, defineInitProvider, encryptJson, ensureInstallPackages, generateHotUpdaterPlugins, getAndroidSdkPath, getBundleSigningPublicKey, getCwd, getHotUpdaterEnvValue, getHotUpdaterInitInputEnv, getInitProviderEnvVars, getInitProviderTextPromptValues, getMissingInitInputs, getMissingInitProviderInputs, getPackageManager, getReactNativeMetadatas, getStorageFileByteSize, link, loadConfig, loadHotUpdaterPlugins, log, makeEnv, p, prepareBundleSigning, printAppSetup, printBanner, putStorageFile, readBundleSigningPublicKeyFile, readHotUpdaterEnv, readHotUpdaterInitEnv, readPackageUp, renderAppSetup, renderHotUpdaterPlugins, renderImportStatements, resolveHotUpdaterServerVersion, resolveInitProviderInput, resolveInitProviderInputs, resolvePackageVersion, shouldAutoSelectOnlyInitResource, stripAnsi, transformEnv, transformTemplate, writeHotUpdaterConfig, writeHotUpdaterPlugins, writeStorageFile, writeStorageResponseFile };
|
package/dist/index.mjs
CHANGED
|
@@ -22905,8 +22905,47 @@ var BuildLogger = class {
|
|
|
22905
22905
|
}
|
|
22906
22906
|
};
|
|
22907
22907
|
//#endregion
|
|
22908
|
-
//#region src/
|
|
22909
|
-
|
|
22908
|
+
//#region src/appSetup.ts
|
|
22909
|
+
/**
|
|
22910
|
+
* The App.tsx code init prints: `HotUpdater.init` with the server's URL,
|
|
22911
|
+
* the header that carries the client credential when the server takes one,
|
|
22912
|
+
* and the client plugins the server's plugins ask for.
|
|
22913
|
+
*/
|
|
22914
|
+
const renderAppSetup = ({ baseURL, credential, clientPlugins = [] }) => [
|
|
22915
|
+
"// Add this to your App.tsx",
|
|
22916
|
+
"import { HotUpdater } from \"@hot-updater/react-native\";",
|
|
22917
|
+
...clientPlugins.map(({ module, name }) => `import { ${name} } from ${JSON.stringify(module)};`),
|
|
22918
|
+
"",
|
|
22919
|
+
"function App() {",
|
|
22920
|
+
" return null; // Replace with your app root.",
|
|
22921
|
+
"}",
|
|
22922
|
+
"",
|
|
22923
|
+
"HotUpdater.init({",
|
|
22924
|
+
` baseURL: ${JSON.stringify(baseURL)},`,
|
|
22925
|
+
...credential === void 0 ? [] : [
|
|
22926
|
+
" requestHeaders: {",
|
|
22927
|
+
` ${JSON.stringify(credential.header)}: ${JSON.stringify(credential.value)},`,
|
|
22928
|
+
" },"
|
|
22929
|
+
],
|
|
22930
|
+
...clientPlugins.length === 0 ? [] : [` plugins: [${clientPlugins.map(({ name }) => `${name}()`).join(", ")}],`],
|
|
22931
|
+
"});",
|
|
22932
|
+
"",
|
|
22933
|
+
"// Call HotUpdater.checkForUpdate({ updateStrategy: \"appVersion\" })",
|
|
22934
|
+
"// when your app is ready to check.",
|
|
22935
|
+
"export default App;"
|
|
22936
|
+
].join("\n");
|
|
22937
|
+
/** Prints the App.tsx code, when the URL is known, and the app's credential. */
|
|
22938
|
+
const printAppSetup = ({ baseURL, ...setup }) => {
|
|
22939
|
+
if (baseURL !== void 0) p.note(renderAppSetup({
|
|
22940
|
+
baseURL,
|
|
22941
|
+
...setup
|
|
22942
|
+
}));
|
|
22943
|
+
const { credential } = setup;
|
|
22944
|
+
if (credential !== void 0) {
|
|
22945
|
+
p.note(credential.value, credential.label);
|
|
22946
|
+
p.log.message(`Store this ${credential.label} separately in a secure place.`);
|
|
22947
|
+
}
|
|
22948
|
+
};
|
|
22910
22949
|
//#endregion
|
|
22911
22950
|
//#region ../../node_modules/.pnpm/ansi-regex@6.2.2/node_modules/ansi-regex/index.js
|
|
22912
22951
|
function ansiRegex({ onlyFirst = false } = {}) {
|
|
@@ -44583,8 +44622,9 @@ const generateHotUpdaterPlugins = async (pkg, filePath = HOT_UPDATER_PLUGINS_PAT
|
|
|
44583
44622
|
};
|
|
44584
44623
|
/**
|
|
44585
44624
|
* The plugins a project's `hotUpdater.plugins.ts` exports, which its server
|
|
44586
|
-
* runs; undefined when the project has no such file. The console
|
|
44587
|
-
* them in process
|
|
44625
|
+
* runs; undefined when the project has no such file. The console and the CLI
|
|
44626
|
+
* assemble them in process as the server does, for the features and commands
|
|
44627
|
+
* the plugins add.
|
|
44588
44628
|
*/
|
|
44589
44629
|
const loadHotUpdaterPlugins = async (cwd = getCwd()) => {
|
|
44590
44630
|
const { config, sources } = await loadConfig$1({
|
|
@@ -45408,4 +45448,4 @@ function transformTemplate(templateString, values) {
|
|
|
45408
45448
|
return result;
|
|
45409
45449
|
}
|
|
45410
45450
|
//#endregion
|
|
45411
|
-
export { BuildLogger, ConfigBuilder, HOT_UPDATER_PLUGINS_PATH, HOT_UPDATER_SERVER_PACKAGE_VERSION_ENV, HotUpdateDirUtil, InitEnvFileError, InitError, LEGACY_BUNDLE_ERROR, LegacyInfrastructureError, MissingInitInputsError, assertInfrastructureGenerationAtUrl, assertInfrastructureGenerationPayload, assertInitInputs, assertInitProviderInputs, banner, typedColors as colors, confirmInitInputPersistence, copyDirToTmp, createCopiedBundleArtifacts, createHotUpdaterConfigScaffold, createHotUpdaterConfigScaffoldFromBuilder, createLogWriter, createTarBrTargetFiles, createZip, decryptJson, defineInitProvider, encryptJson, ensureInstallPackages,
|
|
45451
|
+
export { BuildLogger, ConfigBuilder, HOT_UPDATER_PLUGINS_PATH, HOT_UPDATER_SERVER_PACKAGE_VERSION_ENV, HotUpdateDirUtil, InitEnvFileError, InitError, LEGACY_BUNDLE_ERROR, LegacyInfrastructureError, MissingInitInputsError, assertInfrastructureGenerationAtUrl, assertInfrastructureGenerationPayload, assertInitInputs, assertInitProviderInputs, banner, typedColors as colors, confirmInitInputPersistence, copyDirToTmp, createCopiedBundleArtifacts, createHotUpdaterConfigScaffold, createHotUpdaterConfigScaffoldFromBuilder, createLogWriter, createTarBrTargetFiles, createZip, decryptJson, defineInitProvider, encryptJson, ensureInstallPackages, generateHotUpdaterPlugins, getAndroidSdkPath, getBundleSigningPublicKey, getCwd, getHotUpdaterEnvValue, getHotUpdaterInitInputEnv, getInitProviderEnvVars, getInitProviderTextPromptValues, getMissingInitInputs, getMissingInitProviderInputs, getPackageManager, getReactNativeMetadatas, getStorageFileByteSize, link, loadConfig, loadHotUpdaterPlugins, log, makeEnv, p, prepareBundleSigning, printAppSetup, printBanner, putStorageFile, readBundleSigningPublicKeyFile, readHotUpdaterEnv, readHotUpdaterInitEnv, readPackageUp, renderAppSetup, renderHotUpdaterPlugins, renderImportStatements, resolveHotUpdaterServerVersion, resolveInitProviderInput, resolveInitProviderInputs, resolvePackageVersion, shouldAutoSelectOnlyInitResource, stripAnsi, transformEnv, transformTemplate, writeHotUpdaterConfig, writeHotUpdaterPlugins, writeStorageFile, writeStorageResponseFile };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/cli-tools",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.17",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20.19.0"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"oxc-transform": "0.141.0",
|
|
51
51
|
"unconfig": "7.5.0",
|
|
52
52
|
"@hot-updater/core": "1.0.0-rc.15",
|
|
53
|
-
"@hot-updater/plugin-core": "1.0.0-rc.
|
|
53
|
+
"@hot-updater/plugin-core": "1.0.0-rc.17"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@clack/prompts": "1.7.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"tar": "^7.5.16",
|
|
65
65
|
"verkit": "0.4.0",
|
|
66
66
|
"workspace-tools": "^0.41.7",
|
|
67
|
-
"@hot-updater/test-utils": "1.0.0-rc.
|
|
67
|
+
"@hot-updater/test-utils": "1.0.0-rc.17"
|
|
68
68
|
},
|
|
69
69
|
"inlinedDependencies": {
|
|
70
70
|
"@babel/code-frame": "7.29.0",
|