Skip to content

Commit 8a60ccf

Browse files
author
unknown
committed
init generator
0 parents  commit 8a60ccf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+24448
-0
lines changed

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
9+
# Change these settings to your own preference
10+
indent_style = space
11+
indent_size = 4
12+
13+
# We recommend you to keep these unchanged
14+
end_of_line = lf
15+
charset = utf-8
16+
trim_trailing_whitespace = true
17+
insert_final_newline = true
18+
19+
[*.md]
20+
trim_trailing_whitespace = false

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
text=auto

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# System folders
2+
###################
3+
.DS_Store
4+
5+
# Node
6+
###################
7+
node_modules
8+
9+
# Other folders
10+
###################
11+
coverage

.jscsrc

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"excludeFiles": ["node_modules/**", "bower_components/**"],
3+
4+
"requireCurlyBraces": [
5+
"if",
6+
"else",
7+
"for",
8+
"while",
9+
"do",
10+
"try",
11+
"catch"
12+
],
13+
"requireOperatorBeforeLineBreak": true,
14+
"requireCamelCaseOrUpperCaseIdentifiers": true,
15+
"maximumLineLength": {
16+
"value": 100,
17+
"allowComments": true,
18+
"allowRegex": true
19+
},
20+
"validateIndentation": 4,
21+
"validateQuoteMarks": "'",
22+
23+
"disallowMultipleLineStrings": true,
24+
"disallowMixedSpacesAndTabs": true,
25+
"disallowTrailingWhitespace": true,
26+
"disallowSpaceAfterPrefixUnaryOperators": true,
27+
"disallowMultipleVarDecl": null,
28+
29+
"requireSpaceAfterKeywords": [
30+
"if",
31+
"else",
32+
"for",
33+
"while",
34+
"do",
35+
"switch",
36+
"return",
37+
"try",
38+
"catch"
39+
],
40+
"requireSpaceBeforeBinaryOperators": [
41+
"=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=",
42+
"&=", "|=", "^=", "+=",
43+
44+
"+", "-", "*", "/", "%", "<<", ">>", ">>>", "&",
45+
"|", "^", "&&", "||", "===", "==", ">=",
46+
"<=", "<", ">", "!=", "!=="
47+
],
48+
"requireSpaceAfterBinaryOperators": true,
49+
"requireSpacesInConditionalExpression": true,
50+
"requireSpaceBeforeBlockStatements": true,
51+
"requireLineFeedAtFileEnd": true,
52+
"disallowSpacesInsideObjectBrackets": "all",
53+
"disallowSpacesInsideArrayBrackets": "all",
54+
"disallowSpacesInsideParentheses": true,
55+
56+
"jsDoc": {
57+
"checkAnnotations": true,
58+
"checkParamNames": true,
59+
"requireParamTypes": true,
60+
"checkReturnTypes": true,
61+
"checkTypes": true
62+
},
63+
64+
"disallowMultipleLineBreaks": true,
65+
66+
"disallowCommaBeforeLineBreak": null,
67+
"disallowDanglingUnderscores": null,
68+
"disallowEmptyBlocks": null,
69+
"disallowMultipleLineStrings": null,
70+
"disallowTrailingComma": null,
71+
"requireCommaBeforeLineBreak": null,
72+
"requireDotNotation": null,
73+
"requireMultipleVarDecl": null,
74+
"requireParenthesesAroundIIFE": true
75+
}

.jshintrc

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"bitwise": true,
3+
"camelcase": true,
4+
"curly": true,
5+
"eqeqeq": true,
6+
"es3": false,
7+
"forin": true,
8+
"freeze": true,
9+
"immed": true,
10+
"indent": 4,
11+
"latedef": false,
12+
"newcap": true,
13+
"noarg": true,
14+
"noempty": true,
15+
"nonbsp": true,
16+
"nonew": true,
17+
"plusplus": false,
18+
"quotmark": "single",
19+
"undef": true,
20+
"unused": false,
21+
"strict": false,
22+
"maxparams": 10,
23+
"maxdepth": 5,
24+
"maxstatements": 40,
25+
"maxcomplexity": 8,
26+
"maxlen": 120,
27+
28+
"asi": false,
29+
"boss": false,
30+
"debug": false,
31+
"eqnull": true,
32+
"esnext": true,
33+
"evil": false,
34+
"expr": false,
35+
"funcscope": false,
36+
"globalstrict": false,
37+
"iterator": false,
38+
"lastsemic": false,
39+
"laxbreak": false,
40+
"laxcomma": false,
41+
"loopfunc": true,
42+
"maxerr": 50,
43+
"moz": false,
44+
"multistr": false,
45+
"notypeof": false,
46+
"proto": false,
47+
"scripturl": false,
48+
"shadow": false,
49+
"sub": true,
50+
"supernew": false,
51+
"validthis": false,
52+
"noyield": false,
53+
54+
"browser": true,
55+
"node": true,
56+
57+
"globals": {
58+
"angular": false
59+
}
60+
}

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
sudo: false
2+
language: node_js
3+
node_js:
4+
- 'stable'
5+
before_script:
6+
- npm install

generators/app/index.js

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
'use strict';
2+
var yeoman = require('yeoman-generator');
3+
var chalk = require('chalk');
4+
var yosay = require('yosay');
5+
var path = require('path');
6+
var _ = require('lodash');
7+
8+
module.exports = yeoman.generators.Base.extend({
9+
constructor: function () {
10+
yeoman.generators.Base.apply(this, arguments);
11+
12+
this.argument('appname', {type: String, required: false});
13+
14+
this.option('skip-install', {
15+
desc: 'Whether dependencies should be installed',
16+
defaults: false
17+
});
18+
19+
this.sourceRoot(path.join(path.dirname(this.resolved), 'templates'));
20+
},
21+
22+
prompting: function () {
23+
this.log(yosay(
24+
'Welcome to Tony Sneed\'s ' + chalk.yellow('Visual Studio Code TypeScript') + ' generator!'
25+
));
26+
27+
var done = this.async();
28+
29+
var dirname = path.basename(process.cwd());
30+
this.appname = _.kebabCase(dirname);
31+
32+
var prompts = [
33+
{
34+
type: 'input',
35+
name: 'appname',
36+
message: 'Application Name (' + chalk.yellow(this.appname) + ')'
37+
}
38+
];
39+
40+
this.prompt(prompts, function (props) {
41+
this.appname = props.appname || this.appname;
42+
done();
43+
}.bind(this));
44+
},
45+
46+
writing: {
47+
project: function () {
48+
this.fs.copyTpl(
49+
this.templatePath('_package.json'),
50+
this.destinationPath('package.json'),
51+
{
52+
appname: this.appname
53+
});
54+
this.fs.copyTpl(
55+
this.templatePath('_README.md'),
56+
this.destinationPath('README.md'),
57+
{
58+
appname: this.appname
59+
});
60+
},
61+
files: function () {
62+
this.copy('editorconfig', '.editorconfig');
63+
this.copy('gitattributes', '.gitattributes');
64+
this.copy('gitignore', '.gitignore');
65+
this.copy('jscsrc', '.jscsrc');
66+
this.copy('jshintrc', '.jshintrc');
67+
this.copy('travis.yml', '.travis.yml');
68+
this.copy('_gulp.config.js', 'gulp.config.js');
69+
this.copy('_gulpfile.js', 'gulpfile.js');
70+
this.copy('_karma.conf.js', 'karma.conf.js');
71+
this.copy('_LICENSE', 'LICENSE');
72+
this.copy('_SpecRunner.html', 'SpecRunner.html');
73+
this.copy('_typings.json', 'typings.json');
74+
this.copy('_tslint.json', 'tslint.json');
75+
this.copy('_tsconfig.json', 'tsconfig.json');
76+
},
77+
directories: function () {
78+
this.directory('vscode', '.vscode');
79+
this.directory('_lib', 'lib');
80+
this.directory('_src', 'src');
81+
this.directory('_util', 'util');
82+
this.directory('_typings', 'typings');
83+
}
84+
},
85+
86+
// install: function () {
87+
// this.installDependencies({
88+
// bower: false,
89+
// skipInstall: this.options['skip-install']
90+
// });
91+
// },
92+
93+
install: {
94+
npmInstall: function () {
95+
var generator = this;
96+
generator.npmInstall(null, { skipInstall: this.options['skip-install'] }, function () {
97+
generator.spawnCommandSync('typings', ['install'])
98+
});
99+
}
100+
},
101+
102+
end: function () {
103+
this.log(chalk.yellow.bold('Installation successful!'));
104+
}
105+
});

generators/app/templates/MYREADME.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
- Press **Ctrl+Shift+B** to build.
2+
- Press **Ctrl+Shift+T** to run tests and see result in the Output window.
3+
4+
Press **Ctrl+Shift+V to switch between views
5+
Press **Ctrl+K V to view markdown preview
6+
7+
{ "key": "ctrl+shift+t", "command": "workbench.action.tasks.test" }

generators/app/templates/_LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 Anthony Sneed
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)