@atomicservice/ascf-base 1.0.12 → 1.0.14

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 CHANGED
@@ -23,21 +23,24 @@ declare class Logger {
23
23
  declare function getLogger(categories: any): Logger;
24
24
 
25
25
  declare const qsHostPkg = "com.enjoy.now.hmos";
26
- declare const LEGACY_PKG_NAME = "com.huawei.intelligent/com.huawei.ascf.main.AscfActivity";
26
+ declare const LEGACY_PKG_NAME = "com.huawei.fastapp.dev/com.huawei.ascf.main.AscfActivity";
27
27
  declare const LEGACY_DEVICE = "legacy";
28
28
  declare const HOS_DEVICE = "hos";
29
29
  declare const DEBUG_TYPE_VIEW = "view";
30
30
  declare const DEBUG_TYPE_SERVICE = "service";
31
+ declare const BUILD_TARGET_QS = "quickapp";
32
+ declare const BUILD_TARGET_AS = "atomicservice";
31
33
 
32
34
  type BuildModeType = 'debug' | 'release';
33
- type BuildTargetType = 'atomicservice' | 'crossAtomicService';
34
- type BuildDeviceType = 'hos' | 'legacy';
35
+ type BuildTargetType = typeof BUILD_TARGET_AS | typeof BUILD_TARGET_QS;
36
+ type BuildDeviceType = typeof HOS_DEVICE | typeof LEGACY_DEVICE;
35
37
  type BuilderOptions = {
36
38
  projectRoot?: string;
37
39
  deviceId?: string;
38
40
  buildMode?: BuildModeType;
39
41
  targets?: BuildTargetType;
40
42
  deviceType?: BuildDeviceType;
43
+ subCmd: string;
41
44
  };
42
45
  type DebuggerOptions = {
43
46
  open?: '' | 'default' | 'chrome' | 'edge';
@@ -137,6 +140,11 @@ declare class AscfBuilder extends BuildProcess {
137
140
  uninstall(): Promise<void>;
138
141
  }
139
142
 
143
+ declare function copyDirectory(src: string, dest: string, filter?: any): void;
144
+ declare function isDirectoryExists(dirPath: string): boolean;
145
+ declare function isAscfProject(path: any): boolean;
146
+ declare function isMpProject(path: any): boolean;
147
+
140
148
  declare const IS_WIN32: boolean;
141
149
  declare const IS_MACOS: boolean;
142
150
  declare function getDevEcoToolsDir(): string;
@@ -178,6 +186,11 @@ declare function hasHvigor(projectRoot: any): boolean;
178
186
  declare function clearAscfDepDirCache(projectRoot: any): void;
179
187
  declare function fixHvigorPath(fixPath: any): any;
180
188
  declare function getAscfDepDir(projectRoot: any): Promise<string | undefined>;
189
+ declare function getCmdAndArgs(projectRoot: any, options?: any): Promise<{
190
+ cmd: string;
191
+ args: any[];
192
+ ascfVerCmd: string;
193
+ }>;
181
194
  declare function ascfRun(projectRoot: any, options?: any, onCp?: any): Promise<void>;
182
195
  declare function ascfCompile(projectRoot: any, options?: any, onCp?: any): Promise<void>;
183
196
  declare function ascfConvert(input: any, projectRoot: any, options?: any): Promise<void>;
@@ -242,8 +255,6 @@ declare function startServer(port: number, staticFolder: string): Promise<{
242
255
  hasReq(url: string): boolean | "";
243
256
  }>;
244
257
 
245
- declare const BUILD_TARGET_AS = "atomicservice";
246
- declare const BUILD_TARGET_QS = "crossAtomicService";
247
258
  declare function hdcShared({ logger, getDevEcoSdkHome, getPath, getHdcPath }: {
248
259
  logger: any;
249
260
  getDevEcoSdkHome: any;
@@ -290,6 +301,7 @@ declare function hdcDeviceShared(opts: any): {
290
301
  };
291
302
  };
292
303
 
304
+ declare function getBuildProfile(projectRoot: string): any;
293
305
  declare function execSafe(cmd: any, opt?: {}): string | undefined;
294
306
 
295
307
  declare function openInBrowser(url: any, browserName?: string): void;
@@ -331,4 +343,4 @@ declare function tryHdcPortReversing(deviceId: any, localPort: any, times?: numb
331
343
 
332
344
  declare function installSpkShared({ logger, projectRoot, deviceId, getSpkInfo, buildMode, startServer, tryAdbPortReversing, startHostPkgUrl, rportRmCmd, legacyPkg }: IInstallSpkShared): Promise<void>;
333
345
 
334
- export { $async, ASCF_LOG_FILE, AscfBuilder, AscfDebugger, AsyncResult, BUILD_MODE_DEBUG, BUILD_MODE_RELEASE, BUILD_TARGET_AS, BUILD_TARGET_QS, BuildProcessFactory, DEBUG_TYPE_SERVICE, DEBUG_TYPE_VIEW, DebuggerProcessFactory, ERROR_MSG, HOS_DEVICE, IS_MACOS, IS_WIN32, LEGACY_DEVICE, LEGACY_PKG_NAME, ascfCompile, ascfConvert, ascfGenCert, ascfGenP12, ascfRun, clearAscfDepDirCache, configureLogger, type deviceType, devicesLegacyShared, execSafe, findAvailablePort, fixHvigorPath, fportCmd, fportListCmd, fportRmCmd, getAdbPath, getAscfDebuggerPidFile, getAscfDepDir, getBundleInfo, getDebugServerInfo, getDebugees, getDevEcoSdkHome, getDevEcoToolsDir, getDeviceName, getDevicesCmd, getHdcPath, getHvigorwPath, getJavaBinPath, getLegacyDeviceName, getLegacyPackInfo, getLegacyProcess, getLogLevelGetter, getLogger, getNodeBinPath, getNodePath, getNpmPath, getOhpmPath, getPath, getPid, getProjectConfig, getSpkInfo, hasHvigor, hdcDeviceShared, hdcShared, installAscfTools, installSpkShared, isPortReachable, listTargets, maskLast4, mergeJson, normalizeBuildMode, openInBrowser, optArgIf, parseJsonFile, parseJsonSafe, portManagerShared, qsHostPkg, rportCmd, rportRmCmd, runAdbCmdAsync, setLogLevelGetter, setLoggerConfig, startDebugServerCmd, startHostPkg, startHostPkgUrl, startServer, stopDebugServer, tryAdbPortReversing, tryHdcPortReversing };
346
+ export { $async, ASCF_LOG_FILE, AscfBuilder, AscfDebugger, AsyncResult, BUILD_MODE_DEBUG, BUILD_MODE_RELEASE, BUILD_TARGET_AS, BUILD_TARGET_QS, BuildProcessFactory, DEBUG_TYPE_SERVICE, DEBUG_TYPE_VIEW, DebuggerProcessFactory, ERROR_MSG, HOS_DEVICE, IS_MACOS, IS_WIN32, LEGACY_DEVICE, LEGACY_PKG_NAME, ascfCompile, ascfConvert, ascfGenCert, ascfGenP12, ascfRun, clearAscfDepDirCache, configureLogger, copyDirectory, type deviceType, devicesLegacyShared, execSafe, findAvailablePort, fixHvigorPath, fportCmd, fportListCmd, fportRmCmd, getAdbPath, getAscfDebuggerPidFile, getAscfDepDir, getBuildProfile, getBundleInfo, getCmdAndArgs, getDebugServerInfo, getDebugees, getDevEcoSdkHome, getDevEcoToolsDir, getDeviceName, getDevicesCmd, getHdcPath, getHvigorwPath, getJavaBinPath, getLegacyDeviceName, getLegacyPackInfo, getLegacyProcess, getLogLevelGetter, getLogger, getNodeBinPath, getNodePath, getNpmPath, getOhpmPath, getPath, getPid, getProjectConfig, getSpkInfo, hasHvigor, hdcDeviceShared, hdcShared, installAscfTools, installSpkShared, isAscfProject, isDirectoryExists, isMpProject, isPortReachable, listTargets, maskLast4, mergeJson, normalizeBuildMode, openInBrowser, optArgIf, parseJsonFile, parseJsonSafe, portManagerShared, qsHostPkg, rportCmd, rportRmCmd, runAdbCmdAsync, setLogLevelGetter, setLoggerConfig, startDebugServerCmd, startHostPkg, startHostPkgUrl, startServer, stopDebugServer, tryAdbPortReversing, tryHdcPortReversing };
package/dist/index.d.ts CHANGED
@@ -23,21 +23,24 @@ declare class Logger {
23
23
  declare function getLogger(categories: any): Logger;
24
24
 
25
25
  declare const qsHostPkg = "com.enjoy.now.hmos";
26
- declare const LEGACY_PKG_NAME = "com.huawei.intelligent/com.huawei.ascf.main.AscfActivity";
26
+ declare const LEGACY_PKG_NAME = "com.huawei.fastapp.dev/com.huawei.ascf.main.AscfActivity";
27
27
  declare const LEGACY_DEVICE = "legacy";
28
28
  declare const HOS_DEVICE = "hos";
29
29
  declare const DEBUG_TYPE_VIEW = "view";
30
30
  declare const DEBUG_TYPE_SERVICE = "service";
31
+ declare const BUILD_TARGET_QS = "quickapp";
32
+ declare const BUILD_TARGET_AS = "atomicservice";
31
33
 
32
34
  type BuildModeType = 'debug' | 'release';
33
- type BuildTargetType = 'atomicservice' | 'crossAtomicService';
34
- type BuildDeviceType = 'hos' | 'legacy';
35
+ type BuildTargetType = typeof BUILD_TARGET_AS | typeof BUILD_TARGET_QS;
36
+ type BuildDeviceType = typeof HOS_DEVICE | typeof LEGACY_DEVICE;
35
37
  type BuilderOptions = {
36
38
  projectRoot?: string;
37
39
  deviceId?: string;
38
40
  buildMode?: BuildModeType;
39
41
  targets?: BuildTargetType;
40
42
  deviceType?: BuildDeviceType;
43
+ subCmd: string;
41
44
  };
42
45
  type DebuggerOptions = {
43
46
  open?: '' | 'default' | 'chrome' | 'edge';
@@ -137,6 +140,11 @@ declare class AscfBuilder extends BuildProcess {
137
140
  uninstall(): Promise<void>;
138
141
  }
139
142
 
143
+ declare function copyDirectory(src: string, dest: string, filter?: any): void;
144
+ declare function isDirectoryExists(dirPath: string): boolean;
145
+ declare function isAscfProject(path: any): boolean;
146
+ declare function isMpProject(path: any): boolean;
147
+
140
148
  declare const IS_WIN32: boolean;
141
149
  declare const IS_MACOS: boolean;
142
150
  declare function getDevEcoToolsDir(): string;
@@ -178,6 +186,11 @@ declare function hasHvigor(projectRoot: any): boolean;
178
186
  declare function clearAscfDepDirCache(projectRoot: any): void;
179
187
  declare function fixHvigorPath(fixPath: any): any;
180
188
  declare function getAscfDepDir(projectRoot: any): Promise<string | undefined>;
189
+ declare function getCmdAndArgs(projectRoot: any, options?: any): Promise<{
190
+ cmd: string;
191
+ args: any[];
192
+ ascfVerCmd: string;
193
+ }>;
181
194
  declare function ascfRun(projectRoot: any, options?: any, onCp?: any): Promise<void>;
182
195
  declare function ascfCompile(projectRoot: any, options?: any, onCp?: any): Promise<void>;
183
196
  declare function ascfConvert(input: any, projectRoot: any, options?: any): Promise<void>;
@@ -242,8 +255,6 @@ declare function startServer(port: number, staticFolder: string): Promise<{
242
255
  hasReq(url: string): boolean | "";
243
256
  }>;
244
257
 
245
- declare const BUILD_TARGET_AS = "atomicservice";
246
- declare const BUILD_TARGET_QS = "crossAtomicService";
247
258
  declare function hdcShared({ logger, getDevEcoSdkHome, getPath, getHdcPath }: {
248
259
  logger: any;
249
260
  getDevEcoSdkHome: any;
@@ -290,6 +301,7 @@ declare function hdcDeviceShared(opts: any): {
290
301
  };
291
302
  };
292
303
 
304
+ declare function getBuildProfile(projectRoot: string): any;
293
305
  declare function execSafe(cmd: any, opt?: {}): string | undefined;
294
306
 
295
307
  declare function openInBrowser(url: any, browserName?: string): void;
@@ -331,4 +343,4 @@ declare function tryHdcPortReversing(deviceId: any, localPort: any, times?: numb
331
343
 
332
344
  declare function installSpkShared({ logger, projectRoot, deviceId, getSpkInfo, buildMode, startServer, tryAdbPortReversing, startHostPkgUrl, rportRmCmd, legacyPkg }: IInstallSpkShared): Promise<void>;
333
345
 
334
- export { $async, ASCF_LOG_FILE, AscfBuilder, AscfDebugger, AsyncResult, BUILD_MODE_DEBUG, BUILD_MODE_RELEASE, BUILD_TARGET_AS, BUILD_TARGET_QS, BuildProcessFactory, DEBUG_TYPE_SERVICE, DEBUG_TYPE_VIEW, DebuggerProcessFactory, ERROR_MSG, HOS_DEVICE, IS_MACOS, IS_WIN32, LEGACY_DEVICE, LEGACY_PKG_NAME, ascfCompile, ascfConvert, ascfGenCert, ascfGenP12, ascfRun, clearAscfDepDirCache, configureLogger, type deviceType, devicesLegacyShared, execSafe, findAvailablePort, fixHvigorPath, fportCmd, fportListCmd, fportRmCmd, getAdbPath, getAscfDebuggerPidFile, getAscfDepDir, getBundleInfo, getDebugServerInfo, getDebugees, getDevEcoSdkHome, getDevEcoToolsDir, getDeviceName, getDevicesCmd, getHdcPath, getHvigorwPath, getJavaBinPath, getLegacyDeviceName, getLegacyPackInfo, getLegacyProcess, getLogLevelGetter, getLogger, getNodeBinPath, getNodePath, getNpmPath, getOhpmPath, getPath, getPid, getProjectConfig, getSpkInfo, hasHvigor, hdcDeviceShared, hdcShared, installAscfTools, installSpkShared, isPortReachable, listTargets, maskLast4, mergeJson, normalizeBuildMode, openInBrowser, optArgIf, parseJsonFile, parseJsonSafe, portManagerShared, qsHostPkg, rportCmd, rportRmCmd, runAdbCmdAsync, setLogLevelGetter, setLoggerConfig, startDebugServerCmd, startHostPkg, startHostPkgUrl, startServer, stopDebugServer, tryAdbPortReversing, tryHdcPortReversing };
346
+ export { $async, ASCF_LOG_FILE, AscfBuilder, AscfDebugger, AsyncResult, BUILD_MODE_DEBUG, BUILD_MODE_RELEASE, BUILD_TARGET_AS, BUILD_TARGET_QS, BuildProcessFactory, DEBUG_TYPE_SERVICE, DEBUG_TYPE_VIEW, DebuggerProcessFactory, ERROR_MSG, HOS_DEVICE, IS_MACOS, IS_WIN32, LEGACY_DEVICE, LEGACY_PKG_NAME, ascfCompile, ascfConvert, ascfGenCert, ascfGenP12, ascfRun, clearAscfDepDirCache, configureLogger, copyDirectory, type deviceType, devicesLegacyShared, execSafe, findAvailablePort, fixHvigorPath, fportCmd, fportListCmd, fportRmCmd, getAdbPath, getAscfDebuggerPidFile, getAscfDepDir, getBuildProfile, getBundleInfo, getCmdAndArgs, getDebugServerInfo, getDebugees, getDevEcoSdkHome, getDevEcoToolsDir, getDeviceName, getDevicesCmd, getHdcPath, getHvigorwPath, getJavaBinPath, getLegacyDeviceName, getLegacyPackInfo, getLegacyProcess, getLogLevelGetter, getLogger, getNodeBinPath, getNodePath, getNpmPath, getOhpmPath, getPath, getPid, getProjectConfig, getSpkInfo, hasHvigor, hdcDeviceShared, hdcShared, installAscfTools, installSpkShared, isAscfProject, isDirectoryExists, isMpProject, isPortReachable, listTargets, maskLast4, mergeJson, normalizeBuildMode, openInBrowser, optArgIf, parseJsonFile, parseJsonSafe, portManagerShared, qsHostPkg, rportCmd, rportRmCmd, runAdbCmdAsync, setLogLevelGetter, setLoggerConfig, startDebugServerCmd, startHostPkg, startHostPkgUrl, startServer, stopDebugServer, tryAdbPortReversing, tryHdcPortReversing };