diff --git a/.github/workflows/create_heroku_review_app.yaml b/.github/workflows/create_heroku_review_app.yaml index 61605fb65..56caa2cdf 100644 --- a/.github/workflows/create_heroku_review_app.yaml +++ b/.github/workflows/create_heroku_review_app.yaml @@ -1,13 +1,40 @@ name: Review App on: - pull_request_target: - types: [opened] + pull_request: + types: [opened, synchronize] jobs: create-review-app: runs-on: ubuntu-latest steps: - - uses: fastruby/manage-heroku-review-app@9fa49f0320460f278c3687bc348dd0cbb18555dc # v1.3 + - name: Get PR Number + id: get_pr_number + run: echo "::set-output name=pr_number::${{ github.event.pull_request.number }}" + + - name: Check if PR Number is greater than 140 + id: set_step_id + run: | + pr_number=${{ steps.get_pr_number.outputs.pr_number }} + if [ $pr_number -gt 140 ]; then + echo "::set-output name=step_id::true" + else + echo "::set-output name=step_id::false" + fi + + - name: Display step_id + run: echo "Step ID is ${{ steps.set_step_id.outputs.step_id }}" + + - uses: kqito/manage-heroku-review-app@55e434ad5ac86f21cf2f7654de1566973fbc7046 + if: ${{ steps.set_step_id.outputs.step_id == 'true' }} + with: + action: destroy + env: + HEROKU_API_TOKEN: ${{ secrets.HEROKU_API_TOKEN }} + HEROKU_PIPELINE_ID: ${{ secrets.HEROKU_PIPELINE_ID }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - uses: kqito/manage-heroku-review-app@55e434ad5ac86f21cf2f7654de1566973fbc7046 + if: ${{ steps.set_step_id.outputs.step_id == 'true' }} with: action: create env: diff --git a/.github/workflows/destroy_heroku_review_app.yaml b/.github/workflows/destroy_heroku_review_app.yaml index b2bf67949..cbcec744a 100644 --- a/.github/workflows/destroy_heroku_review_app.yaml +++ b/.github/workflows/destroy_heroku_review_app.yaml @@ -7,7 +7,7 @@ jobs: destroy-review-app: runs-on: ubuntu-latest steps: - - uses: fastruby/manage-heroku-review-app@9fa49f0320460f278c3687bc348dd0cbb18555dc # v1.3 + - uses: kqito/manage-heroku-review-app@55e434ad5ac86f21cf2f7654de1566973fbc7046 with: action: destroy env: diff --git a/package.json b/package.json index 88d45e67d..0074ce490 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "test": "wireit" }, "dependencies": { - "wireit": "0.14.9" + "wireit": "0.14.11" }, "devDependencies": { "@wsh-2025/configs": "workspace:*" @@ -58,5 +58,8 @@ "./workspaces/test:test" ] } + }, + "volta": { + "node": "22.14.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 576486ce7..4e6a03b7a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,8 +18,8 @@ importers: .: dependencies: wireit: - specifier: 0.14.9 - version: 0.14.9 + specifier: 0.14.11 + version: 0.14.11 devDependencies: '@wsh-2025/configs': specifier: workspace:* @@ -5256,6 +5256,11 @@ packages: wildcard@2.0.1: resolution: {integrity: sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==} + wireit@0.14.11: + resolution: {integrity: sha512-edO3AiL1wYlBIapwx8e1OGEmsG37sv7qnRzx4YDsMPcKo+6NMOjWYcfRbaeoB1MzakLrnozWB2Q1q7Ko45NckA==} + engines: {node: '>=18.0.0'} + hasBin: true + wireit@0.14.9: resolution: {integrity: sha512-hFc96BgyslfO1WGSzQqOVYd5N3TB+4u9w70L9GHR/T7SYjvFmeznkYMsRIjMLhPcVabCEYPW1vV66wmIVDs+dQ==} engines: {node: '>=18.0.0'} @@ -10488,6 +10493,14 @@ snapshots: wildcard@2.0.1: {} + wireit@0.14.11: + dependencies: + brace-expansion: 4.0.0 + chokidar: 3.6.0 + fast-glob: 3.3.2 + jsonc-parser: 3.3.1 + proper-lockfile: 4.1.2 + wireit@0.14.9: dependencies: brace-expansion: 4.0.0 diff --git a/public/service-worker.js b/public/service-worker.js new file mode 100644 index 000000000..834a581ba --- /dev/null +++ b/public/service-worker.js @@ -0,0 +1,41 @@ +// workspaces/client/public/service-worker.js +const CACHE_NAME = 'arema-streams-cache-v1'; + +self.addEventListener('install', (event) => { + self.skipWaiting(); +}); + +self.addEventListener('activate', (event) => { + event.waitUntil( + caches.keys().then((cacheNames) => { + return Promise.all( + cacheNames.map((name) => { + if (name !== CACHE_NAME) { + return caches.delete(name); + } + }), + ); + }), + ); +}); + +self.addEventListener('fetch', (event) => { + const requestUrl = new URL(event.request.url); + // /streams/ に対するリクエストのみキャッシュ対象とする + if (requestUrl.pathname.startsWith('/streams/')) { + event.respondWith( + caches.match(event.request).then((response) => { + if (response) { + return response; + } + return fetch(event.request).then((networkResponse) => { + const responseClone = networkResponse.clone(); + caches.open(CACHE_NAME).then((cache) => { + cache.put(event.request, responseClone); + }); + return networkResponse; + }); + }), + ); + } +}); diff --git a/workspaces/client/src/app/Document.tsx b/workspaces/client/src/app/Document.tsx index 0ca7b8252..28f87bc1c 100644 --- a/workspaces/client/src/app/Document.tsx +++ b/workspaces/client/src/app/Document.tsx @@ -18,7 +18,7 @@ export const Document = () => {
-プレミアムエピソードの視聴にはログインが必要です @@ -89,7 +84,6 @@ export const EpisodePage = () => { playerType={PlayerType.HlsJS} playlistUrl={`/streams/episode/${episode.id}/playlist.m3u8`} /> -
この番組は放送が終了しました
{ ) : (この番組は {DateTime.fromISO(program.startAt).toFormat('L月d日 H:mm')} に放送予定です @@ -138,7 +129,6 @@ export const ProgramPage = () => { )}