Skip to content

Commit 3dbdff8

Browse files
committed
first commit
0 parents  commit 3dbdff8

12 files changed

+366
-0
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
end_of_line = lf
6+
charset = utf-8
7+
indent_size = 2
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[{**/{actual,fixtures,expected,templates}/**,*.md}]
12+
trim_trailing_whitespace = false
13+
insert_final_newline = false

.eslintrc.json

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
{
2+
"env": {
3+
"browser": false,
4+
"es6": true,
5+
"node": true,
6+
"mocha": true
7+
},
8+
9+
"globals": {
10+
"document": false,
11+
"navigator": false,
12+
"window": false
13+
},
14+
15+
"rules": {
16+
"accessor-pairs": 2,
17+
"arrow-spacing": [2, { "before": true, "after": true }],
18+
"block-spacing": [2, "always"],
19+
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
20+
"comma-dangle": [2, "never"],
21+
"comma-spacing": [2, { "before": false, "after": true }],
22+
"comma-style": [2, "last"],
23+
"constructor-super": 2,
24+
"curly": [2, "multi-line"],
25+
"dot-location": [2, "property"],
26+
"eol-last": 2,
27+
"eqeqeq": [2, "allow-null"],
28+
"generator-star-spacing": [2, { "before": true, "after": true }],
29+
"handle-callback-err": [2, "^(err|error)$" ],
30+
"indent": [2, 2, { "SwitchCase": 1 }],
31+
"key-spacing": [2, { "beforeColon": false, "afterColon": true }],
32+
"keyword-spacing": [2, { "before": true, "after": true }],
33+
"new-cap": [2, { "newIsCap": true, "capIsNew": false }],
34+
"new-parens": 2,
35+
"no-array-constructor": 2,
36+
"no-caller": 2,
37+
"no-class-assign": 2,
38+
"no-cond-assign": 2,
39+
"no-const-assign": 2,
40+
"no-control-regex": 2,
41+
"no-debugger": 2,
42+
"no-delete-var": 2,
43+
"no-dupe-args": 2,
44+
"no-dupe-class-members": 2,
45+
"no-dupe-keys": 2,
46+
"no-duplicate-case": 2,
47+
"no-empty-character-class": 2,
48+
"no-eval": 2,
49+
"no-ex-assign": 2,
50+
"no-extend-native": 2,
51+
"no-extra-bind": 2,
52+
"no-extra-boolean-cast": 2,
53+
"no-extra-parens": [2, "functions"],
54+
"no-fallthrough": 2,
55+
"no-floating-decimal": 2,
56+
"no-func-assign": 2,
57+
"no-implied-eval": 2,
58+
"no-inner-declarations": [2, "functions"],
59+
"no-invalid-regexp": 2,
60+
"no-irregular-whitespace": 2,
61+
"no-iterator": 2,
62+
"no-label-var": 2,
63+
"no-labels": 2,
64+
"no-lone-blocks": 2,
65+
"no-mixed-spaces-and-tabs": 2,
66+
"no-multi-spaces": 2,
67+
"no-multi-str": 2,
68+
"no-multiple-empty-lines": [2, { "max": 1 }],
69+
"no-native-reassign": 0,
70+
"no-negated-in-lhs": 2,
71+
"no-new": 2,
72+
"no-new-func": 2,
73+
"no-new-object": 2,
74+
"no-new-require": 2,
75+
"no-new-wrappers": 2,
76+
"no-obj-calls": 2,
77+
"no-octal": 2,
78+
"no-octal-escape": 2,
79+
"no-proto": 0,
80+
"no-redeclare": 2,
81+
"no-regex-spaces": 2,
82+
"no-return-assign": 2,
83+
"no-self-compare": 2,
84+
"no-sequences": 2,
85+
"no-shadow-restricted-names": 2,
86+
"no-spaced-func": 2,
87+
"no-sparse-arrays": 2,
88+
"no-this-before-super": 2,
89+
"no-throw-literal": 2,
90+
"no-trailing-spaces": 0,
91+
"no-undef": 2,
92+
"no-undef-init": 2,
93+
"no-unexpected-multiline": 2,
94+
"no-unneeded-ternary": [2, { "defaultAssignment": false }],
95+
"no-unreachable": 2,
96+
"no-unused-vars": [2, { "vars": "all", "args": "none" }],
97+
"no-useless-call": 0,
98+
"no-with": 2,
99+
"one-var": [0, { "initialized": "never" }],
100+
"operator-linebreak": [0, "after", { "overrides": { "?": "before", ":": "before" } }],
101+
"padded-blocks": [0, "never"],
102+
"quotes": [2, "single", "avoid-escape"],
103+
"radix": 2,
104+
"semi": [2, "always"],
105+
"semi-spacing": [2, { "before": false, "after": true }],
106+
"space-before-blocks": [2, "always"],
107+
"space-before-function-paren": [2, "never"],
108+
"space-in-parens": [2, "never"],
109+
"space-infix-ops": 2,
110+
"space-unary-ops": [2, { "words": true, "nonwords": false }],
111+
"spaced-comment": [0, "always", { "markers": ["global", "globals", "eslint", "eslint-disable", "*package", "!", ","] }],
112+
"use-isnan": 2,
113+
"valid-typeof": 2,
114+
"wrap-iife": [2, "any"],
115+
"yoda": [2, "never"]
116+
}
117+
}

.gitattributes

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

.github/contributing.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Contributing to generate-react
2+
3+
First and foremost, thank you! We appreciate that you want to contribute to generate-react, your time is valuable, and your contributions mean a lot to us.
4+
5+
## Important!
6+
7+
By contributing to this project, you:
8+
9+
* Agree that you have authored 100% of the content
10+
* Agree that you have the necessary rights to the content
11+
* Agree that you have received the necessary permissions from your employer to make the contributions (if applicable)
12+
* Agree that the content you contribute may be provided under the Project license(s)
13+
14+
## Getting started
15+
16+
**What does "contributing" mean?**
17+
18+
Creating an issue is the simplest form of contributing to a project. But there are many ways to contribute, including the following:
19+
20+
- Updating or correcting documentation
21+
- Feature requests
22+
- Bug reports
23+
24+
If you'd like to learn more about contributing in general, the [Guide to Idiomatic Contributing](https://github.com/jonschlinkert/idiomatic-contributing) has a lot of useful information.
25+
26+
**Showing support for generate-react**
27+
28+
Please keep in mind that open source software is built by people like you, who spend their free time creating things the rest the community can use.
29+
30+
Don't have time to contribute? No worries, here are some other ways to show your support for generate-react:
31+
32+
- star the [project](https://github.com/generate/generate-react)
33+
- tweet your support for generate-react
34+
35+
## Issues
36+
37+
### Before creating an issue
38+
39+
Please try to determine if the issue is caused by an underlying library, and if so, create the issue there. Sometimes this is difficult to know. We only ask that you attempt to give a reasonable attempt to find out. Oftentimes the readme will have advice about where to go to create issues.
40+
41+
Try to follow these guidelines
42+
43+
- **Avoid creating issues for implementation help**. It's much better for discoverability, SEO, and semantics - to keep the issue tracker focused on bugs and feature requests - to ask implementation-related questions on [stackoverflow.com][so]
44+
- **Investigate the issue**:
45+
- **Check the readme** - oftentimes you will find notes about creating issues, and where to go depending on the type of issue.
46+
- Create the issue in the appropriate repository.
47+
48+
### Creating an issue
49+
50+
Please be as descriptive as possible when creating an issue. Give us the information we need to successfully answer your question or address your issue by answering the following in your issue:
51+
52+
- **version**: please note the version of generate-react are you using
53+
- **extensions, plugins, helpers, etc** (if applicable): please list any extensions you're using
54+
- **error messages**: please paste any error messages into the issue, or a [gist](https://gist.github.com/)
55+
56+
### Closing issues
57+
58+
The original poster or the maintainer's of generate-react may close an issue at any time. Typically, but not exclusively, issues are closed when:
59+
60+
- The issue is resolved
61+
- The project's maintainers have determined the issue is out of scope
62+
- An issue is clearly a duplicate of another issue, in which case the duplicate issue will be linked.
63+
- A discussion has clearly run its course
64+
65+
66+
## Next steps
67+
68+
**Tips for creating idiomatic issues**
69+
70+
Spending just a little extra time to review best practices and brush up on your contributing skills will, at minimum, make your issue easier to read, easier to resolve, and more likely to be found by others who have the same or similar issue in the future. At best, it will open up doors and potential career opportunities by helping you be at your best.
71+
72+
The following resources were hand-picked to help you be the most effective contributor you can be:
73+
74+
- The [Guide to Idiomatic Contributing](https://github.com/jonschlinkert/idiomatic-contributing) is a great place for newcomers to start, but there is also information for experienced contributors there.
75+
- Take some time to learn basic markdown. We can't stress this enough. Don't start pasting code into GitHub issues before you've taken a moment to review this [markdown cheatsheet](https://gist.github.com/jonschlinkert/5854601)
76+
- The GitHub guide to [basic markdown](https://help.github.com/articles/markdown-basics/) is another great markdown resource.
77+
- Learn about [GitHub Flavored Markdown](https://help.github.com/articles/github-flavored-markdown/). And if you want to really go above and beyond, read [mastering markdown](https://guides.github.com/features/mastering-markdown/).
78+
79+
At the very least, please try to:
80+
81+
- Use backticks to wrap code. This ensures that it retains its formatting and isn't modified when it's rendered by GitHub, and makes the code more readable to others
82+
- When applicable, use syntax highlighting by adding the correct language name after the first "code fence"
83+
84+
85+
[so]: http://stackoverflow.com/questions/tagged/generate-react

.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# always ignore files
2+
*.DS_Store
3+
*.sublime-*
4+
5+
# test related, or directories generated by tests
6+
test/actual
7+
actual
8+
coverage
9+
.nyc*
10+
11+
# npm
12+
node_modules
13+
npm-debug.log
14+
15+
# yarn
16+
yarn.lock
17+
yarn-error.log
18+
19+
# misc
20+
_gh_pages
21+
_draft
22+
_drafts
23+
bower_components
24+
vendor
25+
temp
26+
tmp
27+
TODO.md
28+
package-lock.json

.gitkeep

Whitespace-only changes.

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

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) 2020, Yash Pandit.
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.

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# generate-react [![NPM version](https://badge.fury.io/js/generate-react.svg)](https://npmjs.org/package/generate-react) [![Build Status](https://travis-ci.org/generate/generate-react.svg?branch=master)](https://travis-ci.org/generate/generate-react)
2+
3+
> Generate generator for creating React applications, components, and related React resources.
4+
5+
## Installation
6+
7+
```sh
8+
$ npm install --save generate-react
9+
```
10+
11+
## Usage
12+
13+
```js
14+
var generateReact = require('generate-react');
15+
generateReact();
16+
```
17+
18+
## License
19+
20+
MIT © [Yash Pandit](https://github.com/yashpandit)

generator.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
'use strict';
2+
3+
var path = require('path');
4+
var isValid = require('is-valid-app');
5+
6+
module.exports = function(app) {
7+
// return if the generator is already registered
8+
if (!isValid(app, 'generate-react')) return;
9+
10+
/**
11+
* Generate a `index.js` file to the current working directory. Learn how to [customize
12+
* behavior(#customization) or override built-in templates.
13+
*
14+
* ```sh
15+
* $ gen react:react
16+
* ```
17+
* @name react:react
18+
* @api public
19+
*/
20+
21+
task(app, 'react', 'index.js');
22+
23+
/**
24+
* Alias for running the [react](#react) task with the following command:
25+
*
26+
* ```sh
27+
* $ gen react
28+
* ```
29+
* @name react
30+
* @api public
31+
*/
32+
33+
app.task('default', ['react']);
34+
};
35+
36+
/**
37+
* Create a task with the given `name` and glob `pattern`
38+
*/
39+
40+
function task(app, name, pattern) {
41+
app.task(name, function() {
42+
return app.src(pattern, {cwd: __dirname})
43+
.pipe(app.renderFile('*'))
44+
.pipe(app.conflicts(app.cwd))
45+
.pipe(app.dest(app.cwd));
46+
});
47+
}

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
'use strict';
2+
3+
module.exports = require('./generator.js');

package.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "generate-react",
3+
"description": "Generate generator for creating React applications, components, and related React resources.",
4+
"version": "0.1.0",
5+
"homepage": "https://github.com/generate/generate-react",
6+
"author": "Yash Pandit (https://github.com/yashpandit)",
7+
"repository": "generate/generate-react",
8+
"bugs": {
9+
"url": "https://github.com/generate/generate-react/issues"
10+
},
11+
"license": "MIT",
12+
"files": [
13+
"generator.js",
14+
"index.js"
15+
],
16+
"main": "index.js",
17+
"engines": {
18+
"node": ">=4"
19+
},
20+
"scripts": {
21+
"test": "mocha"
22+
},
23+
"dependencies": {
24+
"is-valid-app": "^0.3.0"
25+
},
26+
"keywords": [
27+
"generate",
28+
"react"
29+
]
30+
}

0 commit comments

Comments
 (0)