yamori

有給休暇計算を主目的とした簡易勤怠管理システム

Commits at e43772a17f98367bfa5c78a052f15dd5bdd77b17

  1. e43772a1 check スクリプトを追加 型といったコードのプログラム的正当性を検査するためのコマンド。 Shota FUJI authored at Shota FUJI comitted at
  2. 3c38b9fe gui: ワークスペース一覧取得エラー時の UI Shota FUJI authored at Shota FUJI comitted at
  3. 5aa86a97 gui: 無効になったコードコメントの削除 Shota FUJI authored at Shota FUJI comitted at
  4. 0f33c4ed gui: コールアウトコンポーネント エラー表示なんかに必要なため。 Shota FUJI authored at Shota FUJI comitted at
  5. 5c9a9a0c gui: 読み込まれる CSS についてのドキュメントを作成 いちいち CSS ファイルを読み返すのは大変なので。 色とか文字組みに関しては気力が尽きたのでこのコミットには含まれず。 Shota FUJI authored at Shota FUJI comitted at
  6. 4a746bec gui: workspace.v1.ListResponse 表示 UI Protobuf のデータを受け取って表示する UI のサンプルとして実装。 そのため、足りない状態があったりエラー時の表示がテキストだけ だったりする。 Shota FUJI authored at Shota FUJI comitted at
  7. 20ed274b gui: Component という言葉の利用を限定 UI 要素の区分としても利用しているため、安易に使わないようにする。 Shota FUJI authored at Shota FUJI comitted at
  8. 6ce9c7b3 pwa: gui パッケージを導入 そもそも以前のコミットで gui パッケージが TypeScript のコンパイラバグ のせいでビルドできなくなってたり、 CustomElement として利用できな かったり (何故 Astro 上では見れていたのかは不明) していた。 なので gui 側にもちょこちょこ変更を加えている。 Shota FUJI authored at Shota FUJI comitted at
  9. 00903224 gui: <script> タグ内のインデントを一時的に廃止 markup_fmt のバグで最初の行以外インデントが効かない。 インデントがないよりも醜く見にくいためバグが直るまで インデントはかけない。 Shota FUJI authored at Shota FUJI comitted at
  10. e5c0a2b8 gui: カタログでナビゲーションが見切れるのを修正 メインが長いとナビゲーションも一緒に飛んでっちゃう。 Shota FUJI authored at Shota FUJI comitted at
  11. d8c21d6b gui: ボタンコンポーネント 必ず必要になるため。 リンクに使えるように Light DOM 仕様にしてもよかったが、 使い勝手を考えるとやはりゴリゴリと書いた単体完結のビルトイン 置き換え要素が良い。 Form の submit なんかが必要になったら `submit` 属性とかを 追加する必要はあるだろうが、現状の想定ではこれで十分。 Shota FUJI authored at Shota FUJI comitted at
  12. da8efd2d gui: スタイルガイドを Astro に変更 Vite の Multi-Page Application の DX が著しく低いため。 Astro も HTML やらモジュール周りでかなり酷いが、それでも Vite で 素の HTML を何枚も書くよりはかなりまし。 Shota FUJI authored at Shota FUJI comitted at
  13. 8de886de gui: 共有コンポーネントパッケージ 含まれているボタンコンポーネントはあくまでサンプル用で、挙動や I/F は 最終的に利用されるものとは異なる。 Shota FUJI authored at Shota FUJI comitted at
  14. dfeb6072 pwa: Gleam でワーカーの起動からリクエストまでを行う どんなものか見たかったため。正直 protobuf から生成された TS の 型定義やランタイムの検査結果を全部捨てるのは勿体ない気がする。 Gleam の protobuf コード生成も含めて方針は要検討。 Shota FUJI authored at Shota FUJI comitted at
  15. 656e5a34 pwa: パスエイリアスを設定 Gleam の JS 出力は未だに完全ではなく、 `build/` ファイルにそのまま 必要そうなファイルと一緒に出力するしかない。その結果、他のファイルを import したり、特に `src/` 直下以外から import しようとするとパスが ズレて import できない、といった問題に溢れている。 そのため、現状ではエイリアスを使って絶対パスに解決させるのが一番安全で 安定しているといえる。 Shota FUJI authored at Shota FUJI comitted at
  16. 43dab7ce pwa: Gleam の導入 流石に TypeScript で UI 書くのは論外なので。 ただ、どこまでを Gleam で書くのか、どのようなスタイルにするのかと いった部分は全く決まっていない。 Shota FUJI authored at Shota FUJI comitted at
  17. 54856622 pwa: サービスオブジェクトを参照しない @bufbuild/protobuf の生成するサービスオブジェクトはかなりファットで ランタイムなのに色々詰め込みまくっている。そのため、特に将来的に バンドルサイズに影響が出てくるので必要なメソッドのリクエスト・ レスポンスメッセージを適宜読み込む形にした。 サービスオブジェクトはそのままの JS オブジェクトで、プロパティとして スキーマやらが色々生えている。そのため、 Tree Shaking が効かない。 サービスオブジェクトを使った場合のサイズは、 ``` $ vite build vite v6.0.2 building for production... ✓ 78 modules transformed. ../dist/index.html 0.45 kB │ gzip: 0.30 kB ../dist/assets/main-DJ9_Th8G.js 78.27 kB ../dist/assets/index-DsgyLhcA.js 72.82 kB │ gzip: 19.64 kB ✓ built in 366ms ``` 使わなかった場合のサイズは、 ``` $ vite build vite v6.0.2 building for production... ✓ 67 modules transformed. ../dist/index.html 0.45 kB │ gzip: 0.30 kB ../dist/assets/main-MP79NseV.js 78.26 kB ../dist/assets/index-iIdyv0Db.js 68.83 kB │ gzip: 18.42 kB ✓ built in 359ms ``` と現状のコンパクトなサービスでもかなり違ってくる。 クライアントからのメソッド呼び出しや GUI のコードなんかが入って くるとサイズとしては誤差になるのかもしれないが、削れるのであれば 削りたい。 Shota FUJI authored at Shota FUJI comitted at
  18. 5e79853a pwa: ワークスペースの削除メソッド Shota FUJI authored at Shota FUJI comitted at
  19. d1ab1038 pwa: IDB のトランザクション終了を待つ 多分読み切ってるし問題はないと思うけど、一応ね。 Shota FUJI authored at Shota FUJI comitted at
  20. 842d1edd pwa: ワークスペースの更新メソッド Shota FUJI authored at Shota FUJI comitted at
  21. 973cf4b3 pwa: ライブラリの型エラーを tsc 実行時に無視する どうやら TypeScript の型定義と bun の型定義がバトってるみたい。 こんな感じで正直触る気がしないので無視することにした。 ``` bunx tsc ../../node_modules/@types/node/buffer.d.ts:632:19 - error TS2430: Interface 'Buffer' incorrectly extends interface 'Uint8Array<ArrayBufferLike>'. The types of 'slice(...).buffer' are incompatible between these types. Type 'ArrayBufferLike' is not assignable to type 'ArrayBuffer'. Type 'SharedArrayBuffer' is missing the following properties from type 'ArrayBuffer': resizable, resize, detached, transfer, transferToFixedLength 632 interface Buffer extends Uint8Array { ~~~~~~ ../../node_modules/@types/node/fs/promises.d.ts:56:66 - error TS2344: Type 'Buffer' does not satisfy the constraint 'ArrayBufferView'. Type 'Buffer' is not assignable to type 'Uint8Array<ArrayBufferLike> | DataView<ArrayBufferLike>'. Type 'Buffer' is not assignable to type 'Uint8Array<ArrayBufferLike>'. The types of 'slice(...).buffer' are incompatible between these types. Type 'ArrayBufferLike' is not assignable to type 'ArrayBuffer'. Type 'SharedArrayBuffer' is missing the following properties from type 'ArrayBuffer': resizable, resize, detached, transfer, transferToFixedLength 56 interface FileReadOptions<T extends NodeJS.ArrayBufferView = Buffer> { ~~~~~~ ../../node_modules/@types/node/fs/promises.d.ts:238:49 - error TS2344: Type 'Buffer' does not satisfy the constraint 'ArrayBufferView'. Type 'Buffer' is not assignable to type 'Uint8Array<ArrayBufferLike> | DataView<ArrayBufferLike>'. Type 'Buffer' is not assignable to type 'Uint8Array<ArrayBufferLike>'. The types of 'slice(...).buffer' are incompatible between these types. Type 'ArrayBufferLike' is not assignable to type 'ArrayBuffer'. Type 'SharedArrayBuffer' is missing the following properties from type 'ArrayBuffer': resizable, resize, detached, transfer, transferToFixedLength 238 read<T extends NodeJS.ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>; ~~~~~~ ../../node_modules/@types/node/globals.d.ts:370:14 - error TS2300: Duplicate identifier 'fetch'. 370 function fetch( ~~~~~ ../../node_modules/bun-types/globals.d.ts:1037:6 1037 var fetch: Fetch; ~~~~~ 'fetch' was also declared here. ../../node_modules/@types/node/module.d.ts:283:13 - error TS2687: All declarations of 'dirname' must have identical modifiers. 283 dirname: string; ~~~~~~~ ../../node_modules/@types/node/module.d.ts:289:13 - error TS2687: All declarations of 'filename' must have identical modifiers. 289 filename: string; ~~~~~~~~ ../../node_modules/bun-types/bun.d.ts:117:8 - error TS2420: Class 'ShellError' incorrectly implements interface 'ShellOutput'. Property 'bytes' is missing in type 'ShellError' but required in type 'ShellOutput'. 117 class ShellError extends Error implements ShellOutput { ~~~~~~~~~~ ../../node_modules/bun-types/bun.d.ts:434:3 434 bytes(): Uint8Array; ~~~~~~~~~~~~~~~~~~~~ 'bytes' is declared here. ../../node_modules/bun-types/globals.d.ts:1037:6 - error TS2300: Duplicate identifier 'fetch'. 1037 var fetch: Fetch; ~~~~~ ../../node_modules/typescript/lib/lib.dom.d.ts:28708:18 28708 declare function fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>; ~~~~~ 'fetch' was also declared here. ../../node_modules/@types/node/globals.d.ts:370:14 370 function fetch( ~~~~~ and here. ../../node_modules/bun-types/globals.d.ts:1947:12 - error TS2687: All declarations of 'dirname' must have identical modifiers. 1947 readonly dirname: string; ~~~~~~~ ../../node_modules/bun-types/globals.d.ts:1950:12 - error TS2687: All declarations of 'filename' must have identical modifiers. 1950 readonly filename: string; ~~~~~~~~ ../../node_modules/bun-types/overrides.d.ts:3:29 - error TS2305: Module '"bun"' has no exported member 'PathLike'. 3 import type { BunFile, Env, PathLike } from "bun"; ~~~~~~~~ ../../node_modules/typescript/lib/lib.dom.d.ts:16004:11 - error TS2430: Interface 'MessageEvent<T>' incorrectly extends interface 'Bun.MessageEvent<T>'. Types of property 'ports' are incompatible. Type 'readonly MessagePort[]' is not assignable to type 'readonly import("worker_threads").MessagePort[]'. Type 'MessagePort' is missing the following properties from type 'MessagePort': ref, unref, addListener, emit, and 13 more. 16004 interface MessageEvent<T = any> extends Event { ~~~~~~~~~~~~ ../../node_modules/typescript/lib/lib.dom.d.ts:26068:11 - error TS2430: Interface 'WebSocket' incorrectly extends interface 'import("<repo path>/node_modules/@types/ws/index").WebSocket'. Types of property 'binaryType' are incompatible. Type 'BinaryType' is not assignable to type '"arraybuffer" | "nodebuffer" | "fragments"'. Type '"blob"' is not assignable to type '"arraybuffer" | "nodebuffer" | "fragments"'. 26068 interface WebSocket extends EventTarget { ~~~~~~~~~ ../../node_modules/typescript/lib/lib.dom.d.ts:28708:18 - error TS2300: Duplicate identifier 'fetch'. 28708 declare function fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>; ~~~~~ ../../node_modules/bun-types/globals.d.ts:1037:6 1037 var fetch: Fetch; ~~~~~ 'fetch' was also declared here. Found 14 errors in 8 files. Errors Files 1 ../../node_modules/@types/node/buffer.d.ts:632 2 ../../node_modules/@types/node/fs/promises.d.ts:56 1 ../../node_modules/@types/node/globals.d.ts:370 2 ../../node_modules/@types/node/module.d.ts:283 1 ../../node_modules/bun-types/bun.d.ts:117 3 ../../node_modules/bun-types/globals.d.ts:1037 1 ../../node_modules/bun-types/overrides.d.ts:3 3 ../../node_modules/typescript/lib/lib.dom.d.ts:16004 ``` Shota FUJI authored at Shota FUJI comitted at
  22. 63fd0dd8 pwa: Worker が Rollup でビルドできない問題の修正 top-level await のあれ。 Shota FUJI authored at Shota FUJI comitted at
  23. 22ec9e8f proto: ワークスペース削除・更新メソッド 必要だから。UI実装時にこれがないと勢いが削がれて萎える。 Shota FUJI authored at Shota FUJI comitted at
  24. 859b35d1 pwa: IndexedDB を使ったワークスペースの作成・一覧処理 実際に書く雛形として IndexedDB へのアクセスとテストを書いた。 Shota FUJI authored at Shota FUJI comitted at
  25. 31135eff PWA での Protobuf 通信基礎 Service で定義されたリクエストとレスポンスを Web Worker 越しにやりとり する最低限のコード。今後どんなスタイル・ライブラリで書くにせよまず確実 に必要となるであろう部分を書いた。 Shota FUJI authored at Shota FUJI comitted at
  26. 8570db2a Protobuf の JS コード生成 先に Zig のコード生成をやろうとしたが、 - [zig-protobuf](https://github.com/Arwalk/zig-protobuf) は Protobuf の edition に対応していない - [gremlin](https://github.com/octopus-foundation/gremlin.zig) は Zig の v0.13 でビルドできない ため、 Zig v0.14 がリリースされる予定の 2025-01-01 までお預けすることに した。とりあえず PWA の Worker 実装だけのため、後から置き換えることは 簡単なため JS で進めて問題ない。 Shota FUJI authored at Shota FUJI comitted at
  27. cf72bdb1 労働者追加までの protobuf 定義 アプリケーションの MVP を作るにあたり、とりあえず基礎を作るのに必要な データモデル定義をする必要があった。勤怠や休暇の記録を付けるにもまず 労働者の登録が必要だったため、この定義を優先して行った。 設定ファイルやドキュメントは protobuf やそれに関連するツールの追加に 伴い必要になったもの。 Shota FUJI authored at Shota FUJI comitted at
  28. be1ef017 Markdown で footnotes を使わない GFM の独自拡張であり、各ツールのサポートがほぼない状態のため。 Shota FUJI authored at Shota FUJI comitted at
  29. c887f487 プロジェクト概要とコードチェックインの基礎 最低限のプロジェクトの説明が先に存在しないと経験上迷走しやすいため、 最優先で作成した。また、コードフォーマットに関するものも最初期から ないと後々の diff が見づらくなるので現状必要なものを作成した。 Shota FUJI authored at Shota FUJI comitted at