-
-
Notifications
You must be signed in to change notification settings - Fork 197
Add support for different templates #1218
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
Test PASSed. |
} | ||
|
||
this.$logger.trace("New project package.json data: ", projectPackageJsonData); | ||
this.$fs.writeJson(projectPackageJsonPath, projectPackageJsonData).wait(); |
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.
Should we delete the dependencies from template's package.json?
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.
Maybe it's better to delete template's package.json :)
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.
I've added code to delete the package.json
from app dir
40c3d1d
to
c785049
Compare
Test PASSed. |
this.$logger.out("Project %s was successfully created", projectName); | ||
|
||
}).future<void>()(); | ||
} | ||
|
||
private mergeProjectAndTemplateProperties(projectDir: string, templatePath: 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.
You are not returning but the return type is Future. Consider Future
c785049
to
0edeec5
Compare
Test PASSed. |
💯 |
Test PASSed. |
👍 |
56fbe6a
to
df92027
Compare
Test PASSed. |
Add support for --template option when creating new project. The value for `--template` can be anything that you can `npm install`. For example valid calls are: * `tns create app1 --template tns-template-hello-world` * `tns create app1 --template https://github.com/NativeScript/template-hello-world-ts/tarball/master` * `tns create app1 --template ../myTemplate` In case you use: `tns create app1 --template typescript` or `tns create app1 --template tsc`, CLI will try to install `tns-template-hello-world-ts` template. In case you use `tns create app1 --template [email protected]` we will install version 1.2.0 of `tns-template-hello-world-ts`. When a custom template is used, CLI will extend its App_Resources with the ones from default template in case any of them is missing. Update npm version in order to support .git urls for --template option.
When `tns create <app>` is executed, install all dependencies, so typescript compilation will be enabled immediately when using tsc template.
df92027
to
3ad7872
Compare
Test PASSed. |
👍 |
Add support for different templates
Add support for --template option when creating new project.
The value for
--template
can be anything that you cannpm install
. For example valid calls are:tns create app1 --template tns-template-hello-world
tns create app1 --template https://github.com/NativeScript/template-hello-world-ts/tarball/master
tns create app1 --template ../myTemplate
tns create app1 --template https://github.com/NativeScript/template-hello-world-ts.git
tns create app1 --template https://github.com/NativeScript/template-hello-world-ts.git#master
In case you use:
tns create app1 --template typescript
ortns create app1 --template tsc
, CLI will try to installtns-template-hello-world-ts
template.In case you use
tns create app1 --template [email protected]
we will install version 1.2.0 oftns-template-hello-world-ts
.When a custom template is used, CLI will extend its App_Resources with the ones from default template in case any of them is missing.
Implements #374