diff --git a/.eslintignore b/.eslintignore index ec6b1c704..7c6a6389d 100644 --- a/.eslintignore +++ b/.eslintignore @@ -6,4 +6,5 @@ node_modules/ /openapi/ /public/api/v2/swagger/ /public/storybook/ +/public/LICENSE /utils/$path.ts diff --git a/.gitignore b/.gitignore index e9267ab0b..fc80eb263 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ /eslint_report.json /public/api/v2/swagger/ /public/storybook/ +/public/LICENSE /utils/$path.ts node_modules/ .env* diff --git a/.prettierignore b/.prettierignore index 552f22898..700e343b2 100644 --- a/.prettierignore +++ b/.prettierignore @@ -5,6 +5,7 @@ node_modules/ /eslint_report.json /public/api/v2/swagger/ /public/storybook/ +/public/LICENSE /server/dist/ /server/prisma/json-schema.json /server/prisma/migrations/ diff --git a/INSTALL-ja.md b/INSTALL-ja.md index f62fca7a0..7424aa036 100644 --- a/INSTALL-ja.md +++ b/INSTALL-ja.md @@ -36,24 +36,50 @@ API の接続先の情報を変更する場合 .env を適宜書き換える必 ### ビルド -以下のコマンドを実行。 +次のコマンドを実行し、フロントエンドの静的ファイルを生成し配置します。 ```sh -yarn && yarn build +git clone https://github.com/npocccties/ChibiCHiLO.git +cd ChibiCHiLO +yarn +yarn build ``` -### Storybook +server/dist ディレクトリ以下にファイルが作られれば成功です。 + +### 成果物のファイル構造 -いくつかの UI をブラウザで確認するには `yarn` 実行後、以下のコマンドを実行。 +``` +server/dist +├── index.js … サーバーを起動するためのエントリーポイント +├── public +│ ├── LICENSE … 使用しているソフトウェアライセンスの詳細 +│ ├── logo.png … ロゴ +│ ├── storybook/* … Storybook のためのファイル群 +│ └── ... +└── ... +``` + +### 使用しているソフトウェアライセンスの詳細 + +使用しているソフトウェアライセンスの詳細を取得するには `yarn` 実行後、以下のコマンドを実行します。 ```sh -yarn storybook +yarn build:license ``` -## カスタマイズ +成功すると CSV ファイル `public/LICENSE.csv` が得られます。 ### ロゴ -アプリケーションバーに表示するロゴを変更するにはビルド実行前に `./public/logo.png` をコピー等で上書きする。 +アプリケーションバーに表示するロゴ画像を変更するには `public/logo.png` を上書き後、ビルドします。 -最大幅100px、最大高さ48pxの範囲でアスペクト比を維持してリサイズされるので、それを考慮して用意すること。 +ロゴ画像は最大幅 100px、最大高さ 48px の範囲でアスペクト比を維持してリサイズされます。 + +### Storybook + +いくつかの UI をブラウザで確認するには `yarn` 実行後、以下のコマンドを実行します。 + +```sh +yarn storybook +``` diff --git a/package.json b/package.json index 216fc68c9..be4e17a4a 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,10 @@ "main": "index.js", "license": "MIT", "private": true, + "repository": { + "type": "git", + "url": "https://github.com/npocccties/ChibiCHiLO" + }, "workspaces": [ "server" ], @@ -70,15 +74,16 @@ "compile": "run-p compile:*", "compile:prisma": "yarn --cwd server build:prisma", "compile:pathpida": "pathpida", - "build": "run-s compile build:frontend build:export build:server", - "build:frontend": "run-p build:{storybook,next}", + "build": "run-s compile build:static build:export build:server", + "build:static": "run-p build:{license,storybook,next}", + "build:license": "NODE_ENV=development yarn licenses generate-disclaimer > public/LICENSE", "build:storybook": "build-storybook -o public/storybook", "build:next": "next build", "build:export": "next export -o server/dist/public", "build:server": "yarn --cwd server build:app", "build:openapi": "openapi-generator-cli generate -i http://localhost:8080/api/v2/swagger/json -g typescript-fetch -o openapi", "start": "yarn --cwd server start", - "vercel-build": "run-s compile build:frontend build:server && rm -rf public/api/v2/swagger && mkdir -p public/api/v2/swagger && cp -a server/dist/static public/api/v2/swagger/static", + "vercel-build": "run-s compile build:static build:server && rm -rf public/api/v2/swagger && mkdir -p public/api/v2/swagger && cp -a server/dist/static public/api/v2/swagger/static", "format": "prettier --write .", "lint": "run-s compile 'lint:eslint {@}' --", "lint:eslint": "eslint --ext .js,.jsx,.ts,.tsx .", diff --git a/server/package.json b/server/package.json index 6069b709f..befdc002a 100644 --- a/server/package.json +++ b/server/package.json @@ -2,9 +2,12 @@ "name": "chibichilo-server", "version": "2.1.0", "main": "main.ts", - "author": "Kohei Watanabe ", "license": "MIT", - "private": true, + "repository": { + "type": "git", + "url": "https://github.com/npocccties/ChibiCHiLO", + "directory": "server" + }, "scripts": { "test": "jest", "dev": "run-p dev:*",