diff --git a/.prettierrc.json b/.prettierrc.json index 661f253672..3c53558cd9 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,3 +1,11 @@ { - "useTabs": true + "useTabs": true, + "overrides": [ + { + "files": "*.json", + "options": { + "useTabs": false + } + } + ] } diff --git a/CHANGELOG.md b/CHANGELOG.md index 95d5556ae7..127b0c6380 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## [8.7.2](https://github.com/NativeScript/nativescript-cli/compare/v8.7.1...v8.7.2) (2024-05-28) + +### Bug Fixes + +* fix `npm i -g nativescript` on npm 10.4.0+ ([9d2ec7c](https://github.com/NativeScript/nativescript-cli/commit/9d2ec7cb6a12ea10439ea287991812645a156473)) + +### Features + +* don't uninstall app by default ([bac14c0](https://github.com/NativeScript/nativescript-cli/commit/bac14c06568c7a0538618d9ca1e369a56dd272b5)) + + + ## [8.7.1](https://github.com/NativeScript/nativescript-cli/compare/v8.7.0...v8.7.1) (2024-05-16) diff --git a/lib/common/mobile/application-manager-base.ts b/lib/common/mobile/application-manager-base.ts index d5daf3a7ce..c61e89a6bd 100644 --- a/lib/common/mobile/application-manager-base.ts +++ b/lib/common/mobile/application-manager-base.ts @@ -6,7 +6,8 @@ import * as _ from "lodash"; export abstract class ApplicationManagerBase extends EventEmitter - implements Mobile.IDeviceApplicationManager { + implements Mobile.IDeviceApplicationManager +{ private lastInstalledAppIdentifiers: string[]; private lastAvailableDebuggableApps: Mobile.IDeviceApplicationInformation[]; private lastAvailableDebuggableAppViews: IDictionary< @@ -36,7 +37,7 @@ export abstract class ApplicationManagerBase appIdentifier ); - if (isApplicationInstalled) { + if (isApplicationInstalled && buildData?.clean) { await this.uninstallApplication(appIdentifier); } @@ -65,7 +66,8 @@ export abstract class ApplicationManagerBase // use locking, so the next executions will not get into the body, while the first one is still working. // In case we do not break the next executions, we'll report each app as newly installed several times. try { - const currentlyInstalledAppIdentifiers = await this.getInstalledApplications(); + const currentlyInstalledAppIdentifiers = + await this.getInstalledApplications(); const previouslyInstalledAppIdentifiers = this.lastInstalledAppIdentifiers || []; @@ -122,9 +124,7 @@ export abstract class ApplicationManagerBase appIdentifier?: string, buildData?: IBuildData ): Promise; - public abstract uninstallApplication( - appIdentifier: string - ): Promise; + public abstract uninstallApplication(appIdentifier: string): Promise; public abstract startApplication( appData: Mobile.IApplicationData ): Promise; @@ -190,9 +190,8 @@ export abstract class ApplicationManagerBase _.each( currentlyAvailableAppViews, (currentlyAvailableViews, appIdentifier) => { - const previouslyAvailableViews = this.lastAvailableDebuggableAppViews[ - appIdentifier - ]; + const previouslyAvailableViews = + this.lastAvailableDebuggableAppViews[appIdentifier]; const newAvailableViews = _.differenceBy( currentlyAvailableViews, @@ -229,9 +228,8 @@ export abstract class ApplicationManagerBase } }); - this.lastAvailableDebuggableAppViews[ - appIdentifier - ] = currentlyAvailableViews; + this.lastAvailableDebuggableAppViews[appIdentifier] = + currentlyAvailableViews; } ); } diff --git a/lib/common/test/unit-tests/mobile/application-manager-base.ts b/lib/common/test/unit-tests/mobile/application-manager-base.ts index 9da40e8e6c..a2cf93db77 100644 --- a/lib/common/test/unit-tests/mobile/application-manager-base.ts +++ b/lib/common/test/unit-tests/mobile/application-manager-base.ts @@ -321,9 +321,8 @@ describe("ApplicationManagerBase", () => { currentlyAvailableAppsForDebugging, numberOfViewsPerApp ); - const currentDebuggableViews: IDictionary< - Mobile.IDebugWebViewInfo[] - > = {}; + const currentDebuggableViews: IDictionary = + {}; applicationManager.on( "debuggableViewFound", (appIdentifier: string, d: Mobile.IDebugWebViewInfo) => { @@ -368,9 +367,8 @@ describe("ApplicationManagerBase", () => { const expectedResults = _.cloneDeep( currentlyAvailableAppWebViewsForDebugging ); - const currentDebuggableViews: IDictionary< - Mobile.IDebugWebViewInfo[] - > = {}; + const currentDebuggableViews: IDictionary = + {}; applicationManager .checkForApplicationUpdates() @@ -819,9 +817,8 @@ describe("ApplicationManagerBase", () => { removedApps = removedApps.concat(currentlyRemovedApps); const currentlyAddedApps = [`app${index}`]; - currentlyInstalledApps = currentlyInstalledApps.concat( - currentlyAddedApps - ); + currentlyInstalledApps = + currentlyInstalledApps.concat(currentlyAddedApps); installedApps = installedApps.concat(currentlyAddedApps); await testInstalledAppsResults(); @@ -1004,7 +1001,11 @@ describe("ApplicationManagerBase", () => { applicationManager.isApplicationInstalled = (appIdentifier: string) => Promise.resolve(true); - await applicationManager.reinstallApplication("appId", "packageFilePath"); + await applicationManager.reinstallApplication( + "appId", + "packageFilePath", + { clean: true } as any + ); assert.deepStrictEqual(uninstallApplicationAppIdParam, "appId"); }); @@ -1047,7 +1048,11 @@ describe("ApplicationManagerBase", () => { return Promise.resolve(); }; - await applicationManager.reinstallApplication("appId", "packageFilePath"); + await applicationManager.reinstallApplication( + "appId", + "packageFilePath", + { clean: true } as any + ); assert.isTrue( isUninstallApplicationCalled, diff --git a/package-lock.json b/package-lock.json index 0d76d30b6f..329dba9e44 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,8 @@ "version": "8.7.1", "bundleDependencies": [ "@npmcli/move-file", - "stringify-package" + "stringify-package", + "fsevents" ], "hasInstallScript": true, "license": "Apache-2.0", @@ -5354,6 +5355,7 @@ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "hasInstallScript": true, + "inBundle": true, "optional": true, "os": [ "darwin" diff --git a/package.json b/package.json index 5b58702a1e..d74038d954 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nativescript", - "preferGlobal": true, - "version": "8.7.1", + "main": "./lib/nativescript-cli-lib.js", + "version": "8.7.2", "author": "NativeScript ", "description": "Command-line interface for building NativeScript projects", "bin": { @@ -10,7 +10,6 @@ "nsc": "./bin/tns", "ns": "./bin/tns" }, - "main": "./lib/nativescript-cli-lib.js", "files": [ "bin/*", "config", @@ -117,7 +116,6 @@ "xml2js": "0.6.2", "yargs": "17.7.1" }, - "analyze": true, "devDependencies": { "@types/archiver": "^5.3.2", "@types/byline": "^4.2.33", @@ -171,13 +169,6 @@ "sinon": "15.0.3", "source-map-support": "0.5.21" }, - "license": "Apache-2.0", - "engines": { - "node": ">=10.0.0" - }, - "lint-staged": { - "*.ts": "prettier --write" - }, "bundleDependencies_comment1": "These dependencies are bundled in the CLI and are not installed from npm to avoid deprecation warnings.", "bundleDependencies_comment2": "Eventually we'll remove them as we replaced their functionality.", "bundleDependencies_comment3": "note: @npmcli/move-file is a transient dep of pacote - we dont use it directly.", @@ -185,6 +176,9 @@ "@npmcli/move-file", "stringify-package" ], + "optionalDependencies": { + "fsevents": "*" + }, "overrides": { "jimp": { "xml2js": "0.6.2" @@ -192,5 +186,13 @@ "npm-watch": { "nodemon": "3.0.3" } + }, + "analyze": true, + "license": "Apache-2.0", + "engines": { + "node": ">=14.0.0" + }, + "lint-staged": { + "*.ts": "prettier --write" } } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy