diff --git a/.changeset/chilled-houses-report.md b/.changeset/chilled-houses-report.md new file mode 100644 index 0000000000..aaa154315a --- /dev/null +++ b/.changeset/chilled-houses-report.md @@ -0,0 +1,5 @@ +--- +'@ryanatkn/gro': minor +--- + +fix `Filer` to resolve node modules diff --git a/gro.config.ts b/gro.config.ts index f90d889320..69f63aa4ce 100644 --- a/gro.config.ts +++ b/gro.config.ts @@ -1,5 +1,4 @@ -// TODO see below -// import {gro_plugin_moss} from '@ryanatkn/moss/gro_plugin_moss.js'; +import {gro_plugin_moss} from '@ryanatkn/moss/gro_plugin_moss.js'; import {create_empty_gro_config} from './src/lib/gro_config.js'; import {gro_plugin_sveltekit_library} from './src/lib/gro_plugin_sveltekit_library.js'; @@ -15,10 +14,7 @@ import {gro_plugin_gen} from './src/lib/gro_plugin_gen.js'; const config = create_empty_gro_config(); config.plugins = () => [ - // TODO how to do this? moss imports gro, so it needs to exist in node_modules, - // maybe the fix is to add an exception for gro in the loader if the project is gro? - // would still need to hack the type I guess but that's fine? - // gro_plugin_moss(), + gro_plugin_moss() as any, // TODO hack around self imports, Moss is importing into Gro (maybe extract `format_file` etc) gro_plugin_sveltekit_library(), gro_plugin_sveltekit_app(), gro_plugin_gen(), diff --git a/package-lock.json b/package-lock.json index 5085febceb..807e180dec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "prettier": "^3.3.3", "prettier-plugin-svelte": "^3.2.7", "ts-morph": "^24.0.0", - "tslib": "^2.7.0", + "tslib": "^2.8.0", "zod": "^3.23.8" }, "bin": { @@ -28,21 +28,21 @@ "@changesets/changelog-git": "^0.2.0", "@changesets/types": "^6.0.0", "@ryanatkn/eslint-config": "^0.5.5", - "@ryanatkn/fuz": "^0.129.2", - "@ryanatkn/moss": "^0.18.0", - "@sveltejs/adapter-static": "^3.0.5", - "@sveltejs/kit": "^2.6.4", - "@sveltejs/package": "^2.3.5", - "@sveltejs/vite-plugin-svelte": "^4.0.0-next.6", + "@ryanatkn/fuz": "^0.129.5", + "@ryanatkn/moss": "^0.18.2", + "@sveltejs/adapter-static": "^3.0.6", + "@sveltejs/kit": "^2.7.3", + "@sveltejs/package": "^2.3.7", + "@sveltejs/vite-plugin-svelte": "^4.0.0", "@types/fs-extra": "^11.0.4", - "@types/node": "^22.7.5", + "@types/node": "^22.8.1", "esbuild": "^0.21.5", - "eslint": "^9.12.0", - "eslint-plugin-svelte": "^2.44.1", - "svelte": "^5.0.0-next.264", - "svelte-check": "^4.0.4", + "eslint": "^9.13.0", + "eslint-plugin-svelte": "^2.46.0", + "svelte": "^5.1.3", + "svelte-check": "^4.0.5", "typescript": "^5.6.3", - "typescript-eslint": "^8.8.1", + "typescript-eslint": "^8.11.0", "uvu": "^0.5.6" }, "engines": { @@ -104,17 +104,20 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", + "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", "dev": true, "license": "MIT", "dependencies": { - "eslint-visitor-keys": "^3.3.0" + "eslint-visitor-keys": "^3.4.3" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, + "funding": { + "url": "https://opencollective.com/eslint" + }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } @@ -133,9 +136,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.1.tgz", - "integrity": "sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==", + "version": "4.11.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.2.tgz", + "integrity": "sha512-2WwyTYNVaMNUWPZTOJdkax9iqTdirrApgTbk+Qoq5EPX6myqZvG8QGFRgdKmkjKVG6/G/a565vpPauHk0+hpBA==", "dev": true, "license": "MIT", "engines": { @@ -158,9 +161,9 @@ } }, "node_modules/@eslint/core": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.6.0.tgz", - "integrity": "sha512-8I2Q8ykA4J0x0o7cg67FPVnehcqWTBehu/lmY+bolPFHGjh49YzGBMXTvpqVgEbBdvNCSxj6iFgiIyHzf03lzg==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.7.0.tgz", + "integrity": "sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw==", "dev": true, "license": "Apache-2.0", "engines": { @@ -205,9 +208,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.12.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.12.0.tgz", - "integrity": "sha512-eohesHH8WFRUprDNyEREgqP6beG6htMeUYeCpkEgBCieCMme5r9zFWjzAJp//9S+Kub4rqE+jXe9Cp1a7IYIIA==", + "version": "9.13.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.13.0.tgz", + "integrity": "sha512-IFLyoY4d72Z5y/6o/BazFBezupzI/taV8sGumxTAVw3lXG9A6md1Dc34T9s1FoD/an9pJH8RHbAxsaEbBed9lA==", "dev": true, "license": "MIT", "engines": { @@ -225,9 +228,9 @@ } }, "node_modules/@eslint/plugin-kit": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.0.tgz", - "integrity": "sha512-vH9PiIMMwvhCx31Af3HiGzsVNULDbyVkHXwlemn/B0TFj/00ho3y55efXrUZTfQipxoHC5u4xq6zblww1zm1Ig==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.1.tgz", + "integrity": "sha512-HFZ4Mp26nbWk9d/BpvP0YNL6W4UoZF0VFcTw/aPPA8RpOxeFQgK+ClABGgAUXs9Y/RGX/l1vOmrqz1MQt9MNuw==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -397,21 +400,6 @@ ], "peer": true }, - "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.24.0.tgz", - "integrity": "sha512-w1i+L7kAXZNdYl+vFvzSZy8Y1arS7vMgIy8wusXJzRrPyof5LAb02KGr1PD2EkRcl73kHulIID0M501lN+vobQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true - }, "node_modules/@ryanatkn/belt": { "version": "0.25.3", "resolved": "https://registry.npmjs.org/@ryanatkn/belt/-/belt-0.25.3.tgz", @@ -454,9 +442,9 @@ } }, "node_modules/@ryanatkn/fuz": { - "version": "0.129.2", - "resolved": "https://registry.npmjs.org/@ryanatkn/fuz/-/fuz-0.129.2.tgz", - "integrity": "sha512-GoU9oq8kgPQ2IU7vDS7ZNo+q7m0bNgrOrHaEAutHQOytwgYVohOEc0Y3JQIiIZbnEk1kyc1WiXzgXX4b7DWF6g==", + "version": "0.129.5", + "resolved": "https://registry.npmjs.org/@ryanatkn/fuz/-/fuz-0.129.5.tgz", + "integrity": "sha512-G6sblBKNZsuAJ1lqXQuCgWVupSjwDI35xb9lwCJW8AWYE38AqTs/BCsKC8ByDEX9plwA1l0izQDzrolUBA692w==", "dev": true, "license": "MIT", "engines": { @@ -478,103 +466,10 @@ } } }, - "node_modules/@ryanatkn/gro": { - "version": "0.139.2", - "resolved": "https://registry.npmjs.org/@ryanatkn/gro/-/gro-0.139.2.tgz", - "integrity": "sha512-IB6dXwRca/GMjvlwCpZZgpYhGlhXbkbvLrR9NTPHuilVMc/MX+xW5mquM0NJ2l9wCoWYWzYWOujFrBCQoKJeQA==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "@ryanatkn/belt": "^0.25.3", - "chokidar": "^4.0.1", - "dotenv": "^16.4.5", - "es-module-lexer": "^1.5.4", - "esm-env": "^1.0.0", - "mri": "^1.2.0", - "prettier": "^3.3.3", - "prettier-plugin-svelte": "^3.2.7", - "ts-morph": "^23.0.0", - "tslib": "^2.7.0", - "zod": "^3.23.8" - }, - "bin": { - "gro": "dist/gro.js" - }, - "engines": { - "node": ">=20.17" - }, - "funding": { - "url": "https://www.ryanatkn.com/funding" - }, - "peerDependencies": { - "esbuild": "^0.21.0", - "svelte": "^5.0.0-next.0" - } - }, - "node_modules/@ryanatkn/gro/node_modules/@ts-morph/common": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.24.0.tgz", - "integrity": "sha512-c1xMmNHWpNselmpIqursHeOHHBTIsJLbB+NuovbTTRCNiTLEr/U9dbJ8qy0jd/O2x5pc3seWuOUN5R2IoOTp8A==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "fast-glob": "^3.3.2", - "minimatch": "^9.0.4", - "mkdirp": "^3.0.1", - "path-browserify": "^1.0.1" - } - }, - "node_modules/@ryanatkn/gro/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@ryanatkn/gro/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", - "optional": true, - "peer": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@ryanatkn/gro/node_modules/ts-morph": { - "version": "23.0.0", - "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-23.0.0.tgz", - "integrity": "sha512-FcvFx7a9E8TUe6T3ShihXJLiJOiqyafzFKUO4aqIHDUCIvADdGNShcbc2W5PMr3LerXRv7mafvFZ9lRENxJmug==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "@ts-morph/common": "~0.24.0", - "code-block-writer": "^13.0.1" - } - }, "node_modules/@ryanatkn/moss": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/@ryanatkn/moss/-/moss-0.18.0.tgz", - "integrity": "sha512-iPiu2Lmtz1VPkA26CON0LpPa7vbEUtr8Vyj0XxqG5RPA2XrpdOJqLyE9W5sEGvsyK/7Rb+fiGJtxZ5UuyqeGlw==", + "version": "0.18.2", + "resolved": "https://registry.npmjs.org/@ryanatkn/moss/-/moss-0.18.2.tgz", + "integrity": "sha512-VoWHcv4DGy1exKcoPw1Ml0oHpOudTf6qQ6lw4SuyCW7GUIDt8BtAGe4Jm9iPD+nfsTMkQdSYaElzIqCmbuwDDQ==", "dev": true, "license": "MIT", "engines": { @@ -585,9 +480,9 @@ } }, "node_modules/@sveltejs/adapter-static": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@sveltejs/adapter-static/-/adapter-static-3.0.5.tgz", - "integrity": "sha512-kFJR7RxeB6FBvrKZWAEzIALatgy11ISaaZbcPup8JdWUdrmmfUHHTJ738YHJTEfnCiiXi6aX8Q6ePY7tnSMD6Q==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@sveltejs/adapter-static/-/adapter-static-3.0.6.tgz", + "integrity": "sha512-MGJcesnJWj7FxDcB/GbrdYD3q24Uk0PIL4QIX149ku+hlJuj//nxUbb0HxUTpjkecWfHjVveSUnUaQWnPRXlpg==", "dev": true, "license": "MIT", "peerDependencies": { @@ -595,9 +490,9 @@ } }, "node_modules/@sveltejs/kit": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-2.6.4.tgz", - "integrity": "sha512-qfcbyWw35cy6k9sQ1GUkhuE5qj+PgPKJx3/Aa3+veooWgN0DXZXqMS2PDgpgKDXRIFj6V1KWmMZYYPOhL45lXg==", + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-2.7.3.tgz", + "integrity": "sha512-Vx7nq5MJ86I8qXYsVidC5PX6xm+uxt8DydvOdmJoyOK7LvGP18OFEG359yY+aa51t6pENvqZAMqAREQQx1OI2Q==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -612,7 +507,7 @@ "mrmime": "^2.0.0", "sade": "^1.8.1", "set-cookie-parser": "^2.6.0", - "sirv": "^2.0.4", + "sirv": "^3.0.0", "tiny-glob": "^0.2.9" }, "bin": { @@ -628,9 +523,9 @@ } }, "node_modules/@sveltejs/package": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@sveltejs/package/-/package-2.3.5.tgz", - "integrity": "sha512-fxWSG+pJHxWwcKltG+JoQ+P1CPO7NHVuZD1Gchi/1mNN6C60yD/voHeeXlqr0HHGkvIrpAjRIHLjsavI77Qsiw==", + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/@sveltejs/package/-/package-2.3.7.tgz", + "integrity": "sha512-LYgUkde5GUYqOpXbcoCGUpEH4Ctl3Wj4u4CVZBl56dEeLW5fGHE037ZL1qlK0Ky+QD5uUfwONSeGwIOIighFMQ==", "dev": true, "license": "MIT", "dependencies": { @@ -651,18 +546,18 @@ } }, "node_modules/@sveltejs/vite-plugin-svelte": { - "version": "4.0.0-next.6", - "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-4.0.0-next.6.tgz", - "integrity": "sha512-7+bEFN5F9pthG6nOEHNz9yioHxNXK6yl+0GnTy9WOfxN/SvPykkH/Hs6MqTGjo47a9G2q3QXQnzuxG5WXNX4Tg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-4.0.0.tgz", + "integrity": "sha512-kpVJwF+gNiMEsoHaw+FJL76IYiwBikkxYU83+BpqQLdVMff19KeRKLd2wisS8niNBMJ2omv5gG+iGDDwd8jzag==", "dev": true, "license": "MIT", "dependencies": { "@sveltejs/vite-plugin-svelte-inspector": "^3.0.0-next.0||^3.0.0", - "debug": "^4.3.6", + "debug": "^4.3.7", "deepmerge": "^4.3.1", "kleur": "^4.1.5", - "magic-string": "^0.30.11", - "vitefu": "^0.2.5" + "magic-string": "^0.30.12", + "vitefu": "^1.0.3" }, "engines": { "node": "^18.0.0 || ^20.0.0 || >=22" @@ -673,13 +568,13 @@ } }, "node_modules/@sveltejs/vite-plugin-svelte-inspector": { - "version": "3.0.0-next.3", - "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-3.0.0-next.3.tgz", - "integrity": "sha512-kuGJ2CZ5lAw3gKF8Kw0AfKtUJWbwdlDHY14K413B0MCyrzvQvsKTorwmwZcky0+QqY6RnVIZ/5FttB9bQmkLXg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-3.0.1.tgz", + "integrity": "sha512-2CKypmj1sM4GE7HjllT7UKmo4Q6L5xFRd7VMGEWhYnZ+wc6AUVU01IBd7yUi6WnFndEwWoMNOd6e8UjoN0nbvQ==", "dev": true, "license": "MIT", "dependencies": { - "debug": "^4.3.5" + "debug": "^4.3.7" }, "engines": { "node": "^18.0.0 || ^20.0.0 || >=22" @@ -767,27 +662,27 @@ } }, "node_modules/@types/node": { - "version": "22.7.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", - "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", + "version": "22.8.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.8.1.tgz", + "integrity": "sha512-k6Gi8Yyo8EtrNtkHXutUu2corfDf9su95VYVP10aGYMMROM6SAItZi0w1XszA6RtWTHSVp5OeFof37w0IEqCQg==", "devOptional": true, "license": "MIT", "dependencies": { - "undici-types": "~6.19.2" + "undici-types": "~6.19.8" } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.8.1.tgz", - "integrity": "sha512-xfvdgA8AP/vxHgtgU310+WBnLB4uJQ9XdyP17RebG26rLtDrQJV3ZYrcopX91GrHmMoH8bdSwMRh2a//TiJ1jQ==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.11.0.tgz", + "integrity": "sha512-KhGn2LjW1PJT2A/GfDpiyOfS4a8xHQv2myUagTM5+zsormOmBlYsnQ6pobJ8XxJmh6hnHwa2Mbe3fPrDJoDhbA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.8.1", - "@typescript-eslint/type-utils": "8.8.1", - "@typescript-eslint/utils": "8.8.1", - "@typescript-eslint/visitor-keys": "8.8.1", + "@typescript-eslint/scope-manager": "8.11.0", + "@typescript-eslint/type-utils": "8.11.0", + "@typescript-eslint/utils": "8.11.0", + "@typescript-eslint/visitor-keys": "8.11.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -811,16 +706,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.8.1.tgz", - "integrity": "sha512-hQUVn2Lij2NAxVFEdvIGxT9gP1tq2yM83m+by3whWFsWC+1y8pxxxHUFE1UqDu2VsGi2i6RLcv4QvouM84U+ow==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.11.0.tgz", + "integrity": "sha512-lmt73NeHdy1Q/2ul295Qy3uninSqi6wQI18XwSpm8w0ZbQXUpjCAWP1Vlv/obudoBiIjJVjlztjQ+d/Md98Yxg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/scope-manager": "8.8.1", - "@typescript-eslint/types": "8.8.1", - "@typescript-eslint/typescript-estree": "8.8.1", - "@typescript-eslint/visitor-keys": "8.8.1", + "@typescript-eslint/scope-manager": "8.11.0", + "@typescript-eslint/types": "8.11.0", + "@typescript-eslint/typescript-estree": "8.11.0", + "@typescript-eslint/visitor-keys": "8.11.0", "debug": "^4.3.4" }, "engines": { @@ -840,14 +735,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.8.1.tgz", - "integrity": "sha512-X4JdU+66Mazev/J0gfXlcC/dV6JI37h+93W9BRYXrSn0hrE64IoWgVkO9MSJgEzoWkxONgaQpICWg8vAN74wlA==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.11.0.tgz", + "integrity": "sha512-Uholz7tWhXmA4r6epo+vaeV7yjdKy5QFCERMjs1kMVsLRKIrSdM6o21W2He9ftp5PP6aWOVpD5zvrvuHZC0bMQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.8.1", - "@typescript-eslint/visitor-keys": "8.8.1" + "@typescript-eslint/types": "8.11.0", + "@typescript-eslint/visitor-keys": "8.11.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -858,14 +753,14 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.8.1.tgz", - "integrity": "sha512-qSVnpcbLP8CALORf0za+vjLYj1Wp8HSoiI8zYU5tHxRVj30702Z1Yw4cLwfNKhTPWp5+P+k1pjmD5Zd1nhxiZA==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.11.0.tgz", + "integrity": "sha512-ItiMfJS6pQU0NIKAaybBKkuVzo6IdnAhPFZA/2Mba/uBjuPQPet/8+zh5GtLHwmuFRShZx+8lhIs7/QeDHflOg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.8.1", - "@typescript-eslint/utils": "8.8.1", + "@typescript-eslint/typescript-estree": "8.11.0", + "@typescript-eslint/utils": "8.11.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -883,9 +778,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.8.1.tgz", - "integrity": "sha512-WCcTP4SDXzMd23N27u66zTKMuEevH4uzU8C9jf0RO4E04yVHgQgW+r+TeVTNnO1KIfrL8ebgVVYYMMO3+jC55Q==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.11.0.tgz", + "integrity": "sha512-tn6sNMHf6EBAYMvmPUaKaVeYvhUsrE6x+bXQTxjQRp360h1giATU0WvgeEys1spbvb5R+VpNOZ+XJmjD8wOUHw==", "dev": true, "license": "MIT", "engines": { @@ -897,14 +792,14 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.8.1.tgz", - "integrity": "sha512-A5d1R9p+X+1js4JogdNilDuuq+EHZdsH9MjTVxXOdVFfTJXunKJR/v+fNNyO4TnoOn5HqobzfRlc70NC6HTcdg==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.11.0.tgz", + "integrity": "sha512-yHC3s1z1RCHoCz5t06gf7jH24rr3vns08XXhfEqzYpd6Hll3z/3g23JRi0jM8A47UFKNc3u/y5KIMx8Ynbjohg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "8.8.1", - "@typescript-eslint/visitor-keys": "8.8.1", + "@typescript-eslint/types": "8.11.0", + "@typescript-eslint/visitor-keys": "8.11.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -952,16 +847,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.8.1.tgz", - "integrity": "sha512-/QkNJDbV0bdL7H7d0/y0qBbV2HTtf0TIyjSDTvvmQEzeVx8jEImEbLuOA4EsvE8gIgqMitns0ifb5uQhMj8d9w==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.11.0.tgz", + "integrity": "sha512-CYiX6WZcbXNJV7UNB4PLDIBtSdRmRI/nb0FMyqHPTQD1rMjA0foPLaPUV39C/MxkTd/QKSeX+Gb34PPsDVC35g==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.8.1", - "@typescript-eslint/types": "8.8.1", - "@typescript-eslint/typescript-estree": "8.8.1" + "@typescript-eslint/scope-manager": "8.11.0", + "@typescript-eslint/types": "8.11.0", + "@typescript-eslint/typescript-estree": "8.11.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -975,13 +870,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.8.1.tgz", - "integrity": "sha512-0/TdC3aeRAsW7MDvYRwEc1Uwm0TIBfzjPFgg60UU2Haj5qsCs9cc3zNgY71edqE3LbWfF/WoZQd3lJoDXFQpag==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.11.0.tgz", + "integrity": "sha512-EaewX6lxSjRJnc+99+dqzTeoDZUfyrA52d2/HRrkI830kgovWsmIiTfmr0NZorzqic7ga+1bS60lRBUgR3n/Bw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.8.1", + "@typescript-eslint/types": "8.11.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -1006,9 +901,9 @@ } }, "node_modules/acorn": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", - "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.13.0.tgz", + "integrity": "sha512-8zSiw54Oxrdym50NlZ9sUusyO1Z1ZchgRLWRaK6c86XJFClyCgFKetdowBg5bKxyp/u+CDBJG4Mpp0m3HLZl9w==", "license": "MIT", "bin": { "acorn": "bin/acorn" @@ -1377,18 +1272,18 @@ } }, "node_modules/eslint": { - "version": "9.12.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.12.0.tgz", - "integrity": "sha512-UVIOlTEWxwIopRL1wgSQYdnVDcEvs2wyaO6DGo5mXqe3r16IoCNWkR29iHhyaP4cICWjbgbmFUGAhh0GJRuGZw==", + "version": "9.13.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.13.0.tgz", + "integrity": "sha512-EYZK6SX6zjFHST/HRytOdA/zE72Cq/bfw45LSyuwrdvcclb/gqV8RRQxywOBEWO2+WDpva6UZa4CcDeJKzUCFA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.11.0", "@eslint/config-array": "^0.18.0", - "@eslint/core": "^0.6.0", + "@eslint/core": "^0.7.0", "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.12.0", + "@eslint/js": "9.13.0", "@eslint/plugin-kit": "^0.2.0", "@humanfs/node": "^0.16.5", "@humanwhocodes/module-importer": "^1.0.1", @@ -1454,9 +1349,9 @@ } }, "node_modules/eslint-plugin-svelte": { - "version": "2.44.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-svelte/-/eslint-plugin-svelte-2.44.1.tgz", - "integrity": "sha512-w6wkoJPw1FJKFtM/2oln21rlu5+HTd2CSkkzhm32A+trNoW2EYQqTQAbDTU6k2GI/6Vh64rBHYQejqEgDld7fw==", + "version": "2.46.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-svelte/-/eslint-plugin-svelte-2.46.0.tgz", + "integrity": "sha512-1A7iEMkzmCZ9/Iz+EAfOGYL8IoIG6zeKEq1SmpxGeM5SXmoQq+ZNnCpXFVJpsxPWYx8jIVGMerQMzX20cqUl0g==", "dev": true, "license": "MIT", "dependencies": { @@ -1464,13 +1359,13 @@ "@jridgewell/sourcemap-codec": "^1.4.15", "eslint-compat-utils": "^0.5.1", "esutils": "^2.0.3", - "known-css-properties": "^0.34.0", + "known-css-properties": "^0.35.0", "postcss": "^8.4.38", "postcss-load-config": "^3.1.4", "postcss-safe-parser": "^6.0.0", "postcss-selector-parser": "^6.1.0", "semver": "^7.6.2", - "svelte-eslint-parser": "^0.41.1" + "svelte-eslint-parser": "^0.43.0" }, "engines": { "node": "^14.17.0 || >=16.0.0" @@ -1480,7 +1375,7 @@ }, "peerDependencies": { "eslint": "^7.0.0 || ^8.0.0-0 || ^9.0.0-0", - "svelte": "^3.37.0 || ^4.0.0 || ^5.0.0-next.191" + "svelte": "^3.37.0 || ^4.0.0 || ^5.0.0" }, "peerDependenciesMeta": { "svelte": { @@ -1660,9 +1555,9 @@ } }, "node_modules/fdir": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.0.tgz", - "integrity": "sha512-3oB133prH1o4j/L5lLW7uOCF1PlD+/It2L0eL/iAqWMB91RBbqTewABqxhj0ibBd90EEmWZq7ntIWzVaWcXTGQ==", + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.2.tgz", + "integrity": "sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ==", "license": "MIT", "peerDependencies": { "picomatch": "^3 || ^4" @@ -1946,9 +1841,9 @@ } }, "node_modules/known-css-properties": { - "version": "0.34.0", - "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.34.0.tgz", - "integrity": "sha512-tBECoUqNFbyAY4RrbqsBQqDFpGXAEbdD5QKr8kACx3+rnArmuuR22nKQWKazvp07N9yjTyDZaw/20UIH8tL9DQ==", + "version": "0.35.0", + "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.35.0.tgz", + "integrity": "sha512-a/RAk2BfKk+WFGhhOCAYqSiFLc34k8Mt/6NWRI4joER0EYUzXIcFivjjnoD3+XU1DggLn/tZc3DOAgke7l8a4A==", "dev": true, "license": "MIT" }, @@ -2016,9 +1911,9 @@ } }, "node_modules/magic-string": { - "version": "0.30.11", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.11.tgz", - "integrity": "sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==", + "version": "0.30.12", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.12.tgz", + "integrity": "sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw==", "license": "MIT", "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0" @@ -2074,24 +1969,6 @@ "node": "*" } }, - "node_modules/mkdirp": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", - "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "bin": { - "mkdirp": "dist/cjs/src/bin.js" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/mri": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", @@ -2256,9 +2133,9 @@ } }, "node_modules/picocolors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", - "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true, "license": "ISC" }, @@ -2579,9 +2456,9 @@ } }, "node_modules/set-cookie-parser": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.0.tgz", - "integrity": "sha512-lXLOiqpkUumhRdFF3k1osNXCy9akgx/dyPZ5p8qAg9seJzXr5ZrlqZuWIMuY6ejOsVLE6flJ5/h3lsn57fQ/PQ==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.1.tgz", + "integrity": "sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==", "dev": true, "license": "MIT" }, @@ -2609,9 +2486,9 @@ } }, "node_modules/sirv": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/sirv/-/sirv-2.0.4.tgz", - "integrity": "sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-3.0.0.tgz", + "integrity": "sha512-BPwJGUeDaDCHihkORDchNyyTvWFhcusy1XMmhEVTQTwGeybFbp8YEmB+njbPnth1FibULBSBVwCQni25XlCUDg==", "dev": true, "license": "MIT", "dependencies": { @@ -2620,7 +2497,7 @@ "totalist": "^3.0.0" }, "engines": { - "node": ">= 10" + "node": ">=18" } }, "node_modules/source-map-js": { @@ -2660,9 +2537,9 @@ } }, "node_modules/svelte": { - "version": "5.0.0-next.264", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.0.0-next.264.tgz", - "integrity": "sha512-vmlzMGxYTdIPhVl1vQhbcqHmSztG/sXzi+TooHiv57FgAVSBc/66cpvqtT5Wfxg9gQOEKOXl9tUV9OzBrBBwiw==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.1.3.tgz", + "integrity": "sha512-Sl8UFHlBvF54aK8MElFvyvaUfPE2REOz6LnhR2pBClCL11MU4qpn4V+KgAggaXxDyrP2iQixvHbtpHqL/zXlSQ==", "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.3.0", @@ -2684,9 +2561,9 @@ } }, "node_modules/svelte-check": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.0.4.tgz", - "integrity": "sha512-AcHWIPuZb1mh/jKoIrww0ebBPpAvwWd1bfXCnwC2dx4OkydNMaiG//+Xnry91RJMHFH7CiE+6Y2p332DRIaOXQ==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.0.5.tgz", + "integrity": "sha512-icBTBZ3ibBaywbXUat3cK6hB5Du+Kq9Z8CRuyLmm64XIe2/r+lQcbuBx/IQgsbrC+kT2jQ0weVpZSSRIPwB6jQ==", "dev": true, "license": "MIT", "dependencies": { @@ -2708,9 +2585,9 @@ } }, "node_modules/svelte-eslint-parser": { - "version": "0.41.1", - "resolved": "https://registry.npmjs.org/svelte-eslint-parser/-/svelte-eslint-parser-0.41.1.tgz", - "integrity": "sha512-08ndI6zTghzI8SuJAFpvMbA/haPSGn3xz19pjre19yYMw8Nw/wQJ2PrZBI/L8ijGTgtkWCQQiLLy+Z1tfaCwNA==", + "version": "0.43.0", + "resolved": "https://registry.npmjs.org/svelte-eslint-parser/-/svelte-eslint-parser-0.43.0.tgz", + "integrity": "sha512-GpU52uPKKcVnh8tKN5P4UZpJ/fUDndmq7wfsvoVXsyP+aY0anol7Yqo01fyrlaWGMFfm4av5DyrjlaXdLRJvGA==", "dev": true, "license": "MIT", "dependencies": { @@ -2727,7 +2604,7 @@ "url": "https://github.com/sponsors/ota-meshi" }, "peerDependencies": { - "svelte": "^3.37.0 || ^4.0.0 || ^5.0.0-next.191" + "svelte": "^3.37.0 || ^4.0.0 || ^5.0.0" }, "peerDependenciesMeta": { "svelte": { @@ -2784,9 +2661,9 @@ } }, "node_modules/svelte2tsx": { - "version": "0.7.21", - "resolved": "https://registry.npmjs.org/svelte2tsx/-/svelte2tsx-0.7.21.tgz", - "integrity": "sha512-cdYR5gYBK0Ys3/jzGu9yfW9oxGLtLAnxcKtS7oJy2pjLhLLYSZcWeeeuaY9SMULwlqMZ1HfngGH3n5VdquRC3Q==", + "version": "0.7.22", + "resolved": "https://registry.npmjs.org/svelte2tsx/-/svelte2tsx-0.7.22.tgz", + "integrity": "sha512-hf55ujq17ufVpDQlJzaQfRr9EjlLIwGmFlpKq4uYrQAQFw/99q1OcVYyBT6568iJySgBUY9PdccURrORmfetmQ==", "dev": true, "license": "MIT", "dependencies": { @@ -2817,12 +2694,12 @@ } }, "node_modules/tinyglobby": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.9.tgz", - "integrity": "sha512-8or1+BGEdk1Zkkw2ii16qSS7uVrQJPre5A9o/XkWPATkk23FZh/15BKFxPnlTy6vkljZxLqYCzzBMj30ZrSvjw==", + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.10.tgz", + "integrity": "sha512-Zc+8eJlFMvgatPZTl6A9L/yht8QqdmUNtURHaKZLmKBE12hNPSrqNkUp2cs3M/UKmNVVAMFQYSjYIVHDjW5zew==", "license": "MIT", "dependencies": { - "fdir": "^6.4.0", + "fdir": "^6.4.2", "picomatch": "^4.0.2" }, "engines": { @@ -2876,9 +2753,9 @@ } }, "node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.0.tgz", + "integrity": "sha512-jWVzBLplnCmoaTr13V9dYbiQ99wvZRd0vNWaDRg+aVYRcjDF3nDksxFDE/+fkXnKhpnUUkmx5pK/v8mCtLVqZA==", "license": "0BSD" }, "node_modules/type-check": { @@ -2909,15 +2786,15 @@ } }, "node_modules/typescript-eslint": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.8.1.tgz", - "integrity": "sha512-R0dsXFt6t4SAFjUSKFjMh4pXDtq04SsFKCVGDP3ZOzNP7itF0jBcZYU4fMsZr4y7O7V7Nc751dDeESbe4PbQMQ==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.11.0.tgz", + "integrity": "sha512-cBRGnW3FSlxaYwU8KfAewxFK5uzeOAp0l2KebIlPDOT5olVi65KDG/yjBooPBG0kGW/HLkoz1c/iuBFehcS3IA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.8.1", - "@typescript-eslint/parser": "8.8.1", - "@typescript-eslint/utils": "8.8.1" + "@typescript-eslint/eslint-plugin": "8.11.0", + "@typescript-eslint/parser": "8.11.0", + "@typescript-eslint/utils": "8.11.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2976,9 +2853,9 @@ } }, "node_modules/vite": { - "version": "5.4.8", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.8.tgz", - "integrity": "sha512-FqrItQ4DT1NC4zCUqMB4c4AZORMKIa0m8/URVCZ77OZ/QSNeJ54bU1vrFADbDsuwfIPcgknRkmqakQcgnL4GiQ==", + "version": "5.4.10", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.10.tgz", + "integrity": "sha512-1hvaPshuPUtxeQ0hsVH3Mud0ZanOLwVTneA1EgbAM5LhaZEqyPWGRQ7BtaMvUrTDeEaC8pxtj6a6jku3x4z6SQ==", "dev": true, "license": "MIT", "peer": true, @@ -3037,13 +2914,17 @@ } }, "node_modules/vitefu": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-0.2.5.tgz", - "integrity": "sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.0.3.tgz", + "integrity": "sha512-iKKfOMBHob2WxEJbqbJjHAkmYgvFDPhuqrO82om83S8RLk+17FtyMBfcyeH8GqD0ihShtkMW/zzJgiA51hCNCQ==", "dev": true, "license": "MIT", + "workspaces": [ + "tests/deps/*", + "tests/projects/*" + ], "peerDependencies": { - "vite": "^3.0.0 || ^4.0.0 || ^5.0.0" + "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0-beta.0" }, "peerDependenciesMeta": { "vite": { diff --git a/package.json b/package.json index 684b806eb9..822d33f057 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "prettier": "^3.3.3", "prettier-plugin-svelte": "^3.2.7", "ts-morph": "^24.0.0", - "tslib": "^2.7.0", + "tslib": "^2.8.0", "zod": "^3.23.8" }, "peerDependencies": { @@ -69,21 +69,21 @@ "@changesets/changelog-git": "^0.2.0", "@changesets/types": "^6.0.0", "@ryanatkn/eslint-config": "^0.5.5", - "@ryanatkn/fuz": "^0.129.2", - "@ryanatkn/moss": "^0.18.0", - "@sveltejs/adapter-static": "^3.0.5", - "@sveltejs/kit": "^2.6.4", - "@sveltejs/package": "^2.3.5", - "@sveltejs/vite-plugin-svelte": "^4.0.0-next.6", + "@ryanatkn/fuz": "^0.129.5", + "@ryanatkn/moss": "^0.18.2", + "@sveltejs/adapter-static": "^3.0.6", + "@sveltejs/kit": "^2.7.3", + "@sveltejs/package": "^2.3.7", + "@sveltejs/vite-plugin-svelte": "^4.0.0", "@types/fs-extra": "^11.0.4", - "@types/node": "^22.7.5", + "@types/node": "^22.8.1", "esbuild": "^0.21.5", - "eslint": "^9.12.0", - "eslint-plugin-svelte": "^2.44.1", - "svelte": "^5.0.0-next.264", - "svelte-check": "^4.0.4", + "eslint": "^9.13.0", + "eslint-plugin-svelte": "^2.46.0", + "svelte": "^5.1.3", + "svelte-check": "^4.0.5", "typescript": "^5.6.3", - "typescript-eslint": "^8.8.1", + "typescript-eslint": "^8.11.0", "uvu": "^0.5.6" }, "prettier": { diff --git a/src/lib/filer.ts b/src/lib/filer.ts index af9e55ba9b..00aa4607a9 100644 --- a/src/lib/filer.ts +++ b/src/lib/filer.ts @@ -18,6 +18,8 @@ import {resolve_specifier} from './resolve_specifier.js'; import {default_sveltekit_config} from './sveltekit_config.js'; import {map_sveltekit_aliases} from './sveltekit_helpers.js'; import {Unreachable_Error} from '@ryanatkn/belt/error.js'; +import {resolve_node_specifier} from './resolve_node_specifier.js'; +import type {Package_Json} from './package_json.js'; // TODO see below // import {resolve_node_specifier} from './resolve_node_specifier.js'; @@ -31,6 +33,11 @@ export interface Source_File { * We create the file in memory to track its dependents regardless of its existence on disk. */ contents: string | null; + /** + * Is the source file outside of the `root_dir` or excluded by `watch_dir_options.filter`? + */ + external: boolean; + ctime: number | null; mtime: number | null; dependents: Map; dependencies: Map; @@ -43,6 +50,7 @@ export type On_Filer_Change = (change: Watcher_Change, source_file: Source_File) export interface Options { watch_dir?: typeof watch_dir; watch_dir_options?: Partial>; + package_json_cache?: Record; } export class Filer { @@ -53,10 +61,13 @@ export class Filer { #watch_dir: typeof watch_dir; #watch_dir_options: Partial; + #package_json_cache: Record; + constructor(options: Options = EMPTY_OBJECT) { this.#watch_dir = options.watch_dir ?? watch_dir; this.#watch_dir_options = options.watch_dir_options ?? EMPTY_OBJECT; this.root_dir = resolve(options.watch_dir_options?.dir ?? paths.source); + this.#package_json_cache = options.package_json_cache ?? {}; } #watching: Watch_Node_Fs | undefined; @@ -74,11 +85,17 @@ export class Filer { const file: Source_File = { id, contents: null, + external: this.#is_external(id), // TODO maybe filter externals by default? the user needs to configure the filer then + ctime: null, mtime: null, dependents: new Map(), dependencies: new Map(), }; this.files.set(id, file); + // TODO this may need to be batched/deferred + if (file.external) { + this.#on_change({type: 'add', path: file.id, is_directory: false}); + } return file; }; @@ -86,8 +103,7 @@ export class Filer { const file = this.get_or_create(id); const stats = existsSync(id) ? statSync(id) : null; - // const mtime_prev = file.mtime; - // const mtime_changed = mtime_prev !== (stats?.mtimeMs ?? null); + file.ctime = stats?.ctimeMs ?? null; file.mtime = stats?.mtimeMs ?? null; const new_contents = stats ? readFileSync(id, 'utf8') : null; @@ -109,36 +125,25 @@ export class Filer { const path = map_sveltekit_aliases(specifier, aliases); // The specifier `path` has now been mapped to its final form, so we can inspect it. - if (path[0] === '.' || path[0] === '/') { - const {path_id} = resolve_specifier(path, dir); - dependencies_removed.delete(path_id); - if (!dependencies_before.has(path_id)) { - const d = this.get_or_create(path_id); - file.dependencies.set(d.id, d); - d.dependents.set(file.id, file); - } + const resolved = + path[0] === '.' || path[0] === '/' + ? resolve_specifier(path, dir) + : resolve_node_specifier(path, undefined, file.id, this.#package_json_cache, false); + if (!resolved) continue; // ignore any missing imports like Node identifiers + const {path_id} = resolved; + dependencies_removed.delete(path_id); + if (!dependencies_before.has(path_id)) { + const d = this.get_or_create(path_id); + file.dependencies.set(d.id, d); + d.dependents.set(file.id, file); } - // TODO this doesn't work - // const resolved = - // path[0] === '.' || path[0] === '/' - // ? resolve_specifier(path, dir) - // : resolve_node_specifier(path, dir); - // const {path_id} = resolved; - // dependencies_removed.delete(path_id); - // if (!dependencies_before.has(path_id)) { - // const d = this.get_or_create(path_id); - // file.dependencies.set(d.id, d); - // d.dependents.set(file.id, file); - // } } // update any removed dependencies for (const dependency_removed of dependencies_removed) { - const deleted1 = file.dependencies.delete(dependency_removed); - if (!deleted1) throw Error('expected to delete1 ' + file.id); // TODO @many delete if correct + file.dependencies.delete(dependency_removed); const dependency_removed_file = this.get_or_create(dependency_removed); - const deleted2 = dependency_removed_file.dependents.delete(file.id); - if (!deleted2) throw Error('expected to delete2 ' + file.id); // TODO @many delete if correct + dependency_removed_file.dependents.delete(file.id); } return file; @@ -203,7 +208,7 @@ export class Filer { } #on_change: Watcher_Change_Callback = (change) => { - if (change.is_directory) return; + if (change.is_directory) return; // TODO manage directories? let source_file: Source_File | null; switch (change.type) { case 'add': @@ -236,4 +241,9 @@ export class Filer { this.#watching = undefined; } } + + #is_external(id: string): boolean { + const {filter} = this.#watch_dir_options; + return !id.startsWith(this.root_dir + '/') || (!!filter && !filter(id, false)); + } } diff --git a/src/lib/loader.ts b/src/lib/loader.ts index 4d48e11ddc..1429c1df8c 100644 --- a/src/lib/loader.ts +++ b/src/lib/loader.ts @@ -16,7 +16,7 @@ import { } from './sveltekit_shim_app.js'; import {default_sveltekit_config} from './sveltekit_config.js'; import {SVELTE_MATCHER, SVELTE_RUNES_MATCHER} from './svelte_helpers.js'; -import {paths} from './paths.js'; +import {IS_THIS_GRO, paths} from './paths.js'; import {JSON_MATCHER, NODE_MODULES_DIRNAME, TS_MATCHER} from './path_constants.js'; import {to_define_import_meta_env, default_ts_transform_options} from './esbuild_helpers.js'; import {resolve_specifier} from './resolve_specifier.js'; @@ -173,51 +173,59 @@ export const load: LoadHook = async (url, context, nextLoad) => { }; export const resolve: ResolveHook = async (specifier, context, nextResolve) => { + let s = specifier; + + // Support SvelteKit `$env` imports if ( - specifier === '$env/static/public' || - specifier === '$env/static/private' || - specifier === '$env/dynamic/public' || - specifier === '$env/dynamic/private' + s === '$env/static/public' || + s === '$env/static/private' || + s === '$env/dynamic/public' || + s === '$env/dynamic/private' ) { // The returned `url` is validated before `load` is called, // so we need a slightly roundabout strategy to pass through the specifier for virtual files. return { - url: pathToFileURL(join(dir, 'src/lib', specifier)).href, + url: pathToFileURL(join(dir, 'src/lib', s)).href, format: 'module', shortCircuit: true, }; } + // Special case for Gro's dependencies that import into Gro. + // Without this, we'd need to add a dev dep to Gro for Gro, which causes problems. + if (IS_THIS_GRO && s.startsWith('@ryanatkn/gro')) { + s = join(dir, 'dist', s.substring(13)); + } + const parent_url = context.parentURL; if (!parent_url || NODE_MODULES_MATCHER.test(parent_url)) { - return nextResolve(specifier, context); + return nextResolve(s, context); } - const shimmed = sveltekit_shim_app_specifiers.get(specifier); + const shimmed = sveltekit_shim_app_specifiers.get(s); if (shimmed !== undefined) { return nextResolve(shimmed, context); } - const path = map_sveltekit_aliases(specifier, aliases); + s = map_sveltekit_aliases(s, aliases); - // The specifier `path` has now been mapped to its final form, so we can inspect it. - if (path[0] !== '.' && path[0] !== '/') { + // The specifier has now been mapped to its final form, so we can inspect it. + if (s[0] !== '.' && s[0] !== '/') { // Resolve to `node_modules`. - if (SVELTE_MATCHER.test(path) || JSON_MATCHER.test(path)) { + if (SVELTE_MATCHER.test(s) || JSON_MATCHER.test(s)) { // Match the behavior of Vite and esbuild for Svelte and JSON imports. - // TODO `.ts` too - const resolved = resolve_node_specifier(path, dir, parent_url, package_json_cache); + const resolved = resolve_node_specifier(s, dir, parent_url, package_json_cache)!; // `node:` specifiers shouldn't reach this point, so the assertion is safe return { url: pathToFileURL(resolved.path_id_with_querystring).href, format: 'module', shortCircuit: true, }; } else { - return nextResolve(path, context); + return nextResolve(s, context); } } - const resolved = resolve_specifier(path, dirname(fileURLToPath(parent_url))); + const resolved = resolve_specifier(s, dirname(fileURLToPath(parent_url))); return { url: pathToFileURL(resolved.path_id_with_querystring).href, diff --git a/src/lib/moss_helpers.ts b/src/lib/moss_helpers.ts index 1693ee7485..0c21dedfd9 100644 --- a/src/lib/moss_helpers.ts +++ b/src/lib/moss_helpers.ts @@ -3,6 +3,7 @@ import {existsSync} from 'node:fs'; import {resolve} from 'node:path'; import {has_dep, type Package_Json} from './package_json.js'; +import {NODE_MODULES_DIRNAME} from './path_constants.js'; export const MOSS_PACKAGE_DEP_NAME = '@ryanatkn/moss'; @@ -10,7 +11,7 @@ export const MOSS_PACKAGE_DEP_NAME = '@ryanatkn/moss'; export const load_moss_plugin = async ( package_json?: Package_Json, dep_name = MOSS_PACKAGE_DEP_NAME, - plugin_path = `node_modules/${dep_name}/dist/gro_plugin_moss.js`, // TODO maybe lookup from its `package_json.exports`? kinda unnecessary + plugin_path = `${NODE_MODULES_DIRNAME}/${dep_name}/dist/gro_plugin_moss.js`, // TODO maybe lookup from its `package_json.exports`? kinda unnecessary local_plugin_path = 'src/lib/gro_plugin_moss.ts', ): Promise> => { if (!has_dep(dep_name, package_json)) { diff --git a/src/lib/package.ts b/src/lib/package.ts index 83071666cb..5056c8ba11 100644 --- a/src/lib/package.ts +++ b/src/lib/package.ts @@ -53,7 +53,7 @@ export const package_json = { prettier: '^3.3.3', 'prettier-plugin-svelte': '^3.2.7', 'ts-morph': '^24.0.0', - tslib: '^2.7.0', + tslib: '^2.8.0', zod: '^3.23.8', }, peerDependencies: {esbuild: '^0.21.0', svelte: '^5.0.0-next.0'}, @@ -61,21 +61,21 @@ export const package_json = { '@changesets/changelog-git': '^0.2.0', '@changesets/types': '^6.0.0', '@ryanatkn/eslint-config': '^0.5.5', - '@ryanatkn/fuz': '^0.129.2', - '@ryanatkn/moss': '^0.18.0', - '@sveltejs/adapter-static': '^3.0.5', - '@sveltejs/kit': '^2.6.4', - '@sveltejs/package': '^2.3.5', - '@sveltejs/vite-plugin-svelte': '^4.0.0-next.6', + '@ryanatkn/fuz': '^0.129.5', + '@ryanatkn/moss': '^0.18.2', + '@sveltejs/adapter-static': '^3.0.6', + '@sveltejs/kit': '^2.7.3', + '@sveltejs/package': '^2.3.7', + '@sveltejs/vite-plugin-svelte': '^4.0.0', '@types/fs-extra': '^11.0.4', - '@types/node': '^22.7.5', + '@types/node': '^22.8.1', esbuild: '^0.21.5', - eslint: '^9.12.0', - 'eslint-plugin-svelte': '^2.44.1', - svelte: '^5.0.0-next.264', - 'svelte-check': '^4.0.4', + eslint: '^9.13.0', + 'eslint-plugin-svelte': '^2.46.0', + svelte: '^5.1.3', + 'svelte-check': '^4.0.5', typescript: '^5.6.3', - 'typescript-eslint': '^8.8.1', + 'typescript-eslint': '^8.11.0', uvu: '^0.5.6', }, prettier: { diff --git a/src/lib/package_json.ts b/src/lib/package_json.ts index d7b84f037d..3d6cde9bf9 100644 --- a/src/lib/package_json.ts +++ b/src/lib/package_json.ts @@ -21,7 +21,7 @@ export const Email = z.string(); export type Email = Flavored, 'Email'>; // TODO move this where? -export const transform_empty_object_to_undefined = (val: any): any => { +export const transform_empty_object_to_undefined = (val: T): T | undefined => { if (val && Object.keys(val).length === 0) { return; } @@ -63,8 +63,19 @@ export const Package_Json_Funding = z.union([ ]); export type Package_Json_Funding = z.infer; +// exports: { +// './': './index.js', +// './record': {default: './record.js'}, +// './export_condition': {default: {development: './ec1', default: './ec2.js'}}, +// } export const Package_Json_Exports = z.record( - z.union([z.string(), z.record(z.string())]).optional(), + z + .union([ + z.string(), + z.record(z.string().optional()), + z.record(z.record(z.string().optional()).optional()), + ]) + .optional(), ); export type Package_Json_Exports = z.infer; @@ -131,6 +142,7 @@ export const Package_Json = z bin: z.record(z.string()).optional(), sideEffects: z.array(z.string()).optional(), files: z.array(z.string()).optional(), + main: z.string().optional(), exports: Package_Json_Exports.transform(transform_empty_object_to_undefined).optional(), }) .passthrough(); @@ -145,6 +157,7 @@ export const EMPTY_PACKAGE_JSON: Package_Json = {name: '', version: ''}; export const load_package_json = ( dir = IS_THIS_GRO ? gro_paths.root : paths.root, cache?: Record, + parse = true, // TODO pass `false` here in more places, especially anything perf-sensitive like work on startup ): Package_Json => { let package_json: Package_Json; if (cache && dir in cache) { @@ -155,8 +168,12 @@ export const load_package_json = ( } catch (_err) { return EMPTY_PACKAGE_JSON; } - package_json = parse_package_json(Package_Json, package_json); - if (cache) cache[dir] = package_json; + if (parse) { + package_json = parse_package_json(Package_Json, package_json); + } + if (cache) { + cache[dir] = package_json; + } return package_json; }; diff --git a/src/lib/resolve_node_specifier.test.ts b/src/lib/resolve_node_specifier.test.ts index d42a3e410b..06ef6edd5a 100644 --- a/src/lib/resolve_node_specifier.test.ts +++ b/src/lib/resolve_node_specifier.test.ts @@ -4,6 +4,32 @@ import {resolve} from 'node:path'; import {resolve_node_specifier} from './resolve_node_specifier.js'; +test('resolves a Node specifier', () => { + const specifier = 'svelte'; + const path_id = resolve('node_modules/svelte/src/index-server.js'); + assert.equal(resolve_node_specifier(specifier), { + path_id, + path_id_with_querystring: path_id, + raw: false, + specifier, + mapped_specifier: specifier, + namespace: undefined, + }); +}); + +test('resolves a Node specifier with a username', () => { + const specifier = '@sveltejs/kit'; + const path_id = resolve('node_modules/@sveltejs/kit/src/exports/index.js'); + assert.equal(resolve_node_specifier(specifier), { + path_id, + path_id_with_querystring: path_id, + raw: false, + specifier, + mapped_specifier: specifier, + namespace: undefined, + }); +}); + test('resolves a JS specifier', () => { const specifier = '@ryanatkn/fuz/tome.js'; const path_id = resolve('node_modules/@ryanatkn/fuz/dist/tome.js'); @@ -58,14 +84,46 @@ test('resolves a raw Svelte specifier', () => { }); }); -test('throws for a specifier that does not exist', () => { - let err; - try { - resolve_node_specifier('@ryanatkn/fuz/this_does_not_exist'); - } catch (_err) { - err = _err; - } - assert.ok(err); +test('throws for an export that does not exist', () => { + assert.throws(() => resolve_node_specifier('@ryanatkn/fuz/this_export_does_not_exist')); +}); + +test('throws for a package that does not exist', () => { + assert.throws(() => resolve_node_specifier('@ryanatkn/this_package_does_not_exist')); +}); + +test('throws for a Node specifier', () => { + assert.throws(() => resolve_node_specifier('node:path')); +}); + +test('optionally returns null for an export that does not exist', () => { + assert.is( + resolve_node_specifier( + '@ryanatkn/fuz/this_export_does_not_exist', + undefined, + undefined, + undefined, + false, + ), + null, + ); +}); + +test('optionally returns null for a package that does not exist', () => { + assert.is( + resolve_node_specifier( + '@ryanatkn/this_package_does_not_exist', + undefined, + undefined, + undefined, + false, + ), + null, + ); +}); + +test('optionally returns null for a Node specifier', () => { + assert.is(resolve_node_specifier('node:path', undefined, undefined, undefined, false), null); }); test.run(); diff --git a/src/lib/resolve_node_specifier.ts b/src/lib/resolve_node_specifier.ts index 6e7bd94734..545065d64c 100644 --- a/src/lib/resolve_node_specifier.ts +++ b/src/lib/resolve_node_specifier.ts @@ -1,21 +1,32 @@ import {join} from 'node:path'; +import {existsSync} from 'node:fs'; +import {DEV} from 'esm-env'; -import {Package_Json, load_package_json} from './package_json.js'; +import {Package_Json, Package_Json_Exports, load_package_json} from './package_json.js'; import {paths} from './paths.js'; import {NODE_MODULES_DIRNAME} from './path_constants.js'; import type {Resolved_Specifier} from './resolve_specifier.js'; +/** + * Like `resolve_specifier` but for Node specifiers, + * typically those that aren't relative or absolute. + * Optionally return `null` instead of throwing by setting + * `throw_on_missing_package` to `false`. + */ export const resolve_node_specifier = ( specifier: string, dir = paths.root, - parent_url?: string, + parent_path?: string, cache?: Record, - exports_key = specifier.endsWith('.svelte') ? 'svelte' : 'default', -): Resolved_Specifier => { + throw_on_missing_package = true, + // TODO this needs to use `--conditions`/`-C` to determine the correct key + exports_condition = DEV ? 'development' : 'default', +): Resolved_Specifier | null => { const raw = specifier.endsWith('?raw'); const mapped_specifier = raw ? specifier.substring(0, specifier.length - 4) : specifier; - let idx!: number; + // Parse the specifier + let idx: number = -1; if (mapped_specifier[0] === '@') { // get the index of the second `/` let count = 0; @@ -29,21 +40,47 @@ export const resolve_node_specifier = ( } else { idx = mapped_specifier.indexOf('/'); } - const name = mapped_specifier.substring(0, idx); - const path = mapped_specifier.substring(idx + 1); + const pkg_name = idx === -1 ? mapped_specifier : mapped_specifier.substring(0, idx); + const module_path = idx === -1 ? '' : mapped_specifier.substring(idx + 1); + const subpath = module_path ? './' + module_path : '.'; + const package_dir = join(dir, NODE_MODULES_DIRNAME, pkg_name); - const subpath = './' + path; - const package_dir = join(dir, NODE_MODULES_DIRNAME, name); - const package_json = load_package_json(package_dir, cache); - const exported = package_json.exports?.[subpath]; + if (!existsSync(package_dir)) { + if (throw_on_missing_package) { + throw Error( + `Package not found at ${package_dir} for specifier ${specifier}, you may need to npm install or fix the path` + + (parent_path ? ` imported from ${parent_path}` : ''), + ); + } else { + return null; + } + } + + const package_json = load_package_json(package_dir, cache, false); + const {exported, exports_key} = resolve_subpath(package_json, specifier, subpath); if (!exported) { - // same error message as Node - throw Error( - `[ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath '${subpath}' is not defined by "exports" in ${package_dir}/package.json` + - (parent_url ? ` imported from ${parent_url}` : ''), - ); + if (throw_on_missing_package) { + // same error message as Node + throw Error( + `[ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath '${subpath}' is not defined by 'exports' in ${package_dir}/package.json` + + (parent_path ? ` imported from ${parent_path}` : ''), + ); + } else { + return null; + } } - const path_id = join(package_dir, exported[exports_key]); + const exported_value = resolve_exported_value(exported, exports_key, exports_condition); + if (exported_value === undefined) { + if (throw_on_missing_package) { + throw Error( + `Package subpath '${subpath}' does not define the key '${exports_key}' in 'exports' in ${package_dir}/package.json` + + (parent_path ? ` imported from ${parent_path}` : ''), + ); + } else { + return null; + } + } + const path_id = join(package_dir, exported_value); return { path_id, @@ -54,3 +91,48 @@ export const resolve_node_specifier = ( namespace: undefined, }; }; + +/** + * Resolves the subpath of a package.json `exports` field based on the `specifier`. + */ +const resolve_subpath = ( + package_json: Package_Json, + specifier: string, + subpath: string, +): {exported: Package_Json_Exports[string]; exports_key: string} => { + const exports_key = specifier.endsWith('.svelte') ? 'svelte' : 'default'; + + const exported = + subpath === '.' && !package_json.exports + ? {[exports_key]: package_json.main} + : package_json.exports?.[subpath]; + + return {exported, exports_key}; +}; + +/** + * Resolves the exported value based on the exports key and condition. + */ +const resolve_exported_value = ( + exported: Exclude, + exports_key: string, + exports_condition: string, +): string | undefined => { + let exported_value = typeof exported === 'string' ? exported : exported[exports_key]; + + // TODO best effort fallback, support `default` but fall back to `import` or `node` as the exports key. + if (exported_value === undefined && typeof exported !== 'string' && exports_key === 'default') { + exported_value = exported.import ?? exported.node; + } + + // Possibly resolve to conditional exports. + exported_value = + exported_value === undefined || typeof exported_value === 'string' + ? exported_value + : (exported_value[exports_condition] ?? + exported_value.default ?? + exported_value.import ?? + exported_value.node); // TODO this fallback has corner case bugs for off-spec exports + + return exported_value; +}; diff --git a/src/lib/resolve_specifier.ts b/src/lib/resolve_specifier.ts index 51ee68d33a..a81ca23a15 100644 --- a/src/lib/resolve_specifier.ts +++ b/src/lib/resolve_specifier.ts @@ -20,13 +20,9 @@ export interface Resolved_Specifier { } /** - * Maps a `path` import specifier relative to the `importer`, + * Maps an import `specifier` relative to `dir`, * and infer the correct extension following Vite conventions. - * If no `.js` file is found for the `path` on the filesystem, it assumes `.ts`. - * @param specifier - * @param dir - if defined, enables relative importers like from esbuild plugins - * @param passthrough_extensions - used to support specifiers that have no file extention, which Vite supports, so we do our best effort - * @returns + * If no `.js` file is found for the specifier on the filesystem, it assumes `.ts`. */ export const resolve_specifier = (specifier: string, dir: string): Resolved_Specifier => { const raw = specifier.endsWith('?raw'); diff --git a/src/lib/sveltekit_config.ts b/src/lib/sveltekit_config.ts index 66f1fcdc9f..4bc27f2989 100644 --- a/src/lib/sveltekit_config.ts +++ b/src/lib/sveltekit_config.ts @@ -57,7 +57,7 @@ export interface Parsed_Sveltekit_Config { private_prefix: string | undefined; public_prefix: string | undefined; svelte_compile_options: CompileOptions; - svelte_compile_module_options: CompileOptions; + svelte_compile_module_options: ModuleCompileOptions; svelte_preprocessors: PreprocessorGroup | PreprocessorGroup[] | undefined; } diff --git a/src/lib/upgrade.task.ts b/src/lib/upgrade.task.ts index 7ded12b5e2..1567fde4d0 100644 --- a/src/lib/upgrade.task.ts +++ b/src/lib/upgrade.task.ts @@ -5,6 +5,7 @@ import {Task_Error, type Task} from './task.js'; import {extract_deps, load_package_json, type Package_Json_Dep} from './package_json.js'; import {Git_Origin, git_pull} from './git.js'; import {spawn_cli} from './cli.js'; +import {serialize_args, to_forwarded_args} from './args.js'; export const Args = z .object({ @@ -65,6 +66,7 @@ export const task: Task = { if (force) { install_args.push('--force'); } + install_args.push(...serialize_args(to_forwarded_args('npm'))); await spawn('npm', install_args); // Sync in a new process to pick up any changes after installing, avoiding some errors. diff --git a/src/lib/watch_dir.ts b/src/lib/watch_dir.ts index f457f1350c..f4afbd0be8 100644 --- a/src/lib/watch_dir.ts +++ b/src/lib/watch_dir.ts @@ -1,6 +1,7 @@ import {watch, type ChokidarOptions, type FSWatcher} from 'chokidar'; import {relative} from 'node:path'; import {statSync} from 'node:fs'; +import {create_deferred, type Deferred} from '@ryanatkn/belt/async.js'; import type {Path_Filter} from './path.js'; @@ -42,13 +43,12 @@ export const watch_dir = ({ chokidar, }: Options): Watch_Node_Fs => { let watcher: FSWatcher | undefined; - let initing: Promise | undefined; + let initing: Deferred | undefined; return { init: async () => { - if (initing) return initing; - let resolve: any; - initing = new Promise((r) => (resolve = r)); // TODO `create_deferred`?// cwd: chokidar?.cwd ?? process.cwd() + if (initing) return initing.promise; + initing = create_deferred(); watcher = watch(dir, {...chokidar}); watcher.on('add', (path) => { const final_path = absolute ? path : relative(dir, path); @@ -77,8 +77,8 @@ export const watch_dir = ({ on_change({type: 'delete', path: final_path, is_directory: true}); }); // wait until ready - watcher.once('ready', () => resolve()); - await initing; + watcher.once('ready', () => initing?.resolve()); + await initing.promise; }, close: async () => { initing = undefined; diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index ba504ea484..fde67a9e3e 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,7 +1,7 @@