Skip to content

Commit

Permalink
docs(structure): improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktor Vincze committed Jan 28, 2019
1 parent 7930c09 commit ed164dd
Show file tree
Hide file tree
Showing 24 changed files with 63 additions and 113 deletions.
2 changes: 0 additions & 2 deletions docs/configs/babel.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# babel

## babel

[https://babeljs.io/docs/en/options](https://babeljs.io/docs/en/options)

```bash
Expand Down
2 changes: 0 additions & 2 deletions docs/configs/eslint.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# eslint

## eslint

[https://eslint.org/docs/user-guide/configuring](https://eslint.org/docs/user-guide/configuring)

```bash
Expand Down
2 changes: 0 additions & 2 deletions docs/configs/gitignore.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# gitignore

## gitignore

[https://git-scm.com/docs/gitignore](https://git-scm.com/docs/gitignore)

```bash
Expand Down
2 changes: 0 additions & 2 deletions docs/configs/jest.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# jest

## jest

[https://jestjs.io/docs/en/configuration.html](https://jestjs.io/docs/en/configuration.html)

```bash
Expand Down
2 changes: 0 additions & 2 deletions docs/configs/manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

Used by `webpack` to generate `manifest.json` WebApp Manifest file.

## manifest

```bash
# Print config to console
mhy config manifest
Expand Down
16 changes: 6 additions & 10 deletions docs/configs/mhy.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,35 @@
# mhy

## mhy

`mhy` is being built using `mhy` :\) Just like `npm` is a package on `npm`. It's core configuration values are stored using `mhy` also.

## manifest

```bash
# Print config to console
mhy config mhy
```

### Options
## Options

#### `defaultIndexHtml`
### `defaultIndexHtml`

The `index.html` file to load when using `webpack`.

Default is provided by `mhy`: `resources/index.html`

> You can use your own by putting it to your `src` folder. Not necessary to overwrite this value.
#### `srcFolder`
### `srcFolder`

Folder to your source files from you project root.

Default: `src`

#### `defaultIgnoreList`
### `defaultIgnoreList`

An array including the list of filenames needed to be excluded in general \(like cache folders, log files, etc\). Both `gitignore` and `npmignore` configs are extending this list.

> Please see source file for details.
#### `defaultAliases`
### `defaultAliases`

Aliases provided for `Babel` and `TypeScript` imports.

Expand All @@ -45,7 +41,7 @@ Example: `import Foo from '@/components/foo'`

> Please note that previously aliases were provided for certain folders as `@components`. These are being **DEPRECATED** and should not be used. The new way is more flexible and avoids collision with NPM namespaces.
#### `ecosystem`
### `ecosystem`

The ecosystem you want to load when simply run `mhy` or `mhy ui`.

Expand Down
2 changes: 0 additions & 2 deletions docs/configs/npmignore.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# npmignore

## npmignore

[https://docs.npmjs.com/misc/developers\#keeping-files-out-of-your-package](https://docs.npmjs.com/misc/developers#keeping-files-out-of-your-package)

```bash
Expand Down
2 changes: 0 additions & 2 deletions docs/configs/prettier.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# prettier

## prettier

[https://prettier.io/docs/en/configuration.html](https://prettier.io/docs/en/configuration.html)

```bash
Expand Down
2 changes: 0 additions & 2 deletions docs/configs/storybook.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# storybook

## storybook

> Currently only `start` options are available. Support for standalone Storybook build will come soon\)\*\[\]:
[https://storybook.js.org/configurations/cli-options/](https://storybook.js.org/configurations/cli-options/)
Expand Down
2 changes: 0 additions & 2 deletions docs/configs/tslint.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# tslint

## tslint

[https://palantir.github.io/tslint/rules/](https://palantir.github.io/tslint/rules/)

```bash
Expand Down
2 changes: 0 additions & 2 deletions docs/configs/typescript.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# typescript

## typescript

* [https://www.typescriptlang.org/docs/handbook/compiler-options.html](https://www.typescriptlang.org/docs/handbook/compiler-options.html)
* [https://www.typescriptlang.org/docs/handbook/tsconfig-json.html](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html)

Expand Down
2 changes: 0 additions & 2 deletions docs/configs/webpack.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# webpack

## webpack

[https://webpack.js.org/configuration/](https://webpack.js.org/configuration/)

```bash
Expand Down
20 changes: 9 additions & 11 deletions docs/ide-setup/storm.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
# storm

## WebStorm and PHPStorm

### Search for global `node_modules` folder (GLOBAL_NODE_MODULES)
## Search for global `node_modules` folder (GLOBAL_NODE_MODULES)
1. Use the `which mhy` (`where mhy` on Windows) command to find the path to the `mhy` executable file.
2. The _global_ `node_modules` folder should be around there somewhere. It varies between different systems, maybe it is right next to it, maybe inside a `lib` directory next to it or the upper levels.
3. Inside the _global_ `node_modules` folder, you'll find `mhy/node_modules`. The path to that directory is what we will need.

### Generate every possible config files
## Generate every possible config files
```bash
mhy config

// Use -o to overwrite existing files
```

### `node_modules` resolution
## `node_modules` resolution
Since you're using modules coming from `mhy`, you need to tell the IDE to include a `node_modules` folder outside your project's directory.

1. Find `GLOBAL_NODE_MODULES/mhy/node_modules`
2. Add the path at `File > Settings > Directories` and mark it as `Excluded` and `Resource root`.

### Alias resolution
## Alias resolution
Alias resolution is done by Webpack. You only need to have a `webpack.config.js` file in your root.

1. **ONLY** in case you haven't run `mhy config` yet to set-up your empty project, run `mhy config webpack -i` to initialize a config file.
2. Make sure at `File > Settings > Webpack` that the feature is turned on.

### Prettier (for automatic formatting on save; recommended)
## Prettier (for automatic formatting on save; recommended)
While it's possible to add watchers without the `Prettier plugin`, the plugin simply helps you with pre-filling the necessary fields with the necessary values for your watcher.

1. Install `Prettier plugin` from `File > Settings > Plugins`
Expand All @@ -41,7 +39,7 @@ While it's possible to add watchers without the `Prettier plugin`, the plugin si

> Unfortunately you'll need to create watcher for each `File Type` you want the IDE to watch. By default it was creating it only for JavaScript. Most probably you want to add `jsx, ts, tsx` watcher also. Do this with copying the watcher and change the `File Type`.
### TypeScript
## TypeScript
> Step 0: If it's necessary, please do `npm i` first for your project, only create `tsconfig.json` file after that. This is important to avoid duplicated `@types` to be loaded.
1. **ONLY** in case you don't have `tsconfig.json` file yet: `mhy config typescript -i`
Expand All @@ -50,19 +48,19 @@ While it's possible to add watchers without the `Prettier plugin`, the plugin si

> Note that in `mhy` TypeScript is only being used to perform type-checks and to generate `.d.ts` files. You don't need to enable compilation, that is being done by Babel.
### ESLint
## ESLint
1. **ONLY** in case you don't have `.eslintrc` file yet: `mhy config eslint -i`
2. Go to `File > Settings > Language & Frameworks > JavaScript > Code Quality Tools > ESLint`
3. `Enable`
4. For `ESLint package` set `GLOBAL_NODE_MODULES/mhy/node_modules/eslint`

### TSLint
## TSLint
1. **ONLY** in case you don't have `tsconfig.json` file yet: `mhy config tslint -i`
2. Go to `File > Settings > Language & Frameworks > JavaScript > TSLint`
3. `Enable`
4. For `TSLint package` set `GLOBAL_NODE_MODULES/mhy/node_modules/tslint`

### Tips
## Tips
1. Disable automatic `package.json` dependency inspection.
2. Disable statement termination inspection. `CTRL+Enter` at the end of any line. (ONLY in case you choose to continue using ASI which is the default setting.)
3. Set 4 spaces for indent. (ONLY in case you choose to continue using the default setting.)
Expand Down
8 changes: 3 additions & 5 deletions docs/others/development.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Development

## Development

### Setup environment
## Setup environment

1. Fork repository
2. Rewrite `name` and `bin` key to something else \(eg: `mhyd` for dev\).
Expand All @@ -11,10 +9,10 @@
5. Create PR when done.

> Use `npm run build -- --watch` to watch for file changes.
>
> The name rewrite is needed because `mhy` itself is being built using `mhy` which is why you also need an untouched stable version of it.
### Creating processes/commands
## Creating processes/commands

Coming soon...

6 changes: 2 additions & 4 deletions docs/others/faq.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# FAQ

## FAQ

### Are there any upcoming features?
## Are there any upcoming features?

You can always follow our continuous TODO list here: [https://github.com/wintercounter/mhy/issues/1](https://github.com/wintercounter/mhy/issues/1)

### Why no more question?
## Why no more question?

I have more important things to do now :\)

8 changes: 3 additions & 5 deletions docs/others/help.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# Help

## Help

### Experienced/resolve any issues?
## Experienced/resolve any issues?
Help your fellow developers and make a PR to this page with your solution! Thank you!

### TypeScript
## TypeScript

#### Errors after updating `mhy` to the latest version.
### Errors after updating `mhy` to the latest version.
1. Remove your local `node_modules` folder if you have any.
2. `npm i` if you have any local dependencies.
3. Use `mhy config typescript -io` to regenerate your `tsconfig.json` file.
Expand Down
16 changes: 7 additions & 9 deletions docs/processes/babel.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# babel

## babel

- Environment: `production`
- Alias: `bb`
- By default it uses the whole `src` directory.
Expand All @@ -11,7 +9,7 @@

> Should be used usually to generate production files for libraries.
### Default command
## Default command
```bash
babel ./src --out-dir dist \
--config-file mhy/configs/babel \
Expand All @@ -20,29 +18,29 @@ babel ./src --out-dir dist \
--extensions .js,.jsx,.ts,.tsx
```

### CLI Options
## CLI Options
https://babeljs.io/docs/en/babel-cli

### Examples
## Examples

#### Default CLI
### Default CLI
```bash
mhy babel --mhy-prod
# or
NODE_ENV=production mhy bb
```

#### mhy UI
### mhy UI
```bash
mhy ui babel --mhy-prod
```

#### Start with watcher
### Start with watcher
```bash
mhy babel --watch --mhy-prod
```

#### Only transform one file
### Only transform one file
```bash
mhy babel script.js --mhy-prod
mhy babel script.js --mhy-prod --out-file script-compiled.js
Expand Down
14 changes: 6 additions & 8 deletions docs/processes/eslint.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
# eslint

## eslint

- Environment: `development`

> Linting is done by Webpack also. You only need this process to manually run linting, or run it's `fix` command for example.
### Default command
## Default command
```bash
eslint ./src/**/*.{js,jsx,ts,tsx}
```

### CLI Options
## CLI Options
https://eslint.org/docs/user-guide/command-line-interface

### Examples
## Examples

#### Default CLI
### Default CLI
```bash
mhy eslint
```

#### Only lint one file
### Only lint one file
```bash
mhy eslint src/file.js
```

#### Fix fixable errors
### Fix fixable errors
```bash
mhy eslint --fix
```
Expand Down
Loading

0 comments on commit ed164dd

Please sign in to comment.