Skip to content

Commit cba0f9d

Browse files
committed
Add typings.json and README.md templates
1 parent b26dd48 commit cba0f9d

File tree

6 files changed

+24
-15
lines changed

6 files changed

+24
-15
lines changed

app/index.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ module.exports = generators.Base.extend({
1616
description: this.pkg.description,
1717
version: this.pkg.version,
1818
homepage: this.pkg.homepage
19-
// babel: Boolean(this.options.babel)
2019
};
2120

2221
if (_.isObject(this.pkg.author)) {
@@ -135,28 +134,29 @@ module.exports = generators.Base.extend({
135134
if (this.props.keywords) {
136135
pkg.keywords = _.uniq(this.props.keywords.concat(pkg.keywords));
137136
}
138-
139137
// Let's extend package.json so we're not overwriting user previous fields
140138
this.fs.writeJSON(this.destinationPath('package.json'), pkg);
141139
},
142140

143141
templates: function () {
142+
var pkg = this.fs.readJSON(this.destinationPath('package.json'), {});
144143
var templates = [
145144
'.gitignore',
145+
'.typingsrc',
146+
'.vscode/settings.json',
147+
'.vscode/tasks.json',
148+
'README.md',
146149
'tsconfig.json',
147150
'tslint.json',
148-
'typingsrc',
149-
'.vscode/settings.json',
150-
'.vscode/tasks.json'];
151+
'typings.json',
152+
];
151153
for (template of templates) {
152154
var src = this.templatePath(template);
153155
var dest = this.destinationPath(template);
154-
// this.log(`Writing ${src} to ${dest}`);
155-
this.fs.copyTpl(
156-
src,
157-
dest);
156+
//this.log(`Writing ${src} to ${dest}`);
157+
this.fs.copyTpl(src, dest, { pkg: pkg});
158158
}
159-
}
159+
},
160160
},
161161

162162
installing: function () {

app/templates/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# <%= pkg.name%>
2+
3+
© [<%= pkg.author.name%>]()

app/templates/tsconfig.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
"allowJs": true
77
},
88
"exclude": [
9-
"bower_components",
109
"node_modules",
11-
"typings/browser",
12-
"typings/browser.d.ts"
10+
"typings"
1311
]
1412
}

app/templates/typings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "<%= pkg.name%>",
3+
"version": false,
4+
"dependencies": {},
5+
"globalDependencies": {
6+
"node": "registry:dt/node#4.0.0+20160423143914"
7+
}
8+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "generator-vscode-node",
33
"version": "0.1.0",
4-
"description": "Yeoman generator for Visual Code Node projects.",
4+
"description": "Yeoman generator for Visual Code Node and Typescript projects.",
55
"main": "app/index.js",
66
"keywords": [
77
"yeoman-generator",

typings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "generator-vscode-typescript",
33
"version": false,
44
"dependencies": {},
5-
"ambientDependencies": {
5+
"globalDependencies": {
66
"node": "registry:dt/node#4.0.0+20160423143914",
77
"yeoman-generator": "registry:dt/yeoman-generator#0.0.0+20160317120654"
88
}

0 commit comments

Comments
 (0)