Skip to content

chore: Merge release in master #3520

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 49 commits into from
Apr 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
4e4fb50
Do not create empty .entitlements file
Fatme Mar 21, 2018
cbf2ca0
Print warning when more than one package is produced from build
Fatme Mar 23, 2018
66f5a34
Fix lint error
Mar 23, 2018
4ae2bae
chore: Update CHANGELOG for 4.0.0rc
rosen-vladimirov Mar 26, 2018
8beb15d
Merge pull request #3498 from NativeScript/vladimirov/changelog
rosen-vladimirov Mar 26, 2018
21cac17
Fix (publish): Remove binary-plist and use simple-plist instead
Fatme Mar 23, 2018
eeb64d8
Merge pull request #3482 from NativeScript/fatme/entitlements
Mar 27, 2018
e50e866
Merge pull request #3489 from NativeScript/fatme/multiple-packages-wa…
Mar 27, 2018
bab2994
Merge pull request #3490 from NativeScript/fatme/plist
Mar 27, 2018
aa4cf80
fix: Move @types/ora as devDependency
Mar 26, 2018
f9ef10b
feat(commands) Introduce postCommandAction
rosen-vladimirov Mar 26, 2018
37c2576
Merge pull request #3501 from NativeScript/vladimirov/post-command-ac…
rosen-vladimirov Mar 28, 2018
7ad017d
Merge pull request #3500 from NativeScript/fatme/fix-ora
rosen-vladimirov Mar 28, 2018
88dde98
docs: Fix the help of `tns generate splashes` command
rosen-vladimirov Mar 28, 2018
8d7ebee
Merge pull request #3504 from NativeScript/vladimirov/fix-helop
rosen-vladimirov Mar 28, 2018
791ac7e
fix(deps): Remove bufferpack
rosen-vladimirov Mar 28, 2018
f141d0d
fix(deps): Remove glob
rosen-vladimirov Mar 28, 2018
0d7b219
fix(deps): Remove properties-parser
rosen-vladimirov Mar 28, 2018
825a378
fix(deps): Remove filesize and progress-stream
rosen-vladimirov Mar 28, 2018
9d196fd
chore: Update to latest common lib
rosen-vladimirov Mar 29, 2018
ed89a58
Merge pull request #3505 from NativeScript/vladimirov/clean-deps
rosen-vladimirov Mar 29, 2018
e56d57d
fix(logs): Logs from iOS device are not shown on Windows
rosen-vladimirov Mar 29, 2018
3f2cb1f
Merge pull request #3506 from NativeScript/vladimirov/fix-ios-logs-cloud
rosen-vladimirov Mar 29, 2018
ad23f8c
[WIP] Fix env messages
Fatme Mar 20, 2018
28a0cbd
Fixes the behaviour of getting started when `nativescript-cloud` is a…
Fatme Mar 22, 2018
9940fdd
Fix PR comments
Fatme Mar 29, 2018
dfa2df0
fix(AppResources): try recover if resources update fails
KristianDD Mar 23, 2018
159ca19
Merge pull request #3492 from NativeScript/kddimitrov/fix-resources-l…
KristianDD Mar 30, 2018
50bbfb6
Rename nativescript to nativeScript
Fatme Apr 2, 2018
483eaee
fix: Add recursive module resolution
tdermendjiev Mar 23, 2018
f1f8a43
style: Remove whitespaces
tdermendjiev Mar 23, 2018
93a693b
fix: Update findModule function to search through all parents for module
tdermendjiev Mar 27, 2018
e31790a
style: Fix lint errors
tdermendjiev Mar 27, 2018
3238836
Merge pull request #3503 from NativeScript/tdermendzhiev/add-recursiv…
tdermendjiev Apr 2, 2018
4b479fd
fix: Prepare for iOS with cloud builds fails on non macOS
rosen-vladimirov Apr 3, 2018
1d723ea
fix: pass supportVersion to plugin builds and update gradle
Plamen5kov Apr 3, 2018
72c92c5
fix: cli passes support version to plugin builds
Plamen5kov Apr 3, 2018
51ba9d2
Merge pull request #3511 from NativeScript/vladimirov/fix-prepare-ios
rosen-vladimirov Apr 3, 2018
f1a2995
Merge pull request #3495 from NativeScript/fatme/fix-env-messages
Apr 3, 2018
eb580f2
fix: Incorrect error is shown when xcrun simctl is not configured
rosen-vladimirov Apr 3, 2018
6d37e78
Merge pull request #3513 from NativeScript/plamen5kov/fix-plugin-builds
Plamen5kov Apr 3, 2018
5253501
Merge pull request #3514 from NativeScript/vladimirov/update-ios-sim
rosen-vladimirov Apr 3, 2018
b1101cc
feat(analytics): Remove tracking in cross-client project
rosen-vladimirov Apr 3, 2018
676b774
fix: Getting started prompter fails
rosen-vladimirov Apr 3, 2018
9497818
* Show getting started prompts on doctor command
Fatme Apr 4, 2018
32115da
fix: Use correct messages and tracking for getting started prompters
rosen-vladimirov Apr 4, 2018
16248fe
Merge pull request #3518 from NativeScript/vladimirov/getting-started…
rosen-vladimirov Apr 4, 2018
659f11b
chore: Merge remote-tracking branch 'origin/release' into vladimirov/…
rosen-vladimirov Apr 4, 2018
432d05d
chore: Update to latest common lib
rosen-vladimirov Apr 4, 2018
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
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
NativeScript CLI Changelog
================

4.0.0rc (2018, March 23)
==

### New
* [Implemented #3243](https://github.com/NativeScript/nativescript-cli/issues/3243) 'Scss' file changes trigger app refresh instead reloading the view and apply generated 'css'
* [Implemented #3248](https://github.com/NativeScript/nativescript-cli/issues/3248) Support JDK_HOME and JAVA_HOME
* [Implemented #3257](https://github.com/NativeScript/nativescript-cli/issues/3257) Make {N} project structure configurable
* [Implemented #3317](https://github.com/NativeScript/nativescript-cli/issues/3317) Support livesync with webpack
* [Implemented #3449](https://github.com/NativeScript/nativescript-cli/pull/3449) Track Vue.js project type
* [Implemented #3496](https://github.com/NativeScript/nativescript-cli/issues/3496) Generate assets for the mobile application
* [Implemented #3497](https://github.com/NativeScript/nativescript-cli/issues/3497) Command to migrate Android resources to 4.0.0 structure

### Fixed
* [Fixed #3151](https://github.com/NativeScript/nativescript-cli/issues/3151): Install fails if user setting file is not valid json
* [Fixed #3324](https://github.com/NativeScript/nativescript-cli/issues/3324): Error when iOS simulator's window is closed
* [Fixed #3442](https://github.com/NativeScript/nativescript-cli/issues/3442): Unnecessary second build upon `tns run android`
* [Fixed #3451](https://github.com/NativeScript/nativescript-cli/issues/3451): `tns plugin remove` fails with : Cannot convert undefined or null to object


3.4.3 (2018, March 02)
==

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ position: 12

Usage | Synopsis
------|-------
`$ tns resources generate splashes <Path to image> [<background>]` | Generate all splashscreens for Android and iOS based on the specified image.
`$ tns resources generate splashes <Path to image> [--background <Color>]` | Generate all splashscreens for Android and iOS based on the specified image.

Generates all icons for Android and iOS platforms and places the generated images in the correct directories under `App_Resources/<platform>` directory.
Generates all splashscreens for Android and iOS platforms and places the generated images in the correct directories under `App_Resources/<platform>` directory.

### Options
* `--background` Sets the background color of the splashscreen. Defaults to white in case it is not specified.

### Attributes
* `<Path to image>` is a valid path to an image that will be used to generate all splashscreens.
* `<background>` is a valid path to an image that will be used as a background of the splashscreen. Defaults to white in case it is not specified.
* `<Color>` is a valid color. It can be represented with string, like `white`, `black`, `blue`, etc. or its HEX representation, for example `#FFFFFF`, `#000000`, `#0000FF`. NOTE: As the `#` is special symbol in some terminals, make sure to place the value in quotes, for example `$ tns resources generate splashes ../myImage.png --background "#FF00FF"`.

<% if(isHtml) { %>
### Related Commands
Expand Down
2 changes: 1 addition & 1 deletion lib/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ $injector.require("terminalSpinnerService", "./services/terminal-spinner-service

$injector.require('playgroundService', './services/playground-service');
$injector.require("platformEnvironmentRequirements", "./services/platform-environment-requirements");
$injector.require("nativescriptCloudExtensionService", "./services/nativescript-cloud-extension-service");
$injector.require("nativeScriptCloudExtensionService", "./services/nativescript-cloud-extension-service");

$injector.requireCommand("resources|generate|icons", "./commands/generate-assets");
$injector.requireCommand("resources|generate|splashes", "./commands/generate-assets");
Expand Down
13 changes: 12 additions & 1 deletion lib/commands/create-project.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import * as constants from "../constants";
import * as path from "path";

export class CreateProjectCommand implements ICommand {
public enableHooks = false;
public allowedParameters: ICommandParameter[] = [this.$stringParameterBuilder.createMandatoryParameter("Project name cannot be empty.")];

private createdProjecData: ICreateProjectData;

constructor(private $projectService: IProjectService,
private $logger: ILogger,
private $errors: IErrors,
private $options: IOptions,
private $stringParameterBuilder: IStringParameterBuilder) { }
Expand All @@ -23,7 +27,7 @@ export class CreateProjectCommand implements ICommand {
selectedTemplate = this.$options.template;
}

await this.$projectService.createProject({
this.createdProjecData = await this.$projectService.createProject({
projectName: args[0],
template: selectedTemplate,
appId: this.$options.appid,
Expand All @@ -32,6 +36,13 @@ export class CreateProjectCommand implements ICommand {
ignoreScripts: this.$options.ignoreScripts
});
}

public async postCommandAction(args: string[]): Promise<void> {
const { projectDir } = this.createdProjecData;
const relativePath = path.relative(process.cwd(), projectDir);
this.$logger.printMarkdown(`Now you can navigate to your project with \`$ cd ${relativePath}\``);
this.$logger.printMarkdown(`After that you can run it on device/emulator by executing \`$ tns run <platform>\``);
}
}

$injector.registerCommand("create", CreateProjectCommand);
21 changes: 21 additions & 0 deletions lib/commands/post-install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,27 @@ export class PostInstallCliCommand extends PostInstallCommand {

await this.$subscriptionService.subscribeForNewsletter();
}

public async postCommandAction(args: string[]): Promise<void> {
this.$logger.info("You have successfully installed NativeScript CLI.");
this.$logger.info("In order to create a new project, you can use:".green);
this.$logger.printMarkdown("`tns create <app name>`");
this.$logger.info("To build your project locally you can use:".green);
this.$logger.printMarkdown("`tns build <platform>`");
this.$logger.printMarkdown("NOTE: Local builds require additional setup of your environment. You can find more information here: `https://docs.nativescript.org/start/quick-setup`");

// Add a new line just to ensure separation between local builds and cloud builds info.
this.$logger.info("");
this.$logger.info("To build your project in the cloud you can use:".green);
this.$logger.printMarkdown("`tns cloud build <platform>`");
this.$logger.printMarkdown("NOTE: Cloud builds require Telerik account. You can find more information here: `https://docs.nativescript.org/sidekick/intro/requirements`");

this.$logger.info("");
this.$logger.printMarkdown("In case you want to experiment quickly with NativeScript, you can try the Playground: `https://play.nativescript.org`");

this.$logger.info("");
this.$logger.printMarkdown("In case you have any questions, you can check our forum: `https://forum.nativescript.org` and our public Slack channel: `https://nativescriptcommunity.slack.com/`");
}
}

$injector.registerCommand("post-install-cli", PostInstallCliCommand);
2 changes: 1 addition & 1 deletion lib/commands/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class RunCommandBase implements ICommand {
this.platform = this.$devicePlatformsConstants.Android;
}

this.$liveSyncCommandHelper.validatePlatform(this.platform);
await this.$liveSyncCommandHelper.validatePlatform(this.platform);

return true;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/commands/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ $injector.registerCommand("setup|*", SetupCommand);
export class CloudSetupCommand implements ICommand {
public allowedParameters: ICommandParameter[] = [];

constructor(private $nativescriptCloudExtensionService: INativescriptCloudExtensionService) { }
constructor(private $nativeScriptCloudExtensionService: INativeScriptCloudExtensionService) { }

public execute(args: string[]): Promise<any> {
return this.$nativescriptCloudExtensionService.install();
return this.$nativeScriptCloudExtensionService.install();
}
}
$injector.registerCommand(["setup|cloud", "cloud|setup"], CloudSetupCommand);
5 changes: 4 additions & 1 deletion lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ export const enum TrackActionNames {
CreateProject = "Create project",
Debug = "Debug",
Deploy = "Deploy",
LiveSync = "LiveSync"
LiveSync = "LiveSync",
RunSetupScript = "Run Setup Script",
CheckLocalBuildSetup = "Check Local Build Setup",
CheckEnvironmentRequirements = "Check Environment Requirements"
}

export const enum BuildStates {
Expand Down
7 changes: 6 additions & 1 deletion lib/declarations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -788,12 +788,17 @@ interface IBundleValidatorHelper {
validate(): void;
}

interface INativescriptCloudExtensionService {
interface INativeScriptCloudExtensionService {
/**
* Installs nativescript-cloud extension
* @return {Promise<IExtensionData>} returns the extension data
*/
install(): Promise<IExtensionData>;
/**
* Checks if nativescript-cloud extension is installed
* @return {boolean} returns true in case when nativescript-cloud extension is installed, false otherwise
*/
isInstalled(): boolean
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/definitions/platform.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,5 +381,5 @@ interface IUpdateAppOptions extends IOptionalFilesToSync, IOptionalFilesToRemove
}

interface IPlatformEnvironmentRequirements {
checkEnvironmentRequirements(platform: string): Promise<boolean>;
checkEnvironmentRequirements(platform?: string): Promise<boolean>;
}
19 changes: 10 additions & 9 deletions lib/definitions/project.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,21 @@ interface IProjectSettings {
ignoreScripts?: boolean;
}

interface IProjectName {
projectName: string;
}

interface ICreateProjectData extends IProjectDir, IProjectName {

}

interface IProjectService {
/**
* Creates new NativeScript application.
* @param {any} projectSettings Options describing new project - its name, appId, path and template from which to be created.
* @returns {Promise<void>}
*/
createProject(projectSettings: IProjectSettings): Promise<void>;
createProject(projectSettings: IProjectSettings): Promise<ICreateProjectData>;

/**
* Checks if the specified project is valid NativeScript project.
Expand All @@ -58,8 +66,7 @@ interface INsConfig {
appResourcesPath?: string;
}

interface IProjectData extends IProjectDir {
projectName: string;
interface IProjectData extends ICreateProjectData {
platformsDir: string;
projectFilePath: string;
projectId?: string;
Expand Down Expand Up @@ -394,12 +401,6 @@ interface IPlatformProjectService extends NodeJS.EventEmitter {
executeCommand(projectRoot: string, args: any, childProcessOpts?: any, spawnFromEventOptions?: ISpawnFromEventOptions): Promise<ISpawnResult>;
}

interface IAndroidProjectPropertiesManager {
getProjectReferences(): Promise<ILibRef[]>;
addProjectReference(referencePath: string): Promise<void>;
removeProjectReference(referencePath: string): Promise<void>;
}

interface ITestExecutionService {
startTestRunner(platform: string, projectData: IProjectData, projectFilesConfig: IProjectFilesConfig): Promise<void>;
startKarmaServer(platform: string, projectData: IProjectData, projectFilesConfig: IProjectFilesConfig): Promise<void>;
Expand Down
4 changes: 0 additions & 4 deletions lib/definitions/simple-plist.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion lib/services/analytics/analytics-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class AnalyticsService extends AnalyticsServiceBase {

// In some cases (like in case action is Build and platform is Android), we do not know if the deviceType is emulator or device.
// Just exclude the device_type in this case.
if (isForDevice !== null) {
if (isForDevice !== null && isForDevice !== undefined) {
const deviceType = isForDevice ? DeviceTypes.Device : (this.$mobileHelper.isAndroidPlatform(platform) ? DeviceTypes.Emulator : DeviceTypes.Simulator);
label = this.addDataToLabel(label, deviceType);
}
Expand Down
33 changes: 5 additions & 28 deletions lib/services/analytics/google-analytics-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { AnalyticsClients } from "../../common/constants";

export class GoogleAnalyticsProvider implements IGoogleAnalyticsProvider {
private static GA_TRACKING_ID = "UA-111455-44";
private static GA_CROSS_CLIENT_TRACKING_ID = "UA-111455-51";
private currentPage: string;

constructor(private clientId: string,
Expand All @@ -15,15 +14,12 @@ export class GoogleAnalyticsProvider implements IGoogleAnalyticsProvider {
}

public async trackHit(trackInfo: IGoogleAnalyticsData): Promise<void> {
const trackingIds = [GoogleAnalyticsProvider.GA_TRACKING_ID, GoogleAnalyticsProvider.GA_CROSS_CLIENT_TRACKING_ID];
const sessionId = uuid.v4();

for (const gaTrackingId of trackingIds) {
try {
await this.track(gaTrackingId, trackInfo, sessionId);
} catch (e) {
this.$logger.trace("Analytics exception: ", e);
}
try {
await this.track(GoogleAnalyticsProvider.GA_TRACKING_ID, trackInfo, sessionId);
} catch (e) {
this.$logger.trace("Analytics exception: ", e);
}
}

Expand All @@ -41,14 +37,7 @@ export class GoogleAnalyticsProvider implements IGoogleAnalyticsProvider {
}
});

switch (gaTrackingId) {
case GoogleAnalyticsProvider.GA_CROSS_CLIENT_TRACKING_ID:
this.setCrossClientCustomDimensions(visitor, sessionId);
break;
default:
await this.setCustomDimensions(visitor, trackInfo.customDimensions, sessionId);
break;
}
await this.setCustomDimensions(visitor, trackInfo.customDimensions, sessionId);

switch (trackInfo.googleAnalyticsDataType) {
case GoogleAnalyticsDataType.Page:
Expand Down Expand Up @@ -83,18 +72,6 @@ export class GoogleAnalyticsProvider implements IGoogleAnalyticsProvider {
});
}

private async setCrossClientCustomDimensions(visitor: ua.Visitor, sessionId: string): Promise<void> {
const customDimensions: IStringDictionary = {
[GoogleAnalyticsCrossClientCustomDimensions.sessionId]: sessionId,
[GoogleAnalyticsCrossClientCustomDimensions.clientId]: this.clientId,
[GoogleAnalyticsCrossClientCustomDimensions.crossClientId]: this.clientId,
};

_.each(customDimensions, (value, key) => {
visitor.set(key, value);
});
}

private trackEvent(visitor: ua.Visitor, trackInfo: IGoogleAnalyticsEventData): Promise<void> {
return new Promise<void>((resolve, reject) => {
visitor.event(trackInfo.category, trackInfo.action, trackInfo.label, trackInfo.value, { p: this.currentPage }, (err: Error) => {
Expand Down
2 changes: 2 additions & 0 deletions lib/services/android-plugin-build-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,11 @@ export class AndroidPluginBuildService implements IAndroidPluginBuildService {
const androidToolsInfo = this.$androidToolsInfo.getToolsInfo();
const compileSdk = androidToolsInfo.compileSdkVersion;
const buildToolsVersion = androidToolsInfo.buildToolsVersion;
const supportVersion = androidToolsInfo.supportRepositoryVersion;

localArgs.push(`-PcompileSdk=android-${compileSdk}`);
localArgs.push(`-PbuildToolsVersion=${buildToolsVersion}`);
localArgs.push(`-PsupportVersion=${supportVersion}`);

try {
await this.$childProcess.exec(localArgs.join(" "), { cwd: newPluginDir });
Expand Down
Loading