From 5e9ec00183d70ff83dab1aec50bdb73e0ecf3af8 Mon Sep 17 00:00:00 2001 From: Taylor Y Date: Fri, 28 Jul 2023 15:47:26 -0700 Subject: [PATCH] fresh sessions upgrade and more --- .github/workflows/deno.yml | 2 +- deno.json | 25 ++- deno.lock | 341 +++++++++++++++++++++++++++++++++++++ fresh.gen.ts | 2 - import_map.json | 18 -- routes/_middleware.jsx | 147 ++++++++-------- routes/deal.jsx | 5 +- routes/draw.jsx | 23 ++- test/1_puppet_test.js | 18 +- test/2_game_test.js | 5 +- test/api_test.js | 2 +- test/wrapper.js | 27 +++ 12 files changed, 499 insertions(+), 116 deletions(-) create mode 100644 deno.lock delete mode 100644 import_map.json create mode 100644 test/wrapper.js diff --git a/.github/workflows/deno.yml b/.github/workflows/deno.yml index 656ad04..c9feb0d 100644 --- a/.github/workflows/deno.yml +++ b/.github/workflows/deno.yml @@ -32,7 +32,7 @@ jobs: # uses: denoland/setup-deno@v1 uses: denoland/setup-deno@v1 with: - deno-version: v1.30.3 + deno-version: v1.35.3 - name: Verify formatting run: deno fmt --check diff --git a/deno.json b/deno.json index 7bbe842..3dd3419 100644 --- a/deno.json +++ b/deno.json @@ -1,10 +1,9 @@ { "tasks": { - "start": "deno run -A --watch=static/,routes/ --lock=deno.lock dev.ts", - "run": "DENO_DEPLOYMENT_ID=$(git rev-parse --short HEAD) deno run -A --lock=deno.lock main.ts", - "reload": "deno run -A --watch=static/,routes/ --lock=deno.lock --reload dev.ts" + "start": "deno run -A --unstable --watch=static/,routes/ --lock=deno.lock dev.ts", + "run": "DENO_DEPLOYMENT_ID=$(git rev-parse --short HEAD) deno run -A --unstable --lock=deno.lock main.ts", + "reload": "deno run -A --unstable --watch=static/,routes/ --lock=deno.lock --reload dev.ts" }, - "importMap": "./import_map.json", "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "preact" @@ -14,5 +13,21 @@ "semiColons": false } }, - "lock": false + "lock": false, + "imports": { + "@/": "./", + "$fresh/": "https://deno.land/x/fresh@1.3.1/", + "$std/": "https://deno.land/std@0.196.0/", + "fresh_seo": "https://deno.land/x/fresh_seo@0.2.1/mod.ts", + "preact": "https://esm.sh/preact@10.15.1", + "preact/": "https://esm.sh/preact@10.15.1/", + "preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.1.0", + "twind": "https://esm.sh/twind@0.16.19", + "twind/": "https://esm.sh/twind@0.16.19/", + "redis": "https://deno.land/x/redis@v0.29.0/mod.ts", + "@preact/signals": "https://esm.sh/*@preact/signals@1.1.3", + "@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.2.3", + "envalid": "https://deno.land/x/envalid@0.1.2/mod.ts", + "fresh-session/": "https://deno.land/x/fresh_session@0.2.2/" + } } diff --git a/deno.lock b/deno.lock new file mode 100644 index 0000000..630f005 --- /dev/null +++ b/deno.lock @@ -0,0 +1,341 @@ +{ + "version": "2", + "remote": { + "https://deno.land/std@0.128.0/_deno_unstable.ts": "23a1a36928f1b6d3b0170aaa67de09af12aa998525f608ff7331b9fb364cbde6", + "https://deno.land/std@0.128.0/_util/assert.ts": "e94f2eb37cebd7f199952e242c77654e43333c1ac4c5c700e929ea3aa5489f74", + "https://deno.land/std@0.128.0/_util/os.ts": "49b92edea1e82ba295ec946de8ffd956ed123e2948d9bd1d3e901b04e4307617", + "https://deno.land/std@0.128.0/fs/_util.ts": "0fb24eb4bfebc2c194fb1afdb42b9c3dda12e368f43e8f2321f84fc77d42cb0f", + "https://deno.land/std@0.128.0/fs/copy.ts": "9248d1492599957af8c693ceb10a432b09f0b0b61c60a4d6aff29b0c7d3a17b3", + "https://deno.land/std@0.128.0/fs/empty_dir.ts": "7274d87160de34cbed0531e284df383045cf43543bbeadeb97feac598bd8f3c5", + "https://deno.land/std@0.128.0/fs/ensure_dir.ts": "9dc109c27df4098b9fc12d949612ae5c9c7169507660dcf9ad90631833209d9d", + "https://deno.land/std@0.128.0/fs/ensure_file.ts": "7d353e64fee3d4d1e7c6b6726a2a5e987ba402c15fb49566309042887349c545", + "https://deno.land/std@0.128.0/fs/ensure_link.ts": "489e23df9fe3e6636048b5830ddf0f111eb29621eb85719255ad9bd645f3471b", + "https://deno.land/std@0.128.0/fs/ensure_symlink.ts": "88dc83de1bc90ed883dd458c2d2eae3d5834a4617d12925734836e1f0803b274", + "https://deno.land/std@0.128.0/fs/eol.ts": "b92f0b88036de507e7e6fbedbe8f666835ea9dcbf5ac85917fa1fadc919f83a5", + "https://deno.land/std@0.128.0/fs/exists.ts": "cb734d872f8554ea40b8bff77ad33d4143c1187eac621a55bf37781a43c56f6d", + "https://deno.land/std@0.128.0/fs/expand_glob.ts": "0c10130d67c9b02164b03df8e43c6d6defbf8e395cb69d09e84a8586e6d72ac3", + "https://deno.land/std@0.128.0/fs/mod.ts": "4dc052c461c171abb5c25f6e0f218ab838a716230930b534ba351745864b7d6d", + "https://deno.land/std@0.128.0/fs/move.ts": "0573cedcf583f09a9494f2dfccbf67de68a93629942d6b5e6e74a9e45d4e8a2e", + "https://deno.land/std@0.128.0/fs/walk.ts": "117403ccd21fd322febe56ba06053b1ad5064c802170f19b1ea43214088fe95f", + "https://deno.land/std@0.128.0/path/_constants.ts": "df1db3ffa6dd6d1252cc9617e5d72165cd2483df90e93833e13580687b6083c3", + "https://deno.land/std@0.128.0/path/_interface.ts": "ee3b431a336b80cf445441109d089b70d87d5e248f4f90ff906820889ecf8d09", + "https://deno.land/std@0.128.0/path/_util.ts": "c1e9686d0164e29f7d880b2158971d805b6e0efc3110d0b3e24e4b8af2190d2b", + "https://deno.land/std@0.128.0/path/common.ts": "bee563630abd2d97f99d83c96c2fa0cca7cee103e8cb4e7699ec4d5db7bd2633", + "https://deno.land/std@0.128.0/path/glob.ts": "cb5255638de1048973c3e69e420c77dc04f75755524cb3b2e160fe9277d939ee", + "https://deno.land/std@0.128.0/path/mod.ts": "4275129bb766f0e475ecc5246aa35689eeade419d72a48355203f31802640be7", + "https://deno.land/std@0.128.0/path/posix.ts": "663e4a6fe30a145f56aa41a22d95114c4c5582d8b57d2d7c9ed27ad2c47636bb", + "https://deno.land/std@0.128.0/path/separator.ts": "fe1816cb765a8068afb3e8f13ad272351c85cbc739af56dacfc7d93d710fe0f9", + "https://deno.land/std@0.128.0/path/win32.ts": "e7bdf63e8d9982b4d8a01ef5689425c93310ece950e517476e22af10f41a136e", + "https://deno.land/std@0.140.0/_util/assert.ts": "e94f2eb37cebd7f199952e242c77654e43333c1ac4c5c700e929ea3aa5489f74", + "https://deno.land/std@0.140.0/_util/os.ts": "3b4c6e27febd119d36a416d7a97bd3b0251b77c88942c8f16ee5953ea13e2e49", + "https://deno.land/std@0.140.0/bytes/bytes_list.ts": "67eb118e0b7891d2f389dad4add35856f4ad5faab46318ff99653456c23b025d", + "https://deno.land/std@0.140.0/bytes/equals.ts": "fc16dff2090cced02497f16483de123dfa91e591029f985029193dfaa9d894c9", + "https://deno.land/std@0.140.0/bytes/mod.ts": "763f97d33051cc3f28af1a688dfe2830841192a9fea0cbaa55f927b49d49d0bf", + "https://deno.land/std@0.140.0/encoding/base64.ts": "c8c16b4adaa60d7a8eee047c73ece26844435e8f7f1328d74593dbb2dd58ea4f", + "https://deno.land/std@0.140.0/encoding/base64url.ts": "55f9d13df02efac10c6f96169daa3e702606a64e8aa27c0295f645f198c27130", + "https://deno.land/std@0.140.0/fmt/colors.ts": "30455035d6d728394781c10755351742dd731e3db6771b1843f9b9e490104d37", + "https://deno.land/std@0.140.0/fs/_util.ts": "0fb24eb4bfebc2c194fb1afdb42b9c3dda12e368f43e8f2321f84fc77d42cb0f", + "https://deno.land/std@0.140.0/fs/ensure_dir.ts": "9dc109c27df4098b9fc12d949612ae5c9c7169507660dcf9ad90631833209d9d", + "https://deno.land/std@0.140.0/fs/expand_glob.ts": "0c10130d67c9b02164b03df8e43c6d6defbf8e395cb69d09e84a8586e6d72ac3", + "https://deno.land/std@0.140.0/fs/walk.ts": "117403ccd21fd322febe56ba06053b1ad5064c802170f19b1ea43214088fe95f", + "https://deno.land/std@0.140.0/hash/sha256.ts": "803846c7a5a8a5a97f31defeb37d72f519086c880837129934f5d6f72102a8e8", + "https://deno.land/std@0.140.0/io/buffer.ts": "bd0c4bf53db4b4be916ca5963e454bddfd3fcd45039041ea161dbf826817822b", + "https://deno.land/std@0.140.0/path/_constants.ts": "df1db3ffa6dd6d1252cc9617e5d72165cd2483df90e93833e13580687b6083c3", + "https://deno.land/std@0.140.0/path/_interface.ts": "ee3b431a336b80cf445441109d089b70d87d5e248f4f90ff906820889ecf8d09", + "https://deno.land/std@0.140.0/path/_util.ts": "c1e9686d0164e29f7d880b2158971d805b6e0efc3110d0b3e24e4b8af2190d2b", + "https://deno.land/std@0.140.0/path/common.ts": "bee563630abd2d97f99d83c96c2fa0cca7cee103e8cb4e7699ec4d5db7bd2633", + "https://deno.land/std@0.140.0/path/glob.ts": "cb5255638de1048973c3e69e420c77dc04f75755524cb3b2e160fe9277d939ee", + "https://deno.land/std@0.140.0/path/mod.ts": "d3e68d0abb393fb0bf94a6d07c46ec31dc755b544b13144dee931d8d5f06a52d", + "https://deno.land/std@0.140.0/path/posix.ts": "293cdaec3ecccec0a9cc2b534302dfe308adb6f10861fa183275d6695faace44", + "https://deno.land/std@0.140.0/path/separator.ts": "fe1816cb765a8068afb3e8f13ad272351c85cbc739af56dacfc7d93d710fe0f9", + "https://deno.land/std@0.140.0/path/win32.ts": "31811536855e19ba37a999cd8d1b62078235548d67902ece4aa6b814596dd757", + "https://deno.land/std@0.140.0/streams/conversion.ts": "712585bfa0172a97fb68dd46e784ae8ad59d11b88079d6a4ab098ff42e697d21", + "https://deno.land/std@0.145.0/async/delay.ts": "cbbdf1c87d1aed8edc7bae13592fb3e27e3106e0748f089c263390d4f49e5f6c", + "https://deno.land/std@0.145.0/collections/_comparators.ts": "b9edf2170aaccbe11407d37e8948b6867cf68fbe5225f4cd4cdb02f174227157", + "https://deno.land/std@0.145.0/collections/bs_node.ts": "36a926233eb304d2538274988dfb71bf79ecc2dc4075a6671f99550b9ac435bf", + "https://deno.land/std@0.145.0/collections/bs_tree.ts": "c7e598b455130582426804acdfaf4f59f1cc280a53c1fc0d54d8be6e9133e9ad", + "https://deno.land/std@0.145.0/collections/rb_node.ts": "bf18196024353e89a5ead656f4ad77622c47cca7b281391c41703623023c6f25", + "https://deno.land/std@0.145.0/collections/rb_tree.ts": "5c850ef0e7f83421fd69e1e8fc7a898bd0a2806982fbe895103b1d8d1b46425d", + "https://deno.land/std@0.145.0/fmt/colors.ts": "6f9340b7fb8cc25a993a99e5efc56fe81bb5af284ff412129dd06df06f53c0b4", + "https://deno.land/std@0.145.0/testing/_diff.ts": "029a00560b0d534bc0046f1bce4bd36b3b41ada3f2a3178c85686eb2ff5f1413", + "https://deno.land/std@0.145.0/testing/_format.ts": "0d8dc79eab15b67cdc532826213bbe05bccfd276ca473a50a3fc7bbfb7260642", + "https://deno.land/std@0.145.0/testing/_time.ts": "d1433659f3f0394b38af6e5ae853ee67c61d01171c65dce0f9536b047320d908", + "https://deno.land/std@0.145.0/testing/asserts.ts": "319df43e1e6bba2520508f6090a21a9a640cbe2754d255aee17cd1dfa78c2ff6", + "https://deno.land/std@0.145.0/testing/time.ts": "c576691bb7131bbc526011b4767aad1b0439a87cefbe17fa52215f0ee299f800", + "https://deno.land/std@0.153.0/_util/assert.ts": "e94f2eb37cebd7f199952e242c77654e43333c1ac4c5c700e929ea3aa5489f74", + "https://deno.land/std@0.153.0/_util/os.ts": "3b4c6e27febd119d36a416d7a97bd3b0251b77c88942c8f16ee5953ea13e2e49", + "https://deno.land/std@0.153.0/fmt/colors.ts": "ff7dc9c9f33a72bd48bc24b21bbc1b4545d8494a431f17894dbc5fe92a938fc4", + "https://deno.land/std@0.153.0/path/_constants.ts": "df1db3ffa6dd6d1252cc9617e5d72165cd2483df90e93833e13580687b6083c3", + "https://deno.land/std@0.153.0/path/_interface.ts": "ee3b431a336b80cf445441109d089b70d87d5e248f4f90ff906820889ecf8d09", + "https://deno.land/std@0.153.0/path/_util.ts": "d16be2a16e1204b65f9d0dfc54a9bc472cafe5f4a190b3c8471ec2016ccd1677", + "https://deno.land/std@0.153.0/path/common.ts": "bee563630abd2d97f99d83c96c2fa0cca7cee103e8cb4e7699ec4d5db7bd2633", + "https://deno.land/std@0.153.0/path/glob.ts": "cb5255638de1048973c3e69e420c77dc04f75755524cb3b2e160fe9277d939ee", + "https://deno.land/std@0.153.0/path/mod.ts": "56fec03ad0ebd61b6ab39ddb9b0ddb4c4a5c9f2f4f632e09dd37ec9ebfd722ac", + "https://deno.land/std@0.153.0/path/posix.ts": "c1f7afe274290ea0b51da07ee205653b2964bd74909a82deb07b69a6cc383aaa", + "https://deno.land/std@0.153.0/path/separator.ts": "fe1816cb765a8068afb3e8f13ad272351c85cbc739af56dacfc7d93d710fe0f9", + "https://deno.land/std@0.153.0/path/win32.ts": "bd7549042e37879c68ff2f8576a25950abbfca1d696d41d82c7bca0b7e6f452c", + "https://deno.land/std@0.173.0/_util/asserts.ts": "178dfc49a464aee693a7e285567b3d0b555dc805ff490505a8aae34f9cfb1462", + "https://deno.land/std@0.173.0/_util/os.ts": "d932f56d41e4f6a6093d56044e29ce637f8dcc43c5a90af43504a889cf1775e3", + "https://deno.land/std@0.173.0/encoding/base32.ts": "cb15f16e53c580d2491637280302bc6cfeb48f8911521ea9c7895ba513a2bcc5", + "https://deno.land/std@0.173.0/encoding/jsonc.ts": "02b86115d2b812f26789481ebcf4748171e8ece6514b60243b3733e2c200876a", + "https://deno.land/std@0.173.0/fs/_util.ts": "65381f341af1ff7f40198cee15c20f59951ac26e51ddc651c5293e24f9ce6f32", + "https://deno.land/std@0.173.0/fs/copy.ts": "14214efd94fc3aa6db1e4af2b4b9578e50f7362b7f3725d5a14ad259a5df26c8", + "https://deno.land/std@0.173.0/fs/empty_dir.ts": "c3d2da4c7352fab1cf144a1ecfef58090769e8af633678e0f3fabaef98594688", + "https://deno.land/std@0.173.0/fs/ensure_dir.ts": "724209875497a6b4628dfb256116e5651c4f7816741368d6c44aab2531a1e603", + "https://deno.land/std@0.173.0/fs/ensure_file.ts": "c38602670bfaf259d86ca824a94e6cb9e5eb73757fefa4ebf43a90dd017d53d9", + "https://deno.land/std@0.173.0/fs/ensure_link.ts": "c0f5b2f0ec094ed52b9128eccb1ee23362a617457aa0f699b145d4883f5b2fb4", + "https://deno.land/std@0.173.0/fs/ensure_symlink.ts": "2955cc8332aeca9bdfefd05d8d3976b94e282b0f353392a71684808ed2ffdd41", + "https://deno.land/std@0.173.0/fs/eol.ts": "f1f2eb348a750c34500741987b21d65607f352cf7205f48f4319d417fff42842", + "https://deno.land/std@0.173.0/fs/exists.ts": "b8c8a457b71e9d7f29b9d2f87aad8dba2739cbe637e8926d6ba6e92567875f8e", + "https://deno.land/std@0.173.0/fs/expand_glob.ts": "45d17e89796a24bd6002e4354eda67b4301bb8ba67d2cac8453cdabccf1d9ab0", + "https://deno.land/std@0.173.0/fs/mod.ts": "bc3d0acd488cc7b42627044caf47d72019846d459279544e1934418955ba4898", + "https://deno.land/std@0.173.0/fs/move.ts": "4cb47f880e3f0582c55e71c9f8b1e5e8cfaacb5e84f7390781dd563b7298ec19", + "https://deno.land/std@0.173.0/fs/walk.ts": "ea95ffa6500c1eda6b365be488c056edc7c883a1db41ef46ec3bf057b1c0fe32", + "https://deno.land/std@0.173.0/path/_constants.ts": "e49961f6f4f48039c0dfed3c3f93e963ca3d92791c9d478ac5b43183413136e0", + "https://deno.land/std@0.173.0/path/_interface.ts": "6471159dfbbc357e03882c2266d21ef9afdb1e4aa771b0545e90db58a0ba314b", + "https://deno.land/std@0.173.0/path/_util.ts": "86c2375a996c1931b2f2ac71fefd5ddf0cf0e579fa4ab12d3e4c552d4223b8d8", + "https://deno.land/std@0.173.0/path/common.ts": "ee7505ab01fd22de3963b64e46cff31f40de34f9f8de1fff6a1bd2fe79380000", + "https://deno.land/std@0.173.0/path/glob.ts": "d479e0a695621c94d3fd7fe7abd4f9499caf32a8de13f25073451c6ef420a4e1", + "https://deno.land/std@0.173.0/path/mod.ts": "4b83694ac500d7d31b0cdafc927080a53dc0c3027eb2895790fb155082b0d232", + "https://deno.land/std@0.173.0/path/posix.ts": "0874b341c2c6968ca38d323338b8b295ea1dae10fa872a768d812e2e7d634789", + "https://deno.land/std@0.173.0/path/separator.ts": "0fb679739d0d1d7bf45b68dacfb4ec7563597a902edbaf3c59b50d5bcadd93b1", + "https://deno.land/std@0.173.0/path/win32.ts": "672942919dd66ce1b8c224e77d3447e2ad8254eaff13fe6946420a9f78fa141e", + "https://deno.land/std@0.193.0/_util/asserts.ts": "178dfc49a464aee693a7e285567b3d0b555dc805ff490505a8aae34f9cfb1462", + "https://deno.land/std@0.193.0/_util/os.ts": "d932f56d41e4f6a6093d56044e29ce637f8dcc43c5a90af43504a889cf1775e3", + "https://deno.land/std@0.193.0/async/abortable.ts": "fd682fa46f3b7b16b4606a5ab52a7ce309434b76f820d3221bdfb862719a15d7", + "https://deno.land/std@0.193.0/async/deadline.ts": "58f72a3cc0fcb731b2cc055ba046f4b5be3349ff6bf98f2e793c3b969354aab2", + "https://deno.land/std@0.193.0/async/debounce.ts": "adab11d04ca38d699444ac8a9d9856b4155e8dda2afd07ce78276c01ea5a4332", + "https://deno.land/std@0.193.0/async/deferred.ts": "42790112f36a75a57db4a96d33974a936deb7b04d25c6084a9fa8a49f135def8", + "https://deno.land/std@0.193.0/async/delay.ts": "73aa04cec034c84fc748c7be49bb15cac3dd43a57174bfdb7a4aec22c248f0dd", + "https://deno.land/std@0.193.0/async/mod.ts": "f04344fa21738e5ad6bea37a6bfffd57c617c2d372bb9f9dcfd118a1b622e576", + "https://deno.land/std@0.193.0/async/mux_async_iterator.ts": "70c7f2ee4e9466161350473ad61cac0b9f115cff4c552eaa7ef9d50c4cbb4cc9", + "https://deno.land/std@0.193.0/async/pool.ts": "f1b8d3df4d7fd3c73f8cbc91cc2e8b8e950910f1eab94230b443944d7584c657", + "https://deno.land/std@0.193.0/async/retry.ts": "b1ccf653954a4e52b3d9731e57d18b864e689a7462e78fb20440b11be9905080", + "https://deno.land/std@0.193.0/async/tee.ts": "47e42d35f622650b02234d43803d0383a89eb4387e1b83b5a40106d18ae36757", + "https://deno.land/std@0.193.0/crypto/to_hash_string.ts": "6927c768f3e373a1be4a31555a45ccecf7bd413105455cc334ad3f908cfa986f", + "https://deno.land/std@0.193.0/datetime/constants.ts": "b63a6b702e06fa028fb2ffa25e0cf775e3b21cf7f38e53a6f219e9641894dfbb", + "https://deno.land/std@0.193.0/encoding/base64.ts": "144ae6234c1fbe5b68666c711dc15b1e9ee2aef6d42b3b4345bf9a6c91d70d0d", + "https://deno.land/std@0.193.0/encoding/hex.ts": "b4b1a7cb678745b0bf181ed8cf2498c7be00d121a7de244b752fbf9c7d9c48cd", + "https://deno.land/std@0.193.0/flags/mod.ts": "17f444ddbee43c5487568de0c6a076c7729cfe90d96d2ffcd2b8f8adadafb6e8", + "https://deno.land/std@0.193.0/fmt/colors.ts": "d67e3cd9f472535241a8e410d33423980bec45047e343577554d3356e1f0ef4e", + "https://deno.land/std@0.193.0/fs/_util.ts": "fbf57dcdc9f7bc8128d60301eece608246971a7836a3bb1e78da75314f08b978", + "https://deno.land/std@0.193.0/fs/copy.ts": "14214efd94fc3aa6db1e4af2b4b9578e50f7362b7f3725d5a14ad259a5df26c8", + "https://deno.land/std@0.193.0/fs/empty_dir.ts": "c3d2da4c7352fab1cf144a1ecfef58090769e8af633678e0f3fabaef98594688", + "https://deno.land/std@0.193.0/fs/ensure_dir.ts": "dc64c4c75c64721d4e3fb681f1382f803ff3d2868f08563ff923fdd20d071c40", + "https://deno.land/std@0.193.0/fs/ensure_file.ts": "c38602670bfaf259d86ca824a94e6cb9e5eb73757fefa4ebf43a90dd017d53d9", + "https://deno.land/std@0.193.0/fs/ensure_link.ts": "c0f5b2f0ec094ed52b9128eccb1ee23362a617457aa0f699b145d4883f5b2fb4", + "https://deno.land/std@0.193.0/fs/ensure_symlink.ts": "5006ab2f458159c56d689b53b1e48d57e05eeb1eaf64e677f7f76a30bc4fdba1", + "https://deno.land/std@0.193.0/fs/eol.ts": "f1f2eb348a750c34500741987b21d65607f352cf7205f48f4319d417fff42842", + "https://deno.land/std@0.193.0/fs/exists.ts": "29c26bca8584a22876be7cb8844f1b6c8fc35e9af514576b78f5c6884d7ed02d", + "https://deno.land/std@0.193.0/fs/expand_glob.ts": "e4f56259a0a70fe23f05215b00de3ac5e6ba46646ab2a06ebbe9b010f81c972a", + "https://deno.land/std@0.193.0/fs/mod.ts": "bc3d0acd488cc7b42627044caf47d72019846d459279544e1934418955ba4898", + "https://deno.land/std@0.193.0/fs/move.ts": "b4f8f46730b40c32ea3c0bc8eb0fd0e8139249a698883c7b3756424cf19785c9", + "https://deno.land/std@0.193.0/fs/walk.ts": "920be35a7376db6c0b5b1caf1486fb962925e38c9825f90367f8f26b5e5d0897", + "https://deno.land/std@0.193.0/http/http_status.ts": "8a7bcfe3ac025199ad804075385e57f63d055b2aed539d943ccc277616d6f932", + "https://deno.land/std@0.193.0/http/server.ts": "1b23463b5b36e4eebc495417f6af47a6f7d52e3294827a1226d2a1aab23d9d20", + "https://deno.land/std@0.193.0/jsonc/mod.ts": "b88dce28eb3645667caa856538ae2fe87af51410822544a0b45a4177ef3bd7dd", + "https://deno.land/std@0.193.0/jsonc/parse.ts": "2910e33bc7c3b243e3b6f3a39ce4d6ca84337b277a8df6f2ad2d9e4adbcddc08", + "https://deno.land/std@0.193.0/media_types/_db.ts": "7606d83e31f23ce1a7968cbaee852810c2cf477903a095696cdc62eaab7ce570", + "https://deno.land/std@0.193.0/media_types/_util.ts": "916efbd30b6148a716f110e67a4db29d6949bf4048997b754415dd7e42c52378", + "https://deno.land/std@0.193.0/media_types/content_type.ts": "ad98a5aa2d95f5965b2796072284258710a25e520952376ed432b0937ce743bc", + "https://deno.land/std@0.193.0/media_types/extension.ts": "a7cd28c9417143387cdfed27d4e8607ebcf5b1ec27eb8473d5b000144689fe65", + "https://deno.land/std@0.193.0/media_types/extensions_by_type.ts": "43806d6a52a0d6d965ada9d20e60a982feb40bc7a82268178d94edb764694fed", + "https://deno.land/std@0.193.0/media_types/format_media_type.ts": "f5e1073c05526a6f5a516ac5c5587a1abd043bf1039c71cde1166aa4328c8baf", + "https://deno.land/std@0.193.0/media_types/get_charset.ts": "18b88274796fda5d353806bf409eb1d2ddb3f004eb4bd311662c4cdd8ac173db", + "https://deno.land/std@0.193.0/media_types/mod.ts": "d3f0b99f85053bc0b98ecc24eaa3546dfa09b856dc0bbaf60d8956d2cdd710c8", + "https://deno.land/std@0.193.0/media_types/parse_media_type.ts": "835c4112e1357e95b4f10d7cdea5ae1801967e444f48673ff8f1cb4d32af9920", + "https://deno.land/std@0.193.0/media_types/type_by_extension.ts": "daa801eb0f11cdf199445d0f1b656cf116d47dcf9e5b85cc1e6b4469f5ee0432", + "https://deno.land/std@0.193.0/media_types/vendor/mime-db.v1.52.0.ts": "6925bbcae81ca37241e3f55908d0505724358cda3384eaea707773b2c7e99586", + "https://deno.land/std@0.193.0/path/_constants.ts": "e49961f6f4f48039c0dfed3c3f93e963ca3d92791c9d478ac5b43183413136e0", + "https://deno.land/std@0.193.0/path/_interface.ts": "6471159dfbbc357e03882c2266d21ef9afdb1e4aa771b0545e90db58a0ba314b", + "https://deno.land/std@0.193.0/path/_util.ts": "d7abb1e0dea065f427b89156e28cdeb32b045870acdf865833ba808a73b576d0", + "https://deno.land/std@0.193.0/path/common.ts": "ee7505ab01fd22de3963b64e46cff31f40de34f9f8de1fff6a1bd2fe79380000", + "https://deno.land/std@0.193.0/path/glob.ts": "d479e0a695621c94d3fd7fe7abd4f9499caf32a8de13f25073451c6ef420a4e1", + "https://deno.land/std@0.193.0/path/mod.ts": "f065032a7189404fdac3ad1a1551a9ac84751d2f25c431e101787846c86c79ef", + "https://deno.land/std@0.193.0/path/posix.ts": "8b7c67ac338714b30c816079303d0285dd24af6b284f7ad63da5b27372a2c94d", + "https://deno.land/std@0.193.0/path/separator.ts": "0fb679739d0d1d7bf45b68dacfb4ec7563597a902edbaf3c59b50d5bcadd93b1", + "https://deno.land/std@0.193.0/path/win32.ts": "d186344e5583bcbf8b18af416d13d82b35a317116e6460a5a3953508c3de5bba", + "https://deno.land/std@0.193.0/regexp/escape.ts": "f5955d785245f6910c262ea2f0a284d2be7a76c54929c3f15f4df8d2a623f1d5", + "https://deno.land/std@0.193.0/semver/_shared.ts": "8547ccf91b36c30fb2a8a17d7081df13f4ae694c4aa44c39799eba69ad0dcb23", + "https://deno.land/std@0.193.0/semver/cmp.ts": "4faca58ad459a8c7663ac84ed8410fb5cf932042969f5c25d285f319456d55c1", + "https://deno.land/std@0.193.0/semver/comparator_format.ts": "329e05d914c064590ded4801fc601bf1c5d0f461c5524b1578e10f180551ef6f", + "https://deno.land/std@0.193.0/semver/comparator_intersects.ts": "61920121a6c1600306dbcf8944c4cc55e45c3a1bdbefe41b79a0884bf02d9e1b", + "https://deno.land/std@0.193.0/semver/comparator_max.ts": "f4cc5f528abd8aab68c66bbead732e3c59102b13a318cd8e4f8a47aa3debec76", + "https://deno.land/std@0.193.0/semver/comparator_min.ts": "eea382428ebf0c50168f780898df8519c88da5a10d1f8babbfebdc89fb75942e", + "https://deno.land/std@0.193.0/semver/compare.ts": "503bb7b0ca67b722a0a8a5570486c20eb27ed9bc2316f25699fbd6317a3233ac", + "https://deno.land/std@0.193.0/semver/compare_build.ts": "dc315387ffba691206be83bb4195dff23af6df9983cf8dfb91c29e3f62b9bdca", + "https://deno.land/std@0.193.0/semver/constants.ts": "bb0c7652c433c7ec1dad5bf18c7e7e1557efe9ddfd5e70aa6305153e76dc318c", + "https://deno.land/std@0.193.0/semver/difference.ts": "b86b72f75308c0ab78a41bc676bdca0d933d75e0be8b06dafdc393689e70497f", + "https://deno.land/std@0.193.0/semver/eq.ts": "b8fc7184507423a2448f4b052fc4d9090bf316807b3c9c930afc3775d7a3f3a5", + "https://deno.land/std@0.193.0/semver/format.ts": "236cc8b5d2e8031258dcff3ca89e14ba926434d5b789730e2c781db172e76bd9", + "https://deno.land/std@0.193.0/semver/gt.ts": "2f20b21456179b3ac034656a09b5c259bf52dc2626a941ca038be5d201c415be", + "https://deno.land/std@0.193.0/semver/gte.ts": "d1ed0195a2b38ef0df586374eac4ad860d3b7e181ec1683e734912ce795aaddb", + "https://deno.land/std@0.193.0/semver/gtr.ts": "b0442acf1d52ceb337ec4f82afaa0da3b5251a9a08f4f0b8839ca4629d617078", + "https://deno.land/std@0.193.0/semver/increment.ts": "e41ffc906ea1d57e66987aa1b18ba1d0223d6fb0cd806448d012e4f8117e8513", + "https://deno.land/std@0.193.0/semver/is_semver.ts": "0257f596d8ee33796bd2e46347e0c31030e55b3719bc72fe5258a1e9f9c7e227", + "https://deno.land/std@0.193.0/semver/is_semver_comparator.ts": "120ad68896e3481dbcda81ddd914c10d3fc891fe62cc99028cb69ebfa6c1427c", + "https://deno.land/std@0.193.0/semver/is_semver_range.ts": "0ea096e1edcb8e95200d3bee549c97b53e93ac60d4c2b3601ad7a01f27a0f4da", + "https://deno.land/std@0.193.0/semver/lt.ts": "c8711ffa1c40a3f98921b9bf0d80b59970d8cbc0a12696ebccacf6bccfa9dcc8", + "https://deno.land/std@0.193.0/semver/lte.ts": "721e5f9d353ecea757c1d5d42f4f6699d46cd24cdbd45b2bf88efdf82c0eaac4", + "https://deno.land/std@0.193.0/semver/ltr.ts": "2a10f426605408adcb6cb62e65e871eb6b235d74cbcc2160e58207751e7ca11d", + "https://deno.land/std@0.193.0/semver/max_satisfying.ts": "a8c550100582a9ad2f68026edef8a5ed09debbda0a65d28dceea302508aee41a", + "https://deno.land/std@0.193.0/semver/min_satisfying.ts": "04331cc956f55bc6d14f911ff2561dbab81e1218bfe6a080fe520b999e33e693", + "https://deno.land/std@0.193.0/semver/mod.ts": "79eaeb8015f3f34a34b1e2a98f524dbd5a9a5d7fa1d977cdfc5d6157965e8920", + "https://deno.land/std@0.193.0/semver/neq.ts": "c4116ac01149c4c090bdb5da2bbf946d1f9d74634c97486f3d7e55e75bb35bb0", + "https://deno.land/std@0.193.0/semver/outside.ts": "3ca074513c6f5ac4b3e9c0eda2deb3a83cdfcecc589f1ec69786d41f47885a89", + "https://deno.land/std@0.193.0/semver/parse.ts": "190dab1b5231da1fa6ec40567f58550209e7304dcb655fd8ae46eb7c2966a82b", + "https://deno.land/std@0.193.0/semver/parse_comparator.ts": "f07f9be8322b1f61a36b94c3c65a0dc4124958ee54cf744c92ca4028bf156d5e", + "https://deno.land/std@0.193.0/semver/parse_range.ts": "39a18608a8026004b218ef383e7ae624a9e663b82327948c1810f16d875113c2", + "https://deno.land/std@0.193.0/semver/range_format.ts": "3de31fd0b74dd565e052840e73a8e9ee1d9d289ca60b85749167710b978cc078", + "https://deno.land/std@0.193.0/semver/range_intersects.ts": "e646300d9a10868ae51dc70399c1eee31a503f24610506146eadbeac6bcc6777", + "https://deno.land/std@0.193.0/semver/range_max.ts": "9c10c65bbc7796347ce6f765a77865cead88870d17481ac78259400a2378af2e", + "https://deno.land/std@0.193.0/semver/range_min.ts": "b7849e70e0b0677b382eddaa822b6690521449a659c5b8ec84cbd438f6e6ca59", + "https://deno.land/std@0.193.0/semver/rcompare.ts": "fe4e95bf671bd119df89bc4dd9ceb3fdcc95bad543a78fa3b8ae67ce6b54bc03", + "https://deno.land/std@0.193.0/semver/rsort.ts": "d4bfa2b9fffa6e1afddeead68c7cb470ed932b3846acf45eccde2b46be021644", + "https://deno.land/std@0.193.0/semver/sort.ts": "301d18f7f96f9e46bb6d0327d3d97579fa2d49558c185a0a5035b8e6fbd4a73b", + "https://deno.land/std@0.193.0/semver/test_comparator.ts": "eff5394cb82d133ed18f96fe547de7e7264bf0d25d16cbc6126664aa06ef8f37", + "https://deno.land/std@0.193.0/semver/test_range.ts": "b236c276268e92bbbc65e7c4b4b6b685ea6b4534a71b2525b53093d094f631c6", + "https://deno.land/std@0.193.0/semver/try_parse.ts": "fc7eeafc18686563b0cc35b518eda57690e513e634527a0ff48c600ba7798ce4", + "https://deno.land/std@0.193.0/semver/try_parse_range.ts": "49be2271c4c07374fc2d986d5212fab7bb1f49daa485141e9bedd78d851ca5ca", + "https://deno.land/std@0.193.0/semver/types.ts": "d44f442c2f27dd89bd6695b369e310b80549746f03c38f241fe28a83b33dd429", + "https://deno.land/std@0.195.0/assert/assert.ts": "9a97dad6d98c238938e7540736b826440ad8c1c1e54430ca4c4e623e585607ee", + "https://deno.land/std@0.195.0/assert/assertion_error.ts": "4d0bde9b374dfbcbe8ac23f54f567b77024fb67dbb1906a852d67fe050d42f56", + "https://deno.land/std@0.195.0/async/abortable.ts": "fd682fa46f3b7b16b4606a5ab52a7ce309434b76f820d3221bdfb862719a15d7", + "https://deno.land/std@0.195.0/async/deadline.ts": "58f72a3cc0fcb731b2cc055ba046f4b5be3349ff6bf98f2e793c3b969354aab2", + "https://deno.land/std@0.195.0/async/debounce.ts": "adab11d04ca38d699444ac8a9d9856b4155e8dda2afd07ce78276c01ea5a4332", + "https://deno.land/std@0.195.0/async/deferred.ts": "42790112f36a75a57db4a96d33974a936deb7b04d25c6084a9fa8a49f135def8", + "https://deno.land/std@0.195.0/async/delay.ts": "a6142eb44cdd856b645086af2b811b1fcce08ec06bb7d50969e6a872ee9b8659", + "https://deno.land/std@0.195.0/async/mod.ts": "f04344fa21738e5ad6bea37a6bfffd57c617c2d372bb9f9dcfd118a1b622e576", + "https://deno.land/std@0.195.0/async/mux_async_iterator.ts": "70c7f2ee4e9466161350473ad61cac0b9f115cff4c552eaa7ef9d50c4cbb4cc9", + "https://deno.land/std@0.195.0/async/pool.ts": "f1b8d3df4d7fd3c73f8cbc91cc2e8b8e950910f1eab94230b443944d7584c657", + "https://deno.land/std@0.195.0/async/retry.ts": "296fb9c323e1325a69bee14ba947e7da7409a8dd9dd646d70cb51ea0d301f24e", + "https://deno.land/std@0.195.0/async/tee.ts": "47e42d35f622650b02234d43803d0383a89eb4387e1b83b5a40106d18ae36757", + "https://deno.land/std@0.195.0/datetime/to_imf.ts": "8f9c0af8b167031ffe2e03da01a12a3b0672cc7562f89c61942a0ab0129771b2", + "https://deno.land/std@0.195.0/encoding/base64.ts": "144ae6234c1fbe5b68666c711dc15b1e9ee2aef6d42b3b4345bf9a6c91d70d0d", + "https://deno.land/std@0.195.0/http/_negotiation/common.ts": "14d1a52427ab258a4b7161cd80e1d8a207b7cc64b46e911780f57ead5f4323c6", + "https://deno.land/std@0.195.0/http/_negotiation/encoding.ts": "ff747d107277c88cb7a6a62a08eeb8d56dad91564cbcccb30694d5dc126dcc53", + "https://deno.land/std@0.195.0/http/_negotiation/language.ts": "7bcddd8db3330bdb7ce4fc00a213c5547c1968139864201efd67ef2d0d51887d", + "https://deno.land/std@0.195.0/http/_negotiation/media_type.ts": "58847517cd549384ad677c0fe89e0a4815be36fe7a303ea63cee5f6a1d7e1692", + "https://deno.land/std@0.195.0/http/cookie.ts": "6a8a85f84e64ec548d8dc785fa646fc968234264fc00e8a5c7693c07cadff955", + "https://deno.land/std@0.195.0/http/cookie_map.ts": "d148a5eaf35f19905dd5104126fa47ac71105306dd42f129732365e43108b28a", + "https://deno.land/std@0.195.0/http/etag.ts": "a60fee74def3f9e2add2524cb46bd394828aea51fc0c7dd6cf669d2e824af285", + "https://deno.land/std@0.195.0/http/http_errors.ts": "bbda34819060af86537cecc9dc8e045f877130808b7e7acde4197c5328e852d0", + "https://deno.land/std@0.195.0/http/http_status.ts": "8a7bcfe3ac025199ad804075385e57f63d055b2aed539d943ccc277616d6f932", + "https://deno.land/std@0.195.0/http/method.ts": "e66c2a015cb46c21ab0bb3589aa4fca43143a506cb324ffdfd42d2edef7bc0c4", + "https://deno.land/std@0.195.0/http/mod.ts": "525fb1b3b1e0d297facb08d8cf84c4908f8fadfc3f3f22809185510967279ef7", + "https://deno.land/std@0.195.0/http/negotiation.ts": "46e74a6bad4b857333a58dc5b50fe8e5a4d5267e97292293ea65f980bd918086", + "https://deno.land/std@0.195.0/http/server.ts": "1b23463b5b36e4eebc495417f6af47a6f7d52e3294827a1226d2a1aab23d9d20", + "https://deno.land/std@0.195.0/http/server_sent_event.ts": "d1b63bc91e3d103073cf3a86b45c1d05782422c875ff7d44f9102e5541887ded", + "https://deno.land/std@0.195.0/http/user_agent.ts": "7c3976b321058e90ccf39b75c02f1a6fd4beac81e568bc8bad10e07f290583ab", + "https://deno.land/std@0.196.0/collections/filter_values.ts": "16e1fc456a7969e770ec5b89edf5ac97b295ca534b47c1a83f061b409aad7814", + "https://deno.land/std@0.196.0/collections/without_all.ts": "1e3cccb1ed0659455b473c0766d9414b7710d8cef48862c899f445178f66b779", + "https://deno.land/std@0.196.0/dotenv/mod.ts": "39e5d19e077e55d7e01ea600eb1c6d1e18a8dfdfc65d68826257a576788da3a4", + "https://deno.land/std@0.196.0/fmt/colors.ts": "a7eecffdf3d1d54db890723b303847b6e0a1ab4b528ba6958b8f2e754cf1b3bc", + "https://deno.land/x/code_block_writer@11.0.3/mod.ts": "2c3448060e47c9d08604c8f40dee34343f553f33edcdfebbf648442be33205e5", + "https://deno.land/x/code_block_writer@11.0.3/utils/string_utils.ts": "60cb4ec8bd335bf241ef785ccec51e809d576ff8e8d29da43d2273b69ce2a6ff", + "https://deno.land/x/deno_cache@0.4.1/auth_tokens.ts": "5fee7e9155e78cedf3f6ff3efacffdb76ac1a76c86978658d9066d4fb0f7326e", + "https://deno.land/x/deno_cache@0.4.1/cache.ts": "51f72f4299411193d780faac8c09d4e8cbee951f541121ef75fcc0e94e64c195", + "https://deno.land/x/deno_cache@0.4.1/deno_dir.ts": "f2a9044ce8c7fe1109004cda6be96bf98b08f478ce77e7a07f866eff1bdd933f", + "https://deno.land/x/deno_cache@0.4.1/deps.ts": "8974097d6c17e65d9a82d39377ae8af7d94d74c25c0cbb5855d2920e063f2343", + "https://deno.land/x/deno_cache@0.4.1/dirs.ts": "d2fa473ef490a74f2dcb5abb4b9ab92a48d2b5b6320875df2dee64851fa64aa9", + "https://deno.land/x/deno_cache@0.4.1/disk_cache.ts": "1f3f5232cba4c56412d93bdb324c624e95d5dd179d0578d2121e3ccdf55539f9", + "https://deno.land/x/deno_cache@0.4.1/file_fetcher.ts": "07a6c5f8fd94bf50a116278cc6012b4921c70d2251d98ce1c9f3c352135c39f7", + "https://deno.land/x/deno_cache@0.4.1/http_cache.ts": "f632e0d6ec4a5d61ae3987737a72caf5fcdb93670d21032ddb78df41131360cd", + "https://deno.land/x/deno_cache@0.4.1/mod.ts": "ef1cda9235a93b89cb175fe648372fc0f785add2a43aa29126567a05e3e36195", + "https://deno.land/x/deno_cache@0.4.1/util.ts": "8cb686526f4be5205b92c819ca2ce82220aa0a8dd3613ef0913f6dc269dbbcfe", + "https://deno.land/x/denoflate@1.2.1/mod.ts": "f5628e44b80b3d80ed525afa2ba0f12408e3849db817d47a883b801f9ce69dd6", + "https://deno.land/x/denoflate@1.2.1/pkg/denoflate.js": "b9f9ad9457d3f12f28b1fb35c555f57443427f74decb403113d67364e4f2caf4", + "https://deno.land/x/denoflate@1.2.1/pkg/denoflate_bg.wasm.js": "d581956245407a2115a3d7e8d85a9641c032940a8e810acbd59ca86afd34d44d", + "https://deno.land/x/djwt@v2.7/algorithm.ts": "ba9941961c46838f35a507414407e48aa9a4eca69c679b04fbbede55fe276a09", + "https://deno.land/x/djwt@v2.7/deps.ts": "a5d7952aaf7fad421717c9a2db0b2e736b409632cb70f3f7f9e68f8e96e04f45", + "https://deno.land/x/djwt@v2.7/mod.ts": "08cb2c745c9bc33883c2d027fc4af5c157f0a30564c3ba503a56fe0ab6959c8e", + "https://deno.land/x/djwt@v2.7/signature.ts": "f79b4e521cd6a6dff28cd2779b1d9f2059f9e0822fb99c9f747ff34ae26532e4", + "https://deno.land/x/envalid@0.1.2/core.ts": "9cb1b469919af72d3ad8576f952c8b695e9b5356878d84f15db9328b7afab2d5", + "https://deno.land/x/envalid@0.1.2/envalid.ts": "76755815e2643aacbe604e3cd76415f0f4c8cc04d7cdbae0ab05a0ebc86ceb38", + "https://deno.land/x/envalid@0.1.2/errors.ts": "8524f99ff929abe5c9fa07c250cafb15e564d5339ae8fdfabd6d56fab9ec7e00", + "https://deno.land/x/envalid@0.1.2/middleware.ts": "c7a88e1dce3f280471844c36080a346ac3aadc4420b3fbff92807d21f3aec1e2", + "https://deno.land/x/envalid@0.1.2/mod.ts": "c82f8e49cf6b008478a11275bbc9c55a4f900a2010fb4d0882cfba6f914eaa1c", + "https://deno.land/x/envalid@0.1.2/reporter.ts": "5affd2863a25cca71e7f249504f0670112e5e1742dd8a3977764e45fa5957dcc", + "https://deno.land/x/envalid@0.1.2/types.ts": "3c8630c015922739c8e0c3638dd446bbaf627ecccfb9b21329dbd0af82c4236d", + "https://deno.land/x/envalid@0.1.2/validators.ts": "9252d4a0a70a7c1895be7813596a562cd8b105756f7cbbd8e49caf1bf4998453", + "https://deno.land/x/esbuild@v0.18.11/mod.js": "4938b0ef456e068ab23643f166a2761619045e297d8ced1ae3de5f017ed2ecef", + "https://deno.land/x/esbuild@v0.18.11/wasm.js": "8a4fce99c0b42c1bdabef483cd400f9064cb438738d99cb1a04fe3055350f89d", + "https://deno.land/x/esbuild_deno_loader@0.8.1/deps.ts": "987b50a1a921fcc84ddfcf1a1256cb955f6b16acac28a3fc77901c12c0752173", + "https://deno.land/x/esbuild_deno_loader@0.8.1/mod.ts": "28524460bef46d487221b01ade6ed913d2e127de7eeee025ab75b34b491283da", + "https://deno.land/x/esbuild_deno_loader@0.8.1/src/deno.ts": "b0af3e430c068f18c6fa48c2083a1b4354b6c303e16fb37855e02fcafb95f36d", + "https://deno.land/x/esbuild_deno_loader@0.8.1/src/loader_native.ts": "0289d8708f47c876d6a4280592a8a12bb2d29676fedf25ddf222ecd6a1bb0bd8", + "https://deno.land/x/esbuild_deno_loader@0.8.1/src/loader_portable.ts": "d999f452ef3d8ec2dd3c8443f542adf57efc8a2cd59b29cc41f5b3d7dff512e5", + "https://deno.land/x/esbuild_deno_loader@0.8.1/src/plugin_deno_loader.ts": "166356133ee63d80e5559a10c18e10b625da96e39a4518b8c7adfef718bb4e32", + "https://deno.land/x/esbuild_deno_loader@0.8.1/src/plugin_deno_resolver.ts": "0449ed23ae93db1ec74d015a46934aefd7ba7a8f719f7a4980b616cb3f5bbee4", + "https://deno.land/x/esbuild_deno_loader@0.8.1/src/shared.ts": "33052684aeb542ebd24da372816bbbf885cd090a7ab0fde7770801f7f5b49572", + "https://deno.land/x/fresh@1.3.1/dev.ts": "a66c7d64be35bcd6a8e12eec9c27ae335044c70363a241f2e36ee776db468622", + "https://deno.land/x/fresh@1.3.1/plugins/twind.ts": "b20ab6004318eb56538976c49b23c125560845650cf2b2d69b463c31b16da06f", + "https://deno.land/x/fresh@1.3.1/plugins/twind/shared.ts": "1b5bb9e6ab2844e432e5063ee50ec6010040e460ec86daeac3ab3d2e1b3c9fe3", + "https://deno.land/x/fresh@1.3.1/runtime.ts": "b02ec1e2e32cf73a33d262b7c9dcab9468ce16cd89fd424196c71003698a4ab0", + "https://deno.land/x/fresh@1.3.1/server.ts": "f379c9aad24471a71e58fb887fa57e5cc27ad9df035987eb260541c78df38e84", + "https://deno.land/x/fresh@1.3.1/src/build/deps.ts": "e6f52b4d8814cd40db62f98f78ad050b232d7fac79b4df586429408d14456f23", + "https://deno.land/x/fresh@1.3.1/src/build/esbuild.ts": "2f9c03086afdcea8f6fac30231497b879543a00ec76092b58a303ea87c28ec8f", + "https://deno.land/x/fresh@1.3.1/src/build/mod.ts": "95d2d99b7d31adfa10896599bdd21c67b3eac0d077e7a39fc637f812196538c3", + "https://deno.land/x/fresh@1.3.1/src/dev/deps.ts": "c445140991ee7c28b9c55cc6c85ca430b5d0286c7eb2d6ee5cd5069af052cd4f", + "https://deno.land/x/fresh@1.3.1/src/dev/error.ts": "21a38d240c00279662e6adde41367f1da0ae7e2836d993f818ea94aabab53e7b", + "https://deno.land/x/fresh@1.3.1/src/dev/mod.ts": "c2329b9b5a9d302e8121624ab9ad9a42c3951c62cd2cf5a73240e2fdb71aace7", + "https://deno.land/x/fresh@1.3.1/src/dev/update_check.ts": "25db15d070338b898f836e840eed049031116910dac80c617b358d0086265092", + "https://deno.land/x/fresh@1.3.1/src/runtime/build_id.ts": "8376e70e42ce456dfa6932c638409d2ef1bca4833b4ceba0bf74510080a7f976", + "https://deno.land/x/fresh@1.3.1/src/runtime/csp.ts": "9ee900e9b0b786057b1009da5976298c202d1b86d1f1e4d2510bde5f06530ac9", + "https://deno.land/x/fresh@1.3.1/src/runtime/deserializer.ts": "8f11e04f9671741442b9512cc0617bef3edf22a60620c78b05097143a83cfe6e", + "https://deno.land/x/fresh@1.3.1/src/runtime/head.ts": "0f9932874497ab6e57ed1ba01d549e843523df4a5d36ef97460e7a43e3132fdc", + "https://deno.land/x/fresh@1.3.1/src/runtime/utils.ts": "9f6ef9125891490b34ba3567c8ab43deaf378855b1ccc857c4626d1f6797a868", + "https://deno.land/x/fresh@1.3.1/src/server/build_id.ts": "e7448a3e4c040d906aeaa5dedf6657d67742199bbf4741c55d11410c100cbcef", + "https://deno.land/x/fresh@1.3.1/src/server/constants.ts": "498b1a0f001b6b56bb67524b764605d742a7450fd53edce0a6e04a0463b383b3", + "https://deno.land/x/fresh@1.3.1/src/server/context.ts": "8b96698abf9db8075f9b8058a1d447c6ef960048a22051452a4679c962f6b83c", + "https://deno.land/x/fresh@1.3.1/src/server/default_error_page.ts": "c512f91c9b93540923f0ce0ee4a4af748066d3317e9d8077e5203727c4cb015f", + "https://deno.land/x/fresh@1.3.1/src/server/deps.ts": "b9e147f7196fb7a731454e68e52506797ca5452acd95615e93e441261db3d4b5", + "https://deno.land/x/fresh@1.3.1/src/server/htmlescape.ts": "834ac7d0caa9fc38dffd9b8613fb47aeecd4f22d5d70c51d4b20a310c085835c", + "https://deno.land/x/fresh@1.3.1/src/server/mod.ts": "21c2702da562ad3d831fc3723f2364d6977ab29b6687f928016f0cf58efe9d08", + "https://deno.land/x/fresh@1.3.1/src/server/render.ts": "ad394702dc2cac4f93a6a51a447838361d530f134fb77fab022c947916e00f82", + "https://deno.land/x/fresh@1.3.1/src/server/router.ts": "7829ac51fce737b03568315779c3b9bc52e6f0f13aa4e082e71d44e5d1390dfd", + "https://deno.land/x/fresh@1.3.1/src/server/serializer.ts": "45916ddf18c765b9711c28f7c1cde111125329dd6e9909213adc2807debaf7b6", + "https://deno.land/x/fresh@1.3.1/src/server/types.ts": "f82a2145d0562e763da173754ffbf6a07ea9ad7af7c588c80e73526988618cc8", + "https://deno.land/x/fresh@1.3.1/versions.json": "4531024f957c885e371996f68ee25baff8d69cba4724ef3453a8517271ae7b59", + "https://deno.land/x/fresh_seo@0.2.1/mod.ts": "9473507398048cb24dbb37b3a220777106c69c28d573898648deb2bb84a7e131", + "https://deno.land/x/fresh_seo@0.2.1/src/deps.ts": "b0d001274e7b8afb5c24652b4916bee5c72ab9a1147abaa93b47198ce9d3afa7", + "https://deno.land/x/fresh_seo@0.2.1/src/mod.ts": "ada49ae04c605b1a96dfa7ae4adb1da74760eafe0bebde0dda76ce6cc6a976fd", + "https://deno.land/x/fresh_seo@0.2.1/src/sitemap.ts": "94c746f1afb28ad2ca3b8d52b4a824bb72918746fb84d11d2cc08679448b619f", + "https://deno.land/x/fresh_seo@0.2.1/src/types.ts": "a5085ce3a02710e69de1796dd2d1e32604ac562bf6f71a3b0efc41a294381dda", + "https://deno.land/x/fresh_session@0.2.2/mod.ts": "9473507398048cb24dbb37b3a220777106c69c28d573898648deb2bb84a7e131", + "https://deno.land/x/fresh_session@0.2.2/src/deps.ts": "a1474f75cc9320ad55c5a8c04a0365b81c9970ea5453c2afee8b1030f1883577", + "https://deno.land/x/fresh_session@0.2.2/src/mod.ts": "625851a02f5448f825e338757000ea31464b9427518c02da1acbd360091dc7d2", + "https://deno.land/x/fresh_session@0.2.2/src/session.ts": "a2905cc12c7f3560294f8de22f8af1130e62a46fdb43eae970ab55f4fe6d6723", + "https://deno.land/x/fresh_session@0.2.2/src/stores/cookie.ts": "7acbb411981644776df90c64c9f32288e264c487042af3c456095790569a24c3", + "https://deno.land/x/fresh_session@0.2.2/src/stores/cookie_option.ts": "ecf48fd5e779ab767b94881d8305e8925849246f461a25c6979067046c1077e0", + "https://deno.land/x/fresh_session@0.2.2/src/stores/interface.ts": "3172fd7ee2908a0a25ff85b887ca00251b400d7626d45f3a590682b02c466a07", + "https://deno.land/x/fresh_session@0.2.2/src/stores/kv.ts": "27627ec8be28e27de9978bbc2e4fec39309ce85916982f517de2706707001eec", + "https://deno.land/x/fresh_session@0.2.2/src/stores/redis.ts": "7e78008b495dfb863d87a9ab718af1c38316bf7c21c03eb14255f7d7de141fa6", + "https://deno.land/x/importmap@0.2.1/_util.ts": "ada9a9618b537e6c0316c048a898352396c882b9f2de38aba18fd3f2950ede89", + "https://deno.land/x/importmap@0.2.1/mod.ts": "ae3d1cd7eabd18c01a4960d57db471126b020f23b37ef14e1359bbb949227ade", + "https://deno.land/x/ts_morph@17.0.1/common/DenoRuntime.ts": "537800e840d0994f9055164e11bf33eadf96419246af0d3c453793c3ae67bdb3", + "https://deno.land/x/ts_morph@17.0.1/common/mod.ts": "01985d2ee7da8d1caee318a9d07664774fbee4e31602bc2bb6bb62c3489555ed", + "https://deno.land/x/ts_morph@17.0.1/common/ts_morph_common.js": "49a79124b941ba2b35d81ac9eb90fc33c957b2640cdb97569c1941bac5a3bbdb", + "https://deno.land/x/ts_morph@17.0.1/common/typescript.js": "5dd669eb199ee2a539924c63a92e23d95df43dfe2fbe3a9d68c871648be1ad5e", + "https://deno.land/x/ts_morph@17.0.1/mod.ts": "adba9b82f24865d15d2c78ef6074b9a7457011719056c9928c800f130a617c93", + "https://deno.land/x/ts_morph@17.0.1/ts_morph.js": "1bb80284b9e31a4c5c2078cd533fe9b12b4b2d710267055cb655225aa88fb2df", + "https://esm.sh/*preact-render-to-string@6.1.0": "9499dc7f262a542ed272bba52733bb6aa3365fbf2b2733b0d7ecd6da102fa290", + "https://esm.sh/preact@10.15.1": "2b79349676a4942fbcf835c4efa909791c2f0aeca195225bf22bac9866e94b4e", + "https://esm.sh/preact@10.15.1/debug": "7d1c92309880a87bfb95be85705d984401b27808db31adbd008ee4bed2553c1a", + "https://esm.sh/preact@10.15.1/hooks": "b57df1fdf7e4f917ea1e3133ae0fccc6af4577ae950e708855226493c2236bdd", + "https://esm.sh/preact@10.15.1/jsx-runtime": "3a6250cbda44a43ba01c1c0bc8a79ff8cae167be322d24903483f3b367fe5709", + "https://esm.sh/stable/preact@10.15.1/denonext/debug.js": "e8e5e198bd48c93d484c91c4c78af1900bd81d9bfcfd543e8ac75216f5404c10", + "https://esm.sh/stable/preact@10.15.1/denonext/devtools.js": "9357ad4ccf9ec29ee9a0401876d749177c400da4bbcdcffa9be3b212409702a6", + "https://esm.sh/stable/preact@10.15.1/denonext/hooks.js": "5c989ad368cf4f2cb3a5d7d1801843d9348c599fe3e7731d04728f7b845d724e", + "https://esm.sh/stable/preact@10.15.1/denonext/jsx-runtime.js": "52806054f5b3477005ab4bdc17de3d219ccc6c130d0cd803c45667b0cac2f6ed", + "https://esm.sh/stable/preact@10.15.1/denonext/preact.mjs": "30710ac1d5ff3711ae0c04eddbeb706f34f82d97489f61aaf09897bc75d2a628", + "https://esm.sh/twind@0.16.19": "c19516e533d986da197088d26caed035d91dc1b2c25a22078f3af212a7da51de", + "https://esm.sh/twind@0.16.19/colors": "e0dfd47be2191e08b662a2f8800e0f08cc795b3d4115bd2fb01f77067c5b0573", + "https://esm.sh/twind@0.16.19/sheets": "3fdebfe17be9fd2dfeef7b818cade6a2fa6db876167a9b8c3913da993e1c11ea", + "https://esm.sh/v104/style-vendorizer@2.2.3/deno/style-vendorizer.js": "bacdb96f034bbdae11a8d90427a6d49270d28d5939f02dbf0e7d0e52491ff9e3", + "https://esm.sh/v104/twind@0.16.19/deno/colors.js": "ddf041c04987bce1e5f3d8a7868dc79d0ee66e46801463d22dc4cc318199e5f5", + "https://esm.sh/v104/twind@0.16.19/deno/sheets.js": "7da65867362f9cbf34ef24bfe75a935ee0aaf3d41192e8c05d932e4180ebba57", + "https://esm.sh/v104/twind@0.16.19/deno/twind.js": "f96f4d09889d5e75f4ee3eb5ddb6e37894528c3e97ab1a174398093a08eb7981", + "https://esm.sh/v126/preact-render-to-string@6.1.0/X-ZS8q/denonext/preact-render-to-string.mjs": "8ce71d44f2a197f8fafa24c8d1ac19e0d7fac5a171efae6154f8d754e1ae0ae4" + } +} diff --git a/fresh.gen.ts b/fresh.gen.ts index f06a73c..4d885ca 100644 --- a/fresh.gen.ts +++ b/fresh.gen.ts @@ -2,7 +2,6 @@ // This file SHOULD be checked into source version control. // This file is automatically updated during development when running `dev.ts`. -import config from "./deno.json" assert { type: "json" } import * as $0 from "./routes/_404.jsx" import * as $1 from "./routes/_middleware.jsx" import * as $2 from "./routes/deal.jsx" @@ -32,7 +31,6 @@ const manifest = { "./islands/PokerPlayer.jsx": $$3, }, baseUrl: import.meta.url, - config, } export default manifest diff --git a/import_map.json b/import_map.json deleted file mode 100644 index 48de2d0..0000000 --- a/import_map.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "imports": { - "@/": "./", - "$fresh/": "https://deno.land/x/fresh@1.1.4/", - "$std/": "https://deno.land/std@0.177.0/", - "fresh_marionette": "https://deno.land/x/fresh_marionette@v1.1.0/mod.js", - "fresh_seo": "https://deno.land/x/fresh_seo@0.2.1/mod.ts", - "preact": "https://esm.sh/preact@10.11.0", - "preact/": "https://esm.sh/preact@10.11.0/", - "preact-render-to-string": "https://esm.sh/*preact-render-to-string@5.2.4", - "twind": "https://esm.sh/twind@0.16.17", - "twind/": "https://esm.sh/twind@0.16.17/", - "redis": "https://deno.land/x/redis@v0.29.0/mod.ts", - "@preact/signals": "https://esm.sh/*@preact/signals@1.0.3", - "@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.0.1", - "envalid": "https://deno.land/x/envalid@0.1.2/mod.ts" - } -} diff --git a/routes/_middleware.jsx b/routes/_middleware.jsx index 38d5645..75569bf 100644 --- a/routes/_middleware.jsx +++ b/routes/_middleware.jsx @@ -1,73 +1,79 @@ // routes/_middleware.js import { blue, cyan, green, magenta, red, yellow } from "$std/fmt/colors.ts" -import { getCookies, setCookie } from "$std/http/cookie.ts" -import * as redis from "redis" +import { kvSession } from "fresh-session/mod.ts" + +// import { getCookies, setCookie } from "$std/http/cookie.ts" +// import * as redis from "redis" import { // API_URL, BASE_URL, DENO_ENV, - REDIS_HOST, - REDIS_PASS, - REDIS_PORT, + // REDIS_HOST, + // REDIS_PASS, + // REDIS_PORT, } from "@/utils/config.js" -const store = await redis.connect({ - password: REDIS_PASS, - hostname: REDIS_HOST, - port: REDIS_PORT, -}) +// const store = await redis.connect({ +// password: REDIS_PASS, +// hostname: REDIS_HOST, +// port: REDIS_PORT, +// }) -const COOKIE_NAME = "sesh" -const REDIS_KEY = (COOKIE_VALUE) => `devvideopoker-${COOKIE_VALUE}` +// const COOKIE_NAME = "sesh" +// const REDIS_KEY = (COOKIE_VALUE) => `devvideopoker-${COOKIE_VALUE}` -// Session Tracker -const createSession = async () => { - const session = { - // cart: [], - } - session[COOKIE_NAME] = crypto.randomUUID() - await store.set(REDIS_KEY(session[COOKIE_NAME]), JSON.stringify(session)) - await store.expire(REDIS_KEY(session[COOKIE_NAME]), 7 * 24 * 60 * 60) - return session -} +// // Session Tracker +// const createSession = async () => { +// const session = { +// // cart: [], +// } +// session[COOKIE_NAME] = crypto.randomUUID() +// await store.set(REDIS_KEY(session[COOKIE_NAME]), JSON.stringify(session)) +// await store.expire(REDIS_KEY(session[COOKIE_NAME]), 7 * 24 * 60 * 60) +// return session +// } -const setupNewSession = async (req, ctx) => { - ctx.state = await createSession() - ctx.REDIS_KEY = REDIS_KEY(ctx.state[COOKIE_NAME]) - setupState(req, ctx) - const resp = await ctx.next() - setCookie(resp.headers, { - name: COOKIE_NAME, - value: ctx.state[COOKIE_NAME], - path: "/", - }) - return resp -} +// const setupNewSession = async (req, ctx) => { +// ctx.state = await createSession() +// ctx.REDIS_KEY = REDIS_KEY(ctx.state[COOKIE_NAME]) +// setupState(req, ctx) +// const resp = await ctx.next() +// setCookie(resp.headers, { +// name: COOKIE_NAME, +// value: ctx.state[COOKIE_NAME], +// path: "/", +// }) +// return resp +// } -const setupSession = async (req, ctx) => { - const cookies = getCookies(req.headers) - if (cookies[COOKIE_NAME]) { - const session = await store.get(REDIS_KEY(cookies[COOKIE_NAME])) - if (session) { - ctx.state = JSON.parse(session) - ctx.REDIS_KEY = REDIS_KEY(cookies[COOKIE_NAME]) - } else { - return await setupNewSession(req, ctx) - } - } else { - return await setupNewSession(req, ctx) - } - setupState(req, ctx) - return await ctx.next() -} +// const setupSession = async (req, ctx) => { +// const cookies = getCookies(req.headers) +// if (cookies[COOKIE_NAME]) { +// const session = await store.get(REDIS_KEY(cookies[COOKIE_NAME])) +// if (session) { +// ctx.state = JSON.parse(session) +// ctx.REDIS_KEY = REDIS_KEY(cookies[COOKIE_NAME]) +// } else { +// return await setupNewSession(req, ctx) +// } +// } else { +// return await setupNewSession(req, ctx) +// } +// setupState(req, ctx) +// return await ctx.next() +// } -const setupState = (req, ctx) => { - // req.url.replace("http:", "https:"); - const url = new URL(req.url) - ctx.state.url = url -} +// const setupState = (req, ctx) => { +// // req.url.replace("http:", "https:"); +// const url = new URL(req.url) +// ctx.state.url = url +// } export async function handler(req, ctx) { + const session = kvSession(null, { + maxAge: 10, + httpOnly: true, + }) // For Logging const start = Date.now() const { pathname } = new URL(req.url) @@ -86,29 +92,30 @@ export async function handler(req, ctx) { // ctx.API_URL = API_URL; ctx.BASE_URL = BASE_URL ctx.DENO_ENV = DENO_ENV - ctx.store = store - resp = await setupSession(req, ctx) + // ctx.store = store + resp = session(req, ctx) } else { resp = await ctx.next() } const now = Date.now() const ms = now - start - const status = () => { - const str = resp.status.toString() - if (str[0] === "2") { - return green(str) - } - if (str[0] === "3") { - return yellow(str) - } else { - return red(str) - } - } - resp.headers.set("X-Response-Time", `${ms}ms`) + // const status = () => { + // const str = resp.status.toString() + // console.log(str) + // if (str[0] === "2") { + // return green(str) + // } + // if (str[0] === "3") { + // return yellow(str) + // } else { + // return red(str) + // } + // } + // resp.headers.set("X-Response-Time", `${ms}ms`) console.log( `[${magenta(new Date(now).toISOString())}] ${blue(req.method)} ${ cyan(pathname) - } - ${blue(String(ms) + "ms")} - ${status()}`, + } - ${blue(String(ms) + "ms")} - ${resp.status}`, ) return resp } diff --git a/routes/deal.jsx b/routes/deal.jsx index 4526354..2038710 100644 --- a/routes/deal.jsx +++ b/routes/deal.jsx @@ -4,11 +4,12 @@ import Keyboard from "@/islands/Keyboard.jsx" export const handler = { GET: (req, ctx) => { + const { session } = ctx.state const deck = getNewCards() const deck_id = crypto.randomUUID() const cards = [...deck].splice(0, 5) - ctx.store.set(`deck-${deck_id}`, JSON.stringify({ deck })) - ctx.store.expire(`deck-${deck_id}`, 5 * 60) + session.set(`deck-${deck_id}`, JSON.stringify({ deck })) + // ctx.store.expire(`deck-${deck_id}`, 5 * 60) return ctx.render({ ...ctx.state, cards, deck_id }) }, POST: async (req, ctx) => { diff --git a/routes/draw.jsx b/routes/draw.jsx index 5977b66..7cc68f2 100644 --- a/routes/draw.jsx +++ b/routes/draw.jsx @@ -8,13 +8,15 @@ export const handler = { return ctx.renderNotFound() }, POST: async (req, ctx) => { + const { session } = ctx.state const data = await req.formData() console.log(data) // const deck = getNewCards(); // const deck_id = crypto.randomUUID(); // const cards = deck.splice(0, 5); const deck_id = data.get("deck_id") - const redis_data = await ctx.store.get(`deck-${deck_id}`) + const redis_data = session.get(`deck-${deck_id}`) + // await ctx.store.get(`deck-${deck_id}`) if (redis_data) { const hold_1 = data.get("hold_1") ? true : false const hold_2 = data.get("hold_2") ? true : false @@ -30,7 +32,7 @@ export const handler = { const next = [...redis_data_parsed.deck].splice(5, 5) const cards = holds.map((v, i) => v ? hand[i] : next[i]) const strategy = simpleStrategy(hand) - console.log(user_strategy, strategy.strategy) + // console.log(user_strategy, strategy.strategy) const winner = JSON.stringify(user_strategy) === JSON.stringify(strategy.strategy) ? true @@ -43,17 +45,24 @@ export const handler = { }) // console.log(redis_data_parsed.deck.length, "deck length"); if (winner) { - if (ctx.state.streak) { - ctx.state.streak = ctx.state.streak + 1 + console.log(session.data, "datas") + if (session.has("streak")) { + const streak = session.get("streak") + 1 + ctx.state.streak = streak + session.set("streak", streak) } else { + session.set("streak", 1) ctx.state.streak = 1 } } else { - ctx.state.final = parseInt(ctx.state.streak) + ctx.state.final = session.get("streak") + session.set("streak", 0) ctx.state.streak = 0 } - ctx.store.set(ctx.REDIS_KEY, JSON.stringify({ ...ctx.state })) - ctx.store.expire(`deck-${deck_id}`, 0) + // ctx.store.set(ctx.REDIS_KEY, JSON.stringify({ ...ctx.state })) + session.set(ctx.REDIS_KEY, JSON.stringify({ ...ctx.state })) + // ctx.store.expire(`deck-${deck_id}`, 0) + session.set(`deck-${deck_id}`, null) return ctx.render({ ...ctx.state, cards, diff --git a/test/1_puppet_test.js b/test/1_puppet_test.js index 0a95755..6118d30 100644 --- a/test/1_puppet_test.js +++ b/test/1_puppet_test.js @@ -1,51 +1,53 @@ -import { assertEquals } from "$std/testing/asserts.ts" -import { freshPuppetTestWrapper } from "fresh_marionette" +import { assert, assertEquals } from "$std/assert/mod.ts" +import { freshPuppetTestWrapper } from "@/test/wrapper.js" import { BASE_URL } from "@/utils/config.js" import { puppet_config } from "@/test/config.js" +import { Status } from "$std/http/http_status.ts" Deno.test( "Public Pages Testing", + { sanitizeResources: false, sanitizeOps: false }, freshPuppetTestWrapper(puppet_config, async (t, page) => { await t.step("The homepage should work", async () => { const response = await page.goto(`${BASE_URL}`, { waitUntil: "networkidle2", }) - assertEquals(response.status(), 200) + assert(response.ok) }) await t.step("The sitemap should work", async () => { const response = await page.goto(`${BASE_URL}/sitemap.xml`, { waitUntil: "networkidle2", }) - assertEquals(response.status(), 200) + assert(response.ok) }) await t.step("The deal page should work", async () => { const response = await page.goto(`${BASE_URL}/deal`, { waitUntil: "networkidle2", }) - assertEquals(response.status(), 200) + assert(response.ok) }) await t.step("The draw page should 404 a GET", async () => { const response = await page.goto(`${BASE_URL}/draw`, { waitUntil: "networkidle2", }) - assertEquals(response.status(), 404) + assertEquals(response.status(), Status.NotFound) }) await t.step("The player page should work", async () => { const response = await page.goto(`${BASE_URL}/player`, { waitUntil: "domcontentloaded", }) - assertEquals(response.status(), 200) + assert(response.ok) }) await t.step("The deal page should allow gameplay", async () => { const response = await page.goto(`${BASE_URL}/deal`, { waitUntil: "networkidle2", }) - assertEquals(response.status(), 200) + assertEquals(response.status(), Status.OK) await page.click('[type="submit"]') await page.waitForNetworkIdle() assertEquals(page.url(), `${BASE_URL}/draw`) diff --git a/test/2_game_test.js b/test/2_game_test.js index 1719c7c..7aa79cc 100644 --- a/test/2_game_test.js +++ b/test/2_game_test.js @@ -1,5 +1,5 @@ -import { assertEquals } from "$std/testing/asserts.ts" -import { freshPuppetTestWrapper } from "fresh_marionette" +import { assertEquals } from "$std/assert/mod.ts" +import { freshPuppetTestWrapper } from "@/test/wrapper.js" import { BASE_URL } from "@/utils/config.js" import { simpleStrategy } from "@/utils/simple-strategy/mod.js" import { puppet_config } from "@/test/config.js" @@ -31,6 +31,7 @@ const playGameOfPoker = async (page, done = false) => { Deno.test( "Game Testing", + { sanitizeResources: false, sanitizeOps: false }, freshPuppetTestWrapper(puppet_config, async (t, page) => { await t.step( "The deal page should play 10 perfect hands of poker", diff --git a/test/api_test.js b/test/api_test.js index cb4b8f0..ac42003 100644 --- a/test/api_test.js +++ b/test/api_test.js @@ -1,4 +1,4 @@ -// import { assertEquals } from "$std/testing/asserts.ts"; +// import { assertEquals } from "$std/assert/mod.ts"; // import { BASE_URL } from "@/utils/config.js"; // import { freshTestWrapper } from "@/test/runner.js"; diff --git a/test/wrapper.js b/test/wrapper.js new file mode 100644 index 0000000..cfd9fe5 --- /dev/null +++ b/test/wrapper.js @@ -0,0 +1,27 @@ +import puppeteer from "https://deno.land/x/puppeteer@16.2.0/mod.ts" +// NOt sure how to install this version on GitHub. +// import { default as puppeteer } from "npm:puppeteer" +import { delay } from "$std/async/delay.ts" +import { startFreshServer } from "https://deno.land/x/fresh@1.2.0/tests/test_utils.ts" + +export const freshTestWrapper = (theTests) => async (t) => { + const { serverProcess, lines } = await startFreshServer({ + args: ["run", "-A", "--unstable", "./main.ts"], + }) + await theTests(t) + // Stop the Server + await lines.cancel() + serverProcess.kill("SIGTERM") + // await for the server to close + await delay(100) +} + +export const freshPuppetTestWrapper = (puppetConfig, theTests) => + freshTestWrapper(async (t) => { + const browser = await puppeteer.launch(puppetConfig) + const page = await browser.newPage() + await delay(100) + await theTests(t, page) + // await delay(100) + await browser.close() + })