Skip to content
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

Allow templates to be full applications #3636

Closed
rosen-vladimirov opened this issue May 29, 2018 · 1 comment
Closed

Allow templates to be full applications #3636

rosen-vladimirov opened this issue May 29, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@rosen-vladimirov
Copy link
Contributor

Currently when a project is created the content of the template is placed inside the app directory of the newly created project.

This leads to some issues when you want to support more complex scenarios, for example it is difficult to add configuration file (like nsconfig.json or webpack.config.js) in the root of the project.
The suggested solution to allow templates to be the full application is to check the template from which the application is created. In case the template contains the following information:

{
	"name": "new-template-name",
	"version": "4.0.0",
	"nativescript": {
		"templateVersion": "v2"
	}
}

Read the templateVersion property (if it is not set or there's no nativescript key, the default value is v1) and execute the following action based on its value:

  • In case it is v1, use the old way, i.e. place the content of the template in the app directory of the created project.
  • In case it is v2 place the content of the template at the root of the application.
  • In case it is anything else - throw an error.
  • In case it is missing, use v1 as default.

The solution ensures backwards compatiblity with existing templates and allows creating new types of templates.

@rosen-vladimirov
Copy link
Contributor Author

NOTE: For 4.1.0 we'll release this feature as a BETA - there are still some issues with this approach, for example in case you want the template to has a configuration file required by nativescript-plugin-firebase, the new approach still has some issues with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants