-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove bundle analyzer dependency
- Loading branch information
1 parent
c2e6ed5
commit a8489cd
Showing
8 changed files
with
79 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,83 @@ | ||
--- | ||
title: Getting started/Gatsby/Theme | ||
title: Getting started/Gatsby | ||
type: tutorial | ||
--- | ||
|
||
# Getting started with Gatsby | ||
|
||
## New project | ||
## New project | ||
|
||
### Install | ||
Create a new folder | ||
|
||
```sh | ||
yarn add @component-controls/gatsby-theme-stories | ||
mkdir my-gatsby-project | ||
cd my-gatsby-project | ||
``` | ||
|
||
initialize the project | ||
|
||
```sh | ||
yarn init | ||
``` | ||
|
||
add gatsby dependencies | ||
|
||
```sh | ||
yarn add gatsby react react-dom | ||
``` | ||
|
||
### Configure | ||
in `package.json` | ||
```json | ||
... | ||
"scripts": { | ||
"build": "gatsby build", | ||
"start": "gatsby develop" | ||
}, | ||
... | ||
``` | ||
|
||
The remaining steps are the same as for an existing gatsby project | ||
|
||
the default options will configure `component-controls` to work with react apps, with `react-docgen` for prop-types and `react-docgen-typescript` for typescript props information | ||
## Existing project | ||
|
||
in `gatsby-config.js`: | ||
### Add theme | ||
|
||
```js:title= | ||
```sh | ||
yarn add @component-controls/gatsby-theme-stories | ||
``` | ||
|
||
### Configure theme | ||
|
||
create a `gatsby-config.js` file in your project folder | ||
```js | ||
//gatsby-config.js: | ||
module.exports = { | ||
plugins: [ | ||
... | ||
{ | ||
resolve: '@component-controls/gatsby-theme-stories', | ||
options: { | ||
//path to the configuration files | ||
configPath: '.config', | ||
}, | ||
}, | ||
... | ||
], | ||
}; | ||
``` | ||
|
||
### Create component-controls config folder | ||
|
||
Create a new folder `.config` inside your proejct (or any other name that you used in the step above) | ||
|
||
|
||
### Create component-controls build-time configuration | ||
|
||
create a file `.config/buildtime.js` and enter the paths to search for component-controls documentation files | ||
|
||
```js | ||
//.config/buildtime.js | ||
module.exports = { | ||
stories: [ | ||
'../src/docs/*.mdx', | ||
], | ||
}; | ||
``` | ||
|
||
## Existing project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters