Skip to content

Commit

Permalink
Update: ドキュメントをアップデート
Browse files Browse the repository at this point in the history
  • Loading branch information
manabuyasuda committed Oct 13, 2021
1 parent c737df4 commit 1228f69
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
## 確認環境
以下の環境で動作の確認をしています。

- macOS High Sierra 10.13.6
- Node.js 10.16.0
- macOS High Sierra 10.14.6
- Node.js 14.17.6

Node.jsのバージョンはnodenvで固定しています。

Expand Down Expand Up @@ -144,7 +144,7 @@ npm run htmlValidate
npm run stylelint
```

[Airbnb JavaScriptスタイルガイド](http://mitsuruog.github.io/javascript-style-guide/)[eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue)を元にJavaScriptのリントを実行します。
[JavaScript Standard Style](https://standardjs.com/readme-ja.html)を元にJavaScriptのリントを実行します。

```bash
npm run eslint
Expand All @@ -154,7 +154,7 @@ npm run eslint

- PugをHTMLにコンパイル
- SassをCSSにコンパイル
- JSをES5にコンパイル(Vue.jsの単一ファイルコンポーネントも変換する)
- JSをES5にコンパイル
- SVGスプライトの生成
- ローカルサーバーを立ち上げて動作の確認(static以下のHTMLファイルはSSIにも対応)
- HTMLのリント
Expand Down
12 changes: 3 additions & 9 deletions document/js.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ JavaScriptは大きく6つにわけられます。
1. site.js
2. polyfill.js
3. /namespace
4. /domain
5. /infra
6. /utils
4. /lib
5. /utils

### site.js
JavaScriptのエントリーポイントです。`.js``.vue`はこのファイルで出力されます。
Expand All @@ -26,16 +25,11 @@ ECSSの名前空間のコンセプトを使って、使われる状況ごとに
import jsSmoothScroll from './namespace/js/jsSmoothScroll';
```

### /domain
### /lib
ドメインオブジェクト。ある対象(名詞)の値を持ち・判断・加工・計算をして結果を返します。
1つの`class`にすることで、重複しがちな処理を1箇所で管理することを目的としています。

- `MediaQuery.js` メディアクエリの条件(値)を持ち、条件に一致するかを返す
- `Storage.js` ローカルストレージのキー(値)を持ち、取得・更新・削除などをする
- `History.js` URLパラメーターの取得・更新・削除などをする

### /infra
データベースや外部APIとのやり取りをします。

### /utils
1つの関数が1つの結果を返す汎用関数です。
Expand Down

0 comments on commit 1228f69

Please sign in to comment.