From 0001073ba5b4af16b438cd5ed10ea61d64b2c775 Mon Sep 17 00:00:00 2001 From: Dominik G Date: Tue, 2 Nov 2021 20:29:51 +0100 Subject: [PATCH] feat: initial implementation of markup preprocessor that wraps svg (#1) * feat: initial implementation of markup preprocessor that wraps svg content with @html * fix: override vulnerable ansi-regex version * chore: update esbuild min version * feat: implement strict parser and options, add some docs * test: add tests and fix skip * test: fix expected result after reformat of fixtures * test: include node17, only build main package * fix: remove .npmrc with engine-strict to allow use of vite-plugin-svelte in playground * chore: update package.json before first release * docs: update main readme --- .changeset/smart-roses-allow.md | 5 + .eslintrc.js | 11 ++ .github/workflows/ci.yml | 6 +- .npmrc | 1 - README.md | 18 +-- package.json | 7 +- packages/playground/inline-svg/README.md | 3 + packages/playground/inline-svg/index.html | 13 ++ packages/playground/inline-svg/jsconfig.json | 34 +++++ packages/playground/inline-svg/package.json | 17 +++ .../playground/inline-svg/public/favicon.ico | Bin 0 -> 1150 bytes packages/playground/inline-svg/src/App.svelte | 33 ++++ packages/playground/inline-svg/src/main.js | 7 + .../playground/inline-svg/src/vite-env.d.ts | 2 + .../playground/inline-svg/svelte.config.js | 4 + packages/playground/inline-svg/vite.config.js | 7 + packages/svelte-preprocess-svg/README.md | 56 ++++++- packages/svelte-preprocess-svg/package.json | 11 +- packages/svelte-preprocess-svg/src/index.ts | 144 +++++++++++++++++- .../tests/fixtures/.editorconfig | 7 + .../tests/fixtures/simple.svelte | 24 +++ .../tests/fixtures/simple.svelte.expected | 24 +++ .../tests/fixtures/strict.svelte | 29 ++++ .../tests/fixtures/strict.svelte.expected | 29 ++++ packages/svelte-preprocess-svg/tests/index.ts | 53 ++++++- pnpm-lock.yaml | 136 ++++++++++++++++- 26 files changed, 639 insertions(+), 42 deletions(-) create mode 100644 .changeset/smart-roses-allow.md delete mode 100644 .npmrc create mode 100644 packages/playground/inline-svg/README.md create mode 100644 packages/playground/inline-svg/index.html create mode 100644 packages/playground/inline-svg/jsconfig.json create mode 100644 packages/playground/inline-svg/package.json create mode 100644 packages/playground/inline-svg/public/favicon.ico create mode 100644 packages/playground/inline-svg/src/App.svelte create mode 100644 packages/playground/inline-svg/src/main.js create mode 100644 packages/playground/inline-svg/src/vite-env.d.ts create mode 100644 packages/playground/inline-svg/svelte.config.js create mode 100644 packages/playground/inline-svg/vite.config.js create mode 100644 packages/svelte-preprocess-svg/tests/fixtures/.editorconfig create mode 100644 packages/svelte-preprocess-svg/tests/fixtures/simple.svelte create mode 100644 packages/svelte-preprocess-svg/tests/fixtures/simple.svelte.expected create mode 100644 packages/svelte-preprocess-svg/tests/fixtures/strict.svelte create mode 100644 packages/svelte-preprocess-svg/tests/fixtures/strict.svelte.expected diff --git a/.changeset/smart-roses-allow.md b/.changeset/smart-roses-allow.md new file mode 100644 index 0000000..344f938 --- /dev/null +++ b/.changeset/smart-roses-allow.md @@ -0,0 +1,5 @@ +--- +'@svitejs/svelte-preprocess-svg': minor +--- + +Initial implementation diff --git a/.eslintrc.js b/.eslintrc.js index 9d7ef75..7f12ec5 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -87,6 +87,17 @@ module.exports = { node: true, browser: false } + }, + { + files: ['packages/e2e-tests/**', 'packages/playground/**'], + rules: { + 'node/no-extraneous-import': 'off', + 'node/no-extraneous-require': 'off', + 'no-unused-vars': 'off' + }, + env: { + browser: true + } } ] }; diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c8f822..6e08c34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# build and test on linux, windows, mac with node 12, 14, 16 +# build and test on linux, windows, mac with node 12, 14, 16, 17 name: CI on: @@ -46,7 +46,7 @@ jobs: if: (${{ success() }} || ${{ failure() }}) run: pnpm audit - # this is the test matrix, it runs with node14 on linux,windows,macos + node12,16 on linux + # this is the test matrix, it runs with node14 on linux,windows,macos + node12,16,17 on linux # it is skipped if the build step of the checks job wasn't successful (still runs if lint or audit fail) test: needs: checks @@ -63,6 +63,8 @@ jobs: os: ubuntu-latest - node: 16 os: ubuntu-latest + - node: 17 + os: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 diff --git a/.npmrc b/.npmrc deleted file mode 100644 index b6f27f1..0000000 --- a/.npmrc +++ /dev/null @@ -1 +0,0 @@ -engine-strict=true diff --git a/README.md b/README.md index e674177..7b6e56e 100644 --- a/README.md +++ b/README.md @@ -3,25 +3,15 @@ [![npm version](https://img.shields.io/npm/v/@svitejs/svelte-preprocess-svg)](https://www.npmjs.com/package/@svitejs/svelte-preprocess-svg) [![CI](https://github.com/svitejs/svelte-preprocess-svg/actions/workflows/ci.yml/badge.svg)](https://github.com/svitejs/svelte-preprocess-svg/actions/workflows/ci.yml) -PROJECT TAGLINE HERE +Optimize inline svg in svelte components -## Installation +## Features -```bash -npm install --save-dev @svitejs/svelte-preprocess-svg -``` - -## Usage - -```js -// show em how it's done -``` +- wrap content of `` in `@html` directive so that the svelte compiler treats it as string instead of generating an extra function call for each childnode. ## Documentation -- some -- doc -- links +[see here](packages/svelte-preprocess-svg/README.md) ## Packages diff --git a/package.json b/package.json index 64b3899..9ef5de7 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "license": "MIT", "scripts": { "dev": "pnpm --dir packages/svelte-preprocess-svg dev", - "build": "pnpm -r build", - "test": "pnpm -r test --workspace-concurrency=1", + "build": "pnpm --dir packages/svelte-preprocess-svg build", + "test": "pnpm --dir packages/svelte-preprocess-svg test", "lint": "eslint --ignore-path .gitignore '**/*.{js,ts,svelte,html,svx,md}'", "lint:fix": "pnpm run lint -- --fix", "format": "prettier --ignore-path .gitignore '**/*.{css,scss,svelte,html,js,ts,svx,md}' --check", @@ -56,7 +56,8 @@ "pnpm": { "overrides": { "@svitejs/svelte-preprocess-svg": "workspace:*", - "esbuild": "^0.13.4" + "esbuild": "^0.13.12", + "ansi-regex@>2.1.1 <5.0.1": ">=5.0.1" } } } diff --git a/packages/playground/inline-svg/README.md b/packages/playground/inline-svg/README.md new file mode 100644 index 0000000..bb9f9ab --- /dev/null +++ b/packages/playground/inline-svg/README.md @@ -0,0 +1,3 @@ +# inline-svg + +just a simple playground with an inline svg for quick prototyping diff --git a/packages/playground/inline-svg/index.html b/packages/playground/inline-svg/index.html new file mode 100644 index 0000000..39b5db6 --- /dev/null +++ b/packages/playground/inline-svg/index.html @@ -0,0 +1,13 @@ + + + + + + + Svelte + Vite App + + +
+ + + diff --git a/packages/playground/inline-svg/jsconfig.json b/packages/playground/inline-svg/jsconfig.json new file mode 100644 index 0000000..4258594 --- /dev/null +++ b/packages/playground/inline-svg/jsconfig.json @@ -0,0 +1,34 @@ +{ + "compilerOptions": { + "moduleResolution": "node", + "target": "esnext", + "module": "esnext", + /** + * svelte-preprocess cannot figure out whether you have + * a value or a type, so tell TypeScript to enforce using + * `import type` instead of `import` for Types. + */ + "importsNotUsedAsValues": "error", + "isolatedModules": true, + "resolveJsonModule": true, + /** + * To have warnings / errors of the Svelte compiler at the + * correct position, enable source maps by default. + */ + "sourceMap": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "baseUrl": ".", + /** + * Typecheck JS in `.svelte` and `.js` files by default. + * Disable this if you'd like to use dynamic types. + */ + "checkJs": true + }, + /** + * Use global.d.ts instead of compilerOptions.types + * to avoid limiting type declarations. + */ + "include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"] +} diff --git a/packages/playground/inline-svg/package.json b/packages/playground/inline-svg/package.json new file mode 100644 index 0000000..563c780 --- /dev/null +++ b/packages/playground/inline-svg/package.json @@ -0,0 +1,17 @@ +{ + "name": "inline-svg", + "version": "0.0.0", + "type": "module", + "private": true, + "scripts": { + "dev": "vite", + "build": "vite build", + "serve": "vite preview" + }, + "devDependencies": { + "@sveltejs/vite-plugin-svelte": "^1.0.0-next.30", + "@svitejs/svelte-preprocess-svg": "workspace:*", + "svelte": "^3.44.0", + "vite": "^2.6.13" + } +} diff --git a/packages/playground/inline-svg/public/favicon.ico b/packages/playground/inline-svg/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..d75d248ef0b15096a95054643a4d97f5d9b60846 GIT binary patch literal 1150 zcmaKqSxA*Z7>4KMS_;~x;8i!JU{-`tpyx!I(n2NFMU)w2L{WiMS3#Lcp@vrpA*5Yp zSy6|`AkYfDD(e{`n8yX0pLf20X1@3RmKkGw`Vte3=0)aUq%ldx zm^49K+Hw0b#^`KboP)QXJOwbuVUFxlAs{RfqJ+twGylWfOp{Hc$s#253LlN1nsFVc zKa>40?h5(7PTC6ltDx)(Y&Ze2xggCq(kK? zTA`;gAfKD!+uFjpxc_A3+Ma(L28W=z4Gvs@r*ECk`;c45=S#;=oA|abt`f&j5&uJO z3Dn+&^gZ%h4JidsaTR{{!_Y8PUx(-%PosPy2gi@qIvBMMYz;e3L1{f~mrd9RdB>pZ zD}4R|sk_C`;=cT&r)c=8u>7h9)u32*SbL`xiq3(pq5C^5-sSOw;<|fv@nfXfl&U`2 z81K5ExDp;bf#DISW%IY%k&2-noShOoz-;kb(u?5RFX-ro?87j3GZdCXrFc8bTx}jd zz_n@djWnxc*TbbCjEq80FPyG}1zQwvjq7R6ZSWuQ@_#A*LN5n<3$BI?X}q%iD!B-s zdSFcNp!EgpJr6CAK?klug4>=)Tv z+F#{yt>6EK)3NU=L&y_W3UNaC?Tg=6YE0)^V;(0Mb0$WJ7>7@Lg0~+3x9d)!Pd + console.log('foo'); + + + + +
+

Svelte inline svg

+ +
+ + diff --git a/packages/playground/inline-svg/src/main.js b/packages/playground/inline-svg/src/main.js new file mode 100644 index 0000000..448d149 --- /dev/null +++ b/packages/playground/inline-svg/src/main.js @@ -0,0 +1,7 @@ +import App from './App.svelte'; + +const app = new App({ + target: document.getElementById('app') +}); + +export default app; diff --git a/packages/playground/inline-svg/src/vite-env.d.ts b/packages/playground/inline-svg/src/vite-env.d.ts new file mode 100644 index 0000000..4078e74 --- /dev/null +++ b/packages/playground/inline-svg/src/vite-env.d.ts @@ -0,0 +1,2 @@ +/// +/// diff --git a/packages/playground/inline-svg/svelte.config.js b/packages/playground/inline-svg/svelte.config.js new file mode 100644 index 0000000..31db2bc --- /dev/null +++ b/packages/playground/inline-svg/svelte.config.js @@ -0,0 +1,4 @@ +import { sveltePreprocessSvg } from '@svitejs/svelte-preprocess-svg'; +export default { + preprocess: [sveltePreprocessSvg()] +}; diff --git a/packages/playground/inline-svg/vite.config.js b/packages/playground/inline-svg/vite.config.js new file mode 100644 index 0000000..5e75b6c --- /dev/null +++ b/packages/playground/inline-svg/vite.config.js @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite'; +import { svelte } from '@sveltejs/vite-plugin-svelte'; + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [svelte()] +}); diff --git a/packages/svelte-preprocess-svg/README.md b/packages/svelte-preprocess-svg/README.md index 67f4720..19535dd 100644 --- a/packages/svelte-preprocess-svg/README.md +++ b/packages/svelte-preprocess-svg/README.md @@ -1,24 +1,66 @@ -# @svitejs/project-template +# @svitejs/svelte-preprocess-svg -PROJECT TAGLINE HERE +Optimize inline svg in svelte components ## Installation ```bash -npm install --save-dev @svitejs/project-template +npm install --save-dev @svitejs/svelte-preprocess-svg ``` ## Usage +svelte.config.js + ```js -// show em how it's done +import { sveltePreprocessSvg } from '@svitejs/svelte-preprocess-svg'; +//... +export default { + //... + preprocess: [ + //... + // sveltePreprocessSvg must be used AFTER other markup preprocessors like mdsvex + sveltePreprocessSvg({ + /* options */ + }) + ] + //... +}; ``` ## Documentation -- some -- doc -- links +### options + +```ts +interface SveltePreprocessSvgOptions { + /** + * Filter function to only include some files + * + * @param filename + * @param content + * @return boolean true to include the file + */ + // eslint-disable-next-line no-unused-vars + include?: (filename: string, content?: string) => boolean; + + /** + * Filter function to exclude some files + * + * @param filename + * @param content + * @return boolean true to exclude the file + */ + // eslint-disable-next-line no-unused-vars + exclude?: (filename: string, content?: string) => boolean; + + /** + * Set to true to use a simple string search instead of svelte.parse. + * This is faster but not fault tolerant. misaligned html comments or svg inside string literals will trip it up + */ + useSimpleStringParser?: boolean; +} +``` ## License diff --git a/packages/svelte-preprocess-svg/package.json b/packages/svelte-preprocess-svg/package.json index e3219ea..c995939 100644 --- a/packages/svelte-preprocess-svg/package.json +++ b/packages/svelte-preprocess-svg/package.json @@ -1,9 +1,8 @@ { "name": "@svitejs/svelte-preprocess-svg", - "version": "0.0.0", + "version": "0.0.1", "license": "MIT", "author": "dominikg", - "private": true, "type": "module", "main": "dist/index.cjs", "module": "dist/index.js", @@ -18,7 +17,7 @@ "scripts": { "dev": "tsup-node --watch src", "build": "tsup-node --dts", - "test": "tsm node_modules/uvu/bin.js tests" + "test": "tsm node_modules/uvu/bin.js tests -i fixtures" }, "engines": { "node": "^12.20 || ^14.13.1 || >= 16" @@ -32,7 +31,13 @@ "url": "https://github.com/svitejs/svelte-preprocess-svg/issues" }, "homepage": "https://github.com/svitejs/svelte-preprocess-svg#readme", + "keywords": ["svelte","svelte-preprocess","svg"], + "peerDependencies": { + "svelte": "^3.44.1" + }, "devDependencies": { + "magic-string": "^0.25.7", + "svelte": "^3.44.1", "uvu": "^0.5.2" } } diff --git a/packages/svelte-preprocess-svg/src/index.ts b/packages/svelte-preprocess-svg/src/index.ts index 2e9e9ab..bb153e2 100644 --- a/packages/svelte-preprocess-svg/src/index.ts +++ b/packages/svelte-preprocess-svg/src/index.ts @@ -1 +1,143 @@ -export const code = ''; +import MagicString from 'magic-string'; +import { parse, walk } from 'svelte/compiler'; +// eslint-disable-next-line node/no-missing-import +import { PreprocessorGroup } from 'svelte/types/compiler/preprocess'; + +export interface SveltePreprocessSvgOptions { + /** + * Filter function to only include some files + * + * @param filename + * @param content + * @return boolean true to include the file + */ + // eslint-disable-next-line no-unused-vars + include?: (filename: string, content?: string) => boolean; + + /** + * Filter function to exclude some files + * + * @param filename + * @param content + * @return boolean true to exclude the file + */ + // eslint-disable-next-line no-unused-vars + exclude?: (filename: string, content?: string) => boolean; + + /** + * Set to true to use a simple string search instead of svelte.parse. + * This is faster but not fault tolerant. misaligned html comments or svg inside string literals will trip it up + */ + useSimpleStringParser?: boolean; +} + +function skip(filename: string, content: string, options?: SveltePreprocessSvgOptions) { + if (options?.include && !options.include(filename, content)) { + return true; + } + if (options?.exclude && options.exclude(filename, content)) { + return true; + } + if (!content.includes('', openTagStart + 5) + 1; + if (openTagEnd < 0) { + return; + } + const closeTagStart = content.indexOf('', closeTagStart + 5); + if (closeTagEnd < 0) { + return; + } + return { + openTagStart, + openTagEnd, + closeTagStart, + closeTagEnd + }; +} + +function strictParseTransform(filename: string, content: string) { + const parsed = parse(content, { filename }); + const s = new MagicString(content); + walk(parsed.html, { + enter: function (node: any) { + if (node.type === 'Element' && node.name === 'svg') { + const openTagEnd = content.indexOf('>', node.start) + 1; + const closeTagStart = content.lastIndexOf(' { + return { + // @ts-ignore + markup: ({ filename, content }) => { + if (skip(filename, content, options)) { + return; + } + return options?.useSimpleStringParser + ? simpleStringTransform(filename, content) + : strictParseTransform(filename, content); + } + }; +} diff --git a/packages/svelte-preprocess-svg/tests/fixtures/.editorconfig b/packages/svelte-preprocess-svg/tests/fixtures/.editorconfig new file mode 100644 index 0000000..769ddb4 --- /dev/null +++ b/packages/svelte-preprocess-svg/tests/fixtures/.editorconfig @@ -0,0 +1,7 @@ +# disable mangling of fixtures +[*.expected] +trim_trailing_whitespace = false +indent_size = unset +indent_style = unset +insert_final_newline = unset + diff --git a/packages/svelte-preprocess-svg/tests/fixtures/simple.svelte b/packages/svelte-preprocess-svg/tests/fixtures/simple.svelte new file mode 100644 index 0000000..a3ae240 --- /dev/null +++ b/packages/svelte-preprocess-svg/tests/fixtures/simple.svelte @@ -0,0 +1,24 @@ + + + + +
+

logo {foo} {bar}

+ +
+ + diff --git a/packages/svelte-preprocess-svg/tests/fixtures/simple.svelte.expected b/packages/svelte-preprocess-svg/tests/fixtures/simple.svelte.expected new file mode 100644 index 0000000..68d9d36 --- /dev/null +++ b/packages/svelte-preprocess-svg/tests/fixtures/simple.svelte.expected @@ -0,0 +1,24 @@ + + + + +
+

logo {foo} {bar}

+ +
+ + diff --git a/packages/svelte-preprocess-svg/tests/fixtures/strict.svelte b/packages/svelte-preprocess-svg/tests/fixtures/strict.svelte new file mode 100644 index 0000000..882b013 --- /dev/null +++ b/packages/svelte-preprocess-svg/tests/fixtures/strict.svelte @@ -0,0 +1,29 @@ + + + + +
+

logo {foo} {bar}

+ + +
+ + diff --git a/packages/svelte-preprocess-svg/tests/fixtures/strict.svelte.expected b/packages/svelte-preprocess-svg/tests/fixtures/strict.svelte.expected new file mode 100644 index 0000000..53a4d23 --- /dev/null +++ b/packages/svelte-preprocess-svg/tests/fixtures/strict.svelte.expected @@ -0,0 +1,29 @@ + + + + +
+

logo {foo} {bar}

+ + +
+ + diff --git a/packages/svelte-preprocess-svg/tests/index.ts b/packages/svelte-preprocess-svg/tests/index.ts index aac9b86..67eef4c 100644 --- a/packages/svelte-preprocess-svg/tests/index.ts +++ b/packages/svelte-preprocess-svg/tests/index.ts @@ -1,9 +1,54 @@ import { test } from 'uvu'; -import { equal } from 'uvu/assert'; -import { code } from '../src/index'; +import * as assert from 'uvu/assert'; +// eslint-disable-next-line node/no-missing-import +import { sveltePreprocessSvg } from '../src/index.js'; +import { promises as fs } from 'fs'; +import * as path from 'path'; -test('code', () => { - equal(code, ''); +test('default', async () => { + const filename = path.resolve('tests/fixtures/strict.svelte'); + const content = await fs.readFile(filename, 'utf-8'); + const preprocess = sveltePreprocessSvg(); + const result = await preprocess.markup({ content, filename }); + const expected = await fs.readFile(filename + '.expected', 'utf-8'); + assert.fixture(result.code, expected); +}); + +test('useSimpleStringParser', async () => { + const filename = path.resolve('tests/fixtures/simple.svelte'); + const content = await fs.readFile(filename, 'utf-8'); + const preprocess = await sveltePreprocessSvg({ useSimpleStringParser: true }); + const result = await preprocess.markup({ content, filename }); + const expected = await fs.readFile(filename + '.expected', 'utf-8'); + assert.fixture(result.code, expected); +}); + +test('include', async () => { + const filename = path.resolve('tests/fixtures/strict.svelte'); + const content = await fs.readFile(filename, 'utf-8'); + const preprocess = await sveltePreprocessSvg({ + include: (filename) => { + return filename.includes('strict.svelte'); + } + }); + const result = await preprocess.markup({ content, filename }); + assert.type(result, 'object'); + const result2 = await preprocess.markup({ content, filename: 'some/other/file.svelte' }); + assert.type(result2, 'undefined'); +}); + +test('exclude', async () => { + const filename = path.resolve('tests/fixtures/strict.svelte'); + const content = await fs.readFile(filename, 'utf-8'); + const preprocess = await sveltePreprocessSvg({ + exclude: (filename) => { + return filename.includes('strict.svelte'); + } + }); + const result = await preprocess.markup({ content, filename }); + assert.type(result, 'undefined'); + const result2 = await preprocess.markup({ content, filename: 'some/other/file.svelte' }); + assert.type(result2, 'object'); }); test.run(); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2bff554..0dddefe 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2,7 +2,8 @@ lockfileVersion: 5.3 overrides: '@svitejs/svelte-preprocess-svg': workspace:* - esbuild: ^0.13.4 + esbuild: ^0.13.12 + ansi-regex@>2.1.1 <5.0.1: '>=5.0.1' importers: @@ -58,10 +59,26 @@ importers: tsup: 5.5.0_typescript@4.4.4 typescript: 4.4.4 + packages/playground/inline-svg: + specifiers: + '@sveltejs/vite-plugin-svelte': ^1.0.0-next.30 + '@svitejs/svelte-preprocess-svg': workspace:* + svelte: ^3.44.0 + vite: ^2.6.13 + devDependencies: + '@sveltejs/vite-plugin-svelte': 1.0.0-next.30_svelte@3.44.0+vite@2.6.13 + '@svitejs/svelte-preprocess-svg': link:../../svelte-preprocess-svg + svelte: 3.44.0 + vite: 2.6.13 + packages/svelte-preprocess-svg: specifiers: + magic-string: ^0.25.7 + svelte: ^3.44.1 uvu: ^0.5.2 devDependencies: + magic-string: 0.25.7 + svelte: 3.44.1 uvu: 0.5.2 packages: @@ -344,6 +361,37 @@ packages: fastq: 1.13.0 dev: true + /@rollup/pluginutils/4.1.1: + resolution: {integrity: sha512-clDjivHqWGXi7u+0d2r2sBi4Ie6VLEAzWMIkvJLnDmxoOhBYOTfzGbOQBA32THHm11/LiJbd01tJUpJsbshSWQ==} + engines: {node: '>= 8.0.0'} + dependencies: + estree-walker: 2.0.2 + picomatch: 2.3.0 + dev: true + + /@sveltejs/vite-plugin-svelte/1.0.0-next.30_svelte@3.44.0+vite@2.6.13: + resolution: {integrity: sha512-YQqdMxjL1VgSFk4/+IY3yLwuRRapPafPiZTiaGEq1psbJYSNYUWx9F1zMm32GMsnogg3zn99mGJOqe3ld3HZSg==} + engines: {node: ^14.13.1 || >= 16} + peerDependencies: + diff-match-patch: ^1.0.5 + svelte: ^3.44.0 + vite: ^2.6.0 + peerDependenciesMeta: + diff-match-patch: + optional: true + dependencies: + '@rollup/pluginutils': 4.1.1 + debug: 4.3.2 + kleur: 4.1.4 + magic-string: 0.25.7 + require-relative: 0.8.7 + svelte: 3.44.0 + svelte-hmr: 0.14.7_svelte@3.44.0 + vite: 2.6.13 + transitivePeerDependencies: + - supports-color + dev: true + /@types/json-schema/7.0.9: resolution: {integrity: sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==} dev: true @@ -537,11 +585,6 @@ packages: type-fest: 0.21.3 dev: true - /ansi-regex/3.0.0: - resolution: {integrity: sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=} - engines: {node: '>=4'} - dev: true - /ansi-regex/5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} @@ -1459,6 +1502,10 @@ packages: engines: {node: '>=4.0'} dev: true + /estree-walker/2.0.2: + resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} + dev: true + /esutils/2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} @@ -2214,6 +2261,12 @@ packages: yallist: 4.0.0 dev: true + /magic-string/0.25.7: + resolution: {integrity: sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==} + dependencies: + sourcemap-codec: 1.4.8 + dev: true + /map-obj/1.0.1: resolution: {integrity: sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=} engines: {node: '>=0.10.0'} @@ -2335,6 +2388,12 @@ packages: thenify-all: 1.6.0 dev: true + /nanoid/3.1.30: + resolution: {integrity: sha512-zJpuPDwOv8D2zq2WRoMe1HsfZthVewpel9CAvTfc/2mBD1uUT/agc5f7GHGWXlYkFvi1mVxe4IjvP2HNrop7nQ==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + dev: true + /natural-compare/1.4.0: resolution: {integrity: sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=} dev: true @@ -2586,6 +2645,10 @@ packages: engines: {node: '>=8'} dev: true + /picocolors/1.0.0: + resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + dev: true + /picomatch/2.3.0: resolution: {integrity: sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==} engines: {node: '>=8.6'} @@ -2641,6 +2704,15 @@ packages: yaml: 1.10.2 dev: true + /postcss/8.3.11: + resolution: {integrity: sha512-hCmlUAIlUiav8Xdqw3Io4LcpA1DOt7h3LSTAC4G6JGHFFaWzI6qvFt9oilvl8BmkbBRX1IhM90ZAmpk68zccQA==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.1.30 + picocolors: 1.0.0 + source-map-js: 0.6.2 + dev: true + /preferred-pm/3.0.3: resolution: {integrity: sha512-+wZgbxNES/KlJs9q40F/1sfOd/j7f1O9JaHcW5Dsn3aUUOZg3L2bjpVUcKV2jvtElYfoTuQiNeMfQJ4kwUAhCQ==} engines: {node: '>=10'} @@ -2779,6 +2851,10 @@ packages: resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} dev: true + /require-relative/0.8.7: + resolution: {integrity: sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4=} + dev: true + /resolve-from/4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} @@ -2949,6 +3025,15 @@ packages: yargs: 15.4.1 dev: true + /source-map-js/0.6.2: + resolution: {integrity: sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==} + engines: {node: '>=0.10.0'} + dev: true + + /sourcemap-codec/1.4.8: + resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==} + dev: true + /spawndamnit/2.0.0: resolution: {integrity: sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA==} dependencies: @@ -3046,7 +3131,7 @@ packages: resolution: {integrity: sha1-qEeQIusaw2iocTibY1JixQXuNo8=} engines: {node: '>=4'} dependencies: - ansi-regex: 3.0.0 + ansi-regex: 5.0.1 dev: true /strip-ansi/6.0.1: @@ -3117,11 +3202,24 @@ packages: has-flag: 4.0.0 dev: true + /svelte-hmr/0.14.7_svelte@3.44.0: + resolution: {integrity: sha512-pDrzgcWSoMaK6AJkBWkmgIsecW0GChxYZSZieIYfCP0v2oPyx2CYU/zm7TBIcjLVUPP714WxmViE9Thht4etog==} + peerDependencies: + svelte: '>=3.19.0' + dependencies: + svelte: 3.44.0 + dev: true + /svelte/3.44.0: resolution: {integrity: sha512-zWACSJBSncGiDvFfYOMFGNV5zDLOlyhftmO5yOZ0lEtQMptpElaRtl39MWz1+lYCpwUq4F3Q2lTzI9TrTL+eMA==} engines: {node: '>= 8'} dev: true + /svelte/3.44.1: + resolution: {integrity: sha512-4DrCEJoBvdR689efHNSxIQn2pnFwB7E7j2yLEJtHE/P8hxwZWIphCtJ8are7bjl/iVMlcEf5uh5pJ68IwR09vQ==} + engines: {node: '>= 8'} + dev: true + /term-size/1.2.0: resolution: {integrity: sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=} engines: {node: '>=4'} @@ -3342,6 +3440,30 @@ packages: spdx-expression-parse: 3.0.1 dev: true + /vite/2.6.13: + resolution: {integrity: sha512-+tGZ1OxozRirTudl4M3N3UTNJOlxdVo/qBl2IlDEy/ZpTFcskp+k5ncNjayR3bRYTCbqSOFz2JWGN1UmuDMScA==} + engines: {node: '>=12.2.0'} + hasBin: true + peerDependencies: + less: '*' + sass: '*' + stylus: '*' + peerDependenciesMeta: + less: + optional: true + sass: + optional: true + stylus: + optional: true + dependencies: + esbuild: 0.13.12 + postcss: 8.3.11 + resolve: 1.20.0 + rollup: 2.58.3 + optionalDependencies: + fsevents: 2.3.2 + dev: true + /wcwidth/1.0.1: resolution: {integrity: sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=} dependencies: