Skip to content

Commit c9b0545

Browse files
author
marchen
committed
update readme
1 parent d05ecfe commit c9b0545

File tree

3 files changed

+31
-23
lines changed

3 files changed

+31
-23
lines changed

README.md

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#mc-react-form
2+
13
# User Guide
24
## Table of Contents
35

@@ -7,8 +9,8 @@
79
- [Available Scripts](#available-scripts)
810
- [npm start](#npm-start)
911
- [npm test](#npm-test)
10-
- [npm run build](#npm-run-build)
1112
- [npm run dist](#npm-run-dist)
13+
- [npm run build](#npm-run-build)
1214
- [npm run eject](#npm-run-eject)
1315
- [Displaying Lint Output in the Editor](#displaying-lint-output-in-the-editor)
1416
- [Installing a Dependency](#installing-a-dependency)
@@ -82,13 +84,18 @@ my-component/
8284
index.html
8385
favicon.ico
8486
src/
85-
App.css
86-
App.js
87-
App.test.js
88-
index.css
87+
components
88+
App.js
89+
App.less.css
90+
App.test.js
91+
index.js
92+
logo.png
8993
index.js
90-
logo.svg
94+
README.md
9195
```
96+
For the component to publish, **these files must exist with exact filenames**;
97+
98+
* `src/components` is the componet will dist.
9299

93100
For the project to build, **these files must exist with exact filenames**:
94101

@@ -112,7 +119,7 @@ In the project directory, you can run:
112119

113120
### `npm start`
114121

115-
Runs the component in the development mode.<br>
122+
Runs the app in the development mode.<br>
116123
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
117124

118125
The page will reload if you make edits.<br>
@@ -123,17 +130,17 @@ You will also see any lint errors in the console.
123130
Launches the test runner in the interactive watch mode.<br>
124131
See the section about [running tests](#running-tests) for more information.
125132

133+
### `npm run dist`
134+
Transform your src/components code to dist folder use babel. and transform your css file use less and autoprefixer.
135+
Your component is ready to be deployed!
136+
126137
### `npm run build`
127138

128139
Builds the component for production to the `build` folder.<br>
129140
It correctly bundles React in production mode and optimizes the build for the best performance.
130141

131142
The build is minified and the filenames include the hashes.<br>
132143

133-
### `npm run dist`
134-
Transform your src/component code to dist folder use babel. and transform your less code to css source.
135-
Your component is ready to be deployed!
136-
137144
### `npm run eject`
138145

139146
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
@@ -166,15 +173,15 @@ Then add this block to the `package.json` file of your project:
166173
{
167174
// ...
168175
"eslintConfig": {
169-
"extends": "react-app"
176+
"extends": "magic-component"
170177
}
171178
}
172179
```
173180

174181
Finally, you will need to install some packages *globally*:
175182

176183
```sh
177-
184+
178185
```
179186

180187
We recognize that this is suboptimal, but it is currently required due to the way we hide the ESLint dependency. The ESLint team is already [working on a solution to this](https://github.com/eslint/eslint/issues/3458) so this may become unnecessary in a couple of months.
@@ -270,15 +277,16 @@ If you are concerned about using Webpack-specific semantics, you can put all you
270277

271278
## Post-Processing CSS
272279

273-
This project setup minifies your CSS and adds vendor prefixes to it automatically through [Autoprefixer](https://github.com/postcss/autoprefixer) so you don’t need to worry about it.
280+
This project setup minifies your CSS and use [less.js](https://github.com/less/less.js) to transform css file then adds vendor prefixes to it automatically through [Autoprefixer](https://github.com/postcss/autoprefixer) so you don’t need to worry about it.
274281

275282
For example, this:
276283

277284
```css
285+
@center: center;
278286
.App {
279287
display: flex;
280288
flex-direction: row;
281-
align-items: center;
289+
align-items: @center;
282290
}
283291
```
284292

@@ -299,7 +307,7 @@ becomes this:
299307
}
300308
```
301309

302-
There is currently no support for preprocessors such as Less, or for sharing variables across CSS files.
310+
There is currently only support less preprocessors.
303311

304312
## Adding Images and Fonts
305313

@@ -970,14 +978,14 @@ Install the Surge CLI if you haven't already by running `npm install -g surge`.
970978
password: ********
971979
project path: /path/to/project/build
972980
size: 7 files, 1.8 MB
973-
domain: create-react-app.surge.sh
981+
domain: create-magic-component.surge.sh
974982
upload: [====================] 100%, eta: 0.0s
975983
propagate on CDN: [====================] 100%
976984
plan: Free
977985
978986
IP Address: X.X.X.X
979987
980-
Success! Project is published and running at create-react-app.surge.sh
988+
Success! Project is published and running at create-magic-component.surge.sh
981989
```
982990
983991
Note that in order to support routers that use HTML5 `pushState` API, you may want to rename the `index.html` in your build folder to `200.html` before deploying to Surge. This [ensures that every URL falls back to that file](https://surge.sh/help/adding-a-200-page-for-client-side-routing).

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"react-dom": "^15.4.0"
99
},
1010
"devDependencies": {
11-
"magic-scripts": "0.8.5"
11+
"magic-scripts": "0.8.6"
1212
},
1313
"dependencies": {
1414
"react-addons-pure-render-mixin": "^15.4.0"

src/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Please read how to development magic component
22

3-
### You need to develop your component in component folder.
4-
### When dist your component, component folder's file .js|.jsx will use babel to transform, .css file will use less and autoprefixer to transform. other file will copy to dist folder.
5-
### Componet folder will transform and publish to npm.
3+
### You need to develop your component in components folder.
4+
### When dist your component, components folder's file .js|.jsx will use babel to transform, .css file will use less and autoprefixer to transform. other file will copy to dist folder.
5+
### componets folder will transform and publish to npm.
66

77
- index.js is the enter pointer.
8-
- component folder is the magic component.
8+
- components folder is the magic component.

0 commit comments

Comments
 (0)