diff --git a/CHANGELOG.md b/CHANGELOG.md index d968a248d4..ba86f840e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,33 @@ NativeScript CLI Changelog ================ + +5.2.0 (2018, February 13) +== + +### Implemented +* [Implemented #3807](https://github.com/NativeScript/nativescript-cli/issues/3807): Enable app Podfile +* [Implemented #4243](https://github.com/NativeScript/nativescript-cli/issues/4243): CLI command steps profiling and performance analytics +* [Implemented #4305](https://github.com/NativeScript/nativescript-cli/issues/4305): Add official support for Node.js 11 +* [Implemented #4313](https://github.com/NativeScript/nativescript-cli/issues/4313): Track how many users used {N} CLI and Playground +* [Implemented #4323](https://github.com/NativeScript/nativescript-cli/issues/4323): Skip CLI's postinstall in case it is not installed globally +* [Implemented #4325](https://github.com/NativeScript/nativescript-cli/issues/4325): Angular apps should work with HMR out of the box +* [Implemented #4343](https://github.com/NativeScript/nativescript-cli/issues/4343): Support Objective-C code in App Resources for iOS applications + +### Fixed +* [Fixed #3122](https://github.com/NativeScript/nativescript-cli/issues/3122): `tns debug ios --debug-brk` fails the majority of the time +* [Fixed #3161](https://github.com/NativeScript/nativescript-cli/issues/3161): `tns test` command fails to find a running iOS simulator +* [Fixed #4232](https://github.com/NativeScript/nativescript-cli/issues/4232): Unit testing for freshly created angular project is broken on Android emulator +* [Fixed #4253](https://github.com/NativeScript/nativescript-cli/issues/4253): LiveSync stops working in Preview app when make change in scss file +* [Fixed #4255](https://github.com/NativeScript/nativescript-cli/issues/4255): Uninstalling NativeScript should also remove its extensions +* [Fixed #4283](https://github.com/NativeScript/nativescript-cli/issues/4283): `tns run android` fails with private npm registry +* [Fixed #4300](https://github.com/NativeScript/nativescript-cli/issues/4300): Strange logs after project built for Android +* [Fixed #4311](https://github.com/NativeScript/nativescript-cli/issues/4311): [iOS] Build with nativescript-plugin-firebase requires legacy build system +* [Fixed #4324](https://github.com/NativeScript/nativescript-cli/issues/4324): High CPU utilization during `tns run` +* [Fixed #4327](https://github.com/NativeScript/nativescript-cli/issues/4327): `tns devices --availableDevices` prompts to install Xcode command line tools +* [Fixed #4347](https://github.com/NativeScript/nativescript-cli/issues/4347): `tns resources generate splashes ` fails for newly created project + + 5.1.1 (2019, January 17) == diff --git a/docs/man_pages/index.md b/docs/man_pages/index.md index 76fc7c0684..542395e2ea 100644 --- a/docs/man_pages/index.md +++ b/docs/man_pages/index.md @@ -33,7 +33,9 @@ Command | Description [platform list](project/configuration/platform.html) | Lists all platforms that the project currently targets. [platform remove ``](project/configuration/platform-remove.html) | Removes the selected platform from the platforms that the project currently targets. This operation deletes all platform-specific files and subdirectories from your project. [platform update ``](project/configuration/platform-update.html) | Updates the NativeScript runtime for the specified platform. -[resources update](project/configuration/resources-update.html) | Updates the App_Resources/'s internal folder structure to conform to that of an Android Studio project. +[resources update](project/configuration/resources/resources-update.html) | Updates the App_Resources/'s internal folder structure to conform to that of an Android Studio project. +[resources generate splashes](project/configuration/resources/resources-generate-splashes.html) | Generates all splashscreens for Android and iOS platforms and places the generated images in the correct directories under `App_Resources/` directory. +[resources generate icons](project/configuration/resources/resources-generate-icons.html) | Generates all icons for Android and iOS platforms and places the generated images in the correct directories under `App_Resources/` directory. [prepare ``](project/configuration/prepare.html) | Copies relevant content from the app directory to the subdirectory for the selected target platform to let you build the project. [build ``](project/testing/build.html) | Builds the project for the selected target platform and produces an application package or an emulator package. [deploy ``](project/testing/deploy.html) | Deploys the project to a connected physical or virtual device. diff --git a/lib/config.ts b/lib/config.ts index 9c43b70a30..4a3d7ceecd 100644 --- a/lib/config.ts +++ b/lib/config.ts @@ -156,10 +156,10 @@ export class StaticConfig implements IStaticConfig { $hostInfo: IHostInfo = this.$injector.resolve("$hostInfo"); // prepare the directory to host our copy of adb - const defaultAdbDirPath = path.join(__dirname, `resources/platform-tools/android/${process.platform}`); - const pathToPackageJson = path.join(__dirname, "..", "..", "package.json"); - const commonLibVersion = require(pathToPackageJson).version; - const tmpDir = path.join(os.tmpdir(), `telerik-common-lib-${commonLibVersion}`); + const defaultAdbDirPath = path.join(__dirname, "common", "resources", "platform-tools", "android", process.platform); + const pathToPackageJson = path.join(__dirname, "..", "package.json"); + const nsCliVersion = require(pathToPackageJson).version; + const tmpDir = path.join(os.tmpdir(), `nativescript-cli-${nsCliVersion}`); $fs.createDirectory(tmpDir); // copy the adb and associated files diff --git a/lib/definitions/platform.d.ts b/lib/definitions/platform.d.ts index 5d29921748..ac8874cea1 100644 --- a/lib/definitions/platform.d.ts +++ b/lib/definitions/platform.d.ts @@ -284,7 +284,6 @@ interface INodeModulesBuilderData { interface INodeModulesBuilder { prepareNodeModules(opts: INodeModulesBuilderData): Promise; prepareJSNodeModules(opts: INodeModulesBuilderData): Promise; - cleanNodeModules(absoluteOutputPath: string): void; } interface INodeModulesDependenciesBuilder { diff --git a/lib/services/livesync/ios-device-livesync-service.ts b/lib/services/livesync/ios-device-livesync-service.ts index 9239eb4d53..37494537df 100644 --- a/lib/services/livesync/ios-device-livesync-service.ts +++ b/lib/services/livesync/ios-device-livesync-service.ts @@ -24,7 +24,12 @@ export class IOSDeviceLiveSyncService extends DeviceLiveSyncServiceBase implemen } const appId = projectData.projectIdentifiers.ios; - this.socket = await this.device.getDebugSocket(appId, projectData.projectName); + try { + this.socket = await this.device.getDebugSocket(appId, projectData.projectName); + } catch (err) { + this.$logger.trace(`Error while connecting to the debug socket. Error is:`, err); + } + if (!this.socket) { return false; } diff --git a/lib/tools/node-modules/node-modules-builder.ts b/lib/tools/node-modules/node-modules-builder.ts index aad4a34fdd..17f1c27317 100644 --- a/lib/tools/node-modules/node-modules-builder.ts +++ b/lib/tools/node-modules/node-modules-builder.ts @@ -1,4 +1,3 @@ -import * as shelljs from "shelljs"; import { TnsModulesCopy, NpmPluginPrepare } from "./node-modules-dest-copy"; export class NodeModulesBuilder implements INodeModulesBuilder { @@ -23,20 +22,14 @@ export class NodeModulesBuilder implements INodeModulesBuilder { const { nodeModulesData } = opts; const productionDependencies = this.$nodeModulesDependenciesBuilder.getProductionDependencies(nodeModulesData.projectData.projectDir); - if (opts.copyNodeModules) { + if (opts.copyNodeModules && !nodeModulesData.appFilesUpdaterOptions.bundle) { this.initialPrepareNodeModules(opts, productionDependencies); - } else if (nodeModulesData.appFilesUpdaterOptions.bundle) { - this.cleanNodeModules(nodeModulesData.absoluteOutputPath); } return productionDependencies; } - public cleanNodeModules(absoluteOutputPath: string): void { - shelljs.rm("-rf", absoluteOutputPath); - } - - private initialPrepareNodeModules(opts: INodeModulesBuilderData, productionDependencies: IDependencyData[]): IDependencyData[] { + private initialPrepareNodeModules(opts: INodeModulesBuilderData, productionDependencies: IDependencyData[]): void { const { nodeModulesData, release } = opts; if (!this.$fs.exists(nodeModulesData.absoluteOutputPath)) { @@ -44,16 +37,11 @@ export class NodeModulesBuilder implements INodeModulesBuilder { nodeModulesData.lastModifiedTime = null; } - if (!nodeModulesData.appFilesUpdaterOptions.bundle) { - const tnsModulesCopy: TnsModulesCopy = this.$injector.resolve(TnsModulesCopy, { - outputRoot: nodeModulesData.absoluteOutputPath - }); - tnsModulesCopy.copyModules({ dependencies: productionDependencies, release }); - } else { - this.cleanNodeModules(nodeModulesData.absoluteOutputPath); - } + const tnsModulesCopy: TnsModulesCopy = this.$injector.resolve(TnsModulesCopy, { + outputRoot: nodeModulesData.absoluteOutputPath + }); - return productionDependencies; + tnsModulesCopy.copyModules({ dependencies: productionDependencies, release }); } } diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 52d989da93..fe1747b4be 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -4217,9 +4217,9 @@ "integrity": "sha1-Jjj8OaAzHpysGgS3F5mTHJxQ33k=" }, "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" }, "lodash-node": { "version": "2.4.1", diff --git a/package.json b/package.json index a35353c2d0..18959f5889 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "istextorbinary": "2.2.1", "jimp": "0.2.28", "lockfile": "1.0.3", - "lodash": "4.17.10", + "lodash": "4.17.11", "log4js": "1.0.1", "marked": "0.5.1", "marked-terminal": "3.1.1", diff --git a/test/npm-support.ts b/test/npm-support.ts index e917bf4dd3..cb6bb86eed 100644 --- a/test/npm-support.ts +++ b/test/npm-support.ts @@ -294,28 +294,6 @@ describe("Npm support tests", () => { assert.isTrue(filteredResults.length === 1); }); - - it("Ensures that tns_modules absent when bundling", async () => { - const fs = testInjector.resolve("fs"); - const options = testInjector.resolve("options"); - const tnsModulesFolderPath = path.join(appDestinationFolderPath, "app", "tns_modules"); - - try { - options.bundle = false; - await preparePlatform(testInjector); - assert.isTrue(fs.exists(tnsModulesFolderPath), "tns_modules created first"); - - options.bundle = true; - await preparePlatform(testInjector); - assert.isFalse(fs.exists(tnsModulesFolderPath), "tns_modules deleted when bundling"); - - options.bundle = false; - await preparePlatform(testInjector); - assert.isTrue(fs.exists(tnsModulesFolderPath), "tns_modules recreated"); - } finally { - options.bundle = false; - } - }); }); describe("Flatten npm modules tests", () => {