Skip to content

Commit

Permalink
initial commit of yo generator
Browse files Browse the repository at this point in the history
  • Loading branch information
elyseholladay committed Mar 1, 2019
0 parents commit c0bd26c
Show file tree
Hide file tree
Showing 13 changed files with 8,042 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coverage
**/templates
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
coverage
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: node_js
node_js:
- '8'
- '10'
- v11
- v10
- v8
- v6
- v4
9 changes: 9 additions & 0 deletions .yo-rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"generator-node": {
"promptValues": {
"authorName": "Elyse Holladay",
"authorEmail": "elyseholladay@gmail.com",
"authorUrl": ""
}
}
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2019 Elyse Holladay <elyseholladay@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# generator-standard-docs-templates [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url]
> A generator that creates standard templates for common repository documentation.
## Installation

First, install [Yeoman](http://yeoman.io) and generator-standard-docs-templates using [npm](https://www.npmjs.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)).

```bash
npm install -g yo
npm install -g generator-standard-docs-templates
```

Then generate your new project:

```bash
yo standard-docs-templates
```

## Getting To Know Yeoman

* Yeoman has a heart of gold.
* Yeoman is a person with feelings and opinions, but is very easy to work with.
* Yeoman can be too opinionated at times but is easily convinced not to be.
* Feel free to [learn more about Yeoman](http://yeoman.io/).

## License

MIT © [Elyse Holladay]()


[npm-image]: https://badge.fury.io/js/generator-standard-docs-templates.svg
[npm-url]: https://npmjs.org/package/generator-standard-docs-templates
[travis-image]: https://travis-ci.org/elyseholladay/generator-standard-docs-templates.svg?branch=master
[travis-url]: https://travis-ci.org/elyseholladay/generator-standard-docs-templates
[daviddm-image]: https://david-dm.org/elyseholladay/generator-standard-docs-templates.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/elyseholladay/generator-standard-docs-templates
16 changes: 16 additions & 0 deletions __tests__/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use strict';
const path = require('path');
const assert = require('yeoman-assert');
const helpers = require('yeoman-test');

describe('generator-standard-docs-templates:app', () => {
beforeAll(() => {
return helpers
.run(path.join(__dirname, '../generators/app'))
.withPrompts({ someAnswer: true });
});

it('creates files', () => {
assert.file(['dummyfile.txt']);
});
});
38 changes: 38 additions & 0 deletions generators/app/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
'use strict';
const Generator = require('yeoman-generator');
const chalk = require('chalk');
const yosay = require('yosay');

module.exports = class extends Generator {
prompting() {
// Have Yeoman greet the user.
this.log(
yosay(`Welcome to the bedazzling ${chalk.red('generator-standard-docs-templates')} generator!`)
);

const prompts = [
{
type: 'confirm',
name: 'someAnswer',
message: 'Would you like to enable this option?',
default: true
}
];

return this.prompt(prompts).then(props => {
// To access props later use this.props.someAnswer;
this.props = props;
});
}

writing() {
this.fs.copy(
this.templatePath('dummyfile.txt'),
this.destinationPath('dummyfile.txt')
);
}

install() {
this.installDependencies();
}
};
Empty file.
Loading

0 comments on commit c0bd26c

Please sign in to comment.