Skip to content

Commit

Permalink
feat(docz-gatsby-monorepo): add example showing docz usage in a monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
rakannimer committed Aug 30, 2019
1 parent b3e264e commit 241c757
Show file tree
Hide file tree
Showing 23 changed files with 18,875 additions and 0 deletions.
38 changes: 38 additions & 0 deletions examples/monorepo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Docz Gatsby Mono Repo Example

This example shows you how you can use docz as a [Gatsby Theme](https://www.gatsbyjs.org/blog/2018-11-11-introducing-gatsby-themes/) inside your project as part of a monorepo.


## Using `create-docz-app`

```sh
npx create-docz-app docz-app-monorepo --example monorepo
# or
yarn create docz-app docz-app-monorepo --example monorepo
```

## Download

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

## Setup

```sh
yarn # npm i
```

## Start developing

```sh
yarn dev # npm run dev
```

## Build

```sh
yarn build # npm run build
```
5 changes: 5 additions & 0 deletions examples/monorepo/lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"lerna": "3.16.4",
"packages": ["packages/*"],
"version": "1.0.0"
}
21 changes: 21 additions & 0 deletions examples/monorepo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"private": true,
"workspaces": [
"packages/my-super-special-button",
"packages/docs-site"
],
"name": "docz-gatsby-monorepo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "lerna run build",
"dev": "lerna run dev"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"lerna": "^3.16.4"
}
}
5 changes: 5 additions & 0 deletions examples/monorepo/packages/docs-site/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# gatsby files
.cache/
public

node_modules
147 changes: 147 additions & 0 deletions examples/monorepo/packages/docs-site/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [2.0.0-rc.6](https://github.com/pedronauck/docz/compare/v2.0.0-rc.1...v2.0.0-rc.6) (2019-08-29)

**Note:** Version bump only for package docz-example-gatsby





# [2.0.0-rc.2](https://github.com/pedronauck/docz/compare/v2.0.0-rc.1...v2.0.0-rc.2) (2019-08-28)

**Note:** Version bump only for package docz-example-gatsby





# [2.0.0-rc.1](https://github.com/pedronauck/docz/compare/v1.2.0...v2.0.0-rc.1) (2019-07-18)


### Bug Fixes

* bump version ([a346b59](https://github.com/pedronauck/docz/commit/a346b59))


### Features

* a lot of improvements ([64f75da](https://github.com/pedronauck/docz/commit/64f75da))
* add new Playground component ([7bf03b2](https://github.com/pedronauck/docz/commit/7bf03b2))
* **gatsby-theme-docz:** add new Props component ([8eb780d](https://github.com/pedronauck/docz/commit/8eb780d))
* add typescript support (need fix) ([13947f9](https://github.com/pedronauck/docz/commit/13947f9))
* docz running using gatsby under the hood ([10ffd48](https://github.com/pedronauck/docz/commit/10ffd48))





# [1.2.0](https://github.com/pedronauck/docz/compare/v1.1.0...v1.2.0) (2019-05-08)

**Note:** Version bump only for package docz-example-gatsby





# [1.1.0](https://github.com/pedronauck/docz/compare/v1.0.4...v1.1.0) (2019-05-01)

**Note:** Version bump only for package docz-example-gatsby





## [1.0.4](https://github.com/pedronauck/docz/compare/v1.0.3...v1.0.4) (2019-04-18)

**Note:** Version bump only for package docz-example-gatsby





## [1.0.3](https://github.com/pedronauck/docz/compare/v1.0.2...v1.0.3) (2019-04-15)

**Note:** Version bump only for package docz-example-gatsby





## [1.0.2](https://github.com/pedronauck/docz/compare/v1.0.1...v1.0.2) (2019-04-15)

**Note:** Version bump only for package docz-example-gatsby





## [1.0.1](https://github.com/pedronauck/docz/compare/v1.0.0...v1.0.1) (2019-04-14)

**Note:** Version bump only for package docz-example-gatsby





# [1.0.0](https://github.com/pedronauck/docz/compare/v1.0.0-rc.8...v1.0.0) (2019-04-11)

**Note:** Version bump only for package docz-example-gatsby





# [1.0.0-rc.4](https://github.com/pedronauck/docz/compare/v1.0.0-rc.3...v1.0.0-rc.4) (2019-03-29)


### Bug Fixes

* add missing dependency on examples ([af8ec2d](https://github.com/pedronauck/docz/commit/af8ec2d))





# [1.0.0-rc.3](https://github.com/pedronauck/docz/compare/v1.0.0-rc.2...v1.0.0-rc.3) (2019-03-21)

**Note:** Version bump only for package docz-example-gatsby





# [1.0.0-beta.0](https://github.com/pedronauck/docz/compare/v1.0.0-alpha.1...v1.0.0-beta.0) (2019-03-19)

**Note:** Version bump only for package docz-example-gatsby





# [1.0.0-alpha.1](https://github.com/pedronauck/docz/compare/v1.0.0-alpha.0...v1.0.0-alpha.1) (2019-03-19)

**Note:** Version bump only for package docz-example-gatsby





# [1.0.0-alpha.0](https://github.com/pedronauck/docz/compare/v0.13.5...v1.0.0-alpha.0) (2019-03-19)


### Bug Fixes

* gatsby theme fixes ([dcc5f19](https://github.com/pedronauck/docz/commit/dcc5f19))
* **gatsby-theme-docz:** add specific nodes for entries ([26f7f90](https://github.com/pedronauck/docz/commit/26f7f90))
* **gatsby-theme-docz:** add ssr support for styled-components ([b490010](https://github.com/pedronauck/docz/commit/b490010))
* define right internal dependencies version ([30a91b4](https://github.com/pedronauck/docz/commit/30a91b4))


### Features

* add initial gatsby integration ([#630](https://github.com/pedronauck/docz/issues/630)) ([70d40cc](https://github.com/pedronauck/docz/commit/70d40cc)), closes [#609](https://github.com/pedronauck/docz/issues/609)
* new Props component ([80451b1](https://github.com/pedronauck/docz/commit/80451b1))
38 changes: 38 additions & 0 deletions examples/monorepo/packages/docs-site/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Docz Gatsby Example

This example shows you how you can use docz as a [Gatsby Theme](https://www.gatsbyjs.org/blog/2018-11-11-introducing-gatsby-themes/) inside your project.


## Using `create-docz-app`

```sh
npx create-docz-app docz-app-gatsby --example gatsby
# or
yarn create docz-app docz-app-gatsby --example gatsby
```

## Download

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

## Setup

```sh
yarn # npm i
```

## Start developing

```sh
yarn dev # npm run dev
```

## Build

```sh
yarn build # npm run build
```
3 changes: 3 additions & 0 deletions examples/monorepo/packages/docs-site/doczrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
menu: ['Home', 'Components'],
}
9 changes: 9 additions & 0 deletions examples/monorepo/packages/docs-site/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
plugins: [
'gatsby-theme-docz',
`gatsby-transformer-sharp`,
// this (optional) plugin enables Progressive Web App + Offline functionality
// To learn more, visit: https://gatsby.dev/offline
// `gatsby-plugin-offline`,
],
}
35 changes: 35 additions & 0 deletions examples/monorepo/packages/docs-site/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "docz-example-gatsby-monorepo",
"description": "Example of how to integrate docz with gatsby as a theme in a monorepo",
"version": "2.0.0-rc.6",
"keywords": [
"gatsby",
"docz"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/pedronauck/docz/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/pedronauck/docz.git"
},
"scripts": {
"dev": "gatsby develop",
"build": "gatsby build",
"serve": "gatsby serve"
},
"dependencies": {
"gatsby": "^2.13.73",
"gatsby-plugin-offline": "^2.2.7",
"gatsby-plugin-sharp": "^2.2.18",
"gatsby-theme-docz": "2.0.0-rc.6",
"gatsby-transformer-sharp": "^2.2.7",
"my-super-special-button": "0.1.0",
"prop-types": "^15.7.2",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-helmet": "^5.2.1",
"scheduler": "^0.15.0"
}
}
67 changes: 67 additions & 0 deletions examples/monorepo/packages/docs-site/src/Button.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
name: Button
menu: Components
route: /
---

import { Playground, Props } from "docz";
import { Button } from "my-super-special-button";

# Button

Button make common actions more obvious and help users more easily perform them. Buttons use labels and sometimes icons to communicate the action that will occur when the user touches them.

### Best practices

- Group buttons logically into sets based on usage and importance.
- Ensure that button actions are clear and consistent.
- The main action of a group set can be a primary button.
- Select a single button variation and do not mix them.

## Properties

<Props of={Button} />

## Basic usage

<Playground>
<Button>Click me</Button>
</Playground>

## With different sizes

<Playground>
<Button scale="small">Click me</Button>
<Button scale="normal">Click me</Button>
<Button scale="big">Click me</Button>
</Playground>

## With different colors

<Playground>
<Button kind="primary">Click me</Button>
<Button kind="secondary">Click me</Button>
<Button kind="cancel">Click me</Button>
<Button kind="dark">Click me</Button>
<Button kind="gray">Click me</Button>
</Playground>

## Outlined

<Playground>
<Button kind="primary" outline>
Click me
</Button>
<Button kind="secondary" outline>
Click me
</Button>
<Button kind="cancel" outline>
Click me
</Button>
<Button kind="dark" outline>
Click me
</Button>
<Button kind="gray" outline>
Click me
</Button>
</Playground>
10 changes: 10 additions & 0 deletions examples/monorepo/packages/docs-site/src/pages/404.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react'

const NotFoundPage = () => (
<>
<h1>NOT FOUND</h1>
<p>You just hit a route that doesn&#39;t exist... the sadness.</p>
</>
)

export default NotFoundPage
8 changes: 8 additions & 0 deletions examples/monorepo/packages/my-super-special-button/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.log
.DS_Store
node_modules
.cache
.rts2_cache_cjs
.rts2_cache_esm
.rts2_cache_umd
dist
Loading

0 comments on commit 241c757

Please sign in to comment.