-
-
Notifications
You must be signed in to change notification settings - Fork 197
Refactor project and platform services #7
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
Conversation
@@ -32,5 +38,30 @@ export class NodePackageManager implements INodePackageManager { | |||
}); | |||
return future; | |||
} | |||
|
|||
public tryExecuteAction(action: any, args?: any[]): IFuture<void> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
action
shouldn't be any. Rather, it should be, let's say, action: (...args: any[]) => void
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can simplify the signature for args
by using open-ended arguments: ...args: any[]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree :) It looks better
|
||
public buildProject(projectRoot: string): IFuture<void> { | ||
return (() => { | ||
var buildConfiguration = options.release || "--debug"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is odd. Isn't options.release
a boolean value? Why would it have the value --release
?
@@ -2,6 +2,7 @@ interface INodePackageManager { | |||
cache: string; | |||
load(config?: any): IFuture<void>; | |||
install(where: string, what: string): IFuture<any>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method can be made private in the implementation. The installSafe
method can be renamed to just install
, then.
👍 |
}).future<void>()(); | ||
} | ||
|
||
public install(packageName: string, pathToSave?: string): IFuture<string> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can move this after the other public method in this class.
@ligaz I did the folowings:
|
export var DEFAULT_PROJECT_ID = "com.telerik.tns.HelloWorld"; | ||
export var DEFAULT_PROJECT_NAME = "HelloNativescript"; | ||
export var APP_RESOURCES_FOLDER_NAME = "App_Resources"; | ||
export var PROJECT_FRAMEWORK_DIR = "framework"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are already using the FOLDER_NAME convention so it looks better to name this PROJECT_FRAMEWORK_FOLDER_NAME.
Yes, it looks much better after this refactoring. Good job 😉 |
👍 well done. |
Refactor project and platform services
We need this refactoring in order to reuse code for
iOSProjectService