diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..4781987 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,2 @@ + +# Changelog \ No newline at end of file diff --git a/deno.json b/deno.json index bfa2a46..981553a 100644 --- a/deno.json +++ b/deno.json @@ -3,13 +3,12 @@ "version": "0.0.1", "exports": "./mod.ts", "license": "MIT", - "scopes": { - }, "publish": { "include": [ "mod.ts", "LICENSE", - "README.md" + "README.md", + "CHANGELOG.md" ] }, "tasks": { @@ -20,4 +19,4 @@ "@std/assert": "jsr:@std/assert@1", "@std/log": "jsr:@std/log@^0.224.9" } -} +} \ No newline at end of file diff --git a/deno.lock b/deno.lock index 701c6f9..ca35657 100644 --- a/deno.lock +++ b/deno.lock @@ -7,9 +7,12 @@ "jsr:@std/internal@^1.0.4": "1.0.4", "jsr:@std/io@0.225": "0.225.0", "jsr:@std/log@~0.224.9": "0.224.9", + "jsr:@std/semver@*": "1.0.3", "npm:@changesets/cli@*": "2.27.8", "npm:@types/node@*": "22.5.4", "npm:conventional-changelog-angular@*": "8.0.0", + "npm:conventional-changelog-cli@*": "5.0.0", + "npm:conventional-changelog@*": "6.0.0", "npm:conventional-recommended-bump@*": "10.0.0_conventional-commits-filter@5.0.0_conventional-commits-parser@6.0.0" }, "jsr": { @@ -38,9 +41,23 @@ "jsr:@std/fs", "jsr:@std/io" ] + }, + "@std/semver@1.0.3": { + "integrity": "7c139c6076a080eeaa4252c78b95ca5302818d7eafab0470d34cafd9930c13c8" } }, "npm": { + "@babel/code-frame@7.26.0": { + "integrity": "sha512-INCKxTtbXtcNbUZ3YXutwMpEleqttcswhAdee7dhuoVrD2cnuc3PqtERBtxkX5nziX9vnBL8WXmSGwv8CuPV6g==", + "dependencies": [ + "@babel/helper-validator-identifier", + "js-tokens", + "picocolors" + ] + }, + "@babel/helper-validator-identifier@7.25.9": { + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==" + }, "@babel/runtime@7.25.6": { "integrity": "sha512-VBj9MYyDb9tuLq7yzqjgzt6Q+IBQLrGZfdjOekyEirZPHxXWoTSGUTMrpsfi58Up73d13NfYLv8HT9vmznjzhQ==", "dependencies": [ @@ -233,6 +250,17 @@ "semver" ] }, + "@conventional-changelog/git-client@1.0.1_conventional-commits-parser@6.0.0": { + "integrity": "sha512-PJEqBwAleffCMETaVm/fUgHldzBE35JFk3/9LL6NUA5EXa3qednu+UT6M7E5iBu3zIQZCULYIiZ90fBYHt6xUw==", + "dependencies": [ + "@types/semver", + "conventional-commits-parser", + "semver" + ] + }, + "@hutson/parse-repository-url@5.0.0": { + "integrity": "sha512-e5+YUKENATs1JgYHMzTr2MW/NDcXGfYFAuOQU8gJgF/kEh4EqKgfGrfLI67bMD4tbhZVlkigz/9YYwWcbOFthg==" + }, "@manypkg/find-root@1.1.0": { "integrity": "sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==", "dependencies": [ @@ -279,9 +307,15 @@ "undici-types" ] }, + "@types/normalize-package-data@2.4.4": { + "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==" + }, "@types/semver@7.5.8": { "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==" }, + "add-stream@1.0.0": { + "integrity": "sha512-qQLMr+8o0WC4FZGQTcJiKBVC59JylcPSrTtk6usvmIDFUOCKegapy1VHQwRbFMOFyb/inzUVqHs+eMYKDM1YeQ==" + }, "ansi-colors@4.1.3": { "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==" }, @@ -331,9 +365,89 @@ "compare-func" ] }, + "conventional-changelog-atom@5.0.0": { + "integrity": "sha512-WfzCaAvSCFPkznnLgLnfacRAzjgqjLUjvf3MftfsJzQdDICqkOOpcMtdJF3wTerxSpv2IAAjX8doM3Vozqle3g==" + }, + "conventional-changelog-cli@5.0.0": { + "integrity": "sha512-9Y8fucJe18/6ef6ZlyIlT2YQUbczvoQZZuYmDLaGvcSBP+M6h+LAvf7ON7waRxKJemcCII8Yqu5/8HEfskTxJQ==", + "dependencies": [ + "add-stream", + "conventional-changelog", + "meow", + "tempfile" + ] + }, + "conventional-changelog-codemirror@5.0.0": { + "integrity": "sha512-8gsBDI5Y3vrKUCxN6Ue8xr6occZ5nsDEc4C7jO/EovFGozx8uttCAyfhRrvoUAWi2WMm3OmYs+0mPJU7kQdYWQ==" + }, + "conventional-changelog-conventionalcommits@8.0.0": { + "integrity": "sha512-eOvlTO6OcySPyyyk8pKz2dP4jjElYunj9hn9/s0OB+gapTO8zwS9UQWrZ1pmF2hFs3vw1xhonOLGcGjy/zgsuA==", + "dependencies": [ + "compare-func" + ] + }, + "conventional-changelog-core@8.0.0_conventional-commits-parser@6.0.0": { + "integrity": "sha512-EATUx5y9xewpEe10UEGNpbSHRC6cVZgO+hXQjofMqpy+gFIrcGvH3Fl6yk2VFKh7m+ffenup2N7SZJYpyD9evw==", + "dependencies": [ + "@hutson/parse-repository-url", + "add-stream", + "conventional-changelog-writer", + "conventional-commits-parser", + "git-raw-commits", + "git-semver-tags", + "hosted-git-info", + "normalize-package-data", + "read-package-up", + "read-pkg" + ] + }, + "conventional-changelog-ember@5.0.0": { + "integrity": "sha512-RPflVfm5s4cSO33GH/Ey26oxhiC67akcxSKL8CLRT3kQX2W3dbE19sSOM56iFqUJYEwv9mD9r6k79weWe1urfg==" + }, + "conventional-changelog-eslint@6.0.0": { + "integrity": "sha512-eiUyULWjzq+ybPjXwU6NNRflApDWlPEQEHvI8UAItYW/h22RKkMnOAtfCZxMmrcMO1OKUWtcf2MxKYMWe9zJuw==" + }, + "conventional-changelog-express@5.0.0": { + "integrity": "sha512-D8Q6WctPkQpvr2HNCCmwU5GkX22BVHM0r4EW8vN0230TSyS/d6VQJDAxGb84lbg0dFjpO22MwmsikKL++Oo/oQ==" + }, + "conventional-changelog-jquery@6.0.0": { + "integrity": "sha512-2kxmVakyehgyrho2ZHBi90v4AHswkGzHuTaoH40bmeNqUt20yEkDOSpw8HlPBfvEQBwGtbE+5HpRwzj6ac2UfA==" + }, + "conventional-changelog-jshint@5.0.0": { + "integrity": "sha512-gGNphSb/opc76n2eWaO6ma4/Wqu3tpa2w7i9WYqI6Cs2fncDSI2/ihOfMvXveeTTeld0oFvwMVNV+IYQIk3F3g==", + "dependencies": [ + "compare-func" + ] + }, "conventional-changelog-preset-loader@5.0.0": { "integrity": "sha512-SetDSntXLk8Jh1NOAl1Gu5uLiCNSYenB5tm0YVeZKePRIgDW9lQImromTwLa3c/Gae298tsgOM+/CYT9XAl0NA==" }, + "conventional-changelog-writer@8.0.0": { + "integrity": "sha512-TQcoYGRatlAnT2qEWDON/XSfnVG38JzA7E0wcGScu7RElQBkg9WWgZd1peCWFcWDh1xfb2CfsrcvOn1bbSzztA==", + "dependencies": [ + "@types/semver", + "conventional-commits-filter", + "handlebars", + "meow", + "semver" + ] + }, + "conventional-changelog@6.0.0": { + "integrity": "sha512-tuUH8H/19VjtD9Ig7l6TQRh+Z0Yt0NZ6w/cCkkyzUbGQTnUEmKfGtkC9gGfVgCfOL1Rzno5NgNF4KY8vR+Jo3w==", + "dependencies": [ + "conventional-changelog-angular", + "conventional-changelog-atom", + "conventional-changelog-codemirror", + "conventional-changelog-conventionalcommits", + "conventional-changelog-core", + "conventional-changelog-ember", + "conventional-changelog-eslint", + "conventional-changelog-express", + "conventional-changelog-jquery", + "conventional-changelog-jshint", + "conventional-changelog-preset-loader" + ] + }, "conventional-commits-filter@5.0.0": { "integrity": "sha512-tQMagCOC59EVgNZcC5zl7XqO30Wki9i9J3acbUvkaosCT6JX3EeFwJD7Qqp4MCikRnzS18WXV3BLIQ66ytu6+Q==" }, @@ -346,7 +460,7 @@ "conventional-recommended-bump@10.0.0_conventional-commits-filter@5.0.0_conventional-commits-parser@6.0.0": { "integrity": "sha512-RK/fUnc2btot0oEVtrj3p2doImDSs7iiz/bftFCDzels0Qs1mxLghp+DFHMaOC0qiCI6sWzlTDyBFSYuot6pRA==", "dependencies": [ - "@conventional-changelog/git-client", + "@conventional-changelog/git-client@1.0.1_conventional-commits-filter@5.0.0_conventional-commits-parser@6.0.0", "conventional-changelog-preset-loader", "conventional-commits-filter", "conventional-commits-parser", @@ -356,7 +470,7 @@ "cross-spawn@5.1.0": { "integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==", "dependencies": [ - "lru-cache", + "lru-cache@4.1.5", "shebang-command", "which" ] @@ -419,6 +533,9 @@ "to-regex-range" ] }, + "find-up-simple@1.0.0": { + "integrity": "sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==" + }, "find-up@4.1.0": { "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dependencies": [ @@ -442,6 +559,20 @@ "universalify" ] }, + "git-raw-commits@5.0.0_conventional-commits-parser@6.0.0": { + "integrity": "sha512-I2ZXrXeOc0KrCvC7swqtIFXFN+rbjnC7b2T943tvemIOVNl+XP8YnA9UVwqFhzzLClnSA60KR/qEjLpXzs73Qg==", + "dependencies": [ + "@conventional-changelog/git-client@1.0.1_conventional-commits-parser@6.0.0", + "meow" + ] + }, + "git-semver-tags@8.0.0_conventional-commits-parser@6.0.0": { + "integrity": "sha512-N7YRIklvPH3wYWAR2vysaqGLPRcpwQ0GKdlqTiVN5w1UmCdaeY3K8s6DMKRCh54DDdzyt/OAB6C8jgVtb7Y2Fg==", + "dependencies": [ + "@conventional-changelog/git-client@1.0.1_conventional-commits-parser@6.0.0", + "meow" + ] + }, "glob-parent@5.1.2": { "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dependencies": [ @@ -462,6 +593,22 @@ "graceful-fs@4.2.11": { "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, + "handlebars@4.7.8": { + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", + "dependencies": [ + "minimist", + "neo-async", + "source-map", + "uglify-js", + "wordwrap" + ] + }, + "hosted-git-info@7.0.2": { + "integrity": "sha512-puUZAUKT5m8Zzvs72XWy3HtvVbTWljRE66cP60bxJzAqf2DgICo7lYTY2IHUmLnNpjYvw5bvmoHvPc0QO2a62w==", + "dependencies": [ + "lru-cache@10.4.3" + ] + }, "human-id@1.0.2": { "integrity": "sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==" }, @@ -474,6 +621,9 @@ "ignore@5.3.2": { "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==" }, + "index-to-position@0.1.2": { + "integrity": "sha512-MWDKS3AS1bGCHLBA2VLImJz42f7bJh8wQsTGCzI3j519/CASStoDONUBVz2I/VID0MpiX3SGSnbOD2xUalbE5g==" + }, "is-extglob@2.1.1": { "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" }, @@ -501,6 +651,9 @@ "isexe@2.0.0": { "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, + "js-tokens@4.0.0": { + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, "js-yaml@3.14.1": { "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dependencies": [ @@ -523,6 +676,9 @@ "lodash.startcase@4.4.0": { "integrity": "sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==" }, + "lru-cache@10.4.3": { + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==" + }, "lru-cache@4.1.5": { "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", "dependencies": [ @@ -543,9 +699,23 @@ "picomatch" ] }, + "minimist@1.2.8": { + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==" + }, "mri@1.2.0": { "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==" }, + "neo-async@2.6.2": { + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" + }, + "normalize-package-data@6.0.2": { + "integrity": "sha512-V6gygoYb/5EmNI+MEGrWkC+e6+Rr7mTmfHrxDbLzxQogBkgzo76rkok0Am6thgSF7Mv2nLOajAJj5vDJZEFn7g==", + "dependencies": [ + "hosted-git-info", + "semver", + "validate-npm-package-license" + ] + }, "os-tmpdir@1.0.2": { "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==" }, @@ -579,6 +749,14 @@ "package-manager-detector@0.2.0": { "integrity": "sha512-E385OSk9qDcXhcM9LNSe4sdhx8a9mAPrZ4sMLW+tmxl5ZuGtPUcdFu+MPP2jbgiWAZ6Pfe5soGFMd+0Db5Vrog==" }, + "parse-json@8.1.0": { + "integrity": "sha512-rum1bPifK5SSar35Z6EKZuYPJx85pkNaFrxBK3mwdfSJ1/WKbYrjoW/zTPSjRRamfmVX1ACBIdFAO0VRErW/EA==", + "dependencies": [ + "@babel/code-frame", + "index-to-position", + "type-fest" + ] + }, "path-exists@4.0.0": { "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" }, @@ -603,6 +781,24 @@ "queue-microtask@1.2.3": { "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" }, + "read-package-up@11.0.0": { + "integrity": "sha512-MbgfoNPANMdb4oRBNg5eqLbB2t2r+o5Ua1pNt8BqGp4I0FJZhuVSOj3PaBPni4azWuSzEdNn2evevzVmEk1ohQ==", + "dependencies": [ + "find-up-simple", + "read-pkg", + "type-fest" + ] + }, + "read-pkg@9.0.1": { + "integrity": "sha512-9viLL4/n1BJUCT1NXVTdS1jtm80yDEgR5T4yCelII49Mbj0v1rZdKqj7zCiYdbB0CuCgdrvHcNogAKTFPBocFA==", + "dependencies": [ + "@types/normalize-package-data", + "normalize-package-data", + "parse-json", + "type-fest", + "unicorn-magic" + ] + }, "read-yaml-file@1.1.0": { "integrity": "sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==", "dependencies": [ @@ -648,6 +844,9 @@ "slash@3.0.0": { "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" }, + "source-map@0.6.1": { + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + }, "spawndamnit@2.0.0": { "integrity": "sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA==", "dependencies": [ @@ -655,6 +854,26 @@ "signal-exit" ] }, + "spdx-correct@3.2.0": { + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dependencies": [ + "spdx-expression-parse", + "spdx-license-ids" + ] + }, + "spdx-exceptions@2.5.0": { + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==" + }, + "spdx-expression-parse@3.0.1": { + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dependencies": [ + "spdx-exceptions", + "spdx-license-ids" + ] + }, + "spdx-license-ids@3.0.20": { + "integrity": "sha512-jg25NiDV/1fLtSgEgyvVyDunvaNHbuwF9lfNV17gSmPFAlYzdfNBlLtLzXTevwkPj7DhGbmN9VnmJIgLnhvaBw==" + }, "sprintf-js@1.0.3": { "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" }, @@ -667,6 +886,15 @@ "strip-bom@3.0.0": { "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==" }, + "temp-dir@3.0.0": { + "integrity": "sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==" + }, + "tempfile@5.0.0": { + "integrity": "sha512-bX655WZI/F7EoTDw9JvQURqAXiPHi8o8+yFxPF2lWYyz1aHnmMRuXWqL6YB6GmeO0o4DIYWHLgGNi/X64T+X4Q==", + "dependencies": [ + "temp-dir" + ] + }, "term-size@2.2.1": { "integrity": "sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==" }, @@ -682,18 +910,37 @@ "is-number" ] }, + "type-fest@4.26.1": { + "integrity": "sha512-yOGpmOAL7CkKe/91I5O3gPICmJNLJ1G4zFYVAsRHg7M64biSnPtRj0WNQt++bRkjYOqjWXrhnUw1utzmVErAdg==" + }, + "uglify-js@3.19.3": { + "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==" + }, "undici-types@6.19.8": { "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==" }, + "unicorn-magic@0.1.0": { + "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==" + }, "universalify@0.1.2": { "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" }, + "validate-npm-package-license@3.0.4": { + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dependencies": [ + "spdx-correct", + "spdx-expression-parse" + ] + }, "which@1.3.1": { "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dependencies": [ "isexe" ] }, + "wordwrap@1.0.0": { + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==" + }, "yallist@2.1.2": { "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==" } diff --git a/scripts/release.ts b/scripts/release.ts index cae074b..e22364e 100644 --- a/scripts/release.ts +++ b/scripts/release.ts @@ -1,6 +1,133 @@ -import 'npm:conventional-changelog-angular'; -import {Bumper} from 'npm:conventional-recommended-bump'; +import { critical, info, setup } from "@std/log"; +import { format, increment, parse } from "jsr:@std/semver"; +import { resolve } from "node:path"; +import conventionalChangelog from "npm:conventional-changelog"; +import "npm:conventional-changelog-angular"; +import { Bumper } from "npm:conventional-recommended-bump"; -const bumper = new Bumper(Deno.cwd()).loadPreset('angular'); +setup({}); + +// Ensure clean working tree +const status = new Deno.Command("git", { + args: ["status", "--porcelain"], + stdout: "piped", + stderr: "inherit", +}).outputSync(); + +if (status.stdout.length !== 0) { + critical("Working tree is not clean. Please commit or stash your changes."); + Deno.exit(1); +} + +info("Running tests"); + +if ( + !new Deno.Command("deno", { + args: ["task", "test"], + stdout: "inherit", + "stderr": "inherit", + }).outputSync().success +) { + critical("Tests failed"); + Deno.exit(1); +} + +const CURRENT_FILE = import.meta.url.replace("file://", ""); +Deno.chdir(resolve(CURRENT_FILE, "..", "..")); + +const bumper = new Bumper(Deno.cwd()).loadPreset("angular"); const bump = await bumper.bump(); -console.log(bump.releaseType); // major, minor, patch + +const currentVersion = await import("../deno.json", { with: { type: "json" } }) + .then((pkg) => pkg.default.version); + +if ( + bump.releaseType !== "major" && bump.releaseType !== "minor" && + bump.releaseType !== "patch" +) { + throw new Error("Invalid release type"); +} + +const newVersion = format(increment(parse(currentVersion), bump.releaseType)); + +info(`Bumping version from ${currentVersion} to ${newVersion}`); + +info("Updating deno.json"); + +Deno.writeTextFile( + "./deno.json", + JSON.stringify( + { + ...JSON.parse(Deno.readTextFileSync("./deno.json")), + version: newVersion, + }, + null, + 2, + ), +); + +info("Updated deno.json"); +info("Generating changelog"); + +const changelog = await new Promise((resolve, reject) => { + let data = "#"; + conventionalChangelog({ + preset: "angular", + pkg: { + path: "./deno.json", + }, + }).on("data", (chunk: string) => { + data += chunk; + }).on("end", () => { + resolve(data); + }).on("error", (err: Error) => { + reject(err); + }); +}); + +const oldChangelog = Deno.readTextFileSync("./CHANGELOG.md"); +const newChangelog = oldChangelog.replace( + "# Changelog", + `# Changelog\n\n${changelog}`, +); +Deno.writeTextFile("./CHANGELOG.md", newChangelog); + +info("Updated CHANGELOG.md"); +if ( + !new Deno.Command("git", { + args: ["add", "deno.json", "CHANGELOG.md"], + stdout: "inherit", + "stderr": "inherit", + }).outputSync().success +) { + critical("Failed to add files to git"); + Deno.exit(1); +} + +info("Added files to git"); + +if ( + !new Deno.Command("git", { + args: ["commit", "-m", `chore(release): Release v${newVersion} 🚀`], + stdout: "inherit", + "stderr": "inherit", + }).outputSync().success +) { + critical("Failed to commit changes"); + Deno.exit(1); +} + +info("Committed changes"); + +if ( + !new Deno.Command("git", { + args: ["tag", `v${newVersion}`], + stdout: "inherit", + "stderr": "inherit", + }).outputSync().success +) { + critical("Failed to tag release", newVersion); + Deno.exit(1); +} + +info("Tagged release");