From fe629bf181d517c45a2135711a145bdca357193c Mon Sep 17 00:00:00 2001 From: gohan5858 <88976739+gohan5858@users.noreply.github.com> Date: Sat, 26 Oct 2024 13:42:07 +0900 Subject: [PATCH 01/17] =?UTF-8?q?chore:=20ESLint=E3=81=A8Prettier=E3=81=AE?= =?UTF-8?q?=E3=83=AB=E3=83=BC=E3=83=AB=E3=81=8C=E3=82=B3=E3=83=B3=E3=83=95?= =?UTF-8?q?=E3=83=AA=E3=82=AF=E3=83=88=E3=81=99=E3=82=8B=E3=81=AE=E3=82=92?= =?UTF-8?q?=E5=AF=BE=E7=AD=96=E3=81=99=E3=82=8B=E3=81=9F=E3=82=81=E3=81=AB?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- task_yell/.eslintrc.json | 2 +- task_yell/package-lock.json | 13 +++++++++++++ task_yell/package.json | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/task_yell/.eslintrc.json b/task_yell/.eslintrc.json index 3722418..4360d9b 100644 --- a/task_yell/.eslintrc.json +++ b/task_yell/.eslintrc.json @@ -1,3 +1,3 @@ { - "extends": ["next/core-web-vitals", "next/typescript"] + "extends": ["next/core-web-vitals", "next/typescript", "prettier"] } diff --git a/task_yell/package-lock.json b/task_yell/package-lock.json index bd38bb4..abaccfb 100644 --- a/task_yell/package-lock.json +++ b/task_yell/package-lock.json @@ -20,6 +20,7 @@ "@types/react-dom": "^18", "eslint": "^8", "eslint-config-next": "14.2.15", + "eslint-config-prettier": "^9.1.0", "postcss": "^8", "tailwindcss": "^3.4.1", "typescript": "^5" @@ -2913,6 +2914,18 @@ } } }, + "node_modules/eslint-config-prettier": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "node_modules/eslint-import-resolver-node": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", diff --git a/task_yell/package.json b/task_yell/package.json index 0843702..30fcbc0 100644 --- a/task_yell/package.json +++ b/task_yell/package.json @@ -21,6 +21,7 @@ "@types/react-dom": "^18", "eslint": "^8", "eslint-config-next": "14.2.15", + "eslint-config-prettier": "^9.1.0", "postcss": "^8", "tailwindcss": "^3.4.1", "typescript": "^5" From e4640decf400baa73d3db345692be56b334680cb Mon Sep 17 00:00:00 2001 From: gohan5858 <88976739+gohan5858@users.noreply.github.com> Date: Sat, 26 Oct 2024 13:43:47 +0900 Subject: [PATCH 02/17] chore: add prettier --- task_yell/package-lock.json | 16 ++++++++++++++++ task_yell/package.json | 1 + 2 files changed, 17 insertions(+) diff --git a/task_yell/package-lock.json b/task_yell/package-lock.json index abaccfb..9d54a97 100644 --- a/task_yell/package-lock.json +++ b/task_yell/package-lock.json @@ -22,6 +22,7 @@ "eslint-config-next": "14.2.15", "eslint-config-prettier": "^9.1.0", "postcss": "^8", + "prettier": "^3.3.3", "tailwindcss": "^3.4.1", "typescript": "^5" } @@ -5838,6 +5839,21 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/prop-types": { "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", diff --git a/task_yell/package.json b/task_yell/package.json index 30fcbc0..acbb39a 100644 --- a/task_yell/package.json +++ b/task_yell/package.json @@ -23,6 +23,7 @@ "eslint-config-next": "14.2.15", "eslint-config-prettier": "^9.1.0", "postcss": "^8", + "prettier": "^3.3.3", "tailwindcss": "^3.4.1", "typescript": "^5" } From 6e00864590def09db68bf8fc2b446c099dfb6ee3 Mon Sep 17 00:00:00 2001 From: gohan5858 <88976739+gohan5858@users.noreply.github.com> Date: Sat, 26 Oct 2024 13:45:48 +0900 Subject: [PATCH 03/17] chore: add prettier format script --- task_yell/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/task_yell/package.json b/task_yell/package.json index acbb39a..6a7fc4f 100644 --- a/task_yell/package.json +++ b/task_yell/package.json @@ -6,7 +6,8 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "next lint" + "lint": "next lint", + "format": "prettier --write --ignore-path .gitignore './**/*.{js,jsx,ts,tsx,json}'" }, "dependencies": { "firebase": "^11.0.1", From 7c65ef59862b4f2dc82d2739fa12074f34d2dcbd Mon Sep 17 00:00:00 2001 From: gohan5858 <88976739+gohan5858@users.noreply.github.com> Date: Sat, 26 Oct 2024 13:46:27 +0900 Subject: [PATCH 04/17] chore: npm run format --- task_yell/public/firebase-messaging-sw.js | 114 +++++++++++----------- task_yell/src/firebase/client-app.ts | 4 +- task_yell/src/firebase/config.ts | 22 ++--- task_yell/src/firebase/server-app.ts | 22 +++-- 4 files changed, 86 insertions(+), 76 deletions(-) diff --git a/task_yell/public/firebase-messaging-sw.js b/task_yell/public/firebase-messaging-sw.js index 32e5dbf..a107062 100644 --- a/task_yell/public/firebase-messaging-sw.js +++ b/task_yell/public/firebase-messaging-sw.js @@ -1,84 +1,88 @@ -importScripts('https://www.gstatic.com/firebasejs/10.5.0/firebase-app-compat.js'); -importScripts('https://www.gstatic.com/firebasejs/10.5.0/firebase-messaging-compat.js'); +importScripts( + "https://www.gstatic.com/firebasejs/10.5.0/firebase-app-compat.js", +); +importScripts( + "https://www.gstatic.com/firebasejs/10.5.0/firebase-messaging-compat.js", +); // Your web app's Firebase configuration // どうせウェブサイトで公開されるので、APIキーは公開しても無問題 const firebaseConfig = { - apiKey: "AIzaSyAs0-_k4Djy48sMzc8I4cbxNBxD-n47lQc", - authDomain: "task-yell.firebaseapp.com", - projectId: "task-yell", - storageBucket: "task-yell.appspot.com", - messagingSenderId: "169999020416", - appId: "1:169999020416:web:44063c22ce7eeb072c1165", - measurementId: "G-08113DVNSF" + apiKey: "AIzaSyAs0-_k4Djy48sMzc8I4cbxNBxD-n47lQc", + authDomain: "task-yell.firebaseapp.com", + projectId: "task-yell", + storageBucket: "task-yell.appspot.com", + messagingSenderId: "169999020416", + appId: "1:169999020416:web:44063c22ce7eeb072c1165", + measurementId: "G-08113DVNSF", }; firebase.initializeApp(firebaseConfig); class CustomPushEvent extends Event { - constructor(data) { - super('push'); + constructor(data) { + super("push"); - Object.assign(this, data); - this.custom = true; - } + Object.assign(this, data); + this.custom = true; + } } /* * Overrides push notification data, to avoid having 'notification' key and firebase blocking * the message handler from being called */ -self.addEventListener('push', (e) => { - // Skip if event is our own custom event - if (e.custom) return; +self.addEventListener("push", (e) => { + // Skip if event is our own custom event + if (e.custom) return; - // Kep old event data to override - const oldData = e.data; + // Kep old event data to override + const oldData = e.data; - // Create a new event to dispatch, pull values from notification key and put it in data key, - // and then remove notification key - const newEvent = new CustomPushEvent({ - data: { - ehheh: oldData.json(), - json() { - const newData = oldData.json(); - newData.data = { - ...newData.data, - ...newData.notification, - }; - delete newData.notification; - return newData; - }, - }, - waitUntil: e.waitUntil.bind(e), - }); + // Create a new event to dispatch, pull values from notification key and put it in data key, + // and then remove notification key + const newEvent = new CustomPushEvent({ + data: { + ehheh: oldData.json(), + json() { + const newData = oldData.json(); + newData.data = { + ...newData.data, + ...newData.notification, + }; + delete newData.notification; + return newData; + }, + }, + waitUntil: e.waitUntil.bind(e), + }); - // Stop event propagation - e.stopImmediatePropagation(); + // Stop event propagation + e.stopImmediatePropagation(); - // Dispatch the new wrapped event - dispatchEvent(newEvent); + // Dispatch the new wrapped event + dispatchEvent(newEvent); }); const messaging = firebase.messaging(); messaging.onBackgroundMessage((payload) => { - // console.log('[firebase-messaging-sw.js] Received background message ', payload); + // console.log('[firebase-messaging-sw.js] Received background message ', payload); - const { title, body, image, icon, ...restPayload } = payload.data; - const notificationOptions = { - body, - icon: image || '/icons/firebase-logo.png', // path to your "fallback" firebase notification logo - data: restPayload, - }; - return self.registration.showNotification(title, notificationOptions); + const { title, body, image, icon, ...restPayload } = payload.data; + const notificationOptions = { + body, + icon: image || "/icons/firebase-logo.png", // path to your "fallback" firebase notification logo + data: restPayload, + }; + return self.registration.showNotification(title, notificationOptions); }); -self.addEventListener('notificationclick', (event) => { - if (event?.notification?.data && event?.notification?.data?.link) { - self.clients.openWindow(event.notification.data.link); - } +self.addEventListener("notificationclick", (event) => { + if (event?.notification?.data && event?.notification?.data?.link) { + self.clients.openWindow(event.notification.data.link); + } - // close notification after click - event.notification.close(); -}); \ No newline at end of file + // close notification after click + event.notification.close(); +}); diff --git a/task_yell/src/firebase/client-app.ts b/task_yell/src/firebase/client-app.ts index dec1362..5de3f41 100644 --- a/task_yell/src/firebase/client-app.ts +++ b/task_yell/src/firebase/client-app.ts @@ -1,4 +1,4 @@ -'use client'; +"use client"; import { initializeApp, getApps } from "firebase/app"; import { firebaseConfig } from "./config"; @@ -6,7 +6,7 @@ import { getAuth } from "firebase/auth"; import { getFirestore } from "firebase/firestore"; import { getStorage } from "firebase/storage"; export const firebaseApp = - getApps().length === 0 ? initializeApp(firebaseConfig) : getApps()[0]; + getApps().length === 0 ? initializeApp(firebaseConfig) : getApps()[0]; export const auth = getAuth(firebaseApp); export const db = getFirestore(firebaseApp); export const storage = getStorage(firebaseApp); diff --git a/task_yell/src/firebase/config.ts b/task_yell/src/firebase/config.ts index e4f3af5..59405c0 100644 --- a/task_yell/src/firebase/config.ts +++ b/task_yell/src/firebase/config.ts @@ -1,18 +1,18 @@ const config: Record = { - apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY, - authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN, - projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID, - storageBucket: process.env.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET, - messagingSenderId: process.env.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID, - appId: process.env.NEXT_PUBLIC_FIREBASE_APP_ID, + apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY, + authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN, + projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID, + storageBucket: process.env.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET, + messagingSenderId: process.env.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID, + appId: process.env.NEXT_PUBLIC_FIREBASE_APP_ID, }; // When deployed, there are quotes that need to be stripped for (const key in config) { - const configValue = config[key]; - if (configValue?.charAt(0) === '"') { - config[key] = configValue.substring(1, configValue.length - 1); - } + const configValue = config[key]; + if (configValue?.charAt(0) === '"') { + config[key] = configValue.substring(1, configValue.length - 1); + } } -export const firebaseConfig = config; \ No newline at end of file +export const firebaseConfig = config; diff --git a/task_yell/src/firebase/server-app.ts b/task_yell/src/firebase/server-app.ts index 1746807..a1247d0 100644 --- a/task_yell/src/firebase/server-app.ts +++ b/task_yell/src/firebase/server-app.ts @@ -1,11 +1,17 @@ import "server-only"; -import admin from 'firebase-admin'; +import admin from "firebase-admin"; -export const firebaseAdminApp = admin.apps.length === 0 ? admin.initializeApp({ - credential: admin.credential.cert({ - projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID, - clientEmail: process.env.FIREBASE_SERVICE_ACCOUNT_EMAIL, - privateKey: process.env.FIREBASE_SERVICE_ACCOUNT_PRIVATE_KEY?.replace(/\\n/g, '\n'), - }) -}) : admin.apps[0] as admin.app.App; +export const firebaseAdminApp = + admin.apps.length === 0 + ? admin.initializeApp({ + credential: admin.credential.cert({ + projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID, + clientEmail: process.env.FIREBASE_SERVICE_ACCOUNT_EMAIL, + privateKey: process.env.FIREBASE_SERVICE_ACCOUNT_PRIVATE_KEY?.replace( + /\\n/g, + "\n", + ), + }), + }) + : (admin.apps[0] as admin.app.App); From b6fd557b4c7a48da730441516879ea3e040b0dfa Mon Sep 17 00:00:00 2001 From: gohan5858 <88976739+gohan5858@users.noreply.github.com> Date: Sat, 26 Oct 2024 13:50:21 +0900 Subject: [PATCH 05/17] chore: Add prettier format check script --- task_yell/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/task_yell/package.json b/task_yell/package.json index 6a7fc4f..d22b8da 100644 --- a/task_yell/package.json +++ b/task_yell/package.json @@ -7,7 +7,8 @@ "build": "next build", "start": "next start", "lint": "next lint", - "format": "prettier --write --ignore-path .gitignore './**/*.{js,jsx,ts,tsx,json}'" + "format": "prettier --write --ignore-path .gitignore './**/*.{js,jsx,ts,tsx,json}'", + "format:check": "prettier --check --ignore-path .gitignore './**/*.{js,jsx,ts,tsx,json}'" }, "dependencies": { "firebase": "^11.0.1", From ad46878cd943b462c40c2a910be59ae7e8724895 Mon Sep 17 00:00:00 2001 From: gohan5858 <88976739+gohan5858@users.noreply.github.com> Date: Sat, 26 Oct 2024 13:57:02 +0900 Subject: [PATCH 06/17] chore: Add husky and lint-staged for pre-commit linting --- task_yell/package-lock.json | 684 ++++++++++++++++++++++++++++++++++++ task_yell/package.json | 2 + 2 files changed, 686 insertions(+) diff --git a/task_yell/package-lock.json b/task_yell/package-lock.json index 9d54a97..3d895a0 100644 --- a/task_yell/package-lock.json +++ b/task_yell/package-lock.json @@ -21,6 +21,8 @@ "eslint": "^8", "eslint-config-next": "14.2.15", "eslint-config-prettier": "^9.1.0", + "husky": "^9.1.6", + "lint-staged": "^15.2.10", "postcss": "^8", "prettier": "^3.3.3", "tailwindcss": "^3.4.1", @@ -1780,6 +1782,21 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ansi-escapes": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.0.0.tgz", + "integrity": "sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==", + "dev": true, + "dependencies": { + "environment": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -2284,6 +2301,87 @@ "node": ">= 6" } }, + "node_modules/cli-cursor": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", + "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", + "dev": true, + "dependencies": { + "restore-cursor": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-4.0.0.tgz", + "integrity": "sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==", + "dev": true, + "dependencies": { + "slice-ansi": "^5.0.0", + "string-width": "^7.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/cli-truncate/node_modules/emoji-regex": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", + "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", + "dev": true + }, + "node_modules/cli-truncate/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/client-only": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", @@ -2359,6 +2457,12 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "license": "MIT" }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true + }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -2642,6 +2746,18 @@ "node": ">=10.13.0" } }, + "node_modules/environment": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", + "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/es-abstract": { "version": "1.23.3", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", @@ -3302,6 +3418,47 @@ "node": ">=6" } }, + "node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "dev": true + }, + "node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/execa/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -3780,6 +3937,18 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-east-asian-width": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.3.0.tgz", + "integrity": "sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-intrinsic": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", @@ -3800,6 +3969,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-symbol-description": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", @@ -4189,6 +4370,30 @@ "node": ">= 14" } }, + "node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "engines": { + "node": ">=16.17.0" + } + }, + "node_modules/husky": { + "version": "9.1.6", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.6.tgz", + "integrity": "sha512-sqbjZKK7kf44hfdE94EoX8MZNk0n7HeW37O4YrVGCF4wzgQjp+akPAkfUK5LZ6KuR/6sqeAVuXHji+RzQgOn5A==", + "dev": true, + "bin": { + "husky": "bin.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, "node_modules/idb": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz", @@ -4983,6 +5188,174 @@ "dev": true, "license": "MIT" }, + "node_modules/lint-staged": { + "version": "15.2.10", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.10.tgz", + "integrity": "sha512-5dY5t743e1byO19P9I4b3x8HJwalIznL5E1FWYnU6OWw33KxNBSLAc6Cy7F2PsFEO8FKnLwjwm5hx7aMF0jzZg==", + "dev": true, + "dependencies": { + "chalk": "~5.3.0", + "commander": "~12.1.0", + "debug": "~4.3.6", + "execa": "~8.0.1", + "lilconfig": "~3.1.2", + "listr2": "~8.2.4", + "micromatch": "~4.0.8", + "pidtree": "~0.6.0", + "string-argv": "~0.3.2", + "yaml": "~2.5.0" + }, + "bin": { + "lint-staged": "bin/lint-staged.js" + }, + "engines": { + "node": ">=18.12.0" + }, + "funding": { + "url": "https://opencollective.com/lint-staged" + } + }, + "node_modules/lint-staged/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "dev": true, + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/lint-staged/node_modules/commander": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/lint-staged/node_modules/lilconfig": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.2.tgz", + "integrity": "sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, + "node_modules/lint-staged/node_modules/yaml": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.1.tgz", + "integrity": "sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==", + "dev": true, + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/listr2": { + "version": "8.2.5", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.2.5.tgz", + "integrity": "sha512-iyAZCeyD+c1gPyE9qpFu8af0Y+MRtmKOncdGoA2S5EY8iFq99dmmvkNnHiWo+pj0s7yH7l3KPIgee77tKpXPWQ==", + "dev": true, + "dependencies": { + "cli-truncate": "^4.0.0", + "colorette": "^2.0.20", + "eventemitter3": "^5.0.1", + "log-update": "^6.1.0", + "rfdc": "^1.4.1", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/listr2/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/listr2/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/listr2/node_modules/emoji-regex": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", + "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", + "dev": true + }, + "node_modules/listr2/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/listr2/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/listr2/node_modules/wrap-ansi": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", + "integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -5060,6 +5433,135 @@ "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", "license": "MIT" }, + "node_modules/log-update": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz", + "integrity": "sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==", + "dev": true, + "dependencies": { + "ansi-escapes": "^7.0.0", + "cli-cursor": "^5.0.0", + "slice-ansi": "^7.1.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/log-update/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-update/node_modules/emoji-regex": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", + "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", + "dev": true + }, + "node_modules/log-update/node_modules/is-fullwidth-code-point": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.0.0.tgz", + "integrity": "sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==", + "dev": true, + "dependencies": { + "get-east-asian-width": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/slice-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.0.tgz", + "integrity": "sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.2.1", + "is-fullwidth-code-point": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/log-update/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/log-update/node_modules/wrap-ansi": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", + "integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/long": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", @@ -5107,6 +5609,12 @@ "node": ">=10" } }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -5167,6 +5675,30 @@ "node": ">= 0.6" } }, + "node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mimic-function": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", + "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -5361,6 +5893,33 @@ "node": ">=0.10.0" } }, + "node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -5500,6 +6059,21 @@ "wrappy": "1" } }, + "node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", @@ -5636,6 +6210,18 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pidtree": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.6.0.tgz", + "integrity": "sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==", + "dev": true, + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", @@ -6092,6 +6678,37 @@ "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" } }, + "node_modules/restore-cursor": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", + "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", + "dev": true, + "dependencies": { + "onetime": "^7.0.0", + "signal-exit": "^4.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/restore-cursor/node_modules/onetime": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", + "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", + "dev": true, + "dependencies": { + "mimic-function": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/retry": { "version": "0.13.1", "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", @@ -6128,6 +6745,12 @@ "node": ">=0.10.0" } }, + "node_modules/rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", + "dev": true + }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -6358,6 +6981,46 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/slice-ansi": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", + "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.0.0", + "is-fullwidth-code-point": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", + "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/source-map-js": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", @@ -6402,6 +7065,15 @@ "safe-buffer": "~5.2.0" } }, + "node_modules/string-argv": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", + "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", + "dev": true, + "engines": { + "node": ">=0.6.19" + } + }, "node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", @@ -6613,6 +7285,18 @@ "node": ">=4" } }, + "node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", diff --git a/task_yell/package.json b/task_yell/package.json index d22b8da..cd35d0d 100644 --- a/task_yell/package.json +++ b/task_yell/package.json @@ -24,6 +24,8 @@ "eslint": "^8", "eslint-config-next": "14.2.15", "eslint-config-prettier": "^9.1.0", + "husky": "^9.1.6", + "lint-staged": "^15.2.10", "postcss": "^8", "prettier": "^3.3.3", "tailwindcss": "^3.4.1", From 7848ca8f5ea3c1c2d6b0e5310e2fc048b466273a Mon Sep 17 00:00:00 2001 From: gohan5858 <88976739+gohan5858@users.noreply.github.com> Date: Sat, 26 Oct 2024 14:02:17 +0900 Subject: [PATCH 07/17] chore: Add lint-staged for pre-commit linting --- task_yell/package.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/task_yell/package.json b/task_yell/package.json index cd35d0d..0945901 100644 --- a/task_yell/package.json +++ b/task_yell/package.json @@ -10,6 +10,12 @@ "format": "prettier --write --ignore-path .gitignore './**/*.{js,jsx,ts,tsx,json}'", "format:check": "prettier --check --ignore-path .gitignore './**/*.{js,jsx,ts,tsx,json}'" }, + "lint-staged": { + "*.{js,jsx,ts,tsx,json}": [ + "next lint --fix", + "prettier --write --ignore-path .gitignore './**/*.{js,jsx,ts,tsx,json}'" + ] + }, "dependencies": { "firebase": "^11.0.1", "firebase-admin": "^12.7.0", From 023d63018331fa8bb62659bbf964b5997599a3de Mon Sep 17 00:00:00 2001 From: gohan5858 <88976739+gohan5858@users.noreply.github.com> Date: Sat, 26 Oct 2024 14:12:05 +0900 Subject: [PATCH 08/17] chore: Add lint:fix script for automatic lint fixing --- task_yell/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/task_yell/package.json b/task_yell/package.json index c19fe83..cf7cc7d 100644 --- a/task_yell/package.json +++ b/task_yell/package.json @@ -8,6 +8,7 @@ "build": "next build", "start": "next start", "lint": "next lint", + "lint:fix": "next lint --fix", "format": "prettier --write --ignore-path .gitignore './**/*.{js,jsx,ts,tsx,json}'", "format:check": "prettier --check --ignore-path .gitignore './**/*.{js,jsx,ts,tsx,json}'" }, From 2d2f68f3fbc96c76b530c2f884a969b587fd57ff Mon Sep 17 00:00:00 2001 From: gohan5858 <88976739+gohan5858@users.noreply.github.com> Date: Sat, 26 Oct 2024 14:30:36 +0900 Subject: [PATCH 09/17] chore: Add lint and format job for automatic linting and formatting --- .github/workflows/ci.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 073b4f4..3d386b8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,7 +9,29 @@ env: on: push jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: 18 + check-latest: true + + - name: Install dependencies + run: npm install + + - name: Run ESLint + run: npm run lint + + - name: Run Prettier + run: npm run format:check + preview: + needs: lint if: ${{ github.ref != 'refs/heads/main' }} runs-on: ubuntu-latest environment: @@ -45,6 +67,7 @@ jobs: run: vercel alias ${{ steps.deploy.outputs.url }} stg.my-service.com --scope=my-team --token=${{ secrets.VERCEL_TOKEN }} prod: + needs: lint if: ${{ github.ref == 'refs/heads/main' }} runs-on: ubuntu-latest steps: From 1822f7c6604e72f8926f4d2516a73c163f53f72a Mon Sep 17 00:00:00 2001 From: gohan5858 <88976739+gohan5858@users.noreply.github.com> Date: Sat, 26 Oct 2024 14:43:11 +0900 Subject: [PATCH 10/17] =?UTF-8?q?fix:=20task=5Fyell=E3=81=ABcd=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F=E3=81=AE?= =?UTF-8?q?=E3=81=A7=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3d386b8..64a612a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,6 +21,9 @@ jobs: node-version: 18 check-latest: true + - name: Mv directory + run: cd ./task_yell + - name: Install dependencies run: npm install From b198efdcce775f8f24d0c28229f844b8f0433ad4 Mon Sep 17 00:00:00 2001 From: gohan5858 <88976739+gohan5858@users.noreply.github.com> Date: Sat, 26 Oct 2024 14:47:41 +0900 Subject: [PATCH 11/17] =?UTF-8?q?fix:=20mv=E3=81=99=E3=82=8B=E3=82=BF?= =?UTF-8?q?=E3=82=A4=E3=83=9F=E3=83=B3=E3=82=B0=E3=82=92=E9=96=93=E9=81=95?= =?UTF-8?q?=E3=81=88=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=81=A7=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 64a612a..117b4f6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -49,12 +49,12 @@ jobs: node-version: 18 check-latest: true - - name: Install Vercel CLI - run: npm install --global vercel@latest - - name: Mv directory run: cd ./task_yell + - name: Install Vercel CLI + run: npm install --global vercel@latest + - name: Pull Vercel Environment Information run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} From 7b9170d4f90a3eaa61b20f65061d153c5a37d610 Mon Sep 17 00:00:00 2001 From: gohan5858 <88976739+gohan5858@users.noreply.github.com> Date: Sat, 26 Oct 2024 14:57:38 +0900 Subject: [PATCH 12/17] =?UTF-8?q?chore:=20debug=E7=94=A8=E3=83=AD=E3=82=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 117b4f6..d831843 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -86,7 +86,10 @@ jobs: run: npm install --global vercel@latest - name: Mv directory - run: cd ./task_yell + run: | + tree + cd ./task_yell + tree - name: Pull Vercel Environment Information run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} From 0feb3fa53e2f9273ad875ac059e02bc0ffab70a5 Mon Sep 17 00:00:00 2001 From: gohan5858 <88976739+gohan5858@users.noreply.github.com> Date: Sat, 26 Oct 2024 15:00:53 +0900 Subject: [PATCH 13/17] =?UTF-8?q?fix:=20debug=E7=94=A8=E3=83=AD=E3=82=B0?= =?UTF-8?q?=E3=82=92=E5=B7=AE=E3=81=97=E8=BE=BC=E3=82=80=E5=A0=B4=E6=89=80?= =?UTF-8?q?=E3=82=92=E9=96=93=E9=81=95=E3=81=88=E3=81=A6=E3=81=84=E3=81=9F?= =?UTF-8?q?=E3=81=AE=E3=81=A7=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d831843..0791ddc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -22,7 +22,10 @@ jobs: check-latest: true - name: Mv directory - run: cd ./task_yell + run: | + tree + cd ./task_yell + tree - name: Install dependencies run: npm install @@ -86,10 +89,7 @@ jobs: run: npm install --global vercel@latest - name: Mv directory - run: | - tree - cd ./task_yell - tree + run: cd ./task_yell - name: Pull Vercel Environment Information run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} From cc8dbf3dfa5823a34e6b6f20eb6abe2fd23e4621 Mon Sep 17 00:00:00 2001 From: gohan5858 <88976739+gohan5858@users.noreply.github.com> Date: Sat, 26 Oct 2024 15:05:48 +0900 Subject: [PATCH 14/17] =?UTF-8?q?change:=20checkout@v3=E3=81=8C=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E3=81=A8=E3=81=84=E3=81=86=E6=83=85=E5=A0=B1=E3=81=8C?= =?UTF-8?q?=E3=81=82=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=A7checkout@v4?= =?UTF-8?q?=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0791ddc..a206dd4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup node uses: actions/setup-node@v3 From 982acad3b76ada61f2e76a99b1f74c64abb13dae Mon Sep 17 00:00:00 2001 From: gohan5858 <88976739+gohan5858@users.noreply.github.com> Date: Sat, 26 Oct 2024 15:08:32 +0900 Subject: [PATCH 15/17] =?UTF-8?q?change:=20cd=E3=81=A7=E3=81=AF=E3=81=AA?= =?UTF-8?q?=E3=81=8F=E3=83=87=E3=83=95=E3=82=A9=E3=83=AB=E3=83=88=E3=81=AE?= =?UTF-8?q?working-directory=E3=81=A7=E6=8C=87=E5=AE=9A=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yaml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a206dd4..9e1305c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,6 +11,9 @@ on: push jobs: lint: runs-on: ubuntu-latest + defaults: + run: + working-directory: task_yell steps: - name: Checkout code uses: actions/checkout@v4 @@ -21,12 +24,6 @@ jobs: node-version: 18 check-latest: true - - name: Mv directory - run: | - tree - cd ./task_yell - tree - - name: Install dependencies run: npm install From 4cf14b8eb2561cf69cc2dbd0a096d8589ba7df87 Mon Sep 17 00:00:00 2001 From: gohan5858 <88976739+gohan5858@users.noreply.github.com> Date: Sat, 26 Oct 2024 15:11:33 +0900 Subject: [PATCH 16/17] chore: npm run format --- task_yell/src/components/sign-in-button.tsx | 28 +++++++++++---------- task_yell/src/firebase/auth.ts | 2 +- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/task_yell/src/components/sign-in-button.tsx b/task_yell/src/components/sign-in-button.tsx index ae274a7..5c76e3f 100644 --- a/task_yell/src/components/sign-in-button.tsx +++ b/task_yell/src/components/sign-in-button.tsx @@ -26,24 +26,24 @@ function useUserSession() { useEffect(() => { const unsubscribe = onAuthStateChanged((authUser) => { - setUser(authUser) - }) + setUser(authUser); + }); - return () => unsubscribe() + return () => unsubscribe(); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); useEffect(() => { onAuthStateChanged((authUser) => { - if (user === undefined) return + if (user === undefined) return; // refresh when user changed to ease testing if (user?.email !== authUser?.email) { - router.refresh() + router.refresh(); } - }) + }); // eslint-disable-next-line react-hooks/exhaustive-deps - }, [user, router.refresh]) + }, [user, router.refresh]); return user; } @@ -55,15 +55,17 @@ export function SignInButton() { await signInWithPopup(auth, provider); }, []); const handleSignOut = useCallback(async () => { - console.log("signing out") + console.log("signing out"); await auth.signOut(); }, []); - return !user ? - () : ( + ) : ( + - ) -} \ No newline at end of file + ); +} diff --git a/task_yell/src/firebase/auth.ts b/task_yell/src/firebase/auth.ts index e767709..d074588 100644 --- a/task_yell/src/firebase/auth.ts +++ b/task_yell/src/firebase/auth.ts @@ -28,4 +28,4 @@ export async function signOut() { } catch (error) { console.error("Error signing out with Google", error); } -} \ No newline at end of file +} From 0e1cf2596c445c7bf70649096f544d6a77449fbc Mon Sep 17 00:00:00 2001 From: Yuto Terada Date: Sat, 26 Oct 2024 15:20:28 +0900 Subject: [PATCH 17/17] =?UTF-8?q?=E3=83=97=E3=83=83=E3=82=B7=E3=83=A5?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E3=81=AE=E5=87=A6=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- firebase/functions/src/index.ts | 46 ++++++++++++++++++++++++++++++--- task_yell/src/lib/types.ts | 3 ++- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/firebase/functions/src/index.ts b/firebase/functions/src/index.ts index 88cab58..d3c9c67 100644 --- a/firebase/functions/src/index.ts +++ b/firebase/functions/src/index.ts @@ -7,13 +7,53 @@ * See a full list of supported triggers at https://firebase.google.com/docs/functions */ -import {onRequest} from "firebase-functions/v2/https"; +import { onRequest } from "firebase-functions/v2/https"; +import * as functions from "firebase-functions/v2"; import * as logger from "firebase-functions/logger"; - +import * as admin from "firebase-admin"; +import type { DocumentReference } from "firebase-admin/firestore"; // Start writing functions // https://firebase.google.com/docs/functions/typescript +admin.initializeApp(); + export const helloWorld = onRequest((request, response) => { - logger.info("Hello logs!", {structuredData: true}); + logger.info("Hello logs!", { structuredData: true }); response.send("Hello from Firebase!"); }); + +export const pushNotification = functions.scheduler + .onSchedule("every 1 minutes", async () => { + const now = (() => { + let s = admin.firestore.Timestamp.now().seconds + s = s - s % 60 + return new admin.firestore.Timestamp(s, 0) + })() + // リマインダーコレクションから現在時刻のリマインダーをクエリ + const db = admin.firestore() + const notifications = await Promise.all((await db.collection('notifications') + .where('datetime', '==', now) + .where("type", "==", "push") + .get()) + .docs + .map(async doc => { + const event = await (doc.get("eventOrTaskRef") as DocumentReference).get(); + const tokens = await db.collection("users").doc(doc.get("userId")).get().then(doc => doc.get("fcm-tokens")) as string[]; + return { + title: event.get("title"), + description: event.get("description"), + tokens + } + })); + + const messaging = admin.messaging(); + for (const notification of notifications) { + await messaging.sendEachForMulticast({ + tokens: notification.tokens, + notification: { + title: notification.title, + body: notification.description + } + }) + } + }); diff --git a/task_yell/src/lib/types.ts b/task_yell/src/lib/types.ts index 7fb6330..25b0f32 100644 --- a/task_yell/src/lib/types.ts +++ b/task_yell/src/lib/types.ts @@ -7,10 +7,11 @@ export interface Event { importance: "high" | "medium" | "low"; location: FirebaseFirestore.GeoPoint; reccurence: string[]; - notifications: Notification[]; } export interface Notification { datetime: Date; type: "call" | "push"; + eventOrTaskRef: string; + userId: string; } \ No newline at end of file