nativescript 9.1.1-dev.1 → 9.1.2-dev.2026-09-24-36031892256
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/README.md +13 -8
- package/config/test-deps-versions-generated.json +1 -1
- package/docs/man_pages/project/testing/build-windows.md +64 -0
- package/docs/man_pages/project/testing/build.md +4 -2
- package/docs/man_pages/project/testing/debug-windows.md +69 -0
- package/docs/man_pages/project/testing/debug.md +5 -2
- package/docs/man_pages/project/testing/run-windows.md +63 -0
- package/docs/man_pages/project/testing/run.md +5 -2
- package/lib/bootstrap.js +5 -0
- package/lib/commands/build.d.ts +10 -0
- package/lib/commands/build.js +41 -1
- package/lib/commands/debug.d.ts +12 -0
- package/lib/commands/debug.js +28 -1
- package/lib/commands/run.d.ts +14 -0
- package/lib/commands/run.js +35 -1
- package/lib/commands/typings.d.ts +1 -0
- package/lib/commands/typings.js +55 -0
- package/lib/common/bootstrap.js +1 -0
- package/lib/common/commands/doctor.d.ts +7 -0
- package/lib/common/commands/doctor.js +18 -1
- package/lib/common/definitions/mobile.d.ts +9 -0
- package/lib/common/file-system.js +34 -6
- package/lib/common/http-client.js +9 -2
- package/lib/common/mobile/device-platforms-constants.d.ts +2 -0
- package/lib/common/mobile/device-platforms-constants.js +4 -0
- package/lib/common/mobile/mobile-core/devices-service.d.ts +2 -1
- package/lib/common/mobile/mobile-core/devices-service.js +7 -1
- package/lib/common/mobile/mobile-helper.d.ts +1 -0
- package/lib/common/mobile/mobile-helper.js +9 -0
- package/lib/common/mobile/windows/windows-application-manager.d.ts +25 -0
- package/lib/common/mobile/windows/windows-application-manager.js +237 -0
- package/lib/common/mobile/windows/windows-device-discovery.d.ts +9 -0
- package/lib/common/mobile/windows/windows-device-discovery.js +27 -0
- package/lib/common/mobile/windows/windows-device-file-system.d.ts +15 -0
- package/lib/common/mobile/windows/windows-device-file-system.js +74 -0
- package/lib/common/mobile/windows/windows-device.d.ts +13 -0
- package/lib/common/mobile/windows/windows-device.js +110 -0
- package/lib/constants.d.ts +12 -2
- package/lib/constants.js +15 -4
- package/lib/controllers/prepare-controller.js +3 -0
- package/lib/controllers/run-controller.js +1 -0
- package/lib/data/build-data.d.ts +11 -0
- package/lib/data/build-data.js +18 -1
- package/lib/data/prepare-data.d.ts +4 -0
- package/lib/data/prepare-data.js +8 -1
- package/lib/declarations.d.ts +9 -0
- package/lib/definitions/livesync.d.ts +3 -0
- package/lib/definitions/project.d.ts +10 -0
- package/lib/device-path-provider.d.ts +3 -1
- package/lib/device-path-provider.js +13 -1
- package/lib/options.js +19 -0
- package/lib/project-data.js +5 -0
- package/lib/resolvers/livesync-service-resolver.js +3 -0
- package/lib/services/apple-portal/apple-portal-session-service.d.ts +1 -0
- package/lib/services/apple-portal/apple-portal-session-service.js +34 -0
- package/lib/services/build-data-service.d.ts +2 -2
- package/lib/services/build-data-service.js +3 -0
- package/lib/services/build-info-file-service.js +1 -0
- package/lib/services/bundler/bundler-compiler-service.js +1 -0
- package/lib/services/livesync/windows-device-livesync-service.d.ts +14 -0
- package/lib/services/livesync/windows-device-livesync-service.js +47 -0
- package/lib/services/livesync/windows-livesync-service.d.ts +13 -0
- package/lib/services/livesync/windows-livesync-service.js +19 -0
- package/lib/services/platform/add-platform-service.js +9 -1
- package/lib/services/platforms-data-service.d.ts +1 -1
- package/lib/services/platforms-data-service.js +2 -1
- package/lib/services/prepare-data-service.d.ts +2 -2
- package/lib/services/prepare-data-service.js +4 -1
- package/lib/services/project-cleanup-service.d.ts +1 -0
- package/lib/services/project-cleanup-service.js +30 -1
- package/lib/services/project-data-service.js +18 -0
- package/lib/services/windows-project-service.d.ts +42 -0
- package/lib/services/windows-project-service.js +907 -0
- package/package.json +3 -3
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
2
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
9
|
exports.ApplePortalSessionService = void 0;
|
|
10
|
+
const decorators_1 = require("../../common/decorators");
|
|
4
11
|
const helpers_1 = require("../../common/helpers");
|
|
5
12
|
const yok_1 = require("../../common/yok");
|
|
6
13
|
const crypto = require("crypto");
|
|
@@ -12,6 +19,7 @@ class ApplePortalSessionService {
|
|
|
12
19
|
this.$httpClient = $httpClient;
|
|
13
20
|
this.$logger = $logger;
|
|
14
21
|
this.$prompter = $prompter;
|
|
22
|
+
this.logoutEndpoint = "https://appstoreconnect.apple.com/logout";
|
|
15
23
|
this.loginConfigEndpoint = "https://appstoreconnect.apple.com/olympus/v1/app/config?hostname=itunesconnect.apple.com";
|
|
16
24
|
this.defaultLoginConfig = {
|
|
17
25
|
authServiceUrl: "https://idmsa.apple.com/appleautcodh",
|
|
@@ -161,7 +169,30 @@ For more details how to set up your environment, please execute "ns publish ios
|
|
|
161
169
|
this.$applePortalCookieService.updateUserSessionCookie(completeResponse.headers["set-cookie"]);
|
|
162
170
|
}
|
|
163
171
|
async getLoginConfig() {
|
|
172
|
+
var _a, _b;
|
|
164
173
|
let config = null;
|
|
174
|
+
try {
|
|
175
|
+
const logoutResponse = await this.$httpClient.httpRequest({
|
|
176
|
+
url: this.logoutEndpoint,
|
|
177
|
+
method: "HEAD",
|
|
178
|
+
maxRedirects: 0,
|
|
179
|
+
validateStatus: () => true,
|
|
180
|
+
});
|
|
181
|
+
const location = (_a = logoutResponse === null || logoutResponse === void 0 ? void 0 : logoutResponse.headers) === null || _a === void 0 ? void 0 : _a.location;
|
|
182
|
+
if (location) {
|
|
183
|
+
const redirectUrl = new URL(location);
|
|
184
|
+
const widgetKey = (_b = redirectUrl === null || redirectUrl === void 0 ? void 0 : redirectUrl.searchParams) === null || _b === void 0 ? void 0 : _b.get("widgetKey");
|
|
185
|
+
if (widgetKey) {
|
|
186
|
+
return {
|
|
187
|
+
authServiceKey: widgetKey,
|
|
188
|
+
authServiceUrl: "https://idmsa.apple.com/appleauth",
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
catch (err) {
|
|
194
|
+
this.$logger.trace(`Error while executing request to ${this.logoutEndpoint}. More info: ${err}`);
|
|
195
|
+
}
|
|
165
196
|
try {
|
|
166
197
|
const response = await this.$httpClient.httpRequest({
|
|
167
198
|
url: this.loginConfigEndpoint,
|
|
@@ -246,6 +277,9 @@ For more details how to set up your environment, please execute "ns publish ios
|
|
|
246
277
|
}
|
|
247
278
|
}
|
|
248
279
|
exports.ApplePortalSessionService = ApplePortalSessionService;
|
|
280
|
+
__decorate([
|
|
281
|
+
(0, decorators_1.cache)()
|
|
282
|
+
], ApplePortalSessionService.prototype, "getLoginConfig", null);
|
|
249
283
|
yok_1.injector.register("applePortalSessionService", ApplePortalSessionService);
|
|
250
284
|
function makeHashCash(bits, challenge) {
|
|
251
285
|
const version = 1;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AndroidBuildData, IOSBuildData } from "../data/build-data";
|
|
1
|
+
import { AndroidBuildData, IOSBuildData, WindowsBuildData } from "../data/build-data";
|
|
2
2
|
import { IBuildDataService } from "../definitions/build";
|
|
3
3
|
export declare class BuildDataService implements IBuildDataService {
|
|
4
4
|
private $mobileHelper;
|
|
5
5
|
constructor($mobileHelper: Mobile.IMobileHelper);
|
|
6
|
-
getBuildData(projectDir: string, platform: string, data: any): IOSBuildData | AndroidBuildData;
|
|
6
|
+
getBuildData(projectDir: string, platform: string, data: any): IOSBuildData | WindowsBuildData | AndroidBuildData;
|
|
7
7
|
}
|
|
@@ -14,6 +14,9 @@ class BuildDataService {
|
|
|
14
14
|
else if (this.$mobileHelper.isAndroidPlatform(platform)) {
|
|
15
15
|
return new build_data_1.AndroidBuildData(projectDir, platform, data);
|
|
16
16
|
}
|
|
17
|
+
else if (this.$mobileHelper.isWindowsPlatform(platform)) {
|
|
18
|
+
return new build_data_1.WindowsBuildData(projectDir, platform, data);
|
|
19
|
+
}
|
|
17
20
|
}
|
|
18
21
|
}
|
|
19
22
|
exports.BuildDataService = BuildDataService;
|
|
@@ -55,6 +55,7 @@ class BuildInfoFileService {
|
|
|
55
55
|
const deviceRootPath = await this.$devicePathProvider.getDeviceProjectRootPath(device, {
|
|
56
56
|
appIdentifier: projectData.projectIdentifiers[platform],
|
|
57
57
|
getDirname: true,
|
|
58
|
+
projectData,
|
|
58
59
|
});
|
|
59
60
|
const result = helpers.fromWindowsRelativePathToUnix(path.join(deviceRootPath, buildInfoFileName));
|
|
60
61
|
return result;
|
|
@@ -316,6 +316,7 @@ class BundlerCompilerService extends events_1.EventEmitter {
|
|
|
316
316
|
USER_PROJECT_PLATFORMS_ANDROID: this.$options.hostProjectPath,
|
|
317
317
|
USER_PROJECT_PLATFORMS_ANDROID_MODULE: this.$options.hostProjectModuleName,
|
|
318
318
|
USER_PROJECT_PLATFORMS_IOS: this.$options.hostProjectPath,
|
|
319
|
+
USER_PROJECT_PLATFORMS_WINDOWS: this.$options.hostProjectPath,
|
|
319
320
|
});
|
|
320
321
|
}
|
|
321
322
|
if (debugLog) {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DeviceLiveSyncServiceBase } from "./device-livesync-service-base";
|
|
2
|
+
import { IPlatformsDataService } from "../../definitions/platform";
|
|
3
|
+
import { IProjectData } from "../../definitions/project";
|
|
4
|
+
export declare class WindowsDeviceLiveSyncService extends DeviceLiveSyncServiceBase implements INativeScriptDeviceLiveSyncService {
|
|
5
|
+
protected platformsDataService: IPlatformsDataService;
|
|
6
|
+
protected device: Mobile.IDevice;
|
|
7
|
+
private $logger;
|
|
8
|
+
constructor(platformsDataService: IPlatformsDataService, device: Mobile.IDevice, $logger: ILogger);
|
|
9
|
+
restartApplication(projectData: IProjectData, _liveSyncInfo: ILiveSyncResultInfo): Promise<void>;
|
|
10
|
+
shouldRestart(_projectData: IProjectData, liveSyncInfo: ILiveSyncResultInfo): Promise<boolean>;
|
|
11
|
+
tryRefreshApplication(projectData: IProjectData, liveSyncInfo: ILiveSyncResultInfo): Promise<boolean>;
|
|
12
|
+
private isAppRunning;
|
|
13
|
+
removeFiles(_deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[]): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WindowsDeviceLiveSyncService = void 0;
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const child_process_1 = require("child_process");
|
|
6
|
+
const device_livesync_service_base_1 = require("./device-livesync-service-base");
|
|
7
|
+
class WindowsDeviceLiveSyncService extends device_livesync_service_base_1.DeviceLiveSyncServiceBase {
|
|
8
|
+
constructor(platformsDataService, device, $logger) {
|
|
9
|
+
super(platformsDataService, device);
|
|
10
|
+
this.platformsDataService = platformsDataService;
|
|
11
|
+
this.device = device;
|
|
12
|
+
this.$logger = $logger;
|
|
13
|
+
}
|
|
14
|
+
async restartApplication(projectData, _liveSyncInfo) {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
this.$logger.info(`[Windows LiveSync] Restarting application ${projectData.projectName}`);
|
|
17
|
+
const appId = (_b = (_a = projectData.projectIdentifiers) === null || _a === void 0 ? void 0 : _a["windows"]) !== null && _b !== void 0 ? _b : projectData.projectId;
|
|
18
|
+
await this.device.applicationManager.restartApplication({
|
|
19
|
+
appId,
|
|
20
|
+
projectName: projectData.projectName,
|
|
21
|
+
projectDir: projectData.projectDir,
|
|
22
|
+
waitForDebugger: _liveSyncInfo === null || _liveSyncInfo === void 0 ? void 0 : _liveSyncInfo.waitForDebugger,
|
|
23
|
+
debugMode: _liveSyncInfo === null || _liveSyncInfo === void 0 ? void 0 : _liveSyncInfo.debugMode,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
async shouldRestart(_projectData, liveSyncInfo) {
|
|
27
|
+
return !liveSyncInfo.useHotModuleReload || !!liveSyncInfo.waitForDebugger;
|
|
28
|
+
}
|
|
29
|
+
async tryRefreshApplication(projectData, liveSyncInfo) {
|
|
30
|
+
return (projectData.bundler === "vite" &&
|
|
31
|
+
!!liveSyncInfo.useHotModuleReload &&
|
|
32
|
+
this.isAppRunning(projectData.projectName));
|
|
33
|
+
}
|
|
34
|
+
isAppRunning(processName) {
|
|
35
|
+
const result = (0, child_process_1.spawnSync)("tasklist", ["/FI", `IMAGENAME eq ${processName}.exe`, "/NH", "/FO", "CSV"], { encoding: "utf8", windowsHide: true });
|
|
36
|
+
return (result.stdout || "").toLowerCase().includes(`"${processName.toLowerCase()}.exe"`);
|
|
37
|
+
}
|
|
38
|
+
async removeFiles(_deviceAppData, localToDevicePaths) {
|
|
39
|
+
for (const localToDevicePathData of localToDevicePaths) {
|
|
40
|
+
const devicePath = localToDevicePathData.getDevicePath();
|
|
41
|
+
if (fs.existsSync(devicePath)) {
|
|
42
|
+
fs.unlinkSync(devicePath);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.WindowsDeviceLiveSyncService = WindowsDeviceLiveSyncService;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PlatformLiveSyncServiceBase } from "./platform-livesync-service-base";
|
|
2
|
+
import { IPlatformsDataService } from "../../definitions/platform";
|
|
3
|
+
import { IProjectData } from "../../definitions/project";
|
|
4
|
+
import { IProjectFilesManager, IFileSystem } from "../../common/declarations";
|
|
5
|
+
import { IInjector } from "../../common/definitions/yok";
|
|
6
|
+
import { IOptions } from "../../declarations";
|
|
7
|
+
export declare class WindowsLiveSyncService extends PlatformLiveSyncServiceBase implements IPlatformLiveSyncService {
|
|
8
|
+
protected $platformsDataService: IPlatformsDataService;
|
|
9
|
+
protected $projectFilesManager: IProjectFilesManager;
|
|
10
|
+
private $injector;
|
|
11
|
+
constructor($platformsDataService: IPlatformsDataService, $projectFilesManager: IProjectFilesManager, $injector: IInjector, $devicePathProvider: IDevicePathProvider, $fs: IFileSystem, $logger: ILogger, $options: IOptions);
|
|
12
|
+
protected _getDeviceLiveSyncService(device: Mobile.IDevice, _data: IProjectData, _frameworkVersion: string): INativeScriptDeviceLiveSyncService;
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WindowsLiveSyncService = void 0;
|
|
4
|
+
const platform_livesync_service_base_1 = require("./platform-livesync-service-base");
|
|
5
|
+
const windows_device_livesync_service_1 = require("./windows-device-livesync-service");
|
|
6
|
+
const yok_1 = require("../../common/yok");
|
|
7
|
+
class WindowsLiveSyncService extends platform_livesync_service_base_1.PlatformLiveSyncServiceBase {
|
|
8
|
+
constructor($platformsDataService, $projectFilesManager, $injector, $devicePathProvider, $fs, $logger, $options) {
|
|
9
|
+
super($fs, $logger, $platformsDataService, $projectFilesManager, $devicePathProvider, $options);
|
|
10
|
+
this.$platformsDataService = $platformsDataService;
|
|
11
|
+
this.$projectFilesManager = $projectFilesManager;
|
|
12
|
+
this.$injector = $injector;
|
|
13
|
+
}
|
|
14
|
+
_getDeviceLiveSyncService(device, _data, _frameworkVersion) {
|
|
15
|
+
return this.$injector.resolve(windows_device_livesync_service_1.WindowsDeviceLiveSyncService, { device, platformsDataService: this.$platformsDataService });
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.WindowsLiveSyncService = WindowsLiveSyncService;
|
|
19
|
+
yok_1.injector.register("windowsLiveSyncService", WindowsLiveSyncService);
|
|
@@ -26,7 +26,15 @@ class AddPlatformService {
|
|
|
26
26
|
try {
|
|
27
27
|
spinner.start();
|
|
28
28
|
const frameworkDirPath = await this.installPackage(projectData.projectDir, packageToInstall);
|
|
29
|
-
const
|
|
29
|
+
const frameworkPackageJsonPath = path.join(frameworkDirPath || "", "..", "package.json");
|
|
30
|
+
if (!this.$fs.exists(frameworkPackageJsonPath)) {
|
|
31
|
+
throw new Error(`Installed framework package.json not found at ${frameworkPackageJsonPath}`);
|
|
32
|
+
}
|
|
33
|
+
const frameworkPackageJsonContent = this.$fs.readJson(frameworkPackageJsonPath);
|
|
34
|
+
if (!frameworkPackageJsonContent ||
|
|
35
|
+
!frameworkPackageJsonContent.version) {
|
|
36
|
+
throw new Error(`Installed framework package.json at ${frameworkPackageJsonPath} does not contain a version`);
|
|
37
|
+
}
|
|
30
38
|
const frameworkVersion = frameworkPackageJsonContent.version;
|
|
31
39
|
await this.trackPlatformVersion(frameworkVersion, platformData);
|
|
32
40
|
if (!addPlatformData.nativePrepare ||
|
|
@@ -4,6 +4,6 @@ import { IOptions } from "../declarations";
|
|
|
4
4
|
export declare class PlatformsDataService implements IPlatformsDataService {
|
|
5
5
|
private $options;
|
|
6
6
|
private platformsDataService;
|
|
7
|
-
constructor($options: IOptions, $androidProjectService: IPlatformProjectService, $iOSProjectService: IPlatformProjectService);
|
|
7
|
+
constructor($options: IOptions, $androidProjectService: IPlatformProjectService, $iOSProjectService: IPlatformProjectService, $windowsProjectService: IPlatformProjectService);
|
|
8
8
|
getPlatformData(platform: string, projectData: IProjectData): IPlatformData;
|
|
9
9
|
}
|
|
@@ -4,13 +4,14 @@ exports.PlatformsDataService = void 0;
|
|
|
4
4
|
const yok_1 = require("../common/yok");
|
|
5
5
|
const _ = require("lodash");
|
|
6
6
|
class PlatformsDataService {
|
|
7
|
-
constructor($options, $androidProjectService, $iOSProjectService) {
|
|
7
|
+
constructor($options, $androidProjectService, $iOSProjectService, $windowsProjectService) {
|
|
8
8
|
this.$options = $options;
|
|
9
9
|
this.platformsDataService = {};
|
|
10
10
|
this.platformsDataService = {
|
|
11
11
|
ios: $iOSProjectService,
|
|
12
12
|
android: $androidProjectService,
|
|
13
13
|
visionos: $iOSProjectService,
|
|
14
|
+
windows: $windowsProjectService,
|
|
14
15
|
};
|
|
15
16
|
}
|
|
16
17
|
getPlatformData(platform, projectData) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IOSPrepareData, AndroidPrepareData } from "../data/prepare-data";
|
|
1
|
+
import { IOSPrepareData, AndroidPrepareData, WindowsPrepareData } from "../data/prepare-data";
|
|
2
2
|
import { IOptions } from "../declarations";
|
|
3
3
|
export declare class PrepareDataService implements IPrepareDataService {
|
|
4
4
|
private $mobileHelper;
|
|
5
5
|
constructor($mobileHelper: Mobile.IMobileHelper);
|
|
6
|
-
getPrepareData(projectDir: string, platform: string, data: IOptions): IOSPrepareData | AndroidPrepareData;
|
|
6
|
+
getPrepareData(projectDir: string, platform: string, data: IOptions): IOSPrepareData | AndroidPrepareData | WindowsPrepareData;
|
|
7
7
|
}
|
|
@@ -8,13 +8,16 @@ class PrepareDataService {
|
|
|
8
8
|
this.$mobileHelper = $mobileHelper;
|
|
9
9
|
}
|
|
10
10
|
getPrepareData(projectDir, platform, data) {
|
|
11
|
-
const platformLowerCase = platform.toLowerCase();
|
|
11
|
+
const platformLowerCase = platform && platform.toLowerCase();
|
|
12
12
|
if (this.$mobileHelper.isApplePlatform(platform)) {
|
|
13
13
|
return new prepare_data_1.IOSPrepareData(projectDir, platformLowerCase, data);
|
|
14
14
|
}
|
|
15
15
|
else if (this.$mobileHelper.isAndroidPlatform(platform)) {
|
|
16
16
|
return new prepare_data_1.AndroidPrepareData(projectDir, platformLowerCase, data);
|
|
17
17
|
}
|
|
18
|
+
else if (this.$mobileHelper.isWindowsPlatform(platform)) {
|
|
19
|
+
return new prepare_data_1.WindowsPrepareData(projectDir, platformLowerCase, data);
|
|
20
|
+
}
|
|
18
21
|
}
|
|
19
22
|
}
|
|
20
23
|
exports.PrepareDataService = PrepareDataService;
|
|
@@ -10,4 +10,5 @@ export declare class ProjectCleanupService implements IProjectCleanupService {
|
|
|
10
10
|
constructor($fs: IFileSystem, $logger: ILogger, $projectHelper: IProjectHelper, $terminalSpinnerService: ITerminalSpinnerService);
|
|
11
11
|
clean(pathsToClean: string[], options?: IProjectCleanupOptions): Promise<IProjectCleanupResult>;
|
|
12
12
|
cleanPath(pathToClean: string, options?: IProjectCleanupOptions): Promise<IProjectPathCleanupResult>;
|
|
13
|
+
private _releaseWindowsFileLocks;
|
|
13
14
|
}
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ProjectCleanupService = void 0;
|
|
4
4
|
const yok_1 = require("../common/yok");
|
|
5
5
|
const path = require("path");
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
const child_process_1 = require("child_process");
|
|
6
8
|
const color_1 = require("../color");
|
|
7
9
|
class ProjectCleanupService {
|
|
8
10
|
constructor($fs, $logger, $projectHelper, $terminalSpinnerService) {
|
|
@@ -61,7 +63,10 @@ class ProjectCleanupService {
|
|
|
61
63
|
}
|
|
62
64
|
if (stat.isDirectory()) {
|
|
63
65
|
this.$logger.trace(`${logPrefix}Path '${filePath}' is a directory, deleting.`);
|
|
64
|
-
!dryRun
|
|
66
|
+
if (!dryRun) {
|
|
67
|
+
this._releaseWindowsFileLocks(filePath);
|
|
68
|
+
this.$fs.deleteDirectorySafe(filePath);
|
|
69
|
+
}
|
|
65
70
|
fileType = "directory";
|
|
66
71
|
}
|
|
67
72
|
else {
|
|
@@ -89,6 +94,30 @@ class ProjectCleanupService {
|
|
|
89
94
|
}
|
|
90
95
|
return { ok: true };
|
|
91
96
|
}
|
|
97
|
+
_releaseWindowsFileLocks(dirPath) {
|
|
98
|
+
var _a;
|
|
99
|
+
if (process.platform !== "win32")
|
|
100
|
+
return;
|
|
101
|
+
const exeNames = [];
|
|
102
|
+
try {
|
|
103
|
+
for (const entry of fs.readdirSync(dirPath, { withFileTypes: true, recursive: true })) {
|
|
104
|
+
if (!entry.isFile())
|
|
105
|
+
continue;
|
|
106
|
+
const name = (_a = entry.name) !== null && _a !== void 0 ? _a : "";
|
|
107
|
+
if (name.toLowerCase().endsWith(".exe")) {
|
|
108
|
+
exeNames.push(name.slice(0, -4));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
catch (_b) { }
|
|
113
|
+
for (const name of new Set(exeNames)) {
|
|
114
|
+
try {
|
|
115
|
+
(0, child_process_1.execSync)(`taskkill /F /IM "${name}.exe" /T`, { stdio: "ignore" });
|
|
116
|
+
this.$logger.trace(`[clean] Killed process: ${name}.exe`);
|
|
117
|
+
}
|
|
118
|
+
catch (_c) { }
|
|
119
|
+
}
|
|
120
|
+
}
|
|
92
121
|
}
|
|
93
122
|
exports.ProjectCleanupService = ProjectCleanupService;
|
|
94
123
|
yok_1.injector.register("projectCleanupService", ProjectCleanupService);
|
|
@@ -369,6 +369,15 @@ class ProjectDataService {
|
|
|
369
369
|
else if (platform === constants.PlatformTypes.visionos) {
|
|
370
370
|
return d.name === constants.SCOPED_VISIONOS_RUNTIME_NAME;
|
|
371
371
|
}
|
|
372
|
+
else if (platform === constants.PlatformTypes.windows) {
|
|
373
|
+
return [
|
|
374
|
+
constants.SCOPED_WINDOWS_RUNTIME_NAME,
|
|
375
|
+
constants.SCOPED_WINDOWS_HERMES_RUNTIME_NAME,
|
|
376
|
+
constants.SCOPED_WINDOWS_V8_RUNTIME_NAME,
|
|
377
|
+
constants.SCOPED_WINDOWS_QUICKJS_RUNTIME_NAME,
|
|
378
|
+
constants.SCOPED_WINDOWS_JSC_RUNTIME_NAME,
|
|
379
|
+
].includes(d.name);
|
|
380
|
+
}
|
|
372
381
|
});
|
|
373
382
|
if (runtimePackage) {
|
|
374
383
|
const coerced = semver.coerce(runtimePackage.version);
|
|
@@ -417,6 +426,12 @@ class ProjectDataService {
|
|
|
417
426
|
version: null,
|
|
418
427
|
};
|
|
419
428
|
}
|
|
429
|
+
else if (platform === constants.PlatformTypes.windows) {
|
|
430
|
+
return {
|
|
431
|
+
name: constants.SCOPED_WINDOWS_RUNTIME_NAME,
|
|
432
|
+
version: null,
|
|
433
|
+
};
|
|
434
|
+
}
|
|
420
435
|
}
|
|
421
436
|
getNsConfigDefaultContent(data) {
|
|
422
437
|
const config = this.getNsConfigDefaultObject(data);
|
|
@@ -446,6 +461,9 @@ __decorate([
|
|
|
446
461
|
return projectDir + ":" + platform;
|
|
447
462
|
},
|
|
448
463
|
shouldCache(result) {
|
|
464
|
+
if (!result) {
|
|
465
|
+
return false;
|
|
466
|
+
}
|
|
449
467
|
if (result._coerced) {
|
|
450
468
|
return false;
|
|
451
469
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as projectServiceBaseLib from "./platform-project-service-base";
|
|
2
|
+
import { IPlatformData, IPlatformEnvironmentRequirements } from "../definitions/platform";
|
|
3
|
+
import { IProjectData, IProjectDataService, IValidatePlatformOutput } from "../definitions/project";
|
|
4
|
+
import { IOptions, IDependencyData } from "../declarations";
|
|
5
|
+
import { IPluginData } from "../definitions/plugins";
|
|
6
|
+
import { IFileSystem, IChildProcess, IRelease, ISpawnResult } from "../common/declarations";
|
|
7
|
+
import { INotConfiguredEnvOptions } from "../common/definitions/commands";
|
|
8
|
+
import { IProjectChangesInfo } from "../definitions/project-changes";
|
|
9
|
+
export declare class WindowsProjectService extends projectServiceBaseLib.PlatformProjectServiceBase {
|
|
10
|
+
private $options;
|
|
11
|
+
private $logger;
|
|
12
|
+
private $childProcess;
|
|
13
|
+
private $platformEnvironmentRequirements;
|
|
14
|
+
private static WINDOWS_PLATFORM_NAME;
|
|
15
|
+
constructor($fs: IFileSystem, $projectDataService: IProjectDataService, $options: IOptions, $logger: ILogger, $childProcess: IChildProcess, $platformEnvironmentRequirements: IPlatformEnvironmentRequirements);
|
|
16
|
+
private _platformData;
|
|
17
|
+
getPlatformData(projectData: IProjectData): IPlatformData;
|
|
18
|
+
validateOptions(_projectId?: string, _provision?: true | string, _teamId?: true | string): Promise<boolean>;
|
|
19
|
+
getAppResourcesDestinationDirectoryPath(projectData: IProjectData): string;
|
|
20
|
+
validate(projectData: IProjectData, options: IOptions, notConfiguredEnvOptions?: INotConfiguredEnvOptions): Promise<IValidatePlatformOutput>;
|
|
21
|
+
createProject(frameworkDir: string, _frameworkVersion: string, projectData: IProjectData): Promise<void>;
|
|
22
|
+
interpolateData(projectData: IProjectData): Promise<void>;
|
|
23
|
+
private _replaceInFiles;
|
|
24
|
+
interpolateConfigurationFile(projectData: IProjectData): void;
|
|
25
|
+
afterCreateProject(_projectRoot: string, _projectData: IProjectData): void;
|
|
26
|
+
buildProject(projectRoot: string, projectData: IProjectData, buildConfig: any): Promise<void>;
|
|
27
|
+
prepareProject<T>(_projectData: IProjectData, _prepareData: T): Promise<void>;
|
|
28
|
+
checkForChanges(_changesInfo: IProjectChangesInfo, _prepareData: IPrepareData, _projectData: IProjectData): Promise<void>;
|
|
29
|
+
prepareAppResources(projectData: IProjectData): void;
|
|
30
|
+
isPlatformPrepared(projectRoot: string, projectData: IProjectData): boolean;
|
|
31
|
+
preparePluginNativeCode(pluginData: IPluginData, projectData: IProjectData): Promise<void>;
|
|
32
|
+
removePluginNativeCode(_pluginData: IPluginData, _projectData: IProjectData): Promise<void>;
|
|
33
|
+
beforePrepareAllPlugins(_projectData: IProjectData, dependencies?: IDependencyData[]): Promise<IDependencyData[]>;
|
|
34
|
+
handleNativeDependenciesChange(_projectData: IProjectData, _opts: IRelease): Promise<void>;
|
|
35
|
+
cleanDeviceTempFolder(_deviceIdentifier: string, _projectData: IProjectData): Promise<void>;
|
|
36
|
+
processConfigurationFilesFromAppResources(_projectData: IProjectData, _opts: {
|
|
37
|
+
release: boolean;
|
|
38
|
+
}): Promise<void>;
|
|
39
|
+
ensureConfigurationFileInAppResources(projectData: IProjectData): void;
|
|
40
|
+
stopServices(_projectRoot: string): Promise<ISpawnResult>;
|
|
41
|
+
cleanProject(projectRoot: string): Promise<void>;
|
|
42
|
+
}
|