Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flow example, add setup doc #1021

Merged
merged 6 commits into from
Aug 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/docz/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"marksy": "^8.0.0",
"match-sorter": "^3.1.1",
"prop-types": "^15.7.2",
"scheduler": "^0.15.0",
"ulid": "^2.3.0",
"yargs": "^13.3.0"
},
Expand Down
21 changes: 21 additions & 0 deletions examples/basic/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Basic Docz example

## Download manually

```sh
curl https://codeload.github.com/pedronauck/docz/tar.gz/master | tar -xz --strip=2 docz-master/examples/basic
mv basic docz-basic-example
cd docz-basic-example
```

## Setup

```sh
yarn # npm i
```

## Run

```sh
yarn dev # npm run dev
```
3 changes: 2 additions & 1 deletion examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"@emotion/styled": "^10.0.14",
"prop-types": "^15.7.2",
"react": "^16.8.6",
"react-dom": "^16.8.6"
"react-dom": "^16.8.6",
"scheduler": "^0.15.0"
},
"devDependencies": {
"docz": "^2.0.0-rc.1"
Expand Down
21 changes: 21 additions & 0 deletions examples/flow/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Flow Docz example

## Download

```sh
curl https://codeload.github.com/pedronauck/docz/tar.gz/master | tar -xz --strip=2 docz-master/examples/flow
mv flow docz-flow-example
cd docz-flow-example
```

## Setup

```sh
yarn # npm i
```

## Run

```sh
yarn dev # npm run dev
```
5 changes: 5 additions & 0 deletions examples/flow/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
exports.onCreateBabelConfig = ({ actions }) => {
actions.setBabelPreset({
name: `@babel/preset-flow`,
})
}
16 changes: 2 additions & 14 deletions examples/flow/src/components/Alert.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Alert
menu: Components
---

import { Playground, Props } from 'docz'
import { Alert } from './Alert'
import { Playground, Props } from "docz";
import { Alert } from "./Alert";

# Alert

Expand All @@ -26,15 +26,3 @@ import { Alert } from './Alert'
<Alert kind="negative">Some message</Alert>
<Alert kind="warning">Some message</Alert>
</Playground>

## Use with children as a function

<Playground>
{() => {
const message = 'Hello world'

return (
<Alert>{message}</Alert>
)
}}
</Playground>
21 changes: 21 additions & 0 deletions examples/typescript/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Typescript Docz example

## Download manually

```sh
curl https://codeload.github.com/pedronauck/docz/tar.gz/master | tar -xz --strip=2 docz-master/examples/typescript
mv typescript docz-typescript-example
cd docz-typescript-example
```

## Setup

```sh
yarn # npm i
```

## Run

```sh
yarn dev # npm run dev
```
3 changes: 2 additions & 1 deletion examples/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"@emotion/core": "^10.0.14",
"@emotion/styled": "^10.0.14",
"react": "^16.8.6",
"react-dom": "^16.8.6"
"react-dom": "^16.8.6",
"scheduler": "^0.15.0"
},
"devDependencies": {
"@types/react": "^16.8.23",
Expand Down