Skip to content

Commit 5cb83fa

Browse files
authored
Merge pull request #17 from mziyut/setup-textlint-and-setup-ci
Setup textlint and setup ci
2 parents 00f8360 + b93e0ad commit 5cb83fa

19 files changed

+4051
-72
lines changed

.github/workflows/test.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
6+
permissions:
7+
contents: read
8+
packages: read
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
textlint:
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 2
18+
env:
19+
NODE_AUTH_TOKEN: ${{ secrets.AUTH_TOKEN_FOR_GITHUBPKG }}
20+
steps:
21+
- uses: actions/checkout@v3
22+
- uses: actions/setup-node@v3
23+
with:
24+
cache: 'yarn'
25+
registry-url: 'https://npm.pkg.github.com'
26+
scope: '@increments'
27+
- run: yarn install
28+
- run: yarn run textlint
29+
30+
prettier:
31+
runs-on: ubuntu-latest
32+
timeout-minutes: 2
33+
env:
34+
NODE_AUTH_TOKEN: ${{ secrets.AUTH_TOKEN_FOR_GITHUBPKG }}
35+
steps:
36+
- uses: actions/checkout@v3
37+
- uses: actions/setup-node@v3
38+
with:
39+
cache: 'yarn'
40+
registry-url: 'https://npm.pkg.github.com'
41+
scope: '@increments'
42+
- run: yarn install
43+
- run: yarn run prettier
File renamed without changes.

.textlintignore

Whitespace-only changes.

.textlintrc.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"plugins": {},
3+
"filters": {
4+
"comments": true
5+
},
6+
"rules": {
7+
"@textlint-ja/no-synonyms": {
8+
"allows": [],
9+
"prleferWords": [],
10+
"alrllowAlphabet": true,
11+
"alrllowNumber": true,
12+
"alrllowLexeme": true
13+
},
14+
"aws-service-name": true,
15+
"no-mixed-zenkaku-and-hankaku-alphabet": true,
16+
"no-todo": true,
17+
"period-in-list-item": true
18+
}
19+
}

package.json

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@
44
"description": "mziyut's qiita-articles",
55
"main": "index.js",
66
"scripts": {
7-
"format": "prettier --check .",
8-
"format:fix": "prettier --write .",
7+
"format:": "run-s prettier textlint",
8+
"format:fix": "run-s prettier:fix textlint:fix",
99
"qiita:new": "qiita new",
1010
"qiita:preview": "qiita preview",
1111
"qiita:publish": "qiita publish",
12+
"prettier": "prettier --check .",
13+
"prettier:fix": "prettier --write .",
14+
"textlint": "textlint --config .textlintrc.json *",
15+
"textlint:fix": "textlint --config .textlintrc.json --fix *",
1216
"test": "echo \"Error: no test specified\" && exit 1"
1317
},
1418
"keywords": [],
@@ -26,7 +30,16 @@
2630
"@increments/qiita-cli": "^0.0.20"
2731
},
2832
"devDependencies": {
29-
"prettier": "^2.8.8"
33+
"@textlint-ja/textlint-rule-no-synonyms": "^1.3.0",
34+
"npm-run-all": "^4.1.5",
35+
"prettier": "^2.8.8",
36+
"sudachi-synonyms-dictionary": "^12.0.0",
37+
"textlint": "^13.3.2",
38+
"textlint-filter-rule-comments": "^1.2.2",
39+
"textlint-rule-aws-service-name": "^1.4.0",
40+
"textlint-rule-no-mixed-zenkaku-and-hankaku-alphabet": "^1.0.1",
41+
"textlint-rule-no-todo": "^2.0.1",
42+
"textlint-rule-period-in-list-item": "^1.0.1"
3043
},
3144
"prettier": {
3245
"singleQuote": true

public/0ac39e8792a476393b6c.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
title: BlankAndroidTV向けアプリをReactNativeで起動するまで
2+
title: BlankAndroidTV向けアプリケーションをReactNativeで起動するまで
33
tags:
44
- Android
55
- Node.js
66
- React
77
- AndroidTV
88
- reactnative
99
private: false
10-
updated_at: '2023-06-16T14:30:42+09:00'
10+
updated_at: '2023-06-27T21:59:25+09:00'
1111
id: 0ac39e8792a476393b6c
1212
organization_url_name: qiita-inc
1313
---
@@ -16,24 +16,25 @@ organization_url_name: qiita-inc
1616
株式会社エイチームライフスタイル 自動車事業部 の @mziyut が担当します :santa:
1717

1818
最近購入したテレビが AndroidTV をベースにしたものだったのもあり、
19-
0.55 から ReactNative で AndroidTV 向けアプリの開発を行えるようになっていたので試してみました
19+
0.55 から ReactNative で AndroidTV 向けアプリケーションの開発を行えるようになっていたので試してみました
2020
ちなみに、2019/12/16 時点の最新バージョンは、v0.61.5 でした。
2121

2222
## ReactNative とは :thinking:
2323

24-
簡単に言うと「Facebook が作成した React をベースにネイティブアプリフレームワーク」です。
24+
簡単に言うと「Facebook が作成した React をベースにネイティブアプリケーションフレームワーク」です。
2525

2626
## AndroidTV とは :thinking:
2727

2828
簡単に言うと、Google が提供する、スマートテレビ向けプラットフォームです。
2929

3030
## 今回用いる環境
3131

32-
`sh
32+
```sh
3333
$ sw_vers
3434
ProductName: Mac OS X
3535
ProductVersion: 10.14.4
3636
BuildVersion: 18E226
37+
```
3738

3839
```sh
3940
$ node -v
@@ -103,21 +104,21 @@ npx react-native init react_native_androidtv
103104
Blank の Project が作成されたので、起動できるところまで確認を実施しておきます。
104105
今回は Android が対象なので、Project 作成時に出ていた以下コマンドを実行
105106

106-
````
107+
```sh
107108
$ cd /Users/mziyut/Workspace/github.com/mziyut/react_native_androidtv && npx react-native run-android
108-
`
109+
```
109110

110111
起動することを確認できました :tada:
111112

112113
<img width="300" alt="image.png" src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/55950/7f892fdc-83c2-428a-3828-5e763b01e35a.png">
113114

114-
### AndroidTV向けにオプションの変更
115+
### AndroidTV 向けにオプションの変更
115116

116-
AndroidTV向けにBuildできるように設定を変更しましょう
117+
AndroidTV 向けに Build できるように設定を変更しましょう
117118
`AndroidManifest.xml`の一部を変更する必要があります。
118119

119-
+ react_native_androidtv/android/app/src/main/AndroidManifest.xml
120-
[※1](https://facebook.github.io/react-native/docs/building-for-apple-tv)
120+
- react_native_androidtv/android/app/src/main/AndroidManifest.xml
121+
[※1](https://facebook.github.io/react-native/docs/building-for-apple-tv)
121122

122123
```xml
123124
<!-- Add custom banner image to display as Android TV launcher icon -->
@@ -133,7 +134,7 @@ AndroidTV向けにBuildできるように設定を変更しましょう。
133134
</intent-filter>
134135
...
135136
</application>
136-
````
137+
```
137138

138139
### 仮想デバイスの追加
139140

@@ -162,15 +163,17 @@ AndroidTV を選択し「Next」をクリック。
162163

163164
先程立ち上がっていた、仮想デバイスを停止した後、改めて Build を行います。
164165

165-
```
166+
```sh
166167
$ cd /Users/mziyut/Workspace/github.com/mziyut/react_native_androidtv && npx react-native run-android
167168
```
168169

169170
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/55950/a73cd7ed-ecd8-a7f4-59f2-c41daf96d58c.png)
170171

171172
## まとめ
172173

173-
AndroidTV 向けの Build が ReactNative でサポートされており、少ない設定でアプリを Build し立ち上げるところまで行えました。
174+
<!-- textlint-disable @textlint-ja/no-synonyms -->
175+
176+
AndroidTV 向けの Build が ReactNative でサポートされており、少ない設定でアプリケーションを Build し立ち上げるところまで行えました。
174177
しかし、[TV アプリの品質  |  Android Developers](https://developer.android.com/docs/quality-guidelines/tv-app-quality)に以下記載があります。
175178

176179
> 重要: 優れたユーザー エクスペリエンスを実現するには、TV 端末向けのアプリがユーザビリティの特定の要件に適合している必要があります。
@@ -179,11 +182,13 @@ AndroidTV 向けの Build が ReactNative でサポートされており、少
179182
リモコン操作に対する設定だけではなく UI に関する制限をクリアするために多くの実装を追加で行う必要があります。
180183
(同様に、AppleTV 向けアプリケーションも同様に要件があります)
181184

182-
そのため、ReactNative でスマートテレビ向けアプリを作成できると安易に飛びつくことなく
185+
そのため、ReactNative でスマートテレビ向けアプリケーションを作成できると安易に飛びつくことなく
183186
実装に必要な内容を整理した上で判断したほうが良いと考えます。
184187

185188
Build しただけですが、[mziyut/react_native_androidtv - Github](https://github.com/mziyut/react_native_androidtv)に Push しておきました。
186189

190+
<!-- textlint-enable @textlint-ja/no-synonyms -->
191+
187192
## 最後に
188193

189194
[Ateam Lifestyle Advent Calendar 2019](https://qiita.com/advent-calendar/2019/ateam-lifestyle) 20 日目は @mgmg121 がお送りします!!

public/2d1a32499e1466aec6ad.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ tags:
44
- Slack
55
- pagerduty
66
private: false
7-
updated_at: '2023-06-27T21:52:53+09:00'
7+
updated_at: '2023-06-27T21:59:25+09:00'
88
id: 2d1a32499e1466aec6ad
99
organization_url_name: qiita-inc
1010
---
@@ -40,8 +40,8 @@ Slack の text field に `/pd trigger` と入力し、 Enter 等で 送信して
4040
| Impacted Service | 対象サービスを選択 | Qiita であれば Qiita 等 |
4141
| Title | 何が発生しているかを入力 | ○○ を利用したログインが失敗する |
4242

43-
- Impacted Service は PagerDuty の Service 設定によって異なります。何を選択すれば良いか迷う方は普段から PagerDuty を利用している方に確認してください
44-
- Title は PagerDuty の Incident を受け取った人が一番最初に確認します。 On call 対象者の設定次第ですが、PagerDuty から電話がかかってくる際に読み上げられます 読み上げに使う言語は英語です。可能であれば英語で入力すると電話連絡を受けた方が対応有無の判断を速く行うことが出来ます
43+
- Impacted Service は PagerDuty の Service 設定によって異なります。何を選択すれば良いか迷う方は普段から PagerDuty を利用している方に確認してください
44+
- Title は PagerDuty の Incident を受け取った人が一番最初に確認します。 On call 対象者の設定次第ですが、PagerDuty から電話がかかってくる際に読み上げられます 読み上げに使う言語は英語です。可能であれば英語で入力すると電話連絡を受けた方が対応有無の判断を速く行うことが出来ます
4545

4646
Assign To (担当者選択) や Priority (優先度), Description は必要に応じて記入すると良いでしょう。
4747
迷ったら未選択、未入力で良いと私は考えます。 Incident が発生していることをいち早く担当者に伝えることが重要です。

public/2e125a55945f991b0af4.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ tags:
66
- Next.js
77
- GitHubActions
88
private: false
9-
updated_at: '2023-06-16T14:31:18+09:00'
9+
updated_at: '2023-06-27T21:59:26+09:00'
1010
id: 2e125a55945f991b0af4
1111
organization_url_name: qiita-inc
1212
---
@@ -16,8 +16,8 @@ Increments 株式会社の @mziyut が担当します!
1616

1717
## はじめに
1818

19-
- 最近ハッカソンに参加した際に GitHub Actions を利用し、master(main)ブランチに merge 等新規コミットが行われたことをトリガーに、本番環境に反映されるように設定しました
20-
- この記事では、最短で`firebase deploy`するまでの手順を記載します
19+
- 最近ハッカソンに参加した際に GitHub Actions を利用し、master(main)ブランチに merge 等新規コミットが行われたことをトリガーに、本番環境に反映されるように設定しました
20+
- この記事では、最短で`firebase deploy`するまでの手順を記載します
2121

2222
### 今回用いる環境
2323

@@ -36,7 +36,7 @@ v12.16.0
3636

3737
## Project の準備
3838

39-
- 今回は Firebase にデプロイすることがゴールなので GitHub 上で公開されている Next.js with Firebase Hosting example を利用します
39+
- 今回は Firebase にデプロイすることがゴールなので GitHub 上で公開されている Next.js with Firebase Hosting example を利用します
4040

4141
https://github.com/vercel/next.js/tree/canary/examples/with-firebase-hosting
4242

@@ -46,7 +46,7 @@ npx create-next-app --example with-firebase-hosting mziyut-advent-calendar-2020
4646

4747
### 起動確認
4848

49-
- 最低限作成した Project が動作することを確認しておきましょう
49+
- 最低限作成した Project が動作することを確認しておきましょう
5050

5151
```zsh
5252
cd mziyut-advent-calendar-2020 && yarn dev
@@ -56,7 +56,7 @@ cd mziyut-advent-calendar-2020 && yarn dev
5656

5757
### `.firebaserc` の設定
5858

59-
- [Next.js with Firebase Hosting example](https://github.com/vercel/next.js/tree/canary/examples/with-firebase-hosting) でプロジェクトを作成した場合 `.firebaserc` のプロジェクト設定が `<project-name-here>` となっているので適当なプロジェクト名を設定しましょう
59+
- [Next.js with Firebase Hosting example](https://github.com/vercel/next.js/tree/canary/examples/with-firebase-hosting) でプロジェクトを作成した場合 `.firebaserc` のプロジェクト設定が `<project-name-here>` となっているので適当なプロジェクト名を設定しましょう
6060

6161
```diff:.firebaserc
6262
{

public/2f1d743a3936191ba077.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ tags:
77
- Docker
88
- nextcloud
99
private: false
10-
updated_at: '2023-06-16T14:31:39+09:00'
10+
updated_at: '2023-06-27T21:59:25+09:00'
1111
id: 2f1d743a3936191ba077
1212
organization_url_name: qiita-inc
1313
---
1414

1515
## これはなに
1616

17-
- Docker 版 nextcloud を構築していた際に nextcloud 側で設定されている `PHP_UPLOAD_LIMIT` の上限に引っかかってしまい、設定を上書きをするために簡単に調査したのでまとめました
17+
- Docker 版 nextcloud を構築していた際に nextcloud 側で設定されている `PHP_UPLOAD_LIMIT` の上限に引っかかってしまい、設定を上書きをするために簡単に調査したのでまとめました
1818

1919
## デフォルトの設定
2020

@@ -24,7 +24,7 @@ organization_url_name: qiita-inc
2424

2525
以前は php.ini を作成し公式イメージをベースに Dockerfile を記述していましたが、 ENV を渡せば php.ini が条件に沿って自動生成されるように変更されていました。
2626

27-
`memory_limit` の設定を行ないたい場合は `PHP_MEMORY_LIMIT``1024M` 等の値を渡します。
27+
`memory_limit` の設定を行いたい場合は `PHP_MEMORY_LIMIT``1024M` 等の値を渡します。
2828

2929
`upload_max_filesize` `post_max_size` の設定を行いたい場合は `PHP_UPLOAD_LIMIT` に同様に `1024M` 等の値を設定します。
3030

public/34435e9cb3fd76e7e86f.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ tags:
55
- automation
66
- GitHubActions
77
private: false
8-
updated_at: '2023-06-16T14:31:23+09:00'
8+
updated_at: '2023-06-27T21:59:26+09:00'
99
id: 34435e9cb3fd76e7e86f
1010
organization_url_name: qiita-inc
1111
---
@@ -21,11 +21,11 @@ https://github.com/actions-ecosystem/action-create-Issue
2121

2222
## 設定
2323

24-
- GitHub レポジトリはすでに作成している前提で記載します
24+
- GitHub レポジトリはすでに作成している前提で記載します
2525

2626
### ディレクトリの作成
2727

28-
- GitHub Actions の設定ファイルは `.github` フォルダ以下に記載します
28+
- GitHub Actions の設定ファイルは `.github` フォルダ以下に記載します
2929

3030
```bash
3131
cd path/to/repository

0 commit comments

Comments
 (0)