@@ -43,7 +43,7 @@ Developing and publishing multiple React components requires a lot of work to ke
4343 "component" : " ReactComponentTemplate"
4444 },
4545 "scripts" : {
46- "start" : " p-s --config node_modules/ react-component-template/package-scripts.js -s" ,
46+ "start" : " p-s --config react-component-template/package-scripts -s" ,
4747 "test" : " npm start test" ,
4848 "precommit" : " npm start precommit" ,
4949 "prepush" : " npm start prepush" ,
@@ -71,130 +71,21 @@ Developing and publishing multiple React components requires a lot of work to ke
7171
72725 . Other files
7373
74- ``` js
75- // TODO: better create generator
74+ There is a ` react-component-template ` scaffold generator, install it:
75+ ``` sh
76+ npm install -g cf-react-component-template
77+ ```
78+ and answer some questions, for example:
79+ ``` sh
80+ cf-react-component-template
81+
82+ Your name: Nik Butenko
83+ Your email (will be publicly available, optional):
[email protected] 84+ Your GitHub public username: nkbt
85+ Package name: my-awesome-react-lib
86+ Global package name (CamelCased): MyAwesomeReactLib
87+ Package description: My awesome React library
7688 ```
77-
78-
79- # Template-based component features
80-
81- ## Installation
82-
83- Considering the name is ` react-component-template ` and it is published to NPM
84-
85- ### NPM
86-
87- ``` sh
88- npm install --save react react-component-template
89- ```
90-
91- Don't forget to manually install peer dependencies (` react ` ) if you use npm@3.
92-
93-
94- ### Bower:
95- ``` sh
96- bower install --save https://npmcdn.com/react-component-template/bower.zip
97- ```
98-
99- or in ` bower.json `
100-
101- ``` json
102- {
103- "dependencies" : {
104- "react-component-template" : " https://npmcdn.com/react-component-template/bower.zip"
105- }
106- }
107- ```
108-
109- then include as
110- ``` html
111- <script src =" bower_components/react/react.js" ></script >
112- <script src =" bower_components/react-component-template/build/react-component-template.js" ></script >
113- ```
114-
115-
116- ### 1998 Script Tag:
117- ``` html
118- <script src =" https://npmcdn.com/react/dist/react.js" ></script >
119- <script src =" https://npmcdn.com/react-component-template/build/react-component-template.js" ></script >
120- (Module exposed as `ReactComponentTemplate`)
121- ```
122-
123-
124- ## Demo
125-
126- Publishing on ` gh-pages ` :
127- ``` sh
128- npm start gh-pages
129- ```
130-
131- [ http://nkbt.github.io/react-component-template ] ( http://nkbt.github.io/react-component-template )
132-
133- ## Codepen demo
134-
135- ``` js
136- // TODO
137- ```
138-
139-
140- ## Usage
141- ``` js
142- import React from ' react' ;
143- import ReactDOM from ' react-dom' ;
144- import ReactComponentTemplate from ' react-component-template' ;
145-
146- const App = React .createClass ({
147- render () {
148- return (
149- < div>
150- < ReactComponentTemplate some= " prop" / >
151- < / div>
152- );
153- }
154- });
155-
156- const appRoot = document .createElement (' div' );
157- document .body .appendChild (appRoot);
158- ReactDOM .render (< App / > , appRoot);
159- ```
160-
161- ## Options
162-
163-
164- ``` js
165- // TODO: list component props
166- ```
167-
168-
169- ## Development and testing
170-
171- Currently is being developed and tested with the latest stable ` Node 5 ` on ` OSX ` and ` Windows ` .
172- Should be ok with Node 4, but not guaranteed.
173-
174- To run example covering all ` ReactComponentTemplate ` features, use ` npm start dev ` , which will compile ` src/example/Example.js `
175-
176- ``` bash
177- git clone
[email protected] :nkbt/react-component-template.git
178- cd react-component-template
179- npm install
180- npm start dev
181-
182- # then
183- open http://localhost:8080
184- ```
185-
186- ## Tests
187-
188- ``` bash
189- # to run tests
190- npm start test
191-
192- # to generate test coverage (./reports/coverage)
193- npm start test.cov
194-
195- # to run end-to-end tests
196- npm start test.e2e
197- ```
19889
19990## License
20091
0 commit comments