Skip to content

Commit

Permalink
docs: Updated docs for .storybook folder (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklafrance authored Jan 23, 2024
1 parent 7b00cf2 commit 34e9bdf
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

// Formatters settings
"editor.codeActionsOnSave": {
"source.fixAll": true, // Makes sure ESLint is runned on save
"source.sortImports": true // Let VS Code handle import sorting, it's snappier and more reliable than ESLint
"source.fixAll": "explicit",
"source.sortImports": "explicit"
},
"editor.formatOnSave": true,
"[html]": {
Expand Down
1 change: 1 addition & 0 deletions docs/eslint/setup-monorepo.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ node_modules
*.md
*.yml
*.yaml
!.storybook
```

### Configure indent style
Expand Down
1 change: 1 addition & 0 deletions docs/eslint/setup-polyrepo.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ node_modules
*.md
*.yml
*.yaml
!.storybook
```

## Configure the indent style
Expand Down
1 change: 1 addition & 0 deletions docs/stylelint/setup-monorepo.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ Then, open the newly created file and paste the following ignore rules:
``` .prettierignore
*
!**/*.css
!.storybook
```

### Configure the indent style
Expand Down
1 change: 1 addition & 0 deletions docs/stylelint/setup-polyrepo.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ Then, open the newly created file and paste the following ignore rules:
``` .prettierignore
*
!**/*.css
!.storybook
```

## Configure indent style
Expand Down
10 changes: 10 additions & 0 deletions docs/typescript/setup-monorepo.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ Then, open the newly created file and extend the default configuration with the
}
```

If your application is using [Storybook](https://storybook.js.org/), make sure to include the `.storybook` folder:

```json !#3 tsconfig.json
{
"extends": "@workleap/typescript-configs/monorepo-workspace.json",
"include": ["**/*", ".storybook/*"],
"exclude": ["packages", "node_modules"]
}
```

### Add a CLI script

At times, especially when running the CI build, it's useful to lint the entire solution using a single command. To do so, add the following script to your solution's workspace `package.json` file:
Expand Down
20 changes: 20 additions & 0 deletions docs/typescript/setup-polyrepo.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ For an applications developed with React, use the following configuration:
}
```

If your application is using [Storybook](https://storybook.js.org/), make sure to include the `.storybook` folder:

```json !#3 tsconfig.json
{
"extends": ["@workleap/typescript-configs/web-application.json"],
"include": ["**/*", ".storybook/*"],
"exclude": ["dist", "node_modules"]
}
```

### `library`

For a library project developed with or without React, use the following configuration:
Expand All @@ -65,6 +75,16 @@ For a library project developed with or without React, use the following configu
}
```

If your application is using [Storybook](https://storybook.js.org/), make sure to include the `.storybook` folder:

```json !#3 tsconfig.json
{
"extends": ["@workleap/typescript-configs/library.json"],
"include": ["**/*", ".storybook/*"],
"exclude": ["dist", "node_modules"]
}
```

## Add a CLI script

At times, especially when running the CI build, it's useful to lint the entire solution using a single command. To do so, add the following script to your solution's `package.json` file:
Expand Down
2 changes: 1 addition & 1 deletion docs/webpack/configure-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ const useContentHashOutputFilename: WebpackConfigTransformer = (config: WebpackC
config.output.filename = "[name].[contenthash].bundle.js";

return config;
}:
};

export default defineBuildConfig(swcConfig, {
transformers: [useContentHashOutputFilename]
Expand Down
6 changes: 5 additions & 1 deletion sample/app/src/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { helloFrom } from "@sample/utils";
import "./Home.css";
import AddIcon from "./assets/add.svg";

export function Home() {
return (
<div>
<h1 className="title">Home</h1>
<div>{helloFrom("the homepage")}</div>
<p>{helloFrom("the homepage")}</p>
<p>
<span>Here's an SVG icon loaded with <code>@svgr/webpack</code>:</span><AddIcon />
</p>
</div>
);
}
1 change: 1 addition & 0 deletions sample/app/src/assets/add.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions sample/app/src/types/svgr.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module "*.svg" {
const content: React.FunctionComponent<React.SVGAttributes<SVGElement>>;
export default content;
}

0 comments on commit 34e9bdf

Please sign in to comment.