From cadc0261dc5f4959d6413d11b9360d9ba7a131e7 Mon Sep 17 00:00:00 2001 From: exaby73 Date: Sat, 7 Feb 2026 02:11:27 +0530 Subject: [PATCH 1/4] chore: Update dependencies; and CI --- .github/workflows/check.yaml | 62 ++++++++ dpk.yaml | 8 ++ pubspec.lock | 270 +++++++++++++++++------------------ pubspec.yaml | 36 ++--- 4 files changed, 219 insertions(+), 157 deletions(-) create mode 100644 .github/workflows/check.yaml diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml new file mode 100644 index 0000000..9cfc955 --- /dev/null +++ b/.github/workflows/check.yaml @@ -0,0 +1,62 @@ +name: Check + +on: + push: + branches: [main] + pull_request: + branches: [main] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + format: + name: Format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dart-lang/setup-dart@v1 + with: + sdk: stable + + - name: Install dpk + shell: bash + run: dart install dpk + + - name: Add Dart bin to PATH + shell: bash + run: echo "$HOME/.local/state/Dart/install/bin" >> $GITHUB_PATH + + - name: Get dependencies + shell: bash + run: dart pub get + + - name: Run format + shell: bash + run: dpk run ci:format + + analyze: + name: Analyze + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dart-lang/setup-dart@v1 + with: + sdk: stable + + - name: Install dpk + shell: bash + run: dart install dpk + + - name: Add Dart bin to PATH + shell: bash + run: echo "$HOME/.local/state/Dart/install/bin" >> $GITHUB_PATH + + - name: Get dependencies + shell: bash + run: dart pub get + + - name: Run analyze + shell: bash + run: dpk run ci:analyze diff --git a/dpk.yaml b/dpk.yaml index d1cbef3..933db02 100644 --- a/dpk.yaml +++ b/dpk.yaml @@ -1,3 +1,5 @@ +version: ^0.6.5 + scripts: docker: docker compose up dev: arcade serve @@ -11,3 +13,9 @@ scripts: clean:watch: | dpk run clean dpk run watch + + fix: dart fix --apply + format: dart format . + + ci:format: dart format . --set-exit-if-changed + ci:analyze: dart analyze . --fatal-infos --fatal-warnings diff --git a/pubspec.lock b/pubspec.lock index bc9c25b..7f3aba2 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,18 +5,18 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: c81659312e021e3b780a502206130ea106487b34793bce61e26dc0f9b84807af + sha256: "5b7468c326d2f8a4f630056404ca0d291ade42918f4a3c6233618e724f39da8e" url: "https://pub.dev" source: hosted - version: "83.0.0" + version: "92.0.0" analyzer: dependency: transitive description: name: analyzer - sha256: "9c35a79bf2a150b3ea0d40010fbbb45b5ebea143d47096e0f82fd922a324b49b" + sha256: "70e4b1ef8003c64793a9e268a551a82869a8a96f39deb73dea28084b0e8bf75e" url: "https://pub.dev" source: hosted - version: "7.4.6" + version: "9.0.0" ansi_styles: dependency: transitive description: @@ -25,70 +25,78 @@ packages: url: "https://pub.dev" source: hosted version: "0.3.2+1" + ansicolor: + dependency: transitive + description: + name: ansicolor + sha256: "50e982d500bc863e1d703448afdbf9e5a72eb48840a4f766fa361ffd6877055f" + url: "https://pub.dev" + source: hosted + version: "2.0.3" arcade: dependency: "direct main" description: name: arcade - sha256: "12a46a93d5eb09967e1bf38e76bf4ca1adf0d39ee73e7a3a612fbe2f9ebdf93b" + sha256: "81c80cbd9548f5c4894045dd1e2fed71e6c220eb2422f7c502428624ca9f7837" url: "https://pub.dev" source: hosted - version: "0.3.2" + version: "1.4.0" arcade_cache: dependency: "direct main" description: name: arcade_cache - sha256: "7c347b1099e99e14626b1c3bc7c1b68cb95c2ac364f06c2c9b6b5addee33dbc8" + sha256: d53b0cb2688d6771fd53f0a45101bfc0bfb8a5003dd405d71fbb32be03878033 url: "https://pub.dev" source: hosted - version: "0.0.2" + version: "1.4.0" arcade_cache_redis: dependency: "direct main" description: name: arcade_cache_redis - sha256: "87873addca1af2ca128fd12a6e7346c3f2eba4b9f5f7caf088b7bd3b9e57e533" + sha256: "0d5458a7554e50ec4f2c6961b6041c34fccb08e2ca693127f4440de8ef1a6103" url: "https://pub.dev" source: hosted - version: "0.0.2" + version: "1.4.0" arcade_config: dependency: transitive description: name: arcade_config - sha256: cb7937928c1ba0f12dd97276f35f39c46d62956a9fd6cedc593c3aaba73c4eef + sha256: f81096b92b63d6192b8c8023f0fd42d0f68429bda0a2137a435d732922cbdd3a url: "https://pub.dev" source: hosted - version: "0.1.3" + version: "1.3.0" arcade_logger: dependency: transitive description: name: arcade_logger - sha256: "210d53a36473faa421f539a62f3735924a5cbdbdf1235b3dc018bd9907828cc6" + sha256: "040a2def4ce77c50d143b93c7612f0a31758f4b6d22e216f37e8b6e692e20bd2" url: "https://pub.dev" source: hosted - version: "0.0.5+5" + version: "1.3.0" arcade_swagger: dependency: "direct main" description: name: arcade_swagger - sha256: "089d5eaea507e6b6a2adb0cee9465cdabb7c6edccba0400882e370554eb429ee" + sha256: "2de1ee0e8936c0c9f2f1a4464520dc7ef10110e4e2b58c7faad9a7a8b4ba3d3c" url: "https://pub.dev" source: hosted - version: "0.0.5" + version: "1.4.0" arcade_views: dependency: transitive description: name: arcade_views - sha256: "6b7db8fff21ca720ae300b5bf024bf24ad2e321f76bbd11840bdd44e53aedd79" + sha256: "374eb0102899e0395cee8c3f7b8b9434d8d74980509aa44230d441b23085e936" url: "https://pub.dev" source: hosted - version: "0.1.2" + version: "1.3.0" args: dependency: transitive description: name: args - sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.7.0" async: dependency: transitive description: @@ -117,18 +125,18 @@ packages: dependency: transitive description: name: build - sha256: "51dc711996cbf609b90cbe5b335bbce83143875a9d58e4b5c6d3c4f684d3dda7" + sha256: "275bf6bb2a00a9852c28d4e0b410da1d833a734d57d39d44f94bfc895a484ec3" url: "https://pub.dev" source: hosted - version: "2.5.4" + version: "4.0.4" build_config: dependency: transitive description: name: build_config - sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + sha256: "4f64382b97504dc2fcdf487d5aae33418e08b4703fc21249e4db6d804a4d0187" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.0" build_daemon: dependency: transitive description: @@ -137,30 +145,14 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" - build_resolvers: - dependency: transitive - description: - name: build_resolvers - sha256: ee4257b3f20c0c90e72ed2b57ad637f694ccba48839a821e87db762548c22a62 - url: "https://pub.dev" - source: hosted - version: "2.5.4" build_runner: dependency: "direct dev" description: name: build_runner - sha256: "382a4d649addbfb7ba71a3631df0ec6a45d5ab9b098638144faf27f02778eb53" + sha256: ac78098de97893812b7aff1154f29008fa2464cad9e8e7044d39bc905dad4fbc url: "https://pub.dev" source: hosted - version: "2.5.4" - build_runner_core: - dependency: transitive - description: - name: build_runner_core - sha256: "85fbbb1036d576d966332a3f5ce83f2ce66a40bea1a94ad2d5fc29a19a0d3792" - url: "https://pub.dev" - source: hosted - version: "9.1.2" + version: "2.11.0" built_collection: dependency: transitive description: @@ -221,10 +213,10 @@ packages: dependency: transitive description: name: code_builder - sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e" + sha256: "6a6cab2ba4680d6423f34a9b972a4c9a94ebe1b62ecec4e1a1f2cba91fd1319d" url: "https://pub.dev" source: hosted - version: "4.10.1" + version: "4.11.1" collection: dependency: transitive description: @@ -261,26 +253,26 @@ packages: dependency: transitive description: name: dart_style - sha256: "27eb0ae77836989a3bc541ce55595e8ceee0992807f14511552a898ddd0d88ac" + sha256: a9c30492da18ff84efe2422ba2d319a89942d93e58eb0b73d32abe822ef54b7b url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.1.3" drift: dependency: "direct main" description: name: drift - sha256: e60c715f045dd33624fc533efb0075e057debec9f39e83843e518f488a0e21fb + sha256: "970cd188fddb111b26ea6a9b07a62bf5c2432d74147b8122c67044ae3b97e99e" url: "https://pub.dev" source: hosted - version: "2.27.0" + version: "2.31.0" drift_dev: dependency: "direct dev" description: name: drift_dev - sha256: "7ad88b8982e753eadcdbc0ea7c7d30500598af733601428b5c9d264baf5106d6" + sha256: "917184b2fb867b70a548a83bf0d36268423b38d39968c06cce4905683da49587" url: "https://pub.dev" source: hosted - version: "2.27.0" + version: "2.31.0" drift_postgres: dependency: "direct main" description: @@ -293,26 +285,26 @@ packages: dependency: "direct main" description: name: envied - sha256: a4e2b1d0caa479b5d61332ae516518c175a6d09328a35a0bc0a53894cc5d7e4d + sha256: "4cfe31953c13977d1118b4f14cc5dfb683d8bb4c35d5b0c64b29d5b2e30712e8" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.3.2" envied_generator: dependency: "direct dev" description: name: envied_generator - sha256: "894f6c5eb624c60a1ce6f642b6fd7ec68bc3440aa6f1881837aa9acbbeade0c8" + sha256: "04467955af3b8f8a249b2f20686f00c89a979cb077aef7d0918642978b28bdeb" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.3.2" equatable: dependency: transitive description: name: equatable - sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2 + sha256: "3e0141505477fd8ad55d6eb4e7776d3fe8430be8e497ccb1521370c3f21a3e2b" url: "https://pub.dev" source: hosted - version: "2.0.5" + version: "2.0.8" ffi: dependency: transitive description: @@ -341,18 +333,18 @@ packages: dependency: "direct dev" description: name: freezed - sha256: a6274c34d61b3d68082f2b0e9a641a3ec197e525d269f35b82f62d5b2c6d9f75 + sha256: f23ea33b3863f119b58ed1b586e881a46bd28715ddcc4dbc33104524e3434131 url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.2.5" freezed_annotation: dependency: "direct main" description: name: freezed_annotation - sha256: c87ff004c8aa6af2d531668b46a4ea379f7191dc6dfa066acd53d506da6e044b + sha256: "7294967ff0a6d98638e7acb774aac3af2550777accd8149c90af5b014e6d44d8" url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.1.0" frontend_server_client: dependency: transitive description: @@ -365,18 +357,18 @@ packages: dependency: "direct main" description: name: get_it - sha256: f126a3e286b7f5b578bf436d5592968706c4c1de28a228b870ce375d9f743103 + sha256: "1d648d2dd2047d7f7450d5727ca24ee435f240385753d90b49650e3cdff32e56" url: "https://pub.dev" source: hosted - version: "8.0.3" + version: "9.2.0" glob: dependency: transitive description: name: glob - sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.3" graphs: dependency: transitive description: @@ -385,6 +377,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.3.2" + hotreloader: + dependency: transitive + description: + name: hotreloader + sha256: bc167a1163807b03bada490bfe2df25b0d744df359227880220a5cbd04e5734b + url: "https://pub.dev" + source: hosted + version: "4.3.0" html_unescape: dependency: transitive description: @@ -421,18 +421,18 @@ packages: dependency: "direct main" description: name: injectable - sha256: "5e1556ea1d374fe44cbe846414d9bab346285d3d8a1da5877c01ad0774006068" + sha256: "32b36a9d87f18662bee0b1951b81f47a01f2bf28cd6ea94f60bc5453c7bf598c" url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.7.1+4" injectable_generator: dependency: "direct dev" description: name: injectable_generator - sha256: b04673a4c88b3a848c0c77bf58b8309f9b9e064d9fe1df5450c8ee1675eaea1a + sha256: "5168f8189e8a3a5ec6cbaeb5249e99f53d51b6594f9abbc3e482f95ae1d96bfb" url: "https://pub.dev" source: hosted - version: "2.7.0" + version: "2.12.0" intl: dependency: transitive description: @@ -453,18 +453,10 @@ packages: dependency: transitive description: name: jinja - sha256: e0e14bb04cde45f944d61140612ee9368cfcd890e3ca65573316b7c6ce51c635 + sha256: "67485c43c8551688669a81b4e01fe94f6126578ba8c194908d00f254f23f9b8b" url: "https://pub.dev" source: hosted - version: "0.6.2" - js: - dependency: transitive - description: - name: js - sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf - url: "https://pub.dev" - source: hosted - version: "0.7.1" + version: "0.6.5" json_annotation: dependency: "direct main" description: @@ -477,10 +469,18 @@ packages: dependency: "direct dev" description: name: json_serializable - sha256: c50ef5fc083d5b5e12eef489503ba3bf5ccc899e487d691584699b4bdefeea8c + sha256: "5b89c1e32ae3840bb20a1b3434e3a590173ad3cb605896fb0f60487ce2f8104e" + url: "https://pub.dev" + source: hosted + version: "6.11.4" + lean_builder: + dependency: transitive + description: + name: lean_builder + sha256: "6af3cfbf34400eb14b89fe20111e5981e7083362f00ea10b9ed2a6e833250d76" url: "https://pub.dev" source: hosted - version: "6.9.5" + version: "0.1.6" lint: dependency: "direct dev" description: @@ -501,18 +501,18 @@ packages: dependency: "direct main" description: name: luthor - sha256: "3ef982947cfdbae5a4e4980348fa42277960d21253cc327588cf09f3b904d74a" + sha256: "6ef33c41219aec095d18021a0d3a7d5a22526735232a26afbfd5384988e83581" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.16.0" luthor_generator: dependency: "direct dev" description: name: luthor_generator - sha256: "71d6760b09e132d01168feb567d1ddc45d1108f44869e0de26f2f838cb0ebd26" + sha256: b82a7727daff298d971de458eb4d30b617e91cec755ec3447a9db77956d7c38e url: "https://pub.dev" source: hosted - version: "0.7.0" + version: "0.16.0" mason_logger: dependency: transitive description: @@ -549,10 +549,10 @@ packages: dependency: transitive description: name: openapi_spec - sha256: cd0540431a7dd11a54246fbbf985951914e0e33100466c56ff372cd1b96f5573 + sha256: "0de980914cafaab7e2086f5541cefba1fb6a64510ab136bd3828bdf02e26c09d" url: "https://pub.dev" source: hosted - version: "0.8.2" + version: "0.15.0" package_config: dependency: transitive description: @@ -589,10 +589,10 @@ packages: dependency: "direct main" description: name: postgres - sha256: "9aaa6f4872956adef653535a4e2133b167465c1a68c22b9bd0744ef1244e9393" + sha256: fefbbfe749c6130e5096588b9c4459173684c695952cd7636ab19be76f255469 url: "https://pub.dev" source: hosted - version: "3.5.6" + version: "3.5.9" process: dependency: transitive description: @@ -605,10 +605,10 @@ packages: dependency: transitive description: name: pub_semver - sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" pub_updater: dependency: transitive description: @@ -641,22 +641,6 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.0" - sasl_scram: - dependency: transitive - description: - name: sasl_scram - sha256: a47207a436eb650f8fdcf54a2e2587b850dc3caef9973ce01f332b07a6fc9cb9 - url: "https://pub.dev" - source: hosted - version: "0.1.1" - saslprep: - dependency: transitive - description: - name: saslprep - sha256: "3d421d10be9513bf4459c17c5e70e7b8bc718c9fc5ad4ba5eb4f5fd27396f740" - url: "https://pub.dev" - source: hosted - version: "1.0.3" shelf: dependency: transitive description: @@ -677,26 +661,26 @@ packages: dependency: transitive description: name: source_gen - sha256: "35c8150ece9e8c8d263337a265153c3329667640850b9304861faea59fc98f6b" + sha256: "1d562a3c1f713904ebbed50d2760217fd8a51ca170ac4b05b0db490699dbac17" url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "4.2.0" source_helper: dependency: transitive description: name: source_helper - sha256: "86d247119aedce8e63f4751bd9626fc9613255935558447569ad42f9f5b48b3c" + sha256: "4a85e90b50694e652075cbe4575665539d253e6ec10e46e76b45368ab5e3caae" url: "https://pub.dev" source: hosted - version: "1.3.5" + version: "1.3.10" source_span: dependency: transitive description: name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab" url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.10.2" sprintf: dependency: transitive description: @@ -717,10 +701,10 @@ packages: dependency: transitive description: name: sqlparser - sha256: "27dd0a9f0c02e22ac0eb42a23df9ea079ce69b52bb4a3b478d64e0ef34a263ee" + sha256: "337e9997f7141ffdd054259128553c348635fa318f7ca492f07a4ab76f850d19" url: "https://pub.dev" source: hosted - version: "0.41.0" + version: "0.43.1" stack_trace: dependency: transitive description: @@ -757,18 +741,26 @@ packages: dependency: "direct main" description: name: superclass - sha256: "7480c82d4bb2ba55beaed621f37280bed4e215518ab7bfe35a7cbdd657e75a22" + sha256: b278f14a7061bc510552e7acc880496e8fab4892377714fc4edaa0962f4d40fc url: "https://pub.dev" source: hosted - version: "0.1.0" + version: "0.8.0" superclass_generator: dependency: "direct dev" description: name: superclass_generator - sha256: "2840c5e90bf2a178917b6603dac6af481b369902ac2c81ec571de8acd1fdadc1" + sha256: "1bdd7f3f172e27d77fd33ae530e97307534b78012c6b08f067c1489894a33f80" + url: "https://pub.dev" + source: hosted + version: "0.8.0" + synchronized: + dependency: transitive + description: + name: synchronized + sha256: c254ade258ec8282947a0acbbc90b9575b4f19673533ee46f2f6e9b3aeefd7c0 url: "https://pub.dev" source: hosted - version: "0.4.0" + version: "3.4.0" term_glyph: dependency: transitive description: @@ -793,14 +785,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.0" - timing: - dependency: transitive - description: - name: timing - sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" - url: "https://pub.dev" - source: hosted - version: "1.0.1" type_plus: dependency: transitive description: @@ -817,14 +801,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.2" - unorm_dart: - dependency: transitive - description: - name: unorm_dart - sha256: "8e3870a1caa60bde8352f9597dd3535d8068613269444f8e35ea8925ec84c1f5" - url: "https://pub.dev" - source: hosted - version: "0.3.1+1" uuid: dependency: transitive description: @@ -833,14 +809,22 @@ packages: url: "https://pub.dev" source: hosted version: "4.5.1" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60" + url: "https://pub.dev" + source: hosted + version: "15.0.2" watcher: dependency: transitive description: name: watcher - sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + sha256: "592ab6e2892f67760543fb712ff0177f4ec76c031f02f5b4ff8d3fc5eb9fb61a" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.4" web: dependency: transitive description: @@ -873,13 +857,21 @@ packages: url: "https://pub.dev" source: hosted version: "5.14.0" + xxh3: + dependency: transitive + description: + name: xxh3 + sha256: "399a0438f5d426785723c99da6b16e136f4953fb1e9db0bf270bd41dd4619916" + url: "https://pub.dev" + source: hosted + version: "1.2.0" yaml: dependency: transitive description: name: yaml - sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.1.3" sdks: - dart: ">=3.8.0 <4.0.0" + dart: ">=3.10.0 <4.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 1c6ea24..2fd4f05 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,32 +3,32 @@ description: Starter Arcade application using recommended code generation librar version: 1.0.0 environment: - sdk: ">=3.5.0 <4.0.0" + sdk: ">=3.8.0 <4.0.0" dependencies: - arcade: ^0.3.2 - arcade_cache: ^0.0.2 - arcade_cache_redis: ^0.0.2 - arcade_swagger: ^0.0.5 - drift: ^2.27.0 + arcade: ^1.4.0 + arcade_cache: ^1.4.0 + arcade_cache_redis: ^1.4.0 + arcade_swagger: ^1.4.0 + drift: ^2.31.0 drift_postgres: ^1.3.1 - envied: ^1.1.1 - freezed_annotation: ^3.0.0 - get_it: ^8.0.3 - injectable: ^2.5.0 + envied: ^1.3.2 + freezed_annotation: ^3.1.0 + get_it: ^9.2.0 + injectable: ^2.7.1 json_annotation: ^4.9.0 - luthor: ^0.6.0 + luthor: ^0.16.0 meta: ^1.17.0 - postgres: ^3.5.6 - superclass: ^0.1.0 + postgres: ^3.5.9 + superclass: ^0.8.0 dev_dependencies: build_runner: ^2.5.4 drift_dev: ^2.27.0 - envied_generator: ^1.1.1 - freezed: ^3.0.3 - injectable_generator: ^2.7.0 + envied_generator: ^1.3.2 + freezed: ^3.2.5 + injectable_generator: ^2.12.0 json_serializable: ^6.9.5 lint: ^2.8.0 - luthor_generator: ^0.7.0 - superclass_generator: ^0.4.0 + luthor_generator: ^0.16.0 + superclass_generator: ^0.8.0 From 555e6f4878ded6236d8e11b5e2294aacfe6b65fb Mon Sep 17 00:00:00 2001 From: exaby73 Date: Sat, 7 Feb 2026 02:12:27 +0530 Subject: [PATCH 2/4] chore: Format files --- lib/core/database/database.dart | 9 +- lib/core/init.dart | 78 ++- .../todos/controllers/todo_controller.dart | 25 +- .../repositories/todo_repository.drift.dart | 6 +- lib/modules/todos/services/todo_service.dart | 4 +- .../todos/tables/todos_table.drift.dart | 529 +++++++++++------- lib/shared/data/success_response.dart | 4 +- lib/shared/database/primary_key_mixin.dart | 5 +- lib/shared/database/timestamps_mixin.dart | 10 +- lib/shared/extensions/luthor_extension.dart | 10 +- 10 files changed, 381 insertions(+), 299 deletions(-) diff --git a/lib/core/database/database.dart b/lib/core/database/database.dart index 7e91965..c18717a 100644 --- a/lib/core/database/database.dart +++ b/lib/core/database/database.dart @@ -25,13 +25,8 @@ class Database extends $Database { ); static QueryExecutor _openConnection() { - final Uri( - :host, - :userInfo, - :port, - :pathSegments, - :queryParameters, - ) = Uri.parse(Env.databaseUrl); + final Uri(:host, :userInfo, :port, :pathSegments, :queryParameters) = + Uri.parse(Env.databaseUrl); final [username, password] = userInfo.split(':'); final sslModeString = queryParameters['sslmode'] ?? 'disable'; diff --git a/lib/core/init.dart b/lib/core/init.dart index f053a7e..6327b04 100644 --- a/lib/core/init.dart +++ b/lib/core/init.dart @@ -16,47 +16,41 @@ final getIt = GetIt.instance; Future init() async { await getIt.init(); - setupSwagger( - title: 'Aracde API', - version: '1.0.0', - ); + setupSwagger(title: 'Aracde API', version: '1.0.0'); - route.addBeforeHookForPath( - '/ui', - (context) { - // Validate basic auth. Send a prompt for the browser if not authenticated. - final auth = context.requestHeaders['Authorization']; - if (auth == null) { - context.statusCode = 401; - context.responseHeaders.set('WWW-Authenticate', 'Basic'); - return context; - } + route.addBeforeHookForPath('/ui', (context) { + // Validate basic auth. Send a prompt for the browser if not authenticated. + final auth = context.requestHeaders['Authorization']; + if (auth == null) { + context.statusCode = 401; + context.responseHeaders.set('WWW-Authenticate', 'Basic'); + return context; + } - const username = 'admin'; - const password = 'admin'; - final authValue = auth.first.split(' ').last; - final decoded = base64Decode(authValue); - final decodedString = utf8.decode(decoded); - final credentials = decodedString.split(':'); - if (credentials.length != 2) { - context.statusCode = 401; - context.responseHeaders.set('WWW-Authenticate', 'Basic'); - return context; - } + const username = 'admin'; + const password = 'admin'; + final authValue = auth.first.split(' ').last; + final decoded = base64Decode(authValue); + final decodedString = utf8.decode(decoded); + final credentials = decodedString.split(':'); + if (credentials.length != 2) { + context.statusCode = 401; + context.responseHeaders.set('WWW-Authenticate', 'Basic'); + return context; + } - final [authUsername, authPassword] = credentials; - if (authUsername != username || authPassword != password) { - context.statusCode = 401; - context.responseHeaders.set('WWW-Authenticate', 'Basic'); - return context; - } + final [authUsername, authPassword] = credentials; + if (authUsername != username || authPassword != password) { + context.statusCode = 401; + context.responseHeaders.set('WWW-Authenticate', 'Basic'); + return context; + } - // If we get here, the user is authenticated. - context.responseHeaders.set('X-Auth-Username', username); + // If we get here, the user is authenticated. + context.responseHeaders.set('X-Auth-Username', username); - return context; - }, - ); + return context; + }); } @module @@ -69,13 +63,11 @@ abstract class AdditionalDependencies { Future get cacheManager async { final cache = RedisCacheManager(); final uri = Uri.parse(Env.redisUrl); - await cache.init( - ( - host: uri.host, - port: uri.port, - secure: uri.scheme == 'rediss', - ), - ); + await cache.init(( + host: uri.host, + port: uri.port, + secure: uri.scheme == 'rediss', + )); return cache; } } diff --git a/lib/modules/todos/controllers/todo_controller.dart b/lib/modules/todos/controllers/todo_controller.dart index 811c260..dd7e3aa 100644 --- a/lib/modules/todos/controllers/todo_controller.dart +++ b/lib/modules/todos/controllers/todo_controller.dart @@ -35,9 +35,7 @@ class TodoController { summary: 'Create a todo', description: 'Create a todo', request: $CreateTodoRequestSchema, - responses: { - '201': $$TodoDataResponseSchema, - }, + responses: {'201': $$TodoDataResponseSchema}, ) .post('/') .handle(createTodo); @@ -47,10 +45,7 @@ class TodoController { summary: 'Mark a todo as done', description: 'Mark a todo as done', parameters: const [ - Parameter.path( - name: 'id', - description: 'The id of the todo', - ), + Parameter.path(name: 'id', description: 'The id of the todo'), ], ) .put('/:id/complete') @@ -61,10 +56,7 @@ class TodoController { summary: 'Mark a todo as not done', description: 'Mark a todo as not done', parameters: const [ - Parameter.path( - name: 'id', - description: 'The id of the todo', - ), + Parameter.path(name: 'id', description: 'The id of the todo'), ], ) .put('/:id/incomplete') @@ -75,10 +67,7 @@ class TodoController { summary: 'Delete a todo', description: 'Delete a todo', parameters: const [ - Parameter.path( - name: 'id', - description: 'The id of the todo', - ), + Parameter.path(name: 'id', description: 'The id of the todo'), ], ) .delete('/:id') @@ -88,9 +77,9 @@ class TodoController { } Future> getTodos(RequestContext context) { - return todoService - .getTodos() - .then((todos) => todos.map((todo) => todo.toTodoDataResponse).toList()); + return todoService.getTodos().then( + (todos) => todos.map((todo) => todo.toTodoDataResponse).toList(), + ); } Future createTodo(RequestContext context) async { diff --git a/lib/modules/todos/repositories/todo_repository.drift.dart b/lib/modules/todos/repositories/todo_repository.drift.dart index 5728062..b070a38 100644 --- a/lib/modules/todos/repositories/todo_repository.drift.dart +++ b/lib/modules/todos/repositories/todo_repository.drift.dart @@ -6,7 +6,7 @@ import 'package:start/modules/todos/tables/todos_table.drift.dart' as i2; import 'package:drift/internal/modular.dart' as i3; mixin $TodoRepositoryMixin on i0.DatabaseAccessor { - i2.$TodosTableTable get todosTable => - i3.ReadDatabaseContainer(attachedDatabase) - .resultSet('todos'); + i2.$TodosTableTable get todosTable => i3.ReadDatabaseContainer( + attachedDatabase, + ).resultSet('todos'); } diff --git a/lib/modules/todos/services/todo_service.dart b/lib/modules/todos/services/todo_service.dart index 5b6a6fe..344112d 100644 --- a/lib/modules/todos/services/todo_service.dart +++ b/lib/modules/todos/services/todo_service.dart @@ -44,9 +44,7 @@ class TodoService { Future deleteTodo(String id) { return _todoRepository.deleteTodo( - TodosTableCompanion( - id: Value(UuidValue.fromString(id)), - ), + TodosTableCompanion(id: Value(UuidValue.fromString(id))), ); } } diff --git a/lib/modules/todos/tables/todos_table.drift.dart b/lib/modules/todos/tables/todos_table.drift.dart index 5cb1fd1..4d02069 100644 --- a/lib/modules/todos/tables/todos_table.drift.dart +++ b/lib/modules/todos/tables/todos_table.drift.dart @@ -7,26 +7,26 @@ import 'package:drift_postgres/drift_postgres.dart' as i3; import 'package:start/modules/todos/tables/todos_table.dart' as i4; import 'package:drift/src/runtime/query_builder/query_builder.dart' as i5; -typedef $$TodosTableTableCreateCompanionBuilder = i1.TodosTableCompanion - Function({ - i0.Value id, - i0.Value createdAt, - i0.Value updatedAt, - required String title, - required String description, - i0.Value completed, - i0.Value rowid, -}); -typedef $$TodosTableTableUpdateCompanionBuilder = i1.TodosTableCompanion - Function({ - i0.Value id, - i0.Value createdAt, - i0.Value updatedAt, - i0.Value title, - i0.Value description, - i0.Value completed, - i0.Value rowid, -}); +typedef $$TodosTableTableCreateCompanionBuilder = + i1.TodosTableCompanion Function({ + i0.Value id, + i0.Value createdAt, + i0.Value updatedAt, + required String title, + required String description, + i0.Value completed, + i0.Value rowid, + }); +typedef $$TodosTableTableUpdateCompanionBuilder = + i1.TodosTableCompanion Function({ + i0.Value id, + i0.Value createdAt, + i0.Value updatedAt, + i0.Value title, + i0.Value description, + i0.Value completed, + i0.Value rowid, + }); class $$TodosTableTableFilterComposer extends i0.Composer { @@ -38,23 +38,34 @@ class $$TodosTableTableFilterComposer super.$removeJoinBuilderFromRootComposer, }); i0.ColumnFilters get id => $composableBuilder( - column: $table.id, builder: (column) => i0.ColumnFilters(column)); + column: $table.id, + builder: (column) => i0.ColumnFilters(column), + ); i0.ColumnFilters get createdAt => $composableBuilder( - column: $table.createdAt, builder: (column) => i0.ColumnFilters(column)); + column: $table.createdAt, + builder: (column) => i0.ColumnFilters(column), + ); i0.ColumnFilters get updatedAt => $composableBuilder( - column: $table.updatedAt, builder: (column) => i0.ColumnFilters(column)); + column: $table.updatedAt, + builder: (column) => i0.ColumnFilters(column), + ); i0.ColumnFilters get title => $composableBuilder( - column: $table.title, builder: (column) => i0.ColumnFilters(column)); + column: $table.title, + builder: (column) => i0.ColumnFilters(column), + ); i0.ColumnFilters get description => $composableBuilder( - column: $table.description, - builder: (column) => i0.ColumnFilters(column)); + column: $table.description, + builder: (column) => i0.ColumnFilters(column), + ); i0.ColumnFilters get completed => $composableBuilder( - column: $table.completed, builder: (column) => i0.ColumnFilters(column)); + column: $table.completed, + builder: (column) => i0.ColumnFilters(column), + ); } class $$TodosTableTableOrderingComposer @@ -67,26 +78,34 @@ class $$TodosTableTableOrderingComposer super.$removeJoinBuilderFromRootComposer, }); i0.ColumnOrderings get id => $composableBuilder( - column: $table.id, builder: (column) => i0.ColumnOrderings(column)); + column: $table.id, + builder: (column) => i0.ColumnOrderings(column), + ); i0.ColumnOrderings get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => i0.ColumnOrderings(column)); + column: $table.createdAt, + builder: (column) => i0.ColumnOrderings(column), + ); i0.ColumnOrderings get updatedAt => $composableBuilder( - column: $table.updatedAt, - builder: (column) => i0.ColumnOrderings(column)); + column: $table.updatedAt, + builder: (column) => i0.ColumnOrderings(column), + ); i0.ColumnOrderings get title => $composableBuilder( - column: $table.title, builder: (column) => i0.ColumnOrderings(column)); + column: $table.title, + builder: (column) => i0.ColumnOrderings(column), + ); i0.ColumnOrderings get description => $composableBuilder( - column: $table.description, - builder: (column) => i0.ColumnOrderings(column)); + column: $table.description, + builder: (column) => i0.ColumnOrderings(column), + ); i0.ColumnOrderings get completed => $composableBuilder( - column: $table.completed, - builder: (column) => i0.ColumnOrderings(column)); + column: $table.completed, + builder: (column) => i0.ColumnOrderings(column), + ); } class $$TodosTableTableAnnotationComposer @@ -111,31 +130,41 @@ class $$TodosTableTableAnnotationComposer $composableBuilder(column: $table.title, builder: (column) => column); i0.GeneratedColumn get description => $composableBuilder( - column: $table.description, builder: (column) => column); + column: $table.description, + builder: (column) => column, + ); i0.GeneratedColumn get completed => $composableBuilder(column: $table.completed, builder: (column) => column); } -class $$TodosTableTableTableManager extends i0.RootTableManager< - i0.GeneratedDatabase, - i1.$TodosTableTable, - i1.TodosTableData, - i1.$$TodosTableTableFilterComposer, - i1.$$TodosTableTableOrderingComposer, - i1.$$TodosTableTableAnnotationComposer, - $$TodosTableTableCreateCompanionBuilder, - $$TodosTableTableUpdateCompanionBuilder, - ( - i1.TodosTableData, - i0.BaseReferences - ), - i1.TodosTableData, - i0.PrefetchHooks Function()> { +class $$TodosTableTableTableManager + extends + i0.RootTableManager< + i0.GeneratedDatabase, + i1.$TodosTableTable, + i1.TodosTableData, + i1.$$TodosTableTableFilterComposer, + i1.$$TodosTableTableOrderingComposer, + i1.$$TodosTableTableAnnotationComposer, + $$TodosTableTableCreateCompanionBuilder, + $$TodosTableTableUpdateCompanionBuilder, + ( + i1.TodosTableData, + i0.BaseReferences< + i0.GeneratedDatabase, + i1.$TodosTableTable, + i1.TodosTableData + >, + ), + i1.TodosTableData, + i0.PrefetchHooks Function() + > { $$TodosTableTableTableManager( - i0.GeneratedDatabase db, i1.$TodosTableTable table) - : super(i0.TableManagerState( + i0.GeneratedDatabase db, + i1.$TodosTableTable table, + ) : super( + i0.TableManagerState( db: db, table: table, createFilteringComposer: () => @@ -144,65 +173,71 @@ class $$TodosTableTableTableManager extends i0.RootTableManager< i1.$$TodosTableTableOrderingComposer($db: db, $table: table), createComputedFieldComposer: () => i1.$$TodosTableTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: ({ - i0.Value id = const i0.Value.absent(), - i0.Value createdAt = const i0.Value.absent(), - i0.Value updatedAt = const i0.Value.absent(), - i0.Value title = const i0.Value.absent(), - i0.Value description = const i0.Value.absent(), - i0.Value completed = const i0.Value.absent(), - i0.Value rowid = const i0.Value.absent(), - }) => - i1.TodosTableCompanion( - id: id, - createdAt: createdAt, - updatedAt: updatedAt, - title: title, - description: description, - completed: completed, - rowid: rowid, - ), - createCompanionCallback: ({ - i0.Value id = const i0.Value.absent(), - i0.Value createdAt = const i0.Value.absent(), - i0.Value updatedAt = const i0.Value.absent(), - required String title, - required String description, - i0.Value completed = const i0.Value.absent(), - i0.Value rowid = const i0.Value.absent(), - }) => - i1.TodosTableCompanion.insert( - id: id, - createdAt: createdAt, - updatedAt: updatedAt, - title: title, - description: description, - completed: completed, - rowid: rowid, - ), + updateCompanionCallback: + ({ + i0.Value id = const i0.Value.absent(), + i0.Value createdAt = const i0.Value.absent(), + i0.Value updatedAt = const i0.Value.absent(), + i0.Value title = const i0.Value.absent(), + i0.Value description = const i0.Value.absent(), + i0.Value completed = const i0.Value.absent(), + i0.Value rowid = const i0.Value.absent(), + }) => i1.TodosTableCompanion( + id: id, + createdAt: createdAt, + updatedAt: updatedAt, + title: title, + description: description, + completed: completed, + rowid: rowid, + ), + createCompanionCallback: + ({ + i0.Value id = const i0.Value.absent(), + i0.Value createdAt = const i0.Value.absent(), + i0.Value updatedAt = const i0.Value.absent(), + required String title, + required String description, + i0.Value completed = const i0.Value.absent(), + i0.Value rowid = const i0.Value.absent(), + }) => i1.TodosTableCompanion.insert( + id: id, + createdAt: createdAt, + updatedAt: updatedAt, + title: title, + description: description, + completed: completed, + rowid: rowid, + ), withReferenceMapper: (p0) => p0 .map((e) => (e.readTable(table), i0.BaseReferences(db, table, e))) .toList(), prefetchHooksCallback: null, - )); + ), + ); } -typedef $$TodosTableTableProcessedTableManager = i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$TodosTableTable, - i1.TodosTableData, - i1.$$TodosTableTableFilterComposer, - i1.$$TodosTableTableOrderingComposer, - i1.$$TodosTableTableAnnotationComposer, - $$TodosTableTableCreateCompanionBuilder, - $$TodosTableTableUpdateCompanionBuilder, - ( +typedef $$TodosTableTableProcessedTableManager = + i0.ProcessedTableManager< + i0.GeneratedDatabase, + i1.$TodosTableTable, i1.TodosTableData, - i0.BaseReferences - ), - i1.TodosTableData, - i0.PrefetchHooks Function()>; + i1.$$TodosTableTableFilterComposer, + i1.$$TodosTableTableOrderingComposer, + i1.$$TodosTableTableAnnotationComposer, + $$TodosTableTableCreateCompanionBuilder, + $$TodosTableTableUpdateCompanionBuilder, + ( + i1.TodosTableData, + i0.BaseReferences< + i0.GeneratedDatabase, + i1.$TodosTableTable, + i1.TodosTableData + >, + ), + i1.TodosTableData, + i0.PrefetchHooks Function() + >; class $TodosTableTable extends i4.TodosTable with i0.TableInfo<$TodosTableTable, i1.TodosTableData> { @@ -213,55 +248,92 @@ class $TodosTableTable extends i4.TodosTable static const i0.VerificationMeta _idMeta = const i0.VerificationMeta('id'); @override late final i0.GeneratedColumn id = - i0.GeneratedColumn('id', aliasedName, false, - type: i3.PgTypes.uuid, - requiredDuringInsert: false, - defaultValue: const i5.FunctionCallExpression('gen_random_uuid', [])); - static const i0.VerificationMeta _createdAtMeta = - const i0.VerificationMeta('createdAt'); + i0.GeneratedColumn( + 'id', + aliasedName, + false, + type: i3.PgTypes.uuid, + requiredDuringInsert: false, + defaultValue: const i5.FunctionCallExpression('gen_random_uuid', []), + ); + static const i0.VerificationMeta _createdAtMeta = const i0.VerificationMeta( + 'createdAt', + ); @override late final i0.GeneratedColumn createdAt = - i0.GeneratedColumn('created_at', aliasedName, false, - type: i3.PgTypes.timestampWithTimezone, - requiredDuringInsert: false, - defaultValue: const i5.FunctionCallExpression('now', [])); - static const i0.VerificationMeta _updatedAtMeta = - const i0.VerificationMeta('updatedAt'); + i0.GeneratedColumn( + 'created_at', + aliasedName, + false, + type: i3.PgTypes.timestampWithTimezone, + requiredDuringInsert: false, + defaultValue: const i5.FunctionCallExpression('now', []), + ); + static const i0.VerificationMeta _updatedAtMeta = const i0.VerificationMeta( + 'updatedAt', + ); @override late final i0.GeneratedColumn updatedAt = - i0.GeneratedColumn('updated_at', aliasedName, false, - type: i3.PgTypes.timestampWithTimezone, - requiredDuringInsert: false, - defaultValue: const i5.FunctionCallExpression('now', [])); - static const i0.VerificationMeta _titleMeta = - const i0.VerificationMeta('title'); + i0.GeneratedColumn( + 'updated_at', + aliasedName, + false, + type: i3.PgTypes.timestampWithTimezone, + requiredDuringInsert: false, + defaultValue: const i5.FunctionCallExpression('now', []), + ); + static const i0.VerificationMeta _titleMeta = const i0.VerificationMeta( + 'title', + ); @override late final i0.GeneratedColumn title = i0.GeneratedColumn( - 'title', aliasedName, false, - additionalChecks: i0.GeneratedColumn.checkTextLength( - minTextLength: 1, maxTextLength: 255), - type: i0.DriftSqlType.string, - requiredDuringInsert: true); - static const i0.VerificationMeta _descriptionMeta = - const i0.VerificationMeta('description'); + 'title', + aliasedName, + false, + additionalChecks: i0.GeneratedColumn.checkTextLength( + minTextLength: 1, + maxTextLength: 255, + ), + type: i0.DriftSqlType.string, + requiredDuringInsert: true, + ); + static const i0.VerificationMeta _descriptionMeta = const i0.VerificationMeta( + 'description', + ); @override late final i0.GeneratedColumn description = - i0.GeneratedColumn('description', aliasedName, false, - additionalChecks: i0.GeneratedColumn.checkTextLength( - minTextLength: 1, maxTextLength: 1000), - type: i0.DriftSqlType.string, - requiredDuringInsert: true); - static const i0.VerificationMeta _completedMeta = - const i0.VerificationMeta('completed'); + i0.GeneratedColumn( + 'description', + aliasedName, + false, + additionalChecks: i0.GeneratedColumn.checkTextLength( + minTextLength: 1, + maxTextLength: 1000, + ), + type: i0.DriftSqlType.string, + requiredDuringInsert: true, + ); + static const i0.VerificationMeta _completedMeta = const i0.VerificationMeta( + 'completed', + ); @override late final i0.GeneratedColumn completed = i0.GeneratedColumn( - 'completed', aliasedName, false, - type: i0.DriftSqlType.bool, - requiredDuringInsert: false, - defaultValue: const i5.Constant(false)); + 'completed', + aliasedName, + false, + type: i0.DriftSqlType.bool, + requiredDuringInsert: false, + defaultValue: const i5.Constant(false), + ); @override - List get $columns => - [id, createdAt, updatedAt, title, description, completed]; + List get $columns => [ + id, + createdAt, + updatedAt, + title, + description, + completed, + ]; @override String get aliasedName => _alias ?? actualTableName; @override @@ -269,38 +341,50 @@ class $TodosTableTable extends i4.TodosTable static const String $name = 'todos'; @override i0.VerificationContext validateIntegrity( - i0.Insertable instance, - {bool isInserting = false}) { + i0.Insertable instance, { + bool isInserting = false, + }) { final context = i0.VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } if (data.containsKey('created_at')) { - context.handle(_createdAtMeta, - createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta)); + context.handle( + _createdAtMeta, + createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta), + ); } if (data.containsKey('updated_at')) { - context.handle(_updatedAtMeta, - updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta)); + context.handle( + _updatedAtMeta, + updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta), + ); } if (data.containsKey('title')) { context.handle( - _titleMeta, title.isAcceptableOrUnknown(data['title']!, _titleMeta)); + _titleMeta, + title.isAcceptableOrUnknown(data['title']!, _titleMeta), + ); } else if (isInserting) { context.missing(_titleMeta); } if (data.containsKey('description')) { context.handle( + _descriptionMeta, + description.isAcceptableOrUnknown( + data['description']!, _descriptionMeta, - description.isAcceptableOrUnknown( - data['description']!, _descriptionMeta)); + ), + ); } else if (isInserting) { context.missing(_descriptionMeta); } if (data.containsKey('completed')) { - context.handle(_completedMeta, - completed.isAcceptableOrUnknown(data['completed']!, _completedMeta)); + context.handle( + _completedMeta, + completed.isAcceptableOrUnknown(data['completed']!, _completedMeta), + ); } return context; } @@ -311,20 +395,30 @@ class $TodosTableTable extends i4.TodosTable i1.TodosTableData map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return i1.TodosTableData( - id: attachedDatabase.typeMapping - .read(i3.PgTypes.uuid, data['${effectivePrefix}id'])!, + id: attachedDatabase.typeMapping.read( + i3.PgTypes.uuid, + data['${effectivePrefix}id'], + )!, createdAt: attachedDatabase.typeMapping.read( - i3.PgTypes.timestampWithTimezone, - data['${effectivePrefix}created_at'])!, + i3.PgTypes.timestampWithTimezone, + data['${effectivePrefix}created_at'], + )!, updatedAt: attachedDatabase.typeMapping.read( - i3.PgTypes.timestampWithTimezone, - data['${effectivePrefix}updated_at'])!, - title: attachedDatabase.typeMapping - .read(i0.DriftSqlType.string, data['${effectivePrefix}title'])!, - description: attachedDatabase.typeMapping - .read(i0.DriftSqlType.string, data['${effectivePrefix}description'])!, - completed: attachedDatabase.typeMapping - .read(i0.DriftSqlType.bool, data['${effectivePrefix}completed'])!, + i3.PgTypes.timestampWithTimezone, + data['${effectivePrefix}updated_at'], + )!, + title: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}title'], + )!, + description: attachedDatabase.typeMapping.read( + i0.DriftSqlType.string, + data['${effectivePrefix}description'], + )!, + completed: attachedDatabase.typeMapping.read( + i0.DriftSqlType.bool, + data['${effectivePrefix}completed'], + )!, ); } @@ -342,21 +436,26 @@ class TodosTableData extends i0.DataClass final String title; final String description; final bool completed; - const TodosTableData( - {required this.id, - required this.createdAt, - required this.updatedAt, - required this.title, - required this.description, - required this.completed}); + const TodosTableData({ + required this.id, + required this.createdAt, + required this.updatedAt, + required this.title, + required this.description, + required this.completed, + }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = i0.Variable(id, i3.PgTypes.uuid); - map['created_at'] = - i0.Variable(createdAt, i3.PgTypes.timestampWithTimezone); - map['updated_at'] = - i0.Variable(updatedAt, i3.PgTypes.timestampWithTimezone); + map['created_at'] = i0.Variable( + createdAt, + i3.PgTypes.timestampWithTimezone, + ); + map['updated_at'] = i0.Variable( + updatedAt, + i3.PgTypes.timestampWithTimezone, + ); map['title'] = i0.Variable(title); map['description'] = i0.Variable(description); map['completed'] = i0.Variable(completed); @@ -374,8 +473,10 @@ class TodosTableData extends i0.DataClass ); } - factory TodosTableData.fromJson(Map json, - {i0.ValueSerializer? serializer}) { + factory TodosTableData.fromJson( + Map json, { + i0.ValueSerializer? serializer, + }) { serializer ??= i0.driftRuntimeOptions.defaultSerializer; return TodosTableData( id: serializer.fromJson(json['id']), @@ -399,29 +500,30 @@ class TodosTableData extends i0.DataClass }; } - i1.TodosTableData copyWith( - {i2.UuidValue? id, - i3.PgDateTime? createdAt, - i3.PgDateTime? updatedAt, - String? title, - String? description, - bool? completed}) => - i1.TodosTableData( - id: id ?? this.id, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - title: title ?? this.title, - description: description ?? this.description, - completed: completed ?? this.completed, - ); + i1.TodosTableData copyWith({ + i2.UuidValue? id, + i3.PgDateTime? createdAt, + i3.PgDateTime? updatedAt, + String? title, + String? description, + bool? completed, + }) => i1.TodosTableData( + id: id ?? this.id, + createdAt: createdAt ?? this.createdAt, + updatedAt: updatedAt ?? this.updatedAt, + title: title ?? this.title, + description: description ?? this.description, + completed: completed ?? this.completed, + ); TodosTableData copyWithCompanion(i1.TodosTableCompanion data) { return TodosTableData( id: data.id.present ? data.id.value : this.id, createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, title: data.title.present ? data.title.value : this.title, - description: - data.description.present ? data.description.value : this.description, + description: data.description.present + ? data.description.value + : this.description, completed: data.completed.present ? data.completed.value : this.completed, ); } @@ -479,8 +581,8 @@ class TodosTableCompanion extends i0.UpdateCompanion { required String description, this.completed = const i0.Value.absent(), this.rowid = const i0.Value.absent(), - }) : title = i0.Value(title), - description = i0.Value(description); + }) : title = i0.Value(title), + description = i0.Value(description); static i0.Insertable custom({ i0.Expression? id, i0.Expression? createdAt, @@ -501,14 +603,15 @@ class TodosTableCompanion extends i0.UpdateCompanion { }); } - i1.TodosTableCompanion copyWith( - {i0.Value? id, - i0.Value? createdAt, - i0.Value? updatedAt, - i0.Value? title, - i0.Value? description, - i0.Value? completed, - i0.Value? rowid}) { + i1.TodosTableCompanion copyWith({ + i0.Value? id, + i0.Value? createdAt, + i0.Value? updatedAt, + i0.Value? title, + i0.Value? description, + i0.Value? completed, + i0.Value? rowid, + }) { return i1.TodosTableCompanion( id: id ?? this.id, createdAt: createdAt ?? this.createdAt, @@ -528,11 +631,15 @@ class TodosTableCompanion extends i0.UpdateCompanion { } if (createdAt.present) { map['created_at'] = i0.Variable( - createdAt.value, i3.PgTypes.timestampWithTimezone); + createdAt.value, + i3.PgTypes.timestampWithTimezone, + ); } if (updatedAt.present) { map['updated_at'] = i0.Variable( - updatedAt.value, i3.PgTypes.timestampWithTimezone); + updatedAt.value, + i3.PgTypes.timestampWithTimezone, + ); } if (title.present) { map['title'] = i0.Variable(title.value); diff --git a/lib/shared/data/success_response.dart b/lib/shared/data/success_response.dart index c890993..129bd92 100644 --- a/lib/shared/data/success_response.dart +++ b/lib/shared/data/success_response.dart @@ -5,9 +5,7 @@ part 'success_response.g.dart'; @freezed abstract class SuccessResponse with _$SuccessResponse { - const factory SuccessResponse({ - required String message, - }) = _SuccessResponse; + const factory SuccessResponse({required String message}) = _SuccessResponse; factory SuccessResponse.fromJson(Map json) => _$SuccessResponseFromJson(json); diff --git a/lib/shared/database/primary_key_mixin.dart b/lib/shared/database/primary_key_mixin.dart index 2e88eab..35d2abc 100644 --- a/lib/shared/database/primary_key_mixin.dart +++ b/lib/shared/database/primary_key_mixin.dart @@ -2,8 +2,9 @@ import 'package:drift/drift.dart'; import 'package:drift_postgres/drift_postgres.dart'; mixin PrimaryKeyMixin on Table { - late final id = customType(PgTypes.uuid) - .withDefault(const FunctionCallExpression('gen_random_uuid', []))(); + late final id = customType( + PgTypes.uuid, + ).withDefault(const FunctionCallExpression('gen_random_uuid', []))(); @override Set get primaryKey => {id}; diff --git a/lib/shared/database/timestamps_mixin.dart b/lib/shared/database/timestamps_mixin.dart index 5323598..417d736 100644 --- a/lib/shared/database/timestamps_mixin.dart +++ b/lib/shared/database/timestamps_mixin.dart @@ -9,11 +9,13 @@ mixin TimestampsMixin on Table { @mustBeOverridden String get tableName; - late final createdAt = customType(PgTypes.timestampWithTimezone) - .withDefault(const FunctionCallExpression('now', []))(); + late final createdAt = customType( + PgTypes.timestampWithTimezone, + ).withDefault(const FunctionCallExpression('now', []))(); - late final updatedAt = customType(PgTypes.timestampWithTimezone) - .withDefault(const FunctionCallExpression('now', []))(); + late final updatedAt = customType( + PgTypes.timestampWithTimezone, + ).withDefault(const FunctionCallExpression('now', []))(); String generateUpdateAtTrigger() { return ''' diff --git a/lib/shared/extensions/luthor_extension.dart b/lib/shared/extensions/luthor_extension.dart index c26aa7f..0102bf9 100644 --- a/lib/shared/extensions/luthor_extension.dart +++ b/lib/shared/extensions/luthor_extension.dart @@ -1,16 +1,16 @@ import 'package:arcade/arcade.dart'; import 'package:luthor/luthor.dart'; -typedef SchemaValidationResultMapper = SchemaValidationResult Function( - Map json, -); +typedef SchemaValidationResultMapper = + SchemaValidationResult Function(Map json); extension LuthorExtension on SchemaValidationResultMapper { Future withContext(RequestContext context) async { final body = switch (await context.jsonMap()) { BodyParseSuccess(value: final value) => value, - BodyParseFailure(error: final error) => - throw BadRequestException(message: 'Invalid JSON: $error'), + BodyParseFailure(error: final error) => throw BadRequestException( + message: 'Invalid JSON: $error', + ), }; final result = this(body); From 9a471532af6291222b9f4a3ac27d1fa445744be0 Mon Sep 17 00:00:00 2001 From: exaby73 Date: Sat, 7 Feb 2026 02:14:18 +0530 Subject: [PATCH 3/4] chore: Add build step to CI workflow --- .github/workflows/check.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 9cfc955..195c0cb 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -57,6 +57,10 @@ jobs: shell: bash run: dart pub get + - name: Run build + shell: bash + run: dpk run build + - name: Run analyze shell: bash run: dpk run ci:analyze From 8da4b4de179665e49fb60582eedb1c8fda0cff6a Mon Sep 17 00:00:00 2001 From: exaby73 Date: Sat, 7 Feb 2026 02:15:41 +0530 Subject: [PATCH 4/4] chore: Add step to copy .env.example to .env in CI workflow --- .github/workflows/check.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 195c0cb..78388dc 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -57,6 +57,10 @@ jobs: shell: bash run: dart pub get + - name: Copy .env.example to .env + shell: bash + run: cp .env.example .env + - name: Run build shell: bash run: dpk run build