diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7ec9b28 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,33 @@ +name: CI +on: + pull_request: + branches: [main] + +jobs: + ci: + name: CI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: nixbuild/nix-quick-install-action@v34 + - uses: nix-community/cache-nix-action@v7 + with: + primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }} + restore-prefixes-first-match: nix-${{ runner.os }}- + gc-max-store-size-linux: 1G + purge: true + purge-prefixes: nix-${{ runner.os }}- + purge-created: 0 + purge-last-accessed: P1DT12H + purge-primary-key: never + - name: Install dependencies + run: nix develop -c bun install + + - name: Lint code + run: nix develop -c bun run lint + + - name: Format code + run: nix develop -c bun run format + + - name: Build project + run: nix develop -c bun run build diff --git a/bun.lock b/bun.lock index 925d676..1eceef5 100644 --- a/bun.lock +++ b/bun.lock @@ -21,7 +21,7 @@ "@unocss/astro": "66.6.7", "astro": "^6.1.3", "astro-llms-generate": "1.3.3", - "hono": "4.12.10", + "hono": "catalog:", "prettier-plugin-vue": "1.1.6", "sharp": "0.34.5", "unocss": "66.6.7", @@ -49,7 +49,7 @@ "name": "server", "dependencies": { "@hono/valibot-validator": "0.6.1", - "hono": "4.12.10", + "hono": "catalog:", "mimetext": "3.0.28", "ts-ics": "2.4.3", "valibot": "1.3.1", @@ -59,6 +59,9 @@ }, }, }, + "catalog": { + "hono": "4.12.10", + }, "packages": { "@antfu/install-pkg": ["@antfu/install-pkg@1.1.0", "", { "dependencies": { "package-manager-detector": "^1.3.0", "tinyexec": "^1.0.1" } }, "sha512-MGQsmw10ZyI+EJo45CdSER4zEb+p31LpDAFp2Z3gkSd1yqVZGi0Ebx++YTEMonJy4oChEMLsxZ64j8FH6sSqtQ=="], diff --git a/client/package.json b/client/package.json index ef77dfc..306c124 100644 --- a/client/package.json +++ b/client/package.json @@ -22,7 +22,7 @@ "@unocss/astro": "66.6.7", "astro": "^6.1.3", "astro-llms-generate": "1.3.3", - "hono": "4.12.10", + "hono": "catalog:", "prettier-plugin-vue": "1.1.6", "sharp": "0.34.5", "unocss": "66.6.7", diff --git a/client/src/components/breadcrumb.astro b/client/src/components/Breadcrumb.astro similarity index 100% rename from client/src/components/breadcrumb.astro rename to client/src/components/Breadcrumb.astro diff --git a/client/src/components/CalendarListSkeleton.vue b/client/src/components/CalendarListSkeleton.vue index 2fbb5f5..9d58576 100644 --- a/client/src/components/CalendarListSkeleton.vue +++ b/client/src/components/CalendarListSkeleton.vue @@ -7,7 +7,7 @@ const props = defineProps<{ // 0から7までの配列 const skeletonItems = Array.from({ length: 8 }, (_, i) => i); -const exitStates = ref(new Array(8).fill(false)); +const exitStates = ref(Array.from({ length: 8 }, () => false)); const isFullyExited = ref(false); watch( diff --git a/client/src/components/footer.astro b/client/src/components/Footer.astro similarity index 100% rename from client/src/components/footer.astro rename to client/src/components/Footer.astro diff --git a/client/src/components/frame.astro b/client/src/components/Frame.astro similarity index 100% rename from client/src/components/frame.astro rename to client/src/components/Frame.astro diff --git a/client/src/components/head.astro b/client/src/components/Head.astro similarity index 100% rename from client/src/components/head.astro rename to client/src/components/Head.astro diff --git a/client/src/components/header.astro b/client/src/components/Header.astro similarity index 94% rename from client/src/components/header.astro rename to client/src/components/Header.astro index 6ccc469..0c7f6d7 100644 --- a/client/src/components/header.astro +++ b/client/src/components/Header.astro @@ -1,5 +1,5 @@ --- -import Sidebar from "./sidebar.astro"; +import Sidebar from "./Sidebar.astro"; import favicon from "../../public/favicon.svg"; import { Image } from "astro:assets"; --- diff --git a/client/src/components/sidebar.astro b/client/src/components/Sidebar.astro similarity index 100% rename from client/src/components/sidebar.astro rename to client/src/components/Sidebar.astro diff --git a/client/src/layouts/Layout.astro b/client/src/layouts/Layout.astro index e3f16f5..ae17336 100644 --- a/client/src/layouts/Layout.astro +++ b/client/src/layouts/Layout.astro @@ -1,8 +1,8 @@ --- -import Footer from "@/components/footer.astro"; -import Head from "@/components/head.astro"; -import Header from "@/components/header.astro"; -import Breadcrumb from "@/components/breadcrumb.astro"; +import Footer from "@/components/Footer.astro"; +import Head from "@/components/Head.astro"; +import Header from "@/components/Header.astro"; +import Breadcrumb from "@/components/Breadcrumb.astro"; import "@/styles/global.css"; diff --git a/client/src/pages/access.mdx b/client/src/pages/access.mdx index 0bfd558..b700db5 100644 --- a/client/src/pages/access.mdx +++ b/client/src/pages/access.mdx @@ -4,7 +4,7 @@ title: 稽古場所 description: 大阪公立大学合氣道部の活動場所について --- -import Frame from "../components/frame.astro"; +import Frame from "../components/Frame.astro"; import { Image } from "astro:assets"; import multi_use_room from "../assets/CCCB5965-798F-4403-A4D9-60C3B3EA05A9.png"; diff --git a/client/src/pages/contact.astro b/client/src/pages/contact.astro index a2432a7..813a52f 100644 --- a/client/src/pages/contact.astro +++ b/client/src/pages/contact.astro @@ -1,5 +1,5 @@ --- -import ContactForm from "@/components/contactForm.vue"; +import ContactForm from "@/components/ContactForm.vue"; import Layout from "@/layouts/Layout.astro"; --- diff --git a/flake.lock b/flake.lock index cea29ec..9fbd13c 100644 --- a/flake.lock +++ b/flake.lock @@ -1,30 +1,12 @@ { "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1775126147, - "narHash": "sha256-J0dZU4atgcfo4QvM9D92uQ0Oe1eLTxBVXjJzdEMQpD0=", + "lastModified": 1775403759, + "narHash": "sha256-cGyKiTspHEUx3QwAnV3RfyT+VOXhHLs+NEr17HU34Wo=", "owner": "nixos", "repo": "nixpkgs", - "rev": "8d8c1fa5b412c223ffa47410867813290cdedfef", + "rev": "5e11f7acce6c3469bef9df154d78534fa7ae8b6c", "type": "github" }, "original": { @@ -36,24 +18,8 @@ }, "root": { "inputs": { - "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 6e0b9c8..3995ae0 100644 --- a/flake.nix +++ b/flake.nix @@ -1,26 +1,31 @@ { inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; - flake-utils.url = "github:numtide/flake-utils"; }; - outputs = { - nixpkgs, - flake-utils, - ... - }: - flake-utils.lib.eachDefaultSystem ( - system: let - pkgs = import nixpkgs {inherit system;}; - in { - devShell = pkgs.mkShell { - buildInputs = with pkgs; [ - bun - nodejs-slim_24 - ]; - shellWrapper = pkgs.writeShellScript "dev-shell" '' - exec ${pkgs.zsh}/bin/zsh \"$@\" - ''; - }; - } - ); -} \ No newline at end of file + outputs = {nixpkgs, ...}: let + systems = ["x86_64-linux" "aarch64-darwin"]; + forAllSystems = nixpkgs.lib.genAttrs systems; + + deps = pkgs: + with pkgs; [ + nodejs-slim_24 + ]; + + devDeps = pkgs: + with pkgs; [ + bun + ]; + in { + devShells = forAllSystems (system: let + pkgs = import nixpkgs {inherit system;}; + in { + default = pkgs.mkShell { + buildInputs = (deps pkgs) ++ (devDeps pkgs); + + shellHook = '' + export NODE_ENV=development + ''; + }; + }); + }; +} diff --git a/package.json b/package.json index e2d8e9d..ad0a393 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,14 @@ { "name": "page", - "workspaces": [ - "client", - "worker" - ], + "workspaces": { + "packages": [ + "client", + "worker" + ], + "catalog": { + "hono": "4.12.10" + } + }, "scripts": { "build": "bunx turbo build", "dev": "bunx turbo dev", @@ -11,7 +16,7 @@ "format": "bunx turbo format", "lint": "bunx turbo lint", "outdated": "bunx turbo outdated", - "cf-typegen":"wrangler types ./client/worker-configuration.d.ts" + "cf-typegen": "wrangler types ./client/worker-configuration.d.ts" }, "devDependencies": { "oxfmt": "latest", diff --git a/worker/package.json b/worker/package.json index a1d1fff..a42aee8 100644 --- a/worker/package.json +++ b/worker/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@hono/valibot-validator": "0.6.1", - "hono": "4.12.10", + "hono": "catalog:", "mimetext": "3.0.28", "ts-ics": "2.4.3", "valibot": "1.3.1"