@hot-updater/cli-tools 0.28.0 → 0.29.1

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/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@hot-updater/cli-tools",
3
- "version": "0.28.0",
3
+ "version": "0.29.1",
4
4
  "type": "module",
5
5
  "description": "CLI utilities for Hot Updater",
6
6
  "sideEffects": false,
7
7
  "main": "./dist/index.cjs",
8
- "module": "./dist/index.js",
8
+ "module": "./dist/index.mjs",
9
9
  "types": "./dist/index.d.cts",
10
10
  "exports": {
11
11
  ".": {
12
- "import": "./dist/index.js",
12
+ "import": "./dist/index.mjs",
13
13
  "require": "./dist/index.cjs"
14
14
  },
15
15
  "./package.json": "./package.json"
@@ -39,36 +39,155 @@
39
39
  "access": "public"
40
40
  },
41
41
  "dependencies": {
42
- "oxc-transform": "0.82.1",
43
- "@hot-updater/core": "0.28.0",
44
- "@hot-updater/plugin-core": "0.28.0"
42
+ "oxc-transform": "0.121.0",
43
+ "unconfig": "7.5.0",
44
+ "@hot-updater/core": "0.29.1",
45
+ "@hot-updater/plugin-core": "0.29.1"
45
46
  },
46
47
  "devDependencies": {
47
- "@clack/prompts": "^1.0.1",
48
+ "@clack/prompts": "1.0.1",
49
+ "@types/node": "^20",
50
+ "@types/semver": "^7.7.1",
48
51
  "boxen": "^8.0.1",
49
- "cosmiconfig": "9.0.0",
50
- "cosmiconfig-typescript-loader": "5.0.0",
51
52
  "es-toolkit": "^1.32.0",
53
+ "execa": "9.5.2",
52
54
  "fast-glob": "3.3.3",
53
55
  "jszip": "^3.10.1",
54
56
  "picocolors": "1.1.1",
55
57
  "read-package-up": "^11.0.0",
56
- "tar": "^7.5.1",
57
- "workspace-tools": "^0.36.4",
58
58
  "semver": "^7.6.3",
59
- "@types/node": "^20",
59
+ "tar": "^7.5.1",
60
60
  "typescript": "5.8.2",
61
- "@types/semver": "^7.7.1",
62
- "execa": "9.5.2",
63
- "@hot-updater/test-utils": "0.28.0"
64
- },
65
- "peerDependencies": {
66
- "typescript": "*"
61
+ "workspace-tools": "^0.36.4",
62
+ "@hot-updater/test-utils": "0.29.1"
67
63
  },
68
- "peerDependenciesMeta": {
69
- "typescript": {
70
- "optional": true
71
- }
64
+ "inlinedDependencies": {
65
+ "@babel/code-frame": "7.29.0",
66
+ "@babel/helper-validator-identifier": "7.28.5",
67
+ "@clack/core": "1.0.1",
68
+ "@clack/prompts": "1.0.1",
69
+ "@isaacs/fs-minipass": "4.0.1",
70
+ "@nodelib/fs.scandir": "2.1.5",
71
+ "@nodelib/fs.stat": "2.0.5",
72
+ "@nodelib/fs.walk": "1.2.8",
73
+ "@sec-ant/readable-stream": "0.4.1",
74
+ "@sindresorhus/merge-streams": "4.0.0",
75
+ "@yarnpkg/lockfile": "1.1.0",
76
+ "ansi-align": "3.0.1",
77
+ "ansi-regex": [
78
+ "5.0.1",
79
+ "6.1.0"
80
+ ],
81
+ "ansi-styles": "6.2.1",
82
+ "boxen": "8.0.1",
83
+ "braces": "3.0.3",
84
+ "camelcase": "8.0.0",
85
+ "chalk": "5.4.1",
86
+ "chownr": "3.0.0",
87
+ "cli-boxes": "3.0.0",
88
+ "core-util-is": "1.0.3",
89
+ "cross-spawn": "7.0.6",
90
+ "emoji-regex": [
91
+ "10.4.0",
92
+ "8.0.0"
93
+ ],
94
+ "es-toolkit": "1.32.0",
95
+ "execa": "9.5.2",
96
+ "fast-glob": "3.3.3",
97
+ "fastq": "1.17.1",
98
+ "figures": "6.1.0",
99
+ "fill-range": "7.1.1",
100
+ "find-up-simple": "1.0.1",
101
+ "get-east-asian-width": "1.3.0",
102
+ "get-stream": "9.0.1",
103
+ "git-up": "7.0.0",
104
+ "git-url-parse": "13.1.1",
105
+ "glob-parent": "5.1.2",
106
+ "hosted-git-info": "7.0.2",
107
+ "human-signals": "8.0.1",
108
+ "immediate": "3.0.6",
109
+ "index-to-position": "0.1.2",
110
+ "inherits": "2.0.4",
111
+ "is-extglob": "2.1.1",
112
+ "is-fullwidth-code-point": "3.0.0",
113
+ "is-glob": "4.0.3",
114
+ "is-number": "7.0.0",
115
+ "is-plain-obj": "4.1.0",
116
+ "is-ssh": "1.4.1",
117
+ "is-stream": "4.0.1",
118
+ "is-unicode-supported": "2.1.0",
119
+ "isarray": "1.0.0",
120
+ "isexe": "2.0.0",
121
+ "jju": "1.4.0",
122
+ "js-tokens": "4.0.0",
123
+ "js-yaml": "4.1.0",
124
+ "jszip": "3.10.1",
125
+ "lie": "3.3.0",
126
+ "lru-cache": "10.4.3",
127
+ "merge2": "1.4.1",
128
+ "micromatch": "4.0.8",
129
+ "minipass": "7.1.3",
130
+ "minizlib": "3.1.0",
131
+ "normalize-package-data": "6.0.2",
132
+ "npm-run-path": "6.0.0",
133
+ "pako": "1.0.11",
134
+ "parse-json": "8.1.0",
135
+ "parse-ms": "4.0.0",
136
+ "parse-path": "7.0.1",
137
+ "parse-url": "8.1.0",
138
+ "path-key": [
139
+ "3.1.1",
140
+ "4.0.0"
141
+ ],
142
+ "picocolors": "1.1.1",
143
+ "picomatch": "2.3.1",
144
+ "pretty-ms": "9.2.0",
145
+ "process-nextick-args": "2.0.1",
146
+ "protocols": "2.0.2",
147
+ "queue-microtask": "1.2.3",
148
+ "read-package-up": "11.0.0",
149
+ "read-pkg": "9.0.1",
150
+ "readable-stream": "2.3.8",
151
+ "reusify": "1.0.4",
152
+ "run-parallel": "1.2.0",
153
+ "safe-buffer": "5.1.2",
154
+ "semver": [
155
+ "7.7.3",
156
+ "7.7.4"
157
+ ],
158
+ "setimmediate": "1.0.5",
159
+ "shebang-command": "2.0.0",
160
+ "shebang-regex": "3.0.0",
161
+ "signal-exit": "4.1.0",
162
+ "sisteransi": "1.0.5",
163
+ "spdx-correct": "3.2.0",
164
+ "spdx-exceptions": "2.5.0",
165
+ "spdx-expression-parse": "3.0.1",
166
+ "spdx-license-ids": "3.0.18",
167
+ "string_decoder": "1.1.1",
168
+ "string-width": [
169
+ "4.2.3",
170
+ "7.2.0"
171
+ ],
172
+ "strip-ansi": [
173
+ "6.0.1",
174
+ "7.1.0"
175
+ ],
176
+ "strip-final-newline": "4.0.0",
177
+ "tar": "7.5.1",
178
+ "to-regex-range": "5.0.1",
179
+ "unicorn-magic": [
180
+ "0.1.0",
181
+ "0.3.0"
182
+ ],
183
+ "util-deprecate": "1.0.2",
184
+ "validate-npm-package-license": "3.0.4",
185
+ "which": "2.0.2",
186
+ "widest-line": "5.0.0",
187
+ "workspace-tools": "0.36.4",
188
+ "wrap-ansi": "9.0.0",
189
+ "yallist": "5.0.0",
190
+ "yoctocolors": "2.1.1"
72
191
  },
73
192
  "scripts": {
74
193
  "build": "tsdown",
package/dist/index.d.ts DELETED
@@ -1,247 +0,0 @@
1
- import { Readable } from "stream";
2
- import colors from "picocolors";
3
- import { ConfigInput, Platform, RequiredDeep } from "@hot-updater/plugin-core";
4
- import * as p from "@clack/prompts";
5
-
6
- //#region src/BuildLogger.d.ts
7
- type LinePattern = string | RegExp;
8
- interface BuildLoggerConfig {
9
- logPrefix: string;
10
- /** Lines that should be surfaced in prompt output as important events. */
11
- importantLogPatterns: LinePattern[];
12
- /** Progress stages: stage index advances when corresponding output patterns are observed. */
13
- progressStages: LinePattern[][];
14
- }
15
- declare class BuildLogger {
16
- private readonly config;
17
- private state;
18
- private logWriter?;
19
- private readonly promptProgress;
20
- private readonly stageCount;
21
- constructor(config: BuildLoggerConfig);
22
- start(): Promise<void>;
23
- processStream(input: Readable): Promise<void>;
24
- private consumeProgressStream;
25
- private processProgressLine;
26
- stop(message?: string, success?: boolean): void;
27
- writeError(error: unknown): void;
28
- close(): Promise<void>;
29
- private updateProgress;
30
- private finishRemainingProgress;
31
- private shouldLogLine;
32
- private showLogFileLocation;
33
- }
34
- //#endregion
35
- //#region src/banner.d.ts
36
- declare const link: (url: string) => string;
37
- declare const banner: (version?: string) => string;
38
- declare const printBanner: (version?: string) => void;
39
- //#endregion
40
- //#region src/ConfigBuilder.d.ts
41
- type BuildType = "bare" | "rock" | "expo";
42
- type ImportInfo = {
43
- pkg: string;
44
- named?: string[];
45
- defaultOrNamespace?: string;
46
- sideEffect?: boolean;
47
- };
48
- type ProviderConfig = {
49
- imports: ImportInfo[];
50
- configString: string;
51
- };
52
- interface IConfigBuilder {
53
- /** Sets the build type ('bare' or 'rock' or 'expo') and adds necessary build imports. */
54
- setBuildType(buildType: BuildType): this;
55
- /** Sets the storage configuration and adds its required imports. */
56
- setStorage(storageConfig: ProviderConfig): this;
57
- /** Sets the database configuration and adds its required imports. */
58
- setDatabase(databaseConfig: ProviderConfig): this;
59
- /** Sets the intermediate code block to be placed between imports and defineConfig. */
60
- setIntermediateCode(code: string): this;
61
- /** Assembles and returns the final configuration string. */
62
- getResult(): string;
63
- }
64
- declare class ConfigBuilder implements IConfigBuilder {
65
- private buildType;
66
- private storageInfo;
67
- private databaseInfo;
68
- private intermediateCode;
69
- private collectedImports;
70
- constructor();
71
- addImport(info: ImportInfo): this;
72
- private addImports;
73
- private generateImportStatements;
74
- private generateBuildConfigString;
75
- setBuildType(buildType: BuildType): this;
76
- setStorage(storageConfig: ProviderConfig): this;
77
- setDatabase(databaseConfig: ProviderConfig): this;
78
- setIntermediateCode(code: string): this;
79
- getResult(): string;
80
- }
81
- //#endregion
82
- //#region src/copyDirToTmp.d.ts
83
- declare const copyDirToTmp: (dir: string, childDirname?: string) => Promise<{
84
- tmpDir: string;
85
- removeTmpDir: () => Promise<void>;
86
- }>;
87
- //#endregion
88
- //#region src/createTarBr.d.ts
89
- declare const createTarBrTargetFiles: ({
90
- outfile,
91
- targetFiles
92
- }: {
93
- targetFiles: {
94
- path: string;
95
- name: string;
96
- }[];
97
- outfile: string;
98
- }) => Promise<string>;
99
- declare const createTarBr: ({
100
- outfile,
101
- targetDir,
102
- excludeExts
103
- }: {
104
- targetDir: string;
105
- outfile: string;
106
- excludeExts?: string[];
107
- }) => Promise<string>;
108
- //#endregion
109
- //#region src/createTarGz.d.ts
110
- declare const createTarGzTargetFiles: ({
111
- outfile,
112
- targetFiles
113
- }: {
114
- targetFiles: {
115
- path: string;
116
- name: string;
117
- }[];
118
- outfile: string;
119
- }) => Promise<string>;
120
- declare const createTarGz: ({
121
- outfile,
122
- targetDir,
123
- excludeExts
124
- }: {
125
- targetDir: string;
126
- outfile: string;
127
- excludeExts?: string[];
128
- }) => Promise<string>;
129
- //#endregion
130
- //#region src/createZip.d.ts
131
- declare const createZipTargetFiles: ({
132
- outfile,
133
- targetFiles
134
- }: {
135
- targetFiles: {
136
- path: string;
137
- name: string;
138
- }[];
139
- outfile: string;
140
- }) => Promise<string>;
141
- declare const createZip: ({
142
- outfile,
143
- targetDir,
144
- excludeExts
145
- }: {
146
- targetDir: string;
147
- outfile: string;
148
- excludeExts?: string[];
149
- }) => Promise<string>;
150
- //#endregion
151
- //#region src/crypto.d.ts
152
- declare const encryptJson: (jsonData: Record<string, any>, secretKey: string) => string;
153
- declare const decryptJson: <T>(encryptedData: string, secretKey: string) => T;
154
- //#endregion
155
- //#region src/cwd.d.ts
156
- declare const getCwd: () => string;
157
- //#endregion
158
- //#region src/ensureInstallPackages.d.ts
159
- declare const ensureInstallPackages: (packages: {
160
- dependencies?: string[];
161
- devDependencies?: string[];
162
- }, options?: {
163
- versionResolver?: (pkg: string) => string;
164
- }) => Promise<void>;
165
- //#endregion
166
- //#region src/getAndroidSdkPath.d.ts
167
- declare function getAndroidSdkPath(): string;
168
- //#endregion
169
- //#region src/getPackageManager.d.ts
170
- declare const getPackageManager: () => string;
171
- //#endregion
172
- //#region src/getReactNativeMetadatas.d.ts
173
- interface ReactNativeMetadata {
174
- packagePath: string;
175
- versionRaw: string;
176
- version: {
177
- major: number;
178
- minor: number;
179
- patch?: number;
180
- };
181
- }
182
- declare const getReactNativeMetadatas: (cwd?: string) => ReactNativeMetadata;
183
- //#endregion
184
- //#region src/LogWriter.d.ts
185
- type HotUpdaterLogWriter = {
186
- logFilePath: string | null;
187
- writeStream: (input: Readable) => Promise<void>;
188
- writeError: (error: unknown) => void;
189
- close: () => Promise<void>;
190
- };
191
- declare const stripAnsi: (value: string) => string;
192
- declare const createLogWriter: ({
193
- prefix,
194
- logFilePath
195
- }: {
196
- prefix: string;
197
- logFilePath?: string;
198
- }) => Promise<HotUpdaterLogWriter>;
199
- //#endregion
200
- //#region src/loadConfig.d.ts
201
- type HotUpdaterConfigOptions = {
202
- platform: Platform;
203
- channel: string;
204
- } | null;
205
- type ConfigResponse = RequiredDeep<ConfigInput>;
206
- declare const loadConfig: (options: HotUpdaterConfigOptions) => Promise<ConfigResponse>;
207
- declare const loadConfigSync: (options: HotUpdaterConfigOptions) => ConfigResponse;
208
- //#endregion
209
- //#region src/log.d.ts
210
- declare const log: {
211
- normal: (message: string | number | null | undefined) => void;
212
- success: (message: string | number | null | undefined) => void;
213
- info: (message: string | number | null | undefined) => void;
214
- error: (message: string | number | null | undefined) => void;
215
- warn: (message: string | number | null | undefined) => void;
216
- debug: (message: string | number | null | undefined) => void;
217
- };
218
- //#endregion
219
- //#region src/makeEnv.d.ts
220
- type EnvVarValue = string | {
221
- comment: string;
222
- value: string;
223
- };
224
- declare const makeEnv: (newEnvVars: Record<string, EnvVarValue>, filePath?: string) => Promise<string>;
225
- //#endregion
226
- //#region src/prompts.d.ts
227
- type PromptProgress = ReturnType<typeof p.progress>;
228
- type PromptSpinner = ReturnType<typeof p.spinner>;
229
- //#endregion
230
- //#region src/transformEnv.d.ts
231
- declare const transformEnv: <T extends Record<string, string>>(filename: string, env: T) => string;
232
- //#endregion
233
- //#region src/transformTemplate.d.ts
234
- type ExtractPlaceholders<T extends string> = T extends `${infer _Start}%%${infer Key}%%${infer Rest}` ? Key | ExtractPlaceholders<Rest> : never;
235
- type TransformTemplateArgs<T extends string> = { [Key in ExtractPlaceholders<T>]: string };
236
- /**
237
- * Replaces placeholders in the format %%key%% in a template string with values from the values object.
238
- * Uses generic type T to automatically infer placeholder keys from the template string to ensure type safety.
239
- *
240
- * @example
241
- * const str = "Hello %%name%%, you are %%age%% years old."
242
- * const result = transformTemplate(str, { name: "John", age: "20" })
243
- * // Result: "Hello John, you are 20 years old."
244
- */
245
- declare function transformTemplate<T extends string>(templateString: T, values: TransformTemplateArgs<T>): string;
246
- //#endregion
247
- export { BuildLogger, BuildLoggerConfig, BuildType, ConfigBuilder, ConfigResponse, HotUpdaterConfigOptions, HotUpdaterLogWriter, IConfigBuilder, ImportInfo, PromptProgress, PromptSpinner, ProviderConfig, ReactNativeMetadata, banner, colors, copyDirToTmp, createLogWriter, createTarBr, createTarBrTargetFiles, createTarGz, createTarGzTargetFiles, createZip, createZipTargetFiles, decryptJson, encryptJson, ensureInstallPackages, getAndroidSdkPath, getCwd, getPackageManager, getReactNativeMetadatas, link, loadConfig, loadConfigSync, log, makeEnv, p, printBanner, stripAnsi, transformEnv, transformTemplate };