diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 6f13badd..3e14494e 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,4 +1,5 @@ - +## 関連 Issue + - Close # ## やったこと @@ -7,10 +8,4 @@ ## 確認した方法 - ## スクリーンショット - - -## 自動生成したコード - -- ファイル名 diff --git a/.github/workflows/publish-spec.yml b/.github/workflows/publish-spec.yml index 439db30f..d7a44af0 100644 --- a/.github/workflows/publish-spec.yml +++ b/.github/workflows/publish-spec.yml @@ -21,7 +21,7 @@ jobs: node-version: '22' - name: Bundle API - working-directory: api + working-directory: openapi run: | npm run bundle @@ -29,7 +29,7 @@ jobs: uses: Legion2/swagger-ui-action@v1 with: output: swagger-ui - spec-file: ./api/bundle.yml + spec-file: ./openapi/bundle.yml GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Publish to Cloudflare Pages diff --git a/.github/workflows/validate-spec.yml b/.github/workflows/validate-spec.yml index 6fe7b075..4b5daeeb 100644 --- a/.github/workflows/validate-spec.yml +++ b/.github/workflows/validate-spec.yml @@ -17,4 +17,4 @@ jobs: - name: Validate API Specification run: | - redocly lint ./api/openapi.yml + redocly lint ./openapi/openapi.yml diff --git a/README.dev.md b/README.dev.md index 82fbaa38..e52cd99d 100644 --- a/README.dev.md +++ b/README.dev.md @@ -17,5 +17,5 @@ npm install -g @stoplight/prism-cli モックサーバの起動 ``` -prism mock ./api/openapi.yml +prism mock ./openapi/openapi.yml ``` diff --git a/api/.gitignore b/openapi/.gitignore similarity index 100% rename from api/.gitignore rename to openapi/.gitignore diff --git a/api/README.md b/openapi/README.md similarity index 88% rename from api/README.md rename to openapi/README.md index 6dd1a689..34736c6f 100644 --- a/api/README.md +++ b/openapi/README.md @@ -1,7 +1,7 @@ ## ディレクトリ構造 ``` -api +openapi ├── bundle.yml ... APIに仕様を1つにまとめたYAMLファイル ├── components ... 使い回すために部品化された仕様 │   ├── examples @@ -15,11 +15,13 @@ api ## CLI バリデーション + ``` $ npm run lint ``` -APIの仕様を1つのYAMLファイルにまとめる +API の仕様を 1 つの YAML ファイルにまとめる + ``` $ npm run bundle ``` diff --git a/api/bundle.yml b/openapi/bundle.yml similarity index 100% rename from api/bundle.yml rename to openapi/bundle.yml diff --git a/api/components/examples/book.yml b/openapi/components/examples/book.yml similarity index 100% rename from api/components/examples/book.yml rename to openapi/components/examples/book.yml diff --git a/api/components/examples/google-book.yml b/openapi/components/examples/google-book.yml similarity index 100% rename from api/components/examples/google-book.yml rename to openapi/components/examples/google-book.yml diff --git a/api/components/examples/user.yml b/openapi/components/examples/user.yml similarity index 100% rename from api/components/examples/user.yml rename to openapi/components/examples/user.yml diff --git a/api/components/responses/4xx.yml b/openapi/components/responses/4xx.yml similarity index 100% rename from api/components/responses/4xx.yml rename to openapi/components/responses/4xx.yml diff --git a/api/components/responses/5xx.yml b/openapi/components/responses/5xx.yml similarity index 100% rename from api/components/responses/5xx.yml rename to openapi/components/responses/5xx.yml diff --git a/api/components/schemas/Book.yml b/openapi/components/schemas/Book.yml similarity index 100% rename from api/components/schemas/Book.yml rename to openapi/components/schemas/Book.yml diff --git a/api/components/schemas/Error.yml b/openapi/components/schemas/Error.yml similarity index 100% rename from api/components/schemas/Error.yml rename to openapi/components/schemas/Error.yml diff --git a/api/components/schemas/GoogleBook.yml b/openapi/components/schemas/GoogleBook.yml similarity index 100% rename from api/components/schemas/GoogleBook.yml rename to openapi/components/schemas/GoogleBook.yml diff --git a/api/components/schemas/Loan.yml b/openapi/components/schemas/Loan.yml similarity index 100% rename from api/components/schemas/Loan.yml rename to openapi/components/schemas/Loan.yml diff --git a/api/components/schemas/User.yml b/openapi/components/schemas/User.yml similarity index 100% rename from api/components/schemas/User.yml rename to openapi/components/schemas/User.yml diff --git a/api/openapi.yml b/openapi/openapi.yml similarity index 100% rename from api/openapi.yml rename to openapi/openapi.yml diff --git a/api/package.json b/openapi/package.json similarity index 100% rename from api/package.json rename to openapi/package.json diff --git a/api/paths/auth.yml b/openapi/paths/auth.yml similarity index 100% rename from api/paths/auth.yml rename to openapi/paths/auth.yml diff --git a/api/paths/book.yml b/openapi/paths/book.yml similarity index 100% rename from api/paths/book.yml rename to openapi/paths/book.yml diff --git a/api/paths/google-books.yml b/openapi/paths/google-books.yml similarity index 100% rename from api/paths/google-books.yml rename to openapi/paths/google-books.yml diff --git a/api/paths/loan.yml b/openapi/paths/loan.yml similarity index 100% rename from api/paths/loan.yml rename to openapi/paths/loan.yml diff --git a/api/paths/user.yml b/openapi/paths/user.yml similarity index 100% rename from api/paths/user.yml rename to openapi/paths/user.yml diff --git a/api/redocly.yml b/openapi/redocly.yml similarity index 100% rename from api/redocly.yml rename to openapi/redocly.yml diff --git a/orval.config.dev.js b/orval.config.dev.js index 0dba8087..072190e2 100644 --- a/orval.config.dev.js +++ b/orval.config.dev.js @@ -1,7 +1,7 @@ module.exports = { client: { input: { - target: './api/bundle.yml', + target: './openapi/bundle.yml', }, output: { client: 'react-query', @@ -19,7 +19,7 @@ module.exports = { }, msw: { input: { - target: './api/bundle.yml', + target: './openapi/bundle.yml', }, output: { baseUrl: 'https://localhost:8787', @@ -41,7 +41,7 @@ module.exports = { }, zod: { input: { - target: './api/bundle.yml', + target: './openapi/bundle.yml', }, output: { client: 'zod', diff --git a/orval.config.js b/orval.config.js index 48dc6537..83b2851b 100644 --- a/orval.config.js +++ b/orval.config.js @@ -1,7 +1,7 @@ module.exports = { client: { input: { - target: './api/bundle.yml', + target: './openapi/bundle.yml', }, output: { baseUrl: 'https://kitcc-library-api.kitcc.workers.dev', @@ -19,7 +19,7 @@ module.exports = { }, zod: { input: { - target: './api/bundle.yml', + target: './openapi/bundle.yml', }, output: { client: 'zod',