diff --git a/.changeset/config.json b/.changeset/config.json index f5931cd9d..8f2d28c59 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -6,5 +6,5 @@ "access": "public", "baseBranch": "main", "updateInternalDependencies": "patch", - "ignore": [] + "ignore": ["website", "@kitql-old/all-in"] } diff --git a/.changeset/polite-walls-film.md b/.changeset/polite-walls-film.md new file mode 100644 index 000000000..e5a8444c7 --- /dev/null +++ b/.changeset/polite-walls-film.md @@ -0,0 +1,7 @@ +--- +'vite-plugin-watch-and-run': minor +'@kitql/handles': minor +'@kitql/helper': minor +--- + +new way to release & internal refacto diff --git a/.changeset/pre.json b/.changeset/pre.json new file mode 100644 index 000000000..b1b9743aa --- /dev/null +++ b/.changeset/pre.json @@ -0,0 +1,12 @@ +{ + "mode": "pre", + "tag": "exp", + "initialVersions": { + "@kitql-old/all-in": "0.9.6", + "@kitql/handles": "0.0.3", + "@kitql/helper": "0.7.1", + "vite-plugin-watch-and-run": "1.2.1", + "website": "1.1.2" + }, + "changesets": [] +} diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 711a89252..bca93eae8 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -29,7 +29,7 @@ module.exports = { ], plugins: ['svelte3'], overrides: [ - { files: ['*.svelte'], processor: 'svelte3/svelte3' }, + // { files: ['*.svelte'], processor: 'svelte3/svelte3' }, // { // files: ['packages/helper/*.ts'], // parserOptions: { project: ['packages/helper/tsconfig.json'] }, diff --git a/.gitignore b/.gitignore index aff2c5018..2184876ee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,8 @@ node_modules/ dist/ -.bob/ tsconfig.tsbuildinfo coverage/ .next/ .idea/ .svelte-kit/ -.husky/_/ .env \ No newline at end of file diff --git a/.husky/pre-push b/.husky/pre-push deleted file mode 100755 index 75fac8e18..000000000 --- a/.husky/pre-push +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - -npm run lint diff --git a/.prettierignore b/.prettierignore index 4e673e694..273d59d72 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,11 +1,9 @@ node_modules/ dist/ -.bob/ coverage/ .next/ .idea/ .svelte-kit/ -.husky/_/ pnpm-lock.yaml .changeset/ website/docs/**/*.mdx @@ -13,7 +11,7 @@ README.md CHANGELOG.md package.json build -packages/helper/src/safe-stable-stringify/tmp.ts $houdini -$kitql \ No newline at end of file +$kitql +stats.html \ No newline at end of file diff --git a/package.json b/package.json index 75b6ac521..4018bcea4 100644 --- a/package.json +++ b/package.json @@ -2,20 +2,17 @@ "name": "kitql", "version": "0.0.1", "author": "jycouet ", - "private": true, "license": "MIT", "type": "module", "scripts": { - "prepare": "husky install", "dev:w": "cd website && npm run dev", - "test": "vitest --coverage", "lint": "eslint --ignore-path .prettierignore .", "format": "prettier --write --list-different .", "format:check": "prettier --check .", - "test:ci": "vitest run --coverage", - "test:update-badge": "npm run update-badge", + "test": "pnpm -F !website test", + "test:ci": "pnpm -F !website test", "prebuild": "rimraf packages/*/dist", - "build": "bob build && pnpm --filter @kitql/handles build", + "build": "pnpm -F !website build", "release:version": "npm run changeset version", "release": "npm run build && changeset publish", "reset": "git clean -xdf", @@ -28,20 +25,17 @@ "@theguild/prettier-config": "1.1.3", "@trivago/prettier-plugin-sort-imports": "^4.1.1", "@vitest/coverage-c8": "0.31.0", + "@vitest/coverage-v8": "^0.34.6", "@vitest/ui": "0.31.0", "@vue/compiler-sfc": "^3.3.2", - "bob-the-bundler": "7.0.1", "c8": "7.13.0", "check-code-coverage": "1.10.4", "eslint": "8.40.0", - "husky": "8.0.3", "jsdom": "22.0.0", "prettier": "2.8.8", "prettier-plugin-svelte": "2.10.0", "rimraf": "5.0.0", "svelte": "3.59.1", - "svelte2tsx": "0.6.14", - "typescript": "5.0.4", - "vitest": "0.31.0" + "typescript": "5.0.4" } } diff --git a/packages/all-in/package.json b/packages/all-in/package.json index dc7c04d2c..f83dd68b2 100644 --- a/packages/all-in/package.json +++ b/packages/all-in/package.json @@ -1,12 +1,12 @@ { - "name": "@kitql/all-in", + "name": "@kitql-old/all-in", "version": "0.9.6", "license": "MIT", + "private": true, "repository": { "type": "git", "url": "https://github.com/jycouet/kitql", "directory": "packages/all-in" }, - "type": "module", - "bob": false + "type": "module" } \ No newline at end of file diff --git a/packages/handles/.eslintrc.cjs b/packages/handles/.eslintrc.cjs index 6aecf8688..ebc19589f 100644 --- a/packages/handles/.eslintrc.cjs +++ b/packages/handles/.eslintrc.cjs @@ -1,7 +1,13 @@ module.exports = { root: true, - extends: ['eslint:recommended', 'prettier'], - plugins: ['svelte3'], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:svelte/recommended', + 'prettier' + ], + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint'], parserOptions: { sourceType: 'module', ecmaVersion: 2020, @@ -11,5 +17,14 @@ module.exports = { browser: true, es2017: true, node: true - } + }, + overrides: [ + { + files: ['*.svelte'], + parser: 'svelte-eslint-parser', + parserOptions: { + parser: '@typescript-eslint/parser' + } + } + ] }; diff --git a/packages/handles/package.json b/packages/handles/package.json index 2105ee720..939bd7490 100644 --- a/packages/handles/package.json +++ b/packages/handles/package.json @@ -1,64 +1,66 @@ { - "name": "@kitql/handles", - "version": "0.0.3", - "bob": false, - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/jycouet/kitql", - "directory": "packages/handles" - }, - "type": "module", - "scripts": { - "dev": "vite dev", - "build": "svelte-kit sync && vite build && svelte-package && node ./scripts/package.js", - "preview": "vite preview", - "package": "npm run build && publint", - "prepublishOnly": "npm run package", - "check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json", - "check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch", - "test": "playwright test", - "test:unit": "vitest", - "lint": "prettier --plugin-search-dir . --check . && eslint .", - "format": "prettier --plugin-search-dir . --write ." - }, - "exports": { - ".": { - "types": "./dist/index.d.ts", - "svelte": "./dist/index.js" - } - }, - "files": [ - "dist", - "!dist/**/*.test.*", - "!dist/**/*.spec.*" - ], - "peerDependencies": { - "svelte": "^3.54.0" - }, - "devDependencies": { - "@kitql/helper": "workspace:*", - "@playwright/test": "^1.33.0", - "@sveltejs/adapter-node": "^1.3.1", - "@sveltejs/kit": "^1.16.3", - "@sveltejs/package": "^2.0.2", - "publint": "^0.1.9", - "eslint": "^8.40.0", - "eslint-config-prettier": "^8.8.0", - "eslint-plugin-svelte3": "^4.0.0", - "prettier": "^2.8.8", - "prettier-plugin-svelte": "^2.10.0", - "svelte": "^3.59.1", - "svelte-check": "^3.3.2", - "tslib": "^2.5.0", - "typescript": "^5.0.4", - "vite": "^4.3.5", - "vitest": "^0.31.0" - }, - "svelte": "./dist/index.js", - "types": "./dist/index.d.ts", - "publishConfig": { - "directory": "dist", - "access": "public" - } + "name": "@kitql/handles", + "description": "Some useful handles for SvelteKit", + "version": "0.0.3", + "license": "MIT", + "type": "module", + "repository": { + "type": "git", + "url": "https://github.com/jycouet/kitql", + "directory": "packages/handles", + "homepage": "https://github.com/jycouet/kitql/tree/main/packages/handles" + }, + "scripts": { + "prepare": "svelte-kit sync", + "dev": "vite dev", + "build": "vite build && svelte-package && node ../../scripts/package.js", + "preview": "vite preview", + "package": "npm run build && publint", + "prepublishOnly": "npm run package", + "check": "svelte-check --tsconfig ./jsconfig.json", + "check:watch": "svelte-check --tsconfig ./jsconfig.json --watch", + "test": "vitest", + "test:ci": "vitest --coverage", + "lint": "prettier --plugin-search-dir . --check . && eslint .", + "format": "prettier --plugin-search-dir . --write ." + }, + "peerDependencies": { + "@sveltejs/kit": "^1.25.2", + "svelte": "^4.0.0" + }, + "devDependencies": { + "@sveltejs/adapter-node": "1.3.1", + "@sveltejs/kit": "1.25.2", + "@sveltejs/package": "2.2.2", + "publint": "0.1.9", + "eslint": "8.28.0", + "eslint-config-prettier": "8.5.0", + "eslint-plugin-svelte": "2.30.0", + "prettier": "2.8.0", + "prettier-plugin-svelte": "2.10.1", + "svelte": "4.0.5", + "svelte-check": "3.5.2", + "tslib": "2.5.0", + "typescript": "^5.0.4", + "vite": "4.3.5", + "vitest": "0.31.0" + }, + "sideEffects": false, + "publishConfig": { + "directory": "dist", + "access": "public" + }, + "files": [ + "dist", + "!dist/**/*.test.*", + "!dist/**/*.spec.*" + ], + "svelte": "./dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "svelte": "./dist/index.js" + } + } } diff --git a/packages/handles/playwright.config.js b/packages/handles/playwright.config.js deleted file mode 100644 index f0ba5d26b..000000000 --- a/packages/handles/playwright.config.js +++ /dev/null @@ -1,10 +0,0 @@ -/** @type {import('@playwright/test').PlaywrightTestConfig} */ -const config = { - webServer: { - command: 'npm run build && npm run preview', - port: 4173 - }, - testDir: 'tests' -}; - -export default config; diff --git a/packages/handles/scripts/package.js b/packages/handles/scripts/package.js deleted file mode 100644 index 67b10a7a8..000000000 --- a/packages/handles/scripts/package.js +++ /dev/null @@ -1,22 +0,0 @@ -import fs from 'fs'; - -// read file into JSON -const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf-8')); - -// adjust pkg json however you like ... -delete pkg.publishConfig; -delete pkg.bob; -delete pkg.scripts; - -// It's not allowed to have an empty scripts object -pkg.scripts = { - test: 'echo hello!' -}; - -// write it to your output directory -fs.writeFileSync( - './dist/package.json', // path to your output directory may vary - JSON.stringify(pkg, null, 2) -); - -fs.writeFileSync('./dist/README.md', fs.readFileSync('./README.md', 'utf-8')); diff --git a/packages/handles/src/lib/hooks/handleProxies.js b/packages/handles/src/lib/hooks/handleProxies.js index ee0504644..c402f9e08 100644 --- a/packages/handles/src/lib/hooks/handleProxies.js +++ b/packages/handles/src/lib/hooks/handleProxies.js @@ -10,7 +10,7 @@ import { error } from '@sveltejs/kit'; * handleProxies({ proxies: [{ from: "/proxy", to: "http://my.super.website/graphql" }] }), * ); * - * @param {import('./Types.handleProxies.js').handleProxiesOptions} options + * @param {import('./handleProxies.t.js').handleProxiesOptions} options */ export const handleProxies = (options) => { /** @type {import('@sveltejs/kit').Handle} */ diff --git a/packages/handles/src/lib/hooks/Types.handleProxies.ts b/packages/handles/src/lib/hooks/handleProxies.t.ts similarity index 100% rename from packages/handles/src/lib/hooks/Types.handleProxies.ts rename to packages/handles/src/lib/hooks/handleProxies.t.ts diff --git a/packages/handles/src/routes/+layout.svelte b/packages/handles/src/routes/+layout.svelte index 6427b5d0b..a4acaf9a3 100644 --- a/packages/handles/src/routes/+layout.svelte +++ b/packages/handles/src/routes/+layout.svelte @@ -18,7 +18,7 @@
- Home | About + Home
diff --git a/packages/handles/src/routes/about/+page.js b/packages/handles/src/routes/about/+page.js deleted file mode 100644 index b871a90b1..000000000 --- a/packages/handles/src/routes/about/+page.js +++ /dev/null @@ -1,17 +0,0 @@ -import { Log } from '@kitql/helper'; - -/** @type {import('./$types').PageLoad} */ -export async function load() { - const l = new Log('demo', { prefixEmoji: '👋' }); - l.success('Hello success'); - l.error('Hello error'); - l.info('Hello info 0', { level: 0 }); - l.info('Hello info 1', { level: 1 }); - l.info('Hello info 2', { level: 2 }); - l.info('Hello info 3', { level: 3, withSuccess: true }); - l.info('Hello info 2', { level: 2 }); - l.info('Hello info 1', { level: 1 }); - l.info('Hello info 0', { level: 0 }); - - return {}; -} diff --git a/packages/handles/src/routes/about/+page.svelte b/packages/handles/src/routes/about/+page.svelte deleted file mode 100644 index a856382d2..000000000 --- a/packages/handles/src/routes/about/+page.svelte +++ /dev/null @@ -1 +0,0 @@ -

About

diff --git a/packages/handles/tests/test.js b/packages/handles/tests/test.js deleted file mode 100644 index 5816be413..000000000 --- a/packages/handles/tests/test.js +++ /dev/null @@ -1,6 +0,0 @@ -import { expect, test } from '@playwright/test'; - -test('index page has expected h1', async ({ page }) => { - await page.goto('/'); - await expect(page.getByRole('heading', { name: 'Welcome to SvelteKit' })).toBeVisible(); -}); diff --git a/packages/handles/vite.config.js b/packages/handles/vite.config.js index afc1d9bf0..103e474f1 100644 --- a/packages/handles/vite.config.js +++ b/packages/handles/vite.config.js @@ -3,7 +3,6 @@ import { defineConfig } from 'vitest/config'; export default defineConfig({ plugins: [sveltekit()], - ssr: { noExternal: ['safe-stable-stringify'] }, resolve: { preserveSymlinks: true }, diff --git a/packages/helper/.gitignore b/packages/helper/.gitignore new file mode 100644 index 000000000..217016b81 --- /dev/null +++ b/packages/helper/.gitignore @@ -0,0 +1,13 @@ +.DS_Store +node_modules +/build +/dist +/.svelte-kit +/package +.env +.env.* +!.env.example +vite.config.js.timestamp-* +vite.config.ts.timestamp-* + +stats.html \ No newline at end of file diff --git a/packages/helper/.npmrc b/packages/helper/.npmrc new file mode 100644 index 000000000..b6f27f135 --- /dev/null +++ b/packages/helper/.npmrc @@ -0,0 +1 @@ +engine-strict=true diff --git a/packages/helper/package.json b/packages/helper/package.json index a7e95ea6a..45c267334 100644 --- a/packages/helper/package.json +++ b/packages/helper/package.json @@ -1,47 +1,55 @@ { "name": "@kitql/helper", + "description": "Some useful helpers", "version": "0.7.1", + "license": "MIT", + "type": "module", "repository": { "type": "git", "url": "https://github.com/jycouet/kitql", - "directory": "packages/helper" + "directory": "packages/helper", + "homepage": "https://github.com/jycouet/kitql/tree/main/packages/helper" }, - "type": "module", - "license": "MIT", "scripts": { - "build": "bob runify --single" + "prepare": "svelte-kit sync", + "dev": "vite dev", + "build": "vite build && svelte-package && node ../../scripts/package.js", + "preview": "vite preview", + "package": "svelte-package && publint", + "prepublishOnly": "npm run package", + "check": "svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch", + "test": "vitest", + "test:ci": "vitest --coverage" }, - "dependencies": { - "safe-stable-stringify": "^2.4.3" + "peerDependencies": { + "svelte": "^4.0.0" }, "devDependencies": { - "tslib": "^2.5.0" - }, - "main": "dist/cjs/index.js", - "module": "dist/esm/index.js", - "exports": { - ".": { - "require": { - "types": "./dist/typings/index.d.cts", - "default": "./dist/cjs/index.js" - }, - "import": { - "types": "./dist/typings/index.d.ts", - "default": "./dist/esm/index.js" - }, - "default": { - "types": "./dist/typings/index.d.ts", - "default": "./dist/esm/index.js" - } - }, - "./package.json": "./package.json" - }, - "typings": "dist/typings/index.d.ts", - "typescript": { - "definition": "dist/typings/index.d.ts" + "@sveltejs/adapter-auto": "2.0.0", + "@sveltejs/kit": "1.25.2", + "@sveltejs/package": "2.2.2", + "esm-env": "^1.0.0", + "publint": "0.1.9", + "rollup-plugin-visualizer": "^5.9.2", + "svelte": "4.0.5", + "svelte-check": "3.5.2", + "tslib": "2.4.1", + "typescript": "^5.0.0", + "vite": "4.4.2", + "vitest": "0.34.0" }, + "sideEffects": false, "publishConfig": { "directory": "dist", "access": "public" + }, + "svelte": "./dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "svelte": "./dist/index.js" + } } -} +} \ No newline at end of file diff --git a/packages/helper/src/app.d.ts b/packages/helper/src/app.d.ts new file mode 100644 index 000000000..0425013af --- /dev/null +++ b/packages/helper/src/app.d.ts @@ -0,0 +1,12 @@ +// See https://kit.svelte.dev/docs/types#app +// for information about these interfaces +declare global { + namespace App { + // interface Error {} + // interface Locals {} + // interface PageData {} + // interface Platform {} + } +} + +export {} diff --git a/packages/helper/src/app.html b/packages/helper/src/app.html new file mode 100644 index 000000000..85d6c8f6b --- /dev/null +++ b/packages/helper/src/app.html @@ -0,0 +1,12 @@ + + + + + + + %sveltekit.head% + + +
%sveltekit.body%
+ + diff --git a/packages/helper/src/index.test.ts b/packages/helper/src/index.test.ts new file mode 100644 index 000000000..31ae14297 --- /dev/null +++ b/packages/helper/src/index.test.ts @@ -0,0 +1,7 @@ +import { describe, expect, it } from 'vitest' + +describe('sum test', () => { + it('adds 1 + 2 to equal 3', () => { + expect(1 + 2).toBe(3) + }) +}) diff --git a/packages/helper/test/Log.spec.ts b/packages/helper/src/lib/Log.spec.ts similarity index 90% rename from packages/helper/test/Log.spec.ts rename to packages/helper/src/lib/Log.spec.ts index f7b176984..27ca7552d 100644 --- a/packages/helper/test/Log.spec.ts +++ b/packages/helper/src/lib/Log.spec.ts @@ -1,3 +1,4 @@ +import * as constants from 'esm-env' import { beforeEach, describe, expect, it, vi } from 'vitest' import { @@ -8,26 +9,18 @@ import { gray, green, italic, - Log, magenta, red, strikethrough, - stry, white, yellow, -} from '../src' +} from './colors/index.js' +import { Log } from './Log.js' +import { stry0 } from './stry/stry.js' -// helper -function fakeIsBrowser() { - vi.stubGlobal('window', { document: 'coucou' }) -} +vi.mock('esm-env') describe('kitql - helper - Log', () => { - beforeEach(() => { - vi.stubGlobal('window', undefined) - vi.clearAllMocks() - }) - it('Minimal config', () => { const log = new Log('tool name') expect(log).to.have.property('toolName', 'tool name') @@ -110,14 +103,14 @@ describe('kitql - helper - Log', () => { const result = log.info(msg) expect(spy).toHaveBeenCalledOnce() - expect(stry(result, 0)).toMatchInlineSnapshot( + expect(stry0(result)).toMatchInlineSnapshot( '"[\\"\\\\u001b[35m[tool name]\\\\u001b[39m with all colors: \\\\n \\\\u001b[30mblack\\\\u001b[39m, \\\\n \\\\u001b[31mred\\\\u001b[39m, \\\\n \\\\u001b[32mgreen\\\\u001b[39m, \\\\n \\\\u001b[33myellow\\\\u001b[39m\\\\n \\\\u001b[34mblue\\\\u001b[39m\\\\n \\\\u001b[35mmagenta\\\\u001b[39m, \\\\n \\\\u001b[36mcyan\\\\u001b[39m \\\\n \\\\u001b[37mwhite\\\\u001b[39m \\\\n \\\\u001b[90mgray\\\\u001b[39m \\\\n \\\\u001b[1mbold\\\\u001b[22m \\\\n \\\\u001b[3mitalic\\\\u001b[23m \\\\n \\\\u001b[9mstrikethrough\\\\u001b[29m \\\\n \\"]"', ) }) it('with all colors browser', () => { - fakeIsBrowser() - + // @ts-ignore + constants.BROWSER = true const log = new Log('tool name') const msg = `with all colors: @@ -135,7 +128,7 @@ describe('kitql - helper - Log', () => { ${strikethrough('strikethrough')} ` - const result = log.info(msg, { browser: true }) + const result = log.info(msg) expect(result).toMatchInlineSnapshot( ` @@ -219,6 +212,8 @@ describe('kitql - helper - Log', () => { }) it('with 2 red', () => { + // @ts-ignore + constants.BROWSER = false const log = new Log('tool name') expect(log).to.have.property('toolName', 'tool name') @@ -227,19 +222,19 @@ describe('kitql - helper - Log', () => { const result = log.info(msg) expect(spy).toHaveBeenCalledOnce() - expect(stry(result, 0)).toMatchInlineSnapshot( + expect(stry0(result)).toMatchInlineSnapshot( '"[\\"\\\\u001b[35m[tool name]\\\\u001b[39m with red: \\\\u001b[31mred\\\\u001b[39m and another \\\\u001b[31mred2\\\\u001b[39m\\"]"', ) }) it('with 2 red browser', () => { - fakeIsBrowser() - + // @ts-ignore + constants.BROWSER = true const log = new Log('tool name') const msg = `with red: ${red('red')} and another ${red('red2')}` - const result = log.info(msg, { browser: true }) + const result = log.info(msg) expect(result).toMatchInlineSnapshot(` [ @@ -254,19 +249,11 @@ describe('kitql - helper - Log', () => { `) }) - it('are we NOT in the browser?', () => { - const log = new Log('tool name') - - expect(log).to.have.property('isBrowser', false) - }) - it('are we in the browser?', () => { - fakeIsBrowser() - + // @ts-ignore + constants.BROWSER = true const log = new Log('tool name') - expect(log).to.have.property('isBrowser', true) - const msg = `with red: ${red('red')} and another ${red('red2')}` // no need to put browser: true! it's detected with this.windows const result = log.info(msg) diff --git a/packages/helper/src/Log.ts b/packages/helper/src/lib/Log.ts similarity index 69% rename from packages/helper/src/Log.ts rename to packages/helper/src/lib/Log.ts index 261fdd6fc..eae9e0a01 100644 --- a/packages/helper/src/Log.ts +++ b/packages/helper/src/lib/Log.ts @@ -1,4 +1,4 @@ -import { bold, colorBrowserProcess, greenBright, magenta, redBright } from './colors/index.js' +import { bold, colorProcess, greenBright, magenta, redBright } from './colors/index.js' export class Log { private toolName: string @@ -6,10 +6,6 @@ export class Log { private withDate: null | 'dateTime' | 'time' private prefixEmoji: string - get isBrowser() { - return typeof window !== 'undefined' && typeof window.document !== 'undefined' - } - constructor( toolName: string, options?: { @@ -24,13 +20,7 @@ export class Log { this.prefixEmoji = options?.prefixEmoji ?? '' } - private buildStr( - msg: string, - withError: boolean, - withSuccess: boolean, - indent: string, - browser: boolean, - ) { + private buildStr(msg: string, withError: boolean, withSuccess: boolean, indent: string) { const table = [] if (this.toolName) { table.push(String(magenta(`[${this.toolName}]`))) @@ -62,37 +52,32 @@ export class Log { const str = table.join('') - if (browser) { - return colorBrowserProcess(str) - } + return colorProcess(str) // wrap it because we always unwrap after ;) return [str] } - info(msg: string, conf?: { level?: number; withSuccess?: boolean; browser?: boolean }) { + info(msg: string, conf?: { level?: number; withSuccess?: boolean }) { const level = conf?.level ?? 0 const withSuccess = conf?.withSuccess ?? false - const browser = conf?.browser ?? this.isBrowser if (this.levelsToShow !== null && level <= this.levelsToShow) { const indent = ' '.repeat(level) - const built = this.buildStr(msg, false, withSuccess, indent, browser) + const built = this.buildStr(msg, false, withSuccess, indent) console.info(...built) return built } return null } - success(msg: string, conf?: { level?: number; browser?: boolean }) { + success(msg: string, conf?: { level?: number }) { const level = conf?.level ?? 0 - const browser = conf?.browser ?? this.isBrowser - return this.info(msg, { level, withSuccess: true, browser }) + return this.info(msg, { level, withSuccess: true }) } - error(msg: string, conf?: { browser?: boolean }) { - const browser = conf?.browser ?? this.isBrowser - const built = this.buildStr(msg, true, false, '', browser) + error(msg: string) { + const built = this.buildStr(msg, true, false, '') // Keep error to have the stacktrace in the browser console.error(...built) return built diff --git a/packages/helper/src/Prettify.ts b/packages/helper/src/lib/Prettify.ts similarity index 100% rename from packages/helper/src/Prettify.ts rename to packages/helper/src/lib/Prettify.ts diff --git a/packages/helper/src/lib/colors/colors.spec.ts b/packages/helper/src/lib/colors/colors.spec.ts new file mode 100644 index 000000000..3a11c2d3e --- /dev/null +++ b/packages/helper/src/lib/colors/colors.spec.ts @@ -0,0 +1,347 @@ +import * as constants from 'esm-env' +import { expect, it, vi } from 'vitest' + +import { color, colorProcess, red } from './index.js' + +vi.mock('esm-env') + +it('color NOT in browser', () => { + // @ts-ignore + constants.BROWSER = false + + const message = `with all options: +${color('reset', 'reset')} +${color('bold', 'bold')} +${color('dim', 'dim')} +${color('italic', 'italic')} +${color('underline', 'underline')} +${color('inverse', 'inverse')} +${color('hidden', 'hidden')} +${color('strikethrough', 'strikethrough')} +${color('black', 'black')} +${color('red', 'red')} +${color('green', 'green')} +${color('yellow', 'yellow')} +${color('blue', 'blue')} +${color('magenta', 'magenta')} +${color('cyan', 'cyan')} +${color('white', 'white')} +${color('gray', 'gray')} +${color('bgBlack', 'bgBlack')} +${color('bgRed', 'bgRed')} +${color('bgGreen', 'bgGreen')} +${color('bgYellow', 'bgYellow')} +${color('bgBlue', 'bgBlue')} +${color('bgMagenta', 'bgMagenta')} +${color('bgCyan', 'bgCyan')} +${color('bgWhite', 'bgWhite')} +${color('blackBright', 'blackBright')} +${color('redBright', 'redBright')} +${color('greenBright', 'greenBright')} +${color('yellowBright', 'yellowBright')} +${color('blueBright', 'blueBright')} +${color('magentaBright', 'magentaBright')} +${color('cyanBright', 'cyanBright')} +${color('whiteBright', 'whiteBright')} +${color('bgBlackBright', 'bgBlackBright')} +${color('bgRedBright', 'bgRedBright')} +${color('bgGreenBright', 'bgGreenBright')} +${color('bgYellowBright', 'bgYellowBright')} +${color('bgBlueBright', 'bgBlueBright')} +${color('bgMagentaBright', 'bgMagentaBright')} +${color('bgCyanBright', 'bgCyanBright')} +${color('bgWhiteBright', 'bgWhiteBright')} +` + // console.log(`msg`, message) + expect(message).toMatchInlineSnapshot(` + "with all options: + reset + bold + dim + italic + underline + inverse + hidden + strikethrough + black + red + green + yellow + blue + magenta + cyan + white + gray + bgBlack + bgRed + bgGreen + bgYellow + bgBlue + bgMagenta + bgCyan + bgWhite + blackBright + redBright + greenBright + yellowBright + blueBright + magentaBright + cyanBright + whiteBright + bgBlackBright + bgRedBright + bgGreenBright + bgYellowBright + bgBlueBright + bgMagentaBright + bgCyanBright + bgWhiteBright + " + `) +}) + +it('color in browser', () => { + // @ts-ignore + constants.BROWSER = true + + const message = `with all options: +${color('reset', 'reset')} +${color('bold', 'bold')} +${color('dim', 'dim')} +${color('italic', 'italic')} +${color('underline', 'underline')} +${color('inverse', 'inverse')} +${color('hidden', 'hidden')} +${color('strikethrough', 'strikethrough')} +${color('black', 'black')} +${color('red', 'red')} +${color('green', 'green')} +${color('yellow', 'yellow')} +${color('blue', 'blue')} +${color('magenta', 'magenta')} +${color('cyan', 'cyan')} +${color('white', 'white')} +${color('gray', 'gray')} +${color('bgBlack', 'bgBlack')} +${color('bgRed', 'bgRed')} +${color('bgGreen', 'bgGreen')} +${color('bgYellow', 'bgYellow')} +${color('bgBlue', 'bgBlue')} +${color('bgMagenta', 'bgMagenta')} +${color('bgCyan', 'bgCyan')} +${color('bgWhite', 'bgWhite')} +${color('blackBright', 'blackBright')} +${color('redBright', 'redBright')} +${color('greenBright', 'greenBright')} +${color('yellowBright', 'yellowBright')} +${color('blueBright', 'blueBright')} +${color('magentaBright', 'magentaBright')} +${color('cyanBright', 'cyanBright')} +${color('whiteBright', 'whiteBright')} +${color('bgBlackBright', 'bgBlackBright')} +${color('bgRedBright', 'bgRedBright')} +${color('bgGreenBright', 'bgGreenBright')} +${color('bgYellowBright', 'bgYellowBright')} +${color('bgBlueBright', 'bgBlueBright')} +${color('bgMagentaBright', 'bgMagentaBright')} +${color('bgCyanBright', 'bgCyanBright')} +${color('bgWhiteBright', 'bgWhiteBright')} +` + // console.log(`msg`, message) + expect(message).toMatchInlineSnapshot(` + "with all options: + $$KitQL_reset_KitQL$$reset$$KitQLEND$$ + $$KitQL_bold_KitQL$$bold$$KitQLEND$$ + $$KitQL_dim_KitQL$$dim$$KitQLEND$$ + $$KitQL_italic_KitQL$$italic$$KitQLEND$$ + $$KitQL_underline_KitQL$$underline$$KitQLEND$$ + $$KitQL_inverse_KitQL$$inverse$$KitQLEND$$ + $$KitQL_hidden_KitQL$$hidden$$KitQLEND$$ + $$KitQL_strikethrough_KitQL$$strikethrough$$KitQLEND$$ + $$KitQL_black_KitQL$$black$$KitQLEND$$ + $$KitQL_red_KitQL$$red$$KitQLEND$$ + $$KitQL_green_KitQL$$green$$KitQLEND$$ + $$KitQL_yellow_KitQL$$yellow$$KitQLEND$$ + $$KitQL_blue_KitQL$$blue$$KitQLEND$$ + $$KitQL_magenta_KitQL$$magenta$$KitQLEND$$ + $$KitQL_cyan_KitQL$$cyan$$KitQLEND$$ + $$KitQL_white_KitQL$$white$$KitQLEND$$ + $$KitQL_gray_KitQL$$gray$$KitQLEND$$ + $$KitQL_bgBlack_KitQL$$bgBlack$$KitQLEND$$ + $$KitQL_bgRed_KitQL$$bgRed$$KitQLEND$$ + $$KitQL_bgGreen_KitQL$$bgGreen$$KitQLEND$$ + $$KitQL_bgYellow_KitQL$$bgYellow$$KitQLEND$$ + $$KitQL_bgBlue_KitQL$$bgBlue$$KitQLEND$$ + $$KitQL_bgMagenta_KitQL$$bgMagenta$$KitQLEND$$ + $$KitQL_bgCyan_KitQL$$bgCyan$$KitQLEND$$ + $$KitQL_bgWhite_KitQL$$bgWhite$$KitQLEND$$ + $$KitQL_blackBright_KitQL$$blackBright$$KitQLEND$$ + $$KitQL_redBright_KitQL$$redBright$$KitQLEND$$ + $$KitQL_greenBright_KitQL$$greenBright$$KitQLEND$$ + $$KitQL_yellowBright_KitQL$$yellowBright$$KitQLEND$$ + $$KitQL_blueBright_KitQL$$blueBright$$KitQLEND$$ + $$KitQL_magentaBright_KitQL$$magentaBright$$KitQLEND$$ + $$KitQL_cyanBright_KitQL$$cyanBright$$KitQLEND$$ + $$KitQL_whiteBright_KitQL$$whiteBright$$KitQLEND$$ + $$KitQL_bgBlackBright_KitQL$$bgBlackBright$$KitQLEND$$ + $$KitQL_bgRedBright_KitQL$$bgRedBright$$KitQLEND$$ + $$KitQL_bgGreenBright_KitQL$$bgGreenBright$$KitQLEND$$ + $$KitQL_bgYellowBright_KitQL$$bgYellowBright$$KitQLEND$$ + $$KitQL_bgBlueBright_KitQL$$bgBlueBright$$KitQLEND$$ + $$KitQL_bgMagentaBright_KitQL$$bgMagentaBright$$KitQLEND$$ + $$KitQL_bgCyanBright_KitQL$$bgCyanBright$$KitQLEND$$ + $$KitQL_bgWhiteBright_KitQL$$bgWhiteBright$$KitQLEND$$ + " + `) + + expect(colorProcess(message)).toMatchInlineSnapshot(` + [ + "with all options: + %creset%c + %cbold%c + %cdim%c + %citalic%c + %cunderline%c + %cinverse%c + %chidden%c + %cstrikethrough%c + %cblack%c + %cred%c + %cgreen%c + %cyellow%c + %cblue%c + %cmagenta%c + %ccyan%c + %cwhite%c + %cgray%c + %cbgBlack%c + %cbgRed%c + %cbgGreen%c + %cbgYellow%c + %cbgBlue%c + %cbgMagenta%c + %cbgCyan%c + %cbgWhite%c + %cblackBright%c + %credBright%c + %cgreenBright%c + %cyellowBright%c + %cblueBright%c + %cmagentaBright%c + %ccyanBright%c + %cwhiteBright%c + %cbgBlackBright%c + %cbgRedBright%c + %cbgGreenBright%c + %cbgYellowBright%c + %cbgBlueBright%c + %cbgMagentaBright%c + %cbgCyanBright%c + %cbgWhiteBright%c + ", + "", + "", + "font-weight: bold", + "", + "opacity: 0.5", + "", + "font-style: italic", + "", + "text-decoration: underline", + "", + "filter: invert(1)", + "", + "visibility: hidden", + "", + "text-decoration: line-through", + "", + "color: black", + "", + "color: red", + "", + "color: green", + "", + "color: yellow", + "", + "color: blue", + "", + "color: #ff00ff", + "", + "color: cyan", + "", + "color: white", + "", + "color: gray", + "", + "background-color: black", + "", + "background-color: red", + "", + "background-color: green", + "", + "background-color: yellow", + "", + "background-color: blue", + "", + "background-color: #ff00ff", + "", + "background-color: cyan", + "", + "background-color: white", + "", + "color: #a9a9a9", + "", + "color: #ff4500", + "", + "color: #7fff00", + "", + "color: #ffd700", + "", + "color: #1e90ff", + "", + "color: #ff69b4", + "", + "color: #00ffff", + "", + "color: #ffffff", + "", + "background-color: #a9a9a9", + "", + "background-color: #ff4500", + "", + "background-color: #7fff00", + "", + "background-color: #ffd700", + "", + "background-color: #1e90ff", + "", + "background-color: #ff69b4", + "", + "background-color: #00ffff", + "", + "background-color: #ffffff", + "", + ] + `) +}) + +it('2 color red browser', () => { + // @ts-ignore + constants.BROWSER = true + + const msg = `with red: ${red('red')} and another ${red('red2')}` + + expect(msg).toMatchInlineSnapshot( + '"with red: $$KitQL_red_KitQL$$red$$KitQLEND$$ and another $$KitQL_red_KitQL$$red2$$KitQLEND$$"', + ) + + expect(colorProcess(msg)).toMatchInlineSnapshot(` + [ + "with red: %cred%c and another %cred2%c", + "color: red", + "", + "color: red", + "", + ] + `) +}) diff --git a/packages/helper/src/colors/index.ts b/packages/helper/src/lib/colors/index.ts similarity index 91% rename from packages/helper/src/colors/index.ts rename to packages/helper/src/lib/colors/index.ts index 9f37b70cb..282b490d2 100644 --- a/packages/helper/src/colors/index.ts +++ b/packages/helper/src/lib/colors/index.ts @@ -1,3 +1,5 @@ +import { BROWSER } from 'esm-env' + import * as stylesBrowser from './stylesBrowser.js' import * as stylesNode from './stylesNode.js' import type { Style } from './types.js' @@ -12,13 +14,8 @@ const getStyleNode = (styleKey: string) => { return stylesNode[styleKey] ?? undefined } -export const color = (style: Style, str: string, isBrowser?: boolean) => { - const isBrowserToUse = - // if undefined... Then we try to be smart ;) - isBrowser === undefined - ? typeof window !== 'undefined' && typeof window.document !== 'undefined' - : isBrowser - return isBrowserToUse ? colorBrowserPrepare(style, str) : colorNode(style, str) +export const color = (style: Style, str: string) => { + return BROWSER ? colorBrowser(style, str) : colorNode(style, str) } const colorNode = (style: Style, str: string) => { @@ -28,7 +25,7 @@ const colorNode = (style: Style, str: string) => { const START1 = `$$KitQL_` const START2 = `_KitQL$$` const END = `$$KitQLEND$$` -const colorBrowserPrepare = (style: Style, str: string) => { +const colorBrowser = (style: Style, str: string) => { return `${START1}${style}${START2}${str}${END}` } @@ -44,7 +41,23 @@ function extractKitQLTags(str: string) { return results } -export const colorBrowserProcess = (str: string) => { +const getAllIndexOf = (str: string, subStr: string) => { + let lastIndex = 0 + const indexes = [] + while (lastIndex !== -1) { + lastIndex = str.indexOf(subStr, lastIndex) + if (lastIndex !== -1) { + indexes.push(lastIndex) + lastIndex += subStr.length + } + } + return indexes +} + +export const colorProcess = (str: string) => { + if (!BROWSER) { + return [str] + } const originalStr = str const posToReplace: { index: number; browser: string }[] = [] @@ -75,19 +88,6 @@ export const colorBrowserProcess = (str: string) => { return [str, ...colors] } -const getAllIndexOf = (str: string, subStr: string) => { - let lastIndex = 0 - const indexes = [] - while (lastIndex !== -1) { - lastIndex = str.indexOf(subStr, lastIndex) - if (lastIndex !== -1) { - indexes.push(lastIndex) - lastIndex += subStr.length - } - } - return indexes -} - // export const reset = (str: string) => { diff --git a/packages/helper/src/colors/stylesBrowser.ts b/packages/helper/src/lib/colors/stylesBrowser.ts similarity index 100% rename from packages/helper/src/colors/stylesBrowser.ts rename to packages/helper/src/lib/colors/stylesBrowser.ts diff --git a/packages/helper/src/colors/stylesNode.ts b/packages/helper/src/lib/colors/stylesNode.ts similarity index 100% rename from packages/helper/src/colors/stylesNode.ts rename to packages/helper/src/lib/colors/stylesNode.ts diff --git a/packages/helper/src/colors/types.ts b/packages/helper/src/lib/colors/types.ts similarity index 100% rename from packages/helper/src/colors/types.ts rename to packages/helper/src/lib/colors/types.ts diff --git a/packages/helper/src/index.ts b/packages/helper/src/lib/index.ts similarity index 92% rename from packages/helper/src/index.ts rename to packages/helper/src/lib/index.ts index d8f8efb97..0a9e77da8 100644 --- a/packages/helper/src/index.ts +++ b/packages/helper/src/lib/index.ts @@ -1,7 +1,8 @@ -export { Log } from './Log.js' +export type { Prettify } from './Prettify.js' export { sleep } from './sleep.js' -export { stry, stry0, stryEq } from './stry.js' +export { stry, stry0, stryEq } from './stry/stry.js' +export { Log } from './Log.js' export { bgBlack, bgBlackBright, @@ -45,5 +46,3 @@ export { yellow, yellowBright, } from './colors/index.js' - -export type { Prettify } from './Prettify.js' diff --git a/packages/helper/test/sleep.spec.ts b/packages/helper/src/lib/sleep.spec.ts similarity index 84% rename from packages/helper/test/sleep.spec.ts rename to packages/helper/src/lib/sleep.spec.ts index 73f314379..b728eda6d 100644 --- a/packages/helper/test/sleep.spec.ts +++ b/packages/helper/src/lib/sleep.spec.ts @@ -1,6 +1,6 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest' +import { describe, expect, it } from 'vitest' -import { sleep } from '../src/sleep' +import { sleep } from './sleep.js' describe('kitql - helper - sleep', () => { it('No time', async () => { diff --git a/packages/helper/src/sleep.ts b/packages/helper/src/lib/sleep.ts similarity index 100% rename from packages/helper/src/sleep.ts rename to packages/helper/src/lib/sleep.ts diff --git a/packages/helper/src/safe-stable-stringify/tmp.ts b/packages/helper/src/lib/stry/safe-stable-stringify.ts similarity index 96% rename from packages/helper/src/safe-stable-stringify/tmp.ts rename to packages/helper/src/lib/stry/safe-stable-stringify.ts index 725874c1a..1fb058d27 100644 --- a/packages/helper/src/safe-stable-stringify/tmp.ts +++ b/packages/helper/src/lib/stry/safe-stable-stringify.ts @@ -11,8 +11,8 @@ const stringify = configure() export { configure, stringify } -// eslint-disable-next-line no-control-regex const strEscapeSequencesRegExp = + // eslint-disable-next-line no-control-regex /[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/ // Escape C0 control characters, double quotes, the backslash and every code @@ -180,7 +180,7 @@ function configure(options) { if (value === null) { return 'null' } - if (stack.indexOf(value) !== -1) { + if (stack.includes(value)) { return circularValue } @@ -205,11 +205,11 @@ function configure(options) { let i = 0 for (; i < maximumValuesToStringify - 1; i++) { const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation) - res += tmp !== undefined ? tmp : 'null' + res += tmp === undefined ? 'null' : tmp res += join } const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation) - res += tmp !== undefined ? tmp : 'null' + res += tmp === undefined ? 'null' : tmp if (value.length - 1 > maximumBreadth) { const removedKeys = value.length - maximumBreadth - 1 res += `${join}"... ${getItemCount(removedKeys)} not stringified"` @@ -288,7 +288,7 @@ function configure(options) { if (value === null) { return 'null' } - if (stack.indexOf(value) !== -1) { + if (stack.includes(value)) { return circularValue } @@ -320,7 +320,7 @@ function configure(options) { spacer, indentation, ) - res += tmp !== undefined ? tmp : 'null' + res += tmp === undefined ? 'null' : tmp res += join } const tmp = stringifyArrayReplacer( @@ -331,7 +331,7 @@ function configure(options) { spacer, indentation, ) - res += tmp !== undefined ? tmp : 'null' + res += tmp === undefined ? 'null' : tmp if (value.length - 1 > maximumBreadth) { const removedKeys = value.length - maximumBreadth - 1 res += `${join}"... ${getItemCount(removedKeys)} not stringified"` @@ -397,7 +397,7 @@ function configure(options) { return 'null' } } - if (stack.indexOf(value) !== -1) { + if (stack.includes(value)) { return circularValue } const originalIndentation = indentation @@ -417,11 +417,11 @@ function configure(options) { let i = 0 for (; i < maximumValuesToStringify - 1; i++) { const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation) - res += tmp !== undefined ? tmp : 'null' + res += tmp === undefined ? 'null' : tmp res += join } const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation) - res += tmp !== undefined ? tmp : 'null' + res += tmp === undefined ? 'null' : tmp if (value.length - 1 > maximumBreadth) { const removedKeys = value.length - maximumBreadth - 1 res += `${join}"... ${getItemCount(removedKeys)} not stringified"` @@ -507,7 +507,7 @@ function configure(options) { return 'null' } } - if (stack.indexOf(value) !== -1) { + if (stack.includes(value)) { return circularValue } @@ -525,11 +525,11 @@ function configure(options) { let i = 0 for (; i < maximumValuesToStringify - 1; i++) { const tmp = stringifySimple(String(i), value[i], stack) - res += tmp !== undefined ? tmp : 'null' + res += tmp === undefined ? 'null' : tmp res += ',' } const tmp = stringifySimple(String(i), value[i], stack) - res += tmp !== undefined ? tmp : 'null' + res += tmp === undefined ? 'null' : tmp if (value.length - 1 > maximumBreadth) { const removedKeys = value.length - maximumBreadth - 1 res += `,"... ${getItemCount(removedKeys)} not stringified"` diff --git a/packages/helper/test/stry.spec.ts b/packages/helper/src/lib/stry/stry.spec.ts similarity index 98% rename from packages/helper/test/stry.spec.ts rename to packages/helper/src/lib/stry/stry.spec.ts index bec2d901c..d9aeda320 100644 --- a/packages/helper/test/stry.spec.ts +++ b/packages/helper/src/lib/stry/stry.spec.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' -import { stry } from '../src/stry' +import { stry } from './stry.js' describe('kitql - helper - stry', () => { it('space 2', () => { diff --git a/packages/helper/src/stry.ts b/packages/helper/src/lib/stry/stry.ts similarity index 93% rename from packages/helper/src/stry.ts rename to packages/helper/src/lib/stry/stry.ts index 8c73049a9..4ff783b99 100644 --- a/packages/helper/src/stry.ts +++ b/packages/helper/src/lib/stry/stry.ts @@ -1,7 +1,7 @@ /** * Using https://github.com/BridgeAR/safe-stable-stringify because it's simply more robust and more performant! */ -import { stringify } from './safe-stable-stringify/tmp.js' +import { stringify } from './safe-stable-stringify.js' /** * nice utility to stringify objects without spaces diff --git a/packages/helper/src/routes/+layout.svelte b/packages/helper/src/routes/+layout.svelte new file mode 100644 index 000000000..fdd7f7f6a --- /dev/null +++ b/packages/helper/src/routes/+layout.svelte @@ -0,0 +1,10 @@ + + + + + + + diff --git a/packages/helper/src/routes/+page.svelte b/packages/helper/src/routes/+page.svelte new file mode 100644 index 000000000..8bd56aa20 --- /dev/null +++ b/packages/helper/src/routes/+page.svelte @@ -0,0 +1,4 @@ + + +

Home

diff --git a/packages/helper/src/routes/about/+page.svelte b/packages/helper/src/routes/about/+page.svelte new file mode 100644 index 000000000..110bb7622 --- /dev/null +++ b/packages/helper/src/routes/about/+page.svelte @@ -0,0 +1,4 @@ + + +

About

diff --git a/packages/helper/src/routes/about/+page.ts b/packages/helper/src/routes/about/+page.ts new file mode 100644 index 000000000..17d44b4c5 --- /dev/null +++ b/packages/helper/src/routes/about/+page.ts @@ -0,0 +1,9 @@ +// import { underline } from '$lib/colors/index.js' +import { stry0, underline } from '$lib/index.js' +import { Log } from '$lib/Log.js' + +export const load = async () => { + const l = new Log('@kitql/helper') + l.info(underline('load!')) + return {} +} diff --git a/packages/helper/static/favicon.png b/packages/helper/static/favicon.png new file mode 100644 index 000000000..825b9e65a Binary files /dev/null and b/packages/helper/static/favicon.png differ diff --git a/packages/helper/svelte.config.js b/packages/helper/svelte.config.js new file mode 100644 index 000000000..18b471666 --- /dev/null +++ b/packages/helper/svelte.config.js @@ -0,0 +1,18 @@ +import adapter from '@sveltejs/adapter-auto' +import { vitePreprocess } from '@sveltejs/kit/vite' + +/** @type {import('@sveltejs/kit').Config} */ +const config = { + // Consult https://kit.svelte.dev/docs/integrations#preprocessors + // for more information about preprocessors + preprocess: vitePreprocess(), + + kit: { + // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list. + // If your environment is not supported or you settled on a specific environment, switch out the adapter. + // See https://kit.svelte.dev/docs/adapters for more information about adapters. + adapter: adapter(), + }, +} + +export default config diff --git a/packages/helper/test/colors.spec.ts b/packages/helper/test/colors.spec.ts deleted file mode 100644 index 30732603f..000000000 --- a/packages/helper/test/colors.spec.ts +++ /dev/null @@ -1,297 +0,0 @@ -import { expect, it, vi } from 'vitest' - -import { color, colorBrowserProcess, red } from '../src/colors' - -const msg = () => `with all options: - ${color('reset', 'reset')} - ${color('bold', 'bold')} - ${color('dim', 'dim')} - ${color('italic', 'italic')} - ${color('underline', 'underline')} - ${color('inverse', 'inverse')} - ${color('hidden', 'hidden')} - ${color('strikethrough', 'strikethrough')} - ${color('black', 'black')} - ${color('red', 'red')} - ${color('green', 'green')} - ${color('yellow', 'yellow')} - ${color('blue', 'blue')} - ${color('magenta', 'magenta')} - ${color('cyan', 'cyan')} - ${color('white', 'white')} - ${color('gray', 'gray')} - ${color('bgBlack', 'bgBlack')} - ${color('bgRed', 'bgRed')} - ${color('bgGreen', 'bgGreen')} - ${color('bgYellow', 'bgYellow')} - ${color('bgBlue', 'bgBlue')} - ${color('bgMagenta', 'bgMagenta')} - ${color('bgCyan', 'bgCyan')} - ${color('bgWhite', 'bgWhite')} - ${color('blackBright', 'blackBright')} - ${color('redBright', 'redBright')} - ${color('greenBright', 'greenBright')} - ${color('yellowBright', 'yellowBright')} - ${color('blueBright', 'blueBright')} - ${color('magentaBright', 'magentaBright')} - ${color('cyanBright', 'cyanBright')} - ${color('whiteBright', 'whiteBright')} - ${color('bgBlackBright', 'bgBlackBright')} - ${color('bgRedBright', 'bgRedBright')} - ${color('bgGreenBright', 'bgGreenBright')} - ${color('bgYellowBright', 'bgYellowBright')} - ${color('bgBlueBright', 'bgBlueBright')} - ${color('bgMagentaBright', 'bgMagentaBright')} - ${color('bgCyanBright', 'bgCyanBright')} - ${color('bgWhiteBright', 'bgWhiteBright')} -` -it('color NOT in browser', () => { - const message = msg() - // console.log(`msg`, message) - expect(message).toMatchInlineSnapshot(` - "with all options: - reset - bold - dim - italic - underline - inverse - hidden - strikethrough - black - red - green - yellow - blue - magenta - cyan - white - gray - bgBlack - bgRed - bgGreen - bgYellow - bgBlue - bgMagenta - bgCyan - bgWhite - blackBright - redBright - greenBright - yellowBright - blueBright - magentaBright - cyanBright - whiteBright - bgBlackBright - bgRedBright - bgGreenBright - bgYellowBright - bgBlueBright - bgMagentaBright - bgCyanBright - bgWhiteBright - " - `) -}) - -it('color in browser', () => { - vi.stubGlobal('window', { document: 'coucou' }) - const message = msg() - // console.log(`msg`, message) - expect(message).toMatchInlineSnapshot(` - "with all options: - $$KitQL_reset_KitQL$$reset$$KitQLEND$$ - $$KitQL_bold_KitQL$$bold$$KitQLEND$$ - $$KitQL_dim_KitQL$$dim$$KitQLEND$$ - $$KitQL_italic_KitQL$$italic$$KitQLEND$$ - $$KitQL_underline_KitQL$$underline$$KitQLEND$$ - $$KitQL_inverse_KitQL$$inverse$$KitQLEND$$ - $$KitQL_hidden_KitQL$$hidden$$KitQLEND$$ - $$KitQL_strikethrough_KitQL$$strikethrough$$KitQLEND$$ - $$KitQL_black_KitQL$$black$$KitQLEND$$ - $$KitQL_red_KitQL$$red$$KitQLEND$$ - $$KitQL_green_KitQL$$green$$KitQLEND$$ - $$KitQL_yellow_KitQL$$yellow$$KitQLEND$$ - $$KitQL_blue_KitQL$$blue$$KitQLEND$$ - $$KitQL_magenta_KitQL$$magenta$$KitQLEND$$ - $$KitQL_cyan_KitQL$$cyan$$KitQLEND$$ - $$KitQL_white_KitQL$$white$$KitQLEND$$ - $$KitQL_gray_KitQL$$gray$$KitQLEND$$ - $$KitQL_bgBlack_KitQL$$bgBlack$$KitQLEND$$ - $$KitQL_bgRed_KitQL$$bgRed$$KitQLEND$$ - $$KitQL_bgGreen_KitQL$$bgGreen$$KitQLEND$$ - $$KitQL_bgYellow_KitQL$$bgYellow$$KitQLEND$$ - $$KitQL_bgBlue_KitQL$$bgBlue$$KitQLEND$$ - $$KitQL_bgMagenta_KitQL$$bgMagenta$$KitQLEND$$ - $$KitQL_bgCyan_KitQL$$bgCyan$$KitQLEND$$ - $$KitQL_bgWhite_KitQL$$bgWhite$$KitQLEND$$ - $$KitQL_blackBright_KitQL$$blackBright$$KitQLEND$$ - $$KitQL_redBright_KitQL$$redBright$$KitQLEND$$ - $$KitQL_greenBright_KitQL$$greenBright$$KitQLEND$$ - $$KitQL_yellowBright_KitQL$$yellowBright$$KitQLEND$$ - $$KitQL_blueBright_KitQL$$blueBright$$KitQLEND$$ - $$KitQL_magentaBright_KitQL$$magentaBright$$KitQLEND$$ - $$KitQL_cyanBright_KitQL$$cyanBright$$KitQLEND$$ - $$KitQL_whiteBright_KitQL$$whiteBright$$KitQLEND$$ - $$KitQL_bgBlackBright_KitQL$$bgBlackBright$$KitQLEND$$ - $$KitQL_bgRedBright_KitQL$$bgRedBright$$KitQLEND$$ - $$KitQL_bgGreenBright_KitQL$$bgGreenBright$$KitQLEND$$ - $$KitQL_bgYellowBright_KitQL$$bgYellowBright$$KitQLEND$$ - $$KitQL_bgBlueBright_KitQL$$bgBlueBright$$KitQLEND$$ - $$KitQL_bgMagentaBright_KitQL$$bgMagentaBright$$KitQLEND$$ - $$KitQL_bgCyanBright_KitQL$$bgCyanBright$$KitQLEND$$ - $$KitQL_bgWhiteBright_KitQL$$bgWhiteBright$$KitQLEND$$ - " - `) - - expect(colorBrowserProcess(message)).toMatchInlineSnapshot(` - [ - "with all options: - %creset%c - %cbold%c - %cdim%c - %citalic%c - %cunderline%c - %cinverse%c - %chidden%c - %cstrikethrough%c - %cblack%c - %cred%c - %cgreen%c - %cyellow%c - %cblue%c - %cmagenta%c - %ccyan%c - %cwhite%c - %cgray%c - %cbgBlack%c - %cbgRed%c - %cbgGreen%c - %cbgYellow%c - %cbgBlue%c - %cbgMagenta%c - %cbgCyan%c - %cbgWhite%c - %cblackBright%c - %credBright%c - %cgreenBright%c - %cyellowBright%c - %cblueBright%c - %cmagentaBright%c - %ccyanBright%c - %cwhiteBright%c - %cbgBlackBright%c - %cbgRedBright%c - %cbgGreenBright%c - %cbgYellowBright%c - %cbgBlueBright%c - %cbgMagentaBright%c - %cbgCyanBright%c - %cbgWhiteBright%c - ", - "", - "", - "font-weight: bold", - "", - "opacity: 0.5", - "", - "font-style: italic", - "", - "text-decoration: underline", - "", - "filter: invert(1)", - "", - "visibility: hidden", - "", - "text-decoration: line-through", - "", - "color: black", - "", - "color: red", - "", - "color: green", - "", - "color: yellow", - "", - "color: blue", - "", - "color: #ff00ff", - "", - "color: cyan", - "", - "color: white", - "", - "color: gray", - "", - "background-color: black", - "", - "background-color: red", - "", - "background-color: green", - "", - "background-color: yellow", - "", - "background-color: blue", - "", - "background-color: #ff00ff", - "", - "background-color: cyan", - "", - "background-color: white", - "", - "color: #a9a9a9", - "", - "color: #ff4500", - "", - "color: #7fff00", - "", - "color: #ffd700", - "", - "color: #1e90ff", - "", - "color: #ff69b4", - "", - "color: #00ffff", - "", - "color: #ffffff", - "", - "background-color: #a9a9a9", - "", - "background-color: #ff4500", - "", - "background-color: #7fff00", - "", - "background-color: #ffd700", - "", - "background-color: #1e90ff", - "", - "background-color: #ff69b4", - "", - "background-color: #00ffff", - "", - "background-color: #ffffff", - "", - ] - `) -}) - -it('2 color red browser', () => { - vi.stubGlobal('window', { document: 'coucou' }) - - const msg = `with red: ${red('red')} and another ${red('red2')}` - - expect(msg).toMatchInlineSnapshot( - '"with red: $$KitQL_red_KitQL$$red$$KitQLEND$$ and another $$KitQL_red_KitQL$$red2$$KitQLEND$$"', - ) - - expect(colorBrowserProcess(msg)).toMatchInlineSnapshot(` - [ - "with red: %cred%c and another %cred2%c", - "color: red", - "", - "color: red", - "", - ] - `) -}) diff --git a/packages/helper/tsconfig.json b/packages/helper/tsconfig.json new file mode 100644 index 000000000..9a9b2ea32 --- /dev/null +++ b/packages/helper/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "./.svelte-kit/tsconfig.json", + "compilerOptions": { + "allowJs": true, + "checkJs": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "sourceMap": true, + "strict": true, + "moduleResolution": "NodeNext" + } +} diff --git a/packages/helper/vite.config.ts b/packages/helper/vite.config.ts new file mode 100644 index 000000000..be129e302 --- /dev/null +++ b/packages/helper/vite.config.ts @@ -0,0 +1,18 @@ +import { sveltekit } from '@sveltejs/kit/vite' +import { visualizer } from 'rollup-plugin-visualizer' +import { defineConfig } from 'vite' + +export default defineConfig({ + plugins: [ + sveltekit(), + visualizer({ + // template: 'raw-data', 'sunburst', + emitFile: true, + // open: true, + gzipSize: true, + }), + ], + test: { + include: ['src/**/*.{test,spec}.{js,ts}'], + }, +}) diff --git a/packages/vite-plugin-watch-and-run/.eslintignore b/packages/vite-plugin-watch-and-run/.eslintignore new file mode 100644 index 000000000..38972655f --- /dev/null +++ b/packages/vite-plugin-watch-and-run/.eslintignore @@ -0,0 +1,13 @@ +.DS_Store +node_modules +/build +/.svelte-kit +/package +.env +.env.* +!.env.example + +# Ignore files for PNPM, NPM and YARN +pnpm-lock.yaml +package-lock.json +yarn.lock diff --git a/packages/vite-plugin-watch-and-run/.eslintrc.cjs b/packages/vite-plugin-watch-and-run/.eslintrc.cjs new file mode 100644 index 000000000..ebc19589f --- /dev/null +++ b/packages/vite-plugin-watch-and-run/.eslintrc.cjs @@ -0,0 +1,30 @@ +module.exports = { + root: true, + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:svelte/recommended', + 'prettier' + ], + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint'], + parserOptions: { + sourceType: 'module', + ecmaVersion: 2020, + extraFileExtensions: ['.svelte'] + }, + env: { + browser: true, + es2017: true, + node: true + }, + overrides: [ + { + files: ['*.svelte'], + parser: 'svelte-eslint-parser', + parserOptions: { + parser: '@typescript-eslint/parser' + } + } + ] +}; diff --git a/packages/vite-plugin-watch-and-run/.gitignore b/packages/vite-plugin-watch-and-run/.gitignore new file mode 100644 index 000000000..ac7211b40 --- /dev/null +++ b/packages/vite-plugin-watch-and-run/.gitignore @@ -0,0 +1,11 @@ +.DS_Store +node_modules +/build +/dist +/.svelte-kit +/package +.env +.env.* +!.env.example +vite.config.js.timestamp-* +vite.config.ts.timestamp-* diff --git a/packages/vite-plugin-watch-and-run/.npmrc b/packages/vite-plugin-watch-and-run/.npmrc new file mode 100644 index 000000000..b6f27f135 --- /dev/null +++ b/packages/vite-plugin-watch-and-run/.npmrc @@ -0,0 +1 @@ +engine-strict=true diff --git a/packages/vite-plugin-watch-and-run/.prettierignore b/packages/vite-plugin-watch-and-run/.prettierignore new file mode 100644 index 000000000..38972655f --- /dev/null +++ b/packages/vite-plugin-watch-and-run/.prettierignore @@ -0,0 +1,13 @@ +.DS_Store +node_modules +/build +/.svelte-kit +/package +.env +.env.* +!.env.example + +# Ignore files for PNPM, NPM and YARN +pnpm-lock.yaml +package-lock.json +yarn.lock diff --git a/packages/vite-plugin-watch-and-run/.prettierrc b/packages/vite-plugin-watch-and-run/.prettierrc new file mode 100644 index 000000000..a77fddea9 --- /dev/null +++ b/packages/vite-plugin-watch-and-run/.prettierrc @@ -0,0 +1,9 @@ +{ + "useTabs": true, + "singleQuote": true, + "trailingComma": "none", + "printWidth": 100, + "plugins": ["prettier-plugin-svelte"], + "pluginSearchDirs": ["."], + "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }] +} diff --git a/packages/vite-plugin-watch-and-run/package.json b/packages/vite-plugin-watch-and-run/package.json index 258a2e62e..c6df96bbc 100644 --- a/packages/vite-plugin-watch-and-run/package.json +++ b/packages/vite-plugin-watch-and-run/package.json @@ -1,56 +1,72 @@ { - "name": "vite-plugin-watch-and-run", - "version": "1.2.1", + "name": "vite-plugin-watch-and-run", "description": "vite-plugin that will watch some files and run a package.json script on change", + "version": "1.2.1", + "license": "MIT", + "type": "module", "repository": { "type": "git", "url": "https://github.com/jycouet/kitql", "directory": "packages/vite-plugin-watch-and-run", "homepage": "https://github.com/jycouet/kitql/tree/main/packages/vite-plugin-watch-and-run#readme" }, - "type": "module", - "license": "MIT", - "scripts": { - "test": "vitest run", - "build": "bob runify --single" - }, - "devDependencies": { - "@types/micromatch": "^4.0.2", - "tslib": "2.5.0", - "vite": "4.4.11" - }, - "dependencies": { + "scripts": { + "prepare": "svelte-kit sync", + "dev": "vite dev", + "build": "vite build && svelte-package && node ../../scripts/package.js", + "preview": "vite preview", + "package": "svelte-package && publint", + "prepublishOnly": "npm run package", + "check": "svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch", + "lint": "prettier --plugin-search-dir . --check . && eslint .", + "format": "prettier --plugin-search-dir . --write .", + "test": "vitest", + "test:ci": "vitest --coverage" + }, + "peerDependencies": { + "svelte": "^4.0.0" + }, + "devDependencies": { + "@types/micromatch": "4.0.2", + "@sveltejs/adapter-auto": "2.0.0", + "@sveltejs/kit": "1.20.4", + "@sveltejs/package": "2.2.2", + "@typescript-eslint/eslint-plugin": "6.0.0", + "@typescript-eslint/parser": "6.0.0", + "eslint": "8.28.0", + "eslint-config-prettier": "8.5.0", + "eslint-plugin-svelte": "2.30.0", + "prettier": "2.8.0", + "prettier-plugin-svelte": "2.10.1", + "publint": "0.1.9", + "svelte": "4.0.5", + "svelte-check": "3.4.3", + "tslib": "2.4.1", + "typescript": "^5.0.0", + "vite": "4.4.2", + "vitest": "0.32.2" + }, + "dependencies": { "@kitql/helper": "workspace:*", "micromatch": "4.0.5" }, - "main": "dist/cjs/index.js", - "module": "dist/esm/index.js", - "exports": { - ".": { - "require": { - "types": "./dist/typings/index.d.cts", - "default": "./dist/cjs/index.js" - }, - "import": { - "types": "./dist/typings/index.d.ts", - "default": "./dist/esm/index.js" - }, - "default": { - "types": "./dist/typings/index.d.ts", - "default": "./dist/esm/index.js" - } - }, - "./package.json": "./package.json" - }, - "typings": "dist/typings/index.d.ts", - "typescript": { - "definition": "dist/typings/index.d.ts" - }, - "buildOptions": { - "input": "./src/index.ts" - }, - "publishConfig": { - "directory": "dist", - "access": "public" - } + "sideEffects": false, + "publishConfig": { + "directory": "dist", + "access": "public" + }, + "files": [ + "dist", + "!dist/**/*.test.*", + "!dist/**/*.spec.*" + ], + "svelte": "./dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "svelte": "./dist/index.js" + } + } } diff --git a/packages/vite-plugin-watch-and-run/src/app.d.ts b/packages/vite-plugin-watch-and-run/src/app.d.ts new file mode 100644 index 000000000..f59b884c5 --- /dev/null +++ b/packages/vite-plugin-watch-and-run/src/app.d.ts @@ -0,0 +1,12 @@ +// See https://kit.svelte.dev/docs/types#app +// for information about these interfaces +declare global { + namespace App { + // interface Error {} + // interface Locals {} + // interface PageData {} + // interface Platform {} + } +} + +export {}; diff --git a/packages/vite-plugin-watch-and-run/src/app.html b/packages/vite-plugin-watch-and-run/src/app.html new file mode 100644 index 000000000..d2fc6b061 --- /dev/null +++ b/packages/vite-plugin-watch-and-run/src/app.html @@ -0,0 +1,12 @@ + + + + + + + %sveltekit.head% + + +
%sveltekit.body%
+ + diff --git a/packages/vite-plugin-watch-and-run/src/index.ts b/packages/vite-plugin-watch-and-run/src/index.ts deleted file mode 100644 index 6d790e02f..000000000 --- a/packages/vite-plugin-watch-and-run/src/index.ts +++ /dev/null @@ -1,253 +0,0 @@ -import { cyan, green, Log, magenta, red } from '@kitql/helper' -import micromatch from 'micromatch' -import { spawn } from 'node:child_process' -import type { Plugin } from 'vite' - -const nbOverlap = (a1: readonly any[], a2: readonly any[]) => { - return a1.filter(value => a2?.includes(value)).length -} - -export type Options = { - /** - * watch files to trigger the run action (glob format) - */ - watch?: string - - /** - * watch files to trigger the run action (function format) - */ - watchFile?: (filepath: string) => Promise - - /** - * Kind of watch that will trigger the run action - */ - watchKind?: WatchKind[] - - /** - * Don't print anything extra to the console when an event is trigger - */ - quiet?: boolean - - /** - * run command (npm run gen for example!) - */ - run: string | (() => void | Promise) - - /** - * Delay before running the run command (in ms) - * @default 300 ms - */ - delay?: number | null - - /** - * Name to display in the logs as prefix - */ - name?: string | null - - /** - * Add shell option to spawn, set "powershell.exe" for example to use it there. - */ - shell?: string | null - - /** - * formatErrors instead of throwing an error - */ - formatErrors?: (e: unknown, afterError?: (e: Error) => void) => void -} - -export const kindWithPath = ['add', 'addDir', 'change', 'unlink', 'unlinkDir'] as const -export type KindWithPath = (typeof kindWithPath)[number] -export const kindWithoutPath = ['all', 'error', 'raw', 'ready'] as const -export type KindWithoutPath = (typeof kindWithoutPath)[number] -export type WatchKind = KindWithPath | KindWithoutPath - -export type StateDetail = { - kind: WatchKind[] - quiet: boolean - run: string | (() => void | Promise) - delay: number - isRunning: boolean - watchFile?: (filepath: string) => boolean | Promise - watch?: string - name?: string | null - shell: string | boolean - formatErrors?: (e: unknown, afterError?: (e: Error) => void) => void -} - -function checkConf(params: Options[]) { - if (!Array.isArray(params)) { - throw new Error('plugin watchAndRun, `params` needs to be an array.') - } - - const paramsChecked: StateDetail[] = [] - - for (const paramRow of params) { - const param: StateDetail = { - kind: paramRow.watchKind ?? ['add', 'change', 'unlink'], - run: paramRow.run, - delay: paramRow.delay ?? 300, - isRunning: false, - name: paramRow.name, - quiet: Boolean(paramRow.quiet), - watch: paramRow.watch, - shell: paramRow.shell ?? true, - watchFile: paramRow.watchFile, - formatErrors: paramRow.formatErrors, - } - - // @ts-ignore (because the config is in a js file, and people maybe didn't update their config.) - if (['ADD', 'CHANGE', 'DELETE'].includes(param.kind || '')) { - throw new Error( - 'BREAKING: ADD, CHANGE, DELETE were renamed add, change, unlink. Please update your config.', - ) - } - - // If you use a kind that needs a watch, we need to make you you have one watch or watchFile set - if (nbOverlap(kindWithPath, param.kind) !== 0 && !param.watch && !param.watchFile) { - throw new Error('plugin watch-and-run, `watch` or `watchFile` is missing.') - } - - // You need to have a run command - if (!param.run) { - throw new Error('plugin watch-and-run, `run` is missing.') - } - - // watch can be a function or a string - paramsChecked.push(param) - } - - return paramsChecked -} - -async function shouldRun( - absolutePath: string | null, - watchKind: WatchKind, - watchAndRunConf: StateDetail[], -): Promise { - for (const info of watchAndRunConf) { - if (!absolutePath || (!info.watchFile && !info.watch)) { - continue - } - - const isWatched = info.kind.includes(watchKind) - let isPathMatching = false - - if (info.watchFile) { - isPathMatching = await info.watchFile(absolutePath) - } else if (info.watch) { - isPathMatching = micromatch.isMatch(absolutePath, info.watch) - } - - const isWatchKindWithoutPath = kindWithoutPath.includes(watchKind as KindWithoutPath) - if (!info.isRunning && isWatched && (isPathMatching || isWatchKindWithoutPath)) { - return info - } - } - return null -} - -function formatLog(str: string, name?: string) { - return `${name ? magenta(`[${name}]`) : ''} ${str}` -} - -async function watcher( - absolutePath: string | null, - watchKind: WatchKind, - watchAndRunConf: StateDetail[], -) { - const info = await shouldRun(absolutePath, watchKind, watchAndRunConf) - if (info) { - info.isRunning = true - - // print the message - if (!info.quiet) { - let message = `${green('✔')} Watch ${cyan(watchKind)}` - if (info.watch && absolutePath) { - message += green(' ' + absolutePath.replaceAll(process.cwd(), '')) - } - if (typeof info.run === 'string') { - message += ` and run ${green(info.run)} ` - } - message += ` ${cyan(info.delay + 'ms')}` - - log.info(message) - } - - // Run after a delay - setTimeout(async () => { - // if the run value is a function, we just have to call it and we're done - if (typeof info.run === 'function') { - const promise = info.run() - try { - if (promise) { - await promise - } - } catch (e) { - if (info.formatErrors) { - info.formatErrors(e) - } else { - throw e - } - } - info.isRunning = false - return - } - - const child = spawn(info.run, [], { shell: info.shell }) - - //spit stdout to screen - child.stdout.on('data', data => { - process.stdout.write(formatLog(data.toString(), info.name ?? '')) - }) - - //spit stderr to screen - child.stderr.on('data', data => { - process.stdout.write(formatLog(data.toString(), info.name ?? '')) - }) - - child.on('close', code => { - if (code === 0) { - log.info(`${green('✔')} finished ${green('successfully')}`) - } else { - log.error(`finished with some ${red('errors')}`) - } - info.isRunning = false - }) - - return - }, info.delay) - } - - return -} - -const log = new Log('Watch-and-Run') - -export default function watchAndRun( - params: Options[], -): Plugin & { getCheckedConf: () => StateDetail[] } { - return { - name: 'watch-and-run', - - // jsut for testing purposes - getCheckedConf() { - return checkConf(params) - }, - - async configureServer(server) { - // check params, throw Errors if not valid and return a new object representing the state of the plugin - const watchAndRunConf = checkConf(params) - - for (const kind of kindWithPath) { - const _watcher = async (absolutePath: string) => - watcher(absolutePath, kind, watchAndRunConf) - server.watcher.on(kind, _watcher) - } - - for (const kind of kindWithoutPath) { - const _watcher = () => watcher(null, kind, watchAndRunConf) - server.watcher.on(kind, _watcher) - } - }, - } -} diff --git a/packages/vite-plugin-watch-and-run/src/lib/index.ts b/packages/vite-plugin-watch-and-run/src/lib/index.ts new file mode 100644 index 000000000..b2e9ce6d4 --- /dev/null +++ b/packages/vite-plugin-watch-and-run/src/lib/index.ts @@ -0,0 +1,253 @@ +import { cyan, green, Log, magenta, red } from '@kitql/helper'; +import micromatch from 'micromatch'; +import { spawn } from 'node:child_process'; +import type { Plugin } from 'vite'; + +const nbOverlap = (a1: readonly any[], a2: readonly any[]) => { + return a1.filter((value) => a2?.includes(value)).length; +}; + +export type Options = { + /** + * watch files to trigger the run action (glob format) + */ + watch?: string; + + /** + * watch files to trigger the run action (function format) + */ + watchFile?: (filepath: string) => Promise; + + /** + * Kind of watch that will trigger the run action + */ + watchKind?: WatchKind[]; + + /** + * Don't print anything extra to the console when an event is trigger + */ + quiet?: boolean; + + /** + * run command (npm run gen for example!) + */ + run: string | (() => void | Promise); + + /** + * Delay before running the run command (in ms) + * @default 300 ms + */ + delay?: number | null; + + /** + * Name to display in the logs as prefix + */ + name?: string | null; + + /** + * Add shell option to spawn, set "powershell.exe" for example to use it there. + */ + shell?: string | null; + + /** + * formatErrors instead of throwing an error + */ + formatErrors?: (e: unknown, afterError?: (e: Error) => void) => void; +}; + +export const kindWithPath = ['add', 'addDir', 'change', 'unlink', 'unlinkDir'] as const; +export type KindWithPath = (typeof kindWithPath)[number]; +export const kindWithoutPath = ['all', 'error', 'raw', 'ready'] as const; +export type KindWithoutPath = (typeof kindWithoutPath)[number]; +export type WatchKind = KindWithPath | KindWithoutPath; + +export type StateDetail = { + kind: WatchKind[]; + quiet: boolean; + run: string | (() => void | Promise); + delay: number; + isRunning: boolean; + watchFile?: (filepath: string) => boolean | Promise; + watch?: string; + name?: string | null; + shell: string | boolean; + formatErrors?: (e: unknown, afterError?: (e: Error) => void) => void; +}; + +function checkConf(params: Options[]) { + if (!Array.isArray(params)) { + throw new Error('plugin watchAndRun, `params` needs to be an array.'); + } + + const paramsChecked: StateDetail[] = []; + + for (const paramRow of params) { + const param: StateDetail = { + kind: paramRow.watchKind ?? ['add', 'change', 'unlink'], + run: paramRow.run, + delay: paramRow.delay ?? 300, + isRunning: false, + name: paramRow.name, + quiet: Boolean(paramRow.quiet), + watch: paramRow.watch, + shell: paramRow.shell ?? true, + watchFile: paramRow.watchFile, + formatErrors: paramRow.formatErrors + }; + + // @ts-ignore (because the config is in a js file, and people maybe didn't update their config.) + if (['ADD', 'CHANGE', 'DELETE'].includes(param.kind || '')) { + throw new Error( + 'BREAKING: ADD, CHANGE, DELETE were renamed add, change, unlink. Please update your config.' + ); + } + + // If you use a kind that needs a watch, we need to make you you have one watch or watchFile set + if (nbOverlap(kindWithPath, param.kind) !== 0 && !param.watch && !param.watchFile) { + throw new Error('plugin watch-and-run, `watch` or `watchFile` is missing.'); + } + + // You need to have a run command + if (!param.run) { + throw new Error('plugin watch-and-run, `run` is missing.'); + } + + // watch can be a function or a string + paramsChecked.push(param); + } + + return paramsChecked; +} + +async function shouldRun( + absolutePath: string | null, + watchKind: WatchKind, + watchAndRunConf: StateDetail[] +): Promise { + for (const info of watchAndRunConf) { + if (!absolutePath || (!info.watchFile && !info.watch)) { + continue; + } + + const isWatched = info.kind.includes(watchKind); + let isPathMatching = false; + + if (info.watchFile) { + isPathMatching = await info.watchFile(absolutePath); + } else if (info.watch) { + isPathMatching = micromatch.isMatch(absolutePath, info.watch); + } + + const isWatchKindWithoutPath = kindWithoutPath.includes(watchKind as KindWithoutPath); + if (!info.isRunning && isWatched && (isPathMatching || isWatchKindWithoutPath)) { + return info; + } + } + return null; +} + +function formatLog(str: string, name?: string) { + return `${name ? magenta(`[${name}]`) : ''} ${str}`; +} + +async function watcher( + absolutePath: string | null, + watchKind: WatchKind, + watchAndRunConf: StateDetail[] +) { + const info = await shouldRun(absolutePath, watchKind, watchAndRunConf); + if (info) { + info.isRunning = true; + + // print the message + if (!info.quiet) { + let message = `${green('✔')} Watch ${cyan(watchKind)}`; + if (info.watch && absolutePath) { + message += green(' ' + absolutePath.replaceAll(process.cwd(), '')); + } + if (typeof info.run === 'string') { + message += ` and run ${green(info.run)} `; + } + message += ` ${cyan(info.delay + 'ms')}`; + + log.info(message); + } + + // Run after a delay + setTimeout(async () => { + // if the run value is a function, we just have to call it and we're done + if (typeof info.run === 'function') { + const promise = info.run(); + try { + if (promise) { + await promise; + } + } catch (e) { + if (info.formatErrors) { + info.formatErrors(e); + } else { + throw e; + } + } + info.isRunning = false; + return; + } + + const child = spawn(info.run, [], { shell: info.shell }); + + //spit stdout to screen + child.stdout.on('data', (data) => { + process.stdout.write(formatLog(data.toString(), info.name ?? '')); + }); + + //spit stderr to screen + child.stderr.on('data', (data) => { + process.stdout.write(formatLog(data.toString(), info.name ?? '')); + }); + + child.on('close', (code) => { + if (code === 0) { + log.info(`${green('✔')} finished ${green('successfully')}`); + } else { + log.error(`finished with some ${red('errors')}`); + } + info.isRunning = false; + }); + + return; + }, info.delay); + } + + return; +} + +const log = new Log('Watch-and-Run'); + +export default function watchAndRun( + params: Options[] +): Plugin & { getCheckedConf: () => StateDetail[] } { + return { + name: 'watch-and-run', + + // jsut for testing purposes + getCheckedConf() { + return checkConf(params); + }, + + async configureServer(server) { + // check params, throw Errors if not valid and return a new object representing the state of the plugin + const watchAndRunConf = checkConf(params); + + for (const kind of kindWithPath) { + const _watcher = async (absolutePath: string) => + watcher(absolutePath, kind, watchAndRunConf); + server.watcher.on(kind, _watcher); + } + + for (const kind of kindWithoutPath) { + const _watcher = () => watcher(null, kind, watchAndRunConf); + server.watcher.on(kind, _watcher); + } + } + }; +} diff --git a/packages/vite-plugin-watch-and-run/src/lib/plugins.checkConf.spec.ts b/packages/vite-plugin-watch-and-run/src/lib/plugins.checkConf.spec.ts new file mode 100644 index 000000000..7a0cff324 --- /dev/null +++ b/packages/vite-plugin-watch-and-run/src/lib/plugins.checkConf.spec.ts @@ -0,0 +1,57 @@ +import { describe, expect, it } from 'vitest'; + +import watchAndRun from './index.js'; + +describe('vite-plugin-watch-and-run', () => { + it('Should throw an error as no config is sent', async () => { + const p = watchAndRun(null as any); + try { + await p.getCheckedConf(); + } catch (error: any) { + expect(error.message).toEqual('plugin watchAndRun, `params` needs to be an array.'); + } + }); + + it('Should throw an error as no watch', async () => { + const p = watchAndRun([{} as any]); + try { + await p.getCheckedConf(); + } catch (error: any) { + expect(error.message).toEqual('plugin watch-and-run, `watch` or `watchFile` is missing.'); + } + }); + + it('Should throw an error as no run', async () => { + const p = watchAndRun([{ watch: 'hello!' } as any]); + try { + await p.getCheckedConf(); + } catch (error: any) { + expect(error.message).toEqual('plugin watch-and-run, `run` is missing.'); + } + }); + + it('Should have a valid conf, with default all defaults', async () => { + const p = watchAndRun([{ watch: '**/*.(gql|graphql)', run: 'npm run gen' }]); + + expect(await p.getCheckedConf()).toMatchInlineSnapshot(` + [ + { + "delay": 300, + "formatErrors": undefined, + "isRunning": false, + "kind": [ + "add", + "change", + "unlink", + ], + "name": undefined, + "quiet": false, + "run": "npm run gen", + "shell": true, + "watch": "**/*.(gql|graphql)", + "watchFile": undefined, + }, + ] + `); + }); +}); diff --git a/packages/vite-plugin-watch-and-run/src/routes/+page.svelte b/packages/vite-plugin-watch-and-run/src/routes/+page.svelte new file mode 100644 index 000000000..0a45b69f0 --- /dev/null +++ b/packages/vite-plugin-watch-and-run/src/routes/+page.svelte @@ -0,0 +1,3 @@ +

Welcome to your library project

+

Create your package using @sveltejs/package and preview/showcase your work with SvelteKit

+

Visit kit.svelte.dev to read the documentation

diff --git a/packages/vite-plugin-watch-and-run/static/favicon.png b/packages/vite-plugin-watch-and-run/static/favicon.png new file mode 100644 index 000000000..825b9e65a Binary files /dev/null and b/packages/vite-plugin-watch-and-run/static/favicon.png differ diff --git a/packages/vite-plugin-watch-and-run/svelte.config.js b/packages/vite-plugin-watch-and-run/svelte.config.js new file mode 100644 index 000000000..1cf26a00d --- /dev/null +++ b/packages/vite-plugin-watch-and-run/svelte.config.js @@ -0,0 +1,18 @@ +import adapter from '@sveltejs/adapter-auto'; +import { vitePreprocess } from '@sveltejs/kit/vite'; + +/** @type {import('@sveltejs/kit').Config} */ +const config = { + // Consult https://kit.svelte.dev/docs/integrations#preprocessors + // for more information about preprocessors + preprocess: vitePreprocess(), + + kit: { + // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list. + // If your environment is not supported or you settled on a specific environment, switch out the adapter. + // See https://kit.svelte.dev/docs/adapters for more information about adapters. + adapter: adapter() + } +}; + +export default config; diff --git a/packages/vite-plugin-watch-and-run/test/plugins.checkConf.spec.ts b/packages/vite-plugin-watch-and-run/test/plugins.checkConf.spec.ts deleted file mode 100644 index d209d2cd4..000000000 --- a/packages/vite-plugin-watch-and-run/test/plugins.checkConf.spec.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { describe, expect, it } from 'vitest' - -import watchAndRun from '../src' - -describe('vite-plugin-watch-and-run', () => { - it('Should throw an error as no config is sent', async () => { - const p = watchAndRun(null as any) - try { - await p.getCheckedConf() - } catch (error: any) { - expect(error.message).toEqual('plugin watchAndRun, `params` needs to be an array.') - } - }) - - it('Should throw an error as no watch', async () => { - const p = watchAndRun([{} as any]) - try { - await p.getCheckedConf() - } catch (error: any) { - expect(error.message).toEqual('plugin watch-and-run, `watch` or `watchFile` is missing.') - } - }) - - it('Should throw an error as no run', async () => { - const p = watchAndRun([{ watch: 'hello!' } as any]) - try { - await p.getCheckedConf() - } catch (error: any) { - expect(error.message).toEqual('plugin watch-and-run, `run` is missing.') - } - }) - - it('Should have a valid conf, with default all defaults', async () => { - const p = watchAndRun([{ watch: '**/*.(gql|graphql)', run: 'npm run gen' }]) - - expect(await p.getCheckedConf()).toMatchInlineSnapshot(` - [ - { - "delay": 300, - "formatErrors": undefined, - "isRunning": false, - "kind": [ - "add", - "change", - "unlink", - ], - "name": undefined, - "quiet": false, - "run": "npm run gen", - "shell": true, - "watch": "**/*.(gql|graphql)", - "watchFile": undefined, - }, - ] - `) - }) -}) diff --git a/packages/vite-plugin-watch-and-run/tsconfig.json b/packages/vite-plugin-watch-and-run/tsconfig.json new file mode 100644 index 000000000..f56aae6ff --- /dev/null +++ b/packages/vite-plugin-watch-and-run/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "./.svelte-kit/tsconfig.json", + "compilerOptions": { + "allowJs": true, + "checkJs": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "sourceMap": true, + "strict": true, + "moduleResolution": "NodeNext" + } +} diff --git a/packages/vite-plugin-watch-and-run/vite.config.ts b/packages/vite-plugin-watch-and-run/vite.config.ts new file mode 100644 index 000000000..37b6a84bc --- /dev/null +++ b/packages/vite-plugin-watch-and-run/vite.config.ts @@ -0,0 +1,9 @@ +import { sveltekit } from '@sveltejs/kit/vite'; +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + plugins: [sveltekit()], + test: { + include: ['src/**/*.{test,spec}.{js,ts}'] + } +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f04206193..1b9588a34 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,16 +25,16 @@ importers: version: 4.1.1(@vue/compiler-sfc@3.3.2)(prettier@2.8.8) '@vitest/coverage-c8': specifier: 0.31.0 - version: 0.31.0(vitest@0.31.0) + version: 0.31.0(vitest@0.34.0) + '@vitest/coverage-v8': + specifier: ^0.34.6 + version: 0.34.6(vitest@0.34.0) '@vitest/ui': specifier: 0.31.0 - version: 0.31.0(vitest@0.31.0) + version: 0.31.0(vitest@0.34.0) '@vue/compiler-sfc': specifier: ^3.3.2 version: 3.3.2 - bob-the-bundler: - specifier: 7.0.1 - version: 7.0.1(typescript@5.0.4) c8: specifier: 7.13.0 version: 7.13.0 @@ -44,9 +44,6 @@ importers: eslint: specifier: 8.40.0 version: 8.40.0 - husky: - specifier: 8.0.3 - version: 8.0.3 jsdom: specifier: 22.0.0 version: 22.0.0 @@ -62,82 +59,99 @@ importers: svelte: specifier: 3.59.1 version: 3.59.1 - svelte2tsx: - specifier: 0.6.14 - version: 0.6.14(svelte@3.59.1)(typescript@5.0.4) typescript: specifier: 5.0.4 version: 5.0.4 - vitest: - specifier: 0.31.0 - version: 0.31.0(@vitest/ui@0.31.0)(jsdom@22.0.0) packages/all-in: {} packages/handles: devDependencies: - '@kitql/helper': - specifier: workspace:* - version: link:../helper/dist - '@playwright/test': - specifier: ^1.33.0 - version: 1.33.0 '@sveltejs/adapter-node': - specifier: ^1.3.1 - version: 1.3.1(@sveltejs/kit@1.16.3) + specifier: 1.3.1 + version: 1.3.1(@sveltejs/kit@1.25.2) '@sveltejs/kit': - specifier: ^1.16.3 - version: 1.16.3(svelte@3.59.1)(vite@4.3.5) + specifier: 1.25.2 + version: 1.25.2(svelte@4.0.5)(vite@4.3.5) '@sveltejs/package': - specifier: ^2.0.2 - version: 2.0.2(svelte@3.59.1)(typescript@5.0.4) + specifier: 2.2.2 + version: 2.2.2(svelte@4.0.5)(typescript@5.0.4) eslint: - specifier: ^8.40.0 - version: 8.40.0 + specifier: 8.28.0 + version: 8.28.0 eslint-config-prettier: - specifier: ^8.8.0 - version: 8.8.0(eslint@8.40.0) - eslint-plugin-svelte3: - specifier: ^4.0.0 - version: 4.0.0(eslint@8.40.0)(svelte@3.59.1) + specifier: 8.5.0 + version: 8.5.0(eslint@8.28.0) + eslint-plugin-svelte: + specifier: 2.30.0 + version: 2.30.0(eslint@8.28.0)(svelte@4.0.5) prettier: - specifier: ^2.8.8 - version: 2.8.8 + specifier: 2.8.0 + version: 2.8.0 prettier-plugin-svelte: - specifier: ^2.10.0 - version: 2.10.0(prettier@2.8.8)(svelte@3.59.1) + specifier: 2.10.1 + version: 2.10.1(prettier@2.8.0)(svelte@4.0.5) publint: - specifier: ^0.1.9 - version: 0.1.11 + specifier: 0.1.9 + version: 0.1.9 svelte: - specifier: ^3.59.1 - version: 3.59.1 + specifier: 4.0.5 + version: 4.0.5 svelte-check: - specifier: ^3.3.2 - version: 3.3.2(svelte@3.59.1) + specifier: 3.5.2 + version: 3.5.2(postcss@8.4.31)(svelte@4.0.5) tslib: - specifier: ^2.5.0 + specifier: 2.5.0 version: 2.5.0 typescript: specifier: ^5.0.4 version: 5.0.4 vite: - specifier: ^4.3.5 + specifier: 4.3.5 version: 4.3.5 vitest: - specifier: ^0.31.0 + specifier: 0.31.0 version: 0.31.0(@vitest/ui@0.31.0)(jsdom@22.0.0) publishDirectory: dist packages/helper: - dependencies: - safe-stable-stringify: - specifier: ^2.4.3 - version: 2.4.3 devDependencies: + '@sveltejs/adapter-auto': + specifier: 2.0.0 + version: 2.0.0(@sveltejs/kit@1.25.2) + '@sveltejs/kit': + specifier: 1.25.2 + version: 1.25.2(svelte@4.0.5)(vite@4.4.2) + '@sveltejs/package': + specifier: 2.2.2 + version: 2.2.2(svelte@4.0.5)(typescript@5.0.4) + esm-env: + specifier: ^1.0.0 + version: 1.0.0 + publint: + specifier: 0.1.9 + version: 0.1.9 + rollup-plugin-visualizer: + specifier: ^5.9.2 + version: 5.9.2 + svelte: + specifier: 4.0.5 + version: 4.0.5 + svelte-check: + specifier: 3.5.2 + version: 3.5.2(postcss@8.4.31)(svelte@4.0.5) tslib: - specifier: ^2.5.0 - version: 2.5.0 + specifier: 2.4.1 + version: 2.4.1 + typescript: + specifier: ^5.0.0 + version: 5.0.4 + vite: + specifier: 4.4.2 + version: 4.4.2(@types/node@20.8.4) + vitest: + specifier: 0.34.0 + version: 0.34.0(@vitest/ui@0.31.0)(jsdom@22.0.0) publishDirectory: dist packages/vite-plugin-watch-and-run: @@ -149,15 +163,60 @@ importers: specifier: 4.0.5 version: 4.0.5 devDependencies: + '@sveltejs/adapter-auto': + specifier: 2.0.0 + version: 2.0.0(@sveltejs/kit@1.20.4) + '@sveltejs/kit': + specifier: 1.20.4 + version: 1.20.4(svelte@4.0.5)(vite@4.4.2) + '@sveltejs/package': + specifier: 2.2.2 + version: 2.2.2(svelte@4.0.5)(typescript@5.0.4) '@types/micromatch': - specifier: ^4.0.2 + specifier: 4.0.2 version: 4.0.2 + '@typescript-eslint/eslint-plugin': + specifier: 6.0.0 + version: 6.0.0(@typescript-eslint/parser@6.0.0)(eslint@8.28.0)(typescript@5.0.4) + '@typescript-eslint/parser': + specifier: 6.0.0 + version: 6.0.0(eslint@8.28.0)(typescript@5.0.4) + eslint: + specifier: 8.28.0 + version: 8.28.0 + eslint-config-prettier: + specifier: 8.5.0 + version: 8.5.0(eslint@8.28.0) + eslint-plugin-svelte: + specifier: 2.30.0 + version: 2.30.0(eslint@8.28.0)(svelte@4.0.5) + prettier: + specifier: 2.8.0 + version: 2.8.0 + prettier-plugin-svelte: + specifier: 2.10.1 + version: 2.10.1(prettier@2.8.0)(svelte@4.0.5) + publint: + specifier: 0.1.9 + version: 0.1.9 + svelte: + specifier: 4.0.5 + version: 4.0.5 + svelte-check: + specifier: 3.4.3 + version: 3.4.3(postcss@8.4.31)(svelte@4.0.5) tslib: - specifier: 2.5.0 - version: 2.5.0 + specifier: 2.4.1 + version: 2.4.1 + typescript: + specifier: ^5.0.0 + version: 5.0.4 vite: - specifier: 4.4.11 - version: 4.4.11(@types/node@18.16.8) + specifier: 4.4.2 + version: 4.4.2(@types/node@20.8.4) + vitest: + specifier: 0.32.2 + version: 0.32.2(@vitest/ui@0.31.0)(jsdom@22.0.0) publishDirectory: dist website: @@ -1201,6 +1260,16 @@ packages: dev: true optional: true + /@eslint-community/eslint-utils@4.4.0(eslint@8.28.0): + resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + dependencies: + eslint: 8.28.0 + eslint-visitor-keys: 3.4.1 + dev: true + /@eslint-community/eslint-utils@4.4.0(eslint@8.40.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -1216,6 +1285,23 @@ packages: engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} dev: true + /@eslint/eslintrc@1.4.1: + resolution: {integrity: sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + ajv: 6.12.6 + debug: 4.3.4 + espree: 9.5.2 + globals: 13.20.0 + ignore: 5.2.4 + import-fresh: 3.3.0 + js-yaml: 4.1.0 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + dev: true + /@eslint/eslintrc@2.0.3: resolution: {integrity: sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -1238,6 +1324,11 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true + /@fastify/busboy@2.0.0: + resolution: {integrity: sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==} + engines: {node: '>=14'} + dev: true + /@giscus/react@2.3.0(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-tj79B+NNBfidhPdXJqWoqRm5Jhoc6CBhXMYwBR9nwTwsrdaB/spcQXmHpKcUuOdXZtlYSwMfCFcBogMNbD+gKQ==} peerDependencies: @@ -1298,6 +1389,13 @@ packages: engines: {node: '>=8'} dev: true + /@jest/schemas@29.6.3: + resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@sinclair/typebox': 0.27.8 + dev: true + /@jridgewell/gen-mapping@0.3.3: resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} engines: {node: '>=6.0.0'} @@ -1633,7 +1731,7 @@ packages: nopt: 7.1.0 proc-log: 3.0.0 read-package-json-fast: 3.0.2 - semver: 7.5.1 + semver: 7.5.4 walk-up-path: 3.0.1 dev: true @@ -1671,17 +1769,6 @@ packages: tslib: 2.5.0 dev: true - /@playwright/test@1.33.0: - resolution: {integrity: sha512-YunBa2mE7Hq4CfPkGzQRK916a4tuZoVx/EpLjeWlTVOnD4S2+fdaQZE0LJkbfhN5FTSKNLdcl7MoT5XB37bTkg==} - engines: {node: '>=14'} - hasBin: true - dependencies: - '@types/node': 18.16.8 - playwright-core: 1.33.0 - optionalDependencies: - fsevents: 2.3.2 - dev: true - /@polka/url@1.0.0-next.21: resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==} @@ -2048,12 +2135,34 @@ packages: resolution: {integrity: sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg==} dev: true + /@sinclair/typebox@0.27.8: + resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} + dev: true + /@sindresorhus/is@4.6.0: resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} engines: {node: '>=10'} dev: true - /@sveltejs/adapter-node@1.3.1(@sveltejs/kit@1.16.3): + /@sveltejs/adapter-auto@2.0.0(@sveltejs/kit@1.20.4): + resolution: {integrity: sha512-b+gkHFZgD771kgV3aO4avHFd7y1zhmMYy9i6xOK7m/rwmwaRO8gnF5zBc0Rgca80B2PMU1bKNxyBTHA14OzUAQ==} + peerDependencies: + '@sveltejs/kit': ^1.0.0 + dependencies: + '@sveltejs/kit': 1.20.4(svelte@4.0.5)(vite@4.4.2) + import-meta-resolve: 2.2.2 + dev: true + + /@sveltejs/adapter-auto@2.0.0(@sveltejs/kit@1.25.2): + resolution: {integrity: sha512-b+gkHFZgD771kgV3aO4avHFd7y1zhmMYy9i6xOK7m/rwmwaRO8gnF5zBc0Rgca80B2PMU1bKNxyBTHA14OzUAQ==} + peerDependencies: + '@sveltejs/kit': ^1.0.0 + dependencies: + '@sveltejs/kit': 1.25.2(svelte@4.0.5)(vite@4.4.2) + import-meta-resolve: 2.2.2 + dev: true + + /@sveltejs/adapter-node@1.3.1(@sveltejs/kit@1.25.2): resolution: {integrity: sha512-A0VgRQDCDPzdLNoiAbcOxGw4zT1Mc+n1LwT1OmO350R7WxrEqdMUChPPOd1iMfIDWlP4ie6E2d/WQf5es2d4Zw==} peerDependencies: '@sveltejs/kit': ^1.0.0 @@ -2061,73 +2170,182 @@ packages: '@rollup/plugin-commonjs': 25.0.5(rollup@3.29.4) '@rollup/plugin-json': 6.0.1(rollup@3.29.4) '@rollup/plugin-node-resolve': 15.2.3(rollup@3.29.4) - '@sveltejs/kit': 1.16.3(svelte@3.59.1)(vite@4.3.5) + '@sveltejs/kit': 1.25.2(svelte@4.0.5)(vite@4.3.5) rollup: 3.29.4 dev: true - /@sveltejs/kit@1.16.3(svelte@3.59.1)(vite@4.3.5): - resolution: {integrity: sha512-8uv0udYRpVuE1BweFidcWHfL+u2gAANKmvIal1dN/FWPBl7DJYbt9zYEtr3bNTiXystT8Sn0Wp54RfwpbPqHjQ==} + /@sveltejs/kit@1.20.4(svelte@4.0.5)(vite@4.4.2): + resolution: {integrity: sha512-MmAzIuMrP7A+8fqDVbxm6ekGHRHL/+Fk8sQPAzPG4G2TxUDtHdn/WcIxeEqHzARMf0OtGSC+VPyOSFuw2Cy2Mg==} engines: {node: ^16.14 || >=18} hasBin: true requiresBuild: true peerDependencies: - svelte: ^3.54.0 + svelte: ^3.54.0 || ^4.0.0-next.0 vite: ^4.0.0 dependencies: - '@sveltejs/vite-plugin-svelte': 2.2.0(svelte@3.59.1)(vite@4.3.5) + '@sveltejs/vite-plugin-svelte': 2.4.6(svelte@4.0.5)(vite@4.4.2) '@types/cookie': 0.5.1 cookie: 0.5.0 devalue: 4.3.1 esm-env: 1.0.0 kleur: 4.1.5 - magic-string: 0.30.0 + magic-string: 0.30.4 mime: 3.0.0 sade: 1.8.1 set-cookie-parser: 2.6.0 sirv: 2.0.3 - svelte: 3.59.1 - tiny-glob: 0.2.9 + svelte: 4.0.5 undici: 5.22.1 + vite: 4.4.2(@types/node@20.8.4) + transitivePeerDependencies: + - supports-color + dev: true + + /@sveltejs/kit@1.25.2(svelte@4.0.5)(vite@4.3.5): + resolution: {integrity: sha512-USuuSpdAPFDiLi58N2Pwd/TG9bcUSPAlzE5iaAXaLyCTWa3l36HDKH6nV5NqBybwfeux1ZwgtIeITLZJDJ6HDg==} + engines: {node: ^16.14 || >=18} + hasBin: true + requiresBuild: true + peerDependencies: + svelte: ^3.54.0 || ^4.0.0-next.0 + vite: ^4.0.0 + dependencies: + '@sveltejs/vite-plugin-svelte': 2.4.6(svelte@4.0.5)(vite@4.3.5) + '@types/cookie': 0.5.1 + cookie: 0.5.0 + devalue: 4.3.1 + esm-env: 1.0.0 + kleur: 4.1.5 + magic-string: 0.30.4 + mime: 3.0.0 + sade: 1.8.1 + set-cookie-parser: 2.6.0 + sirv: 2.0.3 + svelte: 4.0.5 + tiny-glob: 0.2.9 + undici: 5.25.4 vite: 4.3.5 transitivePeerDependencies: - supports-color dev: true - /@sveltejs/package@2.0.2(svelte@3.59.1)(typescript@5.0.4): - resolution: {integrity: sha512-cCOCcO8yMHnhHyaR51nQtvKZ3o/vSU9UYI1EXLT1j2CKNPMuH1/g6JNwKcNNrtQGwwquudc69ZeYy8D/TDNwEw==} + /@sveltejs/kit@1.25.2(svelte@4.0.5)(vite@4.4.2): + resolution: {integrity: sha512-USuuSpdAPFDiLi58N2Pwd/TG9bcUSPAlzE5iaAXaLyCTWa3l36HDKH6nV5NqBybwfeux1ZwgtIeITLZJDJ6HDg==} + engines: {node: ^16.14 || >=18} + hasBin: true + requiresBuild: true + peerDependencies: + svelte: ^3.54.0 || ^4.0.0-next.0 + vite: ^4.0.0 + dependencies: + '@sveltejs/vite-plugin-svelte': 2.4.6(svelte@4.0.5)(vite@4.4.2) + '@types/cookie': 0.5.1 + cookie: 0.5.0 + devalue: 4.3.1 + esm-env: 1.0.0 + kleur: 4.1.5 + magic-string: 0.30.4 + mime: 3.0.0 + sade: 1.8.1 + set-cookie-parser: 2.6.0 + sirv: 2.0.3 + svelte: 4.0.5 + tiny-glob: 0.2.9 + undici: 5.25.4 + vite: 4.4.2(@types/node@20.8.4) + transitivePeerDependencies: + - supports-color + dev: true + + /@sveltejs/package@2.2.2(svelte@4.0.5)(typescript@5.0.4): + resolution: {integrity: sha512-rP3sVv6cAntcdcG4r4KspLU6nZYYUrHJBAX3Arrw0KJFdgxtlsi2iDwN0Jwr/vIkgjcU0ZPWM8kkT5kpZDlWAw==} engines: {node: ^16.14 || >=18} hasBin: true peerDependencies: - svelte: ^3.44.0 + svelte: ^3.44.0 || ^4.0.0 dependencies: chokidar: 3.5.3 kleur: 4.1.5 sade: 1.8.1 - svelte: 3.59.1 - svelte2tsx: 0.6.14(svelte@3.59.1)(typescript@5.0.4) + semver: 7.5.4 + svelte: 4.0.5 + svelte2tsx: 0.6.23(svelte@4.0.5)(typescript@5.0.4) transitivePeerDependencies: - typescript dev: true - /@sveltejs/vite-plugin-svelte@2.2.0(svelte@3.59.1)(vite@4.3.5): - resolution: {integrity: sha512-KDtdva+FZrZlyug15KlbXuubntAPKcBau0K7QhAIqC5SAy0uDbjZwoexDRx0L0J2T4niEfC6FnA9GuQQJKg+Aw==} + /@sveltejs/vite-plugin-svelte-inspector@1.0.4(@sveltejs/vite-plugin-svelte@2.4.6)(svelte@4.0.5)(vite@4.3.5): + resolution: {integrity: sha512-zjiuZ3yydBtwpF3bj0kQNV0YXe+iKE545QGZVTaylW3eAzFr+pJ/cwK8lZEaRp4JtaJXhD5DyWAV4AxLh6DgaQ==} + engines: {node: ^14.18.0 || >= 16} + peerDependencies: + '@sveltejs/vite-plugin-svelte': ^2.2.0 + svelte: ^3.54.0 || ^4.0.0 + vite: ^4.0.0 + dependencies: + '@sveltejs/vite-plugin-svelte': 2.4.6(svelte@4.0.5)(vite@4.3.5) + debug: 4.3.4 + svelte: 4.0.5 + vite: 4.3.5 + transitivePeerDependencies: + - supports-color + dev: true + + /@sveltejs/vite-plugin-svelte-inspector@1.0.4(@sveltejs/vite-plugin-svelte@2.4.6)(svelte@4.0.5)(vite@4.4.2): + resolution: {integrity: sha512-zjiuZ3yydBtwpF3bj0kQNV0YXe+iKE545QGZVTaylW3eAzFr+pJ/cwK8lZEaRp4JtaJXhD5DyWAV4AxLh6DgaQ==} + engines: {node: ^14.18.0 || >= 16} + peerDependencies: + '@sveltejs/vite-plugin-svelte': ^2.2.0 + svelte: ^3.54.0 || ^4.0.0 + vite: ^4.0.0 + dependencies: + '@sveltejs/vite-plugin-svelte': 2.4.6(svelte@4.0.5)(vite@4.4.2) + debug: 4.3.4 + svelte: 4.0.5 + vite: 4.4.2(@types/node@20.8.4) + transitivePeerDependencies: + - supports-color + dev: true + + /@sveltejs/vite-plugin-svelte@2.4.6(svelte@4.0.5)(vite@4.3.5): + resolution: {integrity: sha512-zO79p0+DZnXPnF0ltIigWDx/ux7Ni+HRaFOw720Qeivc1azFUrJxTl0OryXVibYNx1hCboGia1NRV3x8RNv4cA==} engines: {node: ^14.18.0 || >= 16} peerDependencies: - svelte: ^3.54.0 + svelte: ^3.54.0 || ^4.0.0 vite: ^4.0.0 dependencies: + '@sveltejs/vite-plugin-svelte-inspector': 1.0.4(@sveltejs/vite-plugin-svelte@2.4.6)(svelte@4.0.5)(vite@4.3.5) debug: 4.3.4 deepmerge: 4.3.1 kleur: 4.1.5 magic-string: 0.30.4 - svelte: 3.59.1 - svelte-hmr: 0.15.1(svelte@3.59.1) + svelte: 4.0.5 + svelte-hmr: 0.15.3(svelte@4.0.5) vite: 4.3.5 vitefu: 0.2.4(vite@4.3.5) transitivePeerDependencies: - supports-color dev: true + /@sveltejs/vite-plugin-svelte@2.4.6(svelte@4.0.5)(vite@4.4.2): + resolution: {integrity: sha512-zO79p0+DZnXPnF0ltIigWDx/ux7Ni+HRaFOw720Qeivc1azFUrJxTl0OryXVibYNx1hCboGia1NRV3x8RNv4cA==} + engines: {node: ^14.18.0 || >= 16} + peerDependencies: + svelte: ^3.54.0 || ^4.0.0 + vite: ^4.0.0 + dependencies: + '@sveltejs/vite-plugin-svelte-inspector': 1.0.4(@sveltejs/vite-plugin-svelte@2.4.6)(svelte@4.0.5)(vite@4.4.2) + debug: 4.3.4 + deepmerge: 4.3.1 + kleur: 4.1.5 + magic-string: 0.30.4 + svelte: 4.0.5 + svelte-hmr: 0.15.3(svelte@4.0.5) + vite: 4.4.2(@types/node@20.8.4) + vitefu: 0.2.4(vite@4.4.2) + transitivePeerDependencies: + - supports-color + dev: true + /@swc/helpers@0.5.2: resolution: {integrity: sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==} dependencies: @@ -2311,7 +2529,7 @@ packages: dependencies: '@types/http-cache-semantics': 4.0.1 '@types/keyv': 3.1.4 - '@types/node': 18.16.8 + '@types/node': 20.8.4 '@types/responselike': 1.0.0 dev: true @@ -2328,7 +2546,7 @@ packages: /@types/concat-stream@2.0.0: resolution: {integrity: sha512-t3YCerNM7NTVjLuICZo5gYAXYoDvpuuTceCcFQWcDQz26kxUR5uIWolxbIR5jRNIXpMqhOpW/b8imCR1LEmuJw==} dependencies: - '@types/node': 18.16.8 + '@types/node': 20.8.4 dev: true /@types/cookie@0.5.1: @@ -2405,13 +2623,13 @@ packages: /@types/keyv@3.1.4: resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} dependencies: - '@types/node': 18.16.8 + '@types/node': 20.8.4 dev: true /@types/mdast@3.0.11: resolution: {integrity: sha512-Y/uImid8aAwrEA24/1tcRZwpxX3pIFTSilcNDKSPn+Y2iDywSEachzRuvgAYYLR3wpGXAsMbv5lvKLDZLeYPAw==} dependencies: - '@types/unist': 2.0.6 + '@types/unist': 3.0.0 /@types/mdast@4.0.1: resolution: {integrity: sha512-IlKct1rUTJ1T81d8OHzyop15kGv9A/ff7Gz7IJgrk6jDb4Udw77pCJ+vq8oxZf4Ghpm+616+i1s/LNg/Vh7d+g==} @@ -2475,7 +2693,7 @@ packages: /@types/responselike@1.0.0: resolution: {integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==} dependencies: - '@types/node': 18.16.8 + '@types/node': 20.8.4 dev: true /@types/scheduler@0.16.3: @@ -2502,7 +2720,6 @@ packages: /@types/unist@3.0.0: resolution: {integrity: sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==} - dev: false /@typescript-eslint/eslint-plugin@5.59.5(@typescript-eslint/parser@5.59.5)(eslint@8.40.0)(typescript@5.0.4): resolution: {integrity: sha512-feA9xbVRWJZor+AnLNAr7A8JRWeZqHUf4T9tlP+TN04b05pFVhO5eN7/O93Y/1OUlLMHKbnJisgDURs/qvtqdg==} @@ -2525,13 +2742,44 @@ packages: grapheme-splitter: 1.0.4 ignore: 5.2.4 natural-compare-lite: 1.4.0 - semver: 7.5.1 + semver: 7.5.4 tsutils: 3.21.0(typescript@5.0.4) typescript: 5.0.4 transitivePeerDependencies: - supports-color dev: true + /@typescript-eslint/eslint-plugin@6.0.0(@typescript-eslint/parser@6.0.0)(eslint@8.28.0)(typescript@5.0.4): + resolution: {integrity: sha512-xuv6ghKGoiq856Bww/yVYnXGsKa588kY3M0XK7uUW/3fJNNULKRfZfSBkMTSpqGG/8ZCXCadfh8G/z/B4aqS/A==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha + eslint: ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@eslint-community/regexpp': 4.5.1 + '@typescript-eslint/parser': 6.0.0(eslint@8.28.0)(typescript@5.0.4) + '@typescript-eslint/scope-manager': 6.0.0 + '@typescript-eslint/type-utils': 6.0.0(eslint@8.28.0)(typescript@5.0.4) + '@typescript-eslint/utils': 6.0.0(eslint@8.28.0)(typescript@5.0.4) + '@typescript-eslint/visitor-keys': 6.0.0 + debug: 4.3.4 + eslint: 8.28.0 + grapheme-splitter: 1.0.4 + graphemer: 1.4.0 + ignore: 5.2.4 + natural-compare: 1.4.0 + natural-compare-lite: 1.4.0 + semver: 7.5.4 + ts-api-utils: 1.0.3(typescript@5.0.4) + typescript: 5.0.4 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/parser@5.59.5(eslint@8.40.0)(typescript@5.0.4): resolution: {integrity: sha512-NJXQC4MRnF9N9yWqQE2/KLRSOLvrrlZb48NGVfBa+RuPMN6B7ZcK5jZOvhuygv4D64fRKnZI4L4p8+M+rfeQuw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2552,6 +2800,27 @@ packages: - supports-color dev: true + /@typescript-eslint/parser@6.0.0(eslint@8.28.0)(typescript@5.0.4): + resolution: {integrity: sha512-TNaufYSPrr1U8n+3xN+Yp9g31vQDJqhXzzPSHfQDLcaO4tU+mCfODPxCwf4H530zo7aUBE3QIdxCXamEnG04Tg==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 6.0.0 + '@typescript-eslint/types': 6.0.0 + '@typescript-eslint/typescript-estree': 6.0.0(typescript@5.0.4) + '@typescript-eslint/visitor-keys': 6.0.0 + debug: 4.3.4 + eslint: 8.28.0 + typescript: 5.0.4 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/scope-manager@5.59.5: resolution: {integrity: sha512-jVecWwnkX6ZgutF+DovbBJirZcAxgxC0EOHYt/niMROf8p4PwxxG32Qdhj/iIQQIuOflLjNkxoXyArkcIP7C3A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2560,6 +2829,14 @@ packages: '@typescript-eslint/visitor-keys': 5.59.5 dev: true + /@typescript-eslint/scope-manager@6.0.0: + resolution: {integrity: sha512-o4q0KHlgCZTqjuaZ25nw5W57NeykZT9LiMEG4do/ovwvOcPnDO1BI5BQdCsUkjxFyrCL0cSzLjvIMfR9uo7cWg==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.0.0 + '@typescript-eslint/visitor-keys': 6.0.0 + dev: true + /@typescript-eslint/type-utils@5.59.5(eslint@8.40.0)(typescript@5.0.4): resolution: {integrity: sha512-4eyhS7oGym67/pSxA2mmNq7X164oqDYNnZCUayBwJZIRVvKpBCMBzFnFxjeoDeShjtO6RQBHBuwybuX3POnDqg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2580,11 +2857,36 @@ packages: - supports-color dev: true + /@typescript-eslint/type-utils@6.0.0(eslint@8.28.0)(typescript@5.0.4): + resolution: {integrity: sha512-ah6LJvLgkoZ/pyJ9GAdFkzeuMZ8goV6BH7eC9FPmojrnX9yNCIsfjB+zYcnex28YO3RFvBkV6rMV6WpIqkPvoQ==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/typescript-estree': 6.0.0(typescript@5.0.4) + '@typescript-eslint/utils': 6.0.0(eslint@8.28.0)(typescript@5.0.4) + debug: 4.3.4 + eslint: 8.28.0 + ts-api-utils: 1.0.3(typescript@5.0.4) + typescript: 5.0.4 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/types@5.59.5: resolution: {integrity: sha512-xkfRPHbqSH4Ggx4eHRIO/eGL8XL4Ysb4woL8c87YuAo8Md7AUjyWKa9YMwTL519SyDPrfEgKdewjkxNCVeJW7w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true + /@typescript-eslint/types@6.0.0: + resolution: {integrity: sha512-Zk9KDggyZM6tj0AJWYYKgF0yQyrcnievdhG0g5FqyU3Y2DRxJn4yWY21sJC0QKBckbsdKKjYDV2yVrrEvuTgxg==} + engines: {node: ^16.0.0 || >=18.0.0} + dev: true + /@typescript-eslint/typescript-estree@5.59.5(typescript@5.0.4): resolution: {integrity: sha512-+XXdLN2CZLZcD/mO7mQtJMvCkzRfmODbeSKuMY/yXbGkzvA9rJyDY5qDYNoiz2kP/dmyAxXquL2BvLQLJFPQIg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2599,13 +2901,34 @@ packages: debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 - semver: 7.5.1 + semver: 7.5.4 tsutils: 3.21.0(typescript@5.0.4) typescript: 5.0.4 transitivePeerDependencies: - supports-color dev: true + /@typescript-eslint/typescript-estree@6.0.0(typescript@5.0.4): + resolution: {integrity: sha512-2zq4O7P6YCQADfmJ5OTDQTP3ktajnXIRrYAtHM9ofto/CJZV3QfJ89GEaM2BNGeSr1KgmBuLhEkz5FBkS2RQhQ==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 6.0.0 + '@typescript-eslint/visitor-keys': 6.0.0 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.5.4 + ts-api-utils: 1.0.3(typescript@5.0.4) + typescript: 5.0.4 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/utils@5.59.5(eslint@8.40.0)(typescript@5.0.4): resolution: {integrity: sha512-sCEHOiw+RbyTii9c3/qN74hYDPNORb8yWCoPLmB7BIflhplJ65u2PBpdRla12e3SSTJ2erRkPjz7ngLHhUegxA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2620,25 +2943,53 @@ packages: '@typescript-eslint/typescript-estree': 5.59.5(typescript@5.0.4) eslint: 8.40.0 eslint-scope: 5.1.1 - semver: 7.5.1 + semver: 7.5.4 transitivePeerDependencies: - supports-color - typescript dev: true - /@typescript-eslint/visitor-keys@5.59.5: - resolution: {integrity: sha512-qL+Oz+dbeBRTeyJTIy0eniD3uvqU7x+y1QceBismZ41hd4aBSRh8UAw4pZP0+XzLuPZmx4raNMq/I+59W2lXKA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/utils@6.0.0(eslint@8.28.0)(typescript@5.0.4): + resolution: {integrity: sha512-SOr6l4NB6HE4H/ktz0JVVWNXqCJTOo/mHnvIte1ZhBQ0Cvd04x5uKZa3zT6tiodL06zf5xxdK8COiDvPnQ27JQ==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 dependencies: - '@typescript-eslint/types': 5.59.5 - eslint-visitor-keys: 3.4.1 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.28.0) + '@types/json-schema': 7.0.11 + '@types/semver': 7.5.0 + '@typescript-eslint/scope-manager': 6.0.0 + '@typescript-eslint/types': 6.0.0 + '@typescript-eslint/typescript-estree': 6.0.0(typescript@5.0.4) + eslint: 8.28.0 + eslint-scope: 5.1.1 + semver: 7.5.4 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + + /@typescript-eslint/visitor-keys@5.59.5: + resolution: {integrity: sha512-qL+Oz+dbeBRTeyJTIy0eniD3uvqU7x+y1QceBismZ41hd4aBSRh8UAw4pZP0+XzLuPZmx4raNMq/I+59W2lXKA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.59.5 + eslint-visitor-keys: 3.4.1 + dev: true + + /@typescript-eslint/visitor-keys@6.0.0: + resolution: {integrity: sha512-cvJ63l8c0yXdeT5POHpL0Q1cZoRcmRKFCtSjNGJxPkcP571EfZMcNbzWAc7oK3D1dRzm/V5EwtkANTZxqvuuUA==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.0.0 + eslint-visitor-keys: 3.4.1 dev: true /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: false - /@vitest/coverage-c8@0.31.0(vitest@0.31.0): + /@vitest/coverage-c8@0.31.0(vitest@0.34.0): resolution: {integrity: sha512-h72qN1D962AO7UefQVulm9JFP5ACS7OfhCdBHioXU8f7ohH/+NTZCgAqmgcfRNHHO/8wLFxx+93YVxhodkEJVA==} peerDependencies: vitest: '>=0.30.0 <1' @@ -2648,7 +2999,28 @@ packages: magic-string: 0.30.0 picocolors: 1.0.0 std-env: 3.3.3 - vitest: 0.31.0(@vitest/ui@0.31.0)(jsdom@22.0.0) + vitest: 0.34.0(@vitest/ui@0.31.0)(jsdom@22.0.0) + dev: true + + /@vitest/coverage-v8@0.34.6(vitest@0.34.0): + resolution: {integrity: sha512-fivy/OK2d/EsJFoEoxHFEnNGTg+MmdZBAVK9Ka4qhXR2K3J0DS08vcGVwzDtXSuUMabLv4KtPcpSKkcMXFDViw==} + peerDependencies: + vitest: '>=0.32.0 <1' + dependencies: + '@ampproject/remapping': 2.2.1 + '@bcoe/v8-coverage': 0.2.3 + istanbul-lib-coverage: 3.2.0 + istanbul-lib-report: 3.0.1 + istanbul-lib-source-maps: 4.0.1 + istanbul-reports: 3.1.5 + magic-string: 0.30.4 + picocolors: 1.0.0 + std-env: 3.3.3 + test-exclude: 6.0.0 + v8-to-istanbul: 9.1.0 + vitest: 0.34.0(@vitest/ui@0.31.0)(jsdom@22.0.0) + transitivePeerDependencies: + - supports-color dev: true /@vitest/expect@0.31.0: @@ -2659,6 +3031,22 @@ packages: chai: 4.3.7 dev: true + /@vitest/expect@0.32.2: + resolution: {integrity: sha512-6q5yzweLnyEv5Zz1fqK5u5E83LU+gOMVBDuxBl2d2Jfx1BAp5M+rZgc5mlyqdnxquyoiOXpXmFNkcGcfFnFH3Q==} + dependencies: + '@vitest/spy': 0.32.2 + '@vitest/utils': 0.32.2 + chai: 4.3.7 + dev: true + + /@vitest/expect@0.34.0: + resolution: {integrity: sha512-d1ZU0XomWFAFyYIc6uNuY0N8NJIWESyO/6ZmwLvlHZw0GevH4AEEpq178KjXIvSCrbHN0GnzYzitd0yjfy7+Ow==} + dependencies: + '@vitest/spy': 0.34.0 + '@vitest/utils': 0.34.0 + chai: 4.3.7 + dev: true + /@vitest/runner@0.31.0: resolution: {integrity: sha512-H1OE+Ly7JFeBwnpHTrKyCNm/oZgr+16N4qIlzzqSG/YRQDATBYmJb/KUn3GrZaiQQyL7GwpNHVZxSQd6juLCgw==} dependencies: @@ -2668,21 +3056,66 @@ packages: pathe: 1.1.0 dev: true + /@vitest/runner@0.32.2: + resolution: {integrity: sha512-06vEL0C1pomOEktGoLjzZw+1Fb+7RBRhmw/06WkDrd1akkT9i12su0ku+R/0QM69dfkIL/rAIDTG+CSuQVDcKw==} + dependencies: + '@vitest/utils': 0.32.2 + concordance: 5.0.4 + p-limit: 4.0.0 + pathe: 1.1.1 + dev: true + + /@vitest/runner@0.34.0: + resolution: {integrity: sha512-xaqM+oArJothtYXzy/dwu/iHe93Khq5QkvnYbzTxiLA0enD2peft1cask3yE6cJpwMkr7C2D1uMJwnTt4mquDw==} + dependencies: + '@vitest/utils': 0.34.0 + p-limit: 4.0.0 + pathe: 1.1.1 + dev: true + /@vitest/snapshot@0.31.0: resolution: {integrity: sha512-5dTXhbHnyUMTMOujZPB0wjFjQ6q5x9c8TvAsSPUNKjp1tVU7i9pbqcKPqntyu2oXtmVxKbuHCqrOd+Ft60r4tg==} dependencies: - magic-string: 0.30.0 + magic-string: 0.30.4 pathe: 1.1.0 pretty-format: 27.5.1 dev: true + /@vitest/snapshot@0.32.2: + resolution: {integrity: sha512-JwhpeH/PPc7GJX38vEfCy9LtRzf9F4er7i4OsAJyV7sjPwjj+AIR8cUgpMTWK4S3TiamzopcTyLsZDMuldoi5A==} + dependencies: + magic-string: 0.30.4 + pathe: 1.1.1 + pretty-format: 27.5.1 + dev: true + + /@vitest/snapshot@0.34.0: + resolution: {integrity: sha512-eGN5XBZHYOghxCOQbf8dcn6/3g7IW77GOOOC/mNFYwRXsPeoQgcgWnhj+6wgJ04pVv25wpxWL9jUkzaQ7LoFtg==} + dependencies: + magic-string: 0.30.4 + pathe: 1.1.1 + pretty-format: 29.7.0 + dev: true + /@vitest/spy@0.31.0: resolution: {integrity: sha512-IzCEQ85RN26GqjQNkYahgVLLkULOxOm5H/t364LG0JYb3Apg0PsYCHLBYGA006+SVRMWhQvHlBBCyuByAMFmkg==} dependencies: - tinyspy: 2.1.0 + tinyspy: 2.2.0 + dev: true + + /@vitest/spy@0.32.2: + resolution: {integrity: sha512-Q/ZNILJ4ca/VzQbRM8ur3Si5Sardsh1HofatG9wsJY1RfEaw0XKP8IVax2lI1qnrk9YPuG9LA2LkZ0EI/3d4ug==} + dependencies: + tinyspy: 2.2.0 dev: true - /@vitest/ui@0.31.0(vitest@0.31.0): + /@vitest/spy@0.34.0: + resolution: {integrity: sha512-0SZaWrQvL9ZiF/uJvyWSvsKjfuMvD1M6dE5BbE4Dmt8Vh3k4htwCV8g3ce8YOYmJSxkbh6TNOpippD6NVsxW6w==} + dependencies: + tinyspy: 2.2.0 + dev: true + + /@vitest/ui@0.31.0(vitest@0.34.0): resolution: {integrity: sha512-Dy86l6r3/dbJposgm7w+oqb/15UWJ0lDBbEQaS1ived3+0CTaMbT8OMkUf9vNBkSL47kvBHEBnZLa5fw5i9gUQ==} peerDependencies: vitest: '>=0.30.1 <1' @@ -2694,7 +3127,7 @@ packages: pathe: 1.1.0 picocolors: 1.0.0 sirv: 2.0.3 - vitest: 0.31.0(@vitest/ui@0.31.0)(jsdom@22.0.0) + vitest: 0.34.0(@vitest/ui@0.31.0)(jsdom@22.0.0) dev: true /@vitest/utils@0.31.0: @@ -2705,6 +3138,22 @@ packages: pretty-format: 27.5.1 dev: true + /@vitest/utils@0.32.2: + resolution: {integrity: sha512-lnJ0T5i03j0IJaeW73hxe2AuVnZ/y1BhhCOuIcl9LIzXnbpXJT9Lrt6brwKHXLOiA7MZ6N5hSJjt0xE1dGNCzQ==} + dependencies: + diff-sequences: 29.6.3 + loupe: 2.3.6 + pretty-format: 27.5.1 + dev: true + + /@vitest/utils@0.34.0: + resolution: {integrity: sha512-IktrDLhBKf3dEUUxH+lcHiPnaw952+GdGvoxg99liMscgP6IePf6LuMY7B9dEIHkFunB1R8VMR/wmI/4UGg1aw==} + dependencies: + diff-sequences: 29.6.3 + loupe: 2.3.6 + pretty-format: 29.7.0 + dev: true + /@vue/compiler-core@3.3.2: resolution: {integrity: sha512-CKZWo1dzsQYTNTft7whzjL0HsrEpMfiK7pjZ2WFE3bC1NA7caUjWioHSK+49y/LK7Bsm4poJZzAMnvZMQ7OTeg==} dependencies: @@ -2750,7 +3199,7 @@ packages: '@vue/compiler-core': 3.3.2 '@vue/shared': 3.3.2 estree-walker: 2.0.2 - magic-string: 0.30.0 + magic-string: 0.30.4 dev: true /@vue/shared@3.3.2: @@ -2901,12 +3350,12 @@ packages: engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dev: true - /acorn-jsx@5.3.2(acorn@8.8.2): + /acorn-jsx@5.3.2(acorn@8.10.0): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - acorn: 8.8.2 + acorn: 8.10.0 /acorn-walk@8.2.0: resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} @@ -2918,8 +3367,8 @@ packages: hasBin: true dev: false - /acorn@8.8.2: - resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} + /acorn@8.10.0: + resolution: {integrity: sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==} engines: {node: '>=0.4.0'} hasBin: true @@ -3088,6 +3537,12 @@ packages: deep-equal: 2.2.1 dev: true + /aria-query@5.3.0: + resolution: {integrity: sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==} + dependencies: + dequal: 2.0.3 + dev: true + /arr-diff@4.0.0: resolution: {integrity: sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA==} engines: {node: '>=0.10.0'} @@ -3248,6 +3703,12 @@ packages: deep-equal: 2.2.1 dev: true + /axobject-query@3.2.1: + resolution: {integrity: sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==} + dependencies: + dequal: 2.0.3 + dev: true + /bail@2.0.2: resolution: {integrity: sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==} @@ -3322,27 +3783,6 @@ packages: resolution: {integrity: sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==} dev: false - /bob-the-bundler@7.0.1(typescript@5.0.4): - resolution: {integrity: sha512-TFpj2AcCzTNVyMZ5ixHqJndJ9KyIUGrgTMMciz88X0HCRDujoUQL+D+61shAY+K20bM4q5Yn/NunbdiPC9drjA==} - engines: {node: '>=16', pnpm: '>=8'} - hasBin: true - peerDependencies: - typescript: ^5.0.0 - dependencies: - consola: 3.2.3 - execa: 7.1.1 - fs-extra: 11.1.1 - globby: 13.1.4 - js-yaml: 4.1.0 - lodash.get: 4.4.2 - p-limit: 4.0.0 - resolve.exports: 2.0.2 - tslib: 2.5.0 - typescript: 5.0.4 - yargs: 17.7.2 - zod: 3.22.4 - dev: true - /boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} dev: true @@ -3497,7 +3937,7 @@ packages: /builtins@5.0.1: resolution: {integrity: sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==} dependencies: - semver: 7.5.1 + semver: 7.5.4 dev: true /bundle-name@3.0.0: @@ -3846,6 +4286,16 @@ packages: engines: {node: '>=6'} dev: false + /code-red@1.0.4: + resolution: {integrity: sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==} + dependencies: + '@jridgewell/sourcemap-codec': 1.4.15 + '@types/estree': 1.0.1 + acorn: 8.10.0 + estree-walker: 3.0.3 + periscopic: 3.1.0 + dev: true + /collection-visit@1.0.0: resolution: {integrity: sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw==} engines: {node: '>=0.10.0'} @@ -3953,15 +4403,10 @@ packages: js-string-escape: 1.0.1 lodash: 4.17.21 md5-hex: 3.0.1 - semver: 7.5.1 + semver: 7.5.4 well-known-symbols: 2.0.0 dev: true - /consola@3.2.3: - resolution: {integrity: sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==} - engines: {node: ^14.18.0 || >=16.10.0} - dev: true - /console-browserify@1.2.0: resolution: {integrity: sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==} dev: false @@ -4688,6 +5133,11 @@ packages: engines: {node: '>=10'} dev: true + /define-lazy-prop@2.0.0: + resolution: {integrity: sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==} + engines: {node: '>=8'} + dev: true + /define-lazy-prop@3.0.0: resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} engines: {node: '>=12'} @@ -4764,6 +5214,11 @@ packages: resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} dev: true + /diff-sequences@29.6.3: + resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dev: true + /diff@5.1.0: resolution: {integrity: sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==} engines: {node: '>=0.3.1'} @@ -5106,6 +5561,15 @@ packages: engines: {node: '>=12'} dev: false + /eslint-config-prettier@8.5.0(eslint@8.28.0): + resolution: {integrity: sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==} + hasBin: true + peerDependencies: + eslint: '>=7.0.0' + dependencies: + eslint: 8.28.0 + dev: true + /eslint-config-prettier@8.8.0(eslint@8.40.0): resolution: {integrity: sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==} hasBin: true @@ -5155,8 +5619,8 @@ packages: peerDependencies: eslint: '>=8.0.0' dependencies: - acorn: 8.8.2 - acorn-jsx: 5.3.2(acorn@8.8.2) + acorn: 8.10.0 + acorn-jsx: 5.3.2(acorn@8.10.0) eslint: 8.40.0 espree: 9.5.2 estree-util-visit: 1.2.1 @@ -5330,7 +5794,7 @@ packages: is-core-module: 2.12.0 minimatch: 3.1.2 resolve: 1.22.2 - semver: 7.5.1 + semver: 7.5.4 dev: true /eslint-plugin-promise@6.1.1(eslint@8.40.0): @@ -5384,14 +5848,30 @@ packages: eslint: 8.40.0 dev: true - /eslint-plugin-svelte3@4.0.0(eslint@8.40.0)(svelte@3.59.1): - resolution: {integrity: sha512-OIx9lgaNzD02+MDFNLw0GEUbuovNcglg+wnd/UY0fbZmlQSz7GlQiQ1f+yX0XvC07XPcDOnFcichqI3xCwp71g==} + /eslint-plugin-svelte@2.30.0(eslint@8.28.0)(svelte@4.0.5): + resolution: {integrity: sha512-2/qj0BJsfM0U2j4EjGb7iC/0nbUvXx1Gn78CdtyuXpi/rSomLPCPwnsZsloXMzlt6Xwe8LBlpRvZObSKEHLP5A==} + engines: {node: ^14.17.0 || >=16.0.0} peerDependencies: - eslint: '>=8.0.0' - svelte: ^3.2.0 + eslint: ^7.0.0 || ^8.0.0-0 + svelte: ^3.37.0 || ^4.0.0-0 + peerDependenciesMeta: + svelte: + optional: true dependencies: - eslint: 8.40.0 - svelte: 3.59.1 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.28.0) + '@jridgewell/sourcemap-codec': 1.4.15 + debug: 4.3.4 + eslint: 8.28.0 + esutils: 2.0.3 + known-css-properties: 0.27.0 + postcss: 8.4.31 + postcss-load-config: 3.1.4(postcss@8.4.31) + postcss-safe-parser: 6.0.0(postcss@8.4.31) + svelte: 4.0.5 + svelte-eslint-parser: 0.30.0(svelte@4.0.5) + transitivePeerDependencies: + - supports-color + - ts-node dev: true /eslint-plugin-unicorn@46.0.1(eslint@8.40.0): @@ -5415,7 +5895,7 @@ packages: regexp-tree: 0.1.27 regjsparser: 0.9.1 safe-regex: 2.1.1 - semver: 7.5.1 + semver: 7.5.4 strip-indent: 3.0.0 dev: true @@ -5465,6 +5945,16 @@ packages: eslint-visitor-keys: 1.3.0 dev: true + /eslint-utils@3.0.0(eslint@8.28.0): + resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} + engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} + peerDependencies: + eslint: '>=5' + dependencies: + eslint: 8.28.0 + eslint-visitor-keys: 2.1.0 + dev: true + /eslint-utils@3.0.0(eslint@8.40.0): resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} @@ -5490,6 +5980,54 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true + /eslint@8.28.0: + resolution: {integrity: sha512-S27Di+EVyMxcHiwDrFzk8dJYAaD+/5SoWKxL1ri/71CRHsnJnRDPNt2Kzj24+MT9FDupf4aqqyqPrvI8MvQ4VQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + hasBin: true + dependencies: + '@eslint/eslintrc': 1.4.1 + '@humanwhocodes/config-array': 0.11.8 + '@humanwhocodes/module-importer': 1.0.1 + '@nodelib/fs.walk': 1.2.8 + ajv: 6.12.6 + chalk: 4.1.2 + cross-spawn: 7.0.3 + debug: 4.3.4 + doctrine: 3.0.0 + escape-string-regexp: 4.0.0 + eslint-scope: 7.2.0 + eslint-utils: 3.0.0(eslint@8.28.0) + eslint-visitor-keys: 3.4.1 + espree: 9.5.2 + esquery: 1.5.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 6.0.1 + find-up: 5.0.0 + glob-parent: 6.0.2 + globals: 13.20.0 + grapheme-splitter: 1.0.4 + ignore: 5.2.4 + import-fresh: 3.3.0 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + is-path-inside: 3.0.3 + js-sdsl: 4.4.0 + js-yaml: 4.1.0 + json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.4.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.1 + regexpp: 3.2.0 + strip-ansi: 6.0.1 + strip-json-comments: 3.1.1 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + dev: true + /eslint@8.40.0: resolution: {integrity: sha512-bvR+TsP9EHL3TqNtj9sCNJVAFK3fBN8Q7g5waghxyRsPLIMwL73XSKnZFK0hk/O2ANC+iAoq6PWMQ+IfBAJIiQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -5547,8 +6085,8 @@ packages: resolution: {integrity: sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - acorn: 8.8.2 - acorn-jsx: 5.3.2(acorn@8.8.2) + acorn: 8.10.0 + acorn-jsx: 5.3.2(acorn@8.10.0) eslint-visitor-keys: 3.4.1 dev: true @@ -5650,7 +6188,6 @@ packages: resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} dependencies: '@types/estree': 1.0.1 - dev: false /esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} @@ -5979,15 +6516,6 @@ packages: readable-stream: 2.3.8 dev: false - /fs-extra@11.1.1: - resolution: {integrity: sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==} - engines: {node: '>=14.14'} - dependencies: - graceful-fs: 4.2.11 - jsonfile: 6.1.0 - universalify: 2.0.0 - dev: true - /fs-extra@7.0.1: resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} engines: {node: '>=6 <7 || >=8'} @@ -6271,6 +6799,10 @@ packages: resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} dev: true + /graphemer@1.4.0: + resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + dev: true + /gray-matter@4.0.3: resolution: {integrity: sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==} engines: {node: '>=6.0'} @@ -6656,12 +7188,6 @@ packages: engines: {node: '>=14.18.0'} dev: true - /husky@8.0.3: - resolution: {integrity: sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==} - engines: {node: '>=14'} - hasBin: true - dev: true - /iconv-lite@0.4.24: resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} engines: {node: '>=0.10.0'} @@ -7072,7 +7598,6 @@ packages: resolution: {integrity: sha512-baJJdQLiYaJdvFbJqXrcGv3WU3QCzBlUcI5QhbesIm6/xPsvmO+2CDoi/GMOFBQEQm+PXkwOPrp9KK5ozZsp2w==} dependencies: '@types/estree': 1.0.1 - dev: false /is-regex@1.1.4: resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} @@ -7209,6 +7734,26 @@ packages: supports-color: 7.2.0 dev: true + /istanbul-lib-report@3.0.1: + resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} + engines: {node: '>=10'} + dependencies: + istanbul-lib-coverage: 3.2.0 + make-dir: 4.0.0 + supports-color: 7.2.0 + dev: true + + /istanbul-lib-source-maps@4.0.1: + resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} + engines: {node: '>=10'} + dependencies: + debug: 4.3.4 + istanbul-lib-coverage: 3.2.0 + source-map: 0.6.1 + transitivePeerDependencies: + - supports-color + dev: true + /istanbul-reports@3.1.5: resolution: {integrity: sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==} engines: {node: '>=8'} @@ -7350,10 +7895,10 @@ packages: resolution: {integrity: sha512-9xZPKVYp9DxnM3sd1yAsh/d59iIaswDkai8oTxbursfKYbg/ibjX0IzFt35+VZ8iEW453TVTXztnRvYUQlAfUQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - acorn: 8.8.2 + acorn: 8.10.0 eslint-visitor-keys: 3.4.1 espree: 9.5.2 - semver: 7.5.1 + semver: 7.5.4 dev: true /jsonc-parser@3.2.0: @@ -7366,14 +7911,6 @@ packages: graceful-fs: 4.2.11 dev: true - /jsonfile@6.1.0: - resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} - dependencies: - universalify: 2.0.0 - optionalDependencies: - graceful-fs: 4.2.11 - dev: true - /jsx-ast-utils@3.3.3: resolution: {integrity: sha512-fYQHZTZ8jSfmWZ0iyzfwiU4WDX4HpHbMCZ3gPlWYiCl3BoeOTsqKBqnTVfH2rYT7eP5c3sVbeSPHnnJOaTrWiw==} engines: {node: '>=4.0'} @@ -7426,6 +7963,10 @@ packages: resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} engines: {node: '>=6'} + /known-css-properties@0.27.0: + resolution: {integrity: sha512-uMCj6+hZYDoffuvAJjFAPz56E9uoowFHmTkqRtRq5WyC5Q6Cu/fTZKNQpX/RbzChBYLLl3lo8CjFZBAZXq9qFg==} + dev: true + /language-subtag-registry@0.3.22: resolution: {integrity: sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w==} dev: true @@ -7528,6 +8069,10 @@ packages: engines: {node: '>=14'} dev: true + /locate-character@3.0.0: + resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==} + dev: true + /locate-path@3.0.0: resolution: {integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==} engines: {node: '>=6'} @@ -7554,10 +8099,6 @@ packages: resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} dev: false - /lodash.get@4.4.2: - resolution: {integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==} - dev: true - /lodash.memoize@4.1.2: resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} dev: true @@ -7666,6 +8207,13 @@ packages: semver: 6.3.0 dev: true + /make-dir@4.0.0: + resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} + engines: {node: '>=10'} + dependencies: + semver: 7.5.4 + dev: true + /map-cache@0.2.2: resolution: {integrity: sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==} engines: {node: '>=0.10.0'} @@ -8289,8 +8837,8 @@ packages: /micromark-extension-mdxjs@1.0.1: resolution: {integrity: sha512-7YA7hF6i5eKOfFUzZ+0z6avRG52GpWR8DL+kN47y3f2KhxbBZMhmxe7auOeaTBrW2DenbbZTf1ea9tA2hDpC2Q==} dependencies: - acorn: 8.8.2 - acorn-jsx: 5.3.2(acorn@8.8.2) + acorn: 8.10.0 + acorn-jsx: 5.3.2(acorn@8.10.0) micromark-extension-mdx-expression: 1.0.5 micromark-extension-mdx-jsx: 1.0.4 micromark-extension-mdx-md: 1.0.1 @@ -8781,12 +9329,21 @@ packages: /mlly@1.2.1: resolution: {integrity: sha512-1aMEByaWgBPEbWV2BOPEMySRrzl7rIHXmQxam4DM8jVjalTQDjpN2ZKOLUrwyhfZQO7IXHml2StcHMhooDeEEQ==} dependencies: - acorn: 8.8.2 - pathe: 1.1.0 + acorn: 8.10.0 + pathe: 1.1.1 pkg-types: 1.0.3 ufo: 1.1.2 dev: true + /mlly@1.4.2: + resolution: {integrity: sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==} + dependencies: + acorn: 8.10.0 + pathe: 1.1.1 + pkg-types: 1.0.3 + ufo: 1.3.1 + dev: true + /move-concurrently@1.0.1: resolution: {integrity: sha512-hdrFxZOycD/g6A6SoI2bB5NA/5NEqD0569+S47WZhPvm46sD50ZHdYaFmnua5lndde9rCHGjmfK7Z8BuCt/PcQ==} dependencies: @@ -9283,6 +9840,15 @@ packages: mimic-fn: 4.0.0 dev: true + /open@8.4.2: + resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==} + engines: {node: '>=12'} + dependencies: + define-lazy-prop: 2.0.0 + is-docker: 2.2.1 + is-wsl: 2.2.0 + dev: true + /open@9.1.0: resolution: {integrity: sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg==} engines: {node: '>=14.16'} @@ -9542,6 +10108,10 @@ packages: resolution: {integrity: sha512-ODbEPR0KKHqECXW1GoxdDb+AZvULmXjVPy4rt+pGo2+TnjJTIPJQSVS6N63n8T2Ip+syHhbn52OewKicV0373w==} dev: true + /pathe@1.1.1: + resolution: {integrity: sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==} + dev: true + /pathval@1.1.1: resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} dev: true @@ -9563,7 +10133,6 @@ packages: '@types/estree': 1.0.1 estree-walker: 3.0.3 is-reference: 3.0.1 - dev: false /picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} @@ -9604,14 +10173,8 @@ packages: resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} dependencies: jsonc-parser: 3.2.0 - mlly: 1.2.1 - pathe: 1.1.0 - dev: true - - /playwright-core@1.33.0: - resolution: {integrity: sha512-aizyPE1Cj62vAECdph1iaMILpT0WUDCq3E6rW6I+dleSbBoGbktvJtzS6VHkZ4DKNEOG9qJpiom/ZxO+S15LAw==} - engines: {node: '>=14'} - hasBin: true + mlly: 1.4.2 + pathe: 1.1.1 dev: true /pluralize@8.0.0: @@ -9729,9 +10292,26 @@ packages: postcss: 8.4.23 dev: true - /postcss-load-config@4.0.1(postcss@8.4.23): - resolution: {integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==} - engines: {node: '>= 14'} + /postcss-load-config@3.1.4(postcss@8.4.31): + resolution: {integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==} + engines: {node: '>= 10'} + peerDependencies: + postcss: '>=8.0.9' + ts-node: '>=9.0.0' + peerDependenciesMeta: + postcss: + optional: true + ts-node: + optional: true + dependencies: + lilconfig: 2.1.0 + postcss: 8.4.31 + yaml: 1.10.2 + dev: true + + /postcss-load-config@4.0.1(postcss@8.4.23): + resolution: {integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==} + engines: {node: '>= 14'} peerDependencies: postcss: '>=8.0.9' ts-node: '>=9.0.0' @@ -9946,6 +10526,15 @@ packages: postcss-value-parser: 4.2.0 dev: true + /postcss-safe-parser@6.0.0(postcss@8.4.31): + resolution: {integrity: sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ==} + engines: {node: '>=12.0'} + peerDependencies: + postcss: ^8.3.3 + dependencies: + postcss: 8.4.31 + dev: true + /postcss-selector-parser@6.0.12: resolution: {integrity: sha512-NdxGCAZdRrwVI1sy59+Wzrh+pMMHxapGnpfenDVlMEXoOcvt4pGE0JLK9YY2F5dLxcFYA/YbVQKhcGU+FtSYQg==} engines: {node: '>=4'} @@ -10046,6 +10635,22 @@ packages: svelte: 3.59.1 dev: true + /prettier-plugin-svelte@2.10.1(prettier@2.8.0)(svelte@4.0.5): + resolution: {integrity: sha512-Wlq7Z5v2ueCubWo0TZzKc9XHcm7TDxqcuzRuGd0gcENfzfT4JZ9yDlCbEgxWgiPmLHkBjfOtpAWkcT28MCDpUQ==} + peerDependencies: + prettier: ^1.16.4 || ^2.0.0 + svelte: ^3.2.0 || ^4.0.0-next.0 + dependencies: + prettier: 2.8.0 + svelte: 4.0.5 + dev: true + + /prettier@2.8.0: + resolution: {integrity: sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==} + engines: {node: '>=10.13.0'} + hasBin: true + dev: true + /prettier@2.8.8: resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} engines: {node: '>=10.13.0'} @@ -10061,6 +10666,15 @@ packages: react-is: 17.0.2 dev: true + /pretty-format@29.7.0: + resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/schemas': 29.6.3 + ansi-styles: 5.2.0 + react-is: 18.2.0 + dev: true + /proc-log@3.0.0: resolution: {integrity: sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -10119,8 +10733,8 @@ packages: safe-buffer: 5.2.1 dev: false - /publint@0.1.11: - resolution: {integrity: sha512-sD0rtIEadks83MkpomJswBO/YHExJLkta1TyqUhb0/aVV+o3ZlVnwsDPjCAow8tpfxmLGutCSLWq32yfhPB98w==} + /publint@0.1.9: + resolution: {integrity: sha512-O53y7vbePxuGFmEjgcrafMSlDpOJwOkj8YdexOt7yWlv7SB3rXoT3mHknyMJ3lf2UFH5Bmt6tnIkHcOTR6dEoA==} engines: {node: '>=16'} hasBin: true dependencies: @@ -10224,6 +10838,10 @@ packages: resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} dev: true + /react-is@18.2.0: + resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} + dev: true + /react-paginate@8.2.0(react@18.2.0): resolution: {integrity: sha512-sJCz1PW+9PNIjUSn919nlcRVuleN2YPoFBOvL+6TPgrH/3lwphqiSOgdrLafLdyLDxsgK+oSgviqacF4hxsDIw==} peerDependencies: @@ -10549,11 +11167,6 @@ packages: deprecated: https://github.com/lydell/resolve-url#deprecated dev: false - /resolve.exports@2.0.2: - resolution: {integrity: sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==} - engines: {node: '>=10'} - dev: true - /resolve@1.22.2: resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==} hasBin: true @@ -10619,12 +11232,20 @@ packages: resolution: {integrity: sha512-ndEIpszUHiG4HtDsQLeIuMvRsDnn8c8rYStabochtUeCvfuvNptb5TUbVD68LRAILPX7p9nqQGh4xJgn3EHS/g==} dev: false - /rollup@3.21.7: - resolution: {integrity: sha512-KXPaEuR8FfUoK2uHwNjxTmJ18ApyvD6zJpYv9FOJSqLStmt6xOY84l1IjK2dSolQmoXknrhEFRaPRgOPdqCT5w==} - engines: {node: '>=14.18.0', npm: '>=8.0.0'} + /rollup-plugin-visualizer@5.9.2: + resolution: {integrity: sha512-waHktD5mlWrYFrhOLbti4YgQCn1uR24nYsNuXxg7LkPH8KdTXVWR9DNY1WU0QqokyMixVXJS4J04HNrVTMP01A==} + engines: {node: '>=14'} hasBin: true - optionalDependencies: - fsevents: 2.3.2 + peerDependencies: + rollup: 2.x || 3.x + peerDependenciesMeta: + rollup: + optional: true + dependencies: + open: 8.4.2 + picomatch: 2.3.1 + source-map: 0.7.4 + yargs: 17.7.2 dev: true /rollup@3.29.4: @@ -10694,11 +11315,6 @@ packages: regexp-tree: 0.1.27 dev: true - /safe-stable-stringify@2.4.3: - resolution: {integrity: sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==} - engines: {node: '>=10'} - dev: false - /safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} @@ -10774,6 +11390,15 @@ packages: hasBin: true dependencies: lru-cache: 6.0.0 + dev: false + + /semver@7.5.4: + resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} + engines: {node: '>=10'} + hasBin: true + dependencies: + lru-cache: 6.0.0 + dev: true /serialize-javascript@4.0.0: resolution: {integrity: sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==} @@ -11000,12 +11625,10 @@ packages: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} requiresBuild: true - dev: false /source-map@0.7.4: resolution: {integrity: sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==} engines: {node: '>= 8'} - dev: false /space-separated-tokens@2.0.2: resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==} @@ -11243,7 +11866,7 @@ packages: /strip-literal@1.0.1: resolution: {integrity: sha512-QZTsipNpa2Ppr6v1AmJHESqJ3Uz247MUS0OjrnnZjFAvEoWqxuyFuXn2xLgMtRnijJShAa1HL0gtJyUs7u7n3Q==} dependencies: - acorn: 8.8.2 + acorn: 8.10.0 dev: true /style-to-object@0.4.1: @@ -11328,11 +11951,11 @@ packages: engines: {node: '>= 0.4'} dev: true - /svelte-check@3.3.2(svelte@3.59.1): - resolution: {integrity: sha512-67j3rI0LDc2DvL0ON/2pvCasVVD3nHDrTkZNr4eITNfo2oFXdw7SIyMOiFj4swu+pjmFQAigytBK1IWyik8dBw==} + /svelte-check@3.4.3(postcss@8.4.31)(svelte@4.0.5): + resolution: {integrity: sha512-O07soQFY3X0VDt+bcGc6D5naz0cLtjwnmNP9JsEBPVyMemFEqUhL2OdLqvkl5H/u8Jwm50EiAU4BPRn5iin/kg==} hasBin: true peerDependencies: - svelte: ^3.55.0 + svelte: ^3.55.0 || ^4.0.0-next.0 || ^4.0.0 dependencies: '@jridgewell/trace-mapping': 0.3.18 chokidar: 3.5.3 @@ -11340,8 +11963,8 @@ packages: import-fresh: 3.3.0 picocolors: 1.0.0 sade: 1.8.1 - svelte: 3.59.1 - svelte-preprocess: 5.0.3(svelte@3.59.1)(typescript@5.0.4) + svelte: 4.0.5 + svelte-preprocess: 5.0.4(postcss@8.4.31)(svelte@4.0.5)(typescript@5.0.4) typescript: 5.0.4 transitivePeerDependencies: - '@babel/core' @@ -11355,17 +11978,59 @@ packages: - sugarss dev: true - /svelte-hmr@0.15.1(svelte@3.59.1): - resolution: {integrity: sha512-BiKB4RZ8YSwRKCNVdNxK/GfY+r4Kjgp9jCLEy0DuqAKfmQtpL38cQK3afdpjw4sqSs4PLi3jIPJIFp259NkZtA==} + /svelte-check@3.5.2(postcss@8.4.31)(svelte@4.0.5): + resolution: {integrity: sha512-5a/YWbiH4c+AqAUP+0VneiV5bP8YOk9JL3jwvN+k2PEPLgpu85bjQc5eE67+eIZBBwUEJzmO3I92OqKcqbp3fw==} + hasBin: true + peerDependencies: + svelte: ^3.55.0 || ^4.0.0-next.0 || ^4.0.0 + dependencies: + '@jridgewell/trace-mapping': 0.3.18 + chokidar: 3.5.3 + fast-glob: 3.2.12 + import-fresh: 3.3.0 + picocolors: 1.0.0 + sade: 1.8.1 + svelte: 4.0.5 + svelte-preprocess: 5.0.4(postcss@8.4.31)(svelte@4.0.5)(typescript@5.0.4) + typescript: 5.0.4 + transitivePeerDependencies: + - '@babel/core' + - coffeescript + - less + - postcss + - postcss-load-config + - pug + - sass + - stylus + - sugarss + dev: true + + /svelte-eslint-parser@0.30.0(svelte@4.0.5): + resolution: {integrity: sha512-H0Cn2TKr70DU9p/Gb04CfwtS7eK28MYumrHYPaDNkIFbfwGDLADpbERBn7u8G1Rcm2RMr2/mL6mq0J2e8iKFlA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + svelte: ^3.37.0 || ^4.0.0-0 + peerDependenciesMeta: + svelte: + optional: true + dependencies: + eslint-scope: 7.2.0 + eslint-visitor-keys: 3.4.1 + espree: 9.5.2 + svelte: 4.0.5 + dev: true + + /svelte-hmr@0.15.3(svelte@4.0.5): + resolution: {integrity: sha512-41snaPswvSf8TJUhlkoJBekRrABDXDMdpNpT2tfHIv4JuhgvHqLMhEPGtaQn0BmbNSTkuz2Ed20DF2eHw0SmBQ==} engines: {node: ^12.20 || ^14.13.1 || >= 16} peerDependencies: - svelte: '>=3.19.0' + svelte: ^3.19.0 || ^4.0.0 dependencies: - svelte: 3.59.1 + svelte: 4.0.5 dev: true - /svelte-preprocess@5.0.3(svelte@3.59.1)(typescript@5.0.4): - resolution: {integrity: sha512-GrHF1rusdJVbOZOwgPWtpqmaexkydznKzy5qIC2FabgpFyKN57bjMUUUqPRfbBXK5igiEWn1uO/DXsa2vJ5VHA==} + /svelte-preprocess@5.0.4(postcss@8.4.31)(svelte@4.0.5)(typescript@5.0.4): + resolution: {integrity: sha512-ABia2QegosxOGsVlsSBJvoWeXy1wUKSfF7SWJdTjLAbx/Y3SrVevvvbFNQqrSJw89+lNSsM58SipmZJ5SRi5iw==} engines: {node: '>= 14.10.0'} requiresBuild: true peerDependencies: @@ -11378,7 +12043,7 @@ packages: sass: ^1.26.8 stylus: ^0.55.0 sugarss: ^2.0.0 || ^3.0.0 || ^4.0.0 - svelte: ^3.23.0 + svelte: ^3.23.0 || ^4.0.0-next.0 || ^4.0.0 typescript: '>=3.9.5 || ^4.0.0 || ^5.0.0' peerDependenciesMeta: '@babel/core': @@ -11405,21 +12070,22 @@ packages: '@types/pug': 2.0.6 detect-indent: 6.1.0 magic-string: 0.27.0 + postcss: 8.4.31 sorcery: 0.11.0 strip-indent: 3.0.0 - svelte: 3.59.1 + svelte: 4.0.5 typescript: 5.0.4 dev: true - /svelte2tsx@0.6.14(svelte@3.59.1)(typescript@5.0.4): - resolution: {integrity: sha512-Sxo9gtpc3dYWuFQ8fruZG+M+I6OZMIvOxxKjt48Lr8jD6Kr9cNf1Hf/yHUDEgDwQdRbAzn5y0FL9xk8Dx5v9lg==} + /svelte2tsx@0.6.23(svelte@4.0.5)(typescript@5.0.4): + resolution: {integrity: sha512-3bwd1PuWUA3oEXy8+85zrLDnmJOsVpShpKVAehGWeYsz/66zMihTpRpUN97VVAKTZbO5tP4wnchHUXYs0zOwdw==} peerDependencies: - svelte: ^3.55 + svelte: ^3.55 || ^4.0.0-next.0 || ^4.0 typescript: ^4.9.4 || ^5.0.0 dependencies: dedent-js: 1.0.1 pascal-case: 3.1.2 - svelte: 3.59.1 + svelte: 4.0.5 typescript: 5.0.4 dev: true @@ -11428,6 +12094,25 @@ packages: engines: {node: '>= 8'} dev: true + /svelte@4.0.5: + resolution: {integrity: sha512-PHKPWP1wiWHBtsE57nCb8xiWB3Ht7/3Kvi3jac0XIxUM2rep8alO7YoAtgWeGD7++tFy46krilOrPW0mG3Dx+A==} + engines: {node: '>=16'} + dependencies: + '@ampproject/remapping': 2.2.1 + '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/trace-mapping': 0.3.18 + acorn: 8.10.0 + aria-query: 5.3.0 + axobject-query: 3.2.1 + code-red: 1.0.4 + css-tree: 2.3.1 + estree-walker: 3.0.3 + is-reference: 3.0.1 + locate-character: 3.0.0 + magic-string: 0.30.4 + periscopic: 3.1.0 + dev: true + /svgo@3.0.2: resolution: {integrity: sha512-Z706C1U2pb1+JGP48fbazf3KxHrWOsLme6Rv7imFBn5EnuanDW1GPaA/P1/dvObE670JDePC3mnj0k0B7P0jjQ==} engines: {node: '>=14.0.0'} @@ -11522,7 +12207,7 @@ packages: engines: {node: '>=6.0.0'} hasBin: true dependencies: - acorn: 8.8.2 + acorn: 8.10.0 commander: 2.20.3 source-map: 0.6.1 source-map-support: 0.5.21 @@ -11589,8 +12274,13 @@ packages: engines: {node: '>=14.0.0'} dev: true - /tinyspy@2.1.0: - resolution: {integrity: sha512-7eORpyqImoOvkQJCSkL0d0mB4NHHIFAy4b1u8PHdDa7SjGS2njzl6/lyGoZLm+eyYEtlUmFGE0rFj66SWxZgQQ==} + /tinypool@0.7.0: + resolution: {integrity: sha512-zSYNUlYSMhJ6Zdou4cJwo/p7w5nmAH17GRfU/ui3ctvjXFErXXkruT4MWW6poDeXgCaIBlGLrfU6TbTXxyGMww==} + engines: {node: '>=14.0.0'} + dev: true + + /tinyspy@2.2.0: + resolution: {integrity: sha512-d2eda04AN/cPOR89F7Xv5bK/jrQEhmcLFe6HFldoeO9AJtps+fqEnh486vnT/8y4bw38pSyxDcTCAq+Ks2aJTg==} engines: {node: '>=14.0.0'} dev: true @@ -11711,6 +12401,15 @@ packages: /trough@2.1.0: resolution: {integrity: sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==} + /ts-api-utils@1.0.3(typescript@5.0.4): + resolution: {integrity: sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==} + engines: {node: '>=16.13.0'} + peerDependencies: + typescript: '>=4.2.0' + dependencies: + typescript: 5.0.4 + dev: true + /ts-dedent@2.2.0: resolution: {integrity: sha512-q5W7tVM71e2xjHZTlgfTDoPF/SmqKG5hddq9SzR49CH2hayqRKJtQ4mtRlSxKaJlR/+9rEM+mnBHf7I2/BQcpQ==} engines: {node: '>=6.10'} @@ -11733,6 +12432,10 @@ packages: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: true + /tslib@2.4.1: + resolution: {integrity: sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==} + dev: true + /tslib@2.5.0: resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==} @@ -11822,6 +12525,10 @@ packages: resolution: {integrity: sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==} dev: true + /ufo@1.3.1: + resolution: {integrity: sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==} + dev: true + /unbox-primitive@1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} dependencies: @@ -11842,6 +12549,13 @@ packages: busboy: 1.6.0 dev: true + /undici@5.25.4: + resolution: {integrity: sha512-450yJxT29qKMf3aoudzFpIciqpx6Pji3hEWaXqXmanbXF58LTAGCKxcJjxMXWu3iG+Mudgo3ZUfDB6YDFd/dAw==} + engines: {node: '>=14.0'} + dependencies: + '@fastify/busboy': 2.0.0 + dev: true + /unified-engine@10.1.0: resolution: {integrity: sha512-5+JDIs4hqKfHnJcVCxTid1yBoI/++FfF/1PFdSMpaftZZZY+qg2JFruRbf7PaIwa9KgLotXQV3gSjtY0IdcFGQ==} dependencies: @@ -11866,7 +12580,7 @@ packages: vfile-message: 3.1.4 vfile-reporter: 7.0.5 vfile-statistics: 2.0.1 - yaml: 2.2.2 + yaml: 2.3.2 transitivePeerDependencies: - supports-color dev: true @@ -12052,11 +12766,6 @@ packages: engines: {node: '>= 4.0.0'} dev: true - /universalify@2.0.0: - resolution: {integrity: sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==} - engines: {node: '>= 10.0.0'} - dev: true - /unset-value@1.0.0: resolution: {integrity: sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==} engines: {node: '>=0.10.0'} @@ -12226,7 +12935,7 @@ packages: vfile-message: 4.0.2 dev: false - /vite-node@0.31.0(@types/node@18.16.8): + /vite-node@0.31.0(@types/node@20.8.4): resolution: {integrity: sha512-8x1x1LNuPvE2vIvkSB7c1mApX5oqlgsxzHQesYF7l5n1gKrEmrClIiZuOFbFDQcjLsmcWSwwmrWrcGWm9Fxc/g==} engines: {node: '>=v14.18.0'} hasBin: true @@ -12236,7 +12945,51 @@ packages: mlly: 1.2.1 pathe: 1.1.0 picocolors: 1.0.0 - vite: 4.4.11(@types/node@18.16.8) + vite: 4.4.2(@types/node@20.8.4) + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - stylus + - sugarss + - supports-color + - terser + dev: true + + /vite-node@0.32.2(@types/node@20.8.4): + resolution: {integrity: sha512-dTQ1DCLwl2aEseov7cfQ+kDMNJpM1ebpyMMMwWzBvLbis8Nla/6c9WQcqpPssTwS6Rp/+U6KwlIj8Eapw4bLdA==} + engines: {node: '>=v14.18.0'} + hasBin: true + dependencies: + cac: 6.7.14 + debug: 4.3.4 + mlly: 1.4.2 + pathe: 1.1.1 + picocolors: 1.0.0 + vite: 4.4.2(@types/node@20.8.4) + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - stylus + - sugarss + - supports-color + - terser + dev: true + + /vite-node@0.34.0(@types/node@20.8.4): + resolution: {integrity: sha512-rGZMvpb052rjUwJA/a17xMfOibzNF7byMdRSTcN2Lw8uxX08s5EfjWW5mBkm3MSFTPctMSVtT2yC+8ShrZbT5g==} + engines: {node: '>=v14.18.0'} + hasBin: true + dependencies: + cac: 6.7.14 + debug: 4.3.4 + mlly: 1.4.2 + pathe: 1.1.1 + picocolors: 1.0.0 + vite: 4.4.2(@types/node@20.8.4) transitivePeerDependencies: - '@types/node' - less @@ -12274,13 +13027,13 @@ packages: optional: true dependencies: esbuild: 0.17.19 - postcss: 8.4.23 - rollup: 3.21.7 + postcss: 8.4.31 + rollup: 3.29.4 optionalDependencies: fsevents: 2.3.2 dev: true - /vite@4.4.11(@types/node@18.16.8): + /vite@4.4.11(@types/node@20.8.4): resolution: {integrity: sha512-ksNZJlkcU9b0lBwAGZGGaZHCMqHsc8OpgtoYhsQ4/I2v5cnpmmmqe5pM4nv/4Hn6G/2GhTdj0DhZh2e+Er1q5A==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -12308,7 +13061,43 @@ packages: terser: optional: true dependencies: - '@types/node': 18.16.8 + '@types/node': 20.8.4 + esbuild: 0.18.20 + postcss: 8.4.31 + rollup: 3.29.4 + optionalDependencies: + fsevents: 2.3.2 + dev: true + + /vite@4.4.2(@types/node@20.8.4): + resolution: {integrity: sha512-zUcsJN+UvdSyHhYa277UHhiJ3iq4hUBwHavOpsNUGsTgjBeoBlK8eDt+iT09pBq0h9/knhG/SPrZiM7cGmg7NA==} + engines: {node: ^14.18.0 || >=16.0.0} + hasBin: true + peerDependencies: + '@types/node': '>= 14' + less: '*' + lightningcss: ^1.21.0 + sass: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + dependencies: + '@types/node': 20.8.4 esbuild: 0.18.20 postcss: 8.4.31 rollup: 3.29.4 @@ -12327,6 +13116,17 @@ packages: vite: 4.3.5 dev: true + /vitefu@0.2.4(vite@4.4.2): + resolution: {integrity: sha512-fanAXjSaf9xXtOOeno8wZXIhgia+CZury481LsDaV++lSvcU2R9Ch2bPh3PYFyoHW+w9LqAeYRISVQjUIew14g==} + peerDependencies: + vite: ^3.0.0 || ^4.0.0 + peerDependenciesMeta: + vite: + optional: true + dependencies: + vite: 4.4.2(@types/node@20.8.4) + dev: true + /vitest@0.31.0(@vitest/ui@0.31.0)(jsdom@22.0.0): resolution: {integrity: sha512-JwWJS9p3GU9GxkG7eBSmr4Q4x4bvVBSswaCFf1PBNHiPx00obfhHRJfgHcnI0ffn+NMlIh9QGvG75FlaIBdKGA==} engines: {node: '>=v14.18.0'} @@ -12360,14 +13160,14 @@ packages: dependencies: '@types/chai': 4.3.5 '@types/chai-subset': 1.3.3 - '@types/node': 18.16.8 + '@types/node': 20.8.4 '@vitest/expect': 0.31.0 '@vitest/runner': 0.31.0 '@vitest/snapshot': 0.31.0 '@vitest/spy': 0.31.0 - '@vitest/ui': 0.31.0(vitest@0.31.0) + '@vitest/ui': 0.31.0(vitest@0.34.0) '@vitest/utils': 0.31.0 - acorn: 8.8.2 + acorn: 8.10.0 acorn-walk: 8.2.0 cac: 6.7.14 chai: 4.3.7 @@ -12375,15 +13175,150 @@ packages: debug: 4.3.4 jsdom: 22.0.0 local-pkg: 0.4.3 - magic-string: 0.30.0 - pathe: 1.1.0 + magic-string: 0.30.4 + pathe: 1.1.1 picocolors: 1.0.0 std-env: 3.3.3 strip-literal: 1.0.1 tinybench: 2.5.0 tinypool: 0.5.0 - vite: 4.4.11(@types/node@18.16.8) - vite-node: 0.31.0(@types/node@18.16.8) + vite: 4.4.11(@types/node@20.8.4) + vite-node: 0.31.0(@types/node@20.8.4) + why-is-node-running: 2.2.2 + transitivePeerDependencies: + - less + - lightningcss + - sass + - stylus + - sugarss + - supports-color + - terser + dev: true + + /vitest@0.32.2(@vitest/ui@0.31.0)(jsdom@22.0.0): + resolution: {integrity: sha512-hU8GNNuQfwuQmqTLfiKcqEhZY72Zxb7nnN07koCUNmntNxbKQnVbeIS6sqUgR3eXSlbOpit8+/gr1KpqoMgWCQ==} + engines: {node: '>=v14.18.0'} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@vitest/browser': '*' + '@vitest/ui': '*' + happy-dom: '*' + jsdom: '*' + playwright: '*' + safaridriver: '*' + webdriverio: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + playwright: + optional: true + safaridriver: + optional: true + webdriverio: + optional: true + dependencies: + '@types/chai': 4.3.5 + '@types/chai-subset': 1.3.3 + '@types/node': 20.8.4 + '@vitest/expect': 0.32.2 + '@vitest/runner': 0.32.2 + '@vitest/snapshot': 0.32.2 + '@vitest/spy': 0.32.2 + '@vitest/ui': 0.31.0(vitest@0.34.0) + '@vitest/utils': 0.32.2 + acorn: 8.10.0 + acorn-walk: 8.2.0 + cac: 6.7.14 + chai: 4.3.7 + concordance: 5.0.4 + debug: 4.3.4 + jsdom: 22.0.0 + local-pkg: 0.4.3 + magic-string: 0.30.4 + pathe: 1.1.1 + picocolors: 1.0.0 + std-env: 3.3.3 + strip-literal: 1.0.1 + tinybench: 2.5.0 + tinypool: 0.5.0 + vite: 4.4.2(@types/node@20.8.4) + vite-node: 0.32.2(@types/node@20.8.4) + why-is-node-running: 2.2.2 + transitivePeerDependencies: + - less + - lightningcss + - sass + - stylus + - sugarss + - supports-color + - terser + dev: true + + /vitest@0.34.0(@vitest/ui@0.31.0)(jsdom@22.0.0): + resolution: {integrity: sha512-8Pnc1fVt1P6uBncdUZ++hgiJGgxIRKuz4bmS/PQziaEcUj0D1g9cGiR1MbLrcsvFTC6fgrqDhYoTAdBG356WMA==} + engines: {node: '>=v14.18.0'} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@vitest/browser': '*' + '@vitest/ui': '*' + happy-dom: '*' + jsdom: '*' + playwright: '*' + safaridriver: '*' + webdriverio: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + playwright: + optional: true + safaridriver: + optional: true + webdriverio: + optional: true + dependencies: + '@types/chai': 4.3.5 + '@types/chai-subset': 1.3.3 + '@types/node': 20.8.4 + '@vitest/expect': 0.34.0 + '@vitest/runner': 0.34.0 + '@vitest/snapshot': 0.34.0 + '@vitest/spy': 0.34.0 + '@vitest/ui': 0.31.0(vitest@0.34.0) + '@vitest/utils': 0.34.0 + acorn: 8.10.0 + acorn-walk: 8.2.0 + cac: 6.7.14 + chai: 4.3.7 + debug: 4.3.4 + jsdom: 22.0.0 + local-pkg: 0.4.3 + magic-string: 0.30.4 + pathe: 1.1.1 + picocolors: 1.0.0 + std-env: 3.3.3 + strip-literal: 1.0.1 + tinybench: 2.5.0 + tinypool: 0.7.0 + vite: 4.4.2(@types/node@20.8.4) + vite-node: 0.34.0(@types/node@20.8.4) why-is-node-running: 2.2.2 transitivePeerDependencies: - less @@ -12468,7 +13403,7 @@ packages: engines: {node: '>= 10.13.0'} hasBin: true dependencies: - acorn: 8.8.2 + acorn: 8.10.0 acorn-walk: 8.2.0 chalk: 4.1.2 commander: 7.2.0 @@ -12732,7 +13667,12 @@ packages: dependencies: eslint-visitor-keys: 3.4.1 lodash: 4.17.21 - yaml: 2.2.2 + yaml: 2.3.2 + dev: true + + /yaml@1.10.2: + resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} + engines: {node: '>= 6'} dev: true /yaml@2.2.2: @@ -12743,7 +13683,6 @@ packages: /yaml@2.3.2: resolution: {integrity: sha512-N/lyzTPaJasoDmfV7YTrYCI0G/3ivm/9wdG0aHuheKowWQwGTsK0Eoiw6utmzAnI6pkJa0DUVygvp3spqqEKXg==} engines: {node: '>= 14'} - dev: false /yargs-parser@18.1.3: resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} @@ -12826,6 +13765,7 @@ packages: /zod@3.22.4: resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} + dev: false /zwitch@2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} diff --git a/scripts/package.js b/scripts/package.js new file mode 100644 index 000000000..15a2ebfc4 --- /dev/null +++ b/scripts/package.js @@ -0,0 +1,95 @@ +import { execSync } from 'child_process' +import fs from 'fs' +import path from 'path' +import { exit } from 'process' + +// Some constants +const toCopy = ['README.md', 'LICENSE', 'CHANGELOG.md'] +const tmpFolder = 'dist-tmp' + +// Where are we? +const packageDirPath = process.cwd() + +// package.json +const packageJsonPath = path.join(packageDirPath, 'package.json') +const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8')) + +// adjust pkg json however you like ... +delete pkg.publishConfig +delete pkg.scripts +delete pkg.devDependencies + +// It's not allowed to have an empty scripts object +pkg.scripts = { + test: `echo hello ${pkg.name}!`, +} + +// let's move dist to another layer of dist! +execSync(`rm -rf ${path.join(packageDirPath, tmpFolder)}`) +fs.mkdirSync(path.join(packageDirPath, tmpFolder)) +fs.writeFileSync(path.join(packageDirPath, tmpFolder, 'package.json'), JSON.stringify(pkg, null, 2)) +copy(path.join(packageDirPath, 'dist'), path.join(packageDirPath, tmpFolder, 'dist'), {}, []) +// write it to your output directory +for (const item of toCopy) { + let from = path.join(packageDirPath, item) + // check if we have a global file? (2 levels up) + if (!fs.existsSync(from)) { + from = path.join(packageDirPath, '../..', item) + } + if (!fs.existsSync(from)) { + console.error(`File missing: "${from}"`) + exit(1) + } + const to = path.join(packageDirPath, tmpFolder, item) + fs.writeFileSync(to, fs.readFileSync(from, 'utf-8')) +} + +execSync(`rm -rf ${path.join(packageDirPath, 'dist')}`) +fs.renameSync(path.join(packageDirPath, tmpFolder), path.join(packageDirPath, 'dist')) + +console.log(`✅ @kitql scripts/package "${pkg.name}" done`) + +function copy( + /** @type {string} */ sourceDir, + /** @type {string} */ destDir, + /** @type {Record} */ transformMap = {}, + /** @type {string[]} */ ignoreList = [], +) { + if (!fs.existsSync(destDir)) { + fs.mkdirSync(destDir) + } + + const files = fs.readdirSync(sourceDir) + for (const file of files) { + const sourceFilePath = path.join(sourceDir, file) + const sourceRelative = path.relative(process.cwd(), sourceFilePath) + // skip the ignore list + if ( + !ignoreList.includes(sourceRelative) && + !sourceRelative.includes('spec.') && + !sourceRelative.includes('test.') + ) { + const destFilePath = path.join(destDir, file) + + const stats = fs.statSync(sourceFilePath) + + // files need to be copied and potentially transformed + if (stats.isFile()) { + // read the source file + const source = fs.readFileSync(sourceFilePath) + + // apply any transformations if necessary + const transformed = Object.entries(transformMap).reduce((prev, [pattern, value]) => { + return prev.replaceAll(pattern, value) + }, source.toString()) + + // write the result + fs.writeFileSync(destFilePath, transformed) + } + // if we run into a directory then we should keep going + else if (stats.isDirectory()) { + copy(sourceFilePath, destFilePath, transformMap, ignoreList) + } + } + } +} diff --git a/scripts/packageJsonFormat.js b/scripts/packageJsonFormat.js new file mode 100644 index 000000000..e387927f8 --- /dev/null +++ b/scripts/packageJsonFormat.js @@ -0,0 +1,47 @@ +// Where are we? +const packageDirPath = process.cwd() + +// package.json +const packageJsonPath = path.join(packageDirPath, 'package.json') +const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8')) + +// rewrite package.json te be in the right order! +fs.writeFileSync( + packageJsonPath, + JSON.stringify( + { + name: pkg.name, + description: pkg.description ?? 'Missing!!!', + version: pkg.version, + license: 'MIT', + type: 'module', + repository: { + type: pkg.repository?.type ?? 'git', + url: pkg.repository?.url ?? 'https://github.com/jycouet/kitql', + directory: pkg.repository?.directory ?? 'packages/' + pkg.name, + homepage: + pkg.repository?.homepage ?? 'https://github.com/jycouet/kitql/tree/main/packages/???', + }, + scripts: pkg.scripts, + peerDependencies: pkg.peerDependencies, + devDependencies: pkg.devDependencies, + dependencies: pkg.dependencies, + sideEffects: pkg.sideEffects ?? false, // Key for tree shaking! + publishConfig: { + directory: pkg.publishConfig?.directory ?? 'dist', + access: pkg.publishConfig?.access ?? 'public', + }, + files: pkg.files ?? ['dist', '!dist/**/*.test.*', '!dist/**/*.spec.*'], + svelte: pkg.svelte ?? './dist/index.js', + types: pkg.types ?? './dist/index.d.ts', + exports: { + '.': { + types: pkg.types ?? './dist/index.d.ts', + svelte: pkg.svelte ?? './dist/index.js', + }, + }, + }, + null, + 2, + ), +) diff --git a/tsconfig.json b/tsconfig.json index b7d340d81..f7197828c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -25,5 +25,5 @@ } }, "include": ["packages"], - "exclude": ["**/dist", "**/temp", "**/.bob"] + "exclude": ["**/dist", "**/temp"] } diff --git a/vite.config.ts b/vite.config.ts deleted file mode 100644 index 352207a70..000000000 --- a/vite.config.ts +++ /dev/null @@ -1,19 +0,0 @@ -/// -import { resolve } from 'path' -import { defineConfig } from 'vitest/config' - -export default defineConfig({ - test: { - exclude: ['**/node_modules/**', '.bob', 'examples'], - coverage: { - reporter: ['json-summary', 'html'], - exclude: ['**/node_modules/**', '**/vite.config.mjs', '**/dist/**', '**/test/**'], - }, - reporters: 'default', - }, - resolve: { - alias: { - '@kitql/helper': resolve('./packages/helper/src/index'), - }, - }, -})