diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 2e7ee7bd..00000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,40 +0,0 @@ -version: 2 - -updates: - # Root package.json dependencies - - package-ecosystem: "npm" - directory: "/" - schedule: - interval: "weekly" - open-pull-requests-limit: 10 - labels: - - "dependencies" - - "npm" - groups: - dev-dependencies: - patterns: - - "@types/*" - - "eslint*" - - "prettier" - - "typescript*" - update-types: - - "minor" - - "patch" - commit-message: - prefix: "chore" - include: "scope" - versioning-strategy: increase - target-branch: "stage" - - # GitHub Actions - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "monthly" - labels: - - "dependencies" - - "github-actions" - commit-message: - prefix: "ci" - include: "scope" - target-branch: "stage" diff --git a/CHANGELOG.md b/CHANGELOG.md index f75213fd..624e2b0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,33 @@ +## 3.1.0-stage.7 (2026-02-11) + +* fix: enable HTTP/3 and QUIC by default in workload (#385) ([c60e53c](https://github.com/aziontech/lib/commit/c60e53c)), closes [#385](https://github.com/aziontech/lib/issues/385) + +## 3.1.0-stage.6 (2026-02-10) + +* fix: extract firewall behaviors schema and add runtime validation (#384) ([bd4b04e](https://github.com/aziontech/lib/commit/bd4b04e)), closes [#384](https://github.com/aziontech/lib/issues/384) +* chore: remove dependabot workflow (#373) ([6570a19](https://github.com/aziontech/lib/commit/6570a19)), closes [#373](https://github.com/aziontech/lib/issues/373) +* chore: update deps (#371) ([2faebc8](https://github.com/aziontech/lib/commit/2faebc8)), closes [#371](https://github.com/aziontech/lib/issues/371) + +## 3.1.0-stage.5 (2026-01-30) + +* fix: restructure firewall rules schema to support multiple behaviors and criteria (#366) ([429722d](https://github.com/aziontech/lib/commit/429722d)), closes [#366](https://github.com/aziontech/lib/issues/366) + +## 3.1.0-stage.4 (2026-01-27) + +* fix: change ES module output extension from .mjs to .js in presets (#365) ([e138dd5](https://github.com/aziontech/lib/commit/e138dd5)), closes [#365](https://github.com/aziontech/lib/issues/365) + +## 3.1.0-stage.3 (2026-01-27) + +* feat: migrate build system from tsup to vite (#354) ([d4130a8](https://github.com/aziontech/lib/commit/d4130a8)), closes [#354](https://github.com/aziontech/lib/issues/354) + +## 3.1.0-stage.2 (2026-01-15) + +* feat: add KV configuration support (#350) ([1a344ca](https://github.com/aziontech/lib/commit/1a344ca)), closes [#350](https://github.com/aziontech/lib/issues/350) + +## 3.1.0-stage.1 (2026-01-13) + +* feat: add KV storage polyfill for local development (#349) ([6d4d6f9](https://github.com/aziontech/lib/commit/6d4d6f9)), closes [#349](https://github.com/aziontech/lib/issues/349) + ## 3.0.0 (2026-01-12) * Merge pull request #347 from aziontech/stage ([7302c73](https://github.com/aziontech/lib/commit/7302c73)), closes [#347](https://github.com/aziontech/lib/issues/347) diff --git a/package-lock.json b/package-lock.json index c94fd823..c8e464f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "azion", - "version": "2.3.2", + "version": "3.1.0-stage.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "azion", - "version": "2.3.2", + "version": "3.1.0-stage.5", "license": "MIT", "workspaces": [ "packages/*" @@ -66,10 +66,11 @@ "globals": "^16.4.0", "husky": "^9.1.7", "prettier": "^3.6.2", - "semantic-release": "^25.0.2", - "tsup": "^8.5.0", + "semantic-release": "^25.0.3", "typescript": "^5.5.3", - "typescript-eslint": "^8.44.1" + "typescript-eslint": "^8.44.1", + "vite": "^7.3.1", + "vite-plugin-dts": "^4.5.4" }, "engines": { "node": ">=18.0.0" @@ -416,9 +417,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", - "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", "license": "MIT", "engines": { "node": ">=6.9.0" @@ -461,12 +462,12 @@ } }, "node_modules/@babel/parser": { - "version": "7.28.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.4.tgz", - "integrity": "sha512-yZbBqeM6TkpP9du/I2pUZnJsRMGGvOuIrhjzC1AwHwW+6he4mni6Bp/m8ijn0iOuZuPI2BfkCoSRunpyjnrQKg==", + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.6.tgz", + "integrity": "sha512-TeR9zWR18BvbfPmGbLampPMW+uW1NZnJlRuuHso8i87QZNq2JRF9i6RgxRqtEq+wQGsS19NNTWr2duhnE49mfQ==", "license": "MIT", "dependencies": { - "@babel/types": "^7.28.4" + "@babel/types": "^7.28.6" }, "bin": { "parser": "bin/babel-parser.js" @@ -1850,13 +1851,13 @@ } }, "node_modules/@babel/types": { - "version": "7.28.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.4.tgz", - "integrity": "sha512-bkFqkLhh3pMBUQQkpVgWDWq/lqzc2678eUyDlTBhRqhCHFguYYGM0Efga7tYk4TogG/3x0EEl66/OQ+WGbWB/Q==", + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.6.tgz", + "integrity": "sha512-0ZrskXVEHSWIqZM/sQZ4EV3jZJXRkio/WCxaqKZP1g//CEWEPSfeZFcms4XeKBCHU0ZKnIkdJeU/kF+eRp5lBg==", "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.27.1", - "@babel/helper-validator-identifier": "^7.27.1" + "@babel/helper-validator-identifier": "^7.28.5" }, "engines": { "node": ">=6.9.0" @@ -3229,47 +3230,25 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, + "node_modules/@isaacs/balanced-match": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz", + "integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==", + "license": "MIT", "engines": { - "node": ">=12" + "node": "20 || >=22" } }, - "node_modules/@isaacs/cliui/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@isaacs/cliui/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, + "node_modules/@isaacs/brace-expansion": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz", + "integrity": "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==", "license": "MIT", "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" + "@isaacs/balanced-match": "^4.0.1" }, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": "20 || >=22" } }, "node_modules/@istanbuljs/load-nyc-config": { @@ -4153,10 +4132,154 @@ "resolved": "packages/utils", "link": true }, + "node_modules/@lib/vite-config": { + "resolved": "packages/vite-config", + "link": true + }, "node_modules/@lib/wasm-image-processor": { "resolved": "packages/wasm-image-processor", "link": true }, + "node_modules/@microsoft/api-extractor": { + "version": "7.55.2", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.55.2.tgz", + "integrity": "sha512-1jlWO4qmgqYoVUcyh+oXYRztZde/pAi7cSVzBz/rc+S7CoVzDasy8QE13dx6sLG4VRo8SfkkLbFORR6tBw4uGQ==", + "license": "MIT", + "dependencies": { + "@microsoft/api-extractor-model": "7.32.2", + "@microsoft/tsdoc": "~0.16.0", + "@microsoft/tsdoc-config": "~0.18.0", + "@rushstack/node-core-library": "5.19.1", + "@rushstack/rig-package": "0.6.0", + "@rushstack/terminal": "0.19.5", + "@rushstack/ts-command-line": "5.1.5", + "diff": "~8.0.2", + "lodash": "~4.17.15", + "minimatch": "10.0.3", + "resolve": "~1.22.1", + "semver": "~7.5.4", + "source-map": "~0.6.1", + "typescript": "5.8.2" + }, + "bin": { + "api-extractor": "bin/api-extractor" + } + }, + "node_modules/@microsoft/api-extractor-model": { + "version": "7.32.2", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.32.2.tgz", + "integrity": "sha512-Ussc25rAalc+4JJs9HNQE7TuO9y6jpYQX9nWD1DhqUzYPBr3Lr7O9intf+ZY8kD5HnIqeIRJX7ccCT0QyBy2Ww==", + "license": "MIT", + "dependencies": { + "@microsoft/tsdoc": "~0.16.0", + "@microsoft/tsdoc-config": "~0.18.0", + "@rushstack/node-core-library": "5.19.1" + } + }, + "node_modules/@microsoft/api-extractor/node_modules/diff": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/diff/-/diff-8.0.3.tgz", + "integrity": "sha512-qejHi7bcSD4hQAZE0tNAawRK1ZtafHDmMTMkrrIGgSLl7hTnQHmKCeB45xAcbfTqK2zowkM3j3bHt/4b/ARbYQ==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/@microsoft/api-extractor/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@microsoft/api-extractor/node_modules/minimatch": { + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.3.tgz", + "integrity": "sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw==", + "license": "ISC", + "dependencies": { + "@isaacs/brace-expansion": "^5.0.0" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@microsoft/api-extractor/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@microsoft/api-extractor/node_modules/typescript": { + "version": "5.8.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", + "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/@microsoft/api-extractor/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" + }, + "node_modules/@microsoft/tsdoc": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.16.0.tgz", + "integrity": "sha512-xgAyonlVVS+q7Vc7qLW0UrJU7rSFcETRWsqdXZtjzRU8dF+6CkozTK4V4y1LwOX7j8r/vHphjDeMeGI4tNGeGA==", + "license": "MIT" + }, + "node_modules/@microsoft/tsdoc-config": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc-config/-/tsdoc-config-0.18.0.tgz", + "integrity": "sha512-8N/vClYyfOH+l4fLkkr9+myAoR6M7akc8ntBJ4DJdWH2b09uVfr71+LTMpNyG19fNqWDg8KEDZhx5wxuqHyGjw==", + "license": "MIT", + "dependencies": { + "@microsoft/tsdoc": "0.16.0", + "ajv": "~8.12.0", + "jju": "~1.4.0", + "resolve": "~1.22.2" + } + }, + "node_modules/@microsoft/tsdoc-config/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/@napi-rs/lzma": { "version": "1.4.5", "resolved": "https://registry.npmjs.org/@napi-rs/lzma/-/lzma-1.4.5.tgz", @@ -5003,17 +5126,6 @@ "node": ">=10.12.0" } }, - "node_modules/@pkgjs/parseargs": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=14" - } - }, "node_modules/@pnpm/config.env-replace": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz", @@ -5059,6 +5171,40 @@ "node": ">=12" } }, + "node_modules/@rollup/pluginutils": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.3.0.tgz", + "integrity": "sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/pluginutils/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.52.2", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.52.2.tgz", @@ -5066,7 +5212,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -5080,7 +5225,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -5094,7 +5238,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -5108,7 +5251,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -5122,7 +5264,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -5136,7 +5277,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -5150,7 +5290,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -5164,7 +5303,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -5178,7 +5316,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -5192,7 +5329,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -5206,7 +5342,6 @@ "cpu": [ "loong64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -5220,7 +5355,6 @@ "cpu": [ "ppc64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -5234,7 +5368,6 @@ "cpu": [ "riscv64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -5248,7 +5381,6 @@ "cpu": [ "riscv64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -5262,7 +5394,6 @@ "cpu": [ "s390x" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -5276,7 +5407,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -5290,7 +5420,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -5304,7 +5433,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -5318,7 +5446,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -5332,7 +5459,6 @@ "cpu": [ "ia32" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -5346,7 +5472,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -5360,104 +5485,278 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ "win32" ] }, - "node_modules/@sec-ant/readable-stream": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@sec-ant/readable-stream/-/readable-stream-0.4.1.tgz", - "integrity": "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@semantic-release/changelog": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/@semantic-release/changelog/-/changelog-6.0.3.tgz", - "integrity": "sha512-dZuR5qByyfe3Y03TpmCvAxCyTnp7r5XwtHRf/8vD9EAn4ZWbavUX8adMtXYzE86EVh0gyLA7lm5yW4IV30XUag==", - "dev": true, + "node_modules/@rushstack/node-core-library": { + "version": "5.19.1", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-5.19.1.tgz", + "integrity": "sha512-ESpb2Tajlatgbmzzukg6zyAhH+sICqJR2CNXNhXcEbz6UGCQfrKCtkxOpJTftWc8RGouroHG0Nud1SJAszvpmA==", "license": "MIT", "dependencies": { - "@semantic-release/error": "^3.0.0", - "aggregate-error": "^3.0.0", - "fs-extra": "^11.0.0", - "lodash": "^4.17.4" - }, - "engines": { - "node": ">=14.17" + "ajv": "~8.13.0", + "ajv-draft-04": "~1.0.0", + "ajv-formats": "~3.0.1", + "fs-extra": "~11.3.0", + "import-lazy": "~4.0.0", + "jju": "~1.4.0", + "resolve": "~1.22.1", + "semver": "~7.5.4" }, "peerDependencies": { - "semantic-release": ">=18.0.0" + "@types/node": "*" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } } }, - "node_modules/@semantic-release/commit-analyzer": { - "version": "13.0.1", - "resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-13.0.1.tgz", - "integrity": "sha512-wdnBPHKkr9HhNhXOhZD5a2LNl91+hs8CC2vsAVYxtZH3y0dV3wKn+uZSN61rdJQZ8EGxzWB3inWocBHV9+u/CQ==", - "dev": true, + "node_modules/@rushstack/node-core-library/node_modules/ajv": { + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz", + "integrity": "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==", "license": "MIT", "dependencies": { - "conventional-changelog-angular": "^8.0.0", - "conventional-changelog-writer": "^8.0.0", - "conventional-commits-filter": "^5.0.0", - "conventional-commits-parser": "^6.0.0", - "debug": "^4.0.0", - "import-from-esm": "^2.0.0", - "lodash-es": "^4.17.21", - "micromatch": "^4.0.2" + "fast-deep-equal": "^3.1.3", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.4.1" }, - "engines": { - "node": ">=20.8.1" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@rushstack/node-core-library/node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" }, "peerDependencies": { - "semantic-release": ">=20.1.0" + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } } }, - "node_modules/@semantic-release/commit-analyzer/node_modules/conventional-changelog-angular": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-8.0.0.tgz", - "integrity": "sha512-CLf+zr6St0wIxos4bmaKHRXWAcsCXrJU6F4VdNDrGRK3B8LDLKoX3zuMV5GhtbGkVR/LohZ6MT6im43vZLSjmA==", - "dev": true, + "node_modules/@rushstack/node-core-library/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "license": "ISC", "dependencies": { - "compare-func": "^2.0.0" + "yallist": "^4.0.0" }, "engines": { - "node": ">=18" + "node": ">=10" } }, - "node_modules/@semantic-release/commit-analyzer/node_modules/conventional-commits-parser": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-6.2.0.tgz", - "integrity": "sha512-uLnoLeIW4XaoFtH37qEcg/SXMJmKF4vi7V0H2rnPueg+VEtFGA/asSCNTcq4M/GQ6QmlzchAEtOoDTtKqWeHag==", - "dev": true, - "license": "MIT", + "node_modules/@rushstack/node-core-library/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "license": "ISC", "dependencies": { - "meow": "^13.0.0" + "lru-cache": "^6.0.0" }, "bin": { - "conventional-commits-parser": "dist/cli/index.js" + "semver": "bin/semver.js" }, "engines": { - "node": ">=18" + "node": ">=10" } }, - "node_modules/@semantic-release/error": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-3.0.0.tgz", - "integrity": "sha512-5hiM4Un+tpl4cKw3lV4UgzJj+SmfNIDCLLw0TepzQxz9ZGV5ixnqkzIVF+3tp0ZHgcMKE+VNGHJjEeyFG2dcSw==", - "dev": true, + "node_modules/@rushstack/node-core-library/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" + }, + "node_modules/@rushstack/problem-matcher": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@rushstack/problem-matcher/-/problem-matcher-0.1.1.tgz", + "integrity": "sha512-Fm5XtS7+G8HLcJHCWpES5VmeMyjAKaWeyZU5qPzZC+22mPlJzAsOxymHiWIfuirtPckX3aptWws+K2d0BzniJA==", "license": "MIT", - "engines": { - "node": ">=14.17" + "peerDependencies": { + "@types/node": "*" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } } }, - "node_modules/@semantic-release/git": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/@semantic-release/git/-/git-10.0.1.tgz", + "node_modules/@rushstack/rig-package": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.6.0.tgz", + "integrity": "sha512-ZQmfzsLE2+Y91GF15c65L/slMRVhF6Hycq04D4TwtdGaUAbIXXg9c5pKA5KFU7M4QMaihoobp9JJYpYcaY3zOw==", + "license": "MIT", + "dependencies": { + "resolve": "~1.22.1", + "strip-json-comments": "~3.1.1" + } + }, + "node_modules/@rushstack/terminal": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.19.5.tgz", + "integrity": "sha512-6k5tpdB88G0K7QrH/3yfKO84HK9ggftfUZ51p7fePyCE7+RLLHkWZbID9OFWbXuna+eeCFE7AkKnRMHMxNbz7Q==", + "license": "MIT", + "dependencies": { + "@rushstack/node-core-library": "5.19.1", + "@rushstack/problem-matcher": "0.1.1", + "supports-color": "~8.1.1" + }, + "peerDependencies": { + "@types/node": "*" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@rushstack/terminal/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/@rushstack/ts-command-line": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-5.1.5.tgz", + "integrity": "sha512-YmrFTFUdHXblYSa+Xc9OO9FsL/XFcckZy0ycQ6q7VSBsVs5P0uD9vcges5Q9vctGlVdu27w+Ct6IuJ458V0cTQ==", + "license": "MIT", + "dependencies": { + "@rushstack/terminal": "0.19.5", + "@types/argparse": "1.0.38", + "argparse": "~1.0.9", + "string-argv": "~0.3.1" + } + }, + "node_modules/@rushstack/ts-command-line/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/@rushstack/ts-command-line/node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "license": "BSD-3-Clause" + }, + "node_modules/@sec-ant/readable-stream": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@sec-ant/readable-stream/-/readable-stream-0.4.1.tgz", + "integrity": "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@semantic-release/changelog": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@semantic-release/changelog/-/changelog-6.0.3.tgz", + "integrity": "sha512-dZuR5qByyfe3Y03TpmCvAxCyTnp7r5XwtHRf/8vD9EAn4ZWbavUX8adMtXYzE86EVh0gyLA7lm5yW4IV30XUag==", + "dev": true, + "license": "MIT", + "dependencies": { + "@semantic-release/error": "^3.0.0", + "aggregate-error": "^3.0.0", + "fs-extra": "^11.0.0", + "lodash": "^4.17.4" + }, + "engines": { + "node": ">=14.17" + }, + "peerDependencies": { + "semantic-release": ">=18.0.0" + } + }, + "node_modules/@semantic-release/commit-analyzer": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-13.0.1.tgz", + "integrity": "sha512-wdnBPHKkr9HhNhXOhZD5a2LNl91+hs8CC2vsAVYxtZH3y0dV3wKn+uZSN61rdJQZ8EGxzWB3inWocBHV9+u/CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "conventional-changelog-angular": "^8.0.0", + "conventional-changelog-writer": "^8.0.0", + "conventional-commits-filter": "^5.0.0", + "conventional-commits-parser": "^6.0.0", + "debug": "^4.0.0", + "import-from-esm": "^2.0.0", + "lodash-es": "^4.17.21", + "micromatch": "^4.0.2" + }, + "engines": { + "node": ">=20.8.1" + }, + "peerDependencies": { + "semantic-release": ">=20.1.0" + } + }, + "node_modules/@semantic-release/commit-analyzer/node_modules/conventional-changelog-angular": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-8.0.0.tgz", + "integrity": "sha512-CLf+zr6St0wIxos4bmaKHRXWAcsCXrJU6F4VdNDrGRK3B8LDLKoX3zuMV5GhtbGkVR/LohZ6MT6im43vZLSjmA==", + "dev": true, + "license": "ISC", + "dependencies": { + "compare-func": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@semantic-release/commit-analyzer/node_modules/conventional-commits-parser": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-6.2.0.tgz", + "integrity": "sha512-uLnoLeIW4XaoFtH37qEcg/SXMJmKF4vi7V0H2rnPueg+VEtFGA/asSCNTcq4M/GQ6QmlzchAEtOoDTtKqWeHag==", + "dev": true, + "license": "MIT", + "dependencies": { + "meow": "^13.0.0" + }, + "bin": { + "conventional-commits-parser": "dist/cli/index.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@semantic-release/error": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-3.0.0.tgz", + "integrity": "sha512-5hiM4Un+tpl4cKw3lV4UgzJj+SmfNIDCLLw0TepzQxz9ZGV5ixnqkzIVF+3tp0ZHgcMKE+VNGHJjEeyFG2dcSw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.17" + } + }, + "node_modules/@semantic-release/git": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@semantic-release/git/-/git-10.0.1.tgz", "integrity": "sha512-eWrx5KguUcU2wUPaO6sfvZI0wPafUKAMNC18aXY4EnNcrZL86dEmpNVnC9uMpGZkmZJ9EfCVJBQx4pV4EMGT1w==", "dev": true, "license": "MIT", @@ -6065,6 +6364,12 @@ "tslib": "^2.4.0" } }, + "node_modules/@types/argparse": { + "version": "1.0.38", + "resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz", + "integrity": "sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==", + "license": "MIT" + }, "node_modules/@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", @@ -6565,6 +6870,119 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@volar/language-core": { + "version": "2.4.27", + "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.4.27.tgz", + "integrity": "sha512-DjmjBWZ4tJKxfNC1F6HyYERNHPYS7L7OPFyCrestykNdUZMFYzI9WTyvwPcaNaHlrEUwESHYsfEw3isInncZxQ==", + "license": "MIT", + "dependencies": { + "@volar/source-map": "2.4.27" + } + }, + "node_modules/@volar/source-map": { + "version": "2.4.27", + "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-2.4.27.tgz", + "integrity": "sha512-ynlcBReMgOZj2i6po+qVswtDUeeBRCTgDurjMGShbm8WYZgJ0PA4RmtebBJ0BCYol1qPv3GQF6jK7C9qoVc7lg==", + "license": "MIT" + }, + "node_modules/@volar/typescript": { + "version": "2.4.27", + "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-2.4.27.tgz", + "integrity": "sha512-eWaYCcl/uAPInSK2Lze6IqVWaBu/itVqR5InXcHXFyles4zO++Mglt3oxdgj75BDcv1Knr9Y93nowS8U3wqhxg==", + "license": "MIT", + "dependencies": { + "@volar/language-core": "2.4.27", + "path-browserify": "^1.0.1", + "vscode-uri": "^3.0.8" + } + }, + "node_modules/@vue/compiler-core": { + "version": "3.5.27", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.27.tgz", + "integrity": "sha512-gnSBQjZA+//qDZen+6a2EdHqJ68Z7uybrMf3SPjEGgG4dicklwDVmMC1AeIHxtLVPT7sn6sH1KOO+tS6gwOUeQ==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.28.5", + "@vue/shared": "3.5.27", + "entities": "^7.0.0", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.1" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.5.27", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.27.tgz", + "integrity": "sha512-oAFea8dZgCtVVVTEC7fv3T5CbZW9BxpFzGGxC79xakTr6ooeEqmRuvQydIiDAkglZEAd09LgVf1RoDnL54fu5w==", + "license": "MIT", + "dependencies": { + "@vue/compiler-core": "3.5.27", + "@vue/shared": "3.5.27" + } + }, + "node_modules/@vue/compiler-vue2": { + "version": "2.7.16", + "resolved": "https://registry.npmjs.org/@vue/compiler-vue2/-/compiler-vue2-2.7.16.tgz", + "integrity": "sha512-qYC3Psj9S/mfu9uVi5WvNZIzq+xnXMhOwbTFKKDD7b1lhpnn71jXSFdTQ+WsIEk0ONCd7VV2IMm7ONl6tbQ86A==", + "license": "MIT", + "dependencies": { + "de-indent": "^1.0.2", + "he": "^1.2.0" + } + }, + "node_modules/@vue/language-core": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-2.2.0.tgz", + "integrity": "sha512-O1ZZFaaBGkKbsRfnVH1ifOK1/1BUkyK+3SQsfnh6PmMmD4qJcTU8godCeA96jjDRTL6zgnK7YzCHfaUlH2r0Mw==", + "license": "MIT", + "dependencies": { + "@volar/language-core": "~2.4.11", + "@vue/compiler-dom": "^3.5.0", + "@vue/compiler-vue2": "^2.7.16", + "@vue/shared": "^3.5.0", + "alien-signals": "^0.4.9", + "minimatch": "^9.0.3", + "muggle-string": "^0.4.1", + "path-browserify": "^1.0.1" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@vue/language-core/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@vue/language-core/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@vue/shared": { + "version": "3.5.27", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.27.tgz", + "integrity": "sha512-dXr/3CgqXsJkZ0n9F3I4elY8wM9jMJpP3pvRG52r6m0tu/MsAFIe6JpXVGeNMd/D9F4hQynWT8Rfuj0bdm9kFQ==", + "license": "MIT" + }, "node_modules/@webassemblyjs/ast": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", @@ -6843,6 +7261,20 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ajv-draft-04": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ajv-draft-04/-/ajv-draft-04-1.0.0.tgz", + "integrity": "sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==", + "license": "MIT", + "peerDependencies": { + "ajv": "^8.5.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, "node_modules/ajv-errors": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-3.0.0.tgz", @@ -6881,6 +7313,12 @@ "ajv": "^8.8.2" } }, + "node_modules/alien-signals": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/alien-signals/-/alien-signals-0.4.14.tgz", + "integrity": "sha512-itUAVzhczTmP2U5yX67xVpsbbOiquusbWVyA9N+sy6+r6YVbFkahXvNCeEPWEOMhwDYwbVbGHFkVL03N9I5g+Q==", + "license": "MIT" + }, "node_modules/ansi-escapes": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.2.0.tgz", @@ -7330,7 +7768,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, "license": "MIT" }, "node_modules/base64-js": { @@ -7653,32 +8090,6 @@ "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==", "license": "MIT" }, - "node_modules/bundle-require": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-5.1.0.tgz", - "integrity": "sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==", - "dev": true, - "license": "MIT", - "dependencies": { - "load-tsconfig": "^0.2.3" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "peerDependencies": { - "esbuild": ">=0.18" - } - }, - "node_modules/cac": { - "version": "6.7.14", - "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", - "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/call-bind": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", @@ -7788,22 +8199,6 @@ "node": ">=10" } }, - "node_modules/chokidar": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", - "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", - "dev": true, - "license": "MIT", - "dependencies": { - "readdirp": "^4.0.1" - }, - "engines": { - "node": ">= 14.16.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/chrome-trace-event": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", @@ -8260,6 +8655,12 @@ "dot-prop": "^5.1.0" } }, + "node_modules/compare-versions": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.1.tgz", + "integrity": "sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg==", + "license": "MIT" + }, "node_modules/complex.js": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/complex.js/-/complex.js-2.4.2.tgz", @@ -8284,7 +8685,6 @@ "version": "0.1.8", "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", - "dev": true, "license": "MIT" }, "node_modules/config-chain": { @@ -8305,16 +8705,6 @@ "dev": true, "license": "ISC" }, - "node_modules/consola": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", - "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^14.18.0 || >=16.10.0" - } - }, "node_modules/conventional-changelog-angular": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-7.0.0.tgz", @@ -8697,6 +9087,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/de-indent": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz", + "integrity": "sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==", + "license": "MIT" + }, "node_modules/debug": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", @@ -9038,13 +9434,6 @@ "readable-stream": "^2.0.2" } }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true, - "license": "MIT" - }, "node_modules/electron-to-chromium": { "version": "1.5.223", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.223.tgz", @@ -9121,6 +9510,18 @@ "node": ">=10.13.0" } }, + "node_modules/entities": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz", + "integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/env-ci": { "version": "11.2.0", "resolved": "https://registry.npmjs.org/env-ci/-/env-ci-11.2.0.tgz", @@ -9724,6 +10125,12 @@ "node": ">=4.0" } }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "license": "MIT" + }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -10043,18 +10450,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/fix-dts-default-cjs-exports": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fix-dts-default-cjs-exports/-/fix-dts-default-cjs-exports-1.0.1.tgz", - "integrity": "sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "magic-string": "^0.30.17", - "mlly": "^1.7.4", - "rollup": "^4.34.8" - } - }, "node_modules/flat-cache": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", @@ -10091,36 +10486,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/foreground-child": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", - "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", - "dev": true, - "license": "ISC", - "dependencies": { - "cross-spawn": "^7.0.6", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/foreground-child/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/fraction.js": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", @@ -10156,7 +10521,6 @@ "version": "11.3.2", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.2.tgz", "integrity": "sha512-Xr9F6z6up6Ws+NjzMCZc6WXg2YFRlrLP9NQDO3VQrWrfiojdhS56TzueT88ze0uBdCTwEIhQ3ptnmKeWGFAe0A==", - "dev": true, "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", @@ -10178,7 +10542,6 @@ "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, "hasInstallScript": true, "license": "MIT", "optional": true, @@ -10358,27 +10721,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/glob": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", - "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", - "dev": true, - "license": "ISC", - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", @@ -10398,32 +10740,6 @@ "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", "license": "BSD-2-Clause" }, - "node_modules/glob/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/glob/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/global-directory": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/global-directory/-/global-directory-4.0.1.tgz", @@ -10583,6 +10899,15 @@ "node": ">= 0.4" } }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "license": "MIT", + "bin": { + "he": "bin/he" + } + }, "node_modules/highlight.js": { "version": "10.7.3", "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", @@ -10769,6 +11094,15 @@ "node": ">=18.20" } }, + "node_modules/import-lazy": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", + "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/import-local": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", @@ -11290,22 +11624,6 @@ "node": ">=8" } }, - "node_modules/jackspeak": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", - "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" - } - }, "node_modules/java-properties": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/java-properties/-/java-properties-1.0.2.tgz", @@ -12676,21 +12994,17 @@ "version": "2.6.0", "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.0.tgz", "integrity": "sha512-VXe6RjJkBPj0ohtqaO8vSWP3ZhAKo66fKrFNCll4BTcwljPLz03pCbaNKfzGP5MbrCYcbJ7v0nOYYwUzTEIdXQ==", - "dev": true, + "devOptional": true, "license": "MIT", "bin": { "jiti": "lib/jiti-cli.mjs" } }, - "node_modules/joycon": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", - "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - } + "node_modules/jju": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", + "integrity": "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==", + "license": "MIT" }, "node_modules/js-tokens": { "version": "4.0.0", @@ -12777,7 +13091,6 @@ "version": "6.2.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", - "dev": true, "license": "MIT", "dependencies": { "universalify": "^2.0.0" @@ -12833,6 +13146,12 @@ "node": ">=6" } }, + "node_modules/kolorist": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/kolorist/-/kolorist-1.8.0.tgz", + "integrity": "sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==", + "license": "MIT" + }, "node_modules/leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", @@ -12857,19 +13176,6 @@ "node": ">= 0.8.0" } }, - "node_modules/lilconfig": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", - "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antonk52" - } - }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -12914,16 +13220,6 @@ "node": ">=4" } }, - "node_modules/load-tsconfig": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz", - "integrity": "sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, "node_modules/loader-runner": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", @@ -12933,6 +13229,40 @@ "node": ">=6.11.5" } }, + "node_modules/local-pkg": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-1.1.2.tgz", + "integrity": "sha512-arhlxbFRmoQHl33a0Zkle/YWlmNwoyt6QNZEIJcqNbdrsix5Lvc4HyyI3EnwxTYlZYc32EbYrQ8SzEZ7dqgg9A==", + "license": "MIT", + "dependencies": { + "mlly": "^1.7.4", + "pkg-types": "^2.3.0", + "quansync": "^0.2.11" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/local-pkg/node_modules/confbox": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.2.2.tgz", + "integrity": "sha512-1NB+BKqhtNipMsov4xI/NnhCKp9XG9NamYp5PVm9klAT0fsrNPjaFICsCFhNhwZJKNh7zB/3q8qXz0E9oaMNtQ==", + "license": "MIT" + }, + "node_modules/local-pkg/node_modules/pkg-types": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.3.0.tgz", + "integrity": "sha512-SIqCzDRg0s9npO5XQ3tNZioRY1uK06lA41ynBC1YmFTmnY6FjUjVt6s4LoADmwoig1qqD0oK8h1p/8mlMx8Oig==", + "license": "MIT", + "dependencies": { + "confbox": "^0.2.2", + "exsolve": "^1.0.7", + "pathe": "^2.0.3" + } + }, "node_modules/locate-path": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", @@ -12953,7 +13283,6 @@ "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true, "license": "MIT" }, "node_modules/lodash-es": { @@ -13038,13 +13367,6 @@ "dev": true, "license": "MIT" }, - "node_modules/lodash.sortby": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==", - "dev": true, - "license": "MIT" - }, "node_modules/lodash.startcase": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.startcase/-/lodash.startcase-4.4.0.tgz", @@ -13411,16 +13733,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, "node_modules/mkdirp": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", @@ -13441,7 +13753,6 @@ "version": "1.8.0", "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.8.0.tgz", "integrity": "sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==", - "dev": true, "license": "MIT", "dependencies": { "acorn": "^8.15.0", @@ -13466,6 +13777,12 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, + "node_modules/muggle-string": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/muggle-string/-/muggle-string-0.4.1.tgz", + "integrity": "sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==", + "license": "MIT" + }, "node_modules/mz": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", @@ -13478,6 +13795,24 @@ "thenify-all": "^1.0.0" } }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -16031,13 +16366,6 @@ "node": ">=4" } }, - "node_modules/package-json-from-dist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", - "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", - "dev": true, - "license": "BlueOak-1.0.0" - }, "node_modules/pako": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", @@ -16129,6 +16457,12 @@ "dev": true, "license": "MIT" }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "license": "MIT" + }, "node_modules/path-exists": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", @@ -16165,30 +16499,6 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "license": "MIT" }, - "node_modules/path-scurry": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" - }, - "engines": { - "node": ">=16 || 14 >=14.18" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", - "dev": true, - "license": "ISC" - }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -16460,7 +16770,6 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz", "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==", - "dev": true, "license": "MIT", "dependencies": { "confbox": "^0.1.8", @@ -16477,16 +16786,19 @@ "node": ">= 0.4" } }, - "node_modules/postcss-load-config": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz", - "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==", - "dev": true, + "node_modules/postcss": { + "version": "8.5.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", + "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", "funding": [ { "type": "opencollective", "url": "https://opencollective.com/postcss/" }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, { "type": "github", "url": "https://github.com/sponsors/ai" @@ -16494,30 +16806,12 @@ ], "license": "MIT", "dependencies": { - "lilconfig": "^3.1.1" + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" }, "engines": { - "node": ">= 18" - }, - "peerDependencies": { - "jiti": ">=1.21.0", - "postcss": ">=8.0.9", - "tsx": "^4.8.1", - "yaml": "^2.4.2" - }, - "peerDependenciesMeta": { - "jiti": { - "optional": true - }, - "postcss": { - "optional": true - }, - "tsx": { - "optional": true - }, - "yaml": { - "optional": true - } + "node": "^10 || ^12 || >=14" } }, "node_modules/prelude-ls": { @@ -16725,6 +17019,22 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/quansync": { + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/quansync/-/quansync-0.2.11.tgz", + "integrity": "sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/antfu" + }, + { + "type": "individual", + "url": "https://github.com/sponsors/sxzz" + } + ], + "license": "MIT" + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -16890,20 +17200,6 @@ "safe-buffer": "~5.1.0" } }, - "node_modules/readdirp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", - "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14.18.0" - }, - "funding": { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/regenerate": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", @@ -17130,7 +17426,6 @@ "version": "4.52.2", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.52.2.tgz", "integrity": "sha512-I25/2QgoROE1vYV+NQ1En9T9UFB9Cmfm2CJ83zZOlaDpvz29wGQSZXWKw7MiNXau7wYgB/T9fVIdIuEQ+KbiiA==", - "dev": true, "license": "MIT", "dependencies": { "@types/estree": "1.0.8" @@ -17275,9 +17570,9 @@ "peer": true }, "node_modules/semantic-release": { - "version": "25.0.2", - "resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-25.0.2.tgz", - "integrity": "sha512-6qGjWccl5yoyugHt3jTgztJ9Y0JVzyH8/Voc/D8PlLat9pwxQYXz7W1Dpnq5h0/G5GCYGUaDSlYcyk3AMh5A6g==", + "version": "25.0.3", + "resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-25.0.3.tgz", + "integrity": "sha512-WRgl5GcypwramYX4HV+eQGzUbD7UUbljVmS+5G1uMwX/wLgYuJAxGeerXJDMO2xshng4+FXqCgyB5QfClV6WjA==", "dev": true, "license": "MIT", "dependencies": { @@ -17307,7 +17602,6 @@ "read-package-up": "^12.0.0", "resolve-from": "^5.0.0", "semver": "^7.3.2", - "semver-diff": "^5.0.0", "signale": "^1.2.1", "yargs": "^18.0.0" }, @@ -17755,40 +18049,10 @@ "semver": "bin/semver.js" } }, - "node_modules/semver-diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-5.0.0.tgz", - "integrity": "sha512-0HbGtOm+S7T6NGQ/pxJSJipJvc4DK3FcRVMRkhsIwJDJ4Jcz5DQC1cPPzB5GhzyHjwttW878HaWQq46CkL3cqg==", - "deprecated": "Deprecated as the semver package now supports this built-in.", - "dev": true, - "license": "MIT", - "dependencies": { - "semver": "^7.3.5" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/semver-diff/node_modules/semver": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", - "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/semver-regex": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-4.0.5.tgz", - "integrity": "sha512-hunMQrEy1T6Jr2uEVjrAIqjwWcQTgOAcIM52C8MY1EZSD3DDNft04XzvYKPqjED65bNVVko0YI38nYeEHCX3yw==", + "node_modules/semver-regex": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-4.0.5.tgz", + "integrity": "sha512-hunMQrEy1T6Jr2uEVjrAIqjwWcQTgOAcIM52C8MY1EZSD3DDNft04XzvYKPqjED65bNVVko0YI38nYeEHCX3yw==", "dev": true, "license": "MIT", "engines": { @@ -18078,6 +18342,15 @@ "node": ">=0.10.0" } }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/source-map-support": { "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", @@ -18253,6 +18526,15 @@ "safe-buffer": "~5.2.0" } }, + "node_modules/string-argv": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", + "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", + "license": "MIT", + "engines": { + "node": ">=0.6.19" + } + }, "node_modules/string-length": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", @@ -18307,52 +18589,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/string-width-cjs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/strip-ansi": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", @@ -18368,30 +18604,6 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", @@ -18425,7 +18637,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -18434,39 +18645,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/sucrase": { - "version": "3.35.0", - "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.0.tgz", - "integrity": "sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.2", - "commander": "^4.0.0", - "glob": "^10.3.10", - "lines-and-columns": "^1.1.6", - "mz": "^2.7.0", - "pirates": "^4.0.1", - "ts-interface-checker": "^0.1.9" - }, - "bin": { - "sucrase": "bin/sucrase", - "sucrase-node": "bin/sucrase-node" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/sucrase/node_modules/commander": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", - "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 6" - } - }, "node_modules/super-regex": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/super-regex/-/super-regex-1.1.0.tgz", @@ -18819,7 +18997,6 @@ "version": "0.2.15", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", - "dev": true, "license": "MIT", "dependencies": { "fdir": "^6.5.0", @@ -18836,7 +19013,6 @@ "version": "6.5.0", "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", - "dev": true, "license": "MIT", "engines": { "node": ">=12.0.0" @@ -18854,7 +19030,6 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", - "dev": true, "license": "MIT", "engines": { "node": ">=12" @@ -18912,26 +19087,6 @@ "node": ">=8.0" } }, - "node_modules/tr46": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "integrity": "sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==", - "dev": true, - "license": "MIT", - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/tr46/node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/traverse": { "version": "0.6.8", "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.8.tgz", @@ -18945,16 +19100,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tree-kill": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", - "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", - "dev": true, - "license": "MIT", - "bin": { - "tree-kill": "cli.js" - } - }, "node_modules/ts-api-utils": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", @@ -18968,13 +19113,6 @@ "typescript": ">=4.8.4" } }, - "node_modules/ts-interface-checker": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", - "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", - "dev": true, - "license": "Apache-2.0" - }, "node_modules/ts-jest": { "version": "29.4.4", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.4.tgz", @@ -19164,80 +19302,6 @@ "devOptional": true, "license": "0BSD" }, - "node_modules/tsup": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/tsup/-/tsup-8.5.0.tgz", - "integrity": "sha512-VmBp77lWNQq6PfuMqCHD3xWl22vEoWsKajkF8t+yMBawlUS8JzEI+vOVMeuNZIuMML8qXRizFKi9oD5glKQVcQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "bundle-require": "^5.1.0", - "cac": "^6.7.14", - "chokidar": "^4.0.3", - "consola": "^3.4.0", - "debug": "^4.4.0", - "esbuild": "^0.25.0", - "fix-dts-default-cjs-exports": "^1.0.0", - "joycon": "^3.1.1", - "picocolors": "^1.1.1", - "postcss-load-config": "^6.0.1", - "resolve-from": "^5.0.0", - "rollup": "^4.34.8", - "source-map": "0.8.0-beta.0", - "sucrase": "^3.35.0", - "tinyexec": "^0.3.2", - "tinyglobby": "^0.2.11", - "tree-kill": "^1.2.2" - }, - "bin": { - "tsup": "dist/cli-default.js", - "tsup-node": "dist/cli-node.js" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@microsoft/api-extractor": "^7.36.0", - "@swc/core": "^1", - "postcss": "^8.4.12", - "typescript": ">=4.5.0" - }, - "peerDependenciesMeta": { - "@microsoft/api-extractor": { - "optional": true - }, - "@swc/core": { - "optional": true - }, - "postcss": { - "optional": true - }, - "typescript": { - "optional": true - } - } - }, - "node_modules/tsup/node_modules/source-map": { - "version": "0.8.0-beta.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", - "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==", - "deprecated": "The work that was done in this beta branch won't be included in future versions", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "whatwg-url": "^7.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/tsup/node_modules/tinyexec": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", - "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", - "dev": true, - "license": "MIT" - }, "node_modules/tunnel": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", @@ -19519,7 +19583,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, "license": "MIT", "engines": { "node": ">= 10.0.0" @@ -19559,7 +19622,6 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" @@ -19569,7 +19631,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -19650,38 +19711,630 @@ "spdx-expression-parse": "^3.0.0" } }, - "node_modules/vm-browserify": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", - "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", - "license": "MIT" - }, - "node_modules/walker": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", - "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "makeerror": "1.0.12" - } - }, - "node_modules/watchpack": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.4.tgz", - "integrity": "sha512-c5EGNOiyxxV5qmTtAB7rbiXxi1ooX1pQKMLX/MIabJjRA0SJBQOjKF+KSVfHkr9U1cADPon0mRiVe/riyaiDUA==", + "node_modules/vite": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.1.tgz", + "integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==", "license": "MIT", "dependencies": { - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.1.2" + "esbuild": "^0.27.0", + "fdir": "^6.5.0", + "picomatch": "^4.0.3", + "postcss": "^8.5.6", + "rollup": "^4.43.0", + "tinyglobby": "^0.2.15" + }, + "bin": { + "vite": "bin/vite.js" }, "engines": { - "node": ">=10.13.0" + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "lightningcss": "^1.21.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } } }, - "node_modules/web-worker": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/web-worker/-/web-worker-1.2.0.tgz", + "node_modules/vite-plugin-dts": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/vite-plugin-dts/-/vite-plugin-dts-4.5.4.tgz", + "integrity": "sha512-d4sOM8M/8z7vRXHHq/ebbblfaxENjogAAekcfcDCCwAyvGqnPrc7f4NZbvItS+g4WTgerW0xDwSz5qz11JT3vg==", + "license": "MIT", + "dependencies": { + "@microsoft/api-extractor": "^7.50.1", + "@rollup/pluginutils": "^5.1.4", + "@volar/typescript": "^2.4.11", + "@vue/language-core": "2.2.0", + "compare-versions": "^6.1.1", + "debug": "^4.4.0", + "kolorist": "^1.8.0", + "local-pkg": "^1.0.0", + "magic-string": "^0.30.17" + }, + "peerDependencies": { + "typescript": "*", + "vite": "*" + }, + "peerDependenciesMeta": { + "vite": { + "optional": true + } + } + }, + "node_modules/vite/node_modules/@esbuild/aix-ppc64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.2.tgz", + "integrity": "sha512-GZMB+a0mOMZs4MpDbj8RJp4cw+w1WV5NYD6xzgvzUJ5Ek2jerwfO2eADyI6ExDSUED+1X8aMbegahsJi+8mgpw==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/android-arm": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.2.tgz", + "integrity": "sha512-DVNI8jlPa7Ujbr1yjU2PfUSRtAUZPG9I1RwW4F4xFB1Imiu2on0ADiI/c3td+KmDtVKNbi+nffGDQMfcIMkwIA==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/android-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.2.tgz", + "integrity": "sha512-pvz8ZZ7ot/RBphf8fv60ljmaoydPU12VuXHImtAs0XhLLw+EXBi2BLe3OYSBslR4rryHvweW5gmkKFwTiFy6KA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/android-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.2.tgz", + "integrity": "sha512-z8Ank4Byh4TJJOh4wpz8g2vDy75zFL0TlZlkUkEwYXuPSgX8yzep596n6mT7905kA9uHZsf/o2OJZubl2l3M7A==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/darwin-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.2.tgz", + "integrity": "sha512-davCD2Zc80nzDVRwXTcQP/28fiJbcOwvdolL0sOiOsbwBa72kegmVU0Wrh1MYrbuCL98Omp5dVhQFWRKR2ZAlg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/darwin-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.2.tgz", + "integrity": "sha512-ZxtijOmlQCBWGwbVmwOF/UCzuGIbUkqB1faQRf5akQmxRJ1ujusWsb3CVfk/9iZKr2L5SMU5wPBi1UWbvL+VQA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/freebsd-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.2.tgz", + "integrity": "sha512-lS/9CN+rgqQ9czogxlMcBMGd+l8Q3Nj1MFQwBZJyoEKI50XGxwuzznYdwcav6lpOGv5BqaZXqvBSiB/kJ5op+g==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/freebsd-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.2.tgz", + "integrity": "sha512-tAfqtNYb4YgPnJlEFu4c212HYjQWSO/w/h/lQaBK7RbwGIkBOuNKQI9tqWzx7Wtp7bTPaGC6MJvWI608P3wXYA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-arm": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.2.tgz", + "integrity": "sha512-vWfq4GaIMP9AIe4yj1ZUW18RDhx6EPQKjwe7n8BbIecFtCQG4CfHGaHuh7fdfq+y3LIA2vGS/o9ZBGVxIDi9hw==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.2.tgz", + "integrity": "sha512-hYxN8pr66NsCCiRFkHUAsxylNOcAQaxSSkHMMjcpx0si13t1LHFphxJZUiGwojB1a/Hd5OiPIqDdXONia6bhTw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-ia32": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.2.tgz", + "integrity": "sha512-MJt5BRRSScPDwG2hLelYhAAKh9imjHK5+NE/tvnRLbIqUWa+0E9N4WNMjmp/kXXPHZGqPLxggwVhz7QP8CTR8w==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-loong64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.2.tgz", + "integrity": "sha512-lugyF1atnAT463aO6KPshVCJK5NgRnU4yb3FUumyVz+cGvZbontBgzeGFO1nF+dPueHD367a2ZXe1NtUkAjOtg==", + "cpu": [ + "loong64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-mips64el": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.2.tgz", + "integrity": "sha512-nlP2I6ArEBewvJ2gjrrkESEZkB5mIoaTswuqNFRv/WYd+ATtUpe9Y09RnJvgvdag7he0OWgEZWhviS1OTOKixw==", + "cpu": [ + "mips64el" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-ppc64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.2.tgz", + "integrity": "sha512-C92gnpey7tUQONqg1n6dKVbx3vphKtTHJaNG2Ok9lGwbZil6DrfyecMsp9CrmXGQJmZ7iiVXvvZH6Ml5hL6XdQ==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-riscv64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.2.tgz", + "integrity": "sha512-B5BOmojNtUyN8AXlK0QJyvjEZkWwy/FKvakkTDCziX95AowLZKR6aCDhG7LeF7uMCXEJqwa8Bejz5LTPYm8AvA==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-s390x": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.2.tgz", + "integrity": "sha512-p4bm9+wsPwup5Z8f4EpfN63qNagQ47Ua2znaqGH6bqLlmJ4bx97Y9JdqxgGZ6Y8xVTixUnEkoKSHcpRlDnNr5w==", + "cpu": [ + "s390x" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.2.tgz", + "integrity": "sha512-uwp2Tip5aPmH+NRUwTcfLb+W32WXjpFejTIOWZFw/v7/KnpCDKG66u4DLcurQpiYTiYwQ9B7KOeMJvLCu/OvbA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.2.tgz", + "integrity": "sha512-Kj6DiBlwXrPsCRDeRvGAUb/LNrBASrfqAIok+xB0LxK8CHqxZ037viF13ugfsIpePH93mX7xfJp97cyDuTZ3cw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/netbsd-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.2.tgz", + "integrity": "sha512-HwGDZ0VLVBY3Y+Nw0JexZy9o/nUAWq9MlV7cahpaXKW6TOzfVno3y3/M8Ga8u8Yr7GldLOov27xiCnqRZf0tCA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.2.tgz", + "integrity": "sha512-DNIHH2BPQ5551A7oSHD0CKbwIA/Ox7+78/AWkbS5QoRzaqlev2uFayfSxq68EkonB+IKjiuxBFoV8ESJy8bOHA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/openbsd-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.2.tgz", + "integrity": "sha512-/it7w9Nb7+0KFIzjalNJVR5bOzA9Vay+yIPLVHfIQYG/j+j9VTH84aNB8ExGKPU4AzfaEvN9/V4HV+F+vo8OEg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.2.tgz", + "integrity": "sha512-LRBbCmiU51IXfeXk59csuX/aSaToeG7w48nMwA6049Y4J4+VbWALAuXcs+qcD04rHDuSCSRKdmY63sruDS5qag==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/sunos-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.2.tgz", + "integrity": "sha512-kMtx1yqJHTmqaqHPAzKCAkDaKsffmXkPHThSfRwZGyuqyIeBvf08KSsYXl+abf5HDAPMJIPnbBfXvP2ZC2TfHg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/win32-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.2.tgz", + "integrity": "sha512-Yaf78O/B3Kkh+nKABUF++bvJv5Ijoy9AN1ww904rOXZFLWVc5OLOfL56W+C8F9xn5JQZa3UX6m+IktJnIb1Jjg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/win32-ia32": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.2.tgz", + "integrity": "sha512-Iuws0kxo4yusk7sw70Xa2E2imZU5HoixzxfGCdxwBdhiDgt9vX9VUCBhqcwY7/uh//78A1hMkkROMJq9l27oLQ==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/win32-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.2.tgz", + "integrity": "sha512-sRdU18mcKf7F+YgheI/zGf5alZatMUTKj/jNS6l744f9u3WFu4v7twcUI9vu4mknF4Y9aDlblIie0IM+5xxaqQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/esbuild": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.2.tgz", + "integrity": "sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw==", + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.27.2", + "@esbuild/android-arm": "0.27.2", + "@esbuild/android-arm64": "0.27.2", + "@esbuild/android-x64": "0.27.2", + "@esbuild/darwin-arm64": "0.27.2", + "@esbuild/darwin-x64": "0.27.2", + "@esbuild/freebsd-arm64": "0.27.2", + "@esbuild/freebsd-x64": "0.27.2", + "@esbuild/linux-arm": "0.27.2", + "@esbuild/linux-arm64": "0.27.2", + "@esbuild/linux-ia32": "0.27.2", + "@esbuild/linux-loong64": "0.27.2", + "@esbuild/linux-mips64el": "0.27.2", + "@esbuild/linux-ppc64": "0.27.2", + "@esbuild/linux-riscv64": "0.27.2", + "@esbuild/linux-s390x": "0.27.2", + "@esbuild/linux-x64": "0.27.2", + "@esbuild/netbsd-arm64": "0.27.2", + "@esbuild/netbsd-x64": "0.27.2", + "@esbuild/openbsd-arm64": "0.27.2", + "@esbuild/openbsd-x64": "0.27.2", + "@esbuild/openharmony-arm64": "0.27.2", + "@esbuild/sunos-x64": "0.27.2", + "@esbuild/win32-arm64": "0.27.2", + "@esbuild/win32-ia32": "0.27.2", + "@esbuild/win32-x64": "0.27.2" + } + }, + "node_modules/vite/node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/vite/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/vm-browserify": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", + "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", + "license": "MIT" + }, + "node_modules/vscode-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.1.0.tgz", + "integrity": "sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==", + "license": "MIT" + }, + "node_modules/walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "makeerror": "1.0.12" + } + }, + "node_modules/watchpack": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.4.tgz", + "integrity": "sha512-c5EGNOiyxxV5qmTtAB7rbiXxi1ooX1pQKMLX/MIabJjRA0SJBQOjKF+KSVfHkr9U1cADPon0mRiVe/riyaiDUA==", + "license": "MIT", + "dependencies": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/web-worker": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/web-worker/-/web-worker-1.2.0.tgz", "integrity": "sha512-PgF341avzqyx60neE9DD+XS26MMNMoUQRz9NOZwW32nPQrF6p77f1htcnjBSEV8BGMKZ16choqUG4hyI0Hx7mA==", "dev": true, "license": "Apache-2.0" @@ -19700,13 +20353,6 @@ "tslib": "^2.7.0" } }, - "node_modules/webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", - "dev": true, - "license": "BSD-2-Clause" - }, "node_modules/webpack": { "version": "5.101.3", "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.101.3.tgz", @@ -19807,18 +20453,6 @@ "node": ">= 0.6" } }, - "node_modules/whatwg-url": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", - "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", - "dev": true, - "license": "MIT", - "dependencies": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -19873,129 +20507,6 @@ "dev": true, "license": "MIT" }, - "node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs": { - "name": "wrap-ansi", - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/wrap-ansi-cjs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true, - "license": "MIT" - }, - "node_modules/wrap-ansi/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -20381,6 +20892,14 @@ "@types/signale": "^1.4.7" } }, + "packages/vite-config": { + "name": "@lib/vite-config", + "version": "1.0.0", + "peerDependencies": { + "vite": "^7.3.1", + "vite-plugin-dts": "^4.5.4" + } + }, "packages/wasm-image-processor": { "name": "@lib/wasm-image-processor", "version": "1.0.0", @@ -20388,8 +20907,7 @@ "devDependencies": { "@types/jest": "^29.5.12", "jest": "^29.7.0", - "ts-jest": "^29.1.2", - "tsup": "^8.0.2" + "ts-jest": "^29.1.2" } } } diff --git a/package.json b/package.json index 259ab9f7..243c6ea0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "azion", - "version": "3.0.0", + "version": "3.1.0-stage.7", "description": "Azion Packages for Edge Computing.", "scripts": { "prepare": "husky", @@ -64,10 +64,11 @@ "globals": "^16.4.0", "husky": "^9.1.7", "prettier": "^3.6.2", - "semantic-release": "^25.0.2", - "tsup": "^8.5.0", + "semantic-release": "^25.0.3", "typescript": "^5.5.3", - "typescript-eslint": "^8.44.1" + "typescript-eslint": "^8.44.1", + "vite": "^7.3.1", + "vite-plugin-dts": "^4.5.4" }, "workspaces": [ "packages/*" @@ -85,91 +86,112 @@ ], "exports": { ".": { - "require": "./packages/client/dist/index.js", + "types": "./packages/client/dist/index.d.ts", + "require": "./packages/client/dist/index.cjs", "import": "./packages/client/dist/index.mjs" }, "./presets": { + "types": "./packages/presets/dist/index.d.ts", "require": "./packages/presets/dist/index.cjs", - "import": "./packages/presets/dist/index.js" + "import": "./packages/presets/dist/index.mjs" }, "./presets/preset/*": "./packages/presets/dist/presets/*", "./preset/nuxt/*": "./packages/presets/src/presets/nuxt/nitro/*/index.js", "./preset/sveltekit": "./packages/presets/src/presets/svelte/kit/index.js", "./preset/sveltekit/cache": "./packages/presets/src/presets/svelte/kit/cache/index.js", "./bundler": { + "types": "./packages/bundler/dist/index.d.ts", "require": "./packages/bundler/dist/index.cjs", - "import": "./packages/bundler/dist/index.js" + "import": "./packages/bundler/dist/index.mjs" }, "./bundler/polyfills": { + "types": "./packages/bundler/src/polyfills/index.d.ts", "import": "./packages/bundler/src/polyfills/index.js" }, "./unenv-preset": { - "require": "./packages/unenv-preset/dist/index.js", + "types": "./packages/unenv-preset/dist/index.d.ts", + "require": "./packages/unenv-preset/dist/index.cjs", "import": "./packages/unenv-preset/dist/index.mjs" }, "./unenv-preset/polyfills/*": "./packages/unenv-preset/src/polyfills/*", "./ai": { - "require": "./packages/ai/dist/index.js", + "types": "./packages/ai/dist/index.d.ts", + "require": "./packages/ai/dist/index.cjs", "import": "./packages/ai/dist/index.mjs" }, "./applications": { - "require": "./packages/applications/dist/index.js", + "types": "./packages/applications/dist/index.d.ts", + "require": "./packages/applications/dist/index.cjs", "import": "./packages/applications/dist/index.mjs" }, "./types": { - "require": "./packages/types/dist/index.js", + "types": "./packages/types/dist/index.d.ts", + "require": "./packages/types/dist/index.cjs", "import": "./packages/types/dist/index.mjs" }, "./config": { - "require": "./packages/config/dist/index.js", + "types": "./packages/config/dist/index.d.ts", + "require": "./packages/config/dist/index.cjs", "import": "./packages/config/dist/index.mjs" }, "./config/rules": { - "require": "./packages/config/dist/rules/index.js", - "import": "./packages/config/dist/rules/index.mjs" + "types": "./packages/config/dist/rules.d.ts", + "require": "./packages/config/dist/rules.cjs", + "import": "./packages/config/dist/rules.mjs" }, "./sql": { - "require": "./packages/sql/dist/index.js", + "types": "./packages/sql/dist/index.d.ts", + "require": "./packages/sql/dist/index.cjs", "import": "./packages/sql/dist/index.mjs" }, "./storage": { - "require": "./packages/storage/dist/index.js", + "types": "./packages/storage/dist/index.d.ts", + "require": "./packages/storage/dist/index.cjs", "import": "./packages/storage/dist/index.mjs" }, "./cookies": { - "require": "./packages/cookies/dist/index.js", + "types": "./packages/cookies/dist/index.d.ts", + "require": "./packages/cookies/dist/index.cjs", "import": "./packages/cookies/dist/index.mjs" }, "./jwt": { - "require": "./packages/jwt/dist/index.js", + "types": "./packages/jwt/dist/index.d.ts", + "require": "./packages/jwt/dist/index.cjs", "import": "./packages/jwt/dist/index.mjs" }, "./purge": { - "require": "./packages/purge/dist/index.js", + "types": "./packages/purge/dist/index.d.ts", + "require": "./packages/purge/dist/index.cjs", "import": "./packages/purge/dist/index.mjs" }, "./router": { - "require": "./packages/router/dist/index.js", + "types": "./packages/router/dist/index.d.ts", + "require": "./packages/router/dist/index.cjs", "import": "./packages/router/dist/index.mjs" }, "./wasm-image-processor": { - "require": "./packages/wasm-image-processor/dist/index.js", + "types": "./packages/wasm-image-processor/dist/index.d.ts", + "require": "./packages/wasm-image-processor/dist/index.cjs", "import": "./packages/wasm-image-processor/dist/index.mjs" }, "./utils": { + "types": "./packages/utils/dist/index.d.ts", "require": "./packages/utils/dist/index.cjs", - "import": "./packages/utils/dist/index.js" + "import": "./packages/utils/dist/index.mjs" }, "./utils/edge": { - "require": "./packages/utils/dist/edge/index.cjs", - "import": "./packages/utils/dist/edge/index.js" + "types": "./packages/utils/dist/edge.d.ts", + "require": "./packages/utils/dist/edge.cjs", + "import": "./packages/utils/dist/edge.mjs" }, "./utils/node": { - "require": "./packages/utils/dist/node/index.cjs", - "import": "./packages/utils/dist/node/index.js" + "types": "./packages/utils/dist/node.d.ts", + "require": "./packages/utils/dist/node.cjs", + "import": "./packages/utils/dist/node.mjs" }, "./domains": { - "require": "./packages/domains/dist/index.js", + "types": "./packages/domains/dist/index.d.ts", + "require": "./packages/domains/dist/index.cjs", "import": "./packages/domains/dist/index.mjs" } }, @@ -182,7 +204,7 @@ "./packages/config/dist/index.d.ts" ], "config/rules": [ - "./packages/config/dist/rules/index.d.ts" + "./packages/config/dist/rules.d.ts" ], "presets": [ "./packages/presets/dist/index.d.ts" @@ -233,10 +255,10 @@ "./packages/domains/dist/index.d.ts" ], "utils/edge": [ - "./packages/utils/dist/edge/index.d.ts" + "./packages/utils/dist/edge.d.ts" ], "utils/node": [ - "./packages/utils/dist/node/index.d.ts" + "./packages/utils/dist/node.d.ts" ] } }, diff --git a/packages/ai/package.json b/packages/ai/package.json index 9f0640c0..0b3399b3 100644 --- a/packages/ai/package.json +++ b/packages/ai/package.json @@ -2,17 +2,18 @@ "name": "@azion/ai", "version": "1.0.0", "description": "Azion AI client for interacting with Copilot API", - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", "exports": { ".": { - "require": "./dist/index.js", + "types": "./dist/index.d.ts", + "require": "./dist/index.cjs", "import": "./dist/index.mjs" } }, "scripts": { - "compile": "tsup --config ../../tsup.config.json", + "compile": "vite build", "lint": "eslint .", "lint:fix": "eslint --fix .", "prettier": "prettier --write .", diff --git a/packages/ai/vite.config.mjs b/packages/ai/vite.config.mjs new file mode 100644 index 00000000..dddbb7ff --- /dev/null +++ b/packages/ai/vite.config.mjs @@ -0,0 +1,5 @@ +import { createViteConfig } from '@lib/vite-config'; + +export default createViteConfig({ + dirname: __dirname, +}); diff --git a/packages/applications/package.json b/packages/applications/package.json index 6ec46a9b..5af15c38 100644 --- a/packages/applications/package.json +++ b/packages/applications/package.json @@ -2,18 +2,19 @@ "name": "@lib/application", "version": "1.0.0", "description": "", - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", "scripts": { - "compile": "tsup --config ../../tsup.config.json", + "compile": "vite build", "lint": "eslint .", "lint:fix": "eslint --fix .", "prettier": "prettier --write ." }, "exports": { ".": { - "require": "./dist/index.js", + "types": "./dist/index.d.ts", + "require": "./dist/index.cjs", "import": "./dist/index.mjs" } }, diff --git a/packages/applications/src/cache-settings/types.ts b/packages/applications/src/cache-settings/types.ts index a45920c5..946a84d8 100644 --- a/packages/applications/src/cache-settings/types.ts +++ b/packages/applications/src/cache-settings/types.ts @@ -1,4 +1,4 @@ -import { +import type { ApiBaseCacheSettingPayload, ApiCacheSetting, ApiListCacheSettingsParams, @@ -7,4 +7,4 @@ import { export type AzionCacheSetting = ApiCacheSetting; -export { ApiBaseCacheSettingPayload, ApiListCacheSettingsParams, ApiUpdateCacheSettingPayload }; +export type { ApiBaseCacheSettingPayload, ApiListCacheSettingsParams, ApiUpdateCacheSettingPayload }; diff --git a/packages/applications/src/functions-instances/types.ts b/packages/applications/src/functions-instances/types.ts index cb3a8536..c58ab886 100644 --- a/packages/applications/src/functions-instances/types.ts +++ b/packages/applications/src/functions-instances/types.ts @@ -1,4 +1,4 @@ -import { +import type { ApiBaseFunctionInstancePayload, ApiFunctionInstance, ApiListFunctionInstancesParams, @@ -7,4 +7,4 @@ import { export type AzionFunctionInstance = ApiFunctionInstance; -export { ApiBaseFunctionInstancePayload, ApiListFunctionInstancesParams, ApiUpdateFunctionInstancePayload }; +export type { ApiBaseFunctionInstancePayload, ApiListFunctionInstancesParams, ApiUpdateFunctionInstancePayload }; diff --git a/packages/applications/src/main-settings/types.ts b/packages/applications/src/main-settings/types.ts index 69aeba2b..29c18cf1 100644 --- a/packages/applications/src/main-settings/types.ts +++ b/packages/applications/src/main-settings/types.ts @@ -1,4 +1,4 @@ -import { +import type { ApiApplication, ApiBaseApplicationPayload, ApiListApplicationsParams, @@ -12,7 +12,7 @@ import { export type AzionApplicationSettings = ApiApplication; -export { +export type { ApiBaseApplicationPayload, ApiListApplicationsParams, ApiUpdateApplicationPayload, diff --git a/packages/applications/src/origins/types.ts b/packages/applications/src/origins/types.ts index 22c76e9a..81e161cd 100644 --- a/packages/applications/src/origins/types.ts +++ b/packages/applications/src/origins/types.ts @@ -2,4 +2,4 @@ import { ApiOrigin } from './services/types'; export type AzionOrigin = ApiOrigin; -export { ApiCreateOriginPayload, ApiListOriginsParams, ApiUpdateOriginRequest } from './services/types'; +export type { ApiCreateOriginPayload, ApiListOriginsParams, ApiUpdateOriginRequest } from './services/types'; diff --git a/packages/applications/src/rules-engine/types.ts b/packages/applications/src/rules-engine/types.ts index df114134..8f1b744b 100644 --- a/packages/applications/src/rules-engine/types.ts +++ b/packages/applications/src/rules-engine/types.ts @@ -2,4 +2,4 @@ import { ApiRuleResponse } from './services/types'; export type AzionRule = ApiRuleResponse['results']; -export { ApiCreateRulePayload, ApiListRulesParams, ApiUpdateRulePayload } from './services/types'; +export type { ApiCreateRulePayload, ApiListRulesParams, ApiUpdateRulePayload } from './services/types'; diff --git a/packages/applications/vite.config.mjs b/packages/applications/vite.config.mjs new file mode 100644 index 00000000..dddbb7ff --- /dev/null +++ b/packages/applications/vite.config.mjs @@ -0,0 +1,5 @@ +import { createViteConfig } from '@lib/vite-config'; + +export default createViteConfig({ + dirname: __dirname, +}); diff --git a/packages/bundler/package.json b/packages/bundler/package.json index 07245ecc..857da432 100644 --- a/packages/bundler/package.json +++ b/packages/bundler/package.json @@ -2,11 +2,12 @@ "name": "@lib/bundler", "version": "1.0.0", "description": "", - "main": "./dist/index.js", + "main": "./dist/index.cjs", + "module": "./dist/index.mjs", "types": "./dist/index.d.ts", "type": "module", "scripts": { - "compile": "tsup --config ./tsup.config.json", + "compile": "vite build", "lint": "eslint .", "lint:fix": "eslint --fix .", "prettier": "prettier --write .", @@ -15,10 +16,14 @@ }, "exports": { ".": { + "types": "./dist/index.d.ts", "require": "./dist/index.cjs", - "import": "./dist/index.js" + "import": "./dist/index.mjs" }, - "./polyfills": "./src/polyfills/index.js" + "./polyfills": { + "types": "./src/polyfills/index.d.ts", + "import": "./src/polyfills/index.js" + } }, "author": "aziontech", "license": "MIT", diff --git a/packages/bundler/src/helpers/azion-local-polyfills.ts b/packages/bundler/src/helpers/azion-local-polyfills.ts index d5dd149c..ab0f05b3 100644 --- a/packages/bundler/src/helpers/azion-local-polyfills.ts +++ b/packages/bundler/src/helpers/azion-local-polyfills.ts @@ -14,5 +14,6 @@ export default { ['Azion.env', `${externalPolyfillsPath}/env-vars/env-vars.polyfills.js`], ['Azion.networkList', `${externalPolyfillsPath}/network-list/network-list.polyfills.js`], ['Azion.Storage', `${externalPolyfillsPath}/storage/storage.polyfills.js`], + ['Azion.KV', `${externalPolyfillsPath}/kv/kv.polyfills.js`], ]), }; diff --git a/packages/bundler/src/polyfills/azion/kv/context/index.js b/packages/bundler/src/polyfills/azion/kv/context/index.js new file mode 100644 index 00000000..e1968ea6 --- /dev/null +++ b/packages/bundler/src/polyfills/azion/kv/context/index.js @@ -0,0 +1,3 @@ +import KVContext from './kv.context.js'; + +export default { KVContext }; diff --git a/packages/bundler/src/polyfills/azion/kv/context/kv.context.js b/packages/bundler/src/polyfills/azion/kv/context/kv.context.js new file mode 100644 index 00000000..b85e2315 --- /dev/null +++ b/packages/bundler/src/polyfills/azion/kv/context/kv.context.js @@ -0,0 +1,149 @@ +import fs from 'fs'; +import path from 'path'; +import { Readable } from 'stream'; + +// KVContext Simulate KV Storage API with file system + +class KVContext { + #pathKV; + #metadataPrefix; + + constructor(kvName, pathKV) { + this.kvName = kvName; + this.#pathKV = pathKV || `.edge/kv/${kvName}`; + this.#metadataPrefix = `.metadata-${kvName}.json`; + } + + // eslint-disable-next-line @typescript-eslint/no-unused-vars + async get(key, returnType = 'text', options = {}) { + try { + const item = await fs.promises.readFile(`${this.#pathKV}/${key}`); + const metadata = await KVContext.getMetadata(this.#pathKV, key, this.#metadataPrefix); + + if (metadata?.expiration) { + const now = Math.floor(Date.now() / 1000); + if (now >= metadata.expiration) { + await this.delete(key); + return { value: null, metadata: null }; + } + } + + return { + value: await this.#convertValue(item, returnType), + metadata: metadata?.metadata || null, + }; + } catch { + return { value: null, metadata: null }; + } + } + + async getMultiple(keys, returnType = 'text', options = {}) { + const results = new Map(); + + for (const key of keys) { + const result = await this.get(key, returnType, options); + results.set(key, result); + } + + return results; + } + + async put(key, value, options = {}) { + const prefix = path.dirname(key); + await fs.promises.mkdir(`${this.#pathKV}/${prefix}`, { + recursive: true, + }); + + let fileContent; + if (value instanceof ReadableStream) { + const reader = value.getReader(); + const chunks = []; + while (true) { + const { done, value: chunk } = await reader.read(); + if (done) break; + chunks.push(chunk); + } + fileContent = Buffer.concat(chunks); + } else if (value instanceof ArrayBuffer) { + fileContent = Buffer.from(value); + } else if (typeof value === 'object') { + fileContent = JSON.stringify(value); + } else { + fileContent = String(value); + } + + await fs.promises.writeFile(`${this.#pathKV}/${key}`, fileContent); + await KVContext.putMetadata(this.#pathKV, key, options, this.#metadataPrefix); + + if (options.expirationTtl) { + setTimeout(async () => { + try { + await this.delete(key); + // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-empty + } catch (error) {} + }, options.expirationTtl * 1000); + } else if (options.expiration) { + const now = Math.floor(Date.now() / 1000); + const ttl = options.expiration - now; + if (ttl > 0) { + setTimeout(async () => { + try { + await this.delete(key); + // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-empty + } catch (error) {} + }, ttl * 1000); + } + } + } + + async delete(key) { + try { + await fs.promises.rm(`${this.#pathKV}/${key}`); + try { + await fs.promises.rm(`${this.#pathKV}/${key}${this.#metadataPrefix}`); + // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-empty + } catch (error) {} + // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-empty + } catch (error) {} + } + + async #convertValue(buffer, returnType) { + switch (returnType) { + case 'json': + return JSON.parse(buffer.toString()); + case 'arrayBuffer': + return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength); + case 'stream': + return Readable.from(buffer); + case 'text': + default: + return buffer.toString(); + } + } + + static async putMetadata(pathKV, key, options, metadataPrefix) { + const bodyMetadata = { + metadata: options?.metadata || null, + expiration: options?.expiration || null, + expirationTtl: options?.expirationTtl || null, + }; + await fs.promises.writeFile(`${pathKV}/${key}${metadataPrefix}`, JSON.stringify(bodyMetadata, undefined, 2)); + return bodyMetadata; + } + + static async getMetadata(pathKV, key, metadataPrefix) { + try { + let data = await fs.promises.readFile(`${pathKV}/${key}${metadataPrefix}`); + data = JSON.parse(data.toString()); + return { + metadata: data?.metadata || null, + expiration: data?.expiration || null, + expirationTtl: data?.expirationTtl || null, + }; + } catch { + return { metadata: null }; + } + } +} + +export default KVContext; diff --git a/packages/bundler/src/polyfills/azion/kv/index.js b/packages/bundler/src/polyfills/azion/kv/index.js new file mode 100644 index 00000000..a28caee3 --- /dev/null +++ b/packages/bundler/src/polyfills/azion/kv/index.js @@ -0,0 +1,4 @@ +import KVContext from './context/kv.context.js'; +import KV from './kv.polyfills.js'; + +export { KV, KVContext }; diff --git a/packages/bundler/src/polyfills/azion/kv/kv.polyfills.js b/packages/bundler/src/polyfills/azion/kv/kv.polyfills.js new file mode 100644 index 00000000..c5a6090e --- /dev/null +++ b/packages/bundler/src/polyfills/azion/kv/kv.polyfills.js @@ -0,0 +1,83 @@ +/* eslint-disable */ + +/** + * KV Storage API Polyfill + * This polyfill is referenced in #build/bundlers/polyfills/polyfills-manager.js + * + * @example + * + * const kv = new KV("mystore"); + * const value = await kv.get("mykey"); + */ + +class KV { + #kvName; + + constructor(kvName) { + if (typeof kvName !== 'string') { + throw new Error('kvName must be a string'); + } + this.#kvName = kvName; + } + + static async open(name) { + if (typeof name !== 'string') { + throw new Error('name must be a string'); + } + return new KV(name); + } + + async get(key, returnType, options) { + if (Array.isArray(key)) { + return this.#getMultiple(key, returnType, options); + } + + const actualReturnType = options?.type || returnType || 'text'; + const result = await new KV_CONTEXT(this.#kvName).get(key, actualReturnType, options); + return result.value; + } + + async getWithMetadata(key, returnType, options) { + if (Array.isArray(key)) { + return this.#getMultipleWithMetadata(key, returnType, options); + } + + const actualReturnType = options?.type || returnType || 'text'; + return await new KV_CONTEXT(this.#kvName).get(key, actualReturnType, options); + } + + async #getMultiple(keys, returnType, options) { + const actualReturnType = options?.type || returnType || 'text'; + const results = await new KV_CONTEXT(this.#kvName).getMultiple(keys, actualReturnType, options); + + const valueMap = new Map(); + for (const [key, result] of results.entries()) { + valueMap.set(key, result.value); + } + return valueMap; + } + + async #getMultipleWithMetadata(keys, returnType, options) { + const actualReturnType = options?.type || returnType || 'text'; + return await new KV_CONTEXT(this.#kvName).getMultiple(keys, actualReturnType, options); + } + + async put(key, value, options) { + if (typeof key !== 'string') { + throw new Error('key must be a string'); + } + return await new KV_CONTEXT(this.#kvName).put(key, value, options || {}); + } + + async delete(key) { + if (typeof key !== 'string') { + throw new Error('key must be a string'); + } + return await new KV_CONTEXT(this.#kvName).delete(key); + } +} + +export default KV; + +globalThis.Azion = globalThis.Azion || {}; +globalThis.Azion.KV = KV; diff --git a/packages/bundler/src/polyfills/index.d.ts b/packages/bundler/src/polyfills/index.d.ts index 7b43519e..7c0b0159 100644 --- a/packages/bundler/src/polyfills/index.d.ts +++ b/packages/bundler/src/polyfills/index.d.ts @@ -14,4 +14,5 @@ declare module 'azion/bundler/polyfills' { export const streamContext: any; export const cryptoContext: any; export const promisesContext: any; + export const KVContext: any; } diff --git a/packages/bundler/src/polyfills/index.js b/packages/bundler/src/polyfills/index.js index 26131e71..1ff4ef23 100644 --- a/packages/bundler/src/polyfills/index.js +++ b/packages/bundler/src/polyfills/index.js @@ -3,6 +3,7 @@ import EnvVarsContext from './azion/env-vars/index.js'; import FetchEventContext from './azion/fetch-event/index.js'; import fetchContext from './azion/fetch/index.js'; import FirewallEventContext from './azion/firewall-event/index.js'; +import { KVContext } from './azion/kv/index.js'; import NetworkListContext from './azion/network-list/index.js'; import { StorageContext } from './azion/storage/index.js'; import cryptoContext from './crypto/index.js'; @@ -20,6 +21,7 @@ export { FetchEventContext, FirewallEventContext, fsContext, + KVContext, NetworkListContext, promisesContext, StorageContext, diff --git a/packages/bundler/tsup.config.json b/packages/bundler/tsup.config.json deleted file mode 100644 index 61cc17b9..00000000 --- a/packages/bundler/tsup.config.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "entry": ["src/index.ts"], - "format": ["cjs", "esm"], - "splitting": true, - "sourcemap": false, - "clean": true, - "bundle": true, - "dts": true, - "minify": true, - "minifyWhitespace": true, - "external": ["signale"] -} diff --git a/packages/bundler/vite.config.mjs b/packages/bundler/vite.config.mjs new file mode 100644 index 00000000..2629cd17 --- /dev/null +++ b/packages/bundler/vite.config.mjs @@ -0,0 +1,40 @@ +import { createViteConfig } from '@lib/vite-config'; +import { resolve } from 'path'; + +export default createViteConfig({ + dirname: __dirname, + ssr: true, + alias: { + 'azion/unenv-preset': resolve(__dirname, '../unenv-preset/src/'), + 'azion/utils/node': resolve(__dirname, '../utils/src/node/'), + }, + external: [ + '@edge-runtime/primitives', + '@fastly/http-compute-js', + '@lib/unenv-preset', + 'accepts', + 'browserify-zlib', + 'dotenv', + 'esbuild', + 'events', + 'inherits', + 'ip-cidr', + 'lodash-es', + 'mime', + 'mime-types', + 'stream-browserify', + 'stream-http', + 'string_decoder', + 'timers-browserify', + 'ts-loader', + 'unenv', + 'url', + 'util', + 'vm-browserify', + 'webpack', + ], + dts: { + exclude: ['src/**/*.test.ts', 'src/polyfills/**/*'], + aliasesExclude: [/^azion\//], + }, +}); diff --git a/packages/client/package.json b/packages/client/package.json index a8197eed..5025fbe8 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -2,18 +2,19 @@ "name": "@lib/client", "version": "1.0.0", "description": "", - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", "scripts": { - "compile": "tsup --config ../../tsup.config.json", + "compile": "vite build", "lint": "eslint .", "lint:fix": "eslint --fix .", "prettier": "prettier --write ." }, "exports": { ".": { - "require": "./dist/index.js", + "types": "./dist/index.d.ts", + "require": "./dist/index.cjs", "import": "./dist/index.mjs" } }, diff --git a/packages/client/src/types.ts b/packages/client/src/types.ts index 6b272528..fa19ea8c 100644 --- a/packages/client/src/types.ts +++ b/packages/client/src/types.ts @@ -1,9 +1,9 @@ +import { AzionAIClient } from 'azion/ai'; +import { AzionApplicationsClient } from 'azion/applications'; import { AzionDomainsClient } from 'azion/domains'; -import { AzionAIClient } from '../../ai/src/types'; -import { AzionApplicationsClient } from '../../applications/src/types'; -import { AzionPurgeClient } from '../../purge/src/types'; -import { AzionClientOptions, AzionSQLClient } from '../../sql/src/types'; -import { AzionStorageClient } from '../../storage/src/types'; +import { AzionPurgeClient } from 'azion/purge'; +import { AzionClientOptions, AzionSQLClient } from 'azion/sql'; +import { AzionStorageClient } from 'azion/storage'; /** * Azion Client interface containing all available service clients. diff --git a/packages/client/vite.config.mjs b/packages/client/vite.config.mjs new file mode 100644 index 00000000..67d2b9d5 --- /dev/null +++ b/packages/client/vite.config.mjs @@ -0,0 +1,21 @@ +import { createViteConfig } from '@lib/vite-config'; +import { resolve } from 'path'; + +export default createViteConfig({ + dirname: __dirname, + ssr: true, + alias: { + 'azion/ai': resolve(__dirname, '../ai/src/'), + 'azion/sql': resolve(__dirname, '../sql/src/'), + 'azion/storage': resolve(__dirname, '../storage/src/'), + 'azion/purge': resolve(__dirname, '../purge/src/'), + 'azion/config': resolve(__dirname, '../config/src/'), + 'azion/domains': resolve(__dirname, '../domains/src/'), + 'azion/applications': resolve(__dirname, '../applications/src/'), + 'azion/types': resolve(__dirname, '../types/src/'), + azion: resolve(__dirname, './src/'), + }, + dts: { + aliasesExclude: [/^azion\//], + }, +}); diff --git a/packages/config/README.md b/packages/config/README.md index 8947b6b6..94d15357 100644 --- a/packages/config/README.md +++ b/packages/config/README.md @@ -28,6 +28,7 @@ This module provides comprehensive configuration and validation for the Azion Pl - [`AzionFirewall`](#azionfirewall) - [`AzionWaf`](#azionwaf) - [`AzionCustomPages`](#azioncustompages) + - [`AzionKV`](#azionkv) ## Installation @@ -359,6 +360,11 @@ const config = defineConfig({ layer: 'cache', }, ], + kv: [ + { + name: 'my-kv', + }, + ], }); ``` @@ -898,3 +904,11 @@ Type definition for individual custom pages. - `ttl?: number` - Time to live (0-31536000 seconds, default: 0). - `uri?: string | null` - URI path (must start with /, max 250 characters). - `customStatusCode?: number | null` - Custom status code (100-599). + +### `AzionKV` + +Type definition for the Key-Value (KV) storage configuration. + +**Properties:** + +- `name: string` - Name of the KV storage (1-255 characters). diff --git a/packages/config/package.json b/packages/config/package.json index 037e7fbb..47261662 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -2,11 +2,11 @@ "name": "@lib/config", "version": "1.0.0", "description": "Azion configuration.", - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", "scripts": { - "compile": "tsup --config ./tsup.config.ts", + "compile": "vite build", "lint": "eslint .", "lint:fix": "eslint --fix .", "prettier": "prettier --write .", @@ -18,12 +18,12 @@ ".": { "types": "./dist/index.d.ts", "require": "./dist/index.cjs", - "import": "./dist/index.js" + "import": "./dist/index.mjs" }, "./rules": { - "types": "./dist/rules/index.d.ts", - "require": "./dist/rules/index.cjs", - "import": "./dist/rules/index.js" + "types": "./dist/rules.d.ts", + "require": "./dist/rules.cjs", + "import": "./dist/rules.mjs" } }, "author": "aziontech", diff --git a/packages/config/src/configProcessor/helpers/azion.config.example.ts b/packages/config/src/configProcessor/helpers/azion.config.example.ts index 5cd9fd39..12887f5c 100644 --- a/packages/config/src/configProcessor/helpers/azion.config.example.ts +++ b/packages/config/src/configProcessor/helpers/azion.config.example.ts @@ -1,21 +1,21 @@ import type { - AzionConfig, - AzionConnector, - CacheByCookie, - CacheByQueryString, - ConnectorDnsResolution, - ConnectorHttpVersionPolicy, - ConnectorTransportPolicy, - ConnectorType, - CustomPageErrorCode, - CustomPageType, - NetworkListType, - WafSensitivity, - WafThreatType, - WorkloadInfrastructure, - WorkloadMTLSVerification, - WorkloadTLSCipher, - WorkloadTLSVersion, + AzionConfig, + AzionConnector, + CacheByCookie, + CacheByQueryString, + ConnectorDnsResolution, + ConnectorHttpVersionPolicy, + ConnectorTransportPolicy, + ConnectorType, + CustomPageErrorCode, + CustomPageType, + NetworkListType, + WafSensitivity, + WafThreatType, + WorkloadInfrastructure, + WorkloadMTLSVerification, + WorkloadTLSCipher, + WorkloadTLSVersion, } from 'azion/config'; const config: AzionConfig = { @@ -487,26 +487,38 @@ const config: AzionConfig = { name: 'rateLimit_Then_Drop', active: true, match: '^/api/sensitive/', - behavior: { - setRateLimit: { - type: 'second', - limitBy: 'clientIp', - averageRateLimit: '10', - maximumBurstSize: '20', + variable: 'request_uri', + behaviors: [ + { + setRateLimit: { + type: 'second', + limitBy: 'clientIp', + averageRateLimit: '10', + maximumBurstSize: '20', + }, }, - }, + ], }, { name: 'customResponse_Only', active: true, - match: '^/custom-error/', - behavior: { - setCustomResponse: { - statusCode: 403, - contentType: 'application/json', - contentBody: '{"error": "Custom error response"}', + criteria: [ + { + variable: 'request_uri', + operator: 'matches', + conditional: 'if', + argument: '^/custom-error/', }, - }, + ], + behaviors: [ + { + setCustomResponse: { + statusCode: 403, + contentType: 'application/json', + contentBody: '{"error": "Custom error response"}', + }, + }, + ], }, ], }, @@ -612,6 +624,11 @@ const config: AzionConfig = { ], }, ], + kv: [ + { + name: 'my-kv', + }, + ], }; export default config; diff --git a/packages/config/src/configProcessor/helpers/schema.ts b/packages/config/src/configProcessor/helpers/schema.ts index d1510ee6..b900b633 100644 --- a/packages/config/src/configProcessor/helpers/schema.ts +++ b/packages/config/src/configProcessor/helpers/schema.ts @@ -13,6 +13,8 @@ import { EDGE_CONNECTOR_TYPES, FIREWALL_RATE_LIMIT_BY, FIREWALL_RATE_LIMIT_TYPES, + FIREWALL_RULE_CONDITIONAL, + FIREWALL_RULE_OPERATORS, FIREWALL_VARIABLES, FIREWALL_WAF_MODES, HEADER_BEHAVIORS, @@ -465,6 +467,163 @@ const schemaStorage = { }, }; +const schemaKV = { + type: 'object', + properties: { + name: { + type: 'string', + minLength: 6, + maxLength: 63, + pattern: '^.{6,63}$', + errorMessage: "The 'name' field must be a string between 6 and 63 characters.", + }, + }, + required: ['name'], + additionalProperties: false, + errorMessage: { + additionalProperties: 'No additional properties are allowed in kv items.', + required: "The 'name' field is required.", + }, +}; + +const firewallRulesBehaviorsSchema = { + type: 'array', + minItems: 1, + maxItems: 10, + items: { + type: 'object', + oneOf: [ + { + properties: { + runFunction: { + type: ['string', 'number'], + errorMessage: "The 'runFunction' behavior must be a string or number", + }, + }, + required: ['runFunction'], + additionalProperties: false, + }, + { + properties: { + setWafRuleset: { + type: 'object', + properties: { + wafMode: { + type: 'string', + enum: FIREWALL_WAF_MODES, + errorMessage: `The wafMode must be one of: ${FIREWALL_WAF_MODES.join(', ')}`, + }, + wafId: { + type: ['string', 'number'], + errorMessage: 'The wafId must be a string or number', + }, + }, + required: ['wafMode', 'wafId'], + additionalProperties: false, + errorMessage: { + additionalProperties: 'No additional properties are allowed in the setWafRuleset object', + required: "Both 'wafMode' and 'wafId' fields are required in setWafRuleset", + }, + }, + }, + required: ['setWafRuleset'], + additionalProperties: false, + }, + { + properties: { + setRateLimit: { + type: 'object', + properties: { + type: { + type: 'string', + enum: FIREWALL_RATE_LIMIT_TYPES, + errorMessage: `The rate limit type must be one of: ${FIREWALL_RATE_LIMIT_TYPES.join(', ')}`, + }, + limitBy: { + type: 'string', + enum: FIREWALL_RATE_LIMIT_BY, + errorMessage: `The rate limit must be applied by one of: ${FIREWALL_RATE_LIMIT_BY.join(', ')}`, + }, + averageRateLimit: { + type: 'string', + errorMessage: 'The averageRateLimit must be a string', + }, + maximumBurstSize: { + type: 'string', + errorMessage: 'The maximumBurstSize must be a string', + }, + }, + required: ['type', 'limitBy', 'averageRateLimit', 'maximumBurstSize'], + additionalProperties: false, + errorMessage: { + additionalProperties: 'No additional properties are allowed in the setRateLimit object', + required: + "All fields ('type', 'limitBy', 'averageRateLimit', 'maximumBurstSize') are required in setRateLimit", + }, + }, + }, + required: ['setRateLimit'], + additionalProperties: false, + }, + { + properties: { + deny: { + type: 'boolean', + const: true, + errorMessage: 'The deny behavior must be true', + }, + }, + required: ['deny'], + additionalProperties: false, + }, + { + properties: { + drop: { + type: 'boolean', + const: true, + errorMessage: 'The drop behavior must be true', + }, + }, + required: ['drop'], + additionalProperties: false, + }, + { + properties: { + setCustomResponse: { + type: 'object', + properties: { + statusCode: { + type: ['integer', 'string'], + minimum: 200, + maximum: 499, + errorMessage: 'The statusCode must be a number or string between 200 and 499', + }, + contentType: { + type: 'string', + errorMessage: 'The contentType must be a string', + }, + contentBody: { + type: 'string', + errorMessage: 'The contentBody must be a string', + }, + }, + required: ['statusCode', 'contentType', 'contentBody'], + additionalProperties: false, + errorMessage: { + additionalProperties: 'No additional properties are allowed in the setCustomResponse object', + required: "All fields ('statusCode', 'contentType', 'contentBody') are required in setCustomResponse", + }, + }, + }, + required: ['setCustomResponse'], + additionalProperties: false, + }, + ], + errorMessage: 'Each behavior item must contain exactly one behavior type', + }, + errorMessage: 'The behaviors array must contain between 1 and 10 behavior items.', +}; + const azionConfigSchema = { $id: 'azionConfig', definitions: { @@ -962,7 +1121,7 @@ const azionConfigSchema = { type: 'string', enum: WORKLOAD_HTTP_VERSIONS, }, - default: ['http1', 'http2'], + default: ['http1', 'http2', 'http3'], }, httpPorts: { type: 'array', @@ -985,10 +1144,10 @@ const azionConfigSchema = { }, default: { http: { - versions: ['http1', 'http2'], + versions: ['http1', 'http2', 'http3'], httpPorts: [80], httpsPorts: [443], - quicPorts: null, + quicPorts: [443], }, }, additionalProperties: false, @@ -1180,11 +1339,6 @@ const azionConfigSchema = { type: 'boolean', errorMessage: "The firewall's 'waf' field must be a boolean", }, - variable: { - type: 'string', - enum: FIREWALL_VARIABLES, - errorMessage: `The 'variable' field must be one of: ${FIREWALL_VARIABLES.join(', ')}`, - }, rules: { type: 'array', items: { @@ -1206,121 +1360,59 @@ const azionConfigSchema = { type: 'string', errorMessage: "The rule's 'match' field must be a string containing a valid regex pattern", }, - behavior: { - type: 'object', - properties: { - runFunction: { - type: ['string', 'number'], - errorMessage: "The 'runFunction' behavior must be a string or number", - }, - setWafRuleset: { - type: 'object', - properties: { - wafMode: { - type: 'string', - enum: FIREWALL_WAF_MODES, - errorMessage: `The wafMode must be one of: ${FIREWALL_WAF_MODES.join(', ')}`, - }, - wafId: { - type: ['string', 'number'], - errorMessage: 'The wafId must be a string or number', - }, + variable: { + type: 'string', + enum: FIREWALL_VARIABLES, + errorMessage: `The 'variable' field must be one of: ${FIREWALL_VARIABLES.join(', ')}`, + }, + behaviors: firewallRulesBehaviorsSchema, + criteria: { + type: 'array', + minItems: 1, + maxItems: 5, + items: { + type: 'object', + properties: { + conditional: { + type: 'string', + enum: FIREWALL_RULE_CONDITIONAL, + errorMessage: `The 'conditional' field must be one of: ${FIREWALL_RULE_CONDITIONAL.join(', ')}`, }, - required: ['wafMode', 'wafId'], - additionalProperties: false, - errorMessage: { - additionalProperties: 'No additional properties are allowed in the setWafRuleset object', - required: "Both 'wafMode' and 'wafId' fields are required in setWafRuleset", + variable: { + type: 'string', + enum: FIREWALL_VARIABLES, + errorMessage: `The 'variable' field must be one of: ${FIREWALL_VARIABLES.join(', ')}`, }, - }, - setRateLimit: { - type: 'object', - properties: { - type: { - type: 'string', - enum: FIREWALL_RATE_LIMIT_TYPES, - errorMessage: `The rate limit type must be one of: ${FIREWALL_RATE_LIMIT_TYPES.join(', ')}`, - }, - limitBy: { - type: 'string', - enum: FIREWALL_RATE_LIMIT_BY, - errorMessage: `The rate limit must be applied by one of: ${FIREWALL_RATE_LIMIT_BY.join(', ')}`, - }, - averageRateLimit: { - type: 'string', - errorMessage: 'The averageRateLimit must be a string', - }, - maximumBurstSize: { - type: 'string', - errorMessage: 'The maximumBurstSize must be a string', - }, + operator: { + type: 'string', + enum: FIREWALL_RULE_OPERATORS, + errorMessage: `The 'operator' field must be one of: ${FIREWALL_RULE_OPERATORS.join(', ')}`, }, - required: ['type', 'limitBy', 'averageRateLimit', 'maximumBurstSize'], - additionalProperties: false, - errorMessage: { - additionalProperties: 'No additional properties are allowed in the setRateLimit object', - required: - "All fields ('type', 'limitBy', 'averageRateLimit', 'maximumBurstSize') are required in setRateLimit", + argument: { + type: 'string', + errorMessage: 'The argument must be a string', }, }, - deny: { - type: 'boolean', - errorMessage: 'The deny behavior must be a boolean', - }, - drop: { - type: 'boolean', - errorMessage: 'The drop behavior must be a boolean', - }, - setCustomResponse: { - type: 'object', - properties: { - statusCode: { - type: ['integer', 'string'], - minimum: 200, - maximum: 499, - errorMessage: 'The statusCode must be a number or string between 200 and 499', - }, - contentType: { - type: 'string', - errorMessage: 'The contentType must be a string', - }, - contentBody: { - type: 'string', - errorMessage: 'The contentBody must be a string', - }, - }, - required: ['statusCode', 'contentType', 'contentBody'], - additionalProperties: false, - errorMessage: { - additionalProperties: - 'No additional properties are allowed in the setCustomResponse object', - required: - "All fields ('statusCode', 'contentType', 'contentBody') are required in setCustomResponse", - }, + required: ['conditional', 'variable', 'operator', 'argument'], + additionalProperties: false, + errorMessage: { + additionalProperties: 'No additional properties are allowed in the criteria object', + required: + "The 'variable', 'operator', 'argument' and 'conditional' fields are required in each criteria object", }, }, - not: { - anyOf: [ - { required: ['deny', 'drop'] }, - { required: ['deny', 'setCustomResponse'] }, - { required: ['deny', 'setRateLimit'] }, - { required: ['drop', 'setCustomResponse'] }, - { required: ['drop', 'setRateLimit'] }, - { required: ['setCustomResponse', 'setRateLimit'] }, - ], - }, errorMessage: { - not: 'Cannot use multiple final behaviors (deny, drop, setRateLimit, setCustomResponse) together. You can combine non-final behaviors (runFunction, setWafRuleset) with only one final behavior.', + type: 'The criteria field must be an array with at least one criteria item', }, - additionalProperties: false, }, }, - required: ['name', 'behavior'], + required: ['name', 'behaviors'], oneOf: [ { - anyOf: [{ required: ['match'] }, { required: ['variable'] }], + required: ['match', 'variable'], not: { required: ['criteria'] }, - errorMessage: "Cannot use 'match' or 'variable' together with 'criteria'.", + errorMessage: + "When using 'match' or 'variable', both fields are required and cannot be used with 'criteria'.", }, { required: ['criteria'], @@ -1331,7 +1423,8 @@ const azionConfigSchema = { }, ], errorMessage: { - oneOf: "You must use either 'match/variable' OR 'criteria', but not both at the same time", + oneOf: + "You must use either 'match' AND 'variable' together OR 'criteria', but not both at the same time", }, }, }, @@ -1924,7 +2017,12 @@ const azionConfigSchema = { storage: { type: 'array', items: schemaStorage, - errorMessage: "The 'storage' field must be an array of storage items.", + errorMessage: "The 'storage' field must be an array of storage items.", + }, + kv: { + type: 'array', + items: schemaKV, + errorMessage: "The 'kv' field must be an array of kv items.", }, }, additionalProperties: false, diff --git a/packages/config/src/configProcessor/helpers/schemaManifest.ts b/packages/config/src/configProcessor/helpers/schemaManifest.ts index 25d32a62..b0fb9b72 100644 --- a/packages/config/src/configProcessor/helpers/schemaManifest.ts +++ b/packages/config/src/configProcessor/helpers/schemaManifest.ts @@ -1,44 +1,44 @@ import { - APPLICATION_DELIVERY_PROTOCOLS, - APPLICATION_HTTP_PORTS, - APPLICATION_HTTPS_PORTS, - APPLICATION_SUPPORTED_CIPHERS, - APPLICATION_TLS_VERSIONS, - CACHE_ADAPTIVE_DELIVERY, - CACHE_BROWSER_SETTINGS, - CACHE_BY_COOKIE, - CACHE_BY_QUERY_STRING, - CACHE_CDN_SETTINGS, - CACHE_VARY_BY_METHOD, - COOKIE_BEHAVIORS, - CUSTOM_PAGE_ERROR_CODES, - EDGE_CONNECTOR_DNS_RESOLUTION, - EDGE_CONNECTOR_HMAC_TYPE, - EDGE_CONNECTOR_HTTP_VERSION_POLICY, - EDGE_CONNECTOR_LOAD_BALANCE_METHOD, - EDGE_CONNECTOR_TRANSPORT_POLICY, - EDGE_CONNECTOR_TYPES, - FIREWALL_BEHAVIOR_NAMES, - FIREWALL_RATE_LIMIT_BY, - FIREWALL_RATE_LIMIT_TYPES, - FIREWALL_RULE_CONDITIONALS, - FIREWALL_RULE_OPERATORS, - FIREWALL_VARIABLES, - FIREWALL_WAF_MODES, - HEADER_BEHAVIORS, - ID_BEHAVIORS, - NETWORK_LIST_TYPES, - NO_ARGS_BEHAVIORS, - RULE_CONDITIONALS, - RULE_OPERATORS_WITH_VALUE, - RULE_OPERATORS_WITHOUT_VALUE, - RULE_VARIABLES, - STRING_BEHAVIORS, - TIERED_CACHE_TOPOLOGY, - WAF_ENGINE_VERSIONS, - WORKLOAD_HTTP_VERSIONS, - WORKLOAD_MTLS_VERIFICATION, - WORKLOAD_TLS_VERSIONS, + APPLICATION_DELIVERY_PROTOCOLS, + APPLICATION_HTTP_PORTS, + APPLICATION_HTTPS_PORTS, + APPLICATION_SUPPORTED_CIPHERS, + APPLICATION_TLS_VERSIONS, + CACHE_ADAPTIVE_DELIVERY, + CACHE_BROWSER_SETTINGS, + CACHE_BY_COOKIE, + CACHE_BY_QUERY_STRING, + CACHE_CDN_SETTINGS, + CACHE_VARY_BY_METHOD, + COOKIE_BEHAVIORS, + CUSTOM_PAGE_ERROR_CODES, + EDGE_CONNECTOR_DNS_RESOLUTION, + EDGE_CONNECTOR_HMAC_TYPE, + EDGE_CONNECTOR_HTTP_VERSION_POLICY, + EDGE_CONNECTOR_LOAD_BALANCE_METHOD, + EDGE_CONNECTOR_TRANSPORT_POLICY, + EDGE_CONNECTOR_TYPES, + FIREWALL_BEHAVIOR_NAMES, + FIREWALL_RATE_LIMIT_BY, + FIREWALL_RATE_LIMIT_TYPES, + FIREWALL_RULE_CONDITIONALS, + FIREWALL_RULE_OPERATORS, + FIREWALL_VARIABLES, + FIREWALL_WAF_MODES, + HEADER_BEHAVIORS, + ID_BEHAVIORS, + NETWORK_LIST_TYPES, + NO_ARGS_BEHAVIORS, + RULE_CONDITIONALS, + RULE_OPERATORS_WITH_VALUE, + RULE_OPERATORS_WITHOUT_VALUE, + RULE_VARIABLES, + STRING_BEHAVIORS, + TIERED_CACHE_TOPOLOGY, + WAF_ENGINE_VERSIONS, + WORKLOAD_HTTP_VERSIONS, + WORKLOAD_MTLS_VERIFICATION, + WORKLOAD_TLS_VERSIONS, } from '../../constants'; const schemaNetworkListManifest = { @@ -257,6 +257,25 @@ const schemaStorageManifest = { }, }; +const schemaKvManifest = { + type: 'object', + properties: { + name: { + type: 'string', + minLength: 6, + maxLength: 63, + pattern: '^.{6,63}$', + errorMessage: "The 'name' field must be a string between 6 and 63 characters.", + }, + }, + required: ['name'], + additionalProperties: false, + errorMessage: { + additionalProperties: 'No additional properties are allowed in kv items.', + required: "The 'name' field is required.", + }, +}; + const schemaFirewallRuleBehaviorArguments = { set_rate_limit: { type: 'object', @@ -642,13 +661,13 @@ const schemaApplicationCacheSettings = { }, required: ['enabled'], if: { - properties: { enabled: { const: true } } + properties: { enabled: { const: true } }, }, then: { required: ['enabled', 'topology'], errorMessage: { - required: "When 'enabled' is true, 'topology' is required in the 'tiered_cache' object." - } + required: "When 'enabled' is true, 'topology' is required in the 'tiered_cache' object.", + }, }, additionalProperties: false, }, @@ -1945,6 +1964,11 @@ const schemaManifest = { items: schemaStorageManifest, errorMessage: "The 'storage' field must be an array of storage items.", }, + kv: { + type: 'array', + items: schemaKvManifest, + errorMessage: "The 'kv' field must be an array of kv items.", + }, }, required: ['build', 'applications', 'workloads', 'workload_deployments'], errorMessage: { diff --git a/packages/config/src/configProcessor/processStrategy/implementations/kvProcessConfigStrategy.test.ts b/packages/config/src/configProcessor/processStrategy/implementations/kvProcessConfigStrategy.test.ts new file mode 100644 index 00000000..bfd75812 --- /dev/null +++ b/packages/config/src/configProcessor/processStrategy/implementations/kvProcessConfigStrategy.test.ts @@ -0,0 +1,145 @@ +import { AzionConfig } from '../../../types'; +import KvProcessConfigStrategy from './kvProcessConfigStrategy'; + +describe('KvProcessConfigStrategy', () => { + let strategy: KvProcessConfigStrategy; + + beforeEach(() => { + strategy = new KvProcessConfigStrategy(); + }); + + describe('transformToManifest', () => { + it('should return undefined when no kv is provided', () => { + const config: AzionConfig = {}; + const result = strategy.transformToManifest(config); + expect(result).toBeUndefined(); + }); + + it('should return undefined when kv array is empty', () => { + const config: AzionConfig = { kv: [] }; + const result = strategy.transformToManifest(config); + expect(result).toBeUndefined(); + }); + + it('should transform a basic kv configuration to manifest format', () => { + const config: AzionConfig = { + kv: [ + { + name: 'my-kv', + }, + ], + }; + + const result = strategy.transformToManifest(config); + + expect(result).toEqual([ + { + name: 'my-kv', + }, + ]); + }); + + it('should transform multiple kv configurations to manifest format', () => { + const config: AzionConfig = { + kv: [ + { + name: 'kv-1', + }, + { + name: 'kv-2', + }, + ], + }; + + const result = strategy.transformToManifest(config); + + expect(result).toHaveLength(2); + expect(result![0].name).toBe('kv-1'); + expect(result![1].name).toBe('kv-2'); + }); + }); + + describe('transformToConfig', () => { + it('should return undefined when no kv is provided', () => { + const payload = {}; + const transformedPayload: AzionConfig = {}; + const result = strategy.transformToConfig(payload, transformedPayload); + expect(result).toBeUndefined(); + }); + + it('should return undefined when kv array is empty', () => { + const payload = { kv: [] }; + const transformedPayload: AzionConfig = {}; + const result = strategy.transformToConfig(payload, transformedPayload); + expect(result).toBeUndefined(); + }); + + it('should transform a basic kv manifest to config format', () => { + const payload = { + kv: [ + { + name: 'my-kv', + }, + ], + }; + const transformedPayload: AzionConfig = {}; + + const result = strategy.transformToConfig(payload, transformedPayload); + + expect(result).toEqual([ + { + name: 'my-kv', + }, + ]); + expect(transformedPayload.kv).toEqual([ + { + name: 'my-kv', + }, + ]); + }); + + it('should transform multiple kv manifests to config format', () => { + const payload = { + kv: [ + { + name: 'kv-1', + }, + { + name: 'kv-2', + }, + ], + }; + const transformedPayload: AzionConfig = {}; + + const result = strategy.transformToConfig(payload, transformedPayload); + + expect(result).toHaveLength(2); + expect(result![0].name).toBe('kv-1'); + expect(result![1].name).toBe('kv-2'); + expect(transformedPayload.kv).toEqual(result); + }); + + it('should handle existing kv in transformedPayload', () => { + const payload = { + kv: [ + { + name: 'new-kv', + }, + ], + }; + const transformedPayload: AzionConfig = { + kv: [ + { + name: 'existing-kv', + }, + ], + }; + + strategy.transformToConfig(payload, transformedPayload); + + // The transformToConfig method replaces the existing kv array + expect(transformedPayload.kv).toHaveLength(1); + expect(transformedPayload.kv![0].name).toBe('new-kv'); + }); + }); +}); diff --git a/packages/config/src/configProcessor/processStrategy/implementations/kvProcessConfigStrategy.ts b/packages/config/src/configProcessor/processStrategy/implementations/kvProcessConfigStrategy.ts new file mode 100644 index 00000000..dcbb2c7f --- /dev/null +++ b/packages/config/src/configProcessor/processStrategy/implementations/kvProcessConfigStrategy.ts @@ -0,0 +1,35 @@ +import { AzionConfig } from '../../../types'; +import ProcessConfigStrategy from '../processConfigStrategy'; + +/** + * KvProcessConfigStrategy + * @class KvProcessConfigStrategy + * @description This class is implementation of the KV ProcessConfig Strategy. + */ +class KvProcessConfigStrategy extends ProcessConfigStrategy { + transformToManifest(config: AzionConfig) { + if (!Array.isArray(config?.kv) || config?.kv.length === 0) { + return; + } + + return config.kv.map((item) => ({ + name: item.name, + })); + } + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + transformToConfig(payload: any, transformedPayload: AzionConfig) { + const kvConfig = payload.kv; + if (!Array.isArray(kvConfig) || kvConfig.length === 0) { + return; + } + + transformedPayload.kv = kvConfig.map((item) => ({ + name: item.name, + })); + + return transformedPayload.kv; + } +} + +export default KvProcessConfigStrategy; diff --git a/packages/config/src/configProcessor/processStrategy/implementations/secure/firewallProcessConfigStrategy.test.ts b/packages/config/src/configProcessor/processStrategy/implementations/secure/firewallProcessConfigStrategy.test.ts index 58bed7ae..dacdaaee 100644 --- a/packages/config/src/configProcessor/processStrategy/implementations/secure/firewallProcessConfigStrategy.test.ts +++ b/packages/config/src/configProcessor/processStrategy/implementations/secure/firewallProcessConfigStrategy.test.ts @@ -29,16 +29,13 @@ describe('FirewallProcessConfigStrategy', () => { functions: true, networkProtection: false, waf: true, - variable: 'request_uri', rules: [ { name: 'rule-1', description: 'desc', match: '/api/*', variable: 'request_uri', - behavior: { - deny: true, - }, + behaviors: [{ deny: true }], }, ], }, @@ -97,21 +94,26 @@ describe('FirewallProcessConfigStrategy', () => { { variable: 'host', operator: 'is_equal', conditional: 'if', argument: 'example.com' }, { variable: 'request_method', operator: 'exists', conditional: 'and' }, ], - behavior: { - runFunction: 'func-1', - setWafRuleset: { wafMode: 'blocking', wafId: 123 }, - setRateLimit: { - type: 'minute', - value: '100', - limitBy: 'clientIp', - averageRateLimit: '60', - maximumBurstSize: '20', - // eslint-disable-next-line @typescript-eslint/no-explicit-any - } as any, - drop: true, - setCustomResponse: { statusCode: 429, contentType: 'application/json', contentBody: '{"err":true}' }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - } as any, + behaviors: [ + { runFunction: 'func-1' }, + { setWafRuleset: { wafMode: 'blocking', wafId: 123 } }, + { + setRateLimit: { + type: 'minute', + limitBy: 'clientIp', + averageRateLimit: '60', + maximumBurstSize: '20', + }, + }, + { drop: true }, + { + setCustomResponse: { + statusCode: 429, + contentType: 'application/json', + contentBody: '{"err":true}', + }, + }, + ], }, ], }, @@ -131,7 +133,6 @@ describe('FirewallProcessConfigStrategy', () => { type: 'set_rate_limit', attributes: { type: 'minute', - value: '100', limit_by: 'clientIp', average_rate_limit: '60', maximum_burst_size: '20', @@ -152,6 +153,160 @@ describe('FirewallProcessConfigStrategy', () => { ], ]); }); + + it('should transform a firewall rule with runFunction followed by other behaviors', () => { + const config: AzionConfig = { + firewall: [ + { + name: 'fw-runFunction', + functions: true, + networkProtection: false, + waf: false, + rules: [ + { + name: 'rule-runFunction-deny', + match: '/api/*', + variable: 'request_uri', + behaviors: [{ runFunction: 'my-function' }, { deny: true }], + }, + ], + }, + ], + }; + + const result = strategy.transformToManifest(config)!; + expect(result).toHaveLength(1); + const rule = result[0].rules_engine[0]; + + expect(rule.behaviors).toEqual([ + { type: 'run_function', attributes: { value: 'my-function' } }, + { type: 'deny' }, + ]); + }); + + it('should transform a firewall rule with single deny behavior', () => { + const config: AzionConfig = { + firewall: [ + { + name: 'fw-single', + functions: false, + networkProtection: true, + waf: false, + rules: [ + { + name: 'rule-single-deny', + match: '/blocked/*', + variable: 'request_uri', + behaviors: [{ deny: true }], + }, + ], + }, + ], + }; + + const result = strategy.transformToManifest(config)!; + expect(result).toHaveLength(1); + const rule = result[0].rules_engine[0]; + + expect(rule.behaviors).toEqual([{ type: 'deny' }]); + }); + + it('should transform a firewall rule with single drop behavior', () => { + const config: AzionConfig = { + firewall: [ + { + name: 'fw-drop', + functions: false, + networkProtection: true, + waf: false, + rules: [ + { + name: 'rule-drop', + match: '/drop/*', + variable: 'request_uri', + behaviors: [{ drop: true }], + }, + ], + }, + ], + }; + + const result = strategy.transformToManifest(config)!; + expect(result).toHaveLength(1); + const rule = result[0].rules_engine[0]; + + expect(rule.behaviors).toEqual([{ type: 'drop' }]); + }); + + it('should transform a firewall rule with runFunction, setWafRuleset, and deny', () => { + const config: AzionConfig = { + firewall: [ + { + name: 'fw-multiple', + functions: true, + networkProtection: false, + waf: true, + rules: [ + { + name: 'rule-multiple', + match: '/protected/*', + variable: 'request_uri', + behaviors: [ + { runFunction: 123 }, + { setWafRuleset: { wafMode: 'blocking', wafId: 456 } }, + { deny: true }, + ], + }, + ], + }, + ], + }; + + const result = strategy.transformToManifest(config)!; + expect(result).toHaveLength(1); + const rule = result[0].rules_engine[0]; + + expect(rule.behaviors).toEqual([ + { type: 'run_function', attributes: { value: 123 } }, + { type: 'set_waf_ruleset', attributes: { mode: 'blocking', waf_id: 456 } }, + { type: 'deny' }, + ]); + }); + + it('should transform a firewall rule using criteria instead of match/variable', () => { + const config: AzionConfig = { + firewall: [ + { + name: 'fw-criteria', + functions: false, + networkProtection: true, + waf: false, + rules: [ + { + name: 'rule-criteria', + criteria: [ + { variable: 'host', operator: 'is_equal', conditional: 'if', argument: 'example.com' }, + { variable: 'request_method', operator: 'matches', conditional: 'and', argument: '^(GET|POST)$' }, + ], + behaviors: [{ deny: true }], + }, + ], + }, + ], + }; + + const result = strategy.transformToManifest(config)!; + expect(result).toHaveLength(1); + const rule = result[0].rules_engine[0]; + + expect(rule.criteria).toEqual([ + [ + { variable: 'host', operator: 'is_equal', conditional: 'if', argument: 'example.com' }, + { variable: 'request_method', operator: 'matches', conditional: 'and', argument: '^(GET|POST)$' }, + ], + ]); + expect(rule.behaviors).toEqual([{ type: 'deny' }]); + }); }); describe('transformToConfig', () => { @@ -205,7 +360,7 @@ describe('FirewallProcessConfigStrategy', () => { expect(result).toBe(transformedPayload.firewall); }); - it('should transform rules_engine behaviors and criteria to config behavior object', () => { + it('should transform rules_engine behaviors and criteria to config behaviors object', () => { const payload = { firewall: [ { @@ -222,7 +377,6 @@ describe('FirewallProcessConfigStrategy', () => { type: 'set_rate_limit', attributes: { type: 'second', - value: '20', limit_by: 'global', average_rate_limit: '10', maximum_burst_size: '5', @@ -250,30 +404,31 @@ describe('FirewallProcessConfigStrategy', () => { const transformedPayload: AzionConfig = {}; strategy.transformToConfig(payload, transformedPayload); - // Note: behavior.runFunction is mapped to an object with { path } by the strategy + // Note: behaviors.runFunction is mapped to an object with { path } by the strategy expect(transformedPayload.firewall?.[0]).toMatchObject({ name: 'fw-2', }); // If rules are mapped, it should look like the following structure - // This expectation documents the intended behavior; failing here indicates a bug in the strategy. + // This expectation documents the intended behaviors; failing here indicates a bug in the strategy. const expectedRule = { name: 'BlockBots', active: false, - behavior: { - runFunction: { path: '/path/to/f.js' }, - setWafRuleset: { wafMode: 'learning', wafId: 999 }, - setRateLimit: { - type: 'second', - value: '20', - limitBy: 'global', - averageRateLimit: '10', - maximumBurstSize: '5', + behaviors: [ + { runFunction: '/path/to/f.js' }, + { setWafRuleset: { wafMode: 'learning', wafId: 999 } }, + { + setRateLimit: { + type: 'second', + limitBy: 'global', + averageRateLimit: '10', + maximumBurstSize: '5', + }, }, - deny: true, - drop: true, - setCustomResponse: { statusCode: 403, contentType: 'text/plain', contentBody: 'forbidden' }, - }, + { deny: true }, + { drop: true }, + { setCustomResponse: { statusCode: 403, contentType: 'text/plain', contentBody: 'forbidden' } }, + ], criteria: [ { variable: 'host', operator: 'is_equal', conditional: 'if', argument: 'bad.com' }, { variable: 'request_method', operator: 'exists', conditional: 'and' }, @@ -285,9 +440,146 @@ describe('FirewallProcessConfigStrategy', () => { // eslint-disable-next-line @typescript-eslint/no-explicit-any expect(transformedPayload.firewall?.[0]?.rules?.[0]).toMatchObject(expectedRule as any); } else { - // Document current behavior if rules are not mapped due to a bug + // Document current behaviors if rules are not mapped due to a bug expect(transformedPayload.firewall?.[0]?.rules).toBeDefined(); } }); + + it('should transform manifest with runFunction followed by deny to config', () => { + const payload = { + firewall: [ + { + name: 'fw-runFunction', + modules: { functions: { enabled: true }, network_protection: { enabled: false }, waf: { enabled: false } }, + rules_engine: [ + { + type: 'RunThenDeny', + active: true, + behaviors: [{ type: 'run_function', attributes: { value: 'my-func' } }, { type: 'deny' }], + criteria: [[{ variable: 'request_uri', operator: 'matches', conditional: 'if', argument: '/api/*' }]], + }, + ], + }, + ], + }; + + const transformedPayload: AzionConfig = {}; + strategy.transformToConfig(payload, transformedPayload); + + expect(transformedPayload.firewall?.[0]?.rules?.[0]).toMatchObject({ + name: 'RunThenDeny', + active: true, + behaviors: [{ runFunction: 'my-func' }, { deny: true }], + }); + }); + + it('should transform manifest with single deny behavior to config', () => { + const payload = { + firewall: [ + { + name: 'fw-single-deny', + modules: { functions: { enabled: false }, network_protection: { enabled: true }, waf: { enabled: false } }, + rules_engine: [ + { + type: 'DenyOnly', + active: true, + behaviors: [{ type: 'deny' }], + criteria: [[{ variable: 'host', operator: 'is_equal', conditional: 'if', argument: 'blocked.com' }]], + }, + ], + }, + ], + }; + + const transformedPayload: AzionConfig = {}; + strategy.transformToConfig(payload, transformedPayload); + + expect(transformedPayload.firewall?.[0]?.rules?.[0]).toMatchObject({ + name: 'DenyOnly', + active: true, + behaviors: [{ deny: true }], + }); + }); + + it('should transform manifest with single drop behavior to config', () => { + const payload = { + firewall: [ + { + name: 'fw-single-drop', + modules: { functions: { enabled: false }, network_protection: { enabled: true }, waf: { enabled: false } }, + rules_engine: [ + { + type: 'DropOnly', + active: true, + behaviors: [{ type: 'drop' }], + criteria: [ + [{ variable: 'request_method', operator: 'is_equal', conditional: 'if', argument: 'DELETE' }], + ], + }, + ], + }, + ], + }; + + const transformedPayload: AzionConfig = {}; + strategy.transformToConfig(payload, transformedPayload); + + expect(transformedPayload.firewall?.[0]?.rules?.[0]).toMatchObject({ + name: 'DropOnly', + active: true, + behaviors: [{ drop: true }], + }); + }); + + it('should transform manifest with runFunction, setWafRuleset, and setCustomResponse to config', () => { + const payload = { + firewall: [ + { + name: 'fw-complex', + modules: { functions: { enabled: true }, network_protection: { enabled: false }, waf: { enabled: true } }, + rules_engine: [ + { + type: 'ComplexRule', + active: true, + behaviors: [ + { type: 'run_function', attributes: { value: 999 } }, + { type: 'set_waf_ruleset', attributes: { mode: 'counting', waf_id: 111 } }, + { + type: 'set_custom_response', + attributes: { + status_code: 429, + content_type: 'application/json', + content_body: '{"error":"rate limit"}', + }, + }, + ], + criteria: [ + [{ variable: 'client_ip', operator: 'is_in_list', conditional: 'if', argument: 'blocklist' }], + ], + }, + ], + }, + ], + }; + + const transformedPayload: AzionConfig = {}; + strategy.transformToConfig(payload, transformedPayload); + + expect(transformedPayload.firewall?.[0]?.rules?.[0]).toMatchObject({ + name: 'ComplexRule', + active: true, + behaviors: [ + { runFunction: 999 }, + { setWafRuleset: { wafMode: 'counting', wafId: 111 } }, + { + setCustomResponse: { + statusCode: 429, + contentType: 'application/json', + contentBody: '{"error":"rate limit"}', + }, + }, + ], + }); + }); }); }); diff --git a/packages/config/src/configProcessor/processStrategy/implementations/secure/firewallProcessConfigStrategy.ts b/packages/config/src/configProcessor/processStrategy/implementations/secure/firewallProcessConfigStrategy.ts index cbdbe6c7..da40bfa4 100644 --- a/packages/config/src/configProcessor/processStrategy/implementations/secure/firewallProcessConfigStrategy.ts +++ b/packages/config/src/configProcessor/processStrategy/implementations/secure/firewallProcessConfigStrategy.ts @@ -36,7 +36,7 @@ class FirewallProcessConfigStrategy extends ProcessConfigStrategy { name: rule.name, description: rule.description || '', active: rule.active ?? true, - behaviors: this.transformBehaviorsToManifest(rule.behavior), + behaviors: this.transformBehaviorsToManifest(rule.behaviors), criteria: rule.criteria ? [ rule.criteria.map((criterion) => { @@ -67,62 +67,78 @@ class FirewallProcessConfigStrategy extends ProcessConfigStrategy { } // eslint-disable-next-line @typescript-eslint/no-explicit-any - private transformBehaviorsToManifest(behavior: any) { + private transformBehaviorsToManifest(behaviorArray: any[]) { + // Runtime validation: deny, drop, and setCustomResponse are terminal behaviors + // and cannot be combined with other behaviors + if (behaviorArray.length > 1) { + const firstBehavior = behaviorArray[0]; + const hasTerminalBehavior = firstBehavior.deny || firstBehavior.drop || firstBehavior.setCustomResponse; + + if (hasTerminalBehavior) { + const behaviorType = firstBehavior.deny ? 'deny' : firstBehavior.drop ? 'drop' : 'setCustomResponse'; + throw new Error( + `The behavior '${behaviorType}' is a terminal behavior and must be used alone. ` + + `It cannot be combined with other behaviors in the same rule.`, + ); + } + } + const behaviors = []; - if (behavior.runFunction) { - behaviors.push({ - type: 'run_function', - attributes: { - value: behavior.runFunction, - }, - }); - } + for (const behaviorItem of behaviorArray) { + if (behaviorItem.runFunction !== undefined) { + behaviors.push({ + type: 'run_function', + attributes: { + value: behaviorItem.runFunction, + }, + }); + } - if (behavior.setWafRuleset) { - behaviors.push({ - type: 'set_waf_ruleset', - attributes: { - mode: behavior.setWafRuleset.wafMode, - waf_id: behavior.setWafRuleset.wafId, - }, - }); - } + if (behaviorItem.setWafRuleset) { + behaviors.push({ + type: 'set_waf_ruleset', + attributes: { + mode: behaviorItem.setWafRuleset.wafMode, + waf_id: behaviorItem.setWafRuleset.wafId, + }, + }); + } - if (behavior.setRateLimit) { - behaviors.push({ - type: 'set_rate_limit', - attributes: { - type: behavior.setRateLimit.type || 'second', - value: behavior.setRateLimit.value, - limit_by: behavior.setRateLimit.limitBy, - average_rate_limit: behavior.setRateLimit.averageRateLimit, - maximum_burst_size: behavior.setRateLimit.maximumBurstSize, - }, - }); - } + if (behaviorItem.setRateLimit) { + behaviors.push({ + type: 'set_rate_limit', + attributes: { + type: behaviorItem.setRateLimit.type || 'second', + limit_by: behaviorItem.setRateLimit.limitBy, + average_rate_limit: behaviorItem.setRateLimit.averageRateLimit, + maximum_burst_size: behaviorItem.setRateLimit.maximumBurstSize, + }, + }); + } - if (behavior.deny) { - behaviors.push({ - type: 'deny', - }); - } + if (behaviorItem.deny) { + behaviors.push({ + type: 'deny', + }); + } - if (behavior.drop) { - behaviors.push({ - type: 'drop', - }); - } + if (behaviorItem.drop) { + behaviors.push({ + type: 'drop', + }); + } - if (behavior.setCustomResponse) { - behaviors.push({ - type: 'set_custom_response', - attributes: { - status_code: behavior.setCustomResponse.statusCode, - content_type: behavior.setCustomResponse.contentType, - content_body: behavior.setCustomResponse.contentBody, - }, - }); + if (behaviorItem.setCustomResponse) { + behaviors.push({ + type: 'set_custom_response', + attributes: { + status_code: behaviorItem.setCustomResponse.statusCode, + content_type: behaviorItem.setCustomResponse.contentType, + content_body: behaviorItem.setCustomResponse.contentBody, + }, + }); + } } return behaviors; @@ -152,7 +168,7 @@ class FirewallProcessConfigStrategy extends ProcessConfigStrategy { const firewallRule: AzionFirewallRule = { name: rule.type, active: rule.active ?? true, - behavior: this.transformBehaviorsToConfig(rule.behaviors), + behaviors: this.transformBehaviorsToConfig(rule.behaviors), criteria: // eslint-disable-next-line @typescript-eslint/no-explicit-any rule.criteria?.[0].map((criterion: any) => { @@ -176,47 +192,52 @@ class FirewallProcessConfigStrategy extends ProcessConfigStrategy { // eslint-disable-next-line @typescript-eslint/no-explicit-any private transformBehaviorsToConfig(behaviors: any[]) { // eslint-disable-next-line @typescript-eslint/no-explicit-any - const behavior: any = {}; + const behaviorArray: any[] = []; behaviors.forEach((b) => { switch (b.type) { case 'run_function': - behavior.runFunction = { - path: b.attributes.value, - }; + behaviorArray.push({ + runFunction: b.attributes.value, + }); break; case 'set_waf_ruleset': - behavior.setWafRuleset = { - wafMode: b.attributes.mode, - wafId: b.attributes.waf_id, - }; + behaviorArray.push({ + setWafRuleset: { + wafMode: b.attributes.mode, + wafId: b.attributes.waf_id, + }, + }); break; case 'set_rate_limit': - behavior.setRateLimit = { - type: b.attributes.type, - value: b.attributes.value, - limitBy: b.attributes.limit_by, - averageRateLimit: b.attributes.average_rate_limit, - maximumBurstSize: b.attributes.maximum_burst_size, - }; + behaviorArray.push({ + setRateLimit: { + type: b.attributes.type, + limitBy: b.attributes.limit_by, + averageRateLimit: b.attributes.average_rate_limit, + maximumBurstSize: b.attributes.maximum_burst_size, + }, + }); break; case 'deny': - behavior.deny = true; + behaviorArray.push({ deny: true }); break; case 'drop': - behavior.drop = true; + behaviorArray.push({ drop: true }); break; case 'set_custom_response': - behavior.setCustomResponse = { - statusCode: b.attributes.status_code, - contentType: b.attributes.content_type, - contentBody: b.attributes.content_body, - }; + behaviorArray.push({ + setCustomResponse: { + statusCode: b.attributes.status_code, + contentType: b.attributes.content_type, + contentBody: b.attributes.content_body, + }, + }); break; } }); - return behavior; + return behaviorArray; } } diff --git a/packages/config/src/configProcessor/processStrategy/implementations/workloadProcessConfigStrategy.test.ts b/packages/config/src/configProcessor/processStrategy/implementations/workloadProcessConfigStrategy.test.ts index b8409ef9..2270e4db 100644 --- a/packages/config/src/configProcessor/processStrategy/implementations/workloadProcessConfigStrategy.test.ts +++ b/packages/config/src/configProcessor/processStrategy/implementations/workloadProcessConfigStrategy.test.ts @@ -48,10 +48,10 @@ describe('WorkloadProcessConfigStrategy', () => { }, protocols: { http: { - versions: ['http1', 'http2'], + versions: ['http1', 'http2', 'http3'], http_ports: [80], https_ports: [443], - quic_ports: null, + quic_ports: [443], }, }, }), diff --git a/packages/config/src/configProcessor/processStrategy/implementations/workloadProcessConfigStrategy.ts b/packages/config/src/configProcessor/processStrategy/implementations/workloadProcessConfigStrategy.ts index 0f1d8437..96eb442c 100644 --- a/packages/config/src/configProcessor/processStrategy/implementations/workloadProcessConfigStrategy.ts +++ b/packages/config/src/configProcessor/processStrategy/implementations/workloadProcessConfigStrategy.ts @@ -25,10 +25,10 @@ class WorkloadProcessConfigStrategy extends ProcessConfigStrategy { }, protocols: { http: { - versions: workload.protocols?.http?.versions || ['http1', 'http2'], + versions: workload.protocols?.http?.versions || ['http1', 'http2', 'http3'], http_ports: workload.protocols?.http?.httpPorts || [80], https_ports: workload.protocols?.http?.httpsPorts || [443], - quic_ports: workload.protocols?.http?.quicPorts || null, + quic_ports: workload.protocols?.http?.quicPorts || [443], }, }, mtls: workload.mtls diff --git a/packages/config/src/configProcessor/processStrategy/index.ts b/packages/config/src/configProcessor/processStrategy/index.ts index 7dcc100e..1dfeea2c 100644 --- a/packages/config/src/configProcessor/processStrategy/index.ts +++ b/packages/config/src/configProcessor/processStrategy/index.ts @@ -3,6 +3,7 @@ import BuildProcessConfigStrategy from './implementations/buildProcessConfigStra import ConnectorProcessConfigStrategy from './implementations/connectorProcessConfigStrategy'; import CustomPagesProcessConfigStrategy from './implementations/customPagesProcessConfigStrategy'; import FunctionsProcessConfigStrategy from './implementations/functionsProcessConfigStrategy'; +import KvProcessConfigStrategy from './implementations/kvProcessConfigStrategy'; import PurgeProcessConfigStrategy from './implementations/purgeProcessConfigStrategy'; import FirewallProcessConfigStrategy from './implementations/secure/firewallProcessConfigStrategy'; import NetworkListProcessConfigStrategy from './implementations/secure/networkListProcessConfigStrategy'; @@ -26,6 +27,7 @@ function factoryProcessContext() { processConfigContext.setStrategy('workloads', new WorkloadProcessConfigStrategy()); processConfigContext.setStrategy('workload_deployments', new WorkloadDeploymentsProcessConfigStrategy()); processConfigContext.setStrategy('custom_pages', new CustomPagesProcessConfigStrategy()); + processConfigContext.setStrategy('kv', new KvProcessConfigStrategy()); return processConfigContext; } diff --git a/packages/config/src/constants.ts b/packages/config/src/constants.ts index c0f1e383..a0f3fecc 100644 --- a/packages/config/src/constants.ts +++ b/packages/config/src/constants.ts @@ -122,6 +122,8 @@ export const FIREWALL_VARIABLES = [ 'ssl_verification_status', ] as const; +export const FIREWALL_RULE_CONDITIONAL = ['if', 'and', 'or'] as const; + export const NETWORK_LIST_TYPES = ['ip_cidr', 'asn', 'countries'] as const; export const WAF_MODE = ['learning', 'blocking', 'counting'] as const; @@ -292,7 +294,7 @@ export const WORKLOAD_TLS_VERSIONS = ['', 'tls_1_0', 'tls_1_1', 'tls_1_2', 'tls_ export const WORKLOAD_MTLS_VERIFICATION = ['enforce', 'permissive'] as const; -export const WORKLOAD_HTTP_VERSIONS = ['http1', 'http2'] as const; +export const WORKLOAD_HTTP_VERSIONS = ['http1', 'http2', 'http3'] as const; // Constantes para Connector V4 export const EDGE_CONNECTOR_TYPES = ['http', 'storage', 'live_ingest'] as const; diff --git a/packages/config/src/types.ts b/packages/config/src/types.ts index 2103dce9..1646efb4 100644 --- a/packages/config/src/types.ts +++ b/packages/config/src/types.ts @@ -173,7 +173,7 @@ export type WorkloadInfrastructure = 1 | 2; export type WorkloadTLSCipher = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; export type WorkloadTLSVersion = '' | 'tls_1_0' | 'tls_1_1' | 'tls_1_2' | 'tls_1_3'; export type WorkloadMTLSVerification = 'enforce' | 'permissive'; -export type WorkloadHTTPVersion = 'http1' | 'http2'; +export type WorkloadHTTPVersion = 'http1' | 'http2' | 'http3'; // Connector types export type ConnectorType = 'http' | 'storage' | 'live_ingest'; @@ -562,44 +562,29 @@ export type AzionApplication = { functionsInstances?: AzionFunctionInstance[]; }; +/** + * Individual firewall behavior types + */ +export type AzionFirewallBehaviorItem = + | { runFunction: string | number } + | { setWafRuleset: { wafMode: FirewallWafMode; wafId: string | number } } + | { + setRateLimit: { + type: FirewallRateLimitType; + limitBy: FirewallRateLimitBy; + averageRateLimit: string; + maximumBurstSize: string; + }; + } + | { deny: true } + | { drop: true } + | { setCustomResponse: { statusCode: number | string; contentType: string; contentBody: string } }; + /** * Firewall behavior configuration for Azion. + * Array of behavior items to be applied when the rule matches. */ -export type AzionFirewallBehavior = { - /** Run a serverless function */ - runFunction?: string | number; - /** Set WAF ruleset */ - setWafRuleset?: { - /** WAF mode */ - wafMode: FirewallWafMode; - /** WAF ID */ - wafId: string | number; - }; - /** Set rate limit */ - setRateLimit?: { - /** Rate limit type */ - type: FirewallRateLimitType; - /** Rate limit by */ - limitBy: FirewallRateLimitBy; - /** Average rate limit */ - averageRateLimit: string; - /** Maximum burst size */ - maximumBurstSize: string; - }; - /** Deny the request */ - deny?: boolean; - /** Drop the request */ - drop?: boolean; - /** Set custom response */ - setCustomResponse?: { - /** HTTP status code (200-499) */ - statusCode: number | string; - /** Response content type */ - contentType: string; - /** Response content body */ - contentBody: string; - }; -}; +export type AzionFirewallBehavior = AzionFirewallBehaviorItem[]; export type AzionFirewallCriteriaBase = { /** Variable to be evaluated */ @@ -639,7 +624,7 @@ export type AzionFirewallRule = { /** Array of criteria for complex conditions */ criteria?: AzionFirewallCriteria[]; /** Behavior to be applied when the rule matches */ - behavior: AzionFirewallBehavior; + behaviors: AzionFirewallBehavior; }; /** @@ -656,8 +641,6 @@ export type AzionFirewall = { networkProtection?: boolean; /** Indicates if WAF is enabled */ waf?: boolean; - /** Variable to be used in the match */ - variable?: RuleVariable; /** List of firewall rules */ rules?: AzionFirewallRule[]; /** Debug mode */ @@ -1044,6 +1027,8 @@ export type AzionConfig = { workloads?: AzionWorkload[]; /** Custom pages configuration */ customPages?: AzionCustomPage[]; + /** KV configuration */ + kv?: AzionKV[]; }; // Rule Types - Separados corretamente baseado no behaviors.yml @@ -1225,3 +1210,11 @@ export type AzionManifestRule = { /** Rule data */ rule: AzionRule; }; + +/** + * KV + */ +export type AzionKV = { + /** KV name */ + name: string; +}; diff --git a/packages/config/tsup.config.ts b/packages/config/tsup.config.ts deleted file mode 100644 index c84b69e2..00000000 --- a/packages/config/tsup.config.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default defineConfig({ - entry: ['src/index.ts', 'src/rules/index.ts'], - format: ['cjs', 'esm'], - splitting: true, - sourcemap: false, - clean: true, - bundle: true, - dts: true, - minify: true, - minifyWhitespace: true, -}); diff --git a/packages/config/vite.config.mjs b/packages/config/vite.config.mjs new file mode 100644 index 00000000..fd5f7711 --- /dev/null +++ b/packages/config/vite.config.mjs @@ -0,0 +1,20 @@ +import { createViteConfig } from '@lib/vite-config'; +import { resolve } from 'path'; + +export default createViteConfig({ + dirname: __dirname, + ssr: true, + entry: { + index: 'src/index.ts', + rules: 'src/rules/index.ts', + }, + alias: { + 'azion/unenv-preset': resolve(__dirname, '../unenv-preset/src/'), + 'azion/utils/node': resolve(__dirname, '../utils/src/node/'), + 'azion/bundler': resolve(__dirname, '../bundler/src/'), + }, + external: ['ajv', 'ajv-errors', 'ajv-keywords', 'mathjs'], + dts: { + aliasesExclude: [/^azion\//], + }, +}); diff --git a/packages/cookies/package.json b/packages/cookies/package.json index b0e3286e..445f75e7 100644 --- a/packages/cookies/package.json +++ b/packages/cookies/package.json @@ -2,11 +2,11 @@ "name": "@lib/cookies", "version": "1.0.0", "description": "", - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", "scripts": { - "compile": "tsup --config ../../tsup.config.json", + "compile": "vite build", "lint": "eslint .", "lint:fix": "eslint --fix .", "prettier": "prettier --write .", @@ -15,7 +15,8 @@ }, "exports": { ".": { - "require": "./dist/index.js", + "types": "./dist/index.d.ts", + "require": "./dist/index.cjs", "import": "./dist/index.mjs" } }, diff --git a/packages/cookies/src/index.ts b/packages/cookies/src/index.ts index 2dd22a98..22f4c32b 100644 --- a/packages/cookies/src/index.ts +++ b/packages/cookies/src/index.ts @@ -1,5 +1,6 @@ import { getCookie } from './getCookie'; -import { CookieOptions, setCookie } from './setCookie'; +import type { CookieOptions } from './setCookie'; +import { setCookie } from './setCookie'; const cookies = { getCookie, diff --git a/packages/cookies/vite.config.mjs b/packages/cookies/vite.config.mjs new file mode 100644 index 00000000..dddbb7ff --- /dev/null +++ b/packages/cookies/vite.config.mjs @@ -0,0 +1,5 @@ +import { createViteConfig } from '@lib/vite-config'; + +export default createViteConfig({ + dirname: __dirname, +}); diff --git a/packages/domains/package.json b/packages/domains/package.json index 3a0c1fba..6c6a9003 100644 --- a/packages/domains/package.json +++ b/packages/domains/package.json @@ -2,11 +2,11 @@ "name": "@lib/domains", "version": "1.0.0", "description": "", - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", "scripts": { - "compile": "tsup --config ../../tsup.config.json", + "compile": "vite build", "lint": "eslint .", "lint:fix": "eslint --fix .", "prettier": "prettier --write .", @@ -16,7 +16,8 @@ }, "exports": { ".": { - "require": "./dist/index.js", + "types": "./dist/index.d.ts", + "require": "./dist/index.cjs", "import": "./dist/index.mjs" } }, diff --git a/packages/domains/vite.config.mjs b/packages/domains/vite.config.mjs new file mode 100644 index 00000000..dddbb7ff --- /dev/null +++ b/packages/domains/vite.config.mjs @@ -0,0 +1,5 @@ +import { createViteConfig } from '@lib/vite-config'; + +export default createViteConfig({ + dirname: __dirname, +}); diff --git a/packages/jwt/package.json b/packages/jwt/package.json index 0b24032d..bf0f8ca7 100644 --- a/packages/jwt/package.json +++ b/packages/jwt/package.json @@ -2,11 +2,11 @@ "name": "@lib/jwt", "version": "1.0.0", "description": "", - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", "scripts": { - "compile": "tsup --config ../../tsup.config.json", + "compile": "vite build", "lint": "eslint .", "lint:fix": "eslint --fix .", "prettier": "prettier --write .", @@ -15,7 +15,8 @@ }, "exports": { ".": { - "require": "./dist/index.js", + "types": "./dist/index.d.ts", + "require": "./dist/index.cjs", "import": "./dist/index.mjs" } }, diff --git a/packages/jwt/vite.config.mjs b/packages/jwt/vite.config.mjs new file mode 100644 index 00000000..dddbb7ff --- /dev/null +++ b/packages/jwt/vite.config.mjs @@ -0,0 +1,5 @@ +import { createViteConfig } from '@lib/vite-config'; + +export default createViteConfig({ + dirname: __dirname, +}); diff --git a/packages/presets/package.json b/packages/presets/package.json index 4a2bd70f..34ad3185 100644 --- a/packages/presets/package.json +++ b/packages/presets/package.json @@ -3,10 +3,10 @@ "version": "1.0.0", "description": "", "main": "./dist/index.cjs", - "module": "./dist/index.js", + "module": "./dist/index.mjs", "type": "module", "scripts": { - "compile": "tsup --config ./tsup.config.json && tsup --config ./tsup.config.ts", + "compile": "vite build --config vite.config.mjs && vite build --config vite.config.presets.js", "lint": "eslint .", "lint:fix": "eslint --fix .", "prettier": "prettier --write .", @@ -15,8 +15,9 @@ }, "exports": { ".": { + "types": "./dist/index.d.ts", "require": "./dist/index.cjs", - "import": "./dist/index.js" + "import": "./dist/index.mjs" }, "./preset/nuxt/*": "./src/presets/nuxt/nitro/*/index.js", "./preset/sveltekit/*": "./src/presets/svelte/kit/index.js", diff --git a/packages/presets/src/index.ts b/packages/presets/src/index.ts index 186df063..5bc2023e 100644 --- a/packages/presets/src/index.ts +++ b/packages/presets/src/index.ts @@ -22,3 +22,5 @@ export * from './presets/typescript'; export * from './presets/vitepress'; export * from './presets/vue'; export * from './presets/vuepress'; + +export * from './types'; diff --git a/packages/presets/src/presets/angular/config.ts b/packages/presets/src/presets/angular/config.ts index f5dac6f7..5f8996f1 100644 --- a/packages/presets/src/presets/angular/config.ts +++ b/packages/presets/src/presets/angular/config.ts @@ -49,14 +49,6 @@ const config: AzionConfig = { name: '$WORKLOAD_NAME', active: true, infrastructure: 1, - protocols: { - http: { - versions: ['http1', 'http2'], - httpPorts: [80], - httpsPorts: [443], - quicPorts: null, - }, - }, deployments: [ { name: '$DEPLOYMENT_NAME', diff --git a/packages/presets/src/presets/astro/config.ts b/packages/presets/src/presets/astro/config.ts index 6a4439c1..a2b3b9d8 100644 --- a/packages/presets/src/presets/astro/config.ts +++ b/packages/presets/src/presets/astro/config.ts @@ -49,14 +49,6 @@ const config: AzionConfig = { name: '$WORKLOAD_NAME', active: true, infrastructure: 1, - protocols: { - http: { - versions: ['http1', 'http2'], - httpPorts: [80], - httpsPorts: [443], - quicPorts: null, - }, - }, deployments: [ { name: '$DEPLOYMENT_NAME', diff --git a/packages/presets/src/presets/docusaurus/config.ts b/packages/presets/src/presets/docusaurus/config.ts index f8cd1421..83923284 100644 --- a/packages/presets/src/presets/docusaurus/config.ts +++ b/packages/presets/src/presets/docusaurus/config.ts @@ -49,14 +49,6 @@ const config: AzionConfig = { name: '$WORKLOAD_NAME', active: true, infrastructure: 1, - protocols: { - http: { - versions: ['http1', 'http2'], - httpPorts: [80], - httpsPorts: [443], - quicPorts: null, - }, - }, deployments: [ { name: '$DEPLOYMENT_NAME', diff --git a/packages/presets/src/presets/eleventy/config.ts b/packages/presets/src/presets/eleventy/config.ts index b61fcf65..948c6427 100644 --- a/packages/presets/src/presets/eleventy/config.ts +++ b/packages/presets/src/presets/eleventy/config.ts @@ -49,14 +49,6 @@ const config: AzionConfig = { name: '$WORKLOAD_NAME', active: true, infrastructure: 1, - protocols: { - http: { - versions: ['http1', 'http2'], - httpPorts: [80], - httpsPorts: [443], - quicPorts: null, - }, - }, deployments: [ { name: '$DEPLOYMENT_NAME', diff --git a/packages/presets/src/presets/emscripten/config.ts b/packages/presets/src/presets/emscripten/config.ts index 563c6b13..44a5bed0 100644 --- a/packages/presets/src/presets/emscripten/config.ts +++ b/packages/presets/src/presets/emscripten/config.ts @@ -82,14 +82,6 @@ const config: AzionConfig = { name: '$WORKLOAD_NAME', active: true, infrastructure: 1, - protocols: { - http: { - versions: ['http1', 'http2'], - httpPorts: [80], - httpsPorts: [443], - quicPorts: null, - }, - }, deployments: [ { name: '$DEPLOYMENT_NAME', diff --git a/packages/presets/src/presets/gatsby/config.ts b/packages/presets/src/presets/gatsby/config.ts index 7aa44ce3..3307dd85 100644 --- a/packages/presets/src/presets/gatsby/config.ts +++ b/packages/presets/src/presets/gatsby/config.ts @@ -49,14 +49,6 @@ const config: AzionConfig = { name: '$WORKLOAD_NAME', active: true, infrastructure: 1, - protocols: { - http: { - versions: ['http1', 'http2'], - httpPorts: [80], - httpsPorts: [443], - quicPorts: null, - }, - }, deployments: [ { name: '$DEPLOYMENT_NAME', diff --git a/packages/presets/src/presets/gatsby/handler.ts b/packages/presets/src/presets/gatsby/handler.ts index b48977f3..1cca2524 100644 --- a/packages/presets/src/presets/gatsby/handler.ts +++ b/packages/presets/src/presets/gatsby/handler.ts @@ -1,4 +1,4 @@ -import { AzionFetchModule, AzionRuntimeRequest } from 'azion/types'; +import { AzionRuntimeModule, AzionRuntimeRequest } from 'azion/types'; import { mountMPA } from 'azion/utils/edge'; import metadata from './metadata'; /** @@ -7,7 +7,7 @@ import metadata from './metadata'; * @param {Object} ctx - The execution context. * @returns {Promise} The response for the request. */ -const handler: AzionFetchModule = { +const handler: AzionRuntimeModule = { fetch: async (request: AzionRuntimeRequest): Promise => { try { const myApp: Response = await mountMPA(request.url); diff --git a/packages/presets/src/presets/hexo/config.ts b/packages/presets/src/presets/hexo/config.ts index 7aa44ce3..3307dd85 100644 --- a/packages/presets/src/presets/hexo/config.ts +++ b/packages/presets/src/presets/hexo/config.ts @@ -49,14 +49,6 @@ const config: AzionConfig = { name: '$WORKLOAD_NAME', active: true, infrastructure: 1, - protocols: { - http: { - versions: ['http1', 'http2'], - httpPorts: [80], - httpsPorts: [443], - quicPorts: null, - }, - }, deployments: [ { name: '$DEPLOYMENT_NAME', diff --git a/packages/presets/src/presets/html/config.ts b/packages/presets/src/presets/html/config.ts index 442415cb..b3a9eb5a 100644 --- a/packages/presets/src/presets/html/config.ts +++ b/packages/presets/src/presets/html/config.ts @@ -49,14 +49,6 @@ const config: AzionConfig = { name: '$WORKLOAD_NAME', active: true, infrastructure: 1, - protocols: { - http: { - versions: ['http1', 'http2'], - httpPorts: [80], - httpsPorts: [443], - quicPorts: null, - }, - }, deployments: [ { name: '$DEPLOYMENT_NAME', diff --git a/packages/presets/src/presets/hugo/config.ts b/packages/presets/src/presets/hugo/config.ts index 7aa44ce3..3307dd85 100644 --- a/packages/presets/src/presets/hugo/config.ts +++ b/packages/presets/src/presets/hugo/config.ts @@ -49,14 +49,6 @@ const config: AzionConfig = { name: '$WORKLOAD_NAME', active: true, infrastructure: 1, - protocols: { - http: { - versions: ['http1', 'http2'], - httpPorts: [80], - httpsPorts: [443], - quicPorts: null, - }, - }, deployments: [ { name: '$DEPLOYMENT_NAME', diff --git a/packages/presets/src/presets/javascript/config.ts b/packages/presets/src/presets/javascript/config.ts index d4903462..1a3ffa84 100644 --- a/packages/presets/src/presets/javascript/config.ts +++ b/packages/presets/src/presets/javascript/config.ts @@ -53,14 +53,6 @@ const config: AzionConfig = { name: '$WORKLOAD_NAME', active: true, infrastructure: 1, - protocols: { - http: { - versions: ['http1', 'http2'], - httpPorts: [80], - httpsPorts: [443], - quicPorts: null, - }, - }, deployments: [ { name: '$DEPLOYMENT_NAME', diff --git a/packages/presets/src/presets/jekyll/config.ts b/packages/presets/src/presets/jekyll/config.ts index b61fcf65..948c6427 100644 --- a/packages/presets/src/presets/jekyll/config.ts +++ b/packages/presets/src/presets/jekyll/config.ts @@ -49,14 +49,6 @@ const config: AzionConfig = { name: '$WORKLOAD_NAME', active: true, infrastructure: 1, - protocols: { - http: { - versions: ['http1', 'http2'], - httpPorts: [80], - httpsPorts: [443], - quicPorts: null, - }, - }, deployments: [ { name: '$DEPLOYMENT_NAME', diff --git a/packages/presets/src/presets/next/config.ts b/packages/presets/src/presets/next/config.ts index 10a64757..40ff59cf 100644 --- a/packages/presets/src/presets/next/config.ts +++ b/packages/presets/src/presets/next/config.ts @@ -156,14 +156,6 @@ const config: AzionConfig = { name: '$WORKLOAD_NAME', active: true, infrastructure: 1, - protocols: { - http: { - versions: ['http1', 'http2'], - httpPorts: [80], - httpsPorts: [443], - quicPorts: null, - }, - }, deployments: [ { name: '$DEPLOYMENT_NAME', diff --git a/packages/presets/src/presets/next/default/handler/routing/libs.js b/packages/presets/src/presets/next/default/handler/routing/libs.js index 6ca8f4e1..a17dcb07 100644 --- a/packages/presets/src/presets/next/default/handler/routing/libs.js +++ b/packages/presets/src/presets/next/default/handler/routing/libs.js @@ -1,4 +1,3 @@ -import cookie from 'cookie'; import createPCRE from 'pcre-to-regexp/dist/index.js'; -export { cookie, createPCRE }; +export { createPCRE }; diff --git a/packages/presets/src/presets/nuxt/config.ts b/packages/presets/src/presets/nuxt/config.ts index 395361d3..2bf7aaa2 100644 --- a/packages/presets/src/presets/nuxt/config.ts +++ b/packages/presets/src/presets/nuxt/config.ts @@ -246,14 +246,6 @@ const config: AzionConfig = { name: '$WORKLOAD_NAME', active: true, infrastructure: 1, - protocols: { - http: { - versions: ['http1', 'http2'], - httpPorts: [80], - httpsPorts: [443], - quicPorts: null, - }, - }, deployments: [ { name: '$DEPLOYMENT_NAME', diff --git a/packages/presets/src/presets/opennextjs/config.ts b/packages/presets/src/presets/opennextjs/config.ts index c87a0ecb..dab2abe0 100644 --- a/packages/presets/src/presets/opennextjs/config.ts +++ b/packages/presets/src/presets/opennextjs/config.ts @@ -159,14 +159,6 @@ const config: AzionConfig = { name: '$WORKLOAD_NAME', active: true, infrastructure: 1, - protocols: { - http: { - versions: ['http1', 'http2'], - httpPorts: [80], - httpsPorts: [443], - quicPorts: null, - }, - }, deployments: [ { name: '$DEPLOYMENT_NAME', diff --git a/packages/presets/src/presets/preact/config.ts b/packages/presets/src/presets/preact/config.ts index 84b14393..760f66d5 100644 --- a/packages/presets/src/presets/preact/config.ts +++ b/packages/presets/src/presets/preact/config.ts @@ -49,14 +49,6 @@ const config: AzionConfig = { name: '$WORKLOAD_NAME', active: true, infrastructure: 1, - protocols: { - http: { - versions: ['http1', 'http2'], - httpPorts: [80], - httpsPorts: [443], - quicPorts: null, - }, - }, deployments: [ { name: '$DEPLOYMENT_NAME', diff --git a/packages/presets/src/presets/preact/prebuild.ts b/packages/presets/src/presets/preact/prebuild.ts index 963bd4c3..b0123123 100644 --- a/packages/presets/src/presets/preact/prebuild.ts +++ b/packages/presets/src/presets/preact/prebuild.ts @@ -3,7 +3,6 @@ import { copyDirectory, exec, getPackageManager } from 'azion/utils/node'; import { lstat, mkdir, readFile, rm } from 'fs/promises'; import { join } from 'path'; -const packageManager = await getPackageManager(); const edgeStorageDir = '.edge/assets'; const defaultViteOutDir = 'dist'; @@ -62,6 +61,7 @@ async function readViteBuildOutput() { * Runs custom prebuild actions */ async function prebuild(_: BuildConfiguration, ctx: BuildContext) { + const packageManager = await getPackageManager(); const npmArgsForward = packageManager === 'npm' ? '--' : ''; // if skipFrameworkBuild is true, we need to create the dist folder diff --git a/packages/presets/src/presets/qwik/config.ts b/packages/presets/src/presets/qwik/config.ts index 84b14393..760f66d5 100644 --- a/packages/presets/src/presets/qwik/config.ts +++ b/packages/presets/src/presets/qwik/config.ts @@ -49,14 +49,6 @@ const config: AzionConfig = { name: '$WORKLOAD_NAME', active: true, infrastructure: 1, - protocols: { - http: { - versions: ['http1', 'http2'], - httpPorts: [80], - httpsPorts: [443], - quicPorts: null, - }, - }, deployments: [ { name: '$DEPLOYMENT_NAME', diff --git a/packages/presets/src/presets/react/config.ts b/packages/presets/src/presets/react/config.ts index 84b14393..760f66d5 100644 --- a/packages/presets/src/presets/react/config.ts +++ b/packages/presets/src/presets/react/config.ts @@ -49,14 +49,6 @@ const config: AzionConfig = { name: '$WORKLOAD_NAME', active: true, infrastructure: 1, - protocols: { - http: { - versions: ['http1', 'http2'], - httpPorts: [80], - httpsPorts: [443], - quicPorts: null, - }, - }, deployments: [ { name: '$DEPLOYMENT_NAME', diff --git a/packages/presets/src/presets/rustwasm/config.ts b/packages/presets/src/presets/rustwasm/config.ts index bd88d19e..7ffa3265 100644 --- a/packages/presets/src/presets/rustwasm/config.ts +++ b/packages/presets/src/presets/rustwasm/config.ts @@ -79,14 +79,6 @@ const config: AzionConfig = { name: '$WORKLOAD_NAME', active: true, infrastructure: 1, - protocols: { - http: { - versions: ['http1', 'http2'], - httpPorts: [80], - httpsPorts: [443], - quicPorts: null, - }, - }, deployments: [ { name: '$DEPLOYMENT_NAME', diff --git a/packages/presets/src/presets/stencil/config.ts b/packages/presets/src/presets/stencil/config.ts index 442415cb..b3a9eb5a 100644 --- a/packages/presets/src/presets/stencil/config.ts +++ b/packages/presets/src/presets/stencil/config.ts @@ -49,14 +49,6 @@ const config: AzionConfig = { name: '$WORKLOAD_NAME', active: true, infrastructure: 1, - protocols: { - http: { - versions: ['http1', 'http2'], - httpPorts: [80], - httpsPorts: [443], - quicPorts: null, - }, - }, deployments: [ { name: '$DEPLOYMENT_NAME', diff --git a/packages/presets/src/presets/svelte/config.ts b/packages/presets/src/presets/svelte/config.ts index 51a086ed..b88f1a21 100644 --- a/packages/presets/src/presets/svelte/config.ts +++ b/packages/presets/src/presets/svelte/config.ts @@ -216,14 +216,6 @@ const config: AzionConfig = { name: '$WORKLOAD_NAME', active: true, infrastructure: 1, - protocols: { - http: { - versions: ['http1', 'http2'], - httpPorts: [80], - httpsPorts: [443], - quicPorts: null, - }, - }, deployments: [ { name: '$DEPLOYMENT_NAME', diff --git a/packages/presets/src/presets/typescript/config.ts b/packages/presets/src/presets/typescript/config.ts index 6ef3a119..1dd649f0 100644 --- a/packages/presets/src/presets/typescript/config.ts +++ b/packages/presets/src/presets/typescript/config.ts @@ -53,14 +53,6 @@ const config: AzionConfig = { name: '$WORKLOAD_NAME', active: true, infrastructure: 1, - protocols: { - http: { - versions: ['http1', 'http2'], - httpPorts: [80], - httpsPorts: [443], - quicPorts: null, - }, - }, deployments: [ { name: '$DEPLOYMENT_NAME', diff --git a/packages/presets/src/presets/vitepress/config.ts b/packages/presets/src/presets/vitepress/config.ts index d8d9820b..0a47617e 100644 --- a/packages/presets/src/presets/vitepress/config.ts +++ b/packages/presets/src/presets/vitepress/config.ts @@ -49,14 +49,6 @@ const config: AzionConfig = { name: '$WORKLOAD_NAME', active: true, infrastructure: 1, - protocols: { - http: { - versions: ['http1', 'http2'], - httpPorts: [80], - httpsPorts: [443], - quicPorts: null, - }, - }, deployments: [ { name: '$DEPLOYMENT_NAME', diff --git a/packages/presets/src/presets/vue/config.ts b/packages/presets/src/presets/vue/config.ts index 84b14393..760f66d5 100644 --- a/packages/presets/src/presets/vue/config.ts +++ b/packages/presets/src/presets/vue/config.ts @@ -49,14 +49,6 @@ const config: AzionConfig = { name: '$WORKLOAD_NAME', active: true, infrastructure: 1, - protocols: { - http: { - versions: ['http1', 'http2'], - httpPorts: [80], - httpsPorts: [443], - quicPorts: null, - }, - }, deployments: [ { name: '$DEPLOYMENT_NAME', diff --git a/packages/presets/src/presets/vuepress/config.ts b/packages/presets/src/presets/vuepress/config.ts index d8d9820b..0a47617e 100644 --- a/packages/presets/src/presets/vuepress/config.ts +++ b/packages/presets/src/presets/vuepress/config.ts @@ -49,14 +49,6 @@ const config: AzionConfig = { name: '$WORKLOAD_NAME', active: true, infrastructure: 1, - protocols: { - http: { - versions: ['http1', 'http2'], - httpPorts: [80], - httpsPorts: [443], - quicPorts: null, - }, - }, deployments: [ { name: '$DEPLOYMENT_NAME', diff --git a/packages/presets/tsup.config.json b/packages/presets/tsup.config.json deleted file mode 100644 index e2cea0b6..00000000 --- a/packages/presets/tsup.config.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "entry": ["src/index.ts"], - "format": ["cjs", "esm"], - "splitting": true, - "sourcemap": false, - "clean": true, - "bundle": true, - "dts": true, - "minify": true, - "minifyWhitespace": true, - "external": [ - "./build/module", - "./.wasm-bindgen/azion_rust_edge_function.js", - "./.wasm-bindgen/azion_rust_edge_function_bg.wasm", - "signale", - "fast-glob", - "mime-types", - "path" - ], - "ignoreWarnings": [ - { - "code": "direct-eval", - "message": "Using direct eval with a bundler is not recommended and may cause problems" - } - ] -} diff --git a/packages/presets/tsup.config.ts b/packages/presets/tsup.config.ts deleted file mode 100644 index fe52fcb7..00000000 --- a/packages/presets/tsup.config.ts +++ /dev/null @@ -1,46 +0,0 @@ -import fs from 'fs'; -import path from 'path'; -import { defineConfig } from 'tsup'; - -const presetDir = path.resolve(__dirname, 'src/presets'); - -const getPresetsEntries = () => { - return fs - .readdirSync(presetDir, { withFileTypes: true }) - .filter((dirent) => { - // ckeck if is a directory and has a handler file inside - return dirent.isDirectory() && fs.existsSync(path.join(presetDir, dirent.name, 'handler.ts')); - }) - .reduce( - (entries, dirent) => { - const presetName = dirent.name; - entries[`presets/${presetName}/handler`] = `src/presets/${presetName}/handler.ts`; - return entries; - }, - {} as Record, - ); -}; - -export default defineConfig({ - entry: { - ...getPresetsEntries(), - }, - format: ['cjs', 'esm'], - splitting: true, - sourcemap: false, - clean: false, - bundle: true, - dts: false, - minifyWhitespace: true, - external: [ - './build/module', - './.wasm-bindgen/azion_rust_edge_function.js', - './.wasm-bindgen/azion_rust_edge_function_bg.wasm', - 'signale', - 'fast-glob', - 'mime-types', - 'fs', - 'fs/promises', - 'path', - ], -}); diff --git a/packages/presets/vite.config.mjs b/packages/presets/vite.config.mjs new file mode 100644 index 00000000..4c49d36b --- /dev/null +++ b/packages/presets/vite.config.mjs @@ -0,0 +1,40 @@ +import { createViteConfig } from '@lib/vite-config'; +import { resolve } from 'path'; + +export default createViteConfig({ + dirname: __dirname, + ssr: true, + alias: { + 'azion/unenv-preset': resolve(__dirname, '../unenv-preset/src/'), + 'azion/utils/edge': resolve(__dirname, '../utils/src/edge/'), + 'azion/utils/node': resolve(__dirname, '../utils/src/node/'), + 'azion/utils': resolve(__dirname, '../utils/src/'), + 'azion/config': resolve(__dirname, '../config/src/'), + 'azion/config/rules': resolve(__dirname, '../config/src/rules/'), + 'azion/presets': resolve(__dirname, '../presets/src/'), + 'azion/bundler': resolve(__dirname, '../bundler/src/'), + 'azion/types': resolve(__dirname, '../types/src/'), + }, + external: (id) => { + if (id.includes('node_modules')) return true; + + const deps = [ + './build/module', + './.wasm-bindgen/azion_rust_edge_function.js', + './.wasm-bindgen/azion_rust_edge_function_bg.wasm', + 'signale', + 'fast-glob', + 'mime-types', + 'fs', + 'fs/promises', + 'path', + 'cookie', + ]; + + return deps.some((dep) => id === dep || id.startsWith(`${dep}/`)); + }, + dts: { + include: ['src/**/*', 'src/types.ts'], + aliasesExclude: [/^azion\//], + }, +}); diff --git a/packages/presets/vite.config.presets.js b/packages/presets/vite.config.presets.js new file mode 100644 index 00000000..94037f38 --- /dev/null +++ b/packages/presets/vite.config.presets.js @@ -0,0 +1,75 @@ +import fs from 'fs'; +import { resolve } from 'path'; +import { defineConfig } from 'vite'; + +const presetDir = resolve(__dirname, 'src/presets'); + +const getPresetsEntries = () => { + return fs + .readdirSync(presetDir, { withFileTypes: true }) + .filter((dirent) => { + // ckeck if is a directory and has a handler file inside + return dirent.isDirectory() && fs.existsSync(resolve(presetDir, dirent.name, 'handler.ts')); + }) + .reduce((entries, dirent) => { + const presetName = dirent.name; + entries[`presets/${presetName}/handler`] = resolve(__dirname, `src/presets/${presetName}/handler.ts`); + return entries; + }, {}); +}; + +export default defineConfig({ + resolve: { + alias: { + 'azion/unenv-preset': resolve(__dirname, '../unenv-preset/src/'), + 'azion/utils/edge': resolve(__dirname, '../utils/src/edge/'), + 'azion/utils/node': resolve(__dirname, '../utils/src/node/'), + 'azion/utils': resolve(__dirname, '../utils/src/'), + 'azion/config/rules': resolve(__dirname, '../config/src/rules/'), + 'azion/config': resolve(__dirname, '../config/src/'), + 'azion/presets': resolve(__dirname, '../presets/src/'), + 'azion/bundler': resolve(__dirname, '../bundler/src/'), + 'azion/types': resolve(__dirname, '../types/src/'), + }, + }, + build: { + ssr: true, + emptyOutDir: false, + lib: { + entry: { + ...getPresetsEntries(), + }, + }, + rollupOptions: { + external: (id) => { + if (id.includes('node_modules')) return true; + + const deps = [ + './build/module', + './.wasm-bindgen/azion_rust_edge_function.js', + './.wasm-bindgen/azion_rust_edge_function_bg.wasm', + 'signale', + 'fast-glob', + 'mime-types', + 'fs', + 'fs/promises', + 'path', + ]; + + return deps.some((dep) => id === dep || id.startsWith(`${dep}/`)); + }, + output: [ + { + format: 'es', + entryFileNames: '[name].js', + }, + { + format: 'cjs', + entryFileNames: '[name].cjs', + exports: 'named', + }, + ], + }, + minify: true, + }, +}); diff --git a/packages/purge/package.json b/packages/purge/package.json index 9d6f9776..0dc81ab5 100644 --- a/packages/purge/package.json +++ b/packages/purge/package.json @@ -2,11 +2,11 @@ "name": "@lib/purge", "version": "1.0.0", "description": "", - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", "scripts": { - "compile": "tsup --config ../../tsup.config.json", + "compile": "vite build", "lint": "eslint .", "lint:fix": "eslint --fix .", "prettier": "prettier --write .", @@ -16,7 +16,8 @@ }, "exports": { ".": { - "require": "./dist/index.js", + "types": "./dist/index.d.ts", + "require": "./dist/index.cjs", "import": "./dist/index.mjs" } }, diff --git a/packages/purge/vite.config.mjs b/packages/purge/vite.config.mjs new file mode 100644 index 00000000..dddbb7ff --- /dev/null +++ b/packages/purge/vite.config.mjs @@ -0,0 +1,5 @@ +import { createViteConfig } from '@lib/vite-config'; + +export default createViteConfig({ + dirname: __dirname, +}); diff --git a/packages/router/package.json b/packages/router/package.json index 7bbb609a..f6102da9 100644 --- a/packages/router/package.json +++ b/packages/router/package.json @@ -2,11 +2,11 @@ "name": "@lib/router", "version": "1.0.0", "description": "", - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", "scripts": { - "compile": "tsup --config ../../tsup.config.json", + "compile": "vite build", "lint": "eslint .", "lint:fix": "eslint --fix .", "prettier": "prettier --write .", @@ -14,7 +14,8 @@ }, "exports": { ".": { - "require": "./dist/index.js", + "types": "./dist/index.d.ts", + "require": "./dist/index.cjs", "import": "./dist/index.mjs" } }, diff --git a/packages/router/vite.config.mjs b/packages/router/vite.config.mjs new file mode 100644 index 00000000..dddbb7ff --- /dev/null +++ b/packages/router/vite.config.mjs @@ -0,0 +1,5 @@ +import { createViteConfig } from '@lib/vite-config'; + +export default createViteConfig({ + dirname: __dirname, +}); diff --git a/packages/sql/package.json b/packages/sql/package.json index df1b0d67..1fe382bf 100644 --- a/packages/sql/package.json +++ b/packages/sql/package.json @@ -2,11 +2,11 @@ "name": "@lib/sql", "version": "1.0.0", "description": "", - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", "scripts": { - "compile": "tsup --config ../../tsup.config.json", + "compile": "vite build", "lint": "eslint .", "lint:fix": "eslint --fix .", "prettier": "prettier --write .", @@ -16,7 +16,8 @@ }, "exports": { ".": { - "require": "./dist/index.js", + "types": "./dist/index.d.ts", + "require": "./dist/index.cjs", "import": "./dist/index.mjs" } }, diff --git a/packages/sql/vite.config.mjs b/packages/sql/vite.config.mjs new file mode 100644 index 00000000..dddbb7ff --- /dev/null +++ b/packages/sql/vite.config.mjs @@ -0,0 +1,5 @@ +import { createViteConfig } from '@lib/vite-config'; + +export default createViteConfig({ + dirname: __dirname, +}); diff --git a/packages/storage/package.json b/packages/storage/package.json index b783d18a..e9ad34c3 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -2,11 +2,11 @@ "name": "@lib/storage", "version": "1.0.0", "description": "", - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", "scripts": { - "compile": "tsup --config ../../tsup.config.json", + "compile": "vite build", "lint": "eslint .", "lint:fix": "eslint --fix .", "prettier": "prettier --write .", @@ -16,7 +16,8 @@ }, "exports": { ".": { - "require": "./dist/index.js", + "types": "./dist/index.d.ts", + "require": "./dist/index.cjs", "import": "./dist/index.mjs" } }, diff --git a/packages/storage/vite.config.mjs b/packages/storage/vite.config.mjs new file mode 100644 index 00000000..dddbb7ff --- /dev/null +++ b/packages/storage/vite.config.mjs @@ -0,0 +1,5 @@ +import { createViteConfig } from '@lib/vite-config'; + +export default createViteConfig({ + dirname: __dirname, +}); diff --git a/packages/types/package.json b/packages/types/package.json index d83ef3fd..d306eeb9 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -2,15 +2,22 @@ "name": "@azion/types", "version": "1.0.0", "description": "Global types for Azion packages", - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", "scripts": { - "compile": "tsup --config ../../tsup.config.json", + "compile": "vite build", "lint": "eslint .", "lint:fix": "eslint --fix .", "prettier": "prettier --write ." }, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "require": "./dist/index.cjs", + "import": "./dist/index.mjs" + } + }, "author": "aziontech", "license": "MIT", "files": [ diff --git a/packages/types/vite.config.mjs b/packages/types/vite.config.mjs new file mode 100644 index 00000000..dddbb7ff --- /dev/null +++ b/packages/types/vite.config.mjs @@ -0,0 +1,5 @@ +import { createViteConfig } from '@lib/vite-config'; + +export default createViteConfig({ + dirname: __dirname, +}); diff --git a/packages/unenv-preset/package.json b/packages/unenv-preset/package.json index 65b95f2e..85249a0d 100644 --- a/packages/unenv-preset/package.json +++ b/packages/unenv-preset/package.json @@ -2,15 +2,23 @@ "name": "@lib/unenv-preset", "version": "1.0.0", "description": "Azion Unenv preset.", - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", "scripts": { - "compile": "tsup --config ../../tsup.config.json", + "compile": "vite build", "lint": "eslint .", "lint:fix": "eslint --fix .", "prettier": "prettier --write ." }, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "require": "./dist/index.cjs", + "import": "./dist/index.mjs" + }, + "./polyfills/*": "./src/polyfills/*" + }, "author": "aziontech", "license": "MIT", "files": [ diff --git a/packages/unenv-preset/vite.config.mjs b/packages/unenv-preset/vite.config.mjs new file mode 100644 index 00000000..7aaae564 --- /dev/null +++ b/packages/unenv-preset/vite.config.mjs @@ -0,0 +1,7 @@ +import { createViteConfig } from '@lib/vite-config'; + +export default createViteConfig({ + dirname: __dirname, + ssr: true, + external: ['crypto-browserify'], +}); diff --git a/packages/utils/package.json b/packages/utils/package.json index 63cbd2ce..3c59ca89 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -3,11 +3,11 @@ "version": "1.0.0", "description": "", "main": "./dist/index.cjs", - "module": "./dist/index.js", + "module": "./dist/index.mjs", "types": "./dist/index.d.ts", "type": "module", "scripts": { - "compile": "tsup --config ./tsup.config.ts", + "compile": "vite build", "lint": "eslint .", "lint:fix": "eslint --fix .", "test": "jest --clearCache && jest --maxWorkers=1 -c jest.config.js .", @@ -20,17 +20,17 @@ ".": { "types": "./dist/index.d.ts", "require": "./dist/index.cjs", - "import": "./dist/index.js" + "import": "./dist/index.mjs" }, "./edge": { - "types": "./dist/edge/index.d.ts", - "require": "./dist/edge/index.cjs", - "import": "./dist/edge/index.js" + "types": "./dist/edge.d.ts", + "require": "./dist/edge.cjs", + "import": "./dist/edge.mjs" }, "./node": { - "types": "./dist/node/index.d.ts", - "require": "./dist/node/index.cjs", - "import": "./dist/node/index.js" + "types": "./dist/node.d.ts", + "require": "./dist/node.cjs", + "import": "./dist/node.mjs" } }, "author": "aziontech", diff --git a/packages/utils/tsup.config.ts b/packages/utils/tsup.config.ts deleted file mode 100644 index a2b08309..00000000 --- a/packages/utils/tsup.config.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default defineConfig({ - entry: ['src/index.ts', 'src/edge/index.ts', 'src/node/index.ts'], - format: ['cjs', 'esm'], - splitting: true, - sourcemap: false, - clean: true, - bundle: true, - dts: true, - minify: true, - minifyWhitespace: true, - external: [ - './build/module', - './.wasm-bindgen/azion_rust_edge_function', - './.wasm-bindgen/azion_rust_edge_function_bg.wasm', - 'signale', - 'fs', - 'fs/promises', - 'path', - ], -}); diff --git a/packages/utils/vite.config.mjs b/packages/utils/vite.config.mjs new file mode 100644 index 00000000..dba3dfc5 --- /dev/null +++ b/packages/utils/vite.config.mjs @@ -0,0 +1,12 @@ +import { createViteConfig } from '@lib/vite-config'; + +export default createViteConfig({ + dirname: __dirname, + ssr: true, + entry: { + index: 'src/index.ts', + edge: 'src/edge/index.ts', + node: 'src/node/index.ts', + }, + external: ['signale'], +}); diff --git a/packages/vite-config/README.md b/packages/vite-config/README.md new file mode 100644 index 00000000..b0873a38 --- /dev/null +++ b/packages/vite-config/README.md @@ -0,0 +1,96 @@ +# @lib/vite-config + +Shared Vite configuration for Azion library packages. + +## Usage + +### Basic Configuration + +```js +import { createViteConfig } from '@lib/vite-config'; + +export default createViteConfig({ + dirname: __dirname, +}); +``` + +### With SSR + +```js +import { createViteConfig } from '@lib/vite-config'; + +export default createViteConfig({ + dirname: __dirname, + ssr: true, +}); +``` + +### With External Dependencies + +```js +import { createViteConfig } from '@lib/vite-config'; + +export default createViteConfig({ + dirname: __dirname, + external: ['dependency1', 'dependency2'], +}); +``` + +### With Multiple Entry Points + +```js +import { createViteConfig } from '@lib/vite-config'; + +export default createViteConfig({ + dirname: __dirname, + entry: { + index: 'src/index.ts', + utils: 'src/utils/index.ts', + }, +}); +``` + +### With Aliases + +```js +import { resolve } from 'path'; +import { createViteConfig } from '@lib/vite-config'; + +export default createViteConfig({ + dirname: __dirname, + alias: { + '@utils': resolve(__dirname, '../utils/src/'), + }, + dts: { + aliasesExclude: [/@utils/], + }, +}); +``` + +### With Custom Plugins + +```js +import { defineConfig } from 'vite'; +import { createViteConfig } from '@lib/vite-config'; +import customPlugin from './custom-plugin'; + +const baseConfig = createViteConfig({ + dirname: __dirname, +}); + +export default defineConfig({ + ...baseConfig, + plugins: [customPlugin(), ...baseConfig.plugins], +}); +``` + +## Options + +- **dirname** (required): `__dirname` of the package +- **entry**: Entry points (default: `{ index: 'src/index.ts' }`) +- **alias**: Resolve aliases object +- **external**: External dependencies (array or function) +- **ssr**: Enable SSR mode (default: `false`) +- **dts**: DTS plugin options override +- **sourcemap**: Enable sourcemap (default: `false`) +- **buildOptions**: Additional build options diff --git a/packages/vite-config/package.json b/packages/vite-config/package.json new file mode 100644 index 00000000..21f3f076 --- /dev/null +++ b/packages/vite-config/package.json @@ -0,0 +1,25 @@ +{ + "name": "@lib/vite-config", + "version": "1.0.0", + "description": "Shared Vite configuration for Azion packages", + "private": true, + "type": "module", + "main": "./src/index.js", + "types": "./src/index.d.ts", + "scripts": { + "compile": "echo 'No compilation needed for @lib/vite-config'" + }, + "exports": { + ".": { + "types": "./src/index.d.ts", + "import": "./src/index.js" + } + }, + "files": [ + "src" + ], + "peerDependencies": { + "vite": "^7.3.1", + "vite-plugin-dts": "^4.5.4" + } +} diff --git a/packages/vite-config/src/index.d.ts b/packages/vite-config/src/index.d.ts new file mode 100644 index 00000000..4f276af8 --- /dev/null +++ b/packages/vite-config/src/index.d.ts @@ -0,0 +1,54 @@ +import { UserConfig } from 'vite'; + +export interface ViteConfigOptions { + /** + * __dirname of the package + */ + dirname: string; + + /** + * Entry points (default: { index: 'src/index.ts' }) + */ + entry?: string | Record; + + /** + * Resolve aliases + */ + alias?: Record; + + /** + * External dependencies (array or function) + */ + external?: string[] | ((id: string) => boolean); + + /** + * Enable SSR mode (default: false) + */ + ssr?: boolean; + + /** + * DTS plugin options override + */ + dts?: { + include?: string[]; + exclude?: string[]; + rollupTypes?: boolean; + aliasesExclude?: RegExp[]; + [key: string]: any; + }; + + /** + * Enable sourcemap (default: false) + */ + sourcemap?: boolean; + + /** + * Additional build options + */ + buildOptions?: Record; +} + +/** + * Creates a Vite config for library packages + */ +export function createViteConfig(options: ViteConfigOptions): UserConfig; diff --git a/packages/vite-config/src/index.js b/packages/vite-config/src/index.js new file mode 100644 index 00000000..bf54d57f --- /dev/null +++ b/packages/vite-config/src/index.js @@ -0,0 +1,71 @@ +import { resolve } from 'path'; +import { defineConfig } from 'vite'; +import dts from 'vite-plugin-dts'; + +/** + * Creates a Vite config for library packages + * @param {Object} options - Configuration options + * @param {string} options.dirname - __dirname of the package + * @param {Object|string} [options.entry] - Entry points (default: { index: 'src/index.ts' }) + * @param {Object} [options.alias] - Resolve aliases + * @param {Array|Function} [options.external] - External dependencies + * @param {boolean} [options.ssr] - Enable SSR mode (default: false) + * @param {Object} [options.dts] - DTS plugin options override + * @param {boolean} [options.sourcemap] - Enable sourcemap (default: false) + * @param {Object} [options.buildOptions] - Additional build options + * @returns {import('vite').UserConfig} + */ +export function createViteConfig(options) { + const { + dirname, + entry = { index: resolve(dirname, 'src/index.ts') }, + alias = {}, + external = [], + ssr = false, + dts: dtsOptions = {}, + sourcemap = false, + buildOptions = {}, + } = options; + + const normalizedEntry = typeof entry === 'string' + ? { index: resolve(dirname, entry) } + : Object.entries(entry).reduce((acc, [key, value]) => { + acc[key] = resolve(dirname, value); + return acc; + }, {}); + + const defaultDtsOptions = { + include: ['src/**/*'], + exclude: ['src/**/*.test.ts'], + rollupTypes: true, + ...dtsOptions, + }; + + return defineConfig({ + resolve: Object.keys(alias).length > 0 ? { alias } : undefined, + build: { + ...(ssr && { ssr: true }), + lib: { + entry: normalizedEntry, + }, + rollupOptions: { + external, + output: [ + { + format: 'es', + entryFileNames: '[name].mjs', + }, + { + format: 'cjs', + entryFileNames: '[name].cjs', + exports: 'named', + }, + ], + }, + minify: true, + sourcemap, + ...buildOptions, + }, + plugins: [dts(defaultDtsOptions)], + }); +} diff --git a/packages/wasm-image-processor/package.json b/packages/wasm-image-processor/package.json index 95979e4f..2add844d 100644 --- a/packages/wasm-image-processor/package.json +++ b/packages/wasm-image-processor/package.json @@ -2,11 +2,11 @@ "name": "@lib/wasm-image-processor", "version": "1.0.0", "description": "", - "main": "./dist/index.js", + "main": "./dist/index.cjs", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", "scripts": { - "compile": "tsup --config ./tsup.config.ts", + "compile": "vite build --config vite.config.mjs", "lint": "eslint .", "lint:fix": "eslint --fix .", "prettier": "prettier --write .", @@ -17,7 +17,8 @@ }, "exports": { ".": { - "require": "./dist/index.js", + "types": "./dist/index.d.ts", + "require": "./dist/index.cjs", "import": "./dist/index.mjs" } }, @@ -30,7 +31,6 @@ "devDependencies": { "@types/jest": "^29.5.12", "jest": "^29.7.0", - "ts-jest": "^29.1.2", - "tsup": "^8.0.2" + "ts-jest": "^29.1.2" } } diff --git a/packages/wasm-image-processor/src/vite/wasmPlugin.js b/packages/wasm-image-processor/src/vite/wasmPlugin.js new file mode 100644 index 00000000..aa30eb6d --- /dev/null +++ b/packages/wasm-image-processor/src/vite/wasmPlugin.js @@ -0,0 +1,22 @@ +import fs from 'node:fs'; + +export default function wasmPlugin() { + return { + name: 'vite-plugin-wasm-inline', + + async load(id) { + if (!id.endsWith('.wasm')) { + return null; + } + + const wasmBuffer = await fs.promises.readFile(id); + const base64 = wasmBuffer.toString('base64'); + + return ` + const wasmBase64 = '${base64}'; + const wasmBinary = Uint8Array.from(atob(wasmBase64), c => c.charCodeAt(0)); + export default wasmBinary; + `; + }, + }; +} diff --git a/packages/wasm-image-processor/tsup.config.ts b/packages/wasm-image-processor/tsup.config.ts deleted file mode 100644 index 8ef7fadf..00000000 --- a/packages/wasm-image-processor/tsup.config.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ -/* eslint-disable @typescript-eslint/no-explicit-any */ -import { defineConfig } from 'tsup'; -import WasmPlugin from './src/esbuild/wasmPlugin'; - -export default defineConfig({ - entry: ['src/index.ts'], - format: ['cjs', 'esm'], - splitting: true, - sourcemap: false, - clean: true, - bundle: true, - dts: true, - minify: true, - minifyWhitespace: true, - esbuildPlugins: [WasmPlugin], - esbuildOptions(options: any, _context: any) { - options.platform = 'browser'; - }, -}); diff --git a/packages/wasm-image-processor/vite.config.mjs b/packages/wasm-image-processor/vite.config.mjs new file mode 100644 index 00000000..e421f0e6 --- /dev/null +++ b/packages/wasm-image-processor/vite.config.mjs @@ -0,0 +1,13 @@ +import { createViteConfig } from '@lib/vite-config'; +import { defineConfig } from 'vite'; +import wasmPlugin from './src/vite/wasmPlugin'; + +const baseConfig = createViteConfig({ + dirname: __dirname, + ssr: true, +}); + +export default defineConfig({ + ...baseConfig, + plugins: [wasmPlugin(), ...baseConfig.plugins], +}); diff --git a/tsup.config.json b/tsup.config.json deleted file mode 100644 index 07e54eae..00000000 --- a/tsup.config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "entry": ["src/index.ts", "src/edge/index.ts", "src/node/index.ts"], - "format": ["cjs", "esm"], - "splitting": true, - "sourcemap": false, - "clean": true, - "bundle": true, - "dts": true, - "minify": true, - "minifyWhitespace": true, - "external": [ - "./build/module", - "./.wasm-bindgen/azion_rust_edge_function", - "./.wasm-bindgen/azion_rust_edge_function_bg.wasm" - ] -}