Skip to content

Commit

Permalink
docs: better explanation & troubleshooting (#27)
Browse files Browse the repository at this point in the history
- Add Troubleshooting Page
- Define directories, that the user has to create manually
- Fix monorepo example
  • Loading branch information
nyarthan authored Mar 25, 2024
1 parent f94ddbc commit 606e1a0
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default defineConfig({
{ text: 'Including Custom Styles', link: '/guide/including-custom-styles' },
{ text: 'CLI', link: '/guide/cli' },
{ text: 'Monorepo', link: '/guide/monorepo' },
{ text: 'Troubleshooting', link: '/guide/troubleshooting' },
],
},
],
Expand Down
19 changes: 19 additions & 0 deletions docs/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,22 @@ Create the styles directory.
```sh
$ mkdir src/styles
```

Create the style subdirectories.

```sh
$ mkdir src/styles/base
$ mkdir src/styles/utilities
$ mkdir src/styles/components
```

::: tip

Each of the subdirectories corresponds to a `json` file in the output directory.
e.g.: `src/styles/base/ -> .styles/base.json`

You can create as many subdirectories inside your styles directory as you want and give them arbitrary names. Just remember to update the imports from the output directory accordingly.

If a directory does not include any files, git will not track it. To prevent this you can add an empty `.gitkeep` inside the directory.

:::
2 changes: 1 addition & 1 deletion docs/guide/monorepo.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import components from './.styles/components.json';

import type { Config } from 'tailwindcss';

export const plugin = plugin(
export const plugin = _plugin(
({ addComponents, addUtilities, addBase }) => {
addBase(base);
addUtilities(utilities);
Expand Down
18 changes: 18 additions & 0 deletions docs/guide/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Troubleshooting

## `Error: ENOSPC: System limit for number of file watchers reached, watch`

Linux uses [inotify](https://en.wikipedia.org/wiki/Inotify) to monitor file changes.
This error is due to the file watchers being reached.

In most cases, restarting the dev-server will fix this issue.

If you want a permanent solution, you can increase the maximum number of file watchers.

```sh
# check current number
$ cat /proc/sys/fs/inotify/max_user_watches

# set a greater value
$ echo fs.inotify.max_user_watches=<increased-value> | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
```

0 comments on commit 606e1a0

Please sign in to comment.