@hot-updater/cli-tools 1.2.0-rc.1 → 1.2.0-rc.3
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 +11 -6
- package/dist/index.mjs +57 -8
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -411,11 +411,6 @@ interface CredentialResolver {
|
|
|
411
411
|
*/
|
|
412
412
|
dispose(): Promise<void>;
|
|
413
413
|
}
|
|
414
|
-
/**
|
|
415
|
-
* The sentence every "credential unavailable" message ends with: the
|
|
416
|
-
* environment variables that provide `kind` whatever the secrets adapter.
|
|
417
|
-
*/
|
|
418
|
-
declare const credentialOverrideHint: (kind: CredentialKind) => string;
|
|
419
414
|
/**
|
|
420
415
|
* The command that stores a credential of `kind` you have as `name` through
|
|
421
416
|
* the config's `secrets` adapter, from its files.
|
|
@@ -2461,6 +2456,16 @@ declare const getConfiguredAdapter: (secrets: SecretsAdapter) => SecretsAdapter
|
|
|
2461
2456
|
* when it stores values, else `localSecrets()`'s file.
|
|
2462
2457
|
*/
|
|
2463
2458
|
declare const describeStoredSecret: (secrets: SecretsAdapter, name: string) => string;
|
|
2459
|
+
/**
|
|
2460
|
+
* `name`'s value, read in the order `secrets.get` reads it, with the one
|
|
2461
|
+
* place it came from, for messages: the config's adapter
|
|
2462
|
+
* (`describeSecret`), the environment variable `localSecrets()` reads
|
|
2463
|
+
* first, or `localSecrets()`'s file. Undefined when nothing holds it.
|
|
2464
|
+
*/
|
|
2465
|
+
declare const readSecretWithSource: (secrets: SecretsAdapter, name: string, cwd: string) => Promise<{
|
|
2466
|
+
readonly value: string;
|
|
2467
|
+
readonly source: string;
|
|
2468
|
+
} | undefined>;
|
|
2464
2469
|
/**
|
|
2465
2470
|
* Whether a key `secrets` stores stays on this machine: it is `localSecrets()`,
|
|
2466
2471
|
* whose files no other machine reads.
|
|
@@ -2542,4 +2547,4 @@ type TransformTemplateArgs<T extends string> = { [Key in ExtractPlaceholders<T>]
|
|
|
2542
2547
|
*/
|
|
2543
2548
|
declare function transformTemplate<T extends string>(templateString: T, values: TransformTemplateArgs<T>): string;
|
|
2544
2549
|
//#endregion
|
|
2545
|
-
export { AppClientCredential, AppClientPlugin, AssembleServerOptions, AssembledServer, BuildFailedError, BuildFailureSummaryConfig, BuildLogger, BuildLoggerConfig, BuildType, BundleSigningSession, CREDENTIAL_ENV_NAMES, CREDENTIAL_LOGIN_GROUPS, ClientAuthSpec, ClientCredentialSpec, ConfigBuilder, ConfigBuilderScaffold, ConfigResponse, CreateCredentialResolverOptions, CreateHotUpdaterConfigScaffoldFromBuilderOptions, CreateHotUpdaterConfigScaffoldOptions, type CredentialFiles, CredentialKind, CredentialRequest, CredentialResolver, CredentialUnavailableError, Credentials, DEFAULT_SIGNING_KEY_SECRET, HOT_UPDATER_HOME_ENV, HOT_UPDATER_SERVER_PACKAGE_VERSION_ENV, HotUpdateDirUtil, HotUpdaterConfigOptions, HotUpdaterConfigScaffold, HotUpdaterInitEnv, HotUpdaterLogWriter, INTERFACE_FINGERPRINT_ENGINE, ImportInfo, InitEnvFileError, InitError, InitProviderDefinition, InitProviderInputDefinition, InitProviderInputPersistence, IssuedCredentialKind, LOCAL_SECRETS_NAME, LegacyInfrastructureError, LocalSecretsOptions, LocalSecretsStore, ManagedHelperStatement, ManagedHelperStrategy, MissingInitInputsError, NativeDependency, NativeInterface, PromptProgress, PromptSpinner, ProviderConfig, ProvisionedClientCredential, ReactNativeMetadata, ReadPackageUpResult, RunInitOptions, SecretsScope, ServerClientEndpoint, ServerDefinition, ServerDefinitionError, WriteHotUpdaterConfigResult, assembleServer, assertInfrastructureGenerationAtUrl, assertInfrastructureGenerationPayload, assertInitInputs, assertInitProviderInputs, assertUnreservedEnv, autolinkingConfigCommand, banner, clientAuthOf, typedColors as colors, confirmInitInputPersistence, copyDirToTmp, createCredentialResolver, createHotUpdaterConfigScaffold, createHotUpdaterConfigScaffoldFromBuilder, createInterfaceFingerprint, createLocalSecretsStore, createLogWriter, createMigrator, createMinBundleId, createTarBrTargetFiles, createZip, credentialIssueCommand, credentialLoginCommand,
|
|
2550
|
+
export { AppClientCredential, AppClientPlugin, AssembleServerOptions, AssembledServer, BuildFailedError, BuildFailureSummaryConfig, BuildLogger, BuildLoggerConfig, BuildType, BundleSigningSession, CREDENTIAL_ENV_NAMES, CREDENTIAL_LOGIN_GROUPS, ClientAuthSpec, ClientCredentialSpec, ConfigBuilder, ConfigBuilderScaffold, ConfigResponse, CreateCredentialResolverOptions, CreateHotUpdaterConfigScaffoldFromBuilderOptions, CreateHotUpdaterConfigScaffoldOptions, type CredentialFiles, CredentialKind, CredentialRequest, CredentialResolver, CredentialUnavailableError, Credentials, DEFAULT_SIGNING_KEY_SECRET, HOT_UPDATER_HOME_ENV, HOT_UPDATER_SERVER_PACKAGE_VERSION_ENV, HotUpdateDirUtil, HotUpdaterConfigOptions, HotUpdaterConfigScaffold, HotUpdaterInitEnv, HotUpdaterLogWriter, INTERFACE_FINGERPRINT_ENGINE, ImportInfo, InitEnvFileError, InitError, InitProviderDefinition, InitProviderInputDefinition, InitProviderInputPersistence, IssuedCredentialKind, LOCAL_SECRETS_NAME, LegacyInfrastructureError, LocalSecretsOptions, LocalSecretsStore, ManagedHelperStatement, ManagedHelperStrategy, MissingInitInputsError, NativeDependency, NativeInterface, PromptProgress, PromptSpinner, ProviderConfig, ProvisionedClientCredential, ReactNativeMetadata, ReadPackageUpResult, RunInitOptions, SecretsScope, ServerClientEndpoint, ServerDefinition, ServerDefinitionError, WriteHotUpdaterConfigResult, assembleServer, assertInfrastructureGenerationAtUrl, assertInfrastructureGenerationPayload, assertInitInputs, assertInitProviderInputs, assertUnreservedEnv, autolinkingConfigCommand, banner, clientAuthOf, typedColors as colors, confirmInitInputPersistence, copyDirToTmp, createCredentialResolver, createHotUpdaterConfigScaffold, createHotUpdaterConfigScaffoldFromBuilder, createInterfaceFingerprint, createLocalSecretsStore, createLogWriter, createMigrator, createMinBundleId, createTarBrTargetFiles, createZip, credentialIssueCommand, credentialLoginCommand, credentialPutCommand, credentialStoreCommand, decryptJson, defineInitProvider, describeSecret, describeStoredSecret, encryptJson, ensureInstallPackages, generateClientCredential, generateSchema, generatesSchema, getAndroidSdkPath, getBundleSigningPublicKey, getConfiguredAdapter, getConfiguredSecrets, getCwd, getHotUpdaterEnvValue, getHotUpdaterHome, getHotUpdaterInitInputEnv, getInitProviderEnvVars, getInitProviderTextPromptValues, getLocalKeyFile, getLocalKeyStoreDir, getLocalSecretsStore, getMissingInitInputs, getMissingInitProviderInputs, getPackageManager, getProjectKey, getReactNativeMetadatas, getStorageFileByteSize, isCI, isCodegenSpecFile, isReservedVariableName, isSecretName, isServerDefinition, keepsKeysOnThisMachine, link, loadConfig, loadPlatformConfigs, localSecrets, log, makeEnv, maskSecretValues, moduleSpecifiersOf, nonInteractiveReason, p, parseLoadedEnv, parseSecretReference, prepareBundleSigning, printAppSetup, printBanner, provisionClientCredential, putStorageFile, reactNativeCliFingerprint, reactNativeConfigCommand, readBundleSigningPublicKeyFile, readHotUpdaterInitEnv, readLoadedHotUpdaterEnv, readLocalKey, readPackageUp, readReactNativeInterface, readSecretVariables, readSecretWithSource, registerCredentialValue, registerSecretValue, renderAppImports, renderAppSetup, renderImportStatements, resolveExpoAutolinking, resolveHotUpdaterServerVersion, resolveInitProviderInput, resolveInitProviderInputs, resolveLocalSecretsPath, resolvePackageVersion, secretEnv, secretVariableName, serverDefinitionOf, setConfiguredSecrets, shouldAutoSelectOnlyInitResource, stripAnsi, transformEnv, transformTemplate, withCredentialResolver, withLocalKeyStore, withSecretsScope, writeHotUpdaterConfig, writeHotUpdaterFiles, writeLocalKey };
|
package/dist/index.mjs
CHANGED
|
@@ -25654,6 +25654,41 @@ const describeStoredSecret = (secrets, name) => {
|
|
|
25654
25654
|
return configured?.set ? describeSecret(configured, name) : getLocalSecretsStore(secrets).file(name, getCwd());
|
|
25655
25655
|
};
|
|
25656
25656
|
/**
|
|
25657
|
+
* `name`'s value, read in the order `secrets.get` reads it, with the one
|
|
25658
|
+
* place it came from, for messages: the config's adapter
|
|
25659
|
+
* (`describeSecret`), the environment variable `localSecrets()` reads
|
|
25660
|
+
* first, or `localSecrets()`'s file. Undefined when nothing holds it.
|
|
25661
|
+
*/
|
|
25662
|
+
const readSecretWithSource = async (secrets, name, cwd) => {
|
|
25663
|
+
const held = (value) => typeof value === "string" && value.length > 0;
|
|
25664
|
+
if (!isLocalKeyStoreSecrets(secrets)) {
|
|
25665
|
+
const value = (await secrets.get([name], { cwd }))[name];
|
|
25666
|
+
return held(value) ? {
|
|
25667
|
+
value,
|
|
25668
|
+
source: describeSecret(secrets, name)
|
|
25669
|
+
} : void 0;
|
|
25670
|
+
}
|
|
25671
|
+
const { configured, store } = secrets[LOCAL_KEY_STORE];
|
|
25672
|
+
if (configured) {
|
|
25673
|
+
const value = (await configured.get([name], { cwd }))[name];
|
|
25674
|
+
if (held(value)) return {
|
|
25675
|
+
value,
|
|
25676
|
+
source: describeSecret(configured, name)
|
|
25677
|
+
};
|
|
25678
|
+
} else {
|
|
25679
|
+
const value = (await readSecretVariables([name], cwd))[name];
|
|
25680
|
+
if (held(value)) return {
|
|
25681
|
+
value,
|
|
25682
|
+
source: `${secretVariableName(name)} (environment)`
|
|
25683
|
+
};
|
|
25684
|
+
}
|
|
25685
|
+
const value = await store.read(name, cwd);
|
|
25686
|
+
return held(value) ? {
|
|
25687
|
+
value,
|
|
25688
|
+
source: store.file(name, cwd)
|
|
25689
|
+
} : void 0;
|
|
25690
|
+
};
|
|
25691
|
+
/**
|
|
25657
25692
|
* Whether a key `secrets` stores stays on this machine: it is `localSecrets()`,
|
|
25658
25693
|
* whose files no other machine reads.
|
|
25659
25694
|
*/
|
|
@@ -38691,10 +38726,23 @@ const describeFields = (fields) => {
|
|
|
38691
38726
|
return `${described.slice(0, -1).join(", ")}, and ${described.at(-1)}`;
|
|
38692
38727
|
};
|
|
38693
38728
|
/**
|
|
38694
|
-
*
|
|
38695
|
-
*
|
|
38729
|
+
* A command to print, broken at spaces with ` \` once a line would pass
|
|
38730
|
+
* 74 columns, each continuation indented two spaces, so a terminal never
|
|
38731
|
+
* wraps it mid-word and it still pastes as one command.
|
|
38696
38732
|
*/
|
|
38697
|
-
const
|
|
38733
|
+
const formatCommand = (command) => {
|
|
38734
|
+
const lines = [];
|
|
38735
|
+
let line = "";
|
|
38736
|
+
for (const word of command.split(" ")) {
|
|
38737
|
+
const next = line ? `${line} ${word}` : word;
|
|
38738
|
+
if (line && next.length > 72) {
|
|
38739
|
+
lines.push(`${line} \\`);
|
|
38740
|
+
line = ` ${word}`;
|
|
38741
|
+
} else line = next;
|
|
38742
|
+
}
|
|
38743
|
+
lines.push(line);
|
|
38744
|
+
return lines.join("\n");
|
|
38745
|
+
};
|
|
38698
38746
|
/**
|
|
38699
38747
|
* The command that stores a credential of `kind` you have as `name` through
|
|
38700
38748
|
* the config's `secrets` adapter, from its files.
|
|
@@ -38838,13 +38886,14 @@ const parseObject = (value) => {
|
|
|
38838
38886
|
const readJsonFields = (kind, item, value, fields) => {
|
|
38839
38887
|
const parsed = parseObject(value);
|
|
38840
38888
|
const shape = `{${fields.map((field) => `"${field}"`).join(", ")}}`;
|
|
38841
|
-
if (!parsed) throw new CredentialUnavailableError(kind, `${item} is not a JSON object
|
|
38889
|
+
if (!parsed) throw new CredentialUnavailableError(kind, `${item} is not a JSON object.\n${capitalize(aKind(kind))} is one JSON value: ${shape}`);
|
|
38842
38890
|
registerJsonSecrets(value, parsed);
|
|
38843
38891
|
const missing = fields.filter((field) => typeof parsed[field] !== "string" || !parsed[field]);
|
|
38844
|
-
if (missing.length > 0) throw new CredentialUnavailableError(kind, `${item} has no ${missing.join(", ")}
|
|
38892
|
+
if (missing.length > 0) throw new CredentialUnavailableError(kind, `${item} has no ${missing.join(", ")}.\n${capitalize(aKind(kind))} is one JSON value: ${shape}`);
|
|
38845
38893
|
return parsed;
|
|
38846
38894
|
};
|
|
38847
38895
|
const aKind = (kind) => `${/^[aeiou]/u.test(kind) ? "an" : "a"} ${kind}`;
|
|
38896
|
+
const capitalize = (text) => text.charAt(0).toUpperCase() + text.slice(1);
|
|
38848
38897
|
/** A base64 value's bytes, or undefined when it is not base64. */
|
|
38849
38898
|
const decodeBase64 = (value) => {
|
|
38850
38899
|
const base64 = value.replace(/\s/g, "");
|
|
@@ -38975,9 +39024,9 @@ const createCredentialResolver = ({ env = {}, secrets, cwd } = {}) => {
|
|
|
38975
39024
|
value = await load(name);
|
|
38976
39025
|
} catch (error) {
|
|
38977
39026
|
const reason = error instanceof Error ? error.message : String(error);
|
|
38978
|
-
throw new CredentialUnavailableError(kind, `
|
|
39027
|
+
throw new CredentialUnavailableError(kind, `Couldn't read ${item} from the ${store.name} secrets adapter.\n${reason}`, { cause: error });
|
|
38979
39028
|
}
|
|
38980
|
-
if (value === void 0) throw new CredentialUnavailableError(kind,
|
|
39029
|
+
if (value === void 0) throw new CredentialUnavailableError(kind, `No ${item} in the ${store.name} secrets adapter.\nStore it once with:\n${formatCommand(credentialStoreCommand(kind, name))}`);
|
|
38981
39030
|
registerSecretValue(value);
|
|
38982
39031
|
return fromSecretValue[kind](value, {
|
|
38983
39032
|
files,
|
|
@@ -47385,4 +47434,4 @@ function transformTemplate(templateString, values) {
|
|
|
47385
47434
|
return result;
|
|
47386
47435
|
}
|
|
47387
47436
|
//#endregion
|
|
47388
|
-
export { BuildFailedError, BuildLogger, CREDENTIAL_ENV_NAMES, CREDENTIAL_LOGIN_GROUPS, ConfigBuilder, CredentialUnavailableError, DEFAULT_SIGNING_KEY_SECRET, HOT_UPDATER_HOME_ENV, HOT_UPDATER_SERVER_PACKAGE_VERSION_ENV, HotUpdateDirUtil, INTERFACE_FINGERPRINT_ENGINE, InitEnvFileError, InitError, LOCAL_SECRETS_NAME, LegacyInfrastructureError, MissingInitInputsError, ServerDefinitionError, assembleServer, assertInfrastructureGenerationAtUrl, assertInfrastructureGenerationPayload, assertInitInputs, assertInitProviderInputs, assertUnreservedEnv, autolinkingConfigCommand, banner, clientAuthOf, typedColors as colors, confirmInitInputPersistence, copyDirToTmp, createCredentialResolver, createHotUpdaterConfigScaffold, createHotUpdaterConfigScaffoldFromBuilder, createInterfaceFingerprint, createLocalSecretsStore, createLogWriter, createMigrator, createMinBundleId, createTarBrTargetFiles, createZip, credentialIssueCommand, credentialLoginCommand,
|
|
47437
|
+
export { BuildFailedError, BuildLogger, CREDENTIAL_ENV_NAMES, CREDENTIAL_LOGIN_GROUPS, ConfigBuilder, CredentialUnavailableError, DEFAULT_SIGNING_KEY_SECRET, HOT_UPDATER_HOME_ENV, HOT_UPDATER_SERVER_PACKAGE_VERSION_ENV, HotUpdateDirUtil, INTERFACE_FINGERPRINT_ENGINE, InitEnvFileError, InitError, LOCAL_SECRETS_NAME, LegacyInfrastructureError, MissingInitInputsError, ServerDefinitionError, assembleServer, assertInfrastructureGenerationAtUrl, assertInfrastructureGenerationPayload, assertInitInputs, assertInitProviderInputs, assertUnreservedEnv, autolinkingConfigCommand, banner, clientAuthOf, typedColors as colors, confirmInitInputPersistence, copyDirToTmp, createCredentialResolver, createHotUpdaterConfigScaffold, createHotUpdaterConfigScaffoldFromBuilder, createInterfaceFingerprint, createLocalSecretsStore, createLogWriter, createMigrator, createMinBundleId, createTarBrTargetFiles, createZip, credentialIssueCommand, credentialLoginCommand, credentialPutCommand, credentialStoreCommand, decryptJson, defineInitProvider, describeSecret, describeStoredSecret, encryptJson, ensureInstallPackages, generateClientCredential, generateSchema, generatesSchema, getAndroidSdkPath, getBundleSigningPublicKey, getConfiguredAdapter, getConfiguredSecrets, getCwd, getHotUpdaterEnvValue, getHotUpdaterHome, getHotUpdaterInitInputEnv, getInitProviderEnvVars, getInitProviderTextPromptValues, getLocalKeyFile, getLocalKeyStoreDir, getLocalSecretsStore, getMissingInitInputs, getMissingInitProviderInputs, getPackageManager, getProjectKey, getReactNativeMetadatas, getStorageFileByteSize, isCI, isCodegenSpecFile, isReservedVariableName, isSecretName, isServerDefinition, keepsKeysOnThisMachine, link, loadConfig, loadPlatformConfigs, localSecrets, log, makeEnv, maskSecretValues, moduleSpecifiersOf, nonInteractiveReason, p, parseLoadedEnv, parseSecretReference, prepareBundleSigning, printAppSetup, printBanner, provisionClientCredential, putStorageFile, reactNativeCliFingerprint, reactNativeConfigCommand, readBundleSigningPublicKeyFile, readHotUpdaterInitEnv, readLoadedHotUpdaterEnv, readLocalKey, readPackageUp, readReactNativeInterface, readSecretVariables, readSecretWithSource, registerCredentialValue, registerSecretValue, renderAppImports, renderAppSetup, renderImportStatements, resolveExpoAutolinking, resolveHotUpdaterServerVersion, resolveInitProviderInput, resolveInitProviderInputs, resolveLocalSecretsPath, resolvePackageVersion, secretEnv, secretVariableName, serverDefinitionOf, setConfiguredSecrets, shouldAutoSelectOnlyInitResource, stripAnsi, transformEnv, transformTemplate, withCredentialResolver, withLocalKeyStore, withSecretsScope, writeHotUpdaterConfig, writeHotUpdaterFiles, writeLocalKey };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/cli-tools",
|
|
3
|
-
"version": "1.2.0-rc.
|
|
3
|
+
"version": "1.2.0-rc.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": "^22.23.4 || ^24.22.1 || >=26.12.1"
|
|
@@ -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/plugin-core": "1.2.0-rc.
|
|
53
|
-
"@hot-updater/protocol": "1.2.0-rc.
|
|
54
|
-
"@hot-updater/server": "1.2.0-rc.
|
|
52
|
+
"@hot-updater/plugin-core": "1.2.0-rc.3",
|
|
53
|
+
"@hot-updater/protocol": "1.2.0-rc.3",
|
|
54
|
+
"@hot-updater/server": "1.2.0-rc.3"
|
|
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.2.0-rc.
|
|
68
|
+
"@hot-updater/test-utils": "1.2.0-rc.3"
|
|
69
69
|
},
|
|
70
70
|
"inlinedDependencies": {
|
|
71
71
|
"@babel/code-frame": "7.29.0",
|