diff --git a/.vscode/settings.json b/.vscode/settings.json index 6896cc78..96dac04f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -23,15 +23,15 @@ "**/CVS": true, "**/.DS_Store": true, "**/Thumbs.db": true, - ".github/ISSUE_TEMPLATE": true, - ".github/PULL_REQUEST_TEMPLATE.md": true, - ".github/FUNDING.yml": true, - "etc/coverage/*.json": true, - ".editorconfig": true, - "CODE_OF_CONDUCT.md": true, - "CONTRIBUTING.md": true, - "SECURITY.md": true, - "LICENSE": true + ".github/ISSUE_TEMPLATE": false, + ".github/PULL_REQUEST_TEMPLATE.md": false, + ".github/FUNDING.yml": false, + "etc/coverage/*.json": false, + ".editorconfig": false, + "CODE_OF_CONDUCT.md": false, + "CONTRIBUTING.md": false, + "SECURITY.md": false, + "LICENSE": false }, "files.watcherExclude": { "**/.git/objects/**": true, diff --git a/README.md b/README.md index b44b829a..387eb169 100644 --- a/README.md +++ b/README.md @@ -20,20 +20,20 @@ cloud-function runtimes and web apis. # ⚙ Components -| Component | Area | Description | -| ------------------------------- | ----------------- | -------------------------------- | -| [Directives](src/directives/) | Rules | | -| [Standards](src/standards/) | Abstraction | | -| [FP](src/fp/) | Functions Library | Tools for functional programming | -| [StdX](src/stdx/) | Functions Library | Encriched Standard Library | -| [Data](src/data/) | Objects Library | Data Objects and Patterns | -| [Environment](src/environment/) | Objects Library | Environment adapters | -| [Formatters](src/formatters/) | Objects Library | Object serializers/deserializers | -| [CLI](src/cli/) | Manager | CLI library | -| [DI](src/di/) | Manager | Dependency injection library | -| [Functions](src/functions/) | Manager | Functions runtime | -| [I18N](src/i18n/) | Manager | Internationalization library | -| [Options](src/options/) | Manager | Configuration library | +| Component | Area | Description | +| ----------------------------------- | ----------------- | -------------------------------- | +| [Directives](src/lib/directives/) | Rules | | +| [Standards](src/lib/standards/) | Abstraction | | +| [FP](src/lib/fp/) | Functions Library | Tools for functional programming | +| [StdX](src/lib/stdx/) | Functions Library | Encriched Standard Library | +| [Data](src/lib/data/) | Objects Library | Data Objects and Patterns | +| [Environment](src/lib/environment/) | Objects Library | Environment adapters | +| [Formatters](src/lib/formatters/) | Objects Library | Object serializers/deserializers | +| [CLI](src/lib/cli/) | Manager | CLI library | +| [DI](src/lib/di/) | Manager | Dependency injection library | +| [Functions](src/lib/functions/) | Manager | Functions runtime | +| [I18N](src/lib/i18n/) | Manager | Internationalization library | +| [Options](src/lib/options/) | Manager | Configuration library | See the respective component page to figure out its specific usage. @@ -46,14 +46,14 @@ system first. **Alternative I**: -Install dext globally first, then create a new project: +Install hex cli globally first, then create a new project: ```sh -$ deno run -A https://dext.deno.dev +$ deno run -A https://hexfw.deno.dev -$ dext create my-project +$ hex create my-project -Creating "dext web template 0.0.1" on my-project... +Creating "hex framework web template 0.0.1" on my-project... ... done. ``` @@ -61,10 +61,23 @@ done. **Alternative II**: +Without any preparation, invoke creating a new project remotely: + +```sh +$ deno run -A https://hexfw.deno.dev create my-project + +Creating "hex framework web template 0.0.1" on my-project... +... +done. +``` + + +**Alternative III**: + Or run a hex routines directly from the resource: ```sh -$ deno run https://deno.land/x/hex/src/functions/samples/basic.ts eser +$ deno run https://deno.land/x/hex/src/lib/functions/samples/basic.ts eser { payload: "hello eser" } ``` diff --git a/deno.lock b/deno.lock index 6a8f4fc7..2047dde5 100644 --- a/deno.lock +++ b/deno.lock @@ -1,9 +1,80 @@ { "version": "2", "remote": { + "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.152.0/_util/assert.ts": "e94f2eb37cebd7f199952e242c77654e43333c1ac4c5c700e929ea3aa5489f74", + "https://deno.land/std@0.152.0/_util/os.ts": "3b4c6e27febd119d36a416d7a97bd3b0251b77c88942c8f16ee5953ea13e2e49", + "https://deno.land/std@0.152.0/async/deferred.ts": "bc18e28108252c9f67dfca2bbc4587c3cbf3aeb6e155f8c864ca8ecff992b98a", + "https://deno.land/std@0.152.0/bytes/bytes_list.ts": "aba5e2369e77d426b10af1de0dcc4531acecec27f9b9056f4f7bfbf8ac147ab4", + "https://deno.land/std@0.152.0/bytes/equals.ts": "3c3558c3ae85526f84510aa2b48ab2ad7bdd899e2e0f5b7a8ffc85acb3a6043a", + "https://deno.land/std@0.152.0/bytes/mod.ts": "763f97d33051cc3f28af1a688dfe2830841192a9fea0cbaa55f927b49d49d0bf", + "https://deno.land/std@0.152.0/crypto/timing_safe_equal.ts": "82a29b737bc8932d75d7a20c404136089d5d23629e94ba14efa98a8cc066c73e", + "https://deno.land/std@0.152.0/encoding/base64.ts": "c57868ca7fa2fbe919f57f88a623ad34e3d970d675bdc1ff3a9d02bba7409db2", + "https://deno.land/std@0.152.0/fmt/colors.ts": "6f9340b7fb8cc25a993a99e5efc56fe81bb5af284ff412129dd06df06f53c0b4", + "https://deno.land/std@0.152.0/http/_negotiation/common.ts": "410e902f01cdd324e4746e8017595be4fc357d6fc4cd6044f2f808a943d7eaf7", + "https://deno.land/std@0.152.0/http/_negotiation/encoding.ts": "f749c1d539d139af783e8a7741de5a47a98a5e3c9af82b8af512567ccf5fe632", + "https://deno.land/std@0.152.0/http/_negotiation/language.ts": "53c306186904d2dace4c624a8822542866ad332a7f40ac90e0af1504f95c63d0", + "https://deno.land/std@0.152.0/http/_negotiation/media_type.ts": "ecdda87286495f7ff25116858f5088856953e2f1585e593d314e0c71b826a137", + "https://deno.land/std@0.152.0/http/http_errors.ts": "fe9b7f95f7ee0592c3306f8c7aed03ba53d55d1ef81e00041c1171b9588f46d9", + "https://deno.land/std@0.152.0/http/http_status.ts": "897575a7d6bc2b9123f6a38ecbc0f03d95a532c5d92029315dc9f508e12526b8", + "https://deno.land/std@0.152.0/http/negotiation.ts": "f35b1ff2ad4ff9feaa00ac234960b398172768205c8eceaef7f2eafe34716ba2", + "https://deno.land/std@0.152.0/io/buffer.ts": "bd0c4bf53db4b4be916ca5963e454bddfd3fcd45039041ea161dbf826817822b", + "https://deno.land/std@0.152.0/io/readers.ts": "45847ad404afd2f605eae1cff193f223462bc55eeb9ae313c2f3db28aada0fd6", + "https://deno.land/std@0.152.0/io/types.d.ts": "0cae3a62da7a37043661746c65c021058bae020b54e50c0e774916e5d4baee43", + "https://deno.land/std@0.152.0/media_types/_util.ts": "ce9b4fc4ba1c447dafab619055e20fd88236ca6bdd7834a21f98bd193c3fbfa1", + "https://deno.land/std@0.152.0/media_types/mod.ts": "3829264ca0610cac40f3214f939d7733483523f82bc1041c51045d7c75fb93b8", + "https://deno.land/std@0.152.0/media_types/vendor/mime-db.v1.52.0.ts": "724cee25fa40f1a52d3937d6b4fbbfdd7791ff55e1b7ac08d9319d5632c7f5af", + "https://deno.land/std@0.152.0/path/_constants.ts": "df1db3ffa6dd6d1252cc9617e5d72165cd2483df90e93833e13580687b6083c3", + "https://deno.land/std@0.152.0/path/_interface.ts": "ee3b431a336b80cf445441109d089b70d87d5e248f4f90ff906820889ecf8d09", + "https://deno.land/std@0.152.0/path/_util.ts": "c1e9686d0164e29f7d880b2158971d805b6e0efc3110d0b3e24e4b8af2190d2b", + "https://deno.land/std@0.152.0/path/common.ts": "bee563630abd2d97f99d83c96c2fa0cca7cee103e8cb4e7699ec4d5db7bd2633", + "https://deno.land/std@0.152.0/path/glob.ts": "cb5255638de1048973c3e69e420c77dc04f75755524cb3b2e160fe9277d939ee", + "https://deno.land/std@0.152.0/path/mod.ts": "56fec03ad0ebd61b6ab39ddb9b0ddb4c4a5c9f2f4f632e09dd37ec9ebfd722ac", + "https://deno.land/std@0.152.0/path/posix.ts": "c1f7afe274290ea0b51da07ee205653b2964bd74909a82deb07b69a6cc383aaa", + "https://deno.land/std@0.152.0/path/separator.ts": "fe1816cb765a8068afb3e8f13ad272351c85cbc739af56dacfc7d93d710fe0f9", + "https://deno.land/std@0.152.0/path/win32.ts": "bd7549042e37879c68ff2f8576a25950abbfca1d696d41d82c7bca0b7e6f452c", + "https://deno.land/std@0.152.0/streams/conversion.ts": "fc3db02026183da795fa32ac7549868e9f19c75ba029d4b4c3739af62b48517a", + "https://deno.land/std@0.152.0/testing/_diff.ts": "029a00560b0d534bc0046f1bce4bd36b3b41ada3f2a3178c85686eb2ff5f1413", + "https://deno.land/std@0.152.0/testing/_format.ts": "0d8dc79eab15b67cdc532826213bbe05bccfd276ca473a50a3fc7bbfb7260642", + "https://deno.land/std@0.152.0/testing/asserts.ts": "093735c88f52bbead7f60a1f7a97a2ce4df3c2d5fab00a46956f20b4a5793ccd", + "https://deno.land/std@0.154.0/_util/assert.ts": "e94f2eb37cebd7f199952e242c77654e43333c1ac4c5c700e929ea3aa5489f74", + "https://deno.land/std@0.154.0/_wasm_crypto/lib/deno_std_wasm_crypto.generated.mjs": "dfcd6777d05345362c70f9f2c49abba3ed3f925fccfcf725abe2d16d51819433", + "https://deno.land/std@0.154.0/_wasm_crypto/mod.ts": "6c60d332716147ded0eece0861780678d51b560f533b27db2e15c64a4ef83665", + "https://deno.land/std@0.154.0/async/deferred.ts": "c01de44b9192359cebd3fe93273fcebf9e95110bf3360023917da9a2d1489fae", + "https://deno.land/std@0.154.0/bytes/bytes_list.ts": "aba5e2369e77d426b10af1de0dcc4531acecec27f9b9056f4f7bfbf8ac147ab4", + "https://deno.land/std@0.154.0/bytes/equals.ts": "3c3558c3ae85526f84510aa2b48ab2ad7bdd899e2e0f5b7a8ffc85acb3a6043a", + "https://deno.land/std@0.154.0/bytes/mod.ts": "763f97d33051cc3f28af1a688dfe2830841192a9fea0cbaa55f927b49d49d0bf", + "https://deno.land/std@0.154.0/crypto/_fnv/fnv32.ts": "aa9bddead8c6345087d3abd4ef35fb9655622afc333fc41fff382b36e64280b5", + "https://deno.land/std@0.154.0/crypto/_fnv/fnv64.ts": "625d7e7505b6cb2e9801b5fd6ed0a89256bac12b2bbb3e4664b85a88b0ec5bef", + "https://deno.land/std@0.154.0/crypto/_fnv/index.ts": "a8f6a361b4c6d54e5e89c16098f99b6962a1dd6ad1307dbc97fa1ecac5d7060a", + "https://deno.land/std@0.154.0/crypto/_fnv/util.ts": "4848313bed7f00f55be3cb080aa0583fc007812ba965b03e4009665bde614ce3", + "https://deno.land/std@0.154.0/crypto/keystack.ts": "e481eed28007395e554a435e880fee83a5c73b9259ed8a135a75e4b1e4f381f7", + "https://deno.land/std@0.154.0/crypto/mod.ts": "0ef11f063cd0f9759485a3c9051e15125e1bde3b47c23b47e79b6e13cfcf9481", + "https://deno.land/std@0.154.0/crypto/timing_safe_equal.ts": "82a29b737bc8932d75d7a20c404136089d5d23629e94ba14efa98a8cc066c73e", + "https://deno.land/std@0.154.0/encoding/base64.ts": "c57868ca7fa2fbe919f57f88a623ad34e3d970d675bdc1ff3a9d02bba7409db2", + "https://deno.land/std@0.154.0/encoding/base64url.ts": "a5f82a9fa703bd85a5eb8e7c1296bc6529e601ebd9642cc2b5eaa6b38fa9e05a", + "https://deno.land/std@0.154.0/encoding/hex.ts": "4cc5324417cbb4ac9b828453d35aed45b9cc29506fad658f1f138d981ae33795", + "https://deno.land/std@0.154.0/fmt/colors.ts": "ff7dc9c9f33a72bd48bc24b21bbc1b4545d8494a431f17894dbc5fe92a938fc4", + "https://deno.land/std@0.154.0/io/buffer.ts": "fae02290f52301c4e0188670e730cd902f9307fb732d79c4aa14ebdc82497289", + "https://deno.land/std@0.154.0/io/files.ts": "d199ef64e918a256320ba8d8d44ae91de87c9077df8f8d6cca013f1b9fbbe285", + "https://deno.land/std@0.154.0/io/mod.ts": "33507cf2460ab67d0d90fb5749fa6fecb33897642b49d54a6bb1ac81e4768f69", + "https://deno.land/std@0.154.0/io/readers.ts": "45847ad404afd2f605eae1cff193f223462bc55eeb9ae313c2f3db28aada0fd6", + "https://deno.land/std@0.154.0/io/streams.ts": "988a19155b52161f0035ce539e2f1d12edbc4c389fa7633da832a64e6edbe1a0", + "https://deno.land/std@0.154.0/io/types.d.ts": "0cae3a62da7a37043661746c65c021058bae020b54e50c0e774916e5d4baee43", + "https://deno.land/std@0.154.0/io/util.ts": "078da53bba767bec0d45f7da44411f6dbf269e51ef7fcfea5e3714e04681c674", + "https://deno.land/std@0.154.0/io/writers.ts": "2e1c63ffd0cfba411b1fd8374609abff9ea86187c9d4d885d42e6fc20325ef0e", + "https://deno.land/std@0.154.0/streams/conversion.ts": "fc4eb76a14148c43f0b85e903a5a1526391aa40ed9434dc21e34f88304eb823e", + "https://deno.land/std@0.154.0/testing/_diff.ts": "141f978a283defc367eeee3ff7b58aa8763cf7c8e0c585132eae614468e9d7b8", + "https://deno.land/std@0.154.0/testing/_format.ts": "cd11136e1797791045e639e9f0f4640d5b4166148796cad37e6ef75f7d7f3832", + "https://deno.land/std@0.154.0/testing/asserts.ts": "ac295f7fd22a7af107580e2475402a8c386cb1bf18bf837ae266ac0665786026", "https://deno.land/std@0.165.0/_util/asserts.ts": "d0844e9b62510f89ce1f9878b046f6a57bf88f208a10304aab50efcb48365272", "https://deno.land/std@0.165.0/_util/os.ts": "8a33345f74990e627b9dfe2de9b040004b08ea5146c7c9e8fe9a29070d193934", + "https://deno.land/std@0.165.0/async/deferred.ts": "d8fb253ffde2a056e4889ef7e90f3928f28be9f9294b6505773d33f136aab4e6", "https://deno.land/std@0.165.0/async/delay.ts": "0419dfc993752849692d1f9647edf13407c7facc3509b099381be99ffbc9d699", + "https://deno.land/std@0.165.0/bytes/bytes_list.ts": "aba5e2369e77d426b10af1de0dcc4531acecec27f9b9056f4f7bfbf8ac147ab4", + "https://deno.land/std@0.165.0/bytes/equals.ts": "3c3558c3ae85526f84510aa2b48ab2ad7bdd899e2e0f5b7a8ffc85acb3a6043a", + "https://deno.land/std@0.165.0/bytes/mod.ts": "b2e342fd3669176a27a4e15061e9d588b89c1aaf5008ab71766e23669565d179", "https://deno.land/std@0.165.0/collections/_comparators.ts": "b9edf2170aaccbe11407d37e8948b6867cf68fbe5225f4cd4cdb02f174227157", "https://deno.land/std@0.165.0/collections/binary_search_node.ts": "44ce42e032d8701d1cbce0de4a2d991742743554d2df09783198d862284eb263", "https://deno.land/std@0.165.0/collections/binary_search_tree.ts": "64224e394fd3b894b5dee2f8da692405a5d6f107cd2ecbab48c478f63b9fad03", @@ -12,6 +83,9 @@ "https://deno.land/std@0.165.0/datetime/formatter.ts": "7c8e6d16a0950f400aef41b9f1eb9168249869776ec520265dfda785d746589e", "https://deno.land/std@0.165.0/datetime/mod.ts": "ea927ca96dfb28c7b9a5eed5bdc7ac46bb9db38038c4922631895cea342fea87", "https://deno.land/std@0.165.0/datetime/tokenizer.ts": "7381e28f6ab51cb504c7e132be31773d73ef2f3e1e50a812736962b9df1e8c47", + "https://deno.land/std@0.165.0/dotenv/mod.ts": "b149416f0daa0361873097495d16adbb321b8bcb594dcc5cdb6bf9639fd173fd", + "https://deno.land/std@0.165.0/dotenv/util.ts": "6cc392f087577a26a27f0463f77cc0c31a390aa055917099935b36eb2454592d", + "https://deno.land/std@0.165.0/flags/mod.ts": "3b459daf581e047819b6b799c92b96c81b4eecbd5ea025643d54dc0abc6ac923", "https://deno.land/std@0.165.0/fmt/colors.ts": "9e36a716611dcd2e4865adea9c4bec916b5c60caad4cdcdc630d4974e6bb8bd4", "https://deno.land/std@0.165.0/fs/_util.ts": "fdc156f897197f261a1c096dcf8ff9267ed0ff42bd5b31f55053a4763a4bae3b", "https://deno.land/std@0.165.0/fs/copy.ts": "37ad2d3390a672a34baf7d16a8623238906a1ee9b2c5fffc8efaa97810f4e6a9", @@ -26,6 +100,12 @@ "https://deno.land/std@0.165.0/fs/mod.ts": "354a6f972ef4e00c4dd1f1339a8828ef0764c1c23d3c0010af3fcc025d8655b0", "https://deno.land/std@0.165.0/fs/move.ts": "6d7fa9da60dbc7a32dd7fdbc2ff812b745861213c8e92ba96dace0669b0c378c", "https://deno.land/std@0.165.0/fs/walk.ts": "0a754cc4696a15bdb175380a4b7deff3eb65be9768cb11d91a4138beee35c2d7", + "https://deno.land/std@0.165.0/io/buffer.ts": "245f1762a949082ddc0a6e9b15589d0be2d29c150266decd04320b8a8318f9f6", + "https://deno.land/std@0.165.0/io/types.d.ts": "107e1e64834c5ba917c783f446b407d33432c5d612c4b3430df64fc2b4ecf091", + "https://deno.land/std@0.165.0/log/handlers.ts": "61ab932822ba268ad42b25de6f0014892fe469df7627b14245ad32db6fd8b54d", + "https://deno.land/std@0.165.0/log/levels.ts": "82c965b90f763b5313e7595d4ba78d5095a13646d18430ebaf547526131604d1", + "https://deno.land/std@0.165.0/log/logger.ts": "b545159727b023825ee6814d9178fb2a7472f8d95d704c253b771b95c658cf8c", + "https://deno.land/std@0.165.0/log/mod.ts": "90618a3fdbb4520ed4e7d960665322a3dbfc107eebb3345fe0f36c8c8a7b7962", "https://deno.land/std@0.165.0/path/_constants.ts": "df1db3ffa6dd6d1252cc9617e5d72165cd2483df90e93833e13580687b6083c3", "https://deno.land/std@0.165.0/path/_interface.ts": "ee3b431a336b80cf445441109d089b70d87d5e248f4f90ff906820889ecf8d09", "https://deno.land/std@0.165.0/path/_util.ts": "d16be2a16e1204b65f9d0dfc54a9bc472cafe5f4a190b3c8471ec2016ccd1677", @@ -35,6 +115,11 @@ "https://deno.land/std@0.165.0/path/posix.ts": "6b63de7097e68c8663c84ccedc0fd977656eb134432d818ecd3a4e122638ac24", "https://deno.land/std@0.165.0/path/separator.ts": "fe1816cb765a8068afb3e8f13ad272351c85cbc739af56dacfc7d93d710fe0f9", "https://deno.land/std@0.165.0/path/win32.ts": "7cebd2bda6657371adc00061a1d23fdd87bcdf64b4843bb148b0b24c11b40f69", + "https://deno.land/std@0.165.0/streams/buffer.ts": "b532492d7ba43aecb59b6abdd546c2a47e2442cb4c50850b74311a2ccacfd981", + "https://deno.land/std@0.165.0/streams/conversion.ts": "555c6c249f3acf85655f2d0af52d1cb3168e40b1c1fa26beefea501b333abe28", + "https://deno.land/std@0.165.0/streams/delimiter.ts": "e18febbded53df275a897fac9249a6d0a6a5efc943256ad0f6cb23bf4d757668", + "https://deno.land/std@0.165.0/streams/merge.ts": "88ed3dfa030ae076802688e4cadd762a251a41d81ed1776dfd9a2a9a0e970195", + "https://deno.land/std@0.165.0/streams/mod.ts": "f402791689d74bd091ecf8f4015bc5b7d5c18132a55c7c72fe0576d1fb254cf9", "https://deno.land/std@0.165.0/testing/_diff.ts": "a23e7fc2b4d8daa3e158fa06856bedf5334ce2a2831e8bf9e509717f455adb2c", "https://deno.land/std@0.165.0/testing/_format.ts": "cd11136e1797791045e639e9f0f4640d5b4166148796cad37e6ef75f7d7f3832", "https://deno.land/std@0.165.0/testing/_test_suite.ts": "2d07073d5460a4e3ec50c55ae822cd9bd136926d7363091379947fef9c73c3e4", @@ -44,14 +129,117 @@ "https://deno.land/std@0.165.0/testing/mock.ts": "d7ad40139cda87476c4dc1efeffe406bbfb4a5f82b688e0b85bffe9e911526a2", "https://deno.land/std@0.165.0/testing/snapshot.ts": "33fdde49f8797742a96d95553bd5282bbcf1b76c5494c7513a2958cc18423db1", "https://deno.land/std@0.165.0/testing/time.ts": "45ff591b7b821e97a91462115332abc3a2553b5747d14577b6e3e4d01cdd4e5e", - "https://esm.sh/react-dom@18.2.0/server?target=deno": "d573360693005ec5f79edbbde31887aa7ce0aac53c7d96428977d027613ee43d", + "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/mongo@v0.31.1/deps.ts": "ba57aa94021d88959c6aac77edbbe85226e4a6836230dcdd891da63afcbf88c1", + "https://deno.land/x/mongo@v0.31.1/mod.ts": "0989f34d08c40440b8786140abdaf863e964e23df5d1a80e661d3d4170d9d21e", + "https://deno.land/x/mongo@v0.31.1/src/auth/base.ts": "7fe14cf0a63d6bbc4ba69a000a04b3b184d26842504d94652a6af2d0c9494944", + "https://deno.land/x/mongo@v0.31.1/src/auth/mod.ts": "b161611bd5be9e9d1b4497227c8ea93ad4daadcd98038c9e5a707bc5da7a25ca", + "https://deno.land/x/mongo@v0.31.1/src/auth/pbkdf2.ts": "1f1db192fd37869d118ab34780b64567ebcf0ad83a03ef28b3d740cae9adb47a", + "https://deno.land/x/mongo@v0.31.1/src/auth/scram.ts": "187db02e94e7e5423ec902e87d6839028770dca57830dca7f154dcd22a959c0f", + "https://deno.land/x/mongo@v0.31.1/src/auth/x509.ts": "a75b27c549707dd441434ae400a3e6a24da7fe7d4e0e80c9bb79dfc6426b651e", + "https://deno.land/x/mongo@v0.31.1/src/client.ts": "368cac10b3df3bfbc2dfba468d1bbd1332c359a643e0bb81a13d7220a58b43ff", + "https://deno.land/x/mongo@v0.31.1/src/cluster.ts": "cff69bf284a5c7fcaff231494f1ab56ca652e725e58622723e402fbb61448d0e", + "https://deno.land/x/mongo@v0.31.1/src/collection/collection.ts": "b8227c276633d2e6425736d5f5c5d5411deed3bc7bf2fccf36e39d609d5b1cb5", + "https://deno.land/x/mongo@v0.31.1/src/collection/commands/aggregate.ts": "440906a670adb46edb36fd95573ffa83f192775108b621520be992165910e895", + "https://deno.land/x/mongo@v0.31.1/src/collection/commands/find.ts": "5c3b750d8c82ce08d865a381bc71f600406cbc4912c4aa689238755579fb71f8", + "https://deno.land/x/mongo@v0.31.1/src/collection/commands/list_indexes.ts": "d32a5120305d0547497026b4f5ab2ecc2f40ff7f44c405b99c2a0287765333f5", + "https://deno.land/x/mongo@v0.31.1/src/collection/commands/update.ts": "cf352108a5dd34f0928c2196a432383d366b8ed292676c71358b9ecf1289418d", + "https://deno.land/x/mongo@v0.31.1/src/collection/mod.ts": "bd791a0b9b46be4365f88c54893584eadec2f8cd799db9eb05e0b5b4c8d72b8e", + "https://deno.land/x/mongo@v0.31.1/src/database.ts": "6effe102726693d2ed6817973facfbc82ae2b1ac68efddbf54493df7e29e105c", + "https://deno.land/x/mongo@v0.31.1/src/error.ts": "8180a822b0831a94a6a28815865b5b40e3996220684bea60fcb81b272ddd06eb", + "https://deno.land/x/mongo@v0.31.1/src/gridfs/bucket.ts": "a4452d63f6928f57486a214a499b54b80b98cc0d13e3d85a6841b34d5ff12a61", + "https://deno.land/x/mongo@v0.31.1/src/gridfs/indexes.ts": "c9747d8272c65399a6364e08071bd1b5ac9c10816329aa670d7b6b9e895ffb5a", + "https://deno.land/x/mongo@v0.31.1/src/gridfs/upload.ts": "6a54a21b00c6f22ad0da6ceef7a2932dc600560f594c2551abd8e4a64976abae", + "https://deno.land/x/mongo@v0.31.1/src/protocol/cursor.ts": "c370a28856fa236129cc2d7abf7ebc4ac6cdd60acb93e0e7371433f7332394cb", + "https://deno.land/x/mongo@v0.31.1/src/protocol/handshake.ts": "3c3ba547d5322751b9756ce9a4750f3cf18febee0a64edca5b007634bd80e0fe", + "https://deno.land/x/mongo@v0.31.1/src/protocol/header.ts": "0f28db842f886e57b7013606c1391affab2e2960a1a4568d2502e7b788117716", + "https://deno.land/x/mongo@v0.31.1/src/protocol/message.ts": "b1121b98420c9a44783619c7a0b2f7bb2cb305dfc64adc3e6a9b7781f4d35a3a", + "https://deno.land/x/mongo@v0.31.1/src/protocol/mod.ts": "4e24d563049c0a236234598ca786ca13778dc17fdb80ac543ac6c75d0c5094d7", + "https://deno.land/x/mongo@v0.31.1/src/protocol/protocol.ts": "92568dd86e6ef3f54054113d9f5620f158fc1dfee2a7c9d13623975835d5996a", + "https://deno.land/x/mongo@v0.31.1/src/types.ts": "aae7d0053341d26a802de9ac26a5209a67f53052bc2c13fae018396867590d4c", + "https://deno.land/x/mongo@v0.31.1/src/types/geojson.ts": "14690e2fa1591939253ddc9de181b0664051e9462db131b72be5fb9d064dff44", + "https://deno.land/x/mongo@v0.31.1/src/types/geospatial.ts": "c73ee13536365fa5d868b65ab47b3488a5f223a67e1e059761886f750db70ef9", + "https://deno.land/x/mongo@v0.31.1/src/types/gridfs.ts": "e1fd12c3ca58d437267e7a8557d745d23b9d8916d1da34c1847e5e373728dfa0", + "https://deno.land/x/mongo@v0.31.1/src/types/read_write_concern.ts": "d00f35eb85520e776741888685d08d479766a19e9a0a970b53f4594c9db00496", + "https://deno.land/x/mongo@v0.31.1/src/utils/ns.ts": "fb0c57b8dc4d31f8993112d267dec3c163d3e8862198d1cd03b2b51bcc3caad9", + "https://deno.land/x/mongo@v0.31.1/src/utils/saslprep/deps.ts": "95ceb81b353110526dacf2a98854bc79d6e17d7f173af8806e91c05555d7b8c7", + "https://deno.land/x/mongo@v0.31.1/src/utils/saslprep/load_code_points.ts": "f6a4ef2eb2345eac40ffbf1a30661cca803f399865f2a0fadafb71f57d4c97bf", + "https://deno.land/x/mongo@v0.31.1/src/utils/saslprep/memory_pager.ts": "f55a79a13ec569c21630c3915a9af0c6fc0aa2b899121fa2a85a813c6dd4afba", + "https://deno.land/x/mongo@v0.31.1/src/utils/saslprep/mod.ts": "0a8a39a0784d065a79c54ce63d7d7b103d0b94addc5b7bcf985517ba2442c8a1", + "https://deno.land/x/mongo@v0.31.1/src/utils/saslprep/sparse_bitfield.ts": "07d6fe2ecd4ba5f711c44c1ae409bb9c1fe3a3cfc09e27434d231d4aae46dd2d", + "https://deno.land/x/mongo@v0.31.1/src/utils/srv.ts": "ed5f78ffe6480faac68291a87e51e3674eff5f28aec937ee97248e99e1317b16", + "https://deno.land/x/mongo@v0.31.1/src/utils/uri.ts": "dcfab8e1dcfcc875c75ada1d9f366664480c03b65594990d6342ed88925452e5", + "https://deno.land/x/oak@v11.1.0/application.ts": "0a728331822b8e27727ceec48a8499657c3163fc48fd379a8a9578a75f3cdb62", + "https://deno.land/x/oak@v11.1.0/body.ts": "78402a4936accb80372c4944384658105604352d6783de7ff1e36b8832dd93c9", + "https://deno.land/x/oak@v11.1.0/buf_reader.ts": "7cf96aa0ac670b75098113cf88a291a68332cc45efa8a9698f064ac5b8098a0f", + "https://deno.land/x/oak@v11.1.0/content_disposition.ts": "8b8c3cb2fba7138cd5b7f82fc3b5ea39b33db924a824b28261659db7e164621e", + "https://deno.land/x/oak@v11.1.0/context.ts": "014d1ce40e62a7901411425541b0d5a08018968a330595bd686f8d00222a35bb", + "https://deno.land/x/oak@v11.1.0/cookies.ts": "d9f94b99f26c6169c6982ce12323c41a548d001bfc28f464264c22dc3dbf2181", + "https://deno.land/x/oak@v11.1.0/deps.ts": "b897b0f2bec99cd8b402b279b7f21de955d98cbd72835b6c912be5e11c26148b", + "https://deno.land/x/oak@v11.1.0/etag.ts": "19918f5e1964e3fe6c9fe524a88ffbf9900ce1dfe4146b187b2a86256bb6b663", + "https://deno.land/x/oak@v11.1.0/headers.ts": "f50fb05614432bda971021633129aa2e8737e0844e0f01c27a937997b4d8dd4f", + "https://deno.land/x/oak@v11.1.0/helpers.ts": "42212afa07a560b2958359cc19577417e89d9574d6579551a0af36ff7f00cc6e", + "https://deno.land/x/oak@v11.1.0/http_request.ts": "0831c828816fcb58a5aa8361c6865c4151f4c8b59fabcef2e2cd235bb28170c5", + "https://deno.land/x/oak@v11.1.0/http_server_flash.ts": "e312754acad26d3d70f243d657547e697921f67f0a2179dbec41a20a3228fd79", + "https://deno.land/x/oak@v11.1.0/http_server_native.ts": "549dffcd2db5cbb0e44ad50cf9c54956b42a10450b1ac66e1362e32a073c8c1b", + "https://deno.land/x/oak@v11.1.0/http_server_native_request.ts": "07910ea2ed51af6c4e69addf9015cdd8d2b5c9ee03fd4993e386834a129a9eb6", + "https://deno.land/x/oak@v11.1.0/isMediaType.ts": "62d638abcf837ece3a8f07a4b7ca59794135cb0d4b73194c7d5837efd4161005", + "https://deno.land/x/oak@v11.1.0/keyStack.ts": "fa0d5898fb8ba34de1c9cdcf4b2e8434952dc9931671858d33560368784a22ef", + "https://deno.land/x/oak@v11.1.0/mediaTyper.ts": "042b853fc8e9c3f6c628dd389e03ef481552bf07242efc3f8a1af042102a6105", + "https://deno.land/x/oak@v11.1.0/middleware.ts": "de14f045a2ddfe845d89b5d3140ff52cbcc6f3b3965391106ce04480f9786737", + "https://deno.land/x/oak@v11.1.0/middleware/proxy.ts": "b927232f97ec18af4185d7912e45b1191e3ffe24a9c875262ad524211b1274c9", + "https://deno.land/x/oak@v11.1.0/mod.ts": "de52855c8f626e30ba683fb265c0a0773ba2f5f117b3549b7d9c857edba58338", + "https://deno.land/x/oak@v11.1.0/multipart.ts": "98fe9f226de8c26a16d067027b69fb1e34ad8c4055767dd157907d06cea36f9a", + "https://deno.land/x/oak@v11.1.0/range.ts": "68a6df7ab3b868843e33f52deb94c3d4cab25cb9ef369691990c2ac15b04fafb", + "https://deno.land/x/oak@v11.1.0/request.ts": "5852ad36389b48e0428a6f3c90854d01f10d1b15949b56001e1e75c2a00ef0f9", + "https://deno.land/x/oak@v11.1.0/response.ts": "867d81f7eb0c65c7b8e0e0e9e145ededd5b6daa9ad922e6adc6a36a525f439a6", + "https://deno.land/x/oak@v11.1.0/router.ts": "187522a549f6c179ff01d321882a8bfacbfb7f3e24b004ec4534a3613c7f9b0e", + "https://deno.land/x/oak@v11.1.0/send.ts": "7ef2591792426d62add91536bb434566d4b224247ca343fdd63e486f9d4e9446", + "https://deno.land/x/oak@v11.1.0/server_sent_event.ts": "948b0fe4cb3fe38c7db15e476eb3b7671ef20e566d130e9f701d7c0146aa47dd", + "https://deno.land/x/oak@v11.1.0/structured_clone.ts": "ecf42598652b8082f37252cb873d6e257ad728e6fe73c6bd61f343d94501fbde", + "https://deno.land/x/oak@v11.1.0/testing.ts": "7612656efd2975f7a2e6848609f5971922dbec46b76372c5c623202fdd7b9a85", + "https://deno.land/x/oak@v11.1.0/types.d.ts": "41951a18c3bfdb11e40707cab75da078ba8a4907cd7d4e11d8536bc2db0dde05", + "https://deno.land/x/oak@v11.1.0/util.ts": "3af8c4ed04c6cc2bedbe66e562a77fc59c72df31c55a902a63885861ca1639d6", + "https://deno.land/x/path_to_regexp@v6.2.1/index.ts": "894060567837bae8fc9c5cbd4d0a05e9024672083d5883b525c031eea940e556", + "https://deno.land/x/web_bson@v0.2.5/deps.ts": "b113dd66321c328ae90b7cf8f0f6b37ea472f6f5a5a0553f0c7dfd89538d2748", + "https://deno.land/x/web_bson@v0.2.5/mod.ts": "a2b58ed2e1748e6faa56fbe6caf0e1937f4e77de15376cad920aea655b17bcf3", + "https://deno.land/x/web_bson@v0.2.5/src/binary.ts": "2bd89fca666d06b12e4da7ae2aae2b87e495666e002011ceef4fd3e228ea3018", + "https://deno.land/x/web_bson@v0.2.5/src/bson.ts": "608b1b8e1b9a2abcb2d3b601b63e2731608a2ee0941e801a08c1328a37ff0751", + "https://deno.land/x/web_bson@v0.2.5/src/code.ts": "ad713ab49d2c9028fa798630ccdf345a9a2fbaa468c9bd0c3df3f411c3679bd1", + "https://deno.land/x/web_bson@v0.2.5/src/constants.ts": "906fb45165e2df04332ffeb6a407b39d257b76ad64667ecfe4848bfc64934a5e", + "https://deno.land/x/web_bson@v0.2.5/src/db_ref.ts": "2b29a4b74fde79d25322f31f8b98a908270468fa84af7ebd72c1e45b436b9fe2", + "https://deno.land/x/web_bson@v0.2.5/src/decimal128.ts": "f0377c29b255ec423d4b491675dfb83410d5e92a9fcca9bcd63bfd757489b05d", + "https://deno.land/x/web_bson@v0.2.5/src/double.ts": "9df7baf7cdb2d8ef50a141a373c755cabebeb5a5da6c2f551e5377064ccf2aa9", + "https://deno.land/x/web_bson@v0.2.5/src/error.ts": "d7aa0d57de5c6dc137402fc97219b6e136fc2dcddef90f031bdeb52181cc5275", + "https://deno.land/x/web_bson@v0.2.5/src/extended_json.ts": "98f57fba581712e49060ed5d495c3d1b8be557dc61b11588ba79882faad4b289", + "https://deno.land/x/web_bson@v0.2.5/src/float_parser.ts": "bffe91eae89d9d177a88d795981681ecf05850facfb92da93901576a268235cd", + "https://deno.land/x/web_bson@v0.2.5/src/int_32.ts": "8ac60fd82c34b62645f60b2eb45238391a3e0994980dced75b31f97058cbb3b4", + "https://deno.land/x/web_bson@v0.2.5/src/long.ts": "efffd2eb49afd7161452f8f3533d46aad78c9af6b07f6474c8c937a1b53c5d19", + "https://deno.land/x/web_bson@v0.2.5/src/max_key.ts": "8016a701657be73fd4d3b80c746084ba18322bb39bdc4e78e35f0e2f21be2a70", + "https://deno.land/x/web_bson@v0.2.5/src/min_key.ts": "19691f520868996bd2fc96bf26037badf6d32f8702c035e0d8531b549ef9854c", + "https://deno.land/x/web_bson@v0.2.5/src/objectid.ts": "afc51f3bf9d566fa474c96a8ec0362951ff962a4b8c7ecde51e4537fe95be089", + "https://deno.land/x/web_bson@v0.2.5/src/parser/calculate_size.ts": "ca1e81c793860c9200a3c6cfec220539524f81acca0d76738426bbf8ef857950", + "https://deno.land/x/web_bson@v0.2.5/src/parser/deserializer.ts": "40d154d44f80250dfef0121c1c1a997220a38d08c0fc369247f573ef83649802", + "https://deno.land/x/web_bson@v0.2.5/src/parser/serializer.ts": "fdea917596143694eda0059b0f72fdbe72ade0591c6ba4b4e8f82958ab35c37d", + "https://deno.land/x/web_bson@v0.2.5/src/parser/utils.ts": "7bfe19aaf71164d8326f82c1e01dabe6140c18939f4bd8961380495a7c76f57f", + "https://deno.land/x/web_bson@v0.2.5/src/regexp.ts": "1e287a7ada20a0a4b625bf3c191295db149bfefac6beb707fe52d0232c612265", + "https://deno.land/x/web_bson@v0.2.5/src/symbol.ts": "b727698ed367d426b32f068c067ccd43a458347589715dd329b82caf10b9cf32", + "https://deno.land/x/web_bson@v0.2.5/src/timestamp.ts": "49bba69e2a26cfea5870b69c739cbfce64814b21682ed3161105737f3d97ef66", + "https://deno.land/x/web_bson@v0.2.5/src/uuid.ts": "c8c51a946dc8c1d6a15370d50de2247f4fbf69ce1c413ae29c8e211738ec0efc", + "https://deno.land/x/web_bson@v0.2.5/src/uuid_utils.ts": "322cbea409a32cfdbffcae854b91bb30b80730741e032b98f5d6868ad63bc07d", + "https://deno.land/x/web_bson@v0.2.5/src/validate_utf8.ts": "b7f4d723c379fb66aa84e148bb59f78f4e1c96847e28c38ee7f9f3bf35703ae4", + "https://deno.land/x/web_bson@v0.2.5/utils.ts": "4c51c0be4bbb77c1e547eeef9b5aa53ffa611f628684875375103f627649ceb1", + "https://esm.sh/react-dom@18.2.0/server?target=deno": "254dadb754ed6c9e58892a8ac39b3bc049c305df75841f174f51ee9fe44f308b", "https://esm.sh/stable/react@18.2.0/deno/react.js": "806868069cfdb815e028419cf07ebc7a7bcba7f9e31dec9e3a045b9f8e82c1ed", - "https://esm.sh/v96/@types/prop-types@15.7.5/index.d.ts": "6a386ff939f180ae8ef064699d8b7b6e62bc2731a62d7fbf5e02589383838dea", - "https://esm.sh/v96/@types/react-dom@18.0.6/server~.d.ts": "954d3e8681fe59bde6377bc8136c3488eaaace7746bd13b4060f655cc111be25", - "https://esm.sh/v96/@types/react@18.0.21/global.d.ts": "bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f", - "https://esm.sh/v96/@types/react@18.0.21/index.d.ts": "c1331ac9d04748a098127f35e0f3f08f6739381dfdc5d718c2180702bcf3eb96", - "https://esm.sh/v96/@types/scheduler@0.16.2/tracing.d.ts": "f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5", - "https://esm.sh/v96/csstype@3.1.1/index.d.ts": "1c29793071152b207c01ea1954e343be9a44d85234447b2b236acae9e709a383", - "https://esm.sh/v96/react-dom@18.2.0/deno/server.js": "bf1ce0fcb084be382713a3bbf9df8d6564cddad331ef30e9307f1c8eaa1e513d" + "https://esm.sh/v99/@types/prop-types@15.7.5/index.d.ts": "6a386ff939f180ae8ef064699d8b7b6e62bc2731a62d7fbf5e02589383838dea", + "https://esm.sh/v99/@types/react-dom@18.0.9/server~.d.ts": "54e0e45acce638a46c2dc13a5e9800c3fc094ec58baef3aeaedbd0c674a55249", + "https://esm.sh/v99/@types/react@18.0.25/global.d.ts": "bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f", + "https://esm.sh/v99/@types/react@18.0.25/index.d.ts": "12154bc47748a901d10aa84dc39d0ec3a5f2d50624a7f018b473ef5af23063b4", + "https://esm.sh/v99/@types/scheduler@0.16.2/tracing.d.ts": "f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5", + "https://esm.sh/v99/csstype@3.1.1/index.d.ts": "1c29793071152b207c01ea1954e343be9a44d85234447b2b236acae9e709a383", + "https://esm.sh/v99/react-dom@18.2.0/deno/server.js": "bf1ce0fcb084be382713a3bbf9df8d6564cddad331ef30e9307f1c8eaa1e513d" } } diff --git a/etc/fw/templates/default/files/.editorconfig b/etc/fw/templates/default/files/.editorconfig new file mode 100644 index 00000000..98557d82 --- /dev/null +++ b/etc/fw/templates/default/files/.editorconfig @@ -0,0 +1,13 @@ +# EditorConfig is awesome: https://EditorConfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/etc/fw/templates/default/files/.gitattributes b/etc/fw/templates/default/files/.gitattributes new file mode 100644 index 00000000..fce0b9b5 --- /dev/null +++ b/etc/fw/templates/default/files/.gitattributes @@ -0,0 +1,11 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text eol=lf + +*.png binary +*.jpg binary +*.ico binary +*.jpg binary +*.eot binary +*.ttf binary +*.woff binary +*.woff2 binary diff --git a/etc/fw/templates/default/files/.github/FUNDING.yml b/etc/fw/templates/default/files/.github/FUNDING.yml new file mode 100644 index 00000000..c3ca950c --- /dev/null +++ b/etc/fw/templates/default/files/.github/FUNDING.yml @@ -0,0 +1,5 @@ +# These are supported funding model platforms + +github: [eserozvataf] +patreon: eserozvataf +open_collective: eser diff --git a/etc/fw/templates/default/files/.github/ISSUE_TEMPLATE/bug_report.md b/etc/fw/templates/default/files/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..1cffec14 --- /dev/null +++ b/etc/fw/templates/default/files/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,39 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: + +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** +- OS: [e.g. iOS] +- Browser [e.g. chrome, safari] +- Version [e.g. 22] + +**Smartphone (please complete the following information):** +- Device: [e.g. iPhone6] +- OS: [e.g. iOS8.1] +- Browser [e.g. stock browser, safari] +- Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/etc/fw/templates/default/files/.github/ISSUE_TEMPLATE/feature_request.md b/etc/fw/templates/default/files/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..08b9ffb4 --- /dev/null +++ b/etc/fw/templates/default/files/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/etc/fw/templates/default/files/.gitignore b/etc/fw/templates/default/files/.gitignore new file mode 100644 index 00000000..da9b1149 --- /dev/null +++ b/etc/fw/templates/default/files/.gitignore @@ -0,0 +1,22 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# OS-specific files +.DS_Store +Thumbs.db + +# Editor metadata +.vscode/* +!.vscode/extensions.json +!.vscode/settings.json +.idea/ + +# local API keys and secrets +.env.local +.env.*.local + +# sensitive files +*.pem +*.swp + +# typescript +*.tsbuildinfo diff --git a/etc/fw/templates/default/files/.vscode/extensions.json b/etc/fw/templates/default/files/.vscode/extensions.json new file mode 100644 index 00000000..70a40f21 --- /dev/null +++ b/etc/fw/templates/default/files/.vscode/extensions.json @@ -0,0 +1,6 @@ +{ + "recommendations": [ + "denoland.vscode-deno", + "ryanluker.vscode-coverage-gutters" + ] +} diff --git a/etc/fw/templates/default/files/.vscode/settings.json b/etc/fw/templates/default/files/.vscode/settings.json new file mode 100644 index 00000000..6620cabb --- /dev/null +++ b/etc/fw/templates/default/files/.vscode/settings.json @@ -0,0 +1,41 @@ +{ + "deno.enable": true, + "deno.lint": true, + "deno.suggest.autoImports": true, + "deno.suggest.completeFunctionCalls": true, + "deno.suggest.imports.autoDiscover": true, + "deno.suggest.imports.hosts": { + "https://deno.land": true + }, + "deno.suggest.names": true, + "deno.suggest.paths": true, + "deno.unstable": true, + "editor.defaultFormatter": "denoland.vscode-deno", + "coverage-gutters.coverageBaseDir": "**/etc/coverage", + "coverage-gutters.coverageFileNames": ["cov_profile.lcov"], + "coverage-gutters.showGutterCoverage": true, + "coverage-gutters.showLineCoverage": true, + "coverage-gutters.showRulerCoverage": true, + "files.exclude": { + "**/.git": true, + "**/.svn": true, + "**/.hg": true, + "**/CVS": true, + "**/.DS_Store": true, + "**/Thumbs.db": true, + ".github/ISSUE_TEMPLATE": true, + ".github/FUNDING.yml": true, + "etc/coverage/*.json": true, + ".editorconfig": true, + "CODE_OF_CONDUCT.md": true, + "CONTRIBUTING.md": true, + "SECURITY.md": true, + "LICENSE": true + }, + "files.watcherExclude": { + "**/.git/objects/**": true, + "**/.git/subtree-cache/**": true, + "**/.hg/store/**": true, + "etc/coverage/**": true + } +} diff --git a/etc/fw/templates/default/files/README.md b/etc/fw/templates/default/files/README.md new file mode 100644 index 00000000..9348496b --- /dev/null +++ b/etc/fw/templates/default/files/README.md @@ -0,0 +1,70 @@ +# ✖️ [hexfw-web](https://github.com/eserozvataf/hexfw-web) + +Not available yet. + +## Features + +- Built on [Deno](https://deno.land). So it supports Modern Web APIs. +- Transpiles [TypeScript](https://www.typescriptlang.org/) and + [React JSX](https://reactjs.org/) out of the box. + +## Quick start + +Ensure that `Deno` is installed on your system first. + +Clone this git repo `git clone https://github.com/eserozvataf/hex.git` - +and checkout the +[tagged release](https://github.com/eserozvataf/hex/releases) you'd like +to use. + +**Important**: local env files (i.e., `.env.local`) is git-ignored, so you can +have secret your sensitive environment variables by creating local copies of +environment variables before running the service. + +## Commands + +| Command | Description | +| ------------------------- | ---------------------------------------------------- | +| `deno task dev` | Start development mode | +| `deno task test` | Execute unit tests | +| `deno task test:coverage` | Execute unit tests with coverage report | +| `deno task bench` | Executes benchmark testing | +| `deno lint` | Executes linter | +| `deno fmt` | Executes formatter | + +## Running the service + +With `Deno`: + +```bash +deno task start +``` + +## Todo List + +See [GitHub Projects](https://github.com/eserozvataf/hex/projects) for +more. + +## Requirements + +- Deno (https://deno.land/) + +## License + +Apache 2.0, for further details, please see [LICENSE](LICENSE) file. + +## Contributing + +See [CONTRIBUTING.md](CONTRIBUTING.md) for details. + +It is publicly open for any contribution. Bugfixes, new features and extra +modules are welcome. + +- To contribute to code: Fork the repo, push your changes to your fork, and + submit a pull request. +- To report a bug: If something does not work, please report it using + [GitHub Issues](https://github.com/eserozvataf/hex/issues). + +## To Support + +[Visit my GitHub Sponsors profile at github.com/sponsors/eserozvataf](https://github.com/sponsors/eserozvataf) diff --git a/etc/fw/templates/default/files/deno.json b/etc/fw/templates/default/files/deno.json new file mode 100644 index 00000000..cbeaede8 --- /dev/null +++ b/etc/fw/templates/default/files/deno.json @@ -0,0 +1,53 @@ +{ + "importMap": "./import_map.json", + "compilerOptions": { + "allowJs": true, + "emitDecoratorMetadata": true, + "jsx": "react", + "strict": true + }, + "lint": { + "files": { + "include": [ + "src/", + "mod.ts", + "*.md", + "*.json" + ], + "exclude": [] + }, + "rules": { + "tags": [ + "recommended" + ], + "include": [], + "exclude": [] + } + }, + "fmt": { + "files": { + "include": [ + "src/", + "mod.ts", + "*.md", + "*.json" + ], + "exclude": [] + } + }, + "test": { + "files": { + "include": [ + "src/" + ], + "exclude": [] + } + }, + "tasks": { + "test": "deno test --allow-net --allow-env --allow-read ./src/ --parallel --coverage=./etc/coverage", + "test:coverage": "deno coverage ./etc/coverage", + "test:generate-lcov": "deno coverage ./etc/coverage --lcov > ./etc/coverage/cov_profile.lcov", + "bench": "deno bench ./src/ --unstable", + "dev": "deno run -A --watch=src/,public/ dev.ts" + } +} diff --git a/etc/fw/templates/default/files/etc/coverage/.gitkeep b/etc/fw/templates/default/files/etc/coverage/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/etc/fw/templates/default/files/import_map.json b/etc/fw/templates/default/files/import_map.json new file mode 100644 index 00000000..7a0e02c5 --- /dev/null +++ b/etc/fw/templates/default/files/import_map.json @@ -0,0 +1,6 @@ +{ + "imports": { + "@hex/": "https://deno.land/x/hex/src/", + "@app/": "./src/" + } +} diff --git a/etc/fw/templates/default/files/public/favicon.ico b/etc/fw/templates/default/files/public/favicon.ico new file mode 100644 index 00000000..c5e3eb42 Binary files /dev/null and b/etc/fw/templates/default/files/public/favicon.ico differ diff --git a/etc/fw/templates/default/files/public/robots.txt b/etc/fw/templates/default/files/public/robots.txt new file mode 100644 index 00000000..c2a49f4f --- /dev/null +++ b/etc/fw/templates/default/files/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Allow: / diff --git a/etc/fw/templates/default/files/src/app/[...static]/index.module.css b/etc/fw/templates/default/files/src/app/[...static]/index.module.css new file mode 100644 index 00000000..e69de29b diff --git a/etc/fw/templates/default/files/src/app/[...static]/index.translations.ts b/etc/fw/templates/default/files/src/app/[...static]/index.translations.ts new file mode 100644 index 00000000..e69de29b diff --git a/etc/fw/templates/default/files/src/app/[...static]/index.tsx b/etc/fw/templates/default/files/src/app/[...static]/index.tsx new file mode 100644 index 00000000..e69de29b diff --git a/etc/fw/templates/default/files/src/app/[...static]/types.ts b/etc/fw/templates/default/files/src/app/[...static]/types.ts new file mode 100644 index 00000000..4f882816 --- /dev/null +++ b/etc/fw/templates/default/files/src/app/[...static]/types.ts @@ -0,0 +1,30 @@ +const staticPage = { + nameSingular: "StaticPage", + namePlural: "StaticPages", + filePathPattern: "./content/**/*.md", + fields: { + title: { + type: "string", + description: "The title of the static page", + required: true, + }, + date: { + type: "date", + description: "The date of the static page", + required: true, + }, + url: { + type: "string", + description: "The url of the static page", + resolve: (item) => { + const [, title, lang] = /static\/([^\.]*)\.(.*)/.exec( + item.filePath, + ); + + return `/${lang}/${title}`; + }, + }, + }, +}; + +export { staticPage, staticPage as default }; diff --git a/etc/fw/templates/default/files/src/app/_unhandled/index.module.css b/etc/fw/templates/default/files/src/app/_unhandled/index.module.css new file mode 100644 index 00000000..e69de29b diff --git a/etc/fw/templates/default/files/src/app/_unhandled/index.translations.ts b/etc/fw/templates/default/files/src/app/_unhandled/index.translations.ts new file mode 100644 index 00000000..e69de29b diff --git a/etc/fw/templates/default/files/src/app/_unhandled/index.tsx b/etc/fw/templates/default/files/src/app/_unhandled/index.tsx new file mode 100644 index 00000000..610df49d --- /dev/null +++ b/etc/fw/templates/default/files/src/app/_unhandled/index.tsx @@ -0,0 +1,21 @@ +import { type Language } from "@hex/lib/i18n"; +import { type Context, results } from "@hex/fw/web/page"; + +interface PageProps { + lang: Language; +} + +const Page = (_ctx: Context) => { + return results.reactView( +
+

Homepage

+
, + { + title: "Homepage", + description: "This is the homepage", + layout: "@app/shared/layout/layout.tsx", + }, + ); +}; + +export { Page, Page as default }; diff --git a/etc/fw/templates/default/files/src/app/global.css b/etc/fw/templates/default/files/src/app/global.css new file mode 100644 index 00000000..b6904d6e --- /dev/null +++ b/etc/fw/templates/default/files/src/app/global.css @@ -0,0 +1,3 @@ +body { + background: slategray; +} diff --git a/etc/fw/templates/default/files/src/app/home/forms/index.tsx b/etc/fw/templates/default/files/src/app/home/forms/index.tsx new file mode 100644 index 00000000..7d72ed09 --- /dev/null +++ b/etc/fw/templates/default/files/src/app/home/forms/index.tsx @@ -0,0 +1,33 @@ +import React from "https://esm.sh/react@18.2.0?target=deno"; + +import { + dumper, + dumperReact, + executeFromCli, + type HexFunctionInput, + results, +} from "@hex/lib/functions/mod.ts"; +import { type Language } from "@hex/lib/i18n/mod.ts"; + +interface PageProps { + lang: Language; +} + +const Page = (_input: HexFunctionInput) => { + return results.reactView( +
+

Homepage

+
, + { + title: "Homepage", + description: "This is the homepage", + layout: "@app/shared/layout/layout.tsx", + }, + ); +}; + +const result = executeFromCli(Page); +// dumper(result); +dumperReact(result); + +export { Page, Page as default }; diff --git a/etc/fw/templates/default/files/src/app/home/index.module.css b/etc/fw/templates/default/files/src/app/home/index.module.css new file mode 100644 index 00000000..e69de29b diff --git a/etc/fw/templates/default/files/src/app/home/index.translations.ts b/etc/fw/templates/default/files/src/app/home/index.translations.ts new file mode 100644 index 00000000..e69de29b diff --git a/etc/fw/templates/default/files/src/app/home/index.tsx b/etc/fw/templates/default/files/src/app/home/index.tsx new file mode 100644 index 00000000..9ea5d3f9 --- /dev/null +++ b/etc/fw/templates/default/files/src/app/home/index.tsx @@ -0,0 +1,33 @@ +import React from "https://esm.sh/react-dom@18.2.0?target=deno"; + +import { + dumper, + dumperReact, + executeFromCli, + type HexFunctionInput, + results, +} from "@hex/lib/functions/mod.ts"; +import { type Language } from "@hex/lib/i18n/mod.ts"; + +interface PageProps { + lang: Language; +} + +const Page = (_input: HexFunctionInput) => { + return results.reactView( +
+

Homepage

+
, + { + title: "Homepage", + description: "This is the homepage", + layout: "@app/shared/layout/layout.tsx", + }, + ); +}; + +const result = executeFromCli(Page); +// dumper(result); +dumperReact(result); + +export { Page, Page as default }; diff --git a/etc/fw/templates/default/files/src/app/layout.tsx b/etc/fw/templates/default/files/src/app/layout.tsx new file mode 100644 index 00000000..5680b023 --- /dev/null +++ b/etc/fw/templates/default/files/src/app/layout.tsx @@ -0,0 +1,35 @@ +import { type Language } from "@hex/lib/i18n"; +import { BodyContents, HeadContents } from "@hex/fw/web/page"; + +interface LayoutProps { + lang: Language; + children: JSX.Element; +} + +const Layout = (props: LayoutProps) => { + return ( + + + + + + + + + +
+ + + +
+ + + + + ); +}; + +export { Layout, Layout as default }; diff --git a/etc/fw/templates/default/files/src/app/stories/[slug]/index.module.css b/etc/fw/templates/default/files/src/app/stories/[slug]/index.module.css new file mode 100644 index 00000000..e69de29b diff --git a/etc/fw/templates/default/files/src/app/stories/[slug]/index.translations.ts b/etc/fw/templates/default/files/src/app/stories/[slug]/index.translations.ts new file mode 100644 index 00000000..e69de29b diff --git a/etc/fw/templates/default/files/src/app/stories/[slug]/index.tsx b/etc/fw/templates/default/files/src/app/stories/[slug]/index.tsx new file mode 100644 index 00000000..e69de29b diff --git a/etc/fw/templates/default/files/src/app/stories/[slug]/types.ts b/etc/fw/templates/default/files/src/app/stories/[slug]/types.ts new file mode 100644 index 00000000..1bb751a0 --- /dev/null +++ b/etc/fw/templates/default/files/src/app/stories/[slug]/types.ts @@ -0,0 +1,30 @@ +const story = { + nameSingular: "Story", + namePlural: "Stories", + filePathPattern: "./content/**/*.md", + fields: { + title: { + type: "string", + description: "The title of the static page", + required: true, + }, + date: { + type: "date", + description: "The date of the static page", + required: true, + }, + url: { + type: "string", + description: "The url of the static page", + resolve: (item) => { + const [, title, lang] = /stories\/([^\.]*)\.(.*)/.exec( + item.filePath, + ); + + return `/${lang}/stories/${title}`; + }, + }, + }, +}; + +export { story, story as default }; diff --git a/etc/fw/templates/default/files/src/app/stories/index.module.css b/etc/fw/templates/default/files/src/app/stories/index.module.css new file mode 100644 index 00000000..e69de29b diff --git a/etc/fw/templates/default/files/src/app/stories/index.translations.ts b/etc/fw/templates/default/files/src/app/stories/index.translations.ts new file mode 100644 index 00000000..e69de29b diff --git a/etc/fw/templates/default/files/src/app/stories/index.tsx b/etc/fw/templates/default/files/src/app/stories/index.tsx new file mode 100644 index 00000000..e69de29b diff --git a/etc/fw/templates/default/files/src/main.ts b/etc/fw/templates/default/files/src/main.ts new file mode 100644 index 00000000..25cfef05 --- /dev/null +++ b/etc/fw/templates/default/files/src/main.ts @@ -0,0 +1,20 @@ +import { run } from "@hex/fw/web/mod.ts"; + +run({ + urls: { + structure: "/[lang]/[...path]", + rewrites: [ + // { + // source: "/", + // destination: "/en/" + // } + ], + }, + + i18n: { + languages: [ + "en", + "tr", + ], + }, +}); diff --git a/etc/fw/templates/default/files/src/shared/.gitkeep b/etc/fw/templates/default/files/src/shared/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/etc/fw/templates/default/template.json b/etc/fw/templates/default/template.json new file mode 100644 index 00000000..aca7004d --- /dev/null +++ b/etc/fw/templates/default/template.json @@ -0,0 +1,42 @@ +{ + "name": "hex framework web template", + "version": "0.0.1", + "files": [ + ".vscode/extensions.json", + ".vscode/settings.json", + ".github/ISSUE_TEMPLATE/bug_report.md", + ".github/ISSUE_TEMPLATE/feature_request.md", + ".github/FUNDING.yml", + "etc/coverage/.gitkeep", + "public/favicon.ico", + "public/robots.txt", + "src/app/_unhandled/index.module.css", + "src/app/_unhandled/index.translations.ts", + "src/app/_unhandled/index.tsx", + "src/app/[...static]/index.module.css", + "src/app/[...static]/index.translations.ts", + "src/app/[...static]/index.tsx", + "src/app/[...static]/types.ts", + "src/app/home/forms/index.tsx", + "src/app/home/index.module.css", + "src/app/home/index.translations.ts", + "src/app/home/index.tsx", + "src/app/stories/[slug]/index.module.css", + "src/app/stories/[slug]/index.translations.ts", + "src/app/stories/[slug]/index.tsx", + "src/app/stories/[slug]/types.ts", + "src/app/stories/index.module.css", + "src/app/stories/index.translations.ts", + "src/app/stories/index.tsx", + "src/app/global.css", + "src/app/layout.tsx", + "src/shared/.gitkeep", + "src/main.ts", + ".editorconfig", + ".gitattributes", + ".gitignore", + "deno.json", + "import_map.json", + "README.md" + ] +} diff --git a/etc/fw/templates/service/files/.editorconfig b/etc/fw/templates/service/files/.editorconfig new file mode 100644 index 00000000..98557d82 --- /dev/null +++ b/etc/fw/templates/service/files/.editorconfig @@ -0,0 +1,13 @@ +# EditorConfig is awesome: https://EditorConfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/etc/fw/templates/service/files/.env b/etc/fw/templates/service/files/.env new file mode 100644 index 00000000..b0b70435 --- /dev/null +++ b/etc/fw/templates/service/files/.env @@ -0,0 +1,6 @@ +# .env +PORT=8080 +LOGS=INFO + +MONGODB_CONNSTRING=mongodb://localhost:27017 +SENTRY_DSN= diff --git a/etc/fw/templates/service/files/.env.development b/etc/fw/templates/service/files/.env.development new file mode 100644 index 00000000..bf813cdc --- /dev/null +++ b/etc/fw/templates/service/files/.env.development @@ -0,0 +1 @@ +LOGS=DEBUG diff --git a/etc/fw/templates/service/files/.gitattributes b/etc/fw/templates/service/files/.gitattributes new file mode 100644 index 00000000..fce0b9b5 --- /dev/null +++ b/etc/fw/templates/service/files/.gitattributes @@ -0,0 +1,11 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text eol=lf + +*.png binary +*.jpg binary +*.ico binary +*.jpg binary +*.eot binary +*.ttf binary +*.woff binary +*.woff2 binary diff --git a/etc/fw/templates/service/files/.github/FUNDING.yml b/etc/fw/templates/service/files/.github/FUNDING.yml new file mode 100644 index 00000000..c3ca950c --- /dev/null +++ b/etc/fw/templates/service/files/.github/FUNDING.yml @@ -0,0 +1,5 @@ +# These are supported funding model platforms + +github: [eserozvataf] +patreon: eserozvataf +open_collective: eser diff --git a/etc/fw/templates/service/files/.github/ISSUE_TEMPLATE/bug_report.md b/etc/fw/templates/service/files/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..1cffec14 --- /dev/null +++ b/etc/fw/templates/service/files/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,39 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: + +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** +- OS: [e.g. iOS] +- Browser [e.g. chrome, safari] +- Version [e.g. 22] + +**Smartphone (please complete the following information):** +- Device: [e.g. iPhone6] +- OS: [e.g. iOS8.1] +- Browser [e.g. stock browser, safari] +- Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/etc/fw/templates/service/files/.github/ISSUE_TEMPLATE/feature_request.md b/etc/fw/templates/service/files/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..08b9ffb4 --- /dev/null +++ b/etc/fw/templates/service/files/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/etc/fw/templates/service/files/.gitignore b/etc/fw/templates/service/files/.gitignore new file mode 100644 index 00000000..4ce59b0c --- /dev/null +++ b/etc/fw/templates/service/files/.gitignore @@ -0,0 +1,32 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# OS-specific files +.DS_Store +Thumbs.db + +# Editor-specific files +.vscode/* +!.vscode/extensions.json +!.vscode/settings.json +.idea/ + +# dotenv local environment variables file +.env.local +.env.*.local + +# NPM packaging +node_modules/ +yarn.lock +package-lock.json + +# Build output +dist/ +tsconfig.tsbuildinfo + +# sensitive files +*.pem +*.swp + +# coverage files +etc/coverage/*.json +etc/coverage/cov_profile.lcov diff --git a/etc/fw/templates/service/files/.vscode/extensions.json b/etc/fw/templates/service/files/.vscode/extensions.json new file mode 100644 index 00000000..70a40f21 --- /dev/null +++ b/etc/fw/templates/service/files/.vscode/extensions.json @@ -0,0 +1,6 @@ +{ + "recommendations": [ + "denoland.vscode-deno", + "ryanluker.vscode-coverage-gutters" + ] +} diff --git a/etc/fw/templates/service/files/.vscode/settings.json b/etc/fw/templates/service/files/.vscode/settings.json new file mode 100644 index 00000000..d2c36390 --- /dev/null +++ b/etc/fw/templates/service/files/.vscode/settings.json @@ -0,0 +1,48 @@ +{ + "deno.enable": true, + "deno.lint": true, + "deno.suggest.autoImports": true, + "deno.suggest.completeFunctionCalls": true, + "deno.suggest.imports.autoDiscover": true, + "deno.suggest.imports.hosts": { + "https://deno.land": true + }, + "deno.suggest.names": true, + "deno.suggest.paths": true, + "deno.unstable": true, + "editor.defaultFormatter": "denoland.vscode-deno", + "coverage-gutters.coverageBaseDir": "**/etc/coverage", + "coverage-gutters.coverageFileNames": ["cov_profile.lcov"], + "coverage-gutters.showGutterCoverage": true, + "coverage-gutters.showLineCoverage": true, + "coverage-gutters.showRulerCoverage": true, + "files.exclude": { + "**/.git": true, + "**/.svn": true, + "**/.hg": true, + "**/CVS": true, + "**/.DS_Store": true, + "**/Thumbs.db": true, + ".github/ISSUE_TEMPLATE": true, + ".github/FUNDING.yml": true, + "etc/coverage/*.json": true, + "node_modules": true, + "yarn.lock": true, + "package-lock.json": true, + "package.json": true, + ".editorconfig": true, + "CODE_OF_CONDUCT.md": true, + "CONTRIBUTING.md": true, + "SECURITY.md": true, + "LICENSE": true, + "packager.ts": true + }, + "files.watcherExclude": { + "**/.git/objects/**": true, + "**/.git/subtree-cache/**": true, + "**/node_modules/*/**": true, + "**/.hg/store/**": true, + "dist/**": true, + "etc/coverage/**": true + } +} diff --git a/etc/fw/templates/service/files/Dockerfile b/etc/fw/templates/service/files/Dockerfile new file mode 100644 index 00000000..52103f40 --- /dev/null +++ b/etc/fw/templates/service/files/Dockerfile @@ -0,0 +1,21 @@ +FROM denoland/deno:debian-1.27.0 + +EXPOSE 8080 + +WORKDIR /app + +USER deno + +COPY ./src/deps.ts ./src/ +COPY ./deno.json ./ +COPY ./import_map.json ./ +RUN deno cache --unstable ./src/deps.ts + +COPY ./src/ ./src/ +COPY ./etc/ ./etc/ +COPY ./.env ./ +COPY ./.env.* ./ +RUN deno cache --unstable ./src/main.ts + +ENTRYPOINT [] +CMD ["deno", "task", "start"] diff --git a/etc/fw/templates/service/files/README.md b/etc/fw/templates/service/files/README.md new file mode 100644 index 00000000..013f457e --- /dev/null +++ b/etc/fw/templates/service/files/README.md @@ -0,0 +1,108 @@ +# ✖️ [hexfw-service](https://github.com/eserozvataf/hexfw-service) + +Dext Service is a service boilerplate to enable developers to start coding their +**forward-compatible** backend projects immediately. + +However, the motivation behind the project may sound familiar, and there are +tons of boilerplates already that serve this purpose, hexfw-service allows you to +run your code for **both** `Deno` and `Node.js`. + +Since hexfw-service provides an orthogonal solution for `Deno` and `Node.js` code +sharing, it's a perfect boilerplate for developers who want to be able to stick +with modern tooling by using them immediately. hexfw-service simply runs on Deno's +powerful ecosystem, which providers many developer tools and libraries built-in. +Additionally, it allows you to compile your code in order to run on good old +`Node.js`. + +## Features + +- Built on [Deno](https://deno.land) and Oak. So it supports Modern Web APIs. +- Can be compiled to run on `Node.js` as well. +- Transpiles [TypeScript](https://www.typescriptlang.org/) and + [React JSX](https://reactjs.org/) out of the box. +- Separated middleware and actions. +- Simple TDD convention and testing environment. +- Ready to debug on VS Code or Chromium Inspector. +- Ready to containerize. +- [WIP] Development mode. +- [WIP] MongoDB connection support. +- [WIP] JWT authentication middleware. +- [TODO] Built-in [Swagger](https://swagger.io) support. + +## Quick start + +Ensure that `Deno` or `Node.js` is installed on your system first. + +Clone this git repo `git clone https://github.com/eserozvataf/hexfw-service.git` - +and checkout the +[tagged release](https://github.com/eserozvataf/hexfw-service/releases) you'd like +to use. + +**Important**: local env files (i.e., `.env.local`) is git-ignored, so you can +have secret your sensitive environment variables by creating local copies of +environment variables before running the service. + +## Commands + +| Command | Description | +| ------------------------- | ---------------------------------------------------- | +| `deno task build` | Compiles codebase to allow its execution on Node.js | +| `deno task start` | Start application backend | +| `deno task dev` | Debug application with chromium inspector or VS Code | +| `deno task test` | Execute unit tests | +| `deno task test:coverage` | Execute unit tests with coverage report | +| `deno task bench` | Executes benchmark testing | +| `deno task cleanup` | Cleans up generated build files | +| `deno task dockerize` | Start application in a docker container | +| `deno lint` | Executes linter | +| `deno fmt` | Executes formatter | + +## Running the service + +With `Deno`: + +```bash +deno task start +``` + +With `Node.js`: + +```bash +deno task build # build it first in order to run on Node.js +node dist/script/app.js +``` + +## Todo List + +See [GitHub Projects](https://github.com/eserozvataf/hexfw-service/projects) for +more. + +## Requirements + +- Deno (https://deno.land/) or, +- Node.js (https://nodejs.dev/) + +## License + +Apache 2.0, for further details, please see [LICENSE](LICENSE) file. + +## Credits + +Thanks [Oak](https://github.com/oakserver/oak) team for awesome project. Also +their `ErrorEvent` shim (MIT-licensed) is used in this project. + +## Contributing + +See [CONTRIBUTING.md](CONTRIBUTING.md) for details. + +It is publicly open for any contribution. Bugfixes, new features and extra +modules are welcome. + +- To contribute to code: Fork the repo, push your changes to your fork, and + submit a pull request. +- To report a bug: If something does not work, please report it using + [GitHub Issues](https://github.com/eserozvataf/hexfw-service/issues). + +## To Support + +[Visit my GitHub Sponsors profile at github.com/sponsors/eserozvataf](https://github.com/sponsors/eserozvataf) diff --git a/etc/fw/templates/service/files/deno.json b/etc/fw/templates/service/files/deno.json new file mode 100644 index 00000000..ec47806d --- /dev/null +++ b/etc/fw/templates/service/files/deno.json @@ -0,0 +1,74 @@ +{ + "importMap": "./import_map.json", + "compilerOptions": { + "allowJs": true, + "lib": [ + "deno.ns", + "esnext", + "dom", + "dom.iterable", + "dom.asynciterable" + ], + "jsx": "react", + "strict": true + }, + "lint": { + "files": { + "include": [ + "src/", + "mod.ts", + "*.md", + "*.json" + ], + "exclude": [ + "dist/", + "node_modules/" + ] + }, + "rules": { + "tags": [ + "recommended" + ], + "include": [], + "exclude": [] + } + }, + "fmt": { + "files": { + "include": [ + "src/", + "mod.ts", + "*.md", + "*.json" + ], + "exclude": [ + "dist/", + "node_modules/" + ] + } + }, + "test": { + "files": { + "include": [ + "src/" + ], + "exclude": [ + "dist/", + "node_modules/" + ] + } + }, + "tasks": { + "test": "deno test --allow-net --allow-env --allow-read ./src/ --parallel --coverage=./etc/coverage", + "test:coverage": "deno coverage ./etc/coverage", + "test:generate-lcov": "deno coverage ./etc/coverage --lcov > ./etc/coverage/cov_profile.lcov", + "bench": "deno bench ./src/ --unstable", + "cleanup": "rm -rf ./dist/ yarn.lock package-lock.json", + "build": "deno run -A packager.ts", + "start": "deno run --allow-net --allow-env --allow-read --unstable ./src/main.ts", + "cli": "deno run ./src/test.ts", + "dev": "deno run --allow-net --allow-env --allow-read --unstable --watch ./src/main.ts", + "dev:inspector": "deno run --allow-net --allow-env --allow-read --unstable --inspect-brk --watch ./src/main.ts", + "dockerize": "docker build -t hexfw-service . && docker run -it --init -p 8080:8080 hexfw-service" + } +} diff --git a/etc/fw/templates/service/files/etc/coverage/.gitkeep b/etc/fw/templates/service/files/etc/coverage/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/etc/fw/templates/service/files/import_map.json b/etc/fw/templates/service/files/import_map.json new file mode 100644 index 00000000..7a0e02c5 --- /dev/null +++ b/etc/fw/templates/service/files/import_map.json @@ -0,0 +1,6 @@ +{ + "imports": { + "@hex/": "https://deno.land/x/hex/src/", + "@app/": "./src/" + } +} diff --git a/etc/fw/templates/service/files/package.json b/etc/fw/templates/service/files/package.json new file mode 100644 index 00000000..e29e7642 --- /dev/null +++ b/etc/fw/templates/service/files/package.json @@ -0,0 +1,30 @@ +{ + "name": "hexfw-service", + "description": "Deno and Node.js boilerplate for plain backend microservices", + "keywords": [], + "version": "0.5.0", + "homepage": "https://github.com/eserozvataf/hexfw-service#readme", + "author": "Eser Ozvataf ", + "contributors": [ + { + "name": "Eser Ozvataf", + "email": "eser@ozvataf.com", + "url": "http://eser.ozvataf.com/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/eserozvataf/hexfw-service.git" + }, + "bugs": { + "url": "https://github.com/eserozvataf/hexfw-service/issues" + }, + "license": "Apache-2.0", + "devDependencies": { + "@types/node": "^18.7.18", + "@types/ws": "^8.5.3" + }, + "dependencies": { + "tslib": "^2.4.0" + } +} diff --git a/etc/fw/templates/service/files/packager.ts b/etc/fw/templates/service/files/packager.ts new file mode 100644 index 00000000..c98250b7 --- /dev/null +++ b/etc/fw/templates/service/files/packager.ts @@ -0,0 +1,90 @@ +import { LibName, build, emptyDir } from "https://deno.land/x/dnt/mod.ts"; +import packageJson from "./package.json" assert { type: "json" }; +import denoJson from "./deno.json" assert { type: "json" }; + +await emptyDir("./dist"); + +await build({ + packageManager: "yarn", + entryPoints: [ + "./src/main.ts", + ], + outDir: "./dist", + package: packageJson, + importMap: denoJson.importMap, + shims: { + custom: [ + // web streams + { + package: { + name: "web-streams-polyfill", // stream/web + subPath: "ponyfill/es2018", + version: "3.2.1", + }, + globalNames: [ + { + name: "ReadableStream", + exportName: "ReadableStream", + }, + { + name: "TransformStream", + exportName: "TransformStream", + }, + ], + }, + // error event + { + module: "https://deno.land/x/hex@0.5.25/src/shims/error-event/error-event.ts", + globalNames: [ + { + name: "ErrorEvent", + exportName: "ErrorEvent", + }, + ], + }, + ], + // see JS docs for overview and more options + deno: true, + // replaces node.js timers with browser-API compatible ones + timers: true, + // the global confirm, alert, and prompt functions + prompts: true, + // shims the Blob global with the one from the "buffer" module + blob: true, + // shims the crypto global. + crypto: true, + // shims DOMException + domException: true, + // shims fetch, File, FormData, Headers, Request, and Response + undici: true, + // shams (checker) for the global.WeakRef, helps type-checking only + weakRef: true, + // shims WebSocket + webSocket: true, + }, + mappings: { + "https://deno.land/x/oak@v11.1.0/http_server_native.ts": "https://deno.land/x/oak@v11.1.0/http_server_node.ts", + }, + typeCheck: false, + test: false, + declaration: true, + compilerOptions: { + // importHelpers: tsconfigJson?.compilerOptions?.importHelpers, + importHelpers: true, + // target: tsconfigJson?.compilerOptions?.target, + target: "ES2017", + // sourceMap: tscconfigJson?.compilerOptions?.sourceMap, + // inlineSources: tscconfigJson?.compilerOptions?.inlineSources, + // lib: denoJson?.compilerOptions?.lib as LibName[] | undefined, + lib: ["esnext", "dom", "dom.iterable"], // , "dom.asynciterable" + // skipLibCheck: tsconfigJson?.compilerOptions?.skipLibCheck, + }, + scriptModule: "cjs", +}); + +// post build steps +Deno.copyFileSync("LICENSE", "dist/LICENSE"); +Deno.copyFileSync("README.md", "dist/README.md"); +Deno.copyFileSync("CODE_OF_CONDUCT.md", "dist/CODE_OF_CONDUCT.md"); +Deno.copyFileSync("CONTRIBUTING.md", "dist/CONTRIBUTING.md"); +Deno.copyFileSync("SECURITY.md", "dist/SECURITY.md"); diff --git a/etc/fw/templates/service/files/src/actions/echo.test.ts b/etc/fw/templates/service/files/src/actions/echo.test.ts new file mode 100644 index 00000000..7bbbf7a4 --- /dev/null +++ b/etc/fw/templates/service/files/src/actions/echo.test.ts @@ -0,0 +1,19 @@ +import * as di from "@hex/lib/di/mod.ts"; +import { echoAction } from "@app/actions/echo.ts"; +import { asserts } from "@app/deps.ts"; + +Deno.test("actions:echo", async (t) => { + await t.step("basic output", () => { + const slug = "eser"; + const test = "placeholder value"; + + di.registry.setValue("test", test); + + const expected = { + message: `Hello ${slug}! Testing ${test}...`, + timestamp: new Date().toLocaleDateString(), + }; + + asserts.assertEquals(expected, echoAction({ registry: di.registry, slug })); + }); +}); diff --git a/etc/fw/templates/service/files/src/actions/echo.ts b/etc/fw/templates/service/files/src/actions/echo.ts new file mode 100644 index 00000000..fa6b1a12 --- /dev/null +++ b/etc/fw/templates/service/files/src/actions/echo.ts @@ -0,0 +1,17 @@ +import { type Registry } from "@app/types.ts"; + +interface EchoActionProps { + registry: Registry; + slug: string; +} + +const echoAction = (props: EchoActionProps) => { + const { test } = props.registry.getMany("test"); + + return { + message: `Hello ${props.slug}! Testing ${test}...`, + timestamp: new Date().toLocaleDateString(), + }; +}; + +export { echoAction, echoAction as default, type EchoActionProps }; diff --git a/etc/fw/templates/service/files/src/actions/error-prone.ts b/etc/fw/templates/service/files/src/actions/error-prone.ts new file mode 100644 index 00000000..8b5f20ab --- /dev/null +++ b/etc/fw/templates/service/files/src/actions/error-prone.ts @@ -0,0 +1,5 @@ +const errorProneAction = () => { + throw new Error("there is an unhandled error"); +}; + +export { errorProneAction, errorProneAction as default }; diff --git a/etc/fw/templates/service/files/src/actions/home.test.ts b/etc/fw/templates/service/files/src/actions/home.test.ts new file mode 100644 index 00000000..0e689add --- /dev/null +++ b/etc/fw/templates/service/files/src/actions/home.test.ts @@ -0,0 +1,10 @@ +import { homeAction } from "@app/actions/home.ts"; +import { asserts } from "@app/deps.ts"; + +Deno.test("actions:home", async (t) => { + await t.step("basic output", () => { + const expected = "Hello world!"; + + asserts.assertEquals(expected, homeAction()); + }); +}); diff --git a/etc/fw/templates/service/files/src/actions/home.ts b/etc/fw/templates/service/files/src/actions/home.ts new file mode 100644 index 00000000..154eb55f --- /dev/null +++ b/etc/fw/templates/service/files/src/actions/home.ts @@ -0,0 +1,5 @@ +const homeAction = () => { + return "Hello world!"; +}; + +export { homeAction, homeAction as default }; diff --git a/etc/fw/templates/service/files/src/actions/mongo.ts b/etc/fw/templates/service/files/src/actions/mongo.ts new file mode 100644 index 00000000..c29f2f12 --- /dev/null +++ b/etc/fw/templates/service/files/src/actions/mongo.ts @@ -0,0 +1,21 @@ +import { type Context, type Registry } from "@app/types.ts"; +import { MongoDbConnection } from "@hex/lib/data/adapters/mongodb.ts"; + +interface Comment { + _id: string; + comment: string; + metric_id: string; + workspace_id: string; +} + +const mongoAction = async (ctx: Context) => { + const registry = ctx.app.state.registry as Registry; + const db = await registry.get("db"); + const commentRepository = db!.repository("comments"); + + const comments = await commentRepository.getAll(); + + return comments; +}; + +export { mongoAction, mongoAction as default }; diff --git a/etc/fw/templates/service/files/src/deps.ts b/etc/fw/templates/service/files/src/deps.ts new file mode 100644 index 00000000..aafa3c91 --- /dev/null +++ b/etc/fw/templates/service/files/src/deps.ts @@ -0,0 +1,4 @@ +export * as asserts from "@hex/lib/stdx/testing/asserts.ts"; +export * as bdd from "@hex/lib/stdx/testing/bdd.ts"; +export * as log from "@hex/lib/stdx/log.ts"; +export * as mongo from "https://deno.land/x/mongo/mod.ts"; diff --git a/etc/fw/templates/service/files/src/main.ts b/etc/fw/templates/service/files/src/main.ts new file mode 100644 index 00000000..d919cd59 --- /dev/null +++ b/etc/fw/templates/service/files/src/main.ts @@ -0,0 +1,67 @@ +import { MongoDbConnection } from "@hex/lib/data/adapters/mongodb.ts"; +import { type Context, run } from "@hex/fw/service/mod.ts"; +import { addHeaderMiddleware } from "@hex/fw/service/middlewares/add-header.ts"; +import { corsMiddleware } from "@hex/fw/service/middlewares/cors.ts"; +import { jwtMiddleware } from "@hex/fw/service/middlewares/jwt.ts"; + +import { homeAction } from "@app/actions/home.ts"; +import { mongoAction } from "@app/actions/mongo.ts"; +import { echoAction } from "@app/actions/echo.ts"; +import { errorProneAction } from "@app/actions/error-prone.ts"; + +import * as Sentry from "npm:@sentry/node"; + +import { type AppOptions } from "./types.ts"; + +run(async (s) => { + // configure options + await s.configureOptions((env, options) => { + options.mongoDbConnString = env.readString("MONGODB_CONNSTRING"); + options.sentryDsn = env.readString("SENTRY_DSN"); + }); + + // configure di registry + await s.configureDI((registry) => { + registry.setValue("test", "placeholder value"); + + registry.setValueLazy("db", async () => { + const client = new MongoDbConnection(s.options.mongoDbConnString!); + await client.connect(); + + return client; + }); + }); + + // add middlewares + s.addMiddleware( + addHeaderMiddleware({ "if-none-match": "no-match-for-this" }), + ); + s.addMiddleware(corsMiddleware()); + s.addMiddleware(jwtMiddleware()); + + // add routes + s.addHealthCheck("/health-check"); + + s.addRoute("get", "/", homeAction); + s.addRoute("get", "/mongo", mongoAction); + s.addRoute("get", "/error", errorProneAction); + + s.addRoute("get", "/:slug", (ctx: Context) => { + ctx.assert(ctx?.params?.slug?.length > 2, 400, "Slug is required"); + + return echoAction({ registry: s.registry, slug: ctx?.params?.slug }); + }); + + // sentry initialization + if (s.options.sentryDsn !== undefined) { + Sentry.init({ + dsn: s.options.sentryDsn, + + // Set tracesSampleRate to 1.0 to capture 100% + // of transactions for performance monitoring. + // We recommend adjusting this value in production + tracesSampleRate: 1.0, + environment: s.options.envName, + }); + } +}); diff --git a/etc/fw/templates/service/files/src/types.ts b/etc/fw/templates/service/files/src/types.ts new file mode 100644 index 00000000..0290daaa --- /dev/null +++ b/etc/fw/templates/service/files/src/types.ts @@ -0,0 +1,16 @@ +import { type Registry } from "@hex/lib/di/registry.ts"; +import { + type Context, + type Service, + type ServiceOptions, +} from "@hex/fw/service/mod.ts"; + +// interface definitions +interface AppOptions extends ServiceOptions { + mongoDbConnString?: string; + sentryDsn?: string; +} + +type App = Service; + +export { type App, type AppOptions, type Context, type Registry }; diff --git a/etc/fw/templates/service/template.json b/etc/fw/templates/service/template.json new file mode 100644 index 00000000..bb049f85 --- /dev/null +++ b/etc/fw/templates/service/template.json @@ -0,0 +1,31 @@ +{ + "name": "hex framework service template", + "version": "0.0.1", + "files": [ + ".vscode/extensions.json", + ".vscode/settings.json", + ".vscode/launch.json", + ".github/ISSUE_TEMPLATE/bug_report.md", + ".github/ISSUE_TEMPLATE/feature_request.md", + ".github/FUNDING.yml", + "etc/coverage/.gitkeep", + "src/actions/echo.ts", + "src/actions/echo.test.ts", + "src/actions/error-prone.ts", + "src/actions/home.ts", + "src/actions/home.test.ts", + "src/actions/mongo.ts", + "src/types.ts", + "src/deps.ts", + "src/main.ts", + ".editorconfig", + ".gitattributes", + ".gitignore", + ".env", + ".env.development", + "Dockerfile", + "deno.json", + "import_map.json", + "README.md" + ] +} diff --git a/hex.ts b/hex.ts new file mode 100644 index 00000000..ac8b86a6 --- /dev/null +++ b/hex.ts @@ -0,0 +1,135 @@ +import { + type Command, + CommandType, + ValueType, + execute, + ExecuteOptions, + showHelp, + showVersion, +} from "https://deno.land/x/hex/src/lib/cli/mod.ts"; +import { create } from "https://deno.land/x/hex/src/fw/generator/create.ts"; +import metadata from "https://deno.land/x/hex/src/metadata.json" assert { type: "json" }; + +const upgradeCli = async (_args: string[], _options: ExecuteOptions) => { + const p = Deno.run({ + cmd: ["deno", "install", "-A", "-r", "-f", "https://deno.land/x/hex/hex.ts"], + stdout: "inherit", + stderr: "inherit", + stdin: "null", + }); + + await p.status(); +}; + +const run = async (args: string[], _options: ExecuteOptions) => { + const p = Deno.run({ + cmd: ["deno", "run", "-A", "--unstable", "src/main.ts", ...args], + stdout: "inherit", + stderr: "inherit", + stdin: "null", + }); + + await p.status(); +}; + +const test = async (_args: string[], _options: ExecuteOptions) => { + const p = Deno.run({ + cmd: ["deno", "task", "test"], + stdout: "inherit", + stderr: "inherit", + stdin: "null", + }); + + await p.status(); +}; + +const hexCli = async () => { + const executeOptions: ExecuteOptions = { + command: "hex", + module: import.meta.url, + }; + + const commands: Command[] = [ + { + type: CommandType.SubCommand, + name: "upgrade", + // shortcut: "u", + description: "Upgrades hex cli to the latest version", + isDefault: true, + + run: (args: string[]) => upgradeCli(args, executeOptions), + }, + { + type: CommandType.SubCommand, + name: "create", + shortcut: "c", + description: "Initialize a new project", + + subcommands: [ + { + type: CommandType.Option, + name: "template", + shortcut: "t", + description: "The template to use", + defaultValue: "default", + valueType: ValueType.String, + }, + ], + + run: (args: string[]) => create(args, executeOptions), + }, + { + type: CommandType.SubCommand, + name: "run", + // shortcut: "r", + description: "Runs the project", + + subcommands: [ + { + type: CommandType.Option, + name: "reload", + shortcut: "r", + description: "Reloads all modules before running", + defaultValue: false, + valueType: ValueType.Boolean, + }, + ], + + run: (args: string[]) => run(args, executeOptions), + }, + { + type: CommandType.SubCommand, + name: "test", + // shortcut: "t", + description: "Runs tests of the project", + + run: (args: string[]) => test(args, executeOptions), + }, + { + type: CommandType.Option, + name: "help", + shortcut: "h", + description: "Display help information", + + run: () => showHelp(commands, metadata.version, executeOptions), + }, + { + type: CommandType.Option, + name: "version", + shortcut: "V", + description: "Display version information", + + run: () => showVersion(metadata.version, executeOptions), + }, + ]; + + const args = (typeof Deno !== "undefined") ? Deno.args : []; + + execute(commands, args, executeOptions); +}; + +if (import.meta.main) { + hexCli(); +} + +export { hexCli as default, hexCli, run, test, upgradeCli }; diff --git a/import_map.json b/import_map.json index f6ca8454..899e37ca 100644 --- a/import_map.json +++ b/import_map.json @@ -1,3 +1,4 @@ { - "imports": {} + "imports": { + } } diff --git a/pre-commit.ts b/pre-commit.ts index 7b2bc29c..b3289c96 100644 --- a/pre-commit.ts +++ b/pre-commit.ts @@ -1,5 +1,5 @@ import metadata from "./src/metadata.json" assert { type: "json" }; -import * as path from "./src/stdx/path.ts"; +import * as path from "./src/lib/stdx/path.ts"; const main = async () => { const baseUrl = new URL(".", import.meta.url); diff --git a/src/fw/generator/copy.ts b/src/fw/generator/copy.ts new file mode 100644 index 00000000..c3782348 --- /dev/null +++ b/src/fw/generator/copy.ts @@ -0,0 +1,51 @@ +import { path, streams } from "./deps.ts"; + +const tryParseUrl = (url: string): URL | undefined => { + try { + return new URL(url); + } catch (err) { + if (err instanceof TypeError) { + return undefined; + } + + throw err; + } +}; + +const copy = async (source: string, target: string) => { + let sourceStream: Deno.Reader | undefined; + + const sourceUrl = tryParseUrl(source); + const isLocalFile = (sourceUrl === undefined) || + (sourceUrl.protocol === "file:"); + + if (isLocalFile) { + sourceStream = await Deno.open( + sourceUrl !== undefined ? path.posix.fromFileUrl(sourceUrl) : source, + ); + } else { + sourceStream = await fetch(sourceUrl) + .then((response) => response.body) + .then((body) => body?.getReader()) + .then((reader) => + (reader !== undefined) + ? streams.readerFromStreamReader(reader) + : undefined + ); + } + + if (sourceStream === undefined) { + throw new Error( + `source stream reader is undefined for '${sourceUrl?.href ?? source}'`, + ); + } + + const targetStream = await Deno.open(target, { + create: true, + write: true, + }); + + await streams.copy(sourceStream, targetStream); +}; + +export { copy, copy as default }; diff --git a/src/fw/generator/create.ts b/src/fw/generator/create.ts new file mode 100644 index 00000000..e9a52043 --- /dev/null +++ b/src/fw/generator/create.ts @@ -0,0 +1,88 @@ +import { type ExecuteOptions, validateOptions } from "../../lib/cli/mod.ts"; +import metadata from "../../metadata.json" assert { type: "json" }; +import { flags } from "./deps.ts"; +import { generate } from "./generate.ts"; + +const showHelp = (options: ExecuteOptions) => { + let generateCommand, otherCommand; + + if (options.command !== undefined) { + generateCommand = `hex create`; + otherCommand = `hex create`; + } else { + generateCommand = `deno run -A ${options.moduleRelative}`; // --allow-read --allow-write --allow-net + otherCommand = `deno run -A ${options.moduleRelative}`; // --allow-read + } + + const messageContents = `hexfw/generator + + Initialize a new hex project. This will create all the necessary files for + a new hex framework project. + + To generate a project in the './my-project' subdirectory: + ${generateCommand} my-project + + To generate a project in the './my-project' subdirectory with the + specific template: + ${generateCommand} my-service-project --template service + + To generate a project in the current directory: + ${generateCommand} . + + Print this message: + ${otherCommand} --help + `; + + console.log(messageContents); +}; + +const showVersion = () => { + const messageContents = `hexfw/generator version ${metadata.version}`; + + console.log(messageContents); +}; + +const create = async (args: string[], options: ExecuteOptions) => { + const options_ = validateOptions(options); + + const params = flags.parse(args, { + alias: { + "h": "help", + "V": "version", + "t": "template", + }, + boolean: ["help", "version"], + string: ["template"], + default: {}, + }); + + if (params.version) { + showVersion(); + return; + } + + if (params.help || params._.length === 0) { + showHelp(options_); + return; + } + + if (params._.length === 1) { + const [projectPath] = params._ as string[]; + + const relativeUrl = new URL(".", import.meta.url); + + await generate(relativeUrl.href, projectPath, params.template); + + return; + } + + console.log( + `invalid command - ${args.join(" ")}'`, + ); +}; + +if (import.meta.main) { + create(Deno.args, { module: import.meta.url }); +} + +export { create, create as default }; diff --git a/src/fw/generator/deps.ts b/src/fw/generator/deps.ts new file mode 100644 index 00000000..bdee6afa --- /dev/null +++ b/src/fw/generator/deps.ts @@ -0,0 +1,3 @@ +export * as flags from "../../lib/stdx/flags.ts"; +export * as path from "../../lib/stdx/path.ts"; +export * as streams from "../../lib/stdx/streams.ts"; diff --git a/src/fw/generator/generate.ts b/src/fw/generator/generate.ts new file mode 100644 index 00000000..2bc29ebb --- /dev/null +++ b/src/fw/generator/generate.ts @@ -0,0 +1,39 @@ +import { path } from "./deps.ts"; +import { readTemplate } from "./template-reader.ts"; +import { copy } from "./copy.ts"; + +const generate = async ( + basePath: string, + projectPath: string, + templateName?: string, +) => { + const templateFolder = `../../etc/templates/${templateName ?? "default"}`; + const template = await readTemplate(templateFolder).then((mod) => + mod.default + ); + + console.log( + `Creating "${template.name} ${template.version}" on ${projectPath}...`, + ); + await Deno.mkdir(projectPath, { recursive: true }); + + for (const file of template.files) { + const sourcePath = path.posix.join( + basePath, + `${templateFolder}/files`, + file, + ); + const targetPath = path.posix.join(projectPath, file); + + console.log(`Copying ${targetPath}...`); + + const targetPathDirectory = path.posix.dirname(targetPath); + await Deno.mkdir(targetPathDirectory, { recursive: true }); + + copy(sourcePath, targetPath); + } + + console.log("done."); +}; + +export { generate, generate as default }; diff --git a/src/fw/generator/template-reader.ts b/src/fw/generator/template-reader.ts new file mode 100644 index 00000000..0df74041 --- /dev/null +++ b/src/fw/generator/template-reader.ts @@ -0,0 +1,13 @@ +const fetchTemplate = async (templatePath: string) => { + const template = await import(templatePath, { assert: { type: "json" } }); + + return template; +}; + +const readTemplate = (templateFolder: string) => { + const templateFile = `${templateFolder}/template.json`; + + return fetchTemplate(templateFile); +}; + +export { readTemplate, readTemplate as default }; diff --git a/src/fw/mod.ts b/src/fw/mod.ts new file mode 100644 index 00000000..2bb311be --- /dev/null +++ b/src/fw/mod.ts @@ -0,0 +1,3 @@ +export * as generator from "./service/mod.ts"; +export * as service from "./service/mod.ts"; +export * as web from "./web/mod.ts"; diff --git a/src/fw/service/deps.ts b/src/fw/service/deps.ts new file mode 100644 index 00000000..926d5b44 --- /dev/null +++ b/src/fw/service/deps.ts @@ -0,0 +1,4 @@ +export * as djwt from "https://deno.land/x/djwt@v2.7/mod.ts"; +export * as oak from "https://deno.land/x/oak@v11.1.0/mod.ts"; +export * as asserts from "../../lib/stdx/testing/asserts.ts"; +export * as log from "../../lib/stdx/log.ts"; diff --git a/src/fw/service/middlewares/add-header.ts b/src/fw/service/middlewares/add-header.ts new file mode 100644 index 00000000..fc70dc38 --- /dev/null +++ b/src/fw/service/middlewares/add-header.ts @@ -0,0 +1,14 @@ +const addHeaderMiddleware = (headers: Record) => { + // deno-lint-ignore no-explicit-any + const addHeaderMiddlewarFn = async (ctx: any, next: any) => { + for (const [key, value] of Object.entries(headers)) { + ctx.response.headers.set(key, value); + } + + await next(); + }; + + return addHeaderMiddlewarFn; +}; + +export { addHeaderMiddleware, addHeaderMiddleware as default }; diff --git a/src/fw/service/middlewares/cors.ts b/src/fw/service/middlewares/cors.ts new file mode 100644 index 00000000..84a51f78 --- /dev/null +++ b/src/fw/service/middlewares/cors.ts @@ -0,0 +1,12 @@ +const corsMiddleware = () => { + // deno-lint-ignore no-explicit-any + const corsMiddlewarFn = async (ctx: any, next: any) => { + ctx.response.headers.set("Access-Control-Allow-Origin", "*"); + + await next(); + }; + + return corsMiddlewarFn; +}; + +export { corsMiddleware, corsMiddleware as default }; diff --git a/src/fw/service/middlewares/error-handler.ts b/src/fw/service/middlewares/error-handler.ts new file mode 100644 index 00000000..3606c597 --- /dev/null +++ b/src/fw/service/middlewares/error-handler.ts @@ -0,0 +1,41 @@ +import { log, oak } from "../deps.ts"; +import { type Service, type ServiceOptions } from "../types.ts"; + +const fixErrorObjectResult = (err: Error) => { + const serialized = JSON.stringify(err, Object.getOwnPropertyNames(err)); + + return JSON.parse(serialized); +}; + +const errorHandlerMiddleware = ( + service: Service, +) => { + // deno-lint-ignore no-explicit-any + const errorHandlerMiddlewareFn = async (ctx: any, next: any) => { + try { + await next(); + } catch (err) { + log.error(err); + + if (oak.isHttpError(err)) { + ctx.response.status = err.status; + } else { + ctx.response.status = 500; + } + + if (service.options.envName === "production") { + ctx.response.body = { error: err.message }; + } else { + ctx.response.body = { + error: err.message, + details: fixErrorObjectResult(err), + }; + } + ctx.response.type = "json"; + } + }; + + return errorHandlerMiddlewareFn; +}; + +export { errorHandlerMiddleware, errorHandlerMiddleware as default }; diff --git a/src/fw/service/middlewares/jwt.ts b/src/fw/service/middlewares/jwt.ts new file mode 100644 index 00000000..a9304582 --- /dev/null +++ b/src/fw/service/middlewares/jwt.ts @@ -0,0 +1,32 @@ +import { djwt } from "../deps.ts"; + +const jwtMiddleware = (key?: CryptoKey, decodeOnly?: boolean) => { + // deno-lint-ignore no-explicit-any + const jwtMiddlewareFn = async (ctx: any, next: any) => { + const authHeader = ctx.request.headers.get("Authorization"); + + if (authHeader === null || !authHeader.startsWith("Bearer ")) { + // ctx.response.status = 401; + // ctx.response.body = { error: "Unauthorized" }; + + await next(); + return; + } + + const authToken = authHeader.slice(7); + + if (decodeOnly) { + const payload = await djwt.decode(authToken); + ctx.state.jwt = payload; + } else { + const payload = await djwt.verify(authToken, key ?? null); + ctx.state.jwt = payload; + } + + await next(); + }; + + return jwtMiddlewareFn; +}; + +export { jwtMiddleware, jwtMiddleware as default }; diff --git a/src/fw/service/middlewares/timer.ts b/src/fw/service/middlewares/timer.ts new file mode 100644 index 00000000..af644c6a --- /dev/null +++ b/src/fw/service/middlewares/timer.ts @@ -0,0 +1,19 @@ +import { log } from "../deps.ts"; + +const timerMiddleware = () => { + // deno-lint-ignore no-explicit-any + const timerMiddlewareFn = async (ctx: any, next: any) => { + const start = Date.now(); + + await next(); + + const ms = Date.now() - start; + + // ctx.response.headers.set("X-Response-Time", `${ms}ms`); + log.info(`${ctx.request.method} ${ctx.request.url} - ${ms}ms`); + }; + + return timerMiddlewareFn; +}; + +export { timerMiddleware, timerMiddleware as default }; diff --git a/src/fw/service/mod.ts b/src/fw/service/mod.ts new file mode 100644 index 00000000..6ac87a2a --- /dev/null +++ b/src/fw/service/mod.ts @@ -0,0 +1,3 @@ +export * from "./types.ts"; +export * from "./options.ts"; +export * from "./run.ts"; diff --git a/src/fw/service/options.ts b/src/fw/service/options.ts new file mode 100644 index 00000000..6208b166 --- /dev/null +++ b/src/fw/service/options.ts @@ -0,0 +1,23 @@ +import { log } from "./deps.ts"; +import { type ServiceOptions } from "./types.ts"; +import * as options from "../../lib/options/mod.ts"; + +// public functions +const createOptionsBuilder = async () => { + const builder = await options.createBuilder(); + + builder.load((env, opts) => { + opts.port = env.readInt("PORT", 8080); + opts.logs = env.readEnum("LOGS", [ + "DEBUG", + "INFO", + "WARNING", + "ERROR", + "CRITICAL", + ], "INFO"); + }); + + return builder; +}; + +export { createOptionsBuilder }; diff --git a/src/fw/service/run.ts b/src/fw/service/run.ts new file mode 100644 index 00000000..5ab8fceb --- /dev/null +++ b/src/fw/service/run.ts @@ -0,0 +1,167 @@ +import { log, oak } from "./deps.ts"; +import { + type Context, + type HttpMethods, + type Middleware, + type RouteParams, + type RouterContext, + type RouterMiddleware, + type Service, + type ServiceOptions, + type State, +} from "./types.ts"; +import * as options from "../../lib/options/mod.ts"; +import * as di from "../../lib/di/mod.ts"; +import { createOptionsBuilder } from "./options.ts"; +import { errorHandlerMiddleware } from "./middlewares/error-handler.ts"; + +// public functions +const start = async ( + service: Service, +): Promise => { + // boot application server + await service.internalApp.listen({ port: service.options.port }); +}; + +const init = async (): Promise< + Service +> => { + // service object reference + // deno-lint-ignore prefer-const + let serviceObject: Service; + + // determine options + const optionsBuilder = await createOptionsBuilder(); + const partialOptions = optionsBuilder.build(); + + // define routes + const router = new oak.Router(); + + const appState = { + router: router, + registry: di.registry, + options: partialOptions, + }; + + // initialize oak application + const app = new oak.Application({ state: appState }); + + app.addEventListener( + "listen", + (e) => { + const protocol = (e.secure) ? "https://" : "http://"; + const hostname = (e.hostname === "0.0.0.0") ? "localhost" : e.hostname; + const uri = `${protocol}${hostname}:${e.port}/`; + + log.info(`Application is starting on ${uri}`); + log.debug(JSON.stringify(serviceObject.options, null, 2)); + }, + ); + + // init logger + await log.setup({ + handlers: { + console: new log.handlers.ConsoleHandler(partialOptions.logs ?? "INFO"), + }, + loggers: { + default: { + level: "DEBUG", + handlers: ["console"], + }, + }, + }); + + // construct service object + serviceObject = { + internalApp: app, + ...appState, + + addMiddleware: (middleware: Middleware): void => { + app.use(middleware); + }, + + addHealthCheck: (path: string): void => { + router.get(path, (ctx) => { + ctx.response.body = ""; + }); + }, + + addRoute: < + R extends string, + P extends RouteParams = RouteParams, + // deno-lint-ignore no-explicit-any + S extends State = Record, + >( + method: HttpMethods, + path: R, + ...middlewares: [ + ...RouterMiddleware[], + (ctx: RouterContext | Context) => unknown, + ] | [ + // FIXME sorry, it's mandatory hack for typescript + (ctx: Context) => unknown, + ] + ): void => { + const fn = middlewares.slice(-1)[0] as + | ((ctx: RouterContext) => unknown) + | undefined; + + const middlewares_ = middlewares.slice(0, -1) as RouterMiddleware< + R, + P, + S + >[]; + middlewares_.push(async (ctx: RouterContext) => { + const result = await fn?.(ctx); + + if (result === undefined || result === null) { + ctx.response.body = ""; + } else { + ctx.response.body = JSON.stringify(result); + } + }); + + // @ts-ignore you know nothing typescript + router[method](path, ...middlewares_); + }, + + configureOptions: async ( + configureOptionsFn: options.ConfigureOptionsFn, + ): Promise => { + await optionsBuilder.load(configureOptionsFn); + serviceObject.options = optionsBuilder.build(); + }, + + configureDI: async ( + configureDIFn: (registry: di.Registry) => Promise | void, + ) => { + await configureDIFn(di.registry); + }, + + start: () => start(serviceObject), + }; + + return serviceObject; +}; + +const run = async ( + initializer: (s: Service) => void | Promise, +) => { + try { + const service = await init(); + + service.internalApp.use(errorHandlerMiddleware(service)); + + await initializer(service); + + // insert these as last 2 middlewares + service.internalApp.use(service.router.routes()); + service.internalApp.use(service.router.allowedMethods()); + + await service.start(); + } catch (error) { + log.error(error); + } +}; + +export { run, run as default }; diff --git a/src/fw/service/types.ts b/src/fw/service/types.ts new file mode 100644 index 00000000..83cf7a08 --- /dev/null +++ b/src/fw/service/types.ts @@ -0,0 +1,101 @@ +import * as di from "../../lib/di/mod.ts"; +import * as options from "../../lib/options/mod.ts"; +import { log, oak } from "./deps.ts"; + +type State = oak.State; +// deno-lint-ignore no-explicit-any +type Application> = oak.Application; +type Middleware = oak.Middleware; +type Router = oak.Router; +type Context = oak.Context & { + params: Record; +}; +type RouteParams = oak.RouteParams; +type Route< + R extends string, + P extends RouteParams = RouteParams, + // deno-lint-ignore no-explicit-any + S extends State = Record, +> = oak.Route; +type RouterMiddleware< + R extends string, + P extends RouteParams = RouteParams, + // deno-lint-ignore no-explicit-any + S extends State = Record, +> = oak.RouterMiddleware; +type RouterContext< + R extends string, + P extends RouteParams = RouteParams, + // deno-lint-ignore no-explicit-any + S extends State = Record, +> = oak.RouterContext; + +type HttpMethods = + | "all" + | "get" + | "post" + | "patch" + | "put" + | "delete" + | "head" + | "options"; + +interface ServiceOptions { + port: number; + logs: log.LevelName; +} + +interface ServiceState { + router: Router; + registry: di.Registry; + options: options.Options; +} + +interface Service + extends ServiceState { + internalApp: Application>; + + addMiddleware: (middleware: Middleware) => void; + addHealthCheck: (path: string) => void; + addRoute: < + R extends string, + P extends RouteParams = RouteParams, + // deno-lint-ignore no-explicit-any + S extends State = Record, + >( + method: HttpMethods, + path: R, + ...middlewares: [ + ...RouterMiddleware[], + (ctx: RouterContext | Context) => unknown, + ] | [ + // FIXME sorry, it's mandatory hack for typescript + (ctx: Context) => unknown, + ] + ) => void; + + configureOptions: ( + configureOptionsFn: options.ConfigureOptionsFn, + ) => Promise; + + configureDI: ( + configureDIFn: (registry: di.Registry) => Promise | void, + ) => Promise; + + start: () => Promise; +} + +export { + type Application, + type Context, + type HttpMethods, + type Middleware, + type Route, + type RouteParams, + type Router, + type RouterContext, + type RouterMiddleware, + type Service, + type ServiceOptions, + type State, +}; diff --git a/src/fw/web/bundler.ts b/src/fw/web/bundler.ts new file mode 100644 index 00000000..bce0071e --- /dev/null +++ b/src/fw/web/bundler.ts @@ -0,0 +1,109 @@ +import { rollup } from "npm:rollup"; +// deno-lint-ignore no-unused-vars +import postcss from "npm:postcss"; +import rollupPostcss from "npm:rollup-plugin-postcss"; + +const inputOptions = { + input: { + entry: "./src/app/global.css", + }, + plugins: [ + rollupPostcss({ + plugins: [], + inject: false, + extract: true, + sourceMap: true, + }), + ], +}; + +const outputOptionsList = [ + { + dir: "build", + format: "es", + chunkFileNames: "[name]-[hash].js", + entryFileNames: "[name]-[hash].js", + compact: true, + generatedCode: "es2015", + // preserveModules: true, + sourcemap: true, + }, +]; + +// deno-lint-ignore no-explicit-any +async function generateOutputs(bundle: any) { + for (const outputOptions of outputOptionsList) { + // generate output specific code in-memory + // you can call this function multiple times on the same bundle object + // replace bundle.generate with bundle.write to directly write to disk + const { output } = await bundle.generate(outputOptions); + + for (const chunkOrAsset of output) { + if (chunkOrAsset.type === "asset") { + // For assets, this contains + // { + // fileName: string, // the asset file name + // source: string | Uint8Array // the asset source + // type: 'asset' // signifies that this is an asset + // } + console.log("Asset", chunkOrAsset); + } else { + // For chunks, this contains + // { + // code: string, // the generated JS code + // dynamicImports: string[], // external modules imported dynamically by the chunk + // exports: string[], // exported variable names + // facadeModuleId: string | null, // the id of a module that this chunk corresponds to + // fileName: string, // the chunk file name + // implicitlyLoadedBefore: string[]; // entries that should only be loaded after this chunk + // imports: string[], // external modules imported statically by the chunk + // importedBindings: {[imported: string]: string[]} // imported bindings per dependency + // isDynamicEntry: boolean, // is this chunk a dynamic entry point + // isEntry: boolean, // is this chunk a static entry point + // isImplicitEntry: boolean, // should this chunk only be loaded after other chunks + // map: string | null, // sourcemaps if present + // modules: { // information about the modules in this chunk + // [id: string]: { + // renderedExports: string[]; // exported variable names that were included + // removedExports: string[]; // exported variable names that were removed + // renderedLength: number; // the length of the remaining code in this module + // originalLength: number; // the original length of the code in this module + // code: string | null; // remaining code in this module + // }; + // }, + // name: string // the name of this chunk as used in naming patterns + // referencedFiles: string[] // files referenced via import.meta.ROLLUP_FILE_URL_ + // type: 'chunk', // signifies that this is a chunk + // } + console.log("Chunk", chunkOrAsset.modules); + console.log(chunkOrAsset.code); + } + } + } +} + +async function build() { + let bundle; + // let buildFailed = false; + + try { + // create a bundle + bundle = await rollup(inputOptions); + + // an array of file names this bundle depends on + console.log(bundle.watchFiles); + + await generateOutputs(bundle); + } catch (error) { + // buildFailed = true; + // do some error reporting + console.error(error); + } + + if (bundle) { + // closes the bundle + await bundle.close(); + } +} + +build(); diff --git a/src/fw/web/codebase/mapper.ts b/src/fw/web/codebase/mapper.ts new file mode 100644 index 00000000..5be12db0 --- /dev/null +++ b/src/fw/web/codebase/mapper.ts @@ -0,0 +1,186 @@ +import { fs } from "../deps.ts"; + +const checkFileNaming = ( + filename: string, + checkEndsWith: boolean, + prefix: string, + extensions: string[], +) => { + for (const extension of extensions) { + if (checkEndsWith) { + if (filename.endsWith(`${prefix}${extension}`)) { + return true; + } + } else if (filename === `${prefix}${extension}`) { + return true; + } + } + + return false; +}; + +interface CodebaseItem { + isDynamicRoute: boolean; + isCatchAllRoute: boolean; + + subpaths: CodebaseSubpath[]; + handlers: { name: string }[]; + layouts: { name: string }[]; + translations: { name: string }[]; + types: { name: string }[]; + assets: { name: string }[]; + others: { name: string }[]; +} + +interface CodebaseSubpath { + name: string; + items: CodebaseItem; +} + +const comparer = (a: boolean, b: boolean) => { + if (a === b) { + return 0; + } + + return a ? 1 : -1; +}; + +const codebaseSubpathSorter = ( + a: CodebaseSubpath, + b: CodebaseSubpath, +) => { + const catchAllRouteComparision = comparer( + a.items.isCatchAllRoute, + b.items.isCatchAllRoute, + ); + + if (catchAllRouteComparision !== 0) { + return catchAllRouteComparision; + } + + const dynamicRouteComparision = comparer( + a.items.isDynamicRoute, + b.items.isDynamicRoute, + ); + + if (dynamicRouteComparision !== 0) { + return dynamicRouteComparision; + } + + return a.name.localeCompare(b.name); +}; + +const codebaseMapper = async ( + dir: string, + extensions: string[], +) => { + const result: CodebaseItem = { + isDynamicRoute: false, + isCatchAllRoute: false, + + subpaths: [], + handlers: [], // /index.ts + layouts: [], // layout.ts + translations: [], // translation.en.ts + types: [], // types.ts + assets: [], // css, js, svgs, images, fonts, ... + others: [], // other files (components etc.) + }; + + const sanitizedDir = dir.endsWith("/") ? dir : `${dir}/`; + + for await (const entry of fs.walk(sanitizedDir, { maxDepth: 1 })) { + if (entry.path === sanitizedDir) { + if ( + entry.isDirectory && entry.name.startsWith("[") && + entry.name.endsWith("]") + ) { + result.isDynamicRoute = true; + + if (entry.name.startsWith("[...")) { + result.isCatchAllRoute = true; + } + } + + continue; + } + + if (entry.isDirectory) { + result.subpaths.push({ + name: entry.name, + items: await codebaseMapper(`${sanitizedDir}${entry.name}`, extensions), + }); + + continue; + } + + // handlers + if ( + checkFileNaming(entry.name, false, "index", extensions) + ) { + result.handlers.push({ name: entry.name }); + + continue; + } + + // layouts + if ( + checkFileNaming(entry.name, false, "layout", extensions) + ) { + result.layouts.push({ name: entry.name }); + + continue; + } + + // translations + if ( + checkFileNaming( + entry.name, + false, + "translations", + extensions, + ) + ) { + result.translations.push({ name: entry.name }); + + continue; + } + + if ( + checkFileNaming( + entry.name, + true, + ".translations", + extensions, + ) + ) { + result.translations.push({ name: entry.name }); + + continue; + } + + // types + if ( + checkFileNaming(entry.name, false, "types", extensions) + ) { + result.types.push({ name: entry.name }); + + continue; + } + + // assets + if (!checkFileNaming(entry.name, false, "", extensions)) { + result.assets.push({ name: entry.name }); + + continue; + } + + result.others.push({ name: entry.name }); + } + + result.subpaths = result.subpaths.sort(codebaseSubpathSorter); + + return result; +}; + +export { type CodebaseItem, codebaseMapper, codebaseMapper as default }; diff --git a/src/fw/web/config.ts b/src/fw/web/config.ts new file mode 100644 index 00000000..968c6ab3 --- /dev/null +++ b/src/fw/web/config.ts @@ -0,0 +1,108 @@ +import { deepMerge } from "../../lib/fp/deep-merge.ts"; + +interface Config { + react?: { + strictMode?: boolean; + }; + + compilation?: { + minify?: boolean; + sourceMaps?: boolean; + }; + + constants?: Record; + + app?: { + baseDir?: string; + startRoute?: string; + extensions?: string[]; + }; + + urls?: { + structure?: string; + rewrites?: { + source: string; + destination: string; + }[]; + }; + + i18n?: { + mode?: string; + languages?: string[]; + }; +} + +const defaultConfig: Config = { + react: { + strictMode: false, + }, + + compilation: { + minify: false, + sourceMaps: false, + }, + + constants: { + "site-name": "hex", + "site-description": + "hex is a free and open source project that helps you build your next web application.", + "site-url": "https://deno.land/x/hex", + "twitter-handle": "@denohex", + }, + + app: { + baseDir: "./src/app/", + // startRoute: "/en/home", + startRoute: "/home", + extensions: [".tsx", ".ts", ".jsx", ".js", ".mdx", ".md"], + }, + + urls: { + // structure: "/[lang]/[...path]", + structure: "/[...path]", + rewrites: [], + }, + + i18n: { + mode: "url", + languages: [ + "en", + ], + }, +}; + +const makeConfig = (config: Config) => { + const newConfig = deepMerge(defaultConfig, config); + + return newConfig; +}; + +const readConfig = async function readConfig(baseDir: string) { + const variations = [ + `${baseDir}/hex.config.ts`, + `${baseDir}/hex.config.js`, + ]; + + let config; + for (const variation of variations) { + try { + config = (await import(variation))?.default; + + break; + } catch (err) { + if (!(err instanceof Deno.errors.NotFound)) { + throw err; + } + + // otherwise, do nothing + } + } + + if (config === undefined) { + return defaultConfig; + } + + return makeConfig(config); +}; + +export { type Config, defaultConfig, makeConfig, readConfig }; diff --git a/src/fw/web/deps.ts b/src/fw/web/deps.ts new file mode 100644 index 00000000..e5458769 --- /dev/null +++ b/src/fw/web/deps.ts @@ -0,0 +1,3 @@ +export * as asserts from "../../lib/stdx/testing/asserts.ts"; +export * as fs from "../../lib/stdx/fs.ts"; +export * as path from "../../lib/stdx/path.ts"; diff --git a/src/fw/web/generator.ts b/src/fw/web/generator.ts new file mode 100644 index 00000000..082a9fdb --- /dev/null +++ b/src/fw/web/generator.ts @@ -0,0 +1,16 @@ +import { codebaseMapper } from "./codebase/mapper.ts"; +import { transformCodebaseMapToRoutes } from "./routing/transformers.ts"; +import { type Config } from "./config.ts"; +import { path } from "./deps.ts"; + +const generator = async function generator(baseDir: string, config: Config) { + const rootDir = path.posix.join(baseDir, config.app!.baseDir!); + + const codebaseMap = await codebaseMapper(rootDir, config.app!.extensions!); + + const routes = transformCodebaseMapToRoutes([], codebaseMap); + + return routes; +}; + +export { generator, generator as default }; diff --git a/src/fw/web/mod.ts b/src/fw/web/mod.ts new file mode 100644 index 00000000..5abb4b47 --- /dev/null +++ b/src/fw/web/mod.ts @@ -0,0 +1,2 @@ +export * as page from "./page.ts"; +export * from "./run.ts"; diff --git a/src/fw/web/page.ts b/src/fw/web/page.ts new file mode 100644 index 00000000..d1fbbf6c --- /dev/null +++ b/src/fw/web/page.ts @@ -0,0 +1,9 @@ +const HeadContents = () => { + throw new Error("not implemented yet."); +}; + +const BodyContents = () => { + throw new Error("not implemented yet."); +}; + +export { BodyContents, HeadContents }; diff --git a/src/fw/web/routing/transformers.ts b/src/fw/web/routing/transformers.ts new file mode 100644 index 00000000..b56a36d0 --- /dev/null +++ b/src/fw/web/routing/transformers.ts @@ -0,0 +1,30 @@ +import { type CodebaseItem } from "../codebase/mapper.ts"; + +const transformCodebaseMapToRoutes = ( + pathElements: string[], + codebaseMapNode: CodebaseItem, +): string[] => { + let paths: string[] = []; + + if (!codebaseMapNode.isCatchAllRoute) { + for (const subnode of codebaseMapNode.subpaths) { + const subpaths = transformCodebaseMapToRoutes( + [...pathElements, subnode.name], + subnode.items, + ); + + paths = [...paths, ...subpaths]; + } + } + + if (codebaseMapNode.handlers.length > 0) { + paths = [...paths, `/${pathElements.join("/")}`]; + } + + return paths; +}; + +export { + transformCodebaseMapToRoutes, + transformCodebaseMapToRoutes as default, +}; diff --git a/src/fw/web/run.ts b/src/fw/web/run.ts new file mode 100644 index 00000000..a2ef7ce0 --- /dev/null +++ b/src/fw/web/run.ts @@ -0,0 +1,17 @@ +import { type Config, makeConfig } from "./config.ts"; +import { generator } from "./generator.ts"; +import { urlResolver } from "./url-resolver.ts"; + +const run = async (config: Config) => { + const baseDir = Deno.cwd(); + + const config_ = makeConfig(config); + const routes = await generator(baseDir, config_); + + const resolution = urlResolver("/en/home", routes, config_); + + console.log(routes); + console.log(resolution); +}; + +export { run, run as default }; diff --git a/src/fw/web/url-resolver.ts b/src/fw/web/url-resolver.ts new file mode 100644 index 00000000..f53544a5 --- /dev/null +++ b/src/fw/web/url-resolver.ts @@ -0,0 +1,147 @@ +import { asserts } from "./deps.ts"; +import { type Config } from "./config.ts"; + +const applyPattern = ( + url: string, + variables: Record, +): string => { + return url.replaceAll(/\[([^\]]+)\]/g, (match: string, variable) => { + if (variables[variable]) { + return applyPattern(variables[variable], variables); + } + + return match; + }); +}; + +const applyRewrites = ( + url: string, + _rewrites: { source: string; destination: string }[], +): string => { + // TODO + return url; +}; + +const applyAll = ( + url: string, + variables: Record, + rewrites: { source: string; destination: string }[], +): string => { + return applyRewrites( + applyPattern(url, variables), + rewrites, + ); +}; + +const leadingSlashAndSpaceTrimmer = ( + urlPart: string, +): string => { + return urlPart.replace(/^[\s\/]+/, ""); +}; + +interface UrlResolution { + url: string; + route: string; + parameters: Record; +} + +const escapeRegExp = (input: string) => { + // $& means the whole matched string + return input.replace(/[.*+?^${}()|[\]\\\/]/g, "\\$&"); +}; + +const routesToRegExp = (route: string) => { + const splitterRegExp = /\[[^\]]+\]|[^\s|\[]+/g; + + const routeParts = route.match(splitterRegExp); + + asserts.assert(routeParts !== null, `unable to parse route: ${route}`); + + const splittedRegExp = routeParts.map( + (routePart) => { + // it's a [variable] or [...variable] + if (routePart.startsWith("[") && routePart.endsWith("]")) { + const variable = routePart.slice(1, -1); + + if (variable.startsWith("...")) { + return `(?<${variable.substring(3)}>.*)`; + } + + return `(?<${variable}>[^\\/]+)`; + } + + return escapeRegExp(routePart); + }, + ); + + const routeRegExp = new RegExp(splittedRegExp.join("")); + + return routeRegExp; +}; + +// TODO not yet +const _compileRoutes = ( + routes: string[], +): Record => { + return routes.reduce( + (acc, curr) => ({ ...acc, [curr]: routesToRegExp(curr) }), + {}, + ); +}; + +const routeMatcher = ( + route: string, + url: string, +): UrlResolution | undefined => { + const routeRegExp = routesToRegExp(route); + + const matches = routeRegExp.exec(url); + + if (matches === null) { + return undefined; + } + + return { + url, + route, + parameters: { ...matches.groups }, + }; +}; + +const urlResolver = ( + url: string, + routes: string[], + config: Config, +) => { + const urlStructure = config.urls?.structure!; + + asserts.assert( + urlStructure.startsWith("/"), + `config.urls.structure value must start with /. +example: /[lang]/[...path] +current: ${urlStructure}`, + ); + + const variables = {}; + + for (const route of routes) { + const route_ = applyAll( + urlStructure, + { + ...variables, + "...path": leadingSlashAndSpaceTrimmer(route), + }, + config.urls?.rewrites!, + ); + + const matchResult = routeMatcher(route_, url); + + if (matchResult !== undefined) { + return matchResult; + } + } + + return undefined; +}; + +export { urlResolver, urlResolver as default }; diff --git a/src/cli/deps.ts b/src/lib/cli/deps.ts similarity index 100% rename from src/cli/deps.ts rename to src/lib/cli/deps.ts diff --git a/src/cli/execute.ts b/src/lib/cli/execute.ts similarity index 100% rename from src/cli/execute.ts rename to src/lib/cli/execute.ts diff --git a/src/cli/help.ts b/src/lib/cli/help.ts similarity index 100% rename from src/cli/help.ts rename to src/lib/cli/help.ts diff --git a/src/cli/mod.ts b/src/lib/cli/mod.ts similarity index 100% rename from src/cli/mod.ts rename to src/lib/cli/mod.ts diff --git a/src/cli/types.ts b/src/lib/cli/types.ts similarity index 100% rename from src/cli/types.ts rename to src/lib/cli/types.ts diff --git a/src/data/adapters/mongodb.ts b/src/lib/data/adapters/mongodb.ts similarity index 100% rename from src/data/adapters/mongodb.ts rename to src/lib/data/adapters/mongodb.ts diff --git a/src/data/connection.ts b/src/lib/data/connection.ts similarity index 100% rename from src/data/connection.ts rename to src/lib/data/connection.ts diff --git a/src/data/deps.ts b/src/lib/data/deps.ts similarity index 100% rename from src/data/deps.ts rename to src/lib/data/deps.ts diff --git a/src/data/mod.ts b/src/lib/data/mod.ts similarity index 100% rename from src/data/mod.ts rename to src/lib/data/mod.ts diff --git a/src/data/repository.ts b/src/lib/data/repository.ts similarity index 100% rename from src/data/repository.ts rename to src/lib/data/repository.ts diff --git a/src/di/README.md b/src/lib/di/README.md similarity index 84% rename from src/di/README.md rename to src/lib/di/README.md index 2f1b1790..bebff257 100644 --- a/src/di/README.md +++ b/src/lib/di/README.md @@ -1,4 +1,4 @@ -# 🧱 [hex/di](https://github.com/eserozvataf/hex/tree/development/src/di) +# 🧱 [hex/lib/di](https://github.com/eserozvataf/hex/tree/development/src/lib/di) ## Package Information diff --git a/src/di/containers.ts b/src/lib/di/containers.ts similarity index 100% rename from src/di/containers.ts rename to src/lib/di/containers.ts diff --git a/src/di/decorators.ts b/src/lib/di/decorators.ts similarity index 100% rename from src/di/decorators.ts rename to src/lib/di/decorators.ts diff --git a/src/di/mod.ts b/src/lib/di/mod.ts similarity index 100% rename from src/di/mod.ts rename to src/lib/di/mod.ts diff --git a/src/di/registry.ts b/src/lib/di/registry.ts similarity index 100% rename from src/di/registry.ts rename to src/lib/di/registry.ts diff --git a/src/di/tests/containers.test.ts b/src/lib/di/tests/containers.test.ts similarity index 100% rename from src/di/tests/containers.test.ts rename to src/lib/di/tests/containers.test.ts diff --git a/src/di/tests/deps.ts b/src/lib/di/tests/deps.ts similarity index 100% rename from src/di/tests/deps.ts rename to src/lib/di/tests/deps.ts diff --git a/src/di/tests/registry.test.ts b/src/lib/di/tests/registry.test.ts similarity index 100% rename from src/di/tests/registry.test.ts rename to src/lib/di/tests/registry.test.ts diff --git a/src/di/use-container-builder.ts b/src/lib/di/use-container-builder.ts similarity index 100% rename from src/di/use-container-builder.ts rename to src/lib/di/use-container-builder.ts diff --git a/src/directives/01-social.md b/src/lib/directives/01-social.md similarity index 97% rename from src/directives/01-social.md rename to src/lib/directives/01-social.md index 019ccd77..dd17bc28 100644 --- a/src/directives/01-social.md +++ b/src/lib/directives/01-social.md @@ -1,4 +1,4 @@ -# 📓 [hex/directives/social](https://github.com/eserozvataf/hex/tree/development/src/directives/social) +# 📓 [hex/lib/directives/social](https://github.com/eserozvataf/hex/tree/development/src/lib/directives/social) ## Our Pledge diff --git a/src/directives/02-technical.md b/src/lib/directives/02-technical.md similarity index 94% rename from src/directives/02-technical.md rename to src/lib/directives/02-technical.md index 2f797c51..c2202c14 100644 --- a/src/directives/02-technical.md +++ b/src/lib/directives/02-technical.md @@ -1,4 +1,4 @@ -# 📓 [hex/directives/technical](https://github.com/eserozvataf/hex/tree/development/src/directives/technical) +# 📓 [hex/lib/directives/technical](https://github.com/eserozvataf/hex/tree/development/src/lib/directives/technical) ## Technical Directives diff --git a/src/directives/README.md b/src/lib/directives/README.md similarity index 84% rename from src/directives/README.md rename to src/lib/directives/README.md index a2229c26..efc734f5 100644 --- a/src/directives/README.md +++ b/src/lib/directives/README.md @@ -1,4 +1,4 @@ -# 📓 [hex/directives](https://github.com/eserozvataf/hex/tree/development/src/directives) +# 📓 [hex/lib/directives](https://github.com/eserozvataf/hex/tree/development/src/lib/directives) ## Package Information diff --git a/src/environment/README.md b/src/lib/environment/README.md similarity index 82% rename from src/environment/README.md rename to src/lib/environment/README.md index 25e4cb42..bf4ec285 100644 --- a/src/environment/README.md +++ b/src/lib/environment/README.md @@ -1,4 +1,4 @@ -# 🧱 [hex/environment](https://github.com/eserozvataf/hex/tree/development/src/environment) +# 🧱 [hex/lib/environment](https://github.com/eserozvataf/hex/tree/development/src/lib/environment) ## Package Information diff --git a/src/environment/channel.ts b/src/lib/environment/channel.ts similarity index 100% rename from src/environment/channel.ts rename to src/lib/environment/channel.ts diff --git a/src/environment/cli/cli.ts b/src/lib/environment/cli/cli.ts similarity index 100% rename from src/environment/cli/cli.ts rename to src/lib/environment/cli/cli.ts diff --git a/src/environment/cli/mod.ts b/src/lib/environment/cli/mod.ts similarity index 100% rename from src/environment/cli/mod.ts rename to src/lib/environment/cli/mod.ts diff --git a/src/environment/environment.ts b/src/lib/environment/environment.ts similarity index 100% rename from src/environment/environment.ts rename to src/lib/environment/environment.ts diff --git a/src/environment/mod.ts b/src/lib/environment/mod.ts similarity index 100% rename from src/environment/mod.ts rename to src/lib/environment/mod.ts diff --git a/src/environment/samples/basic.js b/src/lib/environment/samples/basic.js similarity index 100% rename from src/environment/samples/basic.js rename to src/lib/environment/samples/basic.js diff --git a/src/environment/webapi/mod.ts b/src/lib/environment/webapi/mod.ts similarity index 100% rename from src/environment/webapi/mod.ts rename to src/lib/environment/webapi/mod.ts diff --git a/src/environment/webapi/webapi.ts b/src/lib/environment/webapi/webapi.ts similarity index 100% rename from src/environment/webapi/webapi.ts rename to src/lib/environment/webapi/webapi.ts diff --git a/src/formatters/README.md b/src/lib/formatters/README.md similarity index 84% rename from src/formatters/README.md rename to src/lib/formatters/README.md index a35b26e2..ade39710 100644 --- a/src/formatters/README.md +++ b/src/lib/formatters/README.md @@ -1,4 +1,4 @@ -# 🧱 [hex/formatters](https://github.com/eserozvataf/hex/tree/development/src/formatters) +# 🧱 [hex/lib/formatters](https://github.com/eserozvataf/hex/tree/development/src/lib/formatters) ## Package Information diff --git a/src/formatters/application-json.ts b/src/lib/formatters/application-json.ts similarity index 100% rename from src/formatters/application-json.ts rename to src/lib/formatters/application-json.ts diff --git a/src/formatters/formatter.ts b/src/lib/formatters/formatter.ts similarity index 100% rename from src/formatters/formatter.ts rename to src/lib/formatters/formatter.ts diff --git a/src/formatters/mod.ts b/src/lib/formatters/mod.ts similarity index 100% rename from src/formatters/mod.ts rename to src/lib/formatters/mod.ts diff --git a/src/formatters/registry.ts b/src/lib/formatters/registry.ts similarity index 100% rename from src/formatters/registry.ts rename to src/lib/formatters/registry.ts diff --git a/src/formatters/tests/application-json.test.ts b/src/lib/formatters/tests/application-json.test.ts similarity index 100% rename from src/formatters/tests/application-json.test.ts rename to src/lib/formatters/tests/application-json.test.ts diff --git a/src/formatters/tests/deps.ts b/src/lib/formatters/tests/deps.ts similarity index 100% rename from src/formatters/tests/deps.ts rename to src/lib/formatters/tests/deps.ts diff --git a/src/formatters/tests/registry.test.ts b/src/lib/formatters/tests/registry.test.ts similarity index 100% rename from src/formatters/tests/registry.test.ts rename to src/lib/formatters/tests/registry.test.ts diff --git a/src/formatters/text-plain.ts b/src/lib/formatters/text-plain.ts similarity index 100% rename from src/formatters/text-plain.ts rename to src/lib/formatters/text-plain.ts diff --git a/src/fp/README.md b/src/lib/fp/README.md similarity index 99% rename from src/fp/README.md rename to src/lib/fp/README.md index 8d2d6bf6..bb5e099b 100644 --- a/src/fp/README.md +++ b/src/lib/fp/README.md @@ -1,4 +1,4 @@ -# 🧱 [hex/fp](https://github.com/eserozvataf/hex/tree/development/src/fp) +# 🧱 [hex/lib/fp](https://github.com/eserozvataf/hex/tree/development/src/lib/fp) ## Package Information diff --git a/src/fp/append-to-array.ts b/src/lib/fp/append-to-array.ts similarity index 100% rename from src/fp/append-to-array.ts rename to src/lib/fp/append-to-array.ts diff --git a/src/fp/append-to-object.ts b/src/lib/fp/append-to-object.ts similarity index 100% rename from src/fp/append-to-object.ts rename to src/lib/fp/append-to-object.ts diff --git a/src/fp/associate-array.ts b/src/lib/fp/associate-array.ts similarity index 100% rename from src/fp/associate-array.ts rename to src/lib/fp/associate-array.ts diff --git a/src/fp/associate-object.ts b/src/lib/fp/associate-object.ts similarity index 100% rename from src/fp/associate-object.ts rename to src/lib/fp/associate-object.ts diff --git a/src/fp/benchmarks/append-to-array.bench.ts b/src/lib/fp/benchmarks/append-to-array.bench.ts similarity index 100% rename from src/fp/benchmarks/append-to-array.bench.ts rename to src/lib/fp/benchmarks/append-to-array.bench.ts diff --git a/src/fp/benchmarks/append-to-object.bench.ts b/src/lib/fp/benchmarks/append-to-object.bench.ts similarity index 100% rename from src/fp/benchmarks/append-to-object.bench.ts rename to src/lib/fp/benchmarks/append-to-object.bench.ts diff --git a/src/fp/benchmarks/deep-copy.bench.ts b/src/lib/fp/benchmarks/deep-copy.bench.ts similarity index 100% rename from src/fp/benchmarks/deep-copy.bench.ts rename to src/lib/fp/benchmarks/deep-copy.bench.ts diff --git a/src/fp/benchmarks/mutate.bench.ts b/src/lib/fp/benchmarks/mutate.bench.ts similarity index 100% rename from src/fp/benchmarks/mutate.bench.ts rename to src/lib/fp/benchmarks/mutate.bench.ts diff --git a/src/fp/compose.ts b/src/lib/fp/compose.ts similarity index 100% rename from src/fp/compose.ts rename to src/lib/fp/compose.ts diff --git a/src/fp/curry-functions.ts b/src/lib/fp/curry-functions.ts similarity index 100% rename from src/fp/curry-functions.ts rename to src/lib/fp/curry-functions.ts diff --git a/src/fp/curry-right.ts b/src/lib/fp/curry-right.ts similarity index 100% rename from src/fp/curry-right.ts rename to src/lib/fp/curry-right.ts diff --git a/src/fp/curry.ts b/src/lib/fp/curry.ts similarity index 100% rename from src/fp/curry.ts rename to src/lib/fp/curry.ts diff --git a/src/fp/decorate.ts b/src/lib/fp/decorate.ts similarity index 100% rename from src/fp/decorate.ts rename to src/lib/fp/decorate.ts diff --git a/src/fp/deep-copy.ts b/src/lib/fp/deep-copy.ts similarity index 100% rename from src/fp/deep-copy.ts rename to src/lib/fp/deep-copy.ts diff --git a/src/fp/deep-merge.ts b/src/lib/fp/deep-merge.ts similarity index 100% rename from src/fp/deep-merge.ts rename to src/lib/fp/deep-merge.ts diff --git a/src/fp/dispatcher.ts b/src/lib/fp/dispatcher.ts similarity index 100% rename from src/fp/dispatcher.ts rename to src/lib/fp/dispatcher.ts diff --git a/src/fp/distinct-array.ts b/src/lib/fp/distinct-array.ts similarity index 100% rename from src/fp/distinct-array.ts rename to src/lib/fp/distinct-array.ts diff --git a/src/fp/distinct-object.ts b/src/lib/fp/distinct-object.ts similarity index 100% rename from src/fp/distinct-object.ts rename to src/lib/fp/distinct-object.ts diff --git a/src/fp/drop-from-array.ts b/src/lib/fp/drop-from-array.ts similarity index 100% rename from src/fp/drop-from-array.ts rename to src/lib/fp/drop-from-array.ts diff --git a/src/fp/drop-from-object.ts b/src/lib/fp/drop-from-object.ts similarity index 100% rename from src/fp/drop-from-object.ts rename to src/lib/fp/drop-from-object.ts diff --git a/src/fp/emitter.ts b/src/lib/fp/emitter.ts similarity index 100% rename from src/fp/emitter.ts rename to src/lib/fp/emitter.ts diff --git a/src/fp/filter-array.ts b/src/lib/fp/filter-array.ts similarity index 100% rename from src/fp/filter-array.ts rename to src/lib/fp/filter-array.ts diff --git a/src/fp/filter-object.ts b/src/lib/fp/filter-object.ts similarity index 100% rename from src/fp/filter-object.ts rename to src/lib/fp/filter-object.ts diff --git a/src/fp/iterate.ts b/src/lib/fp/iterate.ts similarity index 100% rename from src/fp/iterate.ts rename to src/lib/fp/iterate.ts diff --git a/src/fp/map-array.ts b/src/lib/fp/map-array.ts similarity index 100% rename from src/fp/map-array.ts rename to src/lib/fp/map-array.ts diff --git a/src/fp/map-object.ts b/src/lib/fp/map-object.ts similarity index 100% rename from src/fp/map-object.ts rename to src/lib/fp/map-object.ts diff --git a/src/fp/merge-arrays.ts b/src/lib/fp/merge-arrays.ts similarity index 100% rename from src/fp/merge-arrays.ts rename to src/lib/fp/merge-arrays.ts diff --git a/src/fp/merge-objects.ts b/src/lib/fp/merge-objects.ts similarity index 100% rename from src/fp/merge-objects.ts rename to src/lib/fp/merge-objects.ts diff --git a/src/fp/mod.ts b/src/lib/fp/mod.ts similarity index 100% rename from src/fp/mod.ts rename to src/lib/fp/mod.ts diff --git a/src/fp/mutate.ts b/src/lib/fp/mutate.ts similarity index 100% rename from src/fp/mutate.ts rename to src/lib/fp/mutate.ts diff --git a/src/fp/pick-from-array.ts b/src/lib/fp/pick-from-array.ts similarity index 100% rename from src/fp/pick-from-array.ts rename to src/lib/fp/pick-from-array.ts diff --git a/src/fp/pick-from-object.ts b/src/lib/fp/pick-from-object.ts similarity index 100% rename from src/fp/pick-from-object.ts rename to src/lib/fp/pick-from-object.ts diff --git a/src/fp/pipe.ts b/src/lib/fp/pipe.ts similarity index 100% rename from src/fp/pipe.ts rename to src/lib/fp/pipe.ts diff --git a/src/fp/prepend-to-array.ts b/src/lib/fp/prepend-to-array.ts similarity index 100% rename from src/fp/prepend-to-array.ts rename to src/lib/fp/prepend-to-array.ts diff --git a/src/fp/prepend-to-object.ts b/src/lib/fp/prepend-to-object.ts similarity index 100% rename from src/fp/prepend-to-object.ts rename to src/lib/fp/prepend-to-object.ts diff --git a/src/fp/remove-first-match-from-array.ts b/src/lib/fp/remove-first-match-from-array.ts similarity index 100% rename from src/fp/remove-first-match-from-array.ts rename to src/lib/fp/remove-first-match-from-array.ts diff --git a/src/fp/remove-first-match-from-object.ts b/src/lib/fp/remove-first-match-from-object.ts similarity index 100% rename from src/fp/remove-first-match-from-object.ts rename to src/lib/fp/remove-first-match-from-object.ts diff --git a/src/fp/remove-index-from-array.ts b/src/lib/fp/remove-index-from-array.ts similarity index 100% rename from src/fp/remove-index-from-array.ts rename to src/lib/fp/remove-index-from-array.ts diff --git a/src/fp/remove-key-from-object.ts b/src/lib/fp/remove-key-from-object.ts similarity index 100% rename from src/fp/remove-key-from-object.ts rename to src/lib/fp/remove-key-from-object.ts diff --git a/src/fp/remove-value-from-array.ts b/src/lib/fp/remove-value-from-array.ts similarity index 100% rename from src/fp/remove-value-from-array.ts rename to src/lib/fp/remove-value-from-array.ts diff --git a/src/fp/remove-value-from-object.ts b/src/lib/fp/remove-value-from-object.ts similarity index 100% rename from src/fp/remove-value-from-object.ts rename to src/lib/fp/remove-value-from-object.ts diff --git a/src/fp/reverse-array.ts b/src/lib/fp/reverse-array.ts similarity index 100% rename from src/fp/reverse-array.ts rename to src/lib/fp/reverse-array.ts diff --git a/src/fp/reverse-object.ts b/src/lib/fp/reverse-object.ts similarity index 100% rename from src/fp/reverse-object.ts rename to src/lib/fp/reverse-object.ts diff --git a/src/fp/split-array.ts b/src/lib/fp/split-array.ts similarity index 100% rename from src/fp/split-array.ts rename to src/lib/fp/split-array.ts diff --git a/src/fp/split-object.ts b/src/lib/fp/split-object.ts similarity index 100% rename from src/fp/split-object.ts rename to src/lib/fp/split-object.ts diff --git a/src/fp/take-from-array.ts b/src/lib/fp/take-from-array.ts similarity index 100% rename from src/fp/take-from-array.ts rename to src/lib/fp/take-from-array.ts diff --git a/src/fp/take-from-object.ts b/src/lib/fp/take-from-object.ts similarity index 100% rename from src/fp/take-from-object.ts rename to src/lib/fp/take-from-object.ts diff --git a/src/fp/tests/append-to-array.test.ts b/src/lib/fp/tests/append-to-array.test.ts similarity index 100% rename from src/fp/tests/append-to-array.test.ts rename to src/lib/fp/tests/append-to-array.test.ts diff --git a/src/fp/tests/append-to-object.test.ts b/src/lib/fp/tests/append-to-object.test.ts similarity index 100% rename from src/fp/tests/append-to-object.test.ts rename to src/lib/fp/tests/append-to-object.test.ts diff --git a/src/fp/tests/associate-array.test.ts b/src/lib/fp/tests/associate-array.test.ts similarity index 100% rename from src/fp/tests/associate-array.test.ts rename to src/lib/fp/tests/associate-array.test.ts diff --git a/src/fp/tests/associate-object.test.ts b/src/lib/fp/tests/associate-object.test.ts similarity index 100% rename from src/fp/tests/associate-object.test.ts rename to src/lib/fp/tests/associate-object.test.ts diff --git a/src/fp/tests/compose.test.ts b/src/lib/fp/tests/compose.test.ts similarity index 100% rename from src/fp/tests/compose.test.ts rename to src/lib/fp/tests/compose.test.ts diff --git a/src/fp/tests/curry-functions.test.ts b/src/lib/fp/tests/curry-functions.test.ts similarity index 100% rename from src/fp/tests/curry-functions.test.ts rename to src/lib/fp/tests/curry-functions.test.ts diff --git a/src/fp/tests/curry-right.test.ts b/src/lib/fp/tests/curry-right.test.ts similarity index 100% rename from src/fp/tests/curry-right.test.ts rename to src/lib/fp/tests/curry-right.test.ts diff --git a/src/fp/tests/curry.test.ts b/src/lib/fp/tests/curry.test.ts similarity index 100% rename from src/fp/tests/curry.test.ts rename to src/lib/fp/tests/curry.test.ts diff --git a/src/fp/tests/decorate.test.ts b/src/lib/fp/tests/decorate.test.ts similarity index 100% rename from src/fp/tests/decorate.test.ts rename to src/lib/fp/tests/decorate.test.ts diff --git a/src/fp/tests/deep-copy.test.ts b/src/lib/fp/tests/deep-copy.test.ts similarity index 100% rename from src/fp/tests/deep-copy.test.ts rename to src/lib/fp/tests/deep-copy.test.ts diff --git a/src/fp/tests/deep-merge.test.ts b/src/lib/fp/tests/deep-merge.test.ts similarity index 100% rename from src/fp/tests/deep-merge.test.ts rename to src/lib/fp/tests/deep-merge.test.ts diff --git a/src/fp/tests/deps.ts b/src/lib/fp/tests/deps.ts similarity index 100% rename from src/fp/tests/deps.ts rename to src/lib/fp/tests/deps.ts diff --git a/src/fp/tests/dispatcher.test.ts b/src/lib/fp/tests/dispatcher.test.ts similarity index 100% rename from src/fp/tests/dispatcher.test.ts rename to src/lib/fp/tests/dispatcher.test.ts diff --git a/src/fp/tests/distinct-array.test.ts b/src/lib/fp/tests/distinct-array.test.ts similarity index 100% rename from src/fp/tests/distinct-array.test.ts rename to src/lib/fp/tests/distinct-array.test.ts diff --git a/src/fp/tests/distinct-object.test.ts b/src/lib/fp/tests/distinct-object.test.ts similarity index 100% rename from src/fp/tests/distinct-object.test.ts rename to src/lib/fp/tests/distinct-object.test.ts diff --git a/src/fp/tests/drop-from-array.test.ts b/src/lib/fp/tests/drop-from-array.test.ts similarity index 100% rename from src/fp/tests/drop-from-array.test.ts rename to src/lib/fp/tests/drop-from-array.test.ts diff --git a/src/fp/tests/drop-from-object.test.ts b/src/lib/fp/tests/drop-from-object.test.ts similarity index 100% rename from src/fp/tests/drop-from-object.test.ts rename to src/lib/fp/tests/drop-from-object.test.ts diff --git a/src/fp/tests/emitter.test.ts b/src/lib/fp/tests/emitter.test.ts similarity index 100% rename from src/fp/tests/emitter.test.ts rename to src/lib/fp/tests/emitter.test.ts diff --git a/src/fp/tests/filter-array.test.ts b/src/lib/fp/tests/filter-array.test.ts similarity index 100% rename from src/fp/tests/filter-array.test.ts rename to src/lib/fp/tests/filter-array.test.ts diff --git a/src/fp/tests/filter-object.test.ts b/src/lib/fp/tests/filter-object.test.ts similarity index 100% rename from src/fp/tests/filter-object.test.ts rename to src/lib/fp/tests/filter-object.test.ts diff --git a/src/fp/tests/iterate.test.ts b/src/lib/fp/tests/iterate.test.ts similarity index 100% rename from src/fp/tests/iterate.test.ts rename to src/lib/fp/tests/iterate.test.ts diff --git a/src/fp/tests/map-array.test.ts b/src/lib/fp/tests/map-array.test.ts similarity index 100% rename from src/fp/tests/map-array.test.ts rename to src/lib/fp/tests/map-array.test.ts diff --git a/src/fp/tests/map-object.test.ts b/src/lib/fp/tests/map-object.test.ts similarity index 100% rename from src/fp/tests/map-object.test.ts rename to src/lib/fp/tests/map-object.test.ts diff --git a/src/fp/tests/merge-arrays.test.ts b/src/lib/fp/tests/merge-arrays.test.ts similarity index 100% rename from src/fp/tests/merge-arrays.test.ts rename to src/lib/fp/tests/merge-arrays.test.ts diff --git a/src/fp/tests/merge-objects.test.ts b/src/lib/fp/tests/merge-objects.test.ts similarity index 100% rename from src/fp/tests/merge-objects.test.ts rename to src/lib/fp/tests/merge-objects.test.ts diff --git a/src/fp/tests/mutate.test.ts b/src/lib/fp/tests/mutate.test.ts similarity index 100% rename from src/fp/tests/mutate.test.ts rename to src/lib/fp/tests/mutate.test.ts diff --git a/src/fp/tests/pick-from-array.test.ts b/src/lib/fp/tests/pick-from-array.test.ts similarity index 100% rename from src/fp/tests/pick-from-array.test.ts rename to src/lib/fp/tests/pick-from-array.test.ts diff --git a/src/fp/tests/pick-from-object.test.ts b/src/lib/fp/tests/pick-from-object.test.ts similarity index 100% rename from src/fp/tests/pick-from-object.test.ts rename to src/lib/fp/tests/pick-from-object.test.ts diff --git a/src/fp/tests/pipe.test.ts b/src/lib/fp/tests/pipe.test.ts similarity index 100% rename from src/fp/tests/pipe.test.ts rename to src/lib/fp/tests/pipe.test.ts diff --git a/src/fp/tests/prepend-to-array.test.ts b/src/lib/fp/tests/prepend-to-array.test.ts similarity index 100% rename from src/fp/tests/prepend-to-array.test.ts rename to src/lib/fp/tests/prepend-to-array.test.ts diff --git a/src/fp/tests/prepend-to-object.test.ts b/src/lib/fp/tests/prepend-to-object.test.ts similarity index 100% rename from src/fp/tests/prepend-to-object.test.ts rename to src/lib/fp/tests/prepend-to-object.test.ts diff --git a/src/fp/tests/remove-first-match-from-array.test.ts b/src/lib/fp/tests/remove-first-match-from-array.test.ts similarity index 100% rename from src/fp/tests/remove-first-match-from-array.test.ts rename to src/lib/fp/tests/remove-first-match-from-array.test.ts diff --git a/src/fp/tests/remove-first-match-from-object.test.ts b/src/lib/fp/tests/remove-first-match-from-object.test.ts similarity index 100% rename from src/fp/tests/remove-first-match-from-object.test.ts rename to src/lib/fp/tests/remove-first-match-from-object.test.ts diff --git a/src/fp/tests/remove-index-from-array.test.ts b/src/lib/fp/tests/remove-index-from-array.test.ts similarity index 100% rename from src/fp/tests/remove-index-from-array.test.ts rename to src/lib/fp/tests/remove-index-from-array.test.ts diff --git a/src/fp/tests/remove-key-from-object.test.ts b/src/lib/fp/tests/remove-key-from-object.test.ts similarity index 100% rename from src/fp/tests/remove-key-from-object.test.ts rename to src/lib/fp/tests/remove-key-from-object.test.ts diff --git a/src/fp/tests/remove-value-from-array.test.ts b/src/lib/fp/tests/remove-value-from-array.test.ts similarity index 100% rename from src/fp/tests/remove-value-from-array.test.ts rename to src/lib/fp/tests/remove-value-from-array.test.ts diff --git a/src/fp/tests/remove-value-from-object.test.ts b/src/lib/fp/tests/remove-value-from-object.test.ts similarity index 100% rename from src/fp/tests/remove-value-from-object.test.ts rename to src/lib/fp/tests/remove-value-from-object.test.ts diff --git a/src/fp/tests/reverse-array.test.ts b/src/lib/fp/tests/reverse-array.test.ts similarity index 100% rename from src/fp/tests/reverse-array.test.ts rename to src/lib/fp/tests/reverse-array.test.ts diff --git a/src/fp/tests/reverse-object.test.ts b/src/lib/fp/tests/reverse-object.test.ts similarity index 100% rename from src/fp/tests/reverse-object.test.ts rename to src/lib/fp/tests/reverse-object.test.ts diff --git a/src/fp/tests/split-array.test.ts b/src/lib/fp/tests/split-array.test.ts similarity index 100% rename from src/fp/tests/split-array.test.ts rename to src/lib/fp/tests/split-array.test.ts diff --git a/src/fp/tests/split-object.test.ts b/src/lib/fp/tests/split-object.test.ts similarity index 100% rename from src/fp/tests/split-object.test.ts rename to src/lib/fp/tests/split-object.test.ts diff --git a/src/fp/tests/take-from-array.test.ts b/src/lib/fp/tests/take-from-array.test.ts similarity index 100% rename from src/fp/tests/take-from-array.test.ts rename to src/lib/fp/tests/take-from-array.test.ts diff --git a/src/fp/tests/take-from-object.test.ts b/src/lib/fp/tests/take-from-object.test.ts similarity index 100% rename from src/fp/tests/take-from-object.test.ts rename to src/lib/fp/tests/take-from-object.test.ts diff --git a/src/fp/tests/wth.test.ts b/src/lib/fp/tests/wth.test.ts similarity index 100% rename from src/fp/tests/wth.test.ts rename to src/lib/fp/tests/wth.test.ts diff --git a/src/fp/tests/wthout.test.ts b/src/lib/fp/tests/wthout.test.ts similarity index 100% rename from src/fp/tests/wthout.test.ts rename to src/lib/fp/tests/wthout.test.ts diff --git a/src/fp/wth.ts b/src/lib/fp/wth.ts similarity index 100% rename from src/fp/wth.ts rename to src/lib/fp/wth.ts diff --git a/src/fp/wthout.ts b/src/lib/fp/wthout.ts similarity index 100% rename from src/fp/wthout.ts rename to src/lib/fp/wthout.ts diff --git a/src/functions/README.md b/src/lib/functions/README.md similarity index 90% rename from src/functions/README.md rename to src/lib/functions/README.md index a3a3d407..289752eb 100644 --- a/src/functions/README.md +++ b/src/lib/functions/README.md @@ -1,4 +1,4 @@ -# 🧱 [hex/functions](https://github.com/eserozvataf/hex/tree/development/src/functions) +# 🧱 [hex/lib/functions](https://github.com/eserozvataf/hex/tree/development/src/lib/functions) ## Package Information @@ -48,7 +48,7 @@ import { executeFromCli, platforms, results, -} from "https://deno.land/x/hex/functions/mod.ts"; +} from "https://deno.land/x/hex/src/lib/functions/mod.ts"; function main(input) { const to = input.params[0] ?? "world"; @@ -71,7 +71,7 @@ import { executeFromCli, platforms, results, -} from "https://deno.land/x/hex/functions/mod.ts"; +} from "https://deno.land/x/hex/src/lib/functions/mod.ts"; function initMiddleware(input, context, next) { context.vars.number = 1; diff --git a/src/functions/composer.ts b/src/lib/functions/composer.ts similarity index 100% rename from src/functions/composer.ts rename to src/lib/functions/composer.ts diff --git a/src/functions/dumper-react.ts b/src/lib/functions/dumper-react.ts similarity index 100% rename from src/functions/dumper-react.ts rename to src/lib/functions/dumper-react.ts diff --git a/src/functions/dumper.ts b/src/lib/functions/dumper.ts similarity index 100% rename from src/functions/dumper.ts rename to src/lib/functions/dumper.ts diff --git a/src/functions/execute.ts b/src/lib/functions/execute.ts similarity index 100% rename from src/functions/execute.ts rename to src/lib/functions/execute.ts diff --git a/src/functions/function-context.ts b/src/lib/functions/function-context.ts similarity index 100% rename from src/functions/function-context.ts rename to src/lib/functions/function-context.ts diff --git a/src/functions/function-input.ts b/src/lib/functions/function-input.ts similarity index 100% rename from src/functions/function-input.ts rename to src/lib/functions/function-input.ts diff --git a/src/functions/function-next.ts b/src/lib/functions/function-next.ts similarity index 100% rename from src/functions/function-next.ts rename to src/lib/functions/function-next.ts diff --git a/src/functions/function-result.ts b/src/lib/functions/function-result.ts similarity index 100% rename from src/functions/function-result.ts rename to src/lib/functions/function-result.ts diff --git a/src/functions/function.ts b/src/lib/functions/function.ts similarity index 100% rename from src/functions/function.ts rename to src/lib/functions/function.ts diff --git a/src/functions/mod.ts b/src/lib/functions/mod.ts similarity index 100% rename from src/functions/mod.ts rename to src/lib/functions/mod.ts diff --git a/src/functions/results.ts b/src/lib/functions/results.ts similarity index 100% rename from src/functions/results.ts rename to src/lib/functions/results.ts diff --git a/src/functions/router.ts b/src/lib/functions/router.ts similarity index 100% rename from src/functions/router.ts rename to src/lib/functions/router.ts diff --git a/src/functions/samples/basic.js b/src/lib/functions/samples/basic.js similarity index 100% rename from src/functions/samples/basic.js rename to src/lib/functions/samples/basic.js diff --git a/src/functions/samples/basic.ts b/src/lib/functions/samples/basic.ts similarity index 100% rename from src/functions/samples/basic.ts rename to src/lib/functions/samples/basic.ts diff --git a/src/functions/samples/generators.js b/src/lib/functions/samples/generators.js similarity index 100% rename from src/functions/samples/generators.js rename to src/lib/functions/samples/generators.js diff --git a/src/functions/samples/generators.ts b/src/lib/functions/samples/generators.ts similarity index 100% rename from src/functions/samples/generators.ts rename to src/lib/functions/samples/generators.ts diff --git a/src/functions/samples/middlewares.js b/src/lib/functions/samples/middlewares.js similarity index 100% rename from src/functions/samples/middlewares.js rename to src/lib/functions/samples/middlewares.js diff --git a/src/functions/samples/middlewares.ts b/src/lib/functions/samples/middlewares.ts similarity index 100% rename from src/functions/samples/middlewares.ts rename to src/lib/functions/samples/middlewares.ts diff --git a/src/functions/samples/react.jsx b/src/lib/functions/samples/react.jsx similarity index 100% rename from src/functions/samples/react.jsx rename to src/lib/functions/samples/react.jsx diff --git a/src/functions/samples/react.tsx b/src/lib/functions/samples/react.tsx similarity index 100% rename from src/functions/samples/react.tsx rename to src/lib/functions/samples/react.tsx diff --git a/src/functions/tests/deps.ts b/src/lib/functions/tests/deps.ts similarity index 100% rename from src/functions/tests/deps.ts rename to src/lib/functions/tests/deps.ts diff --git a/src/functions/tests/execute.test.ts b/src/lib/functions/tests/execute.test.ts similarity index 100% rename from src/functions/tests/execute.test.ts rename to src/lib/functions/tests/execute.test.ts diff --git a/src/i18n/languages.ts b/src/lib/i18n/languages.ts similarity index 100% rename from src/i18n/languages.ts rename to src/lib/i18n/languages.ts diff --git a/src/i18n/mod.ts b/src/lib/i18n/mod.ts similarity index 100% rename from src/i18n/mod.ts rename to src/lib/i18n/mod.ts diff --git a/src/lib/mod.ts b/src/lib/mod.ts new file mode 100644 index 00000000..661304e2 --- /dev/null +++ b/src/lib/mod.ts @@ -0,0 +1,11 @@ +export * as cli from "./cli/mod.ts"; +export * as data from "./data/mod.ts"; +export * as di from "./di/mod.ts"; +export * as environment from "./environment/mod.ts"; +export * as formatters from "./formatters/mod.ts"; +export * as fp from "./fp/mod.ts"; +export * as functions from "./functions/mod.ts"; +export * as i18n from "./i18n/mod.ts"; +export * as options from "./options/mod.ts"; +export * as standards from "./standards/mod.ts"; +export * as stdx from "./stdx/mod.ts"; diff --git a/src/options/deps.ts b/src/lib/options/deps.ts similarity index 100% rename from src/options/deps.ts rename to src/lib/options/deps.ts diff --git a/src/options/env.ts b/src/lib/options/env.ts similarity index 100% rename from src/options/env.ts rename to src/lib/options/env.ts diff --git a/src/options/mod.ts b/src/lib/options/mod.ts similarity index 100% rename from src/options/mod.ts rename to src/lib/options/mod.ts diff --git a/src/options/options.ts b/src/lib/options/options.ts similarity index 100% rename from src/options/options.ts rename to src/lib/options/options.ts diff --git a/src/shims/error-event/error-event.ts b/src/lib/shims/error-event/error-event.ts similarity index 100% rename from src/shims/error-event/error-event.ts rename to src/lib/shims/error-event/error-event.ts diff --git a/src/shims/error-event/oak-LICENSE b/src/lib/shims/error-event/oak-LICENSE similarity index 100% rename from src/shims/error-event/oak-LICENSE rename to src/lib/shims/error-event/oak-LICENSE diff --git a/src/standards/README.md b/src/lib/standards/README.md similarity index 86% rename from src/standards/README.md rename to src/lib/standards/README.md index f2344984..e10744dd 100644 --- a/src/standards/README.md +++ b/src/lib/standards/README.md @@ -1,4 +1,4 @@ -# 📑 [hex/standards](https://github.com/eserozvataf/hex/tree/development/src/standards) +# 📑 [hex/lib/standards](https://github.com/eserozvataf/hex/tree/development/src/lib/standards) ## Package Information diff --git a/src/standards/logging.ts b/src/lib/standards/logging.ts similarity index 100% rename from src/standards/logging.ts rename to src/lib/standards/logging.ts diff --git a/src/standards/mod.ts b/src/lib/standards/mod.ts similarity index 100% rename from src/standards/mod.ts rename to src/lib/standards/mod.ts diff --git a/src/stdx/datetime.test.ts b/src/lib/stdx/datetime.test.ts similarity index 100% rename from src/stdx/datetime.test.ts rename to src/lib/stdx/datetime.test.ts diff --git a/src/stdx/datetime.ts b/src/lib/stdx/datetime.ts similarity index 100% rename from src/stdx/datetime.ts rename to src/lib/stdx/datetime.ts diff --git a/src/stdx/dotenv.ts b/src/lib/stdx/dotenv.ts similarity index 100% rename from src/stdx/dotenv.ts rename to src/lib/stdx/dotenv.ts diff --git a/src/stdx/flags.ts b/src/lib/stdx/flags.ts similarity index 100% rename from src/stdx/flags.ts rename to src/lib/stdx/flags.ts diff --git a/src/stdx/fs.ts b/src/lib/stdx/fs.ts similarity index 100% rename from src/stdx/fs.ts rename to src/lib/stdx/fs.ts diff --git a/src/stdx/log.ts b/src/lib/stdx/log.ts similarity index 100% rename from src/stdx/log.ts rename to src/lib/stdx/log.ts diff --git a/src/stdx/mod.ts b/src/lib/stdx/mod.ts similarity index 100% rename from src/stdx/mod.ts rename to src/lib/stdx/mod.ts diff --git a/src/stdx/path.ts b/src/lib/stdx/path.ts similarity index 100% rename from src/stdx/path.ts rename to src/lib/stdx/path.ts diff --git a/src/stdx/streams.ts b/src/lib/stdx/streams.ts similarity index 100% rename from src/stdx/streams.ts rename to src/lib/stdx/streams.ts diff --git a/src/stdx/testing.ts b/src/lib/stdx/testing.ts similarity index 100% rename from src/stdx/testing.ts rename to src/lib/stdx/testing.ts diff --git a/src/stdx/testing/asserts.ts b/src/lib/stdx/testing/asserts.ts similarity index 100% rename from src/stdx/testing/asserts.ts rename to src/lib/stdx/testing/asserts.ts diff --git a/src/stdx/testing/bdd.ts b/src/lib/stdx/testing/bdd.ts similarity index 100% rename from src/stdx/testing/bdd.ts rename to src/lib/stdx/testing/bdd.ts diff --git a/src/stdx/testing/mock.ts b/src/lib/stdx/testing/mock.ts similarity index 100% rename from src/stdx/testing/mock.ts rename to src/lib/stdx/testing/mock.ts diff --git a/src/stdx/testing/mod.ts b/src/lib/stdx/testing/mod.ts similarity index 100% rename from src/stdx/testing/mod.ts rename to src/lib/stdx/testing/mod.ts diff --git a/src/stdx/testing/snapshot.ts b/src/lib/stdx/testing/snapshot.ts similarity index 100% rename from src/stdx/testing/snapshot.ts rename to src/lib/stdx/testing/snapshot.ts diff --git a/src/stdx/testing/time.ts b/src/lib/stdx/testing/time.ts similarity index 100% rename from src/stdx/testing/time.ts rename to src/lib/stdx/testing/time.ts diff --git a/src/metadata.json b/src/metadata.json index 54b64242..10a8aa12 100644 --- a/src/metadata.json +++ b/src/metadata.json @@ -1,3 +1,3 @@ { - "version": "0.5.31" + "version": "0.6.0" } diff --git a/src/mod.ts b/src/mod.ts index 30128ffb..e9e2125b 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -1,15 +1,6 @@ import metadata from "./metadata.json" assert { type: "json" }; -export * as cli from "./cli/mod.ts"; -export * as data from "./data/mod.ts"; -export * as di from "./di/mod.ts"; -export * as environment from "./environment/mod.ts"; -export * as formatters from "./formatters/mod.ts"; -export * as fp from "./fp/mod.ts"; -export * as functions from "./functions/mod.ts"; -export * as i18n from "./i18n/mod.ts"; -export * as options from "./options/mod.ts"; -export * as standards from "./standards/mod.ts"; -export * as stdx from "./stdx/mod.ts"; +export * as framework from "./fw/mod.ts"; +export * as library from "./lib/mod.ts"; export { metadata }; diff --git a/version.txt b/version.txt index 674bf1d8..a918a2aa 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.5.31 +0.6.0