Skip to content

Commit 3f9ac67

Browse files
Improve project creation
Add required fields in `package.json` when project is created. This way there will be no warnings during `tns create <app>`. Also improve the message (use markdown).
1 parent 882aefd commit 3f9ac67

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/services/project-data-service.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ export class ProjectDataService implements IProjectDataService {
6161
assert.ok(this.projectFilePath, "Initialize method of projectDataService is not called.");
6262

6363
if(!this.$fs.exists(this.projectFilePath).wait()) {
64-
this.$fs.writeFile(this.projectFilePath, null).wait();
64+
this.$fs.writeJson(this.projectFilePath, {
65+
"description": "NativeScript Application",
66+
"license": "SEE LICENSE IN <your-license-filename>",
67+
"readme": "NativeScript Application",
68+
"repository": "<fill-your-repository-here>"
69+
}).wait();
6570
}
6671

6772
this.projectData = this.$fs.readJson(this.projectFilePath).wait() || Object.create(null);

lib/services/project-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export class ProjectService implements IProjectService {
8383
this.$fs.deleteDirectory(projectDir).wait();
8484
throw err;
8585
}
86-
this.$logger.out("Project %s was successfully created", projectName);
86+
this.$logger.printMarkdown("Project `%s` was successfully created.", projectName);
8787

8888
}).future<void>()();
8989
}

0 commit comments

Comments
 (0)