├── .eslintrc.js ├── .github └── FUNDING.yml ├── .gitignore ├── .prettierignore ├── .prettierrc.js ├── CHANGELOG.md ├── LICENSE ├── README.md ├── package-lock.json ├── package.json ├── src └── index.ts ├── svg.d.ts ├── test-app ├── .eslintrc.cjs ├── .gitignore ├── .prettierrc.cjs ├── README.md ├── package-lock.json ├── package.json ├── playwright.config.js ├── src │ ├── app.d.ts │ ├── app.html │ ├── assets │ │ ├── icons │ │ │ ├── beaker-off.svg │ │ │ ├── beaker.svg │ │ │ ├── capsule-off.svg │ │ │ ├── capsule.svg │ │ │ ├── electrocardiogram-off.svg │ │ │ ├── electrocardiogram.svg │ │ │ ├── infusion-off.svg │ │ │ └── infusion.svg │ │ ├── sample-logo.svg │ │ └── ticket-56.svg │ ├── hook │ │ └── svg.svg │ ├── lib │ │ ├── TestComp.svelte │ │ └── sample-logo.svg │ ├── other │ │ └── other-logo.svg │ └── routes │ │ ├── +page.svelte │ │ ├── dataurl │ │ └── +page.svelte │ │ ├── hook │ │ └── +page.svelte │ │ ├── imgurl │ │ └── +page.svelte │ │ ├── ticket-56 │ │ └── +page.svelte │ │ └── ticket-61 │ │ └── +page.svelte ├── static │ ├── favicon.png │ └── static-sample-logo.svg ├── svelte.config.js ├── tests │ ├── test.js │ └── test.js-snapshots │ │ ├── base64explicit-darwin.txt │ │ ├── base64imageurl-darwin.txt │ │ ├── enc-darwin.txt │ │ ├── from-another-dir-darwin.svg │ │ ├── inline-comp-darwin.svg │ │ ├── inline-string-darwin.svg │ │ ├── otherlogoopturl-darwin.svg │ │ ├── samplelogoopturl-darwin.svg │ │ └── unenc-darwin.txt ├── tsconfig.json └── vite.config.ts └── tsconfig.json /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | parser: '@typescript-eslint/parser', 4 | extends: [ 5 | 'eslint:recommended', 6 | 'plugin:@typescript-eslint/recommended', 7 | 'prettier', 8 | ], 9 | plugins: ['@typescript-eslint'], 10 | ignorePatterns: ['.eslintrc.js'], 11 | parserOptions: { 12 | // sourceType: 'module', 13 | ecmaVersion: 2020, 14 | tsconfigRootDir: __dirname, 15 | project: ['./tsconfig.json', './test-app/tsconfig.json'], 16 | }, 17 | env: { 18 | browser: true, 19 | es2020: true, 20 | node: true, 21 | }, 22 | rules: { 23 | 'no-unused-vars': 'off', 24 | curly: 'error', 25 | yoda: 'error', 26 | 'default-case': 'error', 27 | camelcase: 'off', 28 | eqeqeq: ['error', 'always'], 29 | 'no-case-declarations': 'error', 30 | 'no-new-wrappers': 'error', 31 | 'no-return-await': 'error', 32 | 'no-self-compare': 'error', 33 | 'no-useless-call': 'error', 34 | 'no-multi-spaces': 'error', 35 | 'no-trailing-spaces': 'error', 36 | 'no-irregular-whitespace': 'error', 37 | 'max-len': [ 38 | 'error', 39 | { 40 | code: 80, 41 | ignoreUrls: true, 42 | ignoreStrings: true, 43 | ignoreTemplateLiterals: true, 44 | ignoreRegExpLiterals: true, 45 | }, 46 | ], 47 | // -------------- 48 | // no-unused-vars 49 | // -------------- 50 | '@typescript-eslint/no-unused-vars': [ 51 | 'error', 52 | { 53 | vars: 'all', 54 | args: 'after-used', 55 | ignoreRestSiblings: true, 56 | argsIgnorePattern: '^_', 57 | varsIgnorePattern: '^\\$\\$(Props|Events|Slots)$', 58 | }, 59 | ], 60 | }, 61 | } 62 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: poppanator 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: ['https://www.paypal.com/paypalme/poppanator'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | node_modules 3 | .npmrc 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | dist/** 2 | node_modules/** 3 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | semi: false, 3 | trailingComma: 'all', 4 | singleQuote: true, 5 | trailingComma: 'es5', 6 | arrowParens: 'always', 7 | } 8 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | All notable changes to this project will be documented in this file. 2 | 3 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 4 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 5 | 6 | ## [Unreleased] 7 | 8 | - _(empty)_ 9 | 10 | ## [5.0.0-svelte5.0] 2024-01-13 11 | 12 | ### Added 13 | 14 | - Support for Svelte 5 (Experimental) 15 | 16 | ## [4.2.1] 2024-01-14 17 | 18 | ### Changed 19 | 20 | - `@rollup/pluginutils` needs to be a dependency. 21 | 22 | This should fix [#54](https://github.com/poppa/sveltekit-svg/issues/54) 23 | 24 | ## [4.2.0] 2024-01-08 25 | 26 | ### Added 27 | 28 | - SVGs imported as URLs (`import svgUrl from ./some.svg?url`) will now be 29 | _SVGO_ optimized before written to disk on production builds. 30 | 31 | NOTE: SVGs imported as URLs will **not** be optimized in `dev` mode. 32 | 33 | This should fix [#52](https://github.com/poppa/sveltekit-svg/issues/52) 34 | 35 | ## [4.1.3] 2023-09-01 36 | 37 | ### Changed 38 | 39 | - Always return a partial `SourceDescription` when returning code 40 | 41 | This hopefully fixes [#48](https://github.com/poppa/sveltekit-svg/issues/48) 42 | 43 | - Updated dev dependencies 44 | 45 | ## [4.1.2] 2023-08-31 46 | 47 | ### Changed 48 | 49 | - Return the full JS result from compile 50 | 51 | This will include the `map` property as well. 52 | 53 | This should fix #48. 54 | 55 | ## [4.1.1] 2023-08-31 56 | 57 | ### Changed 58 | 59 | - Set Svelte compiler css option to 'none' 60 | 61 | The `css` option to Svelte `compile()` has changed and setting it to a 62 | `boolean` value has been deprecated. 63 | 64 | This gave the _compilerOptions.css as a boolean is deprecated. Use 'external' 65 | instead of false._ warning. 66 | 67 | Since we're disregarding the `css` field in the generated result, we can set 68 | this option to `none` and skip all CSS stuff altogether. 69 | 70 | ## [4.1.0] 2023-08-07 71 | 72 | ### Added 73 | 74 | - Added the `preCompileHook` option. 75 | 76 | This is a function that lets the consumer transform the SVG into a Svelte 77 | component before being passed to the Svelte compiler. 78 | 79 | ## [4.0.1] 2023-08-03 80 | 81 | ### Changed 82 | 83 | Render the contents of the `` tag using `{@html}` in the component mode. 84 | 85 | This is to prevent Svelte having to parse the entire SVG. 86 | 87 | Thanks [Arad Alvand](https://github.com/aradalvand) for the code. 88 | 89 | This solves [#39](https://github.com/poppa/sveltekit-svg/issues/39) 90 | 91 | ## [4.0.0] 2023-06-23 92 | 93 | Updated dependencies and stuff to play along with Svelte 4 94 | 95 | No code changes 96 | 97 | ## [3.0.1] 2023-05-20 98 | 99 | ### Changed 100 | 101 | This is a maintenance release with no code changes 102 | 103 | - Updated all NPM packages 104 | - Renamed `app.d.ts` to `svg.d.ts` since Svelte doesn't like these typings in 105 | `app.d.ts` (see [issue 25](https://github.com/poppa/sveltekit-svg/issues/25)) 106 | - Also copy `svg.d.ts` to `dist/` on build. 107 | - Some fixes to the README file 108 | - Thanks to @joakimnordling for PR #35 109 | 110 | ## [3.0.0] 2023-03-18 111 | 112 | ### Added 113 | 114 | - Support for the SVGO datauri option in the `dataurl` query parameter. 115 | This means that `?dataurl=base64`, `?dataurl=enc` and `?dataurl=unenc` works 116 | 117 | ### Changed 118 | 119 | - Upgraded all NPM packages and bumped the SVGO dependency ro SVGO >=3.0 120 | 121 | ## [2.1.2] 2023-01-29 122 | 123 | ### Fixed 124 | 125 | - Keep the generated source map 126 | 127 | This removes the "Sourcemap is likely to be incorrect: a plugi 128 | (sveltekit-svg) was used to transform files..." warning seen when using this 129 | plugin outside of SvelteKit 130 | 131 | ## [2.1.1] 2023-01-25 132 | 133 | ### Fixed 134 | 135 | - Hot-reload is working for component instances, that is editing a SVG imported 136 | as a component will hot-reload it. SVG:s imported a URL:s will require a page 137 | reload. 138 | 139 | This solves issue [#30](https://github.com/poppa/sveltekit-svg/issues/30) 140 | 141 | ## [2.0.2] 2022-12-29 142 | 143 | ### Fixed 144 | 145 | - Proper type in sample `.d.ts` for component. This will get proper intellisense 146 | for all valid SVG attributes. Thank to [YummYume](https://github.com/YummYume) 147 | for the example code. 148 | 149 | - Upgraded all NPM packages 150 | 151 | ## [2.0.0] 2022-12-12 152 | 153 | ### Fixed 154 | 155 | - Updated to work with Vite 4.0 and latest SvelteKit 156 | 157 | ## [1.1.0] 2022-11-17 158 | 159 | ### Added 160 | 161 | - We now support generating inline data URLs (`data:image/svg+xml;base64,...`), 162 | which can be used in `` attributes, by appending the querystring 163 | variable `?dataurl` to an SVG import. 164 | 165 | ```svelte 166 | 169 | 170 | 171 | ``` 172 | 173 | `?dataurl` differs from `?url` in that SVGO optimization/transform will be 174 | applied to the SVG before it's turned into a data URL. 175 | 176 | ## [1.0.1] 2022-11-07 177 | 178 | ### Changed 179 | 180 | - Use the proper Vite `Plugin` type. The transform signature wasn't 100% 181 | compatible with the `Plugin` interface and would cause errors when the 182 | Vite config file is a Typescript file (e.g. `vite.config.ts`) 183 | 184 | - The suggested `*.svg?component` type definition now has a proper Svelte 185 | typed component interface 186 | 187 | ```ts 188 | declare module '*.svg?component' { 189 | const content: ConstructorOfATypedSvelteComponent 190 | export default content 191 | } 192 | ``` 193 | 194 | ## [1.0.0] 2022-07-27 195 | 196 | Lets go 1.0 197 | 198 | ### Changed 199 | 200 | - Use `vite.config.js` instead of `svelte.config.js` in README. 201 | _Thank you [Arad](https://github.com/aradalvand) for the PR_ 202 | 203 | ## [0.3.4] 2022-06-20 204 | 205 | ### Changed 206 | 207 | - Type definitions for the update Svgo dependency are stricter. If we get an 208 | `OptimizeError` from SVGO we notify and return early 209 | 210 | ## [0.3.3] 2022-06-20 211 | 212 | No changes. Updated package dependencies and added to the README file. 213 | 214 | ## [0.3.2] 2022-04-11 215 | 216 | Thanks to [Miguel Camba](https://github.com/cibernox) for the contribution. 217 | 218 | ### Added 219 | 220 | - By giving `false` as value to the SVGO option you can bypass SVGO altogether. 221 | This is useful when optimization might break SVG animations and alike. 222 | 223 | ## [0.3.0] 2022-02-15 224 | 225 | Thanks to [Jani](https://github.com/ljani) for the contributions 226 | 227 | ### Added 228 | 229 | - It's now possible to pass multiple `svg` transformers based on path prefixes 230 | if you want to apply different SVGO options for SVGs in different locations. 231 | 232 | Example: 233 | 234 | ```ts 235 | const config = { 236 | ..., 237 | 238 | kit: { 239 | ..., 240 | vite: { 241 | plugins: [ 242 | svg({ 243 | includePaths: ["./src/lib/icons/", "./src/assets/icons/"], 244 | svgoOptions: { 245 | multipass: true, 246 | plugins: [ 247 | "preset-default", { 248 | name: "removeAttrs", params: { attrs: "(fill|stroke)" } 249 | } 250 | ], 251 | }, 252 | }), 253 | svg({ 254 | includePaths: ["./src/lib/graphics/"], 255 | svgoOptions: { 256 | multipass: true, 257 | plugins: ["preset-default" ], 258 | }, 259 | }), 260 | ] 261 | } 262 | } 263 | } 264 | ``` 265 | 266 | `includePaths` will be normalized, so they can be both absolute and relative 267 | (to the current working directory). 268 | 269 | ### Fixed 270 | 271 | - Passing `path` property to SVGO by default 272 | 273 | ## [0.2.3] 2022-01-20 274 | 275 | ### Fixed 276 | 277 | - Updated README to reflect reality. Mainly use ESM in example 278 | 279 | ## [0.2.2] 2021-12-09 280 | 281 | ### Fixed 282 | 283 | - Update `transform` params for Vite 2.7.0. 284 | This is just an internal change. Thank you 285 | [James Camilleri](https://github.com/james-camilleri) for the fix. 286 | 287 | ## [0.2.1] 2021-12-07 288 | 289 | ### Fixed 290 | 291 | - Noticed that the `index.d.ts` file was missing from the package. 292 | So no code changes 293 | 294 | ## [0.2.0] 2021-12-01 295 | 296 | ### Added 297 | 298 | - It is now possible to pass attributes to the SVG when it is imported as a 299 | Svelte component 300 | 301 | ```svelte 302 | 305 | 306 | 307 | ``` 308 | 309 | Thanks to @AradAral for pushing on this issue 310 | 311 | ## [0.1.8] 2021-11-25 312 | 313 | ### Maintenance 314 | 315 | - No code changes, upgraded package dependencies 316 | 317 | ## [0.1.7] 2021-09-15 318 | 319 | ### Fixed 320 | 321 | - No changes, just a version bump to sync the CHANGELOG file 322 | 323 | ## [0.1.6] - 2021-09-15 324 | 325 | ### Fixed 326 | 327 | - `svgo.optimize()` expects the options argument to be an object or `null`. 328 | However, the TS typings says object or `undefined`, which previously seem 329 | to have been fine but no longer is. 330 | 331 | This solves bug report [#8](https://github.com/poppa/sveltekit-svg/issues/8) 332 | 333 | ## [0.1.4] - 2021-08-19 334 | 335 | ### Changed 336 | 337 | - The Svelte component wasn't using the optimized SVG output. 338 | Thanks @bummzack (https://github.com/bummzack) for the PR. 339 | 340 | ## [0.1.3] - 2021-07-07 341 | 342 | ### Changed 343 | 344 | - Updated README to reflect that the `plugins` property should be a member of 345 | the `vite` property 346 | 347 | ## [0.1.2] - 2021-05-12 348 | 349 | ### Changed 350 | 351 | - Fixed a typo in the README 352 | - Corrected the years in this file 353 | 354 | ## [0.1.1] - 2021-04-30 355 | 356 | ### Changed 357 | 358 | - Changed Svelte peer dep to 3.x 359 | 360 | ## [0.1.0] - 2021-04-30 361 | 362 | ### Changed 363 | 364 | - Added changelog 365 | - Bump version to 0.1.0 366 | 367 | --- 368 | 369 | [unreleased]: https://github.com/poppa/sveltekit-svg/compare/v4.2.1...HEAD 370 | [4.2.1]: https://github.com/poppa/sveltekit-svg/compare/v4.2.0...v4.2.1 371 | [4.2.0]: https://github.com/poppa/sveltekit-svg/compare/v4.1.3...v4.2.0 372 | [4.1.3]: https://github.com/poppa/sveltekit-svg/compare/v4.1.2...v4.1.3 373 | [4.1.2]: https://github.com/poppa/sveltekit-svg/compare/v4.1.1...v4.1.2 374 | [4.1.1]: https://github.com/poppa/sveltekit-svg/compare/v4.1.0...v4.1.1 375 | [4.1.0]: https://github.com/poppa/sveltekit-svg/compare/v4.0.1...v4.1.0 376 | [4.0.1]: https://github.com/poppa/sveltekit-svg/compare/v4.0.0...v4.0.1 377 | [4.0.0]: https://github.com/poppa/sveltekit-svg/compare/v3.0.1...v4.0.0 378 | [3.0.1]: https://github.com/poppa/sveltekit-svg/compare/v3.0.0...v3.0.1 379 | [3.0.0]: https://github.com/poppa/sveltekit-svg/compare/v2.1.2...v3.0.0 380 | [2.1.2]: https://github.com/poppa/sveltekit-svg/compare/v2.1.1...v2.1.2 381 | [2.1.1]: https://github.com/poppa/sveltekit-svg/compare/v2.0.2...v2.1.1 382 | [2.0.2]: https://github.com/poppa/sveltekit-svg/compare/v2.0.0...v2.0.2 383 | [2.0.0]: https://github.com/poppa/sveltekit-svg/compare/v1.1.0...v2.0.0 384 | [1.1.0]: https://github.com/poppa/sveltekit-svg/compare/v1.0.1...v1.1.0 385 | [1.0.1]: https://github.com/poppa/sveltekit-svg/compare/v1.0.0...v1.0.1 386 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Pontus Östlund 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SvelteKit SVG Plugin 2 | 3 | This plugin makes it possible to import SVG files as Svelte 4 | components, inline SVG code or urls. 5 | 6 | > ### **NOTE!** For **Svelte 4** projects, use version 4 of this plugin 7 | 8 | > _NOTE! This plugin isn't just for SvelteKit, but works for any Svelte 9 | project using Vite_ 10 | 11 | ## Install 12 | 13 | - `yarn add --dev @poppanator/sveltekit-svg` 14 | - `npm install -D @poppanator/sveltekit-svg` 15 | 16 | ## Usage 17 | 18 | In your `vite.config.js` 19 | 20 | ```js 21 | import { sveltekit } from '@sveltejs/kit/vite' 22 | import svg from '@poppanator/sveltekit-svg' 23 | 24 | /** @type {import('vite').UserConfig} */ 25 | const config = { 26 | plugins: [ 27 | sveltekit(), 28 | svg(options), // Options are optional 29 | ], 30 | } 31 | 32 | export default config 33 | ``` 34 | 35 | You can also pass multiple `svg` transformers based on paths if you want to 36 | apply different SVGO options for different SVGs 37 | 38 | ```js 39 | const config = { 40 | plugins: [ 41 | sveltekit(), 42 | svg({ 43 | includePaths: ['./src/lib/icons/', './src/assets/icons/'], 44 | svgoOptions: { 45 | multipass: true, 46 | plugins: [ 47 | { 48 | name: 'preset-default', 49 | // by default svgo removes the viewBox which prevents svg icons from scaling 50 | // not a good idea! https://github.com/svg/svgo/pull/1461 51 | params: { overrides: { removeViewBox: false } }, 52 | }, 53 | { name: 'removeAttrs', params: { attrs: '(fill|stroke)' } }, 54 | ], 55 | }, 56 | }), 57 | svg({ 58 | includePaths: ['./src/lib/graphics/'], 59 | svgoOptions: { 60 | multipass: true, 61 | plugins: ['preset-default'], 62 | }, 63 | }), 64 | ], 65 | } 66 | ``` 67 | 68 | ## Svelte usage 69 | 70 | **Import as a Svelte component:** 71 | 72 | > **NOTE!** It's recommended that you use the `?component` query string if you 73 | > use the suggested type definition below. The reason is that **Vite** ships a 74 | > type definition for `*.svg` which states that `import Comp from './file.svg` 75 | > returns a string. 76 | > 77 | > So providing a default type definition for `*.svg` is in most cases causing 78 | > a conflict which will lead to TSC errors when treating such an import as a 79 | > Svelte component. 80 | > 81 | > So the best way to avoid errors, current and future, is to always use 82 | > `import Comp from './file.svg?component` with the suggested type definition 83 | > at the end of this file. 84 | 85 | ```svelte 86 | 89 | 90 | 91 | ``` 92 | 93 | When used as a component you can also pass attributes to the SVG 94 | 95 | ```svelte 96 | 97 | ``` 98 | 99 | **Import as file path:** 100 | 101 | ```svelte 102 | 105 | 106 | 107 | ``` 108 | 109 | **Import as data URL:** 110 | 111 | ```svelte 112 | 115 | 116 | 117 | ``` 118 | 119 | In contrast to `?url` this will apply SVGO optimization/transform before the 120 | the SVG is turned into a data URL 121 | 122 | You can also pass the SVGO config option `datauri` as value to `?dataurl`. 123 | This will, for instance, generate an URI encoded string 124 | 125 | ```svelte 126 | 129 | 130 | 131 | ``` 132 | 133 | **Import as code:** 134 | 135 | ```svelte 136 | 139 | 140 | {@html logo} 141 | ``` 142 | 143 | ## Options 144 | 145 | ````ts 146 | interface Options { 147 | /** 148 | * Output type 149 | * 150 | * `dataurl` can also take the following options, which are verbatim SVGO 151 | * `datauri` options: 152 | * 153 | * - `?dataurl=base64` (default, same as `?dataurl`) 154 | * - `?dataurl=enc` URL encoded string 155 | * - `?dataurl=unenc` Plain SVG 156 | * 157 | * @default "component" 158 | */ 159 | type?: 'src' | 'url' | 'component' | 'dataurl' 160 | /** 161 | * Verbatim [SVGO](https://github.com/svg/svgo) options 162 | * 163 | * If no options are given, the SVG will be optimized with the default SVGO 164 | * options. 165 | * If `false` SVGO will be bypassed altogether 166 | */ 167 | svgoOptions?: Config | false 168 | /** 169 | * Paths to apply the SVG plugin on. This can be useful if you want to apply 170 | * different SVGO options/plugins on different SVGs. 171 | * 172 | * The paths are path prefixes and should be relative to your 173 | * `svelte.config.js` file. 174 | * 175 | * @example 176 | * ``` 177 | * { 178 | * includePaths: ['src/assets/icons/', 'src/images/icons/'] 179 | * } 180 | * ``` 181 | */ 182 | includePaths?: string[] 183 | /** 184 | * Hook that lets you transform the svg to a raw Svelte component yourself, 185 | * before being passed to the Svelte compiler. 186 | * 187 | * @param rawSvg The raw SVG data as read from disk 188 | * @param splitSvg The SVG split into parts, e.g its attributes and 189 | * its content 190 | * @returns This should return a complete Svelte component that can be passed 191 | * to the Svelte compiler 192 | */ 193 | preCompileHook?(rawSvg: string, splitSvg: SplitSvg): string 194 | } 195 | ```` 196 | 197 | ## Typescript 198 | 199 | For Typescript not to complain about `file.svg?component` et.al, add the 200 | following import statement to `src/app.d.ts` (or any `.d.ts` file somewhere in the path of your 201 | project where `tsc` can find it). 202 | 203 | ```ts 204 | import '@poppanator/sveltekit-svg/dist/svg.d.ts' 205 | ``` 206 | 207 | > **NOTE!** If you have `module`/`moduleResolution` set to `NodeNext` in your 208 | > Typescript config, you **MUST** include `.d.ts` in the import of the SVG 209 | > type definition. 210 | 211 | ## Notes on using with _Jest_ 212 | 213 | _I don't know if this still applies, but it's kept here for good measure_ 214 | 215 | According to a report [_Jest_](https://jestjs.io/) will have trouble 216 | transforming `.svg` files when such is imported as a Svelte component. 217 | 218 | The solution seems to be to add a module name mapper entry in the the 219 | `jest.config.cjs` file, like so: 220 | 221 | ```js 222 | module.exports = { 223 | // ... other config 224 | moduleNameMapper: { 225 | // ... other mappers 226 | '^.+\\.svg$': '/src/lib/EmptyIcon.svelte', 227 | }, 228 | } 229 | ``` 230 | 231 | where `src/lib/EmptyIcon.svelte` can contain just ``. 232 | 233 | > [See the reported issue and solution](https://github.com/poppa/sveltekit-svg/issues/22) 234 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@poppanator/sveltekit-svg", 3 | "version": "5.0.1", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "@poppanator/sveltekit-svg", 9 | "version": "5.0.1", 10 | "license": "MIT", 11 | "dependencies": { 12 | "@rollup/pluginutils": "5.1.4", 13 | "svgo": "^3.2.0" 14 | }, 15 | "devDependencies": { 16 | "@playwright/test": "1.50.0", 17 | "@types/node": "22.10.10", 18 | "@typescript-eslint/eslint-plugin": "8.21.0", 19 | "@typescript-eslint/parser": "8.21.0", 20 | "cross-env": "^7.0.3", 21 | "eslint": "9.18.0", 22 | "eslint-config-prettier": "10.0.1", 23 | "eslint-plugin-prettier": "5.2.3", 24 | "svelte": "5.20.1", 25 | "svelte-check": "4.1.4", 26 | "svelte-preprocess": "^6.0.3", 27 | "tslib": "2.8.1", 28 | "typescript": "5.7.3", 29 | "vite": "6.0.11" 30 | }, 31 | "peerDependencies": { 32 | "svelte": ">=5.x", 33 | "vite": ">=5.x || >= 6.x" 34 | } 35 | }, 36 | "node_modules/@ampproject/remapping": { 37 | "version": "2.3.0", 38 | "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", 39 | "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", 40 | "dev": true, 41 | "dependencies": { 42 | "@jridgewell/gen-mapping": "^0.3.5", 43 | "@jridgewell/trace-mapping": "^0.3.24" 44 | }, 45 | "engines": { 46 | "node": ">=6.0.0" 47 | } 48 | }, 49 | "node_modules/@esbuild/darwin-arm64": { 50 | "version": "0.24.2", 51 | "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.2.tgz", 52 | "integrity": "sha512-kj3AnYWc+CekmZnS5IPu9D+HWtUI49hbnyqk0FLEJDbzCIQt7hg7ucF1SQAilhtYpIujfaHr6O0UHlzzSPdOeA==", 53 | "cpu": [ 54 | "arm64" 55 | ], 56 | "dev": true, 57 | "optional": true, 58 | "os": [ 59 | "darwin" 60 | ], 61 | "engines": { 62 | "node": ">=18" 63 | } 64 | }, 65 | "node_modules/@eslint-community/eslint-utils": { 66 | "version": "4.4.0", 67 | "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", 68 | "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", 69 | "dev": true, 70 | "dependencies": { 71 | "eslint-visitor-keys": "^3.3.0" 72 | }, 73 | "engines": { 74 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 75 | }, 76 | "peerDependencies": { 77 | "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" 78 | } 79 | }, 80 | "node_modules/@eslint-community/regexpp": { 81 | "version": "4.12.1", 82 | "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", 83 | "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", 84 | "dev": true, 85 | "engines": { 86 | "node": "^12.0.0 || ^14.0.0 || >=16.0.0" 87 | } 88 | }, 89 | "node_modules/@eslint/config-array": { 90 | "version": "0.19.1", 91 | "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.1.tgz", 92 | "integrity": "sha512-fo6Mtm5mWyKjA/Chy1BYTdn5mGJoDNjC7C64ug20ADsRDGrA85bN3uK3MaKbeRkRuuIEAR5N33Jr1pbm411/PA==", 93 | "dev": true, 94 | "dependencies": { 95 | "@eslint/object-schema": "^2.1.5", 96 | "debug": "^4.3.1", 97 | "minimatch": "^3.1.2" 98 | }, 99 | "engines": { 100 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 101 | } 102 | }, 103 | "node_modules/@eslint/config-array/node_modules/brace-expansion": { 104 | "version": "1.1.11", 105 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 106 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 107 | "dev": true, 108 | "dependencies": { 109 | "balanced-match": "^1.0.0", 110 | "concat-map": "0.0.1" 111 | } 112 | }, 113 | "node_modules/@eslint/config-array/node_modules/minimatch": { 114 | "version": "3.1.2", 115 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", 116 | "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", 117 | "dev": true, 118 | "dependencies": { 119 | "brace-expansion": "^1.1.7" 120 | }, 121 | "engines": { 122 | "node": "*" 123 | } 124 | }, 125 | "node_modules/@eslint/core": { 126 | "version": "0.10.0", 127 | "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.10.0.tgz", 128 | "integrity": "sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw==", 129 | "dev": true, 130 | "dependencies": { 131 | "@types/json-schema": "^7.0.15" 132 | }, 133 | "engines": { 134 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 135 | } 136 | }, 137 | "node_modules/@eslint/eslintrc": { 138 | "version": "3.2.0", 139 | "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz", 140 | "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==", 141 | "dev": true, 142 | "dependencies": { 143 | "ajv": "^6.12.4", 144 | "debug": "^4.3.2", 145 | "espree": "^10.0.1", 146 | "globals": "^14.0.0", 147 | "ignore": "^5.2.0", 148 | "import-fresh": "^3.2.1", 149 | "js-yaml": "^4.1.0", 150 | "minimatch": "^3.1.2", 151 | "strip-json-comments": "^3.1.1" 152 | }, 153 | "engines": { 154 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 155 | }, 156 | "funding": { 157 | "url": "https://opencollective.com/eslint" 158 | } 159 | }, 160 | "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { 161 | "version": "1.1.11", 162 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 163 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 164 | "dev": true, 165 | "dependencies": { 166 | "balanced-match": "^1.0.0", 167 | "concat-map": "0.0.1" 168 | } 169 | }, 170 | "node_modules/@eslint/eslintrc/node_modules/minimatch": { 171 | "version": "3.1.2", 172 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", 173 | "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", 174 | "dev": true, 175 | "dependencies": { 176 | "brace-expansion": "^1.1.7" 177 | }, 178 | "engines": { 179 | "node": "*" 180 | } 181 | }, 182 | "node_modules/@eslint/js": { 183 | "version": "9.18.0", 184 | "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.18.0.tgz", 185 | "integrity": "sha512-fK6L7rxcq6/z+AaQMtiFTkvbHkBLNlwyRxHpKawP0x3u9+NC6MQTnFW+AdpwC6gfHTW0051cokQgtTN2FqlxQA==", 186 | "dev": true, 187 | "engines": { 188 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 189 | } 190 | }, 191 | "node_modules/@eslint/object-schema": { 192 | "version": "2.1.5", 193 | "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.5.tgz", 194 | "integrity": "sha512-o0bhxnL89h5Bae5T318nFoFzGy+YE5i/gGkoPAgkmTVdRKTiv3p8JHevPiPaMwoloKfEiiaHlawCqaZMqRm+XQ==", 195 | "dev": true, 196 | "engines": { 197 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 198 | } 199 | }, 200 | "node_modules/@eslint/plugin-kit": { 201 | "version": "0.2.5", 202 | "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.5.tgz", 203 | "integrity": "sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A==", 204 | "dev": true, 205 | "dependencies": { 206 | "@eslint/core": "^0.10.0", 207 | "levn": "^0.4.1" 208 | }, 209 | "engines": { 210 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 211 | } 212 | }, 213 | "node_modules/@humanfs/core": { 214 | "version": "0.19.1", 215 | "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", 216 | "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", 217 | "dev": true, 218 | "engines": { 219 | "node": ">=18.18.0" 220 | } 221 | }, 222 | "node_modules/@humanfs/node": { 223 | "version": "0.16.6", 224 | "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", 225 | "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", 226 | "dev": true, 227 | "dependencies": { 228 | "@humanfs/core": "^0.19.1", 229 | "@humanwhocodes/retry": "^0.3.0" 230 | }, 231 | "engines": { 232 | "node": ">=18.18.0" 233 | } 234 | }, 235 | "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { 236 | "version": "0.3.1", 237 | "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", 238 | "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", 239 | "dev": true, 240 | "engines": { 241 | "node": ">=18.18" 242 | }, 243 | "funding": { 244 | "type": "github", 245 | "url": "https://github.com/sponsors/nzakas" 246 | } 247 | }, 248 | "node_modules/@humanwhocodes/module-importer": { 249 | "version": "1.0.1", 250 | "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", 251 | "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", 252 | "dev": true, 253 | "engines": { 254 | "node": ">=12.22" 255 | }, 256 | "funding": { 257 | "type": "github", 258 | "url": "https://github.com/sponsors/nzakas" 259 | } 260 | }, 261 | "node_modules/@humanwhocodes/retry": { 262 | "version": "0.4.1", 263 | "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.1.tgz", 264 | "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==", 265 | "dev": true, 266 | "engines": { 267 | "node": ">=18.18" 268 | }, 269 | "funding": { 270 | "type": "github", 271 | "url": "https://github.com/sponsors/nzakas" 272 | } 273 | }, 274 | "node_modules/@jridgewell/gen-mapping": { 275 | "version": "0.3.5", 276 | "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", 277 | "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", 278 | "dev": true, 279 | "dependencies": { 280 | "@jridgewell/set-array": "^1.2.1", 281 | "@jridgewell/sourcemap-codec": "^1.4.10", 282 | "@jridgewell/trace-mapping": "^0.3.24" 283 | }, 284 | "engines": { 285 | "node": ">=6.0.0" 286 | } 287 | }, 288 | "node_modules/@jridgewell/resolve-uri": { 289 | "version": "3.1.2", 290 | "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", 291 | "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", 292 | "dev": true, 293 | "engines": { 294 | "node": ">=6.0.0" 295 | } 296 | }, 297 | "node_modules/@jridgewell/set-array": { 298 | "version": "1.2.1", 299 | "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", 300 | "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", 301 | "dev": true, 302 | "engines": { 303 | "node": ">=6.0.0" 304 | } 305 | }, 306 | "node_modules/@jridgewell/sourcemap-codec": { 307 | "version": "1.5.0", 308 | "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", 309 | "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", 310 | "dev": true 311 | }, 312 | "node_modules/@jridgewell/trace-mapping": { 313 | "version": "0.3.25", 314 | "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", 315 | "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", 316 | "dev": true, 317 | "dependencies": { 318 | "@jridgewell/resolve-uri": "^3.1.0", 319 | "@jridgewell/sourcemap-codec": "^1.4.14" 320 | } 321 | }, 322 | "node_modules/@nodelib/fs.scandir": { 323 | "version": "2.1.5", 324 | "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", 325 | "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", 326 | "dev": true, 327 | "dependencies": { 328 | "@nodelib/fs.stat": "2.0.5", 329 | "run-parallel": "^1.1.9" 330 | }, 331 | "engines": { 332 | "node": ">= 8" 333 | } 334 | }, 335 | "node_modules/@nodelib/fs.stat": { 336 | "version": "2.0.5", 337 | "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", 338 | "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", 339 | "dev": true, 340 | "engines": { 341 | "node": ">= 8" 342 | } 343 | }, 344 | "node_modules/@nodelib/fs.walk": { 345 | "version": "1.2.8", 346 | "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", 347 | "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", 348 | "dev": true, 349 | "dependencies": { 350 | "@nodelib/fs.scandir": "2.1.5", 351 | "fastq": "^1.6.0" 352 | }, 353 | "engines": { 354 | "node": ">= 8" 355 | } 356 | }, 357 | "node_modules/@pkgr/core": { 358 | "version": "0.1.1", 359 | "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", 360 | "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", 361 | "dev": true, 362 | "engines": { 363 | "node": "^12.20.0 || ^14.18.0 || >=16.0.0" 364 | }, 365 | "funding": { 366 | "url": "https://opencollective.com/unts" 367 | } 368 | }, 369 | "node_modules/@playwright/test": { 370 | "version": "1.50.0", 371 | "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.50.0.tgz", 372 | "integrity": "sha512-ZGNXbt+d65EGjBORQHuYKj+XhCewlwpnSd/EDuLPZGSiEWmgOJB5RmMCCYGy5aMfTs9wx61RivfDKi8H/hcMvw==", 373 | "dev": true, 374 | "dependencies": { 375 | "playwright": "1.50.0" 376 | }, 377 | "bin": { 378 | "playwright": "cli.js" 379 | }, 380 | "engines": { 381 | "node": ">=18" 382 | } 383 | }, 384 | "node_modules/@rollup/pluginutils": { 385 | "version": "5.1.4", 386 | "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.4.tgz", 387 | "integrity": "sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==", 388 | "dependencies": { 389 | "@types/estree": "^1.0.0", 390 | "estree-walker": "^2.0.2", 391 | "picomatch": "^4.0.2" 392 | }, 393 | "engines": { 394 | "node": ">=14.0.0" 395 | }, 396 | "peerDependencies": { 397 | "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" 398 | }, 399 | "peerDependenciesMeta": { 400 | "rollup": { 401 | "optional": true 402 | } 403 | } 404 | }, 405 | "node_modules/@rollup/rollup-darwin-arm64": { 406 | "version": "4.24.0", 407 | "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.24.0.tgz", 408 | "integrity": "sha512-bIv+X9xeSs1XCk6DVvkO+S/z8/2AMt/2lMqdQbMrmVpgFvXlmde9mLcbQpztXm1tajC3raFDqegsH18HQPMYtA==", 409 | "cpu": [ 410 | "arm64" 411 | ], 412 | "dev": true, 413 | "optional": true, 414 | "os": [ 415 | "darwin" 416 | ] 417 | }, 418 | "node_modules/@trysound/sax": { 419 | "version": "0.2.0", 420 | "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", 421 | "integrity": "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==", 422 | "engines": { 423 | "node": ">=10.13.0" 424 | } 425 | }, 426 | "node_modules/@types/estree": { 427 | "version": "1.0.6", 428 | "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", 429 | "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==" 430 | }, 431 | "node_modules/@types/json-schema": { 432 | "version": "7.0.15", 433 | "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", 434 | "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", 435 | "dev": true 436 | }, 437 | "node_modules/@types/node": { 438 | "version": "22.10.10", 439 | "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.10.tgz", 440 | "integrity": "sha512-X47y/mPNzxviAGY5TcYPtYL8JsY3kAq2n8fMmKoRCxq/c4v4pyGNCzM2R6+M5/umG4ZfHuT+sgqDYqWc9rJ6ww==", 441 | "dev": true, 442 | "dependencies": { 443 | "undici-types": "~6.20.0" 444 | } 445 | }, 446 | "node_modules/@typescript-eslint/eslint-plugin": { 447 | "version": "8.21.0", 448 | "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.21.0.tgz", 449 | "integrity": "sha512-eTH+UOR4I7WbdQnG4Z48ebIA6Bgi7WO8HvFEneeYBxG8qCOYgTOFPSg6ek9ITIDvGjDQzWHcoWHCDO2biByNzA==", 450 | "dev": true, 451 | "dependencies": { 452 | "@eslint-community/regexpp": "^4.10.0", 453 | "@typescript-eslint/scope-manager": "8.21.0", 454 | "@typescript-eslint/type-utils": "8.21.0", 455 | "@typescript-eslint/utils": "8.21.0", 456 | "@typescript-eslint/visitor-keys": "8.21.0", 457 | "graphemer": "^1.4.0", 458 | "ignore": "^5.3.1", 459 | "natural-compare": "^1.4.0", 460 | "ts-api-utils": "^2.0.0" 461 | }, 462 | "engines": { 463 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 464 | }, 465 | "funding": { 466 | "type": "opencollective", 467 | "url": "https://opencollective.com/typescript-eslint" 468 | }, 469 | "peerDependencies": { 470 | "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", 471 | "eslint": "^8.57.0 || ^9.0.0", 472 | "typescript": ">=4.8.4 <5.8.0" 473 | } 474 | }, 475 | "node_modules/@typescript-eslint/parser": { 476 | "version": "8.21.0", 477 | "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.21.0.tgz", 478 | "integrity": "sha512-Wy+/sdEH9kI3w9civgACwabHbKl+qIOu0uFZ9IMKzX3Jpv9og0ZBJrZExGrPpFAY7rWsXuxs5e7CPPP17A4eYA==", 479 | "dev": true, 480 | "dependencies": { 481 | "@typescript-eslint/scope-manager": "8.21.0", 482 | "@typescript-eslint/types": "8.21.0", 483 | "@typescript-eslint/typescript-estree": "8.21.0", 484 | "@typescript-eslint/visitor-keys": "8.21.0", 485 | "debug": "^4.3.4" 486 | }, 487 | "engines": { 488 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 489 | }, 490 | "funding": { 491 | "type": "opencollective", 492 | "url": "https://opencollective.com/typescript-eslint" 493 | }, 494 | "peerDependencies": { 495 | "eslint": "^8.57.0 || ^9.0.0", 496 | "typescript": ">=4.8.4 <5.8.0" 497 | } 498 | }, 499 | "node_modules/@typescript-eslint/scope-manager": { 500 | "version": "8.21.0", 501 | "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.21.0.tgz", 502 | "integrity": "sha512-G3IBKz0/0IPfdeGRMbp+4rbjfSSdnGkXsM/pFZA8zM9t9klXDnB/YnKOBQ0GoPmoROa4bCq2NeHgJa5ydsQ4mA==", 503 | "dev": true, 504 | "dependencies": { 505 | "@typescript-eslint/types": "8.21.0", 506 | "@typescript-eslint/visitor-keys": "8.21.0" 507 | }, 508 | "engines": { 509 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 510 | }, 511 | "funding": { 512 | "type": "opencollective", 513 | "url": "https://opencollective.com/typescript-eslint" 514 | } 515 | }, 516 | "node_modules/@typescript-eslint/type-utils": { 517 | "version": "8.21.0", 518 | "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.21.0.tgz", 519 | "integrity": "sha512-95OsL6J2BtzoBxHicoXHxgk3z+9P3BEcQTpBKriqiYzLKnM2DeSqs+sndMKdamU8FosiadQFT3D+BSL9EKnAJQ==", 520 | "dev": true, 521 | "dependencies": { 522 | "@typescript-eslint/typescript-estree": "8.21.0", 523 | "@typescript-eslint/utils": "8.21.0", 524 | "debug": "^4.3.4", 525 | "ts-api-utils": "^2.0.0" 526 | }, 527 | "engines": { 528 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 529 | }, 530 | "funding": { 531 | "type": "opencollective", 532 | "url": "https://opencollective.com/typescript-eslint" 533 | }, 534 | "peerDependencies": { 535 | "eslint": "^8.57.0 || ^9.0.0", 536 | "typescript": ">=4.8.4 <5.8.0" 537 | } 538 | }, 539 | "node_modules/@typescript-eslint/types": { 540 | "version": "8.21.0", 541 | "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.21.0.tgz", 542 | "integrity": "sha512-PAL6LUuQwotLW2a8VsySDBwYMm129vFm4tMVlylzdoTybTHaAi0oBp7Ac6LhSrHHOdLM3efH+nAR6hAWoMF89A==", 543 | "dev": true, 544 | "engines": { 545 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 546 | }, 547 | "funding": { 548 | "type": "opencollective", 549 | "url": "https://opencollective.com/typescript-eslint" 550 | } 551 | }, 552 | "node_modules/@typescript-eslint/typescript-estree": { 553 | "version": "8.21.0", 554 | "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.21.0.tgz", 555 | "integrity": "sha512-x+aeKh/AjAArSauz0GiQZsjT8ciadNMHdkUSwBB9Z6PrKc/4knM4g3UfHml6oDJmKC88a6//cdxnO/+P2LkMcg==", 556 | "dev": true, 557 | "dependencies": { 558 | "@typescript-eslint/types": "8.21.0", 559 | "@typescript-eslint/visitor-keys": "8.21.0", 560 | "debug": "^4.3.4", 561 | "fast-glob": "^3.3.2", 562 | "is-glob": "^4.0.3", 563 | "minimatch": "^9.0.4", 564 | "semver": "^7.6.0", 565 | "ts-api-utils": "^2.0.0" 566 | }, 567 | "engines": { 568 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 569 | }, 570 | "funding": { 571 | "type": "opencollective", 572 | "url": "https://opencollective.com/typescript-eslint" 573 | }, 574 | "peerDependencies": { 575 | "typescript": ">=4.8.4 <5.8.0" 576 | } 577 | }, 578 | "node_modules/@typescript-eslint/utils": { 579 | "version": "8.21.0", 580 | "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.21.0.tgz", 581 | "integrity": "sha512-xcXBfcq0Kaxgj7dwejMbFyq7IOHgpNMtVuDveK7w3ZGwG9owKzhALVwKpTF2yrZmEwl9SWdetf3fxNzJQaVuxw==", 582 | "dev": true, 583 | "dependencies": { 584 | "@eslint-community/eslint-utils": "^4.4.0", 585 | "@typescript-eslint/scope-manager": "8.21.0", 586 | "@typescript-eslint/types": "8.21.0", 587 | "@typescript-eslint/typescript-estree": "8.21.0" 588 | }, 589 | "engines": { 590 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 591 | }, 592 | "funding": { 593 | "type": "opencollective", 594 | "url": "https://opencollective.com/typescript-eslint" 595 | }, 596 | "peerDependencies": { 597 | "eslint": "^8.57.0 || ^9.0.0", 598 | "typescript": ">=4.8.4 <5.8.0" 599 | } 600 | }, 601 | "node_modules/@typescript-eslint/visitor-keys": { 602 | "version": "8.21.0", 603 | "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.21.0.tgz", 604 | "integrity": "sha512-BkLMNpdV6prozk8LlyK/SOoWLmUFi+ZD+pcqti9ILCbVvHGk1ui1g4jJOc2WDLaeExz2qWwojxlPce5PljcT3w==", 605 | "dev": true, 606 | "dependencies": { 607 | "@typescript-eslint/types": "8.21.0", 608 | "eslint-visitor-keys": "^4.2.0" 609 | }, 610 | "engines": { 611 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 612 | }, 613 | "funding": { 614 | "type": "opencollective", 615 | "url": "https://opencollective.com/typescript-eslint" 616 | } 617 | }, 618 | "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { 619 | "version": "4.2.0", 620 | "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", 621 | "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", 622 | "dev": true, 623 | "engines": { 624 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 625 | }, 626 | "funding": { 627 | "url": "https://opencollective.com/eslint" 628 | } 629 | }, 630 | "node_modules/acorn": { 631 | "version": "8.14.0", 632 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", 633 | "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", 634 | "dev": true, 635 | "bin": { 636 | "acorn": "bin/acorn" 637 | }, 638 | "engines": { 639 | "node": ">=0.4.0" 640 | } 641 | }, 642 | "node_modules/acorn-jsx": { 643 | "version": "5.3.2", 644 | "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", 645 | "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", 646 | "dev": true, 647 | "peerDependencies": { 648 | "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" 649 | } 650 | }, 651 | "node_modules/acorn-typescript": { 652 | "version": "1.4.13", 653 | "resolved": "https://registry.npmjs.org/acorn-typescript/-/acorn-typescript-1.4.13.tgz", 654 | "integrity": "sha512-xsc9Xv0xlVfwp2o7sQ+GCQ1PgbkdcpWdTzrwXxO3xDMTAywVS3oXVOcOHuRjAPkS4P9b+yc/qNF15460v+jp4Q==", 655 | "dev": true, 656 | "peerDependencies": { 657 | "acorn": ">=8.9.0" 658 | } 659 | }, 660 | "node_modules/ajv": { 661 | "version": "6.12.6", 662 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", 663 | "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", 664 | "dev": true, 665 | "dependencies": { 666 | "fast-deep-equal": "^3.1.1", 667 | "fast-json-stable-stringify": "^2.0.0", 668 | "json-schema-traverse": "^0.4.1", 669 | "uri-js": "^4.2.2" 670 | }, 671 | "funding": { 672 | "type": "github", 673 | "url": "https://github.com/sponsors/epoberezkin" 674 | } 675 | }, 676 | "node_modules/ansi-styles": { 677 | "version": "4.3.0", 678 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 679 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 680 | "dev": true, 681 | "dependencies": { 682 | "color-convert": "^2.0.1" 683 | }, 684 | "engines": { 685 | "node": ">=8" 686 | }, 687 | "funding": { 688 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 689 | } 690 | }, 691 | "node_modules/argparse": { 692 | "version": "2.0.1", 693 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", 694 | "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", 695 | "dev": true 696 | }, 697 | "node_modules/aria-query": { 698 | "version": "5.3.2", 699 | "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz", 700 | "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==", 701 | "dev": true, 702 | "engines": { 703 | "node": ">= 0.4" 704 | } 705 | }, 706 | "node_modules/axobject-query": { 707 | "version": "4.1.0", 708 | "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", 709 | "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==", 710 | "dev": true, 711 | "engines": { 712 | "node": ">= 0.4" 713 | } 714 | }, 715 | "node_modules/balanced-match": { 716 | "version": "1.0.2", 717 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 718 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", 719 | "dev": true 720 | }, 721 | "node_modules/boolbase": { 722 | "version": "1.0.0", 723 | "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", 724 | "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" 725 | }, 726 | "node_modules/brace-expansion": { 727 | "version": "2.0.1", 728 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", 729 | "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", 730 | "dev": true, 731 | "dependencies": { 732 | "balanced-match": "^1.0.0" 733 | } 734 | }, 735 | "node_modules/braces": { 736 | "version": "3.0.3", 737 | "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", 738 | "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", 739 | "dev": true, 740 | "dependencies": { 741 | "fill-range": "^7.1.1" 742 | }, 743 | "engines": { 744 | "node": ">=8" 745 | } 746 | }, 747 | "node_modules/callsites": { 748 | "version": "3.1.0", 749 | "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", 750 | "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", 751 | "dev": true, 752 | "engines": { 753 | "node": ">=6" 754 | } 755 | }, 756 | "node_modules/chalk": { 757 | "version": "4.1.2", 758 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", 759 | "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", 760 | "dev": true, 761 | "dependencies": { 762 | "ansi-styles": "^4.1.0", 763 | "supports-color": "^7.1.0" 764 | }, 765 | "engines": { 766 | "node": ">=10" 767 | }, 768 | "funding": { 769 | "url": "https://github.com/chalk/chalk?sponsor=1" 770 | } 771 | }, 772 | "node_modules/chokidar": { 773 | "version": "4.0.1", 774 | "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.1.tgz", 775 | "integrity": "sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==", 776 | "dev": true, 777 | "dependencies": { 778 | "readdirp": "^4.0.1" 779 | }, 780 | "engines": { 781 | "node": ">= 14.16.0" 782 | }, 783 | "funding": { 784 | "url": "https://paulmillr.com/funding/" 785 | } 786 | }, 787 | "node_modules/clsx": { 788 | "version": "2.1.1", 789 | "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", 790 | "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", 791 | "dev": true, 792 | "engines": { 793 | "node": ">=6" 794 | } 795 | }, 796 | "node_modules/color-convert": { 797 | "version": "2.0.1", 798 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 799 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 800 | "dev": true, 801 | "dependencies": { 802 | "color-name": "~1.1.4" 803 | }, 804 | "engines": { 805 | "node": ">=7.0.0" 806 | } 807 | }, 808 | "node_modules/color-name": { 809 | "version": "1.1.4", 810 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 811 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", 812 | "dev": true 813 | }, 814 | "node_modules/commander": { 815 | "version": "7.2.0", 816 | "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", 817 | "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", 818 | "engines": { 819 | "node": ">= 10" 820 | } 821 | }, 822 | "node_modules/concat-map": { 823 | "version": "0.0.1", 824 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 825 | "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", 826 | "dev": true 827 | }, 828 | "node_modules/cross-env": { 829 | "version": "7.0.3", 830 | "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", 831 | "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", 832 | "dev": true, 833 | "dependencies": { 834 | "cross-spawn": "^7.0.1" 835 | }, 836 | "bin": { 837 | "cross-env": "src/bin/cross-env.js", 838 | "cross-env-shell": "src/bin/cross-env-shell.js" 839 | }, 840 | "engines": { 841 | "node": ">=10.14", 842 | "npm": ">=6", 843 | "yarn": ">=1" 844 | } 845 | }, 846 | "node_modules/cross-spawn": { 847 | "version": "7.0.6", 848 | "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", 849 | "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", 850 | "dev": true, 851 | "dependencies": { 852 | "path-key": "^3.1.0", 853 | "shebang-command": "^2.0.0", 854 | "which": "^2.0.1" 855 | }, 856 | "engines": { 857 | "node": ">= 8" 858 | } 859 | }, 860 | "node_modules/css-select": { 861 | "version": "5.1.0", 862 | "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", 863 | "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", 864 | "dependencies": { 865 | "boolbase": "^1.0.0", 866 | "css-what": "^6.1.0", 867 | "domhandler": "^5.0.2", 868 | "domutils": "^3.0.1", 869 | "nth-check": "^2.0.1" 870 | }, 871 | "funding": { 872 | "url": "https://github.com/sponsors/fb55" 873 | } 874 | }, 875 | "node_modules/css-tree": { 876 | "version": "2.3.1", 877 | "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", 878 | "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", 879 | "dependencies": { 880 | "mdn-data": "2.0.30", 881 | "source-map-js": "^1.0.1" 882 | }, 883 | "engines": { 884 | "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" 885 | } 886 | }, 887 | "node_modules/css-what": { 888 | "version": "6.1.0", 889 | "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", 890 | "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", 891 | "engines": { 892 | "node": ">= 6" 893 | }, 894 | "funding": { 895 | "url": "https://github.com/sponsors/fb55" 896 | } 897 | }, 898 | "node_modules/csso": { 899 | "version": "5.0.5", 900 | "resolved": "https://registry.npmjs.org/csso/-/csso-5.0.5.tgz", 901 | "integrity": "sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==", 902 | "dependencies": { 903 | "css-tree": "~2.2.0" 904 | }, 905 | "engines": { 906 | "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", 907 | "npm": ">=7.0.0" 908 | } 909 | }, 910 | "node_modules/csso/node_modules/css-tree": { 911 | "version": "2.2.1", 912 | "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.2.1.tgz", 913 | "integrity": "sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==", 914 | "dependencies": { 915 | "mdn-data": "2.0.28", 916 | "source-map-js": "^1.0.1" 917 | }, 918 | "engines": { 919 | "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", 920 | "npm": ">=7.0.0" 921 | } 922 | }, 923 | "node_modules/csso/node_modules/mdn-data": { 924 | "version": "2.0.28", 925 | "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.28.tgz", 926 | "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==" 927 | }, 928 | "node_modules/debug": { 929 | "version": "4.3.5", 930 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", 931 | "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", 932 | "dev": true, 933 | "dependencies": { 934 | "ms": "2.1.2" 935 | }, 936 | "engines": { 937 | "node": ">=6.0" 938 | }, 939 | "peerDependenciesMeta": { 940 | "supports-color": { 941 | "optional": true 942 | } 943 | } 944 | }, 945 | "node_modules/deep-is": { 946 | "version": "0.1.4", 947 | "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", 948 | "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", 949 | "dev": true 950 | }, 951 | "node_modules/dom-serializer": { 952 | "version": "2.0.0", 953 | "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", 954 | "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", 955 | "dependencies": { 956 | "domelementtype": "^2.3.0", 957 | "domhandler": "^5.0.2", 958 | "entities": "^4.2.0" 959 | }, 960 | "funding": { 961 | "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" 962 | } 963 | }, 964 | "node_modules/domelementtype": { 965 | "version": "2.3.0", 966 | "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", 967 | "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", 968 | "funding": [ 969 | { 970 | "type": "github", 971 | "url": "https://github.com/sponsors/fb55" 972 | } 973 | ] 974 | }, 975 | "node_modules/domhandler": { 976 | "version": "5.0.3", 977 | "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", 978 | "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", 979 | "dependencies": { 980 | "domelementtype": "^2.3.0" 981 | }, 982 | "engines": { 983 | "node": ">= 4" 984 | }, 985 | "funding": { 986 | "url": "https://github.com/fb55/domhandler?sponsor=1" 987 | } 988 | }, 989 | "node_modules/domutils": { 990 | "version": "3.1.0", 991 | "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", 992 | "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", 993 | "dependencies": { 994 | "dom-serializer": "^2.0.0", 995 | "domelementtype": "^2.3.0", 996 | "domhandler": "^5.0.3" 997 | }, 998 | "funding": { 999 | "url": "https://github.com/fb55/domutils?sponsor=1" 1000 | } 1001 | }, 1002 | "node_modules/eastasianwidth": { 1003 | "version": "0.2.0", 1004 | "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", 1005 | "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", 1006 | "dev": true 1007 | }, 1008 | "node_modules/emoji-regex": { 1009 | "version": "9.2.2", 1010 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", 1011 | "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", 1012 | "dev": true 1013 | }, 1014 | "node_modules/entities": { 1015 | "version": "4.5.0", 1016 | "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", 1017 | "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", 1018 | "engines": { 1019 | "node": ">=0.12" 1020 | }, 1021 | "funding": { 1022 | "url": "https://github.com/fb55/entities?sponsor=1" 1023 | } 1024 | }, 1025 | "node_modules/esbuild": { 1026 | "version": "0.24.2", 1027 | "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.2.tgz", 1028 | "integrity": "sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA==", 1029 | "dev": true, 1030 | "hasInstallScript": true, 1031 | "bin": { 1032 | "esbuild": "bin/esbuild" 1033 | }, 1034 | "engines": { 1035 | "node": ">=18" 1036 | }, 1037 | "optionalDependencies": { 1038 | "@esbuild/aix-ppc64": "0.24.2", 1039 | "@esbuild/android-arm": "0.24.2", 1040 | "@esbuild/android-arm64": "0.24.2", 1041 | "@esbuild/android-x64": "0.24.2", 1042 | "@esbuild/darwin-arm64": "0.24.2", 1043 | "@esbuild/darwin-x64": "0.24.2", 1044 | "@esbuild/freebsd-arm64": "0.24.2", 1045 | "@esbuild/freebsd-x64": "0.24.2", 1046 | "@esbuild/linux-arm": "0.24.2", 1047 | "@esbuild/linux-arm64": "0.24.2", 1048 | "@esbuild/linux-ia32": "0.24.2", 1049 | "@esbuild/linux-loong64": "0.24.2", 1050 | "@esbuild/linux-mips64el": "0.24.2", 1051 | "@esbuild/linux-ppc64": "0.24.2", 1052 | "@esbuild/linux-riscv64": "0.24.2", 1053 | "@esbuild/linux-s390x": "0.24.2", 1054 | "@esbuild/linux-x64": "0.24.2", 1055 | "@esbuild/netbsd-arm64": "0.24.2", 1056 | "@esbuild/netbsd-x64": "0.24.2", 1057 | "@esbuild/openbsd-arm64": "0.24.2", 1058 | "@esbuild/openbsd-x64": "0.24.2", 1059 | "@esbuild/sunos-x64": "0.24.2", 1060 | "@esbuild/win32-arm64": "0.24.2", 1061 | "@esbuild/win32-ia32": "0.24.2", 1062 | "@esbuild/win32-x64": "0.24.2" 1063 | } 1064 | }, 1065 | "node_modules/escape-string-regexp": { 1066 | "version": "4.0.0", 1067 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", 1068 | "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", 1069 | "dev": true, 1070 | "engines": { 1071 | "node": ">=10" 1072 | }, 1073 | "funding": { 1074 | "url": "https://github.com/sponsors/sindresorhus" 1075 | } 1076 | }, 1077 | "node_modules/eslint": { 1078 | "version": "9.18.0", 1079 | "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.18.0.tgz", 1080 | "integrity": "sha512-+waTfRWQlSbpt3KWE+CjrPPYnbq9kfZIYUqapc0uBXyjTp8aYXZDsUH16m39Ryq3NjAVP4tjuF7KaukeqoCoaA==", 1081 | "dev": true, 1082 | "dependencies": { 1083 | "@eslint-community/eslint-utils": "^4.2.0", 1084 | "@eslint-community/regexpp": "^4.12.1", 1085 | "@eslint/config-array": "^0.19.0", 1086 | "@eslint/core": "^0.10.0", 1087 | "@eslint/eslintrc": "^3.2.0", 1088 | "@eslint/js": "9.18.0", 1089 | "@eslint/plugin-kit": "^0.2.5", 1090 | "@humanfs/node": "^0.16.6", 1091 | "@humanwhocodes/module-importer": "^1.0.1", 1092 | "@humanwhocodes/retry": "^0.4.1", 1093 | "@types/estree": "^1.0.6", 1094 | "@types/json-schema": "^7.0.15", 1095 | "ajv": "^6.12.4", 1096 | "chalk": "^4.0.0", 1097 | "cross-spawn": "^7.0.6", 1098 | "debug": "^4.3.2", 1099 | "escape-string-regexp": "^4.0.0", 1100 | "eslint-scope": "^8.2.0", 1101 | "eslint-visitor-keys": "^4.2.0", 1102 | "espree": "^10.3.0", 1103 | "esquery": "^1.5.0", 1104 | "esutils": "^2.0.2", 1105 | "fast-deep-equal": "^3.1.3", 1106 | "file-entry-cache": "^8.0.0", 1107 | "find-up": "^5.0.0", 1108 | "glob-parent": "^6.0.2", 1109 | "ignore": "^5.2.0", 1110 | "imurmurhash": "^0.1.4", 1111 | "is-glob": "^4.0.0", 1112 | "json-stable-stringify-without-jsonify": "^1.0.1", 1113 | "lodash.merge": "^4.6.2", 1114 | "minimatch": "^3.1.2", 1115 | "natural-compare": "^1.4.0", 1116 | "optionator": "^0.9.3" 1117 | }, 1118 | "bin": { 1119 | "eslint": "bin/eslint.js" 1120 | }, 1121 | "engines": { 1122 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 1123 | }, 1124 | "funding": { 1125 | "url": "https://eslint.org/donate" 1126 | }, 1127 | "peerDependencies": { 1128 | "jiti": "*" 1129 | }, 1130 | "peerDependenciesMeta": { 1131 | "jiti": { 1132 | "optional": true 1133 | } 1134 | } 1135 | }, 1136 | "node_modules/eslint-config-prettier": { 1137 | "version": "10.0.1", 1138 | "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.0.1.tgz", 1139 | "integrity": "sha512-lZBts941cyJyeaooiKxAtzoPHTN+GbQTJFAIdQbRhA4/8whaAraEh47Whw/ZFfrjNSnlAxqfm9i0XVAEkULjCw==", 1140 | "dev": true, 1141 | "bin": { 1142 | "eslint-config-prettier": "build/bin/cli.js" 1143 | }, 1144 | "peerDependencies": { 1145 | "eslint": ">=7.0.0" 1146 | } 1147 | }, 1148 | "node_modules/eslint-plugin-prettier": { 1149 | "version": "5.2.3", 1150 | "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.3.tgz", 1151 | "integrity": "sha512-qJ+y0FfCp/mQYQ/vWQ3s7eUlFEL4PyKfAJxsnYTJ4YT73nsJBWqmEpFryxV9OeUiqmsTsYJ5Y+KDNaeP31wrRw==", 1152 | "dev": true, 1153 | "dependencies": { 1154 | "prettier-linter-helpers": "^1.0.0", 1155 | "synckit": "^0.9.1" 1156 | }, 1157 | "engines": { 1158 | "node": "^14.18.0 || >=16.0.0" 1159 | }, 1160 | "funding": { 1161 | "url": "https://opencollective.com/eslint-plugin-prettier" 1162 | }, 1163 | "peerDependencies": { 1164 | "@types/eslint": ">=8.0.0", 1165 | "eslint": ">=8.0.0", 1166 | "eslint-config-prettier": "*", 1167 | "prettier": ">=3.0.0" 1168 | }, 1169 | "peerDependenciesMeta": { 1170 | "@types/eslint": { 1171 | "optional": true 1172 | }, 1173 | "eslint-config-prettier": { 1174 | "optional": true 1175 | } 1176 | } 1177 | }, 1178 | "node_modules/eslint-scope": { 1179 | "version": "8.2.0", 1180 | "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", 1181 | "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", 1182 | "dev": true, 1183 | "dependencies": { 1184 | "esrecurse": "^4.3.0", 1185 | "estraverse": "^5.2.0" 1186 | }, 1187 | "engines": { 1188 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 1189 | }, 1190 | "funding": { 1191 | "url": "https://opencollective.com/eslint" 1192 | } 1193 | }, 1194 | "node_modules/eslint-visitor-keys": { 1195 | "version": "3.4.3", 1196 | "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", 1197 | "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", 1198 | "dev": true, 1199 | "engines": { 1200 | "node": "^12.22.0 || ^14.17.0 || >=16.0.0" 1201 | }, 1202 | "funding": { 1203 | "url": "https://opencollective.com/eslint" 1204 | } 1205 | }, 1206 | "node_modules/eslint/node_modules/brace-expansion": { 1207 | "version": "1.1.11", 1208 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 1209 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 1210 | "dev": true, 1211 | "dependencies": { 1212 | "balanced-match": "^1.0.0", 1213 | "concat-map": "0.0.1" 1214 | } 1215 | }, 1216 | "node_modules/eslint/node_modules/eslint-visitor-keys": { 1217 | "version": "4.2.0", 1218 | "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", 1219 | "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", 1220 | "dev": true, 1221 | "engines": { 1222 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 1223 | }, 1224 | "funding": { 1225 | "url": "https://opencollective.com/eslint" 1226 | } 1227 | }, 1228 | "node_modules/eslint/node_modules/minimatch": { 1229 | "version": "3.1.2", 1230 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", 1231 | "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", 1232 | "dev": true, 1233 | "dependencies": { 1234 | "brace-expansion": "^1.1.7" 1235 | }, 1236 | "engines": { 1237 | "node": "*" 1238 | } 1239 | }, 1240 | "node_modules/esm-env": { 1241 | "version": "1.2.2", 1242 | "resolved": "https://registry.npmjs.org/esm-env/-/esm-env-1.2.2.tgz", 1243 | "integrity": "sha512-Epxrv+Nr/CaL4ZcFGPJIYLWFom+YeV1DqMLHJoEd9SYRxNbaFruBwfEX/kkHUJf55j2+TUbmDcmuilbP1TmXHA==", 1244 | "dev": true 1245 | }, 1246 | "node_modules/espree": { 1247 | "version": "10.3.0", 1248 | "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", 1249 | "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", 1250 | "dev": true, 1251 | "dependencies": { 1252 | "acorn": "^8.14.0", 1253 | "acorn-jsx": "^5.3.2", 1254 | "eslint-visitor-keys": "^4.2.0" 1255 | }, 1256 | "engines": { 1257 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 1258 | }, 1259 | "funding": { 1260 | "url": "https://opencollective.com/eslint" 1261 | } 1262 | }, 1263 | "node_modules/espree/node_modules/eslint-visitor-keys": { 1264 | "version": "4.2.0", 1265 | "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", 1266 | "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", 1267 | "dev": true, 1268 | "engines": { 1269 | "node": "^18.18.0 || ^20.9.0 || >=21.1.0" 1270 | }, 1271 | "funding": { 1272 | "url": "https://opencollective.com/eslint" 1273 | } 1274 | }, 1275 | "node_modules/esquery": { 1276 | "version": "1.5.0", 1277 | "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", 1278 | "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", 1279 | "dev": true, 1280 | "dependencies": { 1281 | "estraverse": "^5.1.0" 1282 | }, 1283 | "engines": { 1284 | "node": ">=0.10" 1285 | } 1286 | }, 1287 | "node_modules/esrap": { 1288 | "version": "1.4.3", 1289 | "resolved": "https://registry.npmjs.org/esrap/-/esrap-1.4.3.tgz", 1290 | "integrity": "sha512-Xddc1RsoFJ4z9nR7W7BFaEPIp4UXoeQ0+077UdWLxbafMQFyU79sQJMk7kxNgRwQ9/aVgaKacCHC2pUACGwmYw==", 1291 | "dev": true, 1292 | "dependencies": { 1293 | "@jridgewell/sourcemap-codec": "^1.4.15" 1294 | } 1295 | }, 1296 | "node_modules/esrecurse": { 1297 | "version": "4.3.0", 1298 | "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", 1299 | "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", 1300 | "dev": true, 1301 | "dependencies": { 1302 | "estraverse": "^5.2.0" 1303 | }, 1304 | "engines": { 1305 | "node": ">=4.0" 1306 | } 1307 | }, 1308 | "node_modules/estraverse": { 1309 | "version": "5.3.0", 1310 | "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", 1311 | "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", 1312 | "dev": true, 1313 | "engines": { 1314 | "node": ">=4.0" 1315 | } 1316 | }, 1317 | "node_modules/estree-walker": { 1318 | "version": "2.0.2", 1319 | "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", 1320 | "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" 1321 | }, 1322 | "node_modules/esutils": { 1323 | "version": "2.0.3", 1324 | "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", 1325 | "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", 1326 | "dev": true, 1327 | "engines": { 1328 | "node": ">=0.10.0" 1329 | } 1330 | }, 1331 | "node_modules/fast-deep-equal": { 1332 | "version": "3.1.3", 1333 | "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", 1334 | "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", 1335 | "dev": true 1336 | }, 1337 | "node_modules/fast-diff": { 1338 | "version": "1.3.0", 1339 | "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", 1340 | "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", 1341 | "dev": true 1342 | }, 1343 | "node_modules/fast-glob": { 1344 | "version": "3.3.3", 1345 | "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", 1346 | "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", 1347 | "dev": true, 1348 | "dependencies": { 1349 | "@nodelib/fs.stat": "^2.0.2", 1350 | "@nodelib/fs.walk": "^1.2.3", 1351 | "glob-parent": "^5.1.2", 1352 | "merge2": "^1.3.0", 1353 | "micromatch": "^4.0.8" 1354 | }, 1355 | "engines": { 1356 | "node": ">=8.6.0" 1357 | } 1358 | }, 1359 | "node_modules/fast-glob/node_modules/glob-parent": { 1360 | "version": "5.1.2", 1361 | "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", 1362 | "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", 1363 | "dev": true, 1364 | "dependencies": { 1365 | "is-glob": "^4.0.1" 1366 | }, 1367 | "engines": { 1368 | "node": ">= 6" 1369 | } 1370 | }, 1371 | "node_modules/fast-json-stable-stringify": { 1372 | "version": "2.1.0", 1373 | "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", 1374 | "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", 1375 | "dev": true 1376 | }, 1377 | "node_modules/fast-levenshtein": { 1378 | "version": "2.0.6", 1379 | "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", 1380 | "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", 1381 | "dev": true 1382 | }, 1383 | "node_modules/fastq": { 1384 | "version": "1.18.0", 1385 | "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.18.0.tgz", 1386 | "integrity": "sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw==", 1387 | "dev": true, 1388 | "dependencies": { 1389 | "reusify": "^1.0.4" 1390 | } 1391 | }, 1392 | "node_modules/file-entry-cache": { 1393 | "version": "8.0.0", 1394 | "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", 1395 | "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", 1396 | "dev": true, 1397 | "dependencies": { 1398 | "flat-cache": "^4.0.0" 1399 | }, 1400 | "engines": { 1401 | "node": ">=16.0.0" 1402 | } 1403 | }, 1404 | "node_modules/fill-range": { 1405 | "version": "7.1.1", 1406 | "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", 1407 | "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", 1408 | "dev": true, 1409 | "dependencies": { 1410 | "to-regex-range": "^5.0.1" 1411 | }, 1412 | "engines": { 1413 | "node": ">=8" 1414 | } 1415 | }, 1416 | "node_modules/find-up": { 1417 | "version": "5.0.0", 1418 | "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", 1419 | "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", 1420 | "dev": true, 1421 | "dependencies": { 1422 | "locate-path": "^6.0.0", 1423 | "path-exists": "^4.0.0" 1424 | }, 1425 | "engines": { 1426 | "node": ">=10" 1427 | }, 1428 | "funding": { 1429 | "url": "https://github.com/sponsors/sindresorhus" 1430 | } 1431 | }, 1432 | "node_modules/flat-cache": { 1433 | "version": "4.0.1", 1434 | "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", 1435 | "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", 1436 | "dev": true, 1437 | "dependencies": { 1438 | "flatted": "^3.2.9", 1439 | "keyv": "^4.5.4" 1440 | }, 1441 | "engines": { 1442 | "node": ">=16" 1443 | } 1444 | }, 1445 | "node_modules/flatted": { 1446 | "version": "3.3.2", 1447 | "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", 1448 | "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", 1449 | "dev": true 1450 | }, 1451 | "node_modules/fsevents": { 1452 | "version": "2.3.2", 1453 | "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", 1454 | "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", 1455 | "dev": true, 1456 | "hasInstallScript": true, 1457 | "optional": true, 1458 | "os": [ 1459 | "darwin" 1460 | ], 1461 | "engines": { 1462 | "node": "^8.16.0 || ^10.6.0 || >=11.0.0" 1463 | } 1464 | }, 1465 | "node_modules/glob-parent": { 1466 | "version": "6.0.2", 1467 | "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", 1468 | "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", 1469 | "dev": true, 1470 | "dependencies": { 1471 | "is-glob": "^4.0.3" 1472 | }, 1473 | "engines": { 1474 | "node": ">=10.13.0" 1475 | } 1476 | }, 1477 | "node_modules/globals": { 1478 | "version": "14.0.0", 1479 | "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", 1480 | "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", 1481 | "dev": true, 1482 | "engines": { 1483 | "node": ">=18" 1484 | }, 1485 | "funding": { 1486 | "url": "https://github.com/sponsors/sindresorhus" 1487 | } 1488 | }, 1489 | "node_modules/graphemer": { 1490 | "version": "1.4.0", 1491 | "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", 1492 | "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", 1493 | "dev": true 1494 | }, 1495 | "node_modules/has-flag": { 1496 | "version": "4.0.0", 1497 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", 1498 | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", 1499 | "dev": true, 1500 | "engines": { 1501 | "node": ">=8" 1502 | } 1503 | }, 1504 | "node_modules/ignore": { 1505 | "version": "5.3.1", 1506 | "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", 1507 | "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", 1508 | "dev": true, 1509 | "engines": { 1510 | "node": ">= 4" 1511 | } 1512 | }, 1513 | "node_modules/import-fresh": { 1514 | "version": "3.3.0", 1515 | "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", 1516 | "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", 1517 | "dev": true, 1518 | "dependencies": { 1519 | "parent-module": "^1.0.0", 1520 | "resolve-from": "^4.0.0" 1521 | }, 1522 | "engines": { 1523 | "node": ">=6" 1524 | }, 1525 | "funding": { 1526 | "url": "https://github.com/sponsors/sindresorhus" 1527 | } 1528 | }, 1529 | "node_modules/imurmurhash": { 1530 | "version": "0.1.4", 1531 | "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", 1532 | "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", 1533 | "dev": true, 1534 | "engines": { 1535 | "node": ">=0.8.19" 1536 | } 1537 | }, 1538 | "node_modules/is-extglob": { 1539 | "version": "2.1.1", 1540 | "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", 1541 | "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", 1542 | "dev": true, 1543 | "engines": { 1544 | "node": ">=0.10.0" 1545 | } 1546 | }, 1547 | "node_modules/is-glob": { 1548 | "version": "4.0.3", 1549 | "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", 1550 | "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", 1551 | "dev": true, 1552 | "dependencies": { 1553 | "is-extglob": "^2.1.1" 1554 | }, 1555 | "engines": { 1556 | "node": ">=0.10.0" 1557 | } 1558 | }, 1559 | "node_modules/is-number": { 1560 | "version": "7.0.0", 1561 | "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", 1562 | "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", 1563 | "dev": true, 1564 | "engines": { 1565 | "node": ">=0.12.0" 1566 | } 1567 | }, 1568 | "node_modules/is-reference": { 1569 | "version": "3.0.3", 1570 | "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.3.tgz", 1571 | "integrity": "sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==", 1572 | "dev": true, 1573 | "dependencies": { 1574 | "@types/estree": "^1.0.6" 1575 | } 1576 | }, 1577 | "node_modules/isexe": { 1578 | "version": "2.0.0", 1579 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 1580 | "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", 1581 | "dev": true 1582 | }, 1583 | "node_modules/js-yaml": { 1584 | "version": "4.1.0", 1585 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", 1586 | "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", 1587 | "dev": true, 1588 | "dependencies": { 1589 | "argparse": "^2.0.1" 1590 | }, 1591 | "bin": { 1592 | "js-yaml": "bin/js-yaml.js" 1593 | } 1594 | }, 1595 | "node_modules/json-buffer": { 1596 | "version": "3.0.1", 1597 | "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", 1598 | "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", 1599 | "dev": true 1600 | }, 1601 | "node_modules/json-schema-traverse": { 1602 | "version": "0.4.1", 1603 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", 1604 | "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", 1605 | "dev": true 1606 | }, 1607 | "node_modules/json-stable-stringify-without-jsonify": { 1608 | "version": "1.0.1", 1609 | "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", 1610 | "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", 1611 | "dev": true 1612 | }, 1613 | "node_modules/keyv": { 1614 | "version": "4.5.4", 1615 | "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", 1616 | "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", 1617 | "dev": true, 1618 | "dependencies": { 1619 | "json-buffer": "3.0.1" 1620 | } 1621 | }, 1622 | "node_modules/levn": { 1623 | "version": "0.4.1", 1624 | "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", 1625 | "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", 1626 | "dev": true, 1627 | "dependencies": { 1628 | "prelude-ls": "^1.2.1", 1629 | "type-check": "~0.4.0" 1630 | }, 1631 | "engines": { 1632 | "node": ">= 0.8.0" 1633 | } 1634 | }, 1635 | "node_modules/locate-character": { 1636 | "version": "3.0.0", 1637 | "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz", 1638 | "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==", 1639 | "dev": true 1640 | }, 1641 | "node_modules/locate-path": { 1642 | "version": "6.0.0", 1643 | "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", 1644 | "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", 1645 | "dev": true, 1646 | "dependencies": { 1647 | "p-locate": "^5.0.0" 1648 | }, 1649 | "engines": { 1650 | "node": ">=10" 1651 | }, 1652 | "funding": { 1653 | "url": "https://github.com/sponsors/sindresorhus" 1654 | } 1655 | }, 1656 | "node_modules/lodash.merge": { 1657 | "version": "4.6.2", 1658 | "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", 1659 | "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", 1660 | "dev": true 1661 | }, 1662 | "node_modules/magic-string": { 1663 | "version": "0.30.12", 1664 | "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.12.tgz", 1665 | "integrity": "sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw==", 1666 | "dev": true, 1667 | "dependencies": { 1668 | "@jridgewell/sourcemap-codec": "^1.5.0" 1669 | } 1670 | }, 1671 | "node_modules/mdn-data": { 1672 | "version": "2.0.30", 1673 | "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", 1674 | "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==" 1675 | }, 1676 | "node_modules/merge2": { 1677 | "version": "1.4.1", 1678 | "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", 1679 | "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", 1680 | "dev": true, 1681 | "engines": { 1682 | "node": ">= 8" 1683 | } 1684 | }, 1685 | "node_modules/micromatch": { 1686 | "version": "4.0.8", 1687 | "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", 1688 | "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", 1689 | "dev": true, 1690 | "dependencies": { 1691 | "braces": "^3.0.3", 1692 | "picomatch": "^2.3.1" 1693 | }, 1694 | "engines": { 1695 | "node": ">=8.6" 1696 | } 1697 | }, 1698 | "node_modules/micromatch/node_modules/picomatch": { 1699 | "version": "2.3.1", 1700 | "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", 1701 | "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", 1702 | "dev": true, 1703 | "engines": { 1704 | "node": ">=8.6" 1705 | }, 1706 | "funding": { 1707 | "url": "https://github.com/sponsors/jonschlinkert" 1708 | } 1709 | }, 1710 | "node_modules/minimatch": { 1711 | "version": "9.0.5", 1712 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", 1713 | "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", 1714 | "dev": true, 1715 | "dependencies": { 1716 | "brace-expansion": "^2.0.1" 1717 | }, 1718 | "engines": { 1719 | "node": ">=16 || 14 >=14.17" 1720 | }, 1721 | "funding": { 1722 | "url": "https://github.com/sponsors/isaacs" 1723 | } 1724 | }, 1725 | "node_modules/mri": { 1726 | "version": "1.2.0", 1727 | "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", 1728 | "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", 1729 | "dev": true, 1730 | "engines": { 1731 | "node": ">=4" 1732 | } 1733 | }, 1734 | "node_modules/ms": { 1735 | "version": "2.1.2", 1736 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 1737 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", 1738 | "dev": true 1739 | }, 1740 | "node_modules/nanoid": { 1741 | "version": "3.3.8", 1742 | "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", 1743 | "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", 1744 | "dev": true, 1745 | "funding": [ 1746 | { 1747 | "type": "github", 1748 | "url": "https://github.com/sponsors/ai" 1749 | } 1750 | ], 1751 | "bin": { 1752 | "nanoid": "bin/nanoid.cjs" 1753 | }, 1754 | "engines": { 1755 | "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" 1756 | } 1757 | }, 1758 | "node_modules/natural-compare": { 1759 | "version": "1.4.0", 1760 | "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", 1761 | "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", 1762 | "dev": true 1763 | }, 1764 | "node_modules/nth-check": { 1765 | "version": "2.1.1", 1766 | "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", 1767 | "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", 1768 | "dependencies": { 1769 | "boolbase": "^1.0.0" 1770 | }, 1771 | "funding": { 1772 | "url": "https://github.com/fb55/nth-check?sponsor=1" 1773 | } 1774 | }, 1775 | "node_modules/optionator": { 1776 | "version": "0.9.4", 1777 | "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", 1778 | "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", 1779 | "dev": true, 1780 | "dependencies": { 1781 | "deep-is": "^0.1.3", 1782 | "fast-levenshtein": "^2.0.6", 1783 | "levn": "^0.4.1", 1784 | "prelude-ls": "^1.2.1", 1785 | "type-check": "^0.4.0", 1786 | "word-wrap": "^1.2.5" 1787 | }, 1788 | "engines": { 1789 | "node": ">= 0.8.0" 1790 | } 1791 | }, 1792 | "node_modules/p-limit": { 1793 | "version": "3.1.0", 1794 | "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", 1795 | "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", 1796 | "dev": true, 1797 | "dependencies": { 1798 | "yocto-queue": "^0.1.0" 1799 | }, 1800 | "engines": { 1801 | "node": ">=10" 1802 | }, 1803 | "funding": { 1804 | "url": "https://github.com/sponsors/sindresorhus" 1805 | } 1806 | }, 1807 | "node_modules/p-locate": { 1808 | "version": "5.0.0", 1809 | "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", 1810 | "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", 1811 | "dev": true, 1812 | "dependencies": { 1813 | "p-limit": "^3.0.2" 1814 | }, 1815 | "engines": { 1816 | "node": ">=10" 1817 | }, 1818 | "funding": { 1819 | "url": "https://github.com/sponsors/sindresorhus" 1820 | } 1821 | }, 1822 | "node_modules/parent-module": { 1823 | "version": "1.0.1", 1824 | "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", 1825 | "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", 1826 | "dev": true, 1827 | "dependencies": { 1828 | "callsites": "^3.0.0" 1829 | }, 1830 | "engines": { 1831 | "node": ">=6" 1832 | } 1833 | }, 1834 | "node_modules/path-exists": { 1835 | "version": "4.0.0", 1836 | "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", 1837 | "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", 1838 | "dev": true, 1839 | "engines": { 1840 | "node": ">=8" 1841 | } 1842 | }, 1843 | "node_modules/path-key": { 1844 | "version": "3.1.1", 1845 | "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", 1846 | "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", 1847 | "dev": true, 1848 | "engines": { 1849 | "node": ">=8" 1850 | } 1851 | }, 1852 | "node_modules/picocolors": { 1853 | "version": "1.1.1", 1854 | "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", 1855 | "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" 1856 | }, 1857 | "node_modules/picomatch": { 1858 | "version": "4.0.2", 1859 | "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", 1860 | "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", 1861 | "engines": { 1862 | "node": ">=12" 1863 | }, 1864 | "funding": { 1865 | "url": "https://github.com/sponsors/jonschlinkert" 1866 | } 1867 | }, 1868 | "node_modules/playwright": { 1869 | "version": "1.50.0", 1870 | "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.50.0.tgz", 1871 | "integrity": "sha512-+GinGfGTrd2IfX1TA4N2gNmeIksSb+IAe589ZH+FlmpV3MYTx6+buChGIuDLQwrGNCw2lWibqV50fU510N7S+w==", 1872 | "dev": true, 1873 | "dependencies": { 1874 | "playwright-core": "1.50.0" 1875 | }, 1876 | "bin": { 1877 | "playwright": "cli.js" 1878 | }, 1879 | "engines": { 1880 | "node": ">=18" 1881 | }, 1882 | "optionalDependencies": { 1883 | "fsevents": "2.3.2" 1884 | } 1885 | }, 1886 | "node_modules/playwright-core": { 1887 | "version": "1.50.0", 1888 | "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.50.0.tgz", 1889 | "integrity": "sha512-CXkSSlr4JaZs2tZHI40DsZUN/NIwgaUPsyLuOAaIZp2CyF2sN5MM5NJsyB188lFSSozFxQ5fPT4qM+f0tH/6wQ==", 1890 | "dev": true, 1891 | "bin": { 1892 | "playwright-core": "cli.js" 1893 | }, 1894 | "engines": { 1895 | "node": ">=18" 1896 | } 1897 | }, 1898 | "node_modules/postcss": { 1899 | "version": "8.5.1", 1900 | "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.1.tgz", 1901 | "integrity": "sha512-6oz2beyjc5VMn/KV1pPw8fliQkhBXrVn1Z3TVyqZxU8kZpzEKhBdmCFqI6ZbmGtamQvQGuU1sgPTk8ZrXDD7jQ==", 1902 | "dev": true, 1903 | "funding": [ 1904 | { 1905 | "type": "opencollective", 1906 | "url": "https://opencollective.com/postcss/" 1907 | }, 1908 | { 1909 | "type": "tidelift", 1910 | "url": "https://tidelift.com/funding/github/npm/postcss" 1911 | }, 1912 | { 1913 | "type": "github", 1914 | "url": "https://github.com/sponsors/ai" 1915 | } 1916 | ], 1917 | "dependencies": { 1918 | "nanoid": "^3.3.8", 1919 | "picocolors": "^1.1.1", 1920 | "source-map-js": "^1.2.1" 1921 | }, 1922 | "engines": { 1923 | "node": "^10 || ^12 || >=14" 1924 | } 1925 | }, 1926 | "node_modules/prelude-ls": { 1927 | "version": "1.2.1", 1928 | "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", 1929 | "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", 1930 | "dev": true, 1931 | "engines": { 1932 | "node": ">= 0.8.0" 1933 | } 1934 | }, 1935 | "node_modules/prettier": { 1936 | "version": "3.3.1", 1937 | "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.1.tgz", 1938 | "integrity": "sha512-7CAwy5dRsxs8PHXT3twixW9/OEll8MLE0VRPCJyl7CkS6VHGPSlsVaWTiASPTyGyYRyApxlaWTzwUxVNrhcwDg==", 1939 | "dev": true, 1940 | "peer": true, 1941 | "bin": { 1942 | "prettier": "bin/prettier.cjs" 1943 | }, 1944 | "engines": { 1945 | "node": ">=14" 1946 | }, 1947 | "funding": { 1948 | "url": "https://github.com/prettier/prettier?sponsor=1" 1949 | } 1950 | }, 1951 | "node_modules/prettier-linter-helpers": { 1952 | "version": "1.0.0", 1953 | "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", 1954 | "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", 1955 | "dev": true, 1956 | "dependencies": { 1957 | "fast-diff": "^1.1.2" 1958 | }, 1959 | "engines": { 1960 | "node": ">=6.0.0" 1961 | } 1962 | }, 1963 | "node_modules/punycode": { 1964 | "version": "2.3.1", 1965 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", 1966 | "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", 1967 | "dev": true, 1968 | "engines": { 1969 | "node": ">=6" 1970 | } 1971 | }, 1972 | "node_modules/queue-microtask": { 1973 | "version": "1.2.3", 1974 | "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", 1975 | "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", 1976 | "dev": true, 1977 | "funding": [ 1978 | { 1979 | "type": "github", 1980 | "url": "https://github.com/sponsors/feross" 1981 | }, 1982 | { 1983 | "type": "patreon", 1984 | "url": "https://www.patreon.com/feross" 1985 | }, 1986 | { 1987 | "type": "consulting", 1988 | "url": "https://feross.org/support" 1989 | } 1990 | ] 1991 | }, 1992 | "node_modules/readdirp": { 1993 | "version": "4.0.2", 1994 | "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.0.2.tgz", 1995 | "integrity": "sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA==", 1996 | "dev": true, 1997 | "engines": { 1998 | "node": ">= 14.16.0" 1999 | }, 2000 | "funding": { 2001 | "type": "individual", 2002 | "url": "https://paulmillr.com/funding/" 2003 | } 2004 | }, 2005 | "node_modules/resolve-from": { 2006 | "version": "4.0.0", 2007 | "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", 2008 | "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", 2009 | "dev": true, 2010 | "engines": { 2011 | "node": ">=4" 2012 | } 2013 | }, 2014 | "node_modules/reusify": { 2015 | "version": "1.0.4", 2016 | "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", 2017 | "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", 2018 | "dev": true, 2019 | "engines": { 2020 | "iojs": ">=1.0.0", 2021 | "node": ">=0.10.0" 2022 | } 2023 | }, 2024 | "node_modules/rollup": { 2025 | "version": "4.24.0", 2026 | "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.24.0.tgz", 2027 | "integrity": "sha512-DOmrlGSXNk1DM0ljiQA+i+o0rSLhtii1je5wgk60j49d1jHT5YYttBv1iWOnYSTG+fZZESUOSNiAl89SIet+Cg==", 2028 | "devOptional": true, 2029 | "dependencies": { 2030 | "@types/estree": "1.0.6" 2031 | }, 2032 | "bin": { 2033 | "rollup": "dist/bin/rollup" 2034 | }, 2035 | "engines": { 2036 | "node": ">=18.0.0", 2037 | "npm": ">=8.0.0" 2038 | }, 2039 | "optionalDependencies": { 2040 | "@rollup/rollup-android-arm-eabi": "4.24.0", 2041 | "@rollup/rollup-android-arm64": "4.24.0", 2042 | "@rollup/rollup-darwin-arm64": "4.24.0", 2043 | "@rollup/rollup-darwin-x64": "4.24.0", 2044 | "@rollup/rollup-linux-arm-gnueabihf": "4.24.0", 2045 | "@rollup/rollup-linux-arm-musleabihf": "4.24.0", 2046 | "@rollup/rollup-linux-arm64-gnu": "4.24.0", 2047 | "@rollup/rollup-linux-arm64-musl": "4.24.0", 2048 | "@rollup/rollup-linux-powerpc64le-gnu": "4.24.0", 2049 | "@rollup/rollup-linux-riscv64-gnu": "4.24.0", 2050 | "@rollup/rollup-linux-s390x-gnu": "4.24.0", 2051 | "@rollup/rollup-linux-x64-gnu": "4.24.0", 2052 | "@rollup/rollup-linux-x64-musl": "4.24.0", 2053 | "@rollup/rollup-win32-arm64-msvc": "4.24.0", 2054 | "@rollup/rollup-win32-ia32-msvc": "4.24.0", 2055 | "@rollup/rollup-win32-x64-msvc": "4.24.0", 2056 | "fsevents": "~2.3.2" 2057 | } 2058 | }, 2059 | "node_modules/run-parallel": { 2060 | "version": "1.2.0", 2061 | "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", 2062 | "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", 2063 | "dev": true, 2064 | "funding": [ 2065 | { 2066 | "type": "github", 2067 | "url": "https://github.com/sponsors/feross" 2068 | }, 2069 | { 2070 | "type": "patreon", 2071 | "url": "https://www.patreon.com/feross" 2072 | }, 2073 | { 2074 | "type": "consulting", 2075 | "url": "https://feross.org/support" 2076 | } 2077 | ], 2078 | "dependencies": { 2079 | "queue-microtask": "^1.2.2" 2080 | } 2081 | }, 2082 | "node_modules/sade": { 2083 | "version": "1.8.1", 2084 | "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", 2085 | "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", 2086 | "dev": true, 2087 | "dependencies": { 2088 | "mri": "^1.1.0" 2089 | }, 2090 | "engines": { 2091 | "node": ">=6" 2092 | } 2093 | }, 2094 | "node_modules/semver": { 2095 | "version": "7.6.3", 2096 | "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", 2097 | "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", 2098 | "dev": true, 2099 | "bin": { 2100 | "semver": "bin/semver.js" 2101 | }, 2102 | "engines": { 2103 | "node": ">=10" 2104 | } 2105 | }, 2106 | "node_modules/shebang-command": { 2107 | "version": "2.0.0", 2108 | "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", 2109 | "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", 2110 | "dev": true, 2111 | "dependencies": { 2112 | "shebang-regex": "^3.0.0" 2113 | }, 2114 | "engines": { 2115 | "node": ">=8" 2116 | } 2117 | }, 2118 | "node_modules/shebang-regex": { 2119 | "version": "3.0.0", 2120 | "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", 2121 | "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", 2122 | "dev": true, 2123 | "engines": { 2124 | "node": ">=8" 2125 | } 2126 | }, 2127 | "node_modules/source-map-js": { 2128 | "version": "1.2.1", 2129 | "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", 2130 | "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", 2131 | "engines": { 2132 | "node": ">=0.10.0" 2133 | } 2134 | }, 2135 | "node_modules/string-width": { 2136 | "version": "5.1.2", 2137 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", 2138 | "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", 2139 | "dev": true, 2140 | "dependencies": { 2141 | "eastasianwidth": "^0.2.0", 2142 | "emoji-regex": "^9.2.2", 2143 | "strip-ansi": "^7.0.1" 2144 | }, 2145 | "engines": { 2146 | "node": ">=12" 2147 | }, 2148 | "funding": { 2149 | "url": "https://github.com/sponsors/sindresorhus" 2150 | } 2151 | }, 2152 | "node_modules/string-width/node_modules/ansi-regex": { 2153 | "version": "6.0.1", 2154 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", 2155 | "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", 2156 | "dev": true, 2157 | "engines": { 2158 | "node": ">=12" 2159 | }, 2160 | "funding": { 2161 | "url": "https://github.com/chalk/ansi-regex?sponsor=1" 2162 | } 2163 | }, 2164 | "node_modules/string-width/node_modules/strip-ansi": { 2165 | "version": "7.1.0", 2166 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", 2167 | "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", 2168 | "dev": true, 2169 | "dependencies": { 2170 | "ansi-regex": "^6.0.1" 2171 | }, 2172 | "engines": { 2173 | "node": ">=12" 2174 | }, 2175 | "funding": { 2176 | "url": "https://github.com/chalk/strip-ansi?sponsor=1" 2177 | } 2178 | }, 2179 | "node_modules/strip-json-comments": { 2180 | "version": "3.1.1", 2181 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", 2182 | "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", 2183 | "dev": true, 2184 | "engines": { 2185 | "node": ">=8" 2186 | }, 2187 | "funding": { 2188 | "url": "https://github.com/sponsors/sindresorhus" 2189 | } 2190 | }, 2191 | "node_modules/supports-color": { 2192 | "version": "7.2.0", 2193 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", 2194 | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", 2195 | "dev": true, 2196 | "dependencies": { 2197 | "has-flag": "^4.0.0" 2198 | }, 2199 | "engines": { 2200 | "node": ">=8" 2201 | } 2202 | }, 2203 | "node_modules/svelte": { 2204 | "version": "5.20.1", 2205 | "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.20.1.tgz", 2206 | "integrity": "sha512-aCARru2WTdzJl55Ws8SK27+kvQwd8tijl4kY7NoDUXUHtTHhxMa8Lf6QNZKmU7cuPu3jjFloDO1j5HgYJNIIWg==", 2207 | "dev": true, 2208 | "dependencies": { 2209 | "@ampproject/remapping": "^2.3.0", 2210 | "@jridgewell/sourcemap-codec": "^1.5.0", 2211 | "@types/estree": "^1.0.5", 2212 | "acorn": "^8.12.1", 2213 | "acorn-typescript": "^1.4.13", 2214 | "aria-query": "^5.3.1", 2215 | "axobject-query": "^4.1.0", 2216 | "clsx": "^2.1.1", 2217 | "esm-env": "^1.2.1", 2218 | "esrap": "^1.4.3", 2219 | "is-reference": "^3.0.3", 2220 | "locate-character": "^3.0.0", 2221 | "magic-string": "^0.30.11", 2222 | "zimmerframe": "^1.1.2" 2223 | }, 2224 | "engines": { 2225 | "node": ">=18" 2226 | } 2227 | }, 2228 | "node_modules/svelte-check": { 2229 | "version": "4.1.4", 2230 | "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.1.4.tgz", 2231 | "integrity": "sha512-v0j7yLbT29MezzaQJPEDwksybTE2Ups9rUxEXy92T06TiA0cbqcO8wAOwNUVkFW6B0hsYHA+oAX3BS8b/2oHtw==", 2232 | "dev": true, 2233 | "dependencies": { 2234 | "@jridgewell/trace-mapping": "^0.3.25", 2235 | "chokidar": "^4.0.1", 2236 | "fdir": "^6.2.0", 2237 | "picocolors": "^1.0.0", 2238 | "sade": "^1.7.4" 2239 | }, 2240 | "bin": { 2241 | "svelte-check": "bin/svelte-check" 2242 | }, 2243 | "engines": { 2244 | "node": ">= 18.0.0" 2245 | }, 2246 | "peerDependencies": { 2247 | "svelte": "^4.0.0 || ^5.0.0-next.0", 2248 | "typescript": ">=5.0.0" 2249 | } 2250 | }, 2251 | "node_modules/svelte-check/node_modules/fdir": { 2252 | "version": "6.4.2", 2253 | "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.2.tgz", 2254 | "integrity": "sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ==", 2255 | "dev": true, 2256 | "peerDependencies": { 2257 | "picomatch": "^3 || ^4" 2258 | }, 2259 | "peerDependenciesMeta": { 2260 | "picomatch": { 2261 | "optional": true 2262 | } 2263 | } 2264 | }, 2265 | "node_modules/svelte-preprocess": { 2266 | "version": "6.0.3", 2267 | "resolved": "https://registry.npmjs.org/svelte-preprocess/-/svelte-preprocess-6.0.3.tgz", 2268 | "integrity": "sha512-PLG2k05qHdhmRG7zR/dyo5qKvakhm8IJ+hD2eFRQmMLHp7X3eJnjeupUtvuRpbNiF31RjVw45W+abDwHEmP5OA==", 2269 | "dev": true, 2270 | "hasInstallScript": true, 2271 | "engines": { 2272 | "node": ">= 18.0.0" 2273 | }, 2274 | "peerDependencies": { 2275 | "@babel/core": "^7.10.2", 2276 | "coffeescript": "^2.5.1", 2277 | "less": "^3.11.3 || ^4.0.0", 2278 | "postcss": "^7 || ^8", 2279 | "postcss-load-config": ">=3", 2280 | "pug": "^3.0.0", 2281 | "sass": "^1.26.8", 2282 | "stylus": ">=0.55", 2283 | "sugarss": "^2.0.0 || ^3.0.0 || ^4.0.0", 2284 | "svelte": "^4.0.0 || ^5.0.0-next.100 || ^5.0.0", 2285 | "typescript": "^5.0.0" 2286 | }, 2287 | "peerDependenciesMeta": { 2288 | "@babel/core": { 2289 | "optional": true 2290 | }, 2291 | "coffeescript": { 2292 | "optional": true 2293 | }, 2294 | "less": { 2295 | "optional": true 2296 | }, 2297 | "postcss": { 2298 | "optional": true 2299 | }, 2300 | "postcss-load-config": { 2301 | "optional": true 2302 | }, 2303 | "pug": { 2304 | "optional": true 2305 | }, 2306 | "sass": { 2307 | "optional": true 2308 | }, 2309 | "stylus": { 2310 | "optional": true 2311 | }, 2312 | "sugarss": { 2313 | "optional": true 2314 | }, 2315 | "typescript": { 2316 | "optional": true 2317 | } 2318 | } 2319 | }, 2320 | "node_modules/svgo": { 2321 | "version": "3.3.2", 2322 | "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.3.2.tgz", 2323 | "integrity": "sha512-OoohrmuUlBs8B8o6MB2Aevn+pRIH9zDALSR+6hhqVfa6fRwG/Qw9VUMSMW9VNg2CFc/MTIfabtdOVl9ODIJjpw==", 2324 | "dependencies": { 2325 | "@trysound/sax": "0.2.0", 2326 | "commander": "^7.2.0", 2327 | "css-select": "^5.1.0", 2328 | "css-tree": "^2.3.1", 2329 | "css-what": "^6.1.0", 2330 | "csso": "^5.0.5", 2331 | "picocolors": "^1.0.0" 2332 | }, 2333 | "bin": { 2334 | "svgo": "bin/svgo" 2335 | }, 2336 | "engines": { 2337 | "node": ">=14.0.0" 2338 | }, 2339 | "funding": { 2340 | "type": "opencollective", 2341 | "url": "https://opencollective.com/svgo" 2342 | } 2343 | }, 2344 | "node_modules/synckit": { 2345 | "version": "0.9.2", 2346 | "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.2.tgz", 2347 | "integrity": "sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==", 2348 | "dev": true, 2349 | "dependencies": { 2350 | "@pkgr/core": "^0.1.0", 2351 | "tslib": "^2.6.2" 2352 | }, 2353 | "engines": { 2354 | "node": "^14.18.0 || >=16.0.0" 2355 | }, 2356 | "funding": { 2357 | "url": "https://opencollective.com/unts" 2358 | } 2359 | }, 2360 | "node_modules/to-regex-range": { 2361 | "version": "5.0.1", 2362 | "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", 2363 | "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", 2364 | "dev": true, 2365 | "dependencies": { 2366 | "is-number": "^7.0.0" 2367 | }, 2368 | "engines": { 2369 | "node": ">=8.0" 2370 | } 2371 | }, 2372 | "node_modules/ts-api-utils": { 2373 | "version": "2.0.0", 2374 | "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.0.tgz", 2375 | "integrity": "sha512-xCt/TOAc+EOHS1XPnijD3/yzpH6qg2xppZO1YDqGoVsNXfQfzHpOdNuXwrwOU8u4ITXJyDCTyt8w5g1sZv9ynQ==", 2376 | "dev": true, 2377 | "engines": { 2378 | "node": ">=18.12" 2379 | }, 2380 | "peerDependencies": { 2381 | "typescript": ">=4.8.4" 2382 | } 2383 | }, 2384 | "node_modules/tslib": { 2385 | "version": "2.8.1", 2386 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", 2387 | "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", 2388 | "dev": true 2389 | }, 2390 | "node_modules/type-check": { 2391 | "version": "0.4.0", 2392 | "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", 2393 | "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", 2394 | "dev": true, 2395 | "dependencies": { 2396 | "prelude-ls": "^1.2.1" 2397 | }, 2398 | "engines": { 2399 | "node": ">= 0.8.0" 2400 | } 2401 | }, 2402 | "node_modules/typescript": { 2403 | "version": "5.7.3", 2404 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", 2405 | "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", 2406 | "dev": true, 2407 | "bin": { 2408 | "tsc": "bin/tsc", 2409 | "tsserver": "bin/tsserver" 2410 | }, 2411 | "engines": { 2412 | "node": ">=14.17" 2413 | } 2414 | }, 2415 | "node_modules/undici-types": { 2416 | "version": "6.20.0", 2417 | "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", 2418 | "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", 2419 | "dev": true 2420 | }, 2421 | "node_modules/uri-js": { 2422 | "version": "4.4.1", 2423 | "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", 2424 | "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", 2425 | "dev": true, 2426 | "dependencies": { 2427 | "punycode": "^2.1.0" 2428 | } 2429 | }, 2430 | "node_modules/vite": { 2431 | "version": "6.0.11", 2432 | "resolved": "https://registry.npmjs.org/vite/-/vite-6.0.11.tgz", 2433 | "integrity": "sha512-4VL9mQPKoHy4+FE0NnRE/kbY51TOfaknxAjt3fJbGJxhIpBZiqVzlZDEesWWsuREXHwNdAoOFZ9MkPEVXczHwg==", 2434 | "dev": true, 2435 | "dependencies": { 2436 | "esbuild": "^0.24.2", 2437 | "postcss": "^8.4.49", 2438 | "rollup": "^4.23.0" 2439 | }, 2440 | "bin": { 2441 | "vite": "bin/vite.js" 2442 | }, 2443 | "engines": { 2444 | "node": "^18.0.0 || ^20.0.0 || >=22.0.0" 2445 | }, 2446 | "funding": { 2447 | "url": "https://github.com/vitejs/vite?sponsor=1" 2448 | }, 2449 | "optionalDependencies": { 2450 | "fsevents": "~2.3.3" 2451 | }, 2452 | "peerDependencies": { 2453 | "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", 2454 | "jiti": ">=1.21.0", 2455 | "less": "*", 2456 | "lightningcss": "^1.21.0", 2457 | "sass": "*", 2458 | "sass-embedded": "*", 2459 | "stylus": "*", 2460 | "sugarss": "*", 2461 | "terser": "^5.16.0", 2462 | "tsx": "^4.8.1", 2463 | "yaml": "^2.4.2" 2464 | }, 2465 | "peerDependenciesMeta": { 2466 | "@types/node": { 2467 | "optional": true 2468 | }, 2469 | "jiti": { 2470 | "optional": true 2471 | }, 2472 | "less": { 2473 | "optional": true 2474 | }, 2475 | "lightningcss": { 2476 | "optional": true 2477 | }, 2478 | "sass": { 2479 | "optional": true 2480 | }, 2481 | "sass-embedded": { 2482 | "optional": true 2483 | }, 2484 | "stylus": { 2485 | "optional": true 2486 | }, 2487 | "sugarss": { 2488 | "optional": true 2489 | }, 2490 | "terser": { 2491 | "optional": true 2492 | }, 2493 | "tsx": { 2494 | "optional": true 2495 | }, 2496 | "yaml": { 2497 | "optional": true 2498 | } 2499 | } 2500 | }, 2501 | "node_modules/vite/node_modules/fsevents": { 2502 | "version": "2.3.3", 2503 | "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", 2504 | "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", 2505 | "dev": true, 2506 | "hasInstallScript": true, 2507 | "optional": true, 2508 | "os": [ 2509 | "darwin" 2510 | ], 2511 | "engines": { 2512 | "node": "^8.16.0 || ^10.6.0 || >=11.0.0" 2513 | } 2514 | }, 2515 | "node_modules/which": { 2516 | "version": "2.0.2", 2517 | "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", 2518 | "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", 2519 | "dev": true, 2520 | "dependencies": { 2521 | "isexe": "^2.0.0" 2522 | }, 2523 | "bin": { 2524 | "node-which": "bin/node-which" 2525 | }, 2526 | "engines": { 2527 | "node": ">= 8" 2528 | } 2529 | }, 2530 | "node_modules/word-wrap": { 2531 | "version": "1.2.5", 2532 | "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", 2533 | "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", 2534 | "dev": true, 2535 | "engines": { 2536 | "node": ">=0.10.0" 2537 | } 2538 | }, 2539 | "node_modules/yocto-queue": { 2540 | "version": "0.1.0", 2541 | "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", 2542 | "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", 2543 | "dev": true, 2544 | "dependencies": { 2545 | "ansi-styles": "^6.1.0", 2546 | "string-width": "^5.0.1", 2547 | "strip-ansi": "^7.0.1" 2548 | }, 2549 | "engines": { 2550 | "node": ">=12" 2551 | }, 2552 | "funding": { 2553 | "url": "https://github.com/chalk/wrap-ansi?sponsor=1" 2554 | } 2555 | }, 2556 | "node_modules/yocto-queue/node_modules/ansi-regex": { 2557 | "version": "6.1.0", 2558 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", 2559 | "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", 2560 | "dev": true, 2561 | "engines": { 2562 | "node": ">=12" 2563 | }, 2564 | "funding": { 2565 | "url": "https://github.com/chalk/ansi-regex?sponsor=1" 2566 | } 2567 | }, 2568 | "node_modules/yocto-queue/node_modules/ansi-styles": { 2569 | "version": "6.2.1", 2570 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", 2571 | "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", 2572 | "dev": true, 2573 | "engines": { 2574 | "node": ">=12" 2575 | }, 2576 | "funding": { 2577 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 2578 | } 2579 | }, 2580 | "node_modules/yocto-queue/node_modules/strip-ansi": { 2581 | "version": "7.1.0", 2582 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", 2583 | "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", 2584 | "dev": true, 2585 | "dependencies": { 2586 | "ansi-regex": "^6.0.1" 2587 | }, 2588 | "engines": { 2589 | "node": ">=12" 2590 | }, 2591 | "funding": { 2592 | "url": "https://github.com/chalk/strip-ansi?sponsor=1" 2593 | } 2594 | }, 2595 | "node_modules/zimmerframe": { 2596 | "version": "1.1.2", 2597 | "resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.2.tgz", 2598 | "integrity": "sha512-rAbqEGa8ovJy4pyBxZM70hg4pE6gDgaQ0Sl9M3enG3I0d6H4XSAM3GeNGLKnsBpuijUow064sf7ww1nutC5/3w==", 2599 | "dev": true 2600 | } 2601 | } 2602 | } 2603 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@poppanator/sveltekit-svg", 3 | "version": "5.0.1", 4 | "description": "Import SVG files as Svelte components", 5 | "private": false, 6 | "keywords": [ 7 | "sveltekit-plugin", 8 | "svg", 9 | "svgo", 10 | "svelte", 11 | "sveltekit", 12 | "vite", 13 | "vite-plugin" 14 | ], 15 | "files": [ 16 | "dist" 17 | ], 18 | "scripts": { 19 | "dev": "tsc -w", 20 | "build": "tsc && cp svg.d.ts dist/", 21 | "pre-test": "npx playwright install && npm link && cd test-app && npm run pre-test", 22 | "test": "cd test-app && npm run test", 23 | "test:all": "npm ci && npm run build && npm run pre-test && npm run test", 24 | "clean": "rimraf dist && rimraf node_modules", 25 | "clean:test-app": "rimraf test-app/node_modules && rimraf test-app/build && rimraf test-app/test-results", 26 | "clean:all": "npm run clean:test-app && npm run clean", 27 | "bootstrap": "npm ci && cd test-app && npm ci" 28 | }, 29 | "main": "dist/index.js", 30 | "types": "dist/index.d.ts", 31 | "license": "MIT", 32 | "author": { 33 | "name": "Pontus Östlund", 34 | "url": "https://github.com/poppa" 35 | }, 36 | "contributors": [ 37 | { 38 | "name": "Jani", 39 | "url": "https://github.com/ljani" 40 | }, 41 | { 42 | "name": "James Camilleri", 43 | "url": "https://github.com/james-camilleri" 44 | }, 45 | { 46 | "name": "Roman Schmid", 47 | "url": "https://github.com/bummzack" 48 | }, 49 | { 50 | "name": "Arad Alvand", 51 | "url": "https://github.com/aradalvand" 52 | }, 53 | { 54 | "name": "Tobias Oetiker", 55 | "url": "https://github.com/oetiker" 56 | }, 57 | { 58 | "name": "Joakim Nordling", 59 | "url": "https://github.com/joakimnordling" 60 | }, 61 | { 62 | "name": "Paolo Ricciuti", 63 | "url": "https://github.com/paoloricciuti" 64 | } 65 | ], 66 | "repository": { 67 | "type": "git", 68 | "url": "git+https://github.com/poppa/sveltekit-svg" 69 | }, 70 | "bugs": { 71 | "url": "https://github.com/poppa/sveltekit-svg/issues" 72 | }, 73 | "homepage": "https://github.com/poppa/sveltekit-svg#readme", 74 | "devDependencies": { 75 | "@playwright/test": "1.50.0", 76 | "@types/node": "22.10.10", 77 | "@typescript-eslint/eslint-plugin": "8.21.0", 78 | "@typescript-eslint/parser": "8.21.0", 79 | "cross-env": "^7.0.3", 80 | "eslint": "9.18.0", 81 | "eslint-config-prettier": "10.0.1", 82 | "eslint-plugin-prettier": "5.2.3", 83 | "svelte": "5.20.1", 84 | "svelte-check": "4.1.4", 85 | "svelte-preprocess": "^6.0.3", 86 | "tslib": "2.8.1", 87 | "typescript": "5.7.3", 88 | "vite": "6.0.11" 89 | }, 90 | "peerDependencies": { 91 | "svelte": ">=5.x", 92 | "vite": ">=5.x || >= 6.x" 93 | }, 94 | "dependencies": { 95 | "@rollup/pluginutils": "5.1.4", 96 | "svgo": "^3.2.0" 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import { normalizePath } from '@rollup/pluginutils' 2 | import { promises } from 'fs' 3 | import path from 'path' 4 | import { compile } from 'svelte/compiler' 5 | import { optimize, type Config } from 'svgo' 6 | import type { Plugin } from 'vite' 7 | 8 | const { readFile } = promises 9 | 10 | interface Options { 11 | /** 12 | * Output type 13 | * 14 | * `dataurl` can also take the following options, which are verbatim SVGO 15 | * `datauri` options: 16 | * 17 | * - `?dataurl=base64` (default, same as `?dataurl`) 18 | * - `?dataurl=enc` URL encoded string 19 | * - `?dataurl=unenc` Plain SVG 20 | * 21 | * @default "component" 22 | */ 23 | type?: 'src' | 'url' | 'component' | 'dataurl' 24 | /** 25 | * Verbatim [SVGO](https://github.com/svg/svgo) options 26 | * 27 | * If no options are given, the SVG will be optimized with the default SVGO 28 | * options. 29 | * If `false` SVGO will be bypassed altogether 30 | */ 31 | svgoOptions?: Config | false 32 | /** 33 | * Paths to apply the SVG plugin on. This can be useful if you want to apply 34 | * different SVGO options/plugins on different SVGs. 35 | * 36 | * The paths are path prefixes and should be relative to your 37 | * `svelte.config.js` file. 38 | * 39 | * @example 40 | * ``` 41 | * { 42 | * includePaths: ['src/assets/icons/', 'src/images/icons/'] 43 | * } 44 | * ``` 45 | */ 46 | includePaths?: string[] 47 | /** 48 | * Hook that lets you transform the svg to a raw Svelte component yourself, 49 | * before being passed to the Svelte compiler. 50 | * 51 | * @param rawSvg The raw SVG data as read from disk 52 | * @param splitSvg The SVG split into parts, e.g its attributes and 53 | * its content 54 | * @returns This should return a complete Svelte component that can be passed 55 | * to the Svelte compiler 56 | */ 57 | preCompileHook?(rawSvg: string, splitSvg: SplitSvg): string 58 | } 59 | 60 | type Position = { 61 | line: number 62 | column: number 63 | character: number 64 | } 65 | 66 | type CompileError = Error & { 67 | code: string 68 | pos: number 69 | filename: string 70 | frame: string 71 | start: Position 72 | end: Position 73 | } 74 | 75 | type SplitSvg = { 76 | /** 77 | * The attributes of an SVG as a string 78 | * 79 | * Given `` this will be 80 | * `width="200" height="100"` 81 | */ 82 | attributes: string | undefined 83 | /** 84 | * The inner content of an SVG 85 | * 86 | * Given `` this will be ``. 87 | */ 88 | content: string | undefined 89 | /** 90 | * The default generated, by this plugin, Svelte component as a string 91 | * 92 | * Given `` this will be something like 93 | * `{@html ""}` 94 | */ 95 | component: string 96 | } 97 | 98 | function isCompileError(err: unknown): err is CompileError { 99 | return err instanceof Error && 'code' in err && 'frame' in err 100 | } 101 | 102 | const svgRegex = /(.*)<\/svg>/s 103 | 104 | function color(start: string, end = '\u001b[0m'): (text: string) => string { 105 | return (text: string) => `${start}${text}${end}` 106 | } 107 | 108 | // const green = color('\u001b[32m') 109 | const yellow = color('\u001b[33m') 110 | const blue = color('\u001b[34m') 111 | 112 | function toComponent(svg: string): SplitSvg { 113 | const parts = svgRegex.exec(svg) 114 | 115 | if (!parts) { 116 | throw new Error('Invalid SVG') 117 | } 118 | 119 | const [, attributes, content] = parts 120 | // JSON.stringify escapes any characters that need to be escaped and 121 | // surrounds `content` with double quotes 122 | const contentStrLiteral = JSON.stringify(content) 123 | const component = `{@html ${contentStrLiteral}}` 124 | 125 | return { 126 | attributes, 127 | content, 128 | component, 129 | } 130 | } 131 | 132 | function isSvgoOptimizeError(obj: unknown): obj is Error { 133 | return typeof obj === 'object' && obj !== null && !('data' in obj) 134 | } 135 | 136 | function hasCdata(code: string): boolean { 137 | return code.includes('') 138 | } 139 | 140 | function isDevelopmentMode(): boolean { 141 | return process.env['NODE_ENV'] === 'development' 142 | } 143 | 144 | function readSvg(options: Options = { type: 'component' }): Plugin { 145 | const resvg = /\.svg(?:\?(src|url|component|dataurl)(=(base64|(un)?enc))?)?$/ 146 | 147 | if (options.includePaths) { 148 | // Normalize the include paths prefixes ahead of time 149 | options.includePaths = options.includePaths.map((pattern) => { 150 | const filepath = path.resolve(path.normalize(pattern)) 151 | return normalizePath(filepath) 152 | }) 153 | } 154 | 155 | const isType = (str: string | undefined, type: Options['type']): boolean => { 156 | return (!str && options.type === type) || str === type 157 | } 158 | 159 | const handlePath = (id: string): boolean => { 160 | if (!resvg.test(id)) { 161 | return false 162 | } 163 | 164 | if (options.includePaths) { 165 | return options.includePaths.some((pattern) => { 166 | return id.startsWith(pattern) 167 | }) 168 | } 169 | 170 | return true 171 | } 172 | 173 | const hook = options.preCompileHook 174 | 175 | /** 176 | * This contains URLs of generated static assets, that is SVGs that are 177 | * imported as URLs, so we can optimize them before they are written to disk. 178 | */ 179 | const optmizeUrls = new Set<string>() 180 | 181 | const plugin: Plugin = { 182 | name: 'sveltekit-svg', 183 | 184 | // NOTE: This will only run in production mode 185 | renderChunk(_code, chunk) { 186 | // Check if this chunk is an SVG imported as an URL... 187 | const mods = chunk.moduleIds.filter( 188 | (id) => this.getModuleInfo(id)?.meta['isSvgUrl'] 189 | ) 190 | 191 | // ...if so, we should have 1 module and one importAssets... 192 | if (mods.length !== 1 || chunk.viteMetadata?.importedAssets.size !== 1) { 193 | return undefined 194 | } 195 | 196 | // ...and store the output filename in the lookup so we can verify in 197 | // `generateBundle()` that the SVG should be optimized before written 198 | // to disk 199 | const outputId = Array.from(chunk.viteMetadata.importedAssets)[0] 200 | if (outputId) { 201 | optmizeUrls.add(outputId) 202 | } 203 | }, 204 | 205 | // NOTE: This will only run in production mode 206 | async generateBundle(_options, bundle) { 207 | // Resolve assets that should be SVGO optimized before written to disk. 208 | // Such assets should exist in the `optimizeUrl` lookup data structure. 209 | for (const [k, v] of Object.entries(bundle)) { 210 | if (!optmizeUrls.has(k) || v.type !== 'asset') { 211 | continue 212 | } 213 | 214 | const optSvg = optimize( 215 | v.source.toString(), 216 | options.svgoOptions || undefined 217 | ) 218 | 219 | v.source = Buffer.from(optSvg.data) 220 | } 221 | }, 222 | 223 | async transform( 224 | source: string, 225 | id: string, 226 | transformOptions?: { ssr?: boolean } 227 | ) { 228 | if (!handlePath(id)) { 229 | return undefined 230 | } 231 | 232 | const match = id.match(resvg) 233 | 234 | if (!match) { 235 | return undefined 236 | } 237 | 238 | const isBuild = transformOptions?.ssr ?? false 239 | const type = match[1] 240 | 241 | if (isType(type, 'url')) { 242 | if (isDevelopmentMode()) { 243 | const msg = `"url" imports are not optimized in development mode` 244 | this.info({ 245 | id, 246 | message: msg, 247 | }) 248 | } 249 | 250 | return { code: source, map: null, meta: { isSvgUrl: true } } 251 | } 252 | 253 | let svgo = options.svgoOptions 254 | let isSvgoDataUri = false 255 | 256 | if (svgo && typeof svgo === 'object') { 257 | if (svgo.datauri) { 258 | isSvgoDataUri = true 259 | } 260 | } 261 | 262 | if (isSvgoDataUri && type === 'component') { 263 | console.warn( 264 | `%s Type %O can not be imported as a Svelte component ` + 265 | `since "datauri" is set in vite.config`, 266 | yellow('[WARNING]'), 267 | id 268 | ) 269 | } else if (type === 'dataurl') { 270 | const t = match[3] ?? 'base64' 271 | 272 | if (!svgo) { 273 | svgo = {} 274 | } 275 | 276 | svgo.datauri = t as Config['datauri'] 277 | isSvgoDataUri = true 278 | } 279 | 280 | try { 281 | const filename = id.replace(/\.svg(\?.*)$/, '.svg') 282 | const data = (await readFile(filename)).toString('utf-8') 283 | const opt = 284 | svgo !== false 285 | ? optimize(data, { path: filename, ...svgo }) 286 | : { data } 287 | 288 | if (isSvgoOptimizeError(opt)) { 289 | console.error('Got optimize error from SVGO:', opt) 290 | return undefined 291 | } 292 | 293 | if (isType(type, 'src') || isSvgoDataUri) { 294 | return { 295 | code: `\nexport default \`${opt.data}\`;`, 296 | map: null, 297 | } 298 | } 299 | 300 | const comp = toComponent(opt.data) 301 | opt.data = hook ? hook(opt.data, comp) : comp.component 302 | const { js } = compile(opt.data, { 303 | css: 'external', 304 | filename: id, 305 | namespace: 'svg', 306 | generate: isBuild ? 'server' : 'client', 307 | }) 308 | 309 | // Remove query string from sources 310 | js.map.sources.forEach((v, idx, a) => { 311 | if (v.includes('?')) { 312 | const t = v.split('?')[0] 313 | 314 | if (t) { 315 | a[idx] = t 316 | } 317 | } 318 | }) 319 | 320 | return js 321 | } catch (err: unknown) { 322 | if (isCompileError(err) && hasCdata(err.frame)) { 323 | const msg = 324 | `\n%s The SVG file %O contains a %s section which is not ` + 325 | `supported by Svelte. To make this SVG work with the %s ` + 326 | `plugin, you need to remove all %s sections from the SVG.\n` 327 | 328 | console.warn( 329 | msg, 330 | yellow('[WARNING]'), 331 | id, 332 | blue('<![CDATA[...'), 333 | blue('@poppanator/sveltekit-svg'), 334 | blue('...') 335 | ) 336 | } else { 337 | console.error( 338 | 'Failed reading SVG "%s": %s', 339 | id, 340 | (err as Error).message, 341 | err 342 | ) 343 | } 344 | 345 | return undefined 346 | } 347 | }, 348 | } 349 | 350 | if (isDevelopmentMode()) { 351 | delete plugin.renderChunk 352 | delete plugin.generateBundle 353 | } 354 | 355 | return plugin 356 | } 357 | 358 | export = readSvg 359 | -------------------------------------------------------------------------------- /svg.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.svg?component' { 2 | import type { Component, SvelteComponent } from 'svelte' 3 | import type { SVGAttributes } from 'svelte/elements' 4 | 5 | const content: Component> 6 | 7 | export default content 8 | } 9 | 10 | declare module '*.svg?src' { 11 | const content: string 12 | export default content 13 | } 14 | 15 | declare module '*.svg?url' { 16 | const content: string 17 | export default content 18 | } 19 | 20 | declare module '*.svg?dataurl' { 21 | const content: string 22 | export default content 23 | } 24 | 25 | declare module '*.svg?dataurl=base64' { 26 | const content: string 27 | export default content 28 | } 29 | 30 | declare module '*.svg?dataurl=enc' { 31 | const content: string 32 | export default content 33 | } 34 | 35 | declare module '*.svg?dataurl=unenc' { 36 | const content: string 37 | export default content 38 | } 39 | -------------------------------------------------------------------------------- /test-app/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | parser: '@typescript-eslint/parser', 4 | extends: [ 5 | 'eslint:recommended', 6 | 'plugin:@typescript-eslint/recommended', 7 | 'plugin:svelte/recommended', 8 | 'prettier', 9 | ], 10 | plugins: ['@typescript-eslint'], 11 | parserOptions: { 12 | // sourceType: 'module', 13 | ecmaVersion: 2020, 14 | extraFileExtensions: ['.svelte'], 15 | }, 16 | overrides: [ 17 | { 18 | files: ['*.svelte'], 19 | parser: 'svelte-eslint-parser', 20 | parserOptions: { 21 | parser: '@typescript-eslint/parser', 22 | }, 23 | }, 24 | ], 25 | env: { 26 | browser: true, 27 | es2020: true, 28 | node: true, 29 | }, 30 | rules: { 31 | 'no-unused-vars': 'off', 32 | curly: 'error', 33 | yoda: 'error', 34 | 'default-case': 'error', 35 | camelcase: 'off', 36 | eqeqeq: ['error', 'always'], 37 | 'no-case-declarations': 'error', 38 | 'no-new-wrappers': 'error', 39 | 'no-return-await': 'error', 40 | 'no-self-compare': 'error', 41 | 'no-useless-call': 'error', 42 | 'no-multi-spaces': 'error', 43 | 'no-trailing-spaces': 'error', 44 | 'no-irregular-whitespace': 'error', 45 | 'max-len': [ 46 | 'error', 47 | { 48 | code: 80, 49 | ignoreUrls: true, 50 | ignoreStrings: true, 51 | ignoreTemplateLiterals: true, 52 | ignoreRegExpLiterals: true, 53 | }, 54 | ], 55 | }, 56 | } 57 | -------------------------------------------------------------------------------- /test-app/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /build 4 | /.svelte-kit 5 | /package 6 | /test-results 7 | -------------------------------------------------------------------------------- /test-app/.prettierrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | semi: false, 3 | trailingComma: 'all', 4 | singleQuote: true, 5 | trailingComma: 'es5', 6 | arrowParens: 'always', 7 | } 8 | -------------------------------------------------------------------------------- /test-app/README.md: -------------------------------------------------------------------------------- 1 | # Test App 2 | 3 | This is just a simple test app for `@poppanator/sveltekit-svg` 4 | -------------------------------------------------------------------------------- /test-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test-app", 3 | "version": "5.0.0", 4 | "scripts": { 5 | "dev": "vite dev", 6 | "build": "vite build", 7 | "preview": "vite preview", 8 | "package": "svelte-package", 9 | "check": "svelte-check --tsconfig ./tsconfig.json", 10 | "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch", 11 | "pre-test": "npm link @poppanator/sveltekit-svg", 12 | "test": "cross-env NODE_NO_WARNINGS=1 playwright test" 13 | }, 14 | "type": "module", 15 | "devDependencies": { 16 | "@sveltejs/adapter-node": "^5.2.12", 17 | "@sveltejs/kit": "2.17.2", 18 | "eslint-plugin-svelte": "2.46.1", 19 | "svelte": "5.20.1", 20 | "svelte-check": "4.1.4", 21 | "svelte-preprocess": "^6.0.3", 22 | "svgo": "3.3.2", 23 | "vite": "6.0.11" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test-app/playwright.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('@playwright/test').PlaywrightTestConfig} */ 2 | const config = { 3 | testMatch: /tests\/.*.js$/, 4 | webServer: { 5 | command: 'npm run build && npm run preview', 6 | port: 4173, 7 | }, 8 | } 9 | 10 | export default config 11 | -------------------------------------------------------------------------------- /test-app/src/app.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.svg?component' { 2 | import type { Component } from 'svelte' 3 | import type { SVGAttributes } from 'svelte/elements' 4 | 5 | const content: Component & { title?: string }> 6 | 7 | export default content 8 | } 9 | 10 | declare module '*.svg?src' { 11 | const content: string 12 | export default content 13 | } 14 | 15 | declare module '*.svg?url' { 16 | const content: string 17 | export default content 18 | } 19 | 20 | declare module '*.svg?dataurl' { 21 | const content: string 22 | export default content 23 | } 24 | 25 | declare module '*.svg?dataurl=base64' { 26 | const content: string 27 | export default content 28 | } 29 | 30 | declare module '*.svg?dataurl=enc' { 31 | const content: string 32 | export default content 33 | } 34 | 35 | declare module '*.svg?dataurl=unenc' { 36 | const content: string 37 | export default content 38 | } 39 | -------------------------------------------------------------------------------- /test-app/src/app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %sveltekit.head% 8 | 9 | 10 |
%sveltekit.body%
11 | 12 | 13 | -------------------------------------------------------------------------------- /test-app/src/assets/icons/beaker-off.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /test-app/src/assets/icons/beaker.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /test-app/src/assets/icons/capsule-off.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /test-app/src/assets/icons/capsule.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /test-app/src/assets/icons/electrocardiogram-off.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test-app/src/assets/icons/electrocardiogram.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /test-app/src/assets/icons/infusion-off.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test-app/src/assets/icons/infusion.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /test-app/src/assets/sample-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /test-app/src/assets/ticket-56.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /test-app/src/hook/svg.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /test-app/src/lib/TestComp.svelte: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /test-app/src/lib/sample-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /test-app/src/other/other-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /test-app/src/routes/+page.svelte: -------------------------------------------------------------------------------- 1 | 8 | 9 |

As inline component

10 |
11 | 12 |
13 | 14 |

As inline string

15 |
16 | 17 | {@html logoSvgString} 18 |
19 | 20 |

As URL in an image tag

21 |
22 | Sample logo 23 |
24 | 25 |

With component props

26 |
27 | 28 |
29 | 30 |

From another directory

31 | 32 | 33 | 34 | 35 |

Data-URL

36 | 37 | Sample logo as data URL 43 | 44 | -------------------------------------------------------------------------------- /test-app/src/routes/dataurl/+page.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 |

Base 64 (Explicit)

8 |
b64explicit
9 | 10 |

Base 64 (Enc)

11 |
Enc
12 | 13 |

Base 64 (UnEnc)

14 |
UnEnc
15 | 16 | 21 | -------------------------------------------------------------------------------- /test-app/src/routes/hook/+page.svelte: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /test-app/src/routes/imgurl/+page.svelte: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /test-app/src/routes/ticket-56/+page.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 |

Sample Component

9 | 10 |
11 | 12 |
13 |

Sample Raw

14 | 15 | {@html sampleRaw} 16 |
17 | 18 |
19 |

Sample Img

20 | 21 |
22 | -------------------------------------------------------------------------------- /test-app/src/routes/ticket-61/+page.svelte: -------------------------------------------------------------------------------- 1 | 42 | 43 | 63 | 64 | 82 | -------------------------------------------------------------------------------- /test-app/static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poppa/sveltekit-svg/9b88f2d23d0fa41b0209cc22502e7e5d14d3b6d0/test-app/static/favicon.png -------------------------------------------------------------------------------- /test-app/static/static-sample-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /test-app/svelte.config.js: -------------------------------------------------------------------------------- 1 | import adapter from '@sveltejs/adapter-node' 2 | import { sveltePreprocess } from 'svelte-preprocess' 3 | 4 | /** @type {import('@sveltejs/kit').Config} */ 5 | const config = { 6 | // Consult https://github.com/sveltejs/svelte-preprocess 7 | // for more information about preprocessors 8 | preprocess: sveltePreprocess(), 9 | kit: { 10 | adapter: adapter({ strict: false }), 11 | }, 12 | } 13 | 14 | export default config 15 | -------------------------------------------------------------------------------- /test-app/tests/test.js: -------------------------------------------------------------------------------- 1 | import { expect, test } from '@playwright/test' 2 | 3 | const outerHtml = async (elem) => { 4 | if (!elem) { 5 | return undefined 6 | } 7 | 8 | return elem.evaluate((el) => el.outerHTML) 9 | } 10 | 11 | test('SVG as inline component', async ({ page }) => { 12 | await page.goto('/') 13 | const svg = page.locator('#inline-comp > svg') 14 | expect(await outerHtml(svg)).toMatchSnapshot('inline-comp.svg') 15 | }) 16 | 17 | test('SVG as inline string', async ({ page }) => { 18 | await page.goto('/') 19 | const svg = page.locator('#inline-string > svg') 20 | expect(await outerHtml(svg)).toMatchSnapshot('inline-string.svg') 21 | }) 22 | 23 | // FIXME: This test breaks when running in this test context (we get a data url) 24 | // but it works fine when you look at the page in a browse when running 25 | // the server 26 | test.skip('As URL in an image tag', async ({ page }) => { 27 | await page.goto('/') 28 | const img = page.locator('#image > img') 29 | expect((await img.getAttribute('src')).includes('sample-logo')).toEqual(true) 30 | expect(await img.getAttribute('alt')).toEqual('Sample logo') 31 | }) 32 | 33 | test('With component props', async ({ page }) => { 34 | await page.goto('/') 35 | const svg = page.locator('#with-props > svg') 36 | expect(await svg.getAttribute('width')).toEqual('200') 37 | expect(await svg.getAttribute('aria-hidden')).toEqual('false') 38 | }) 39 | 40 | test('From another directory', async ({ page }) => { 41 | await page.goto('/') 42 | const svg = page.locator('#from-another-dir > svg') 43 | expect(await outerHtml(svg)).toMatchSnapshot('from-another-dir.svg') 44 | }) 45 | 46 | test('As data URL', async ({ page }) => { 47 | await page.goto('/') 48 | const img = page.locator('#dataurl > img') 49 | expect(await img.getAttribute('src')).toMatchSnapshot('base64imageurl.txt') 50 | }) 51 | 52 | test('As data URL with explicit base64', async ({ page }) => { 53 | await page.goto('/dataurl') 54 | const img = page.locator('#b64e > img') 55 | expect(await img.getAttribute('src')).toMatchSnapshot('base64explicit.txt') 56 | }) 57 | 58 | test('As data URL with explicit enc', async ({ page }) => { 59 | await page.goto('/dataurl') 60 | const img = page.locator('#enc > img') 61 | expect(await img.getAttribute('src')).toMatchSnapshot('enc.txt') 62 | }) 63 | 64 | test('As data URL with explicit unenc', async ({ page }) => { 65 | await page.goto('/dataurl') 66 | const img = page.locator('#unenc > img') 67 | expect(await img.getAttribute('src')).toMatchSnapshot('unenc.txt') 68 | }) 69 | 70 | test('Transform hook', async ({ page }) => { 71 | await page.goto('/hook') 72 | const svg = page.locator('svg > title') 73 | const title = await svg.textContent() 74 | 75 | expect(title).toEqual('Official SVG Logo') 76 | }) 77 | 78 | test('Optimized URL import', async ({ page }) => { 79 | await page.goto('/imgurl') 80 | const samplelogo = await page.locator('img#samplelogo').getAttribute('src') 81 | const otherlogo = await page.locator('img#otherlogo').getAttribute('src') 82 | 83 | await page.goto(samplelogo) 84 | 85 | let data = await page.content() 86 | expect(data).toMatchSnapshot('samplelogoopturl.svg') 87 | 88 | await page.goto(otherlogo) 89 | data = await page.content() 90 | expect(data).toMatchSnapshot('otherlogoopturl.svg') 91 | }) 92 | -------------------------------------------------------------------------------- /test-app/tests/test.js-snapshots/base64explicit-darwin.txt: -------------------------------------------------------------------------------- 1 | data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHZpZXdCb3g9IjAgMCA0NTUgNDU1Ij48cGF0aCBkPSJNMjY3LjQzIDIxNS42MjZjLTIzLjc4OCAwLTM2LjExOCAyMS4yOTktMzYuMTE4IDQ3Ljg1NCAwIDI4LjUzIDE0LjAzIDQ2LjQzMSAzNS44MDIgNDYuNDMxIDE1LjEzNSAwIDI3LjE4Ny0xMC4zMTMgMzAuMjY5LTI1LjEzMiAxLjA2OS0zLjcxNCAxLjM4NS03LjU4OCAxLjM4NS0xMi4wNTJ2LTIxLjkzMWMwLTIuNzY2LS4zMTYtNi42NC0uNzkxLTkuNDA2LTMuMDgzLTE0LjAyOC0xNC4zNDQtMjUuNzY0LTMwLjU0Ny0yNS43NjQiIHN0eWxlPSJmaWxsLXJ1bGU6ZXZlbm9kZDtjbGlwLXJ1bGU6ZXZlbm9kZCIvPjxwYXRoIGQ9Ik0wIDB2NDU1aDQ1NVYwem0xNTUuMTY3IDM0Ny43MjdoLTUyLjYzNFYxMTUuNzI5aDUyLjYzNHptMTUwLjgzMSAwLTIuMjkzLTI0LjY5NWgtLjc4OWMtMTAuNjI5IDE4Ljg0OS0zMS4wMjIgMjguNTY5LTUyLjYzNyAyOC41NjktMzkuOTg5IDAtNzEuOTE3LTM0LjEwMi03MS45MTctODYuNDItLjQ3NS01Ni44MjYgMzUuMDUtODkuNTQ2IDc1LjMxOC04OS41NDYgMjAuNzA2IDAgMzYuOTA2IDcuMjcyIDQ0LjQ1NiAxOC45NjloLjYzMnYtOTEuMjA1aDUyLjMxOXYxOTQuMDI2YzAgMTguOTY3Ljc5MSAzOS4wNDEgMS4zODIgNTAuMzAyeiIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkIi8+PC9zdmc+ -------------------------------------------------------------------------------- /test-app/tests/test.js-snapshots/base64imageurl-darwin.txt: -------------------------------------------------------------------------------- 1 | data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHZpZXdCb3g9IjAgMCA0NTUgNDU1Ij48cGF0aCBkPSJNMjY3LjQzIDIxNS42MjZjLTIzLjc4OCAwLTM2LjExOCAyMS4yOTktMzYuMTE4IDQ3Ljg1NCAwIDI4LjUzIDE0LjAzIDQ2LjQzMSAzNS44MDIgNDYuNDMxIDE1LjEzNSAwIDI3LjE4Ny0xMC4zMTMgMzAuMjY5LTI1LjEzMiAxLjA2OS0zLjcxNCAxLjM4NS03LjU4OCAxLjM4NS0xMi4wNTJ2LTIxLjkzMWMwLTIuNzY2LS4zMTYtNi42NC0uNzkxLTkuNDA2LTMuMDgzLTE0LjAyOC0xNC4zNDQtMjUuNzY0LTMwLjU0Ny0yNS43NjQiIHN0eWxlPSJmaWxsLXJ1bGU6ZXZlbm9kZDtjbGlwLXJ1bGU6ZXZlbm9kZCIvPjxwYXRoIGQ9Ik0wIDB2NDU1aDQ1NVYwem0xNTUuMTY3IDM0Ny43MjdoLTUyLjYzNFYxMTUuNzI5aDUyLjYzNHptMTUwLjgzMSAwLTIuMjkzLTI0LjY5NWgtLjc4OWMtMTAuNjI5IDE4Ljg0OS0zMS4wMjIgMjguNTY5LTUyLjYzNyAyOC41NjktMzkuOTg5IDAtNzEuOTE3LTM0LjEwMi03MS45MTctODYuNDItLjQ3NS01Ni44MjYgMzUuMDUtODkuNTQ2IDc1LjMxOC04OS41NDYgMjAuNzA2IDAgMzYuOTA2IDcuMjcyIDQ0LjQ1NiAxOC45NjloLjYzMnYtOTEuMjA1aDUyLjMxOXYxOTQuMDI2YzAgMTguOTY3Ljc5MSAzOS4wNDEgMS4zODIgNTAuMzAyeiIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkIi8+PC9zdmc+ -------------------------------------------------------------------------------- /test-app/tests/test.js-snapshots/enc-darwin.txt: -------------------------------------------------------------------------------- 1 | data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xml%3Aspace%3D%22preserve%22%20viewBox%3D%220%200%20455%20455%22%3E%3Cpath%20d%3D%22M267.43%20215.626c-23.788%200-36.118%2021.299-36.118%2047.854%200%2028.53%2014.03%2046.431%2035.802%2046.431%2015.135%200%2027.187-10.313%2030.269-25.132%201.069-3.714%201.385-7.588%201.385-12.052v-21.931c0-2.766-.316-6.64-.791-9.406-3.083-14.028-14.344-25.764-30.547-25.764%22%20style%3D%22fill-rule%3Aevenodd%3Bclip-rule%3Aevenodd%22%2F%3E%3Cpath%20d%3D%22M0%200v455h455V0zm155.167%20347.727h-52.634V115.729h52.634zm150.831%200-2.293-24.695h-.789c-10.629%2018.849-31.022%2028.569-52.637%2028.569-39.989%200-71.917-34.102-71.917-86.42-.475-56.826%2035.05-89.546%2075.318-89.546%2020.706%200%2036.906%207.272%2044.456%2018.969h.632v-91.205h52.319v194.026c0%2018.967.791%2039.041%201.382%2050.302z%22%20style%3D%22fill-rule%3Aevenodd%3Bclip-rule%3Aevenodd%22%2F%3E%3C%2Fsvg%3E -------------------------------------------------------------------------------- /test-app/tests/test.js-snapshots/from-another-dir-darwin.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test-app/tests/test.js-snapshots/inline-comp-darwin.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test-app/tests/test.js-snapshots/inline-string-darwin.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test-app/tests/test.js-snapshots/otherlogoopturl-darwin.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test-app/tests/test.js-snapshots/samplelogoopturl-darwin.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test-app/tests/test.js-snapshots/unenc-darwin.txt: -------------------------------------------------------------------------------- 1 | data:image/svg+xml, -------------------------------------------------------------------------------- /test-app/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./.svelte-kit/tsconfig.json", 3 | "compilerOptions": { 4 | "moduleResolution": "NodeNext", 5 | "module": "NodeNext", 6 | "verbatimModuleSyntax": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test-app/vite.config.ts: -------------------------------------------------------------------------------- 1 | import svg from '@poppanator/sveltekit-svg' 2 | import { sveltekit } from '@sveltejs/kit/vite' 3 | import type { UserConfig } from 'vite' 4 | 5 | const config: UserConfig = { 6 | plugins: [ 7 | sveltekit(), 8 | svg({ includePaths: [`./src/assets/`, 'src/other/'] }), 9 | svg({ includePaths: ['./src/lib/'] }), 10 | svg({ 11 | includePaths: [`./src/hook/`], 12 | preCompileHook(rawSvg, splitSvg) { 13 | const comp = ` 14 | 15 | 16 | {title} 17 | ${splitSvg.content} 18 | 19 | ` 20 | 21 | return comp 22 | }, 23 | }), 24 | ], 25 | } 26 | 27 | export default config 28 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig.json to read more about this file */ 4 | 5 | /* Basic Options */ 6 | "target": "es2019" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, 7 | "module": "CommonJS" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, 8 | "outDir": "dist", 9 | "declaration": true, 10 | 11 | /* Strict Type-Checking Options */ 12 | "strict": true /* Enable all strict type-checking options. */, 13 | 14 | /* Additional Checks */ 15 | "noUnusedLocals": true /* Report errors on unused locals. */, 16 | "noUnusedParameters": true /* Report errors on unused parameters. */, 17 | "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, 18 | "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, 19 | "noUncheckedIndexedAccess": true /* Include 'undefined' in index signature results */, 20 | "noPropertyAccessFromIndexSignature": true /* Require undeclared properties from index signatures to use element accesses. */, 21 | 22 | /* Module Resolution Options */ 23 | "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */, 24 | "allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */, 25 | "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, 26 | 27 | /* Advanced Options */ 28 | "skipLibCheck": true /* Skip type checking of declaration files. */, 29 | "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ 30 | }, 31 | "include": ["src/**/*.ts"] 32 | } 33 | --------------------------------------------------------------------------------