Skip to content
This repository was archived by the owner on May 28, 2019. It is now read-only.

Commit b803761

Browse files
committed
Init v3
1 parent 93ac40a commit b803761

35 files changed

+125
-773
lines changed

.eslintignore

-1
This file was deleted.

.eslintrc

-6
This file was deleted.

.gitignore

+23-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,24 @@
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# dependencies
14
node_modules
2-
*.log
5+
6+
# testing
7+
coverage
8+
9+
# publishing
10+
dist
11+
12+
# development
13+
test-cdk-scripts
14+
15+
# misc
16+
.DS_Store
17+
.env.local
18+
.env.development.local
19+
.env.test.local
20+
.env.production.local
21+
22+
npm-debug.log*
23+
yarn-debug.log*
24+
yarn-error.log*

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
## Changelog
22

3+
### v3.0.0-alpha.0
4+
24-September-2017
5+
6+
Work for updating to version 3 is started
7+
8+
* Add roadmap.md
9+
* Init monorepo
10+
311
### v2.0.2
412
26-August-2016
513

CONTRIBUTING.md

+2-14
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ We welcome you help to make React CDK better. This document will help to streaml
66

77
No software is bug free. So, if you got an issue, follow these steps:
88

9-
* Search the [issue list](https://github.com/kadirahq/react-storybook/issues?utf8=%E2%9C%93&q=) for current and old issues.
9+
* Search the [issue list](https://github.com/storybooks/react-cdk/issues?utf8=%E2%9C%93&q=) for current and old issues.
1010
* If non of that is helping, create an issue with with following information:
1111
* Clear title (make is shorter if possible).
1212
* Describe the issue in clear language.
@@ -18,21 +18,9 @@ No software is bug free. So, if you got an issue, follow these steps:
1818
We welcome your contributions. There are many ways you can help us. This is few of those ways:
1919

2020
* Fix typos and add more documentation.
21-
* Try to fix some [bugs](https://github.com/kadirahq/react-cdk/labels/bug).
21+
* Try to fix some [bugs](https://github.com/storybooks/react-cdk/labels/bug).
2222
* Add new features (try to discuss with what are building by creating an issue).
2323

2424
Before you submit a new PR, make you to run `npm test`. Do not submit a PR if tests are failing. If you need any help, create an issue and ask.
2525

2626
## Development Guide
27-
28-
This is Yeoman generator. There are two generators, which are:
29-
30-
* app - main generator creates the project
31-
* update - which update an existing project
32-
33-
Before you start developing, you need to get familiar with yeoman first. Refer following links:
34-
35-
* [Yeoman getting started guide](http://yeoman.io/learning/)
36-
* [Creating a yeoman generator](http://yeoman.io/authoring/)
37-
38-
Then link this project with `npm link`. Then you can try `yo react-cdk` and it'll use your development repo.

README.md

+3-222
Original file line numberDiff line numberDiff line change
@@ -1,224 +1,5 @@
1-
# React CDK
1+
# React-CDK v.3
22

3-
### Component Development Kit for React
3+
This branch is under development. Any help with code review, bug reporting/fixes, ideas, wishes, objections, PR creation, docs writing is very appreciated! If you are interested, please contact us in the [Storybook Slack](https://now-examples-slackin-nqnzoygycp.now.sh/).
44

5-
##### We are looking for an active maintainer for this repository. React CDK has been put on hold and may become deprecated in the future so our core team can focus on Storybook. If you are interested, please contact Norbert in the Storybook Slack.
6-
7-
React CDK is not just another React boilerplate. With React CDK, you can focus on developing your React component or utility while React CDK takes care of all the other stuff.
8-
9-
> Read why [Kadira created React CDK](https://voice.kadira.io/say-hello-to-react-cdk-97cff692e798#.2aaodkb6c).
10-
11-
React CDK comes with following features:
12-
13-
* Create a project with a single command.
14-
* Write your component in [ES2016+ syntax](https://www.npmjs.com/package/babel-preset-react-app).
15-
* Develop in a live environment with [React Storybook](https://github.com/kadirahq/react-storybook/).
16-
* Write tests with Mocha and [Enzyme](https://github.com/airbnb/enzyme).
17-
* Use ESLint with the [Airbnb style guide](https://github.com/airbnb/javascript).
18-
* Publish correctly transpiled code into NPM.
19-
* Deploy your storybook to GitHub Pages.
20-
* Get **updates** to core building tools.
21-
22-
## TOC
23-
24-
* [Getting Started](#getting-started)
25-
* [Developing Your Component](#developing-your-component)
26-
* [Testing](#testing)
27-
* [Lint Rules](#lint-rules)
28-
* [Publishing](#publishing)
29-
* [Deploying Storybook](#deploying-storybook)
30-
* [CSS and Styles](#css-and-styles)
31-
* [Updating Your Component with React CDK](#updating-your-component-with-react-cdk)
32-
* [Customizing the Component](#customizing-the-component)
33-
34-
## Getting Started
35-
36-
Install React CDK with the following command:
37-
38-
```
39-
npm install -g yo generator-react-cdk
40-
```
41-
42-
> React CDK comes as a [yeoman](http://yeoman.io/) generator, which allows you to scaffold your component quickly.
43-
44-
45-
Then, create your first component library with the following command:
46-
47-
```
48-
yo react-cdk react-wizard
49-
```
50-
51-
![Creating a project with React CDK](docs/create-project-with-react-cdk.png)
52-
53-
> React CDK will create a directory called react-wizard with all the files you need to get started.
54-
55-
56-
Visit that directory and install the NPM dependencies:
57-
58-
```
59-
cd react-wizard
60-
npm install
61-
```
62-
63-
By default, this project contains a simple button created with React. It also includes tests and [React Storybook](https://github.com/kadirahq/react-storybook/) stories so you can get ideas for writing your own stories.
64-
65-
## Developing Your Component
66-
67-
Now we need to work with the component. Your component lives under the src directory. Open `src/index.js` in your favorite editor and start developing.
68-
69-
Now, it’s time to start the Storybook so we can see what we are building:
70-
71-
```
72-
npm run storybook
73-
```
74-
75-
The above command starts the Storybook console on [http://localhost:9010](http://localhost:9010/).
76-
77-
![React Storybook](docs/storybook.png)
78-
79-
> You can see changes you make while you are editing your component. Visit [React Storybook](https://github.com/kadirahq/react-storybook/) repo to learn more.
80-
81-
82-
You can write your component in ES2015+ syntax. It supports `react` and `babel-stage2` presets.
83-
84-
## Testing
85-
86-
You can write your tests inside the `src/tests` directory. By default, the project comes with two test cases demonstrating how to write tests. React CDK configures your component with Mocha, [Enzyme](https://github.com/airbnb/enzyme), jsdom, and other essential JS testing tools.
87-
88-
This is the ideal way to write React tests.
89-
90-
You can run tests with the following commands:
91-
92-
* `npm run testonly` (run tests once)
93-
* `npm run test-watch` (run tests and watch for changes)
94-
* `npm test` (run tests and apply lint rules)
95-
96-
## Lint Rules
97-
98-
Your project is configured with ESLint based on the [Airbnb JavaScript style guide](https://github.com/airbnb/javascript) with some minor changes.
99-
100-
You can apply lint rules with the following commands:
101-
102-
* `npm run lint` (apply lint rules)
103-
* `npm run lintfix` (apply lint rules and fix some common issues)
104-
105-
## Publishing
106-
107-
Now it’s time to publish your component to NPM. Before you publish, make sure you’ve customized the following files as necessary:
108-
109-
* package.json
110-
* README.md
111-
* CONTRIBUTE.md
112-
* LICENSE
113-
114-
If everything is okay, simply publish your component to NPM with the following command:
115-
116-
```
117-
npm publish
118-
```
119-
120-
This command will transpile your component for ES5 before publishing it to NPM. Your component will work on any JavaScript environment.
121-
122-
## Deploying Storybook
123-
124-
You will usually write your stories while you are developing your component. That allows you to use your storybook as a living document. You could show what your component looks like and different ways to use it.
125-
126-
Then you can simply deploy it to GitHub Pages with the following command:
127-
128-
```
129-
npm run publish-storybook
130-
```
131-
132-
You can link your Storybook URL inside the README file.
133-
134-
Here’s a [sample component](https://github.com/kadira-samples/react-button) listing a Storybook URL.
135-
136-
137-
> You can also publish your storybook automatically when you publish your component to NPM. To do that, simply add the following NPM script to your package.json file:
138-
139-
```js
140-
{
141-
"scripts": {
142-
...
143-
"postpublish": "npm run publish-storybook"
144-
...
145-
}
146-
}
147-
```
148-
149-
## CSS and Styles
150-
151-
It’s common to include CSS and Styles with your component. There are many ways to do this. Some prefer to write CSS in JS, while some provide a CSS file that lives inside the repo.
152-
153-
### CSS in JS
154-
155-
With this approach, you don’t need to configure anything. You can just use it. However, you should make sure you accept some external styles, which allows the end user to change the look and feel of your component as needed.
156-
157-
### Plain old CSS files
158-
159-
If you are following this approach, make sure to place your CSS files inside the root of your component and not inside the src directory. Then, your end users can import it like this:
160-
161-
```js
162-
import 'my-comp/style.css'
163-
```
164-
165-
You may also need to load this style sheet inside your stories. Simply import the above style sheet into src/stories/index.js with the following command:
166-
167-
```
168-
import '../../style.css'
169-
```
170-
171-
## Updating Your Component with React CDK
172-
173-
This is a plain NPM module without any magic. However, it’s written in a way that allows us to push updates to your repo.
174-
175-
You never need to worry about updating dependencies and build tools. React CDK will take care of that.
176-
177-
First, update React CDK with the following command:
178-
179-
```
180-
npm install -g generator-react-cdk
181-
```
182-
183-
Then, visit your project and apply the following command:
184-
185-
```
186-
yo react-cdk:update
187-
```
188-
189-
This will update the core build tools and the package.json file for dependencies.
190-
191-
192-
> It won’t update dependencies you’ve added; it will only update the dependencies and NPM script React CDK has added.
193-
194-
## Customizing the Component
195-
196-
Since your component is a plain NPM module, you can customize it any way you want. Here are some ways to do so:
197-
198-
### Add dependencies
199-
200-
You can add dependencies to the `package.json` file as needed.
201-
202-
### Change the JavaScript environment
203-
204-
Sometimes you may want to use cutting-edge JavaScript features. You can simply add the necessary Babel preset and change the `.babelrc` file.
205-
206-
### Change other dotfiles
207-
208-
You can change any of the dotfiles, including `.gitignore` and `.npmignore`.
209-
210-
### Customize Storybook
211-
212-
Sometimes you may need to customize your React Storybook. If you do, you’ll usually customize the `.storybook/webpack.config.js` file. Go ahead and do it.
213-
214-
### Add some pre-publish code
215-
216-
React CDK already uses the NPM `pre-publish` hook, so you won’t be able to use it directly. Instead, you can use `.scripts/user/prepublish.sh` to add your own code.
217-
218-
### Configure test utilities
219-
220-
We have included JSDOM(to support enzyme's [full DOM rendering](https://github.com/airbnb/enzyme/blob/master/docs/api/mount.md)) and Babel configurations before running Mocha tests. If you want to add more stuff, simply use the `.scripts/user/pretest.js` file.
221-
222-
### Configure something else
223-
224-
You can configure this project in many ways. Give it a try, and I bet you can do it without our help. If you need help from the core React CDK tools, just create [an issue](https://github.com/kadirahq/react-cdk/issues).
5+
See [Roadmap](ROADMAP.md)

ROADMAP.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Roadmap
2+
3+
This project is going to be a CRA and @Storybook/CLI based minimalistic boilerplate focused on the components development. General settings will be left to the CRA which is used as a dependency, while React-CDK provides only special scripts and project templates.
4+
5+
6+
## Project development
7+
8+
- create `cdk-scripts` package to wrap `react-scripts`
9+
- use `cdk-scripts` as a custom scripts with CRA
10+
- launch `getstorybook` from `cdk-scripts`
11+
- create `create-react-cdk` package as a CLI for creating projects
12+
- use `create-react-cdk` to launch `create-react-app` internally
13+
- add `publish` script to `cdk-scripts`
14+
- add `pack` script to `cdk-scripts` (publish:local)
15+
- add `deploy` script to `cdk-scripts`
16+
- add user templates support
17+
- add default React-CDK template
18+
- `create-react-cdk` should always use the latest version of `cdk-scripts`
19+
- setup yarn workspace
20+
- add docs & tests
21+
- update CONTRIBUTING guide
22+
23+
24+
## Features
25+
26+
- setup [Displaying Lint Output in the Editor](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#displaying-lint-output-in-the-editor)
27+
28+
- add prettier support
29+
30+
- setup [Debugging in the Editor](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#debugging-in-the-editor) (for VSCode)
31+
32+
- bundle libraries with webpack
33+
34+
35+
## Templates
36+
37+
- default template
38+
39+
*Provides minimum required settings*
40+
41+
- storybook-kitchen-sink
42+
43+
*Goes with full @storybook/cra-kitchen-sink addons equipment*
44+
45+
- storybook boilerplate
46+
47+
*Creates the well-balanced development environment with most useful addons set from Storybook Addons Gallery*
48+
49+
- addon development
50+
51+
*Special template ready for the new Storybook addon creation/development*
-147 KB
Binary file not shown.

docs/readme.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Docs folder

docs/storybook.png

-88.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)