You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 a nativescript key and templateVersion property in it, check 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.
@@ -189,3 +192,12 @@ export class SubscribeForNewsletterMessages {
189
192
publicstaticReviewPrivacyPolicyMsg=`You can review the Progress Software Privacy Policy at \`${PROGRESS_PRIVACY_POLICY_URL}\``;
190
193
publicstaticPromptMsg="Input your e-mail address to agree".green+" or "+"leave empty to decline".red.bold+":";
191
194
}
195
+
196
+
exportclassTemplateVersions{
197
+
publicstaticv1="v1";
198
+
publicstaticv2="v2";
199
+
}
200
+
201
+
exportclassProjectTemplateErrors{
202
+
publicstaticInvalidTemplateVersionStringFormat="The template '%s' has a NativeScript version '%s' that is not supported. Unable to create project from it.";
this.$logger.trace(`The template ${templatePath} does not specify version or we were unable to find out the version. Using default one ${defaultVersion}`);
0 commit comments