Skip to content

chore: merge release in master #4365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Feb 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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 <path to image>` fails for newly created project


5.1.1 (2019, January 17)
==

Expand Down
4 changes: 3 additions & 1 deletion docs/man_pages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ Command | Description
[platform list](project/configuration/platform.html) | Lists all platforms that the project currently targets.
[platform remove `<Platform>`](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 `<Platform>`](project/configuration/platform-update.html) | Updates the NativeScript runtime for the specified platform.
[resources update](project/configuration/resources-update.html) | Updates the App_Resources/<platform>'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/<platform>'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/<platform>` 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/<platform>` directory.
[prepare `<Platform>`](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 `<Platform>`](project/testing/build.html) | Builds the project for the selected target platform and produces an application package or an emulator package.
[deploy `<Platform>`](project/testing/deploy.html) | Deploys the project to a connected physical or virtual device.
Expand Down
8 changes: 4 additions & 4 deletions lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion lib/definitions/platform.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ interface INodeModulesBuilderData {
interface INodeModulesBuilder {
prepareNodeModules(opts: INodeModulesBuilderData): Promise<void>;
prepareJSNodeModules(opts: INodeModulesBuilderData): Promise<void>;
cleanNodeModules(absoluteOutputPath: string): void;
}

interface INodeModulesDependenciesBuilder {
Expand Down
7 changes: 6 additions & 1 deletion lib/services/livesync/ios-device-livesync-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
24 changes: 6 additions & 18 deletions lib/tools/node-modules/node-modules-builder.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as shelljs from "shelljs";
import { TnsModulesCopy, NpmPluginPrepare } from "./node-modules-dest-copy";

export class NodeModulesBuilder implements INodeModulesBuilder {
Expand All @@ -23,37 +22,26 @@ 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)) {
// Force copying if the destination doesn't exist.
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 });
}
}

Expand Down
6 changes: 3 additions & 3 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
22 changes: 0 additions & 22 deletions test/npm-support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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", () => {
Expand Down