diff --git a/examples/inline-mod/.gitignore b/examples/inline-mod/.gitignore new file mode 100644 index 00000000..a547bf36 --- /dev/null +++ b/examples/inline-mod/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/examples/inline-mod/index.html b/examples/inline-mod/index.html new file mode 100644 index 00000000..44a93350 --- /dev/null +++ b/examples/inline-mod/index.html @@ -0,0 +1,13 @@ + + + + + + + Vite + TS + + +
+ + + diff --git a/examples/inline-mod/package.json b/examples/inline-mod/package.json new file mode 100644 index 00000000..f0c7385e --- /dev/null +++ b/examples/inline-mod/package.json @@ -0,0 +1,16 @@ +{ + "name": "@example/inline-mod", + "version": "0.0.0", + "private": true, + "type": "module", + "scripts": { + "build": "tsc && vite build", + "dev": "vite", + "preview": "vite preview" + }, + "devDependencies": { + "typescript": "^5.2.2", + "@inox-tools/inline-mod": "workspace:*", + "vite": "^5.0.8" + } +} diff --git a/examples/inline-mod/public/vite.svg b/examples/inline-mod/public/vite.svg new file mode 100644 index 00000000..e7b8dfb1 --- /dev/null +++ b/examples/inline-mod/public/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/inline-mod/src/counter.ts b/examples/inline-mod/src/counter.ts new file mode 100644 index 00000000..5909bbe2 --- /dev/null +++ b/examples/inline-mod/src/counter.ts @@ -0,0 +1,11 @@ +import {interceptCounter} from 'virtual:interceptors'; + +export function setupCounter(element: HTMLButtonElement) { + let counter = 0 + const setCounter = (count: number) => { + counter = interceptCounter(count); + element.innerHTML = `count is ${counter}`; + } + element.addEventListener('click', () => setCounter(counter + 1)) + setCounter(0) +} diff --git a/examples/inline-mod/src/main.ts b/examples/inline-mod/src/main.ts new file mode 100644 index 00000000..791547b0 --- /dev/null +++ b/examples/inline-mod/src/main.ts @@ -0,0 +1,24 @@ +import './style.css' +import typescriptLogo from './typescript.svg' +import viteLogo from '/vite.svg' +import { setupCounter } from './counter.ts' + +document.querySelector('#app')!.innerHTML = ` +
+ + + + + + +

Vite + TypeScript

+
+ +
+

+ Click on the Vite and TypeScript logos to learn more +

+
+` + +setupCounter(document.querySelector('#counter')!) diff --git a/examples/inline-mod/src/style.css b/examples/inline-mod/src/style.css new file mode 100644 index 00000000..f9c73502 --- /dev/null +++ b/examples/inline-mod/src/style.css @@ -0,0 +1,96 @@ +:root { + font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; + line-height: 1.5; + font-weight: 400; + + color-scheme: light dark; + color: rgba(255, 255, 255, 0.87); + background-color: #242424; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +a { + font-weight: 500; + color: #646cff; + text-decoration: inherit; +} +a:hover { + color: #535bf2; +} + +body { + margin: 0; + display: flex; + place-items: center; + min-width: 320px; + min-height: 100vh; +} + +h1 { + font-size: 3.2em; + line-height: 1.1; +} + +#app { + max-width: 1280px; + margin: 0 auto; + padding: 2rem; + text-align: center; +} + +.logo { + height: 6em; + padding: 1.5em; + will-change: filter; + transition: filter 300ms; +} +.logo:hover { + filter: drop-shadow(0 0 2em #646cffaa); +} +.logo.vanilla:hover { + filter: drop-shadow(0 0 2em #3178c6aa); +} + +.card { + padding: 2em; +} + +.read-the-docs { + color: #888; +} + +button { + border-radius: 8px; + border: 1px solid transparent; + padding: 0.6em 1.2em; + font-size: 1em; + font-weight: 500; + font-family: inherit; + background-color: #1a1a1a; + cursor: pointer; + transition: border-color 0.25s; +} +button:hover { + border-color: #646cff; +} +button:focus, +button:focus-visible { + outline: 4px auto -webkit-focus-ring-color; +} + +@media (prefers-color-scheme: light) { + :root { + color: #213547; + background-color: #ffffff; + } + a:hover { + color: #747bff; + } + button { + background-color: #f9f9f9; + } +} diff --git a/examples/inline-mod/src/typescript.svg b/examples/inline-mod/src/typescript.svg new file mode 100644 index 00000000..d91c910c --- /dev/null +++ b/examples/inline-mod/src/typescript.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/inline-mod/src/vite-env.d.ts b/examples/inline-mod/src/vite-env.d.ts new file mode 100644 index 00000000..11f02fe2 --- /dev/null +++ b/examples/inline-mod/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/examples/inline-mod/tsconfig.json b/examples/inline-mod/tsconfig.json new file mode 100644 index 00000000..75abdef2 --- /dev/null +++ b/examples/inline-mod/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src"] +} diff --git a/examples/inline-mod/vite.config.mts b/examples/inline-mod/vite.config.mts new file mode 100644 index 00000000..8aa206c8 --- /dev/null +++ b/examples/inline-mod/vite.config.mts @@ -0,0 +1,13 @@ +import { defineConfig } from 'vite'; +import inlineModPlugin, {inlineMod} from "@inox-tools/inline-mod/vite"; + +inlineMod({ + constExports: { + interceptCounter: count => count % 13, + }, + modName: 'virtual:interceptors', +}) + +export default defineConfig({ + plugins: [inlineModPlugin({})] +}) diff --git a/package.json b/package.json index ff8a0361..c49deddd 100644 --- a/package.json +++ b/package.json @@ -25,18 +25,18 @@ "devDependencies": { "@changesets/changelog-github": "^0.5.0", "@changesets/cli": "^2.27.1", - "@types/node": "^20.10.6", - "@typescript-eslint/eslint-plugin": "^6.17.0", - "@typescript-eslint/parser": "^6.17.0", + "@types/node": "^20.11.5", + "@typescript-eslint/eslint-plugin": "^6.19.0", + "@typescript-eslint/parser": "^6.19.0", "esbuild": "^0.19.11", "eslint": "^8.56.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-no-only-tests": "^3.1.0", - "eslint-plugin-prettier": "^5.1.2", + "eslint-plugin-prettier": "^5.1.3", "organize-imports-cli": "^0.10.0", - "prettier": "^3.1.1", - "prettier-plugin-astro": "^0.12.3", - "turbo": "^1.11.3", + "prettier": "^3.2.4", + "prettier-plugin-astro": "^0.13.0", + "turbo": "^1", "typescript": "^5.3.3" }, "packageManager": "pnpm@^8" diff --git a/packages/inline-mod/package.json b/packages/inline-mod/package.json index d69dbde4..b06eb0a5 100644 --- a/packages/inline-mod/package.json +++ b/packages/inline-mod/package.json @@ -1,6 +1,6 @@ { "name": "@inox-tools/inline-mod", - "version": "0.0.1", + "version": "0.0.4", "description": "Define a virtual module inline with any reference to buildtime values", "keywords": [ "vite-plugin" @@ -10,20 +10,21 @@ "author": "Luiz Ferraz ", "type": "module", "exports": { + ".": "./dist/index.js", "./vite": { "types": "./dist/vite.d.ts", - "default": "./dist/index.js" + "default": "./dist/vite.js" } }, "files": [ "README.md", - "dist" + "src" ], "scripts": { "build": "tsup", "test": "vitest", - "dev": "vite --host", - "prepublish": "npm run clean && npm run build" + "dev": "tsup --watch", + "prepublish": "pnpm run build" }, "dependencies": { "typescript": "^5" diff --git a/packages/inline-mod/src/closure/entry.ts b/packages/inline-mod/src/closure/entry.ts index 339cad6b..c05eccbc 100644 --- a/packages/inline-mod/src/closure/entry.ts +++ b/packages/inline-mod/src/closure/entry.ts @@ -115,6 +115,11 @@ export class EntryRegistry { this.inner.set(key, entry); } + public addUnchecked(key: K, entry: Entry) { + this.remove(key); + this.add(key, entry); + } + public prepare(key: K) { // Pending entry is intentionally not constructable without a cast this.add(key, { type: 'pending' } as Entry<'pending'>); diff --git a/packages/inline-mod/src/closure/inspectCode.ts b/packages/inline-mod/src/closure/inspectCode.ts index 2527b9fd..b8d332f0 100644 --- a/packages/inline-mod/src/closure/inspectCode.ts +++ b/packages/inline-mod/src/closure/inspectCode.ts @@ -1,5 +1,5 @@ import * as modules from 'node:module'; -import upath from 'upath'; +import * as upath from 'node:path'; import { Entry, EntryRegistry } from './entry.js'; import { Lazy } from './lazy.js'; import { getModuleFromPath } from './package.js'; @@ -878,17 +878,17 @@ class GlobalCache { // Add entries to allow proper serialization over generators and iterators. const emptyGenerator = function* (): any {}; - this.cache.add(Object.getPrototypeOf(emptyGenerator), { + this.cache.addUnchecked(Object.getPrototypeOf(emptyGenerator), { type: 'expr', value: 'Object.getPrototypeOf(function*(){})', }); - this.cache.add(Object.getPrototypeOf(emptyGenerator.prototype), { + this.cache.addUnchecked(Object.getPrototypeOf(emptyGenerator.prototype), { type: 'expr', value: 'Object.getPrototypeOf((function*(){}).prototype)', }); - this.cache.add(Symbol.iterator, { type: 'expr', value: 'Symbol.iterator' }); + this.cache.addUnchecked(Symbol.iterator, { type: 'expr', value: 'Symbol.iterator' }); - this.cache.add(process.env, Entry.expr('process.env')); + this.cache.addUnchecked(process.env, Entry.expr('process.env')); } private addGlobalInfo(key: string) { @@ -896,12 +896,12 @@ class GlobalCache { const text = utils.isLegalMemberName(key) ? `global.${key}` : `global[${JSON.stringify(key)}]`; if (globalObj !== undefined && globalObj !== null) { - this.cache.add(globalObj, { type: 'expr', value: text }); - this.cache.add(Object.getPrototypeOf(globalObj), { + this.cache.addUnchecked(globalObj, { type: 'expr', value: text }); + this.cache.addUnchecked(Object.getPrototypeOf(globalObj), { type: 'expr', value: `Object.getPrototypeOf(${text})`, }); - this.cache.add(globalObj.prototype, { + this.cache.addUnchecked(globalObj.prototype, { type: 'expr', value: `${text}.prototype`, }); diff --git a/packages/inline-mod/src/closure/package.ts b/packages/inline-mod/src/closure/package.ts index ec184dc2..c75528f8 100644 --- a/packages/inline-mod/src/closure/package.ts +++ b/packages/inline-mod/src/closure/package.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import * as upath from 'upath'; +import * as upath from 'node:path'; type Exports = string | { [key: string]: SubExports }; type SubExports = string | { [key: string]: SubExports } | null; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 73daa546..98159c6b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,14 +15,14 @@ importers: specifier: ^2.27.1 version: 2.27.1 '@types/node': - specifier: ^20.10.6 - version: 20.10.6 + specifier: ^20.11.5 + version: 20.11.5 '@typescript-eslint/eslint-plugin': - specifier: ^6.17.0 - version: 6.17.0(@typescript-eslint/parser@6.17.0)(eslint@8.56.0)(typescript@5.3.3) + specifier: ^6.19.0 + version: 6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/parser': - specifier: ^6.17.0 - version: 6.17.0(eslint@8.56.0)(typescript@5.3.3) + specifier: ^6.19.0 + version: 6.19.0(eslint@8.56.0)(typescript@5.3.3) esbuild: specifier: ^0.19.11 version: 0.19.11 @@ -36,17 +36,17 @@ importers: specifier: ^3.1.0 version: 3.1.0 eslint-plugin-prettier: - specifier: ^5.1.2 - version: 5.1.2(eslint-config-prettier@9.1.0)(eslint@8.56.0)(prettier@3.1.1) + specifier: ^5.1.3 + version: 5.1.3(eslint-config-prettier@9.1.0)(eslint@8.56.0)(prettier@3.2.4) organize-imports-cli: specifier: ^0.10.0 version: 0.10.0 prettier: - specifier: ^3.1.1 - version: 3.1.1 + specifier: ^3.2.4 + version: 3.2.4 prettier-plugin-astro: - specifier: ^0.12.3 - version: 0.12.3 + specifier: ^0.13.0 + version: 0.13.0 turbo: specifier: ^1.11.3 version: 1.11.3 @@ -54,6 +54,18 @@ importers: specifier: ^5.3.3 version: 5.3.3 + examples/inline-mod: + devDependencies: + '@inox-tools/inline-mod': + specifier: workspace:* + version: link:../../packages/inline-mod + typescript: + specifier: ^5.2.2 + version: 5.3.3 + vite: + specifier: ^5.0.8 + version: 5.0.11(@types/node@20.11.5) + packages/inline-mod: dependencies: typescript: @@ -61,7 +73,7 @@ importers: version: 5.3.3 vite: specifier: ^3.2.0 - version: 3.2.7(@types/node@20.10.6) + version: 3.2.7(@types/node@20.11.5) devDependencies: '@vitest/ui': specifier: ^1.1.3 @@ -74,7 +86,7 @@ importers: version: 2.0.1 vitest: specifier: ^1.1.3 - version: 1.1.3(@types/node@20.10.6)(@vitest/ui@1.1.3) + version: 1.1.3(@types/node@20.11.5)(@vitest/ui@1.1.3) packages/velox-luna: dependencies: @@ -90,7 +102,7 @@ importers: version: 5.3.3 vitest: specifier: ^1.1.3 - version: 1.1.3(@types/node@20.10.6)(@vitest/ui@1.1.3) + version: 1.1.3(@types/node@20.11.5)(@vitest/ui@1.1.3) turbo: devDependencies: @@ -148,8 +160,8 @@ packages: regenerator-runtime: 0.14.1 dev: true - /@babel/runtime@7.23.7: - resolution: {integrity: sha512-w06OXVOFso7LcbzMiDGt+3X7Rh7Ho8MmgPoWU3rarH+8upf+wSU/grlGbWzQyr3DkdN6ZeuMFjpdwW0Q+HxobA==} + /@babel/runtime@7.23.8: + resolution: {integrity: sha512-Y7KbAP984rn1VGMbGqKmBLio9V7y5Je9GvU4rQPCPinCyNfUcToxIXl06d59URp/F3LwinvODxab5N/G6qggkw==} engines: {node: '>=6.9.0'} dependencies: regenerator-runtime: 0.14.1 @@ -158,7 +170,7 @@ packages: /@changesets/apply-release-plan@7.0.0: resolution: {integrity: sha512-vfi69JR416qC9hWmFGSxj7N6wA5J222XNBmezSVATPWDVPIF7gkd4d8CpbEbXmRWbVrkoli3oerGS6dcL/BGsQ==} dependencies: - '@babel/runtime': 7.23.7 + '@babel/runtime': 7.23.8 '@changesets/config': 3.0.0 '@changesets/get-version-range-type': 0.4.0 '@changesets/git': 3.0.0 @@ -176,7 +188,7 @@ packages: /@changesets/assemble-release-plan@6.0.0: resolution: {integrity: sha512-4QG7NuisAjisbW4hkLCmGW2lRYdPrKzro+fCtZaILX+3zdUELSvYjpL4GTv0E4aM9Mef3PuIQp89VmHJ4y2bfw==} dependencies: - '@babel/runtime': 7.23.7 + '@babel/runtime': 7.23.8 '@changesets/errors': 0.2.0 '@changesets/get-dependents-graph': 2.0.0 '@changesets/types': 6.0.0 @@ -204,7 +216,7 @@ packages: resolution: {integrity: sha512-iJ91xlvRnnrJnELTp4eJJEOPjgpF3NOh4qeQehM6Ugiz9gJPRZ2t+TsXun6E3AMN4hScZKjqVXl0TX+C7AB3ZQ==} hasBin: true dependencies: - '@babel/runtime': 7.23.7 + '@babel/runtime': 7.23.8 '@changesets/apply-release-plan': 7.0.0 '@changesets/assemble-release-plan': 6.0.0 '@changesets/changelog-git': 0.2.0 @@ -278,7 +290,7 @@ packages: /@changesets/get-release-plan@4.0.0: resolution: {integrity: sha512-9L9xCUeD/Tb6L/oKmpm8nyzsOzhdNBBbt/ZNcjynbHC07WW4E1eX8NMGC5g5SbM5z/V+MOrYsJ4lRW41GCbg3w==} dependencies: - '@babel/runtime': 7.23.7 + '@babel/runtime': 7.23.8 '@changesets/assemble-release-plan': 6.0.0 '@changesets/config': 3.0.0 '@changesets/pre': 2.0.0 @@ -294,7 +306,7 @@ packages: /@changesets/git@3.0.0: resolution: {integrity: sha512-vvhnZDHe2eiBNRFHEgMiGd2CT+164dfYyrJDhwwxTVD/OW0FUD6G7+4DIx1dNwkwjHyzisxGAU96q0sVNBns0w==} dependencies: - '@babel/runtime': 7.23.7 + '@babel/runtime': 7.23.8 '@changesets/errors': 0.2.0 '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 @@ -319,7 +331,7 @@ packages: /@changesets/pre@2.0.0: resolution: {integrity: sha512-HLTNYX/A4jZxc+Sq8D1AMBsv+1qD6rmmJtjsCJa/9MSRybdxh0mjbTvE6JYZQ/ZiQ0mMlDOlGPXTm9KLTU3jyw==} dependencies: - '@babel/runtime': 7.23.7 + '@babel/runtime': 7.23.8 '@changesets/errors': 0.2.0 '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 @@ -329,7 +341,7 @@ packages: /@changesets/read@0.6.0: resolution: {integrity: sha512-ZypqX8+/im1Fm98K4YcZtmLKgjs1kDQ5zHpc2U1qdtNBmZZfo/IBiG162RoP0CUF05tvp2y4IspH11PLnPxuuw==} dependencies: - '@babel/runtime': 7.23.7 + '@babel/runtime': 7.23.8 '@changesets/git': 3.0.0 '@changesets/logger': 0.1.0 '@changesets/parse': 0.4.0 @@ -350,7 +362,7 @@ packages: /@changesets/write@0.3.0: resolution: {integrity: sha512-slGLb21fxZVUYbyea+94uFiD6ntQW0M2hIKNznFizDhZPDgn2c/fv1UzzlW43RVzh1BEDuIqW6hzlJ1OflNmcw==} dependencies: - '@babel/runtime': 7.23.7 + '@babel/runtime': 7.23.8 '@changesets/types': 6.0.0 fs-extra: 7.0.1 human-id: 1.0.2 @@ -626,11 +638,11 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@humanwhocodes/config-array@0.11.13: - resolution: {integrity: sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==} + /@humanwhocodes/config-array@0.11.14: + resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} dependencies: - '@humanwhocodes/object-schema': 2.0.1 + '@humanwhocodes/object-schema': 2.0.2 debug: 4.3.4 minimatch: 3.1.2 transitivePeerDependencies: @@ -642,8 +654,8 @@ packages: engines: {node: '>=12.22'} dev: true - /@humanwhocodes/object-schema@2.0.1: - resolution: {integrity: sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==} + /@humanwhocodes/object-schema@2.0.2: + resolution: {integrity: sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==} dev: true /@isaacs/cliui@8.0.2: @@ -727,7 +739,7 @@ packages: '@lit-labs/ssr-dom-shim': 1.1.2 '@lit/reactive-element': 2.0.2 '@parse5/tools': 0.3.0 - '@types/node': 16.18.70 + '@types/node': 16.18.74 enhanced-resolve: 5.15.0 lit: 3.1.0 lit-element: 4.0.2 @@ -769,7 +781,7 @@ packages: /@manypkg/find-root@1.1.0: resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} dependencies: - '@babel/runtime': 7.23.7 + '@babel/runtime': 7.23.8 '@types/node': 12.20.55 find-up: 4.1.0 fs-extra: 8.1.0 @@ -778,7 +790,7 @@ packages: /@manypkg/get-packages@1.1.3: resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==} dependencies: - '@babel/runtime': 7.23.7 + '@babel/runtime': 7.23.8 '@changesets/types': 4.1.0 '@manypkg/find-root': 1.1.0 fs-extra: 8.1.0 @@ -817,8 +829,8 @@ packages: dev: true optional: true - /@pkgr/core@0.1.0: - resolution: {integrity: sha512-Zwq5OCzuwJC2jwqmpEQt7Ds1DTi6BWSwoGkbb1n9pO3hzb35BoJELx7c0T23iDkBGkh2e7tvOtjF3tr3OaQHDQ==} + /@pkgr/core@0.1.1: + resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} dev: true @@ -1012,7 +1024,7 @@ packages: resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: '@types/minimatch': 5.1.2 - '@types/node': 20.10.6 + '@types/node': 20.11.5 dev: true /@types/hast@3.0.3: @@ -1054,20 +1066,14 @@ packages: resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} dev: true - /@types/node@16.18.70: - resolution: {integrity: sha512-8eIk20G5VVVQNZNouHjLA2b8utE2NvGybLjMaF4lyhA9uhGwnmXF8o+icdXKGSQSNANJewXva/sFUoZLwAaYAg==} + /@types/node@16.18.74: + resolution: {integrity: sha512-eEn8RkzZFcT0gb8qyi0CcfSOQnLE+NbGLIIaxGGmjn/N35v/C3M8ohxcpSlNlCv+H8vPpMGmrGDdCkzr8xu2tQ==} dev: false - /@types/node@20.10.6: - resolution: {integrity: sha512-Vac8H+NlRNNlAmDfGUP7b5h/KA+AtWIzuXy0E6OyP8f1tCLYAtPvKRRDJjAPqhpCb0t6U2j7/xqAuLEebW2kiw==} - dependencies: - undici-types: 5.26.5 - /@types/node@20.11.5: resolution: {integrity: sha512-g557vgQjUUfN76MZAN/dt1z3dzcUsimuysco0KeluHgrPdJXkP/XdAURgyO2W9fZWHRtRBiVKzKn8vyOAwlG+w==} dependencies: undici-types: 5.26.5 - dev: true /@types/normalize-package-data@2.4.4: resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -1088,7 +1094,7 @@ packages: /@types/through@0.0.33: resolution: {integrity: sha512-HsJ+z3QuETzP3cswwtzt2vEIiHBk/dCcHGhbmG5X3ecnwFD/lPrMpliGXxSCg03L9AhrdwA4Oz/qfspkDW+xGQ==} dependencies: - '@types/node': 20.10.6 + '@types/node': 20.11.5 dev: true /@types/tinycolor2@1.4.6: @@ -1103,8 +1109,8 @@ packages: resolution: {integrity: sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==} dev: false - /@typescript-eslint/eslint-plugin@6.17.0(@typescript-eslint/parser@6.17.0)(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-Vih/4xLXmY7V490dGwBQJTpIZxH4ZFH6eCVmQ4RFkB+wmaCTDAx4dtgoWwMNGKLkqRY1L6rPqzEbjorRnDo4rQ==} + /@typescript-eslint/eslint-plugin@6.19.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-DUCUkQNklCQYnrBSSikjVChdc84/vMPDQSgJTHBZ64G9bA9w0Crc0rd2diujKbTdp6w2J47qkeHQLoi0rpLCdg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha @@ -1115,11 +1121,11 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.17.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/scope-manager': 6.17.0 - '@typescript-eslint/type-utils': 6.17.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/utils': 6.17.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 6.17.0 + '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/scope-manager': 6.19.0 + '@typescript-eslint/type-utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 6.19.0 debug: 4.3.4 eslint: 8.56.0 graphemer: 1.4.0 @@ -1132,8 +1138,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@6.17.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-C4bBaX2orvhK+LlwrY8oWGmSl4WolCfYm513gEccdWZj0CwGadbIADb0FtVEcI+WzUyjyoBj2JRP8g25E6IB8A==} + /@typescript-eslint/parser@6.19.0(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-1DyBLG5SH7PYCd00QlroiW60YJ4rWMuUGa/JBV0iZuqi4l4IK3twKPq5ZkEebmGqRjXWVgsUzfd3+nZveewgow==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -1142,10 +1148,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 6.17.0 - '@typescript-eslint/types': 6.17.0 - '@typescript-eslint/typescript-estree': 6.17.0(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 6.17.0 + '@typescript-eslint/scope-manager': 6.19.0 + '@typescript-eslint/types': 6.19.0 + '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 6.19.0 debug: 4.3.4 eslint: 8.56.0 typescript: 5.3.3 @@ -1153,16 +1159,16 @@ packages: - supports-color dev: true - /@typescript-eslint/scope-manager@6.17.0: - resolution: {integrity: sha512-RX7a8lwgOi7am0k17NUO0+ZmMOX4PpjLtLRgLmT1d3lBYdWH4ssBUbwdmc5pdRX8rXon8v9x8vaoOSpkHfcXGA==} + /@typescript-eslint/scope-manager@6.19.0: + resolution: {integrity: sha512-dO1XMhV2ehBI6QN8Ufi7I10wmUovmLU0Oru3n5LVlM2JuzB4M+dVphCPLkVpKvGij2j/pHBWuJ9piuXx+BhzxQ==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.17.0 - '@typescript-eslint/visitor-keys': 6.17.0 + '@typescript-eslint/types': 6.19.0 + '@typescript-eslint/visitor-keys': 6.19.0 dev: true - /@typescript-eslint/type-utils@6.17.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-hDXcWmnbtn4P2B37ka3nil3yi3VCQO2QEB9gBiHJmQp5wmyQWqnjA85+ZcE8c4FqnaB6lBwMrPkgd4aBYz3iNg==} + /@typescript-eslint/type-utils@6.19.0(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-mcvS6WSWbjiSxKCwBcXtOM5pRkPQ6kcDds/juxcy/727IQr3xMEcwr/YLHW2A2+Fp5ql6khjbKBzOyjuPqGi/w==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -1171,8 +1177,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.17.0(typescript@5.3.3) - '@typescript-eslint/utils': 6.17.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.3.3) + '@typescript-eslint/utils': 6.19.0(eslint@8.56.0)(typescript@5.3.3) debug: 4.3.4 eslint: 8.56.0 ts-api-utils: 1.0.3(typescript@5.3.3) @@ -1181,13 +1187,13 @@ packages: - supports-color dev: true - /@typescript-eslint/types@6.17.0: - resolution: {integrity: sha512-qRKs9tvc3a4RBcL/9PXtKSehI/q8wuU9xYJxe97WFxnzH8NWWtcW3ffNS+EWg8uPvIerhjsEZ+rHtDqOCiH57A==} + /@typescript-eslint/types@6.19.0: + resolution: {integrity: sha512-lFviGV/vYhOy3m8BJ/nAKoAyNhInTdXpftonhWle66XHAtT1ouBlkjL496b5H5hb8dWXHwtypTqgtb/DEa+j5A==} engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/typescript-estree@6.17.0(typescript@5.3.3): - resolution: {integrity: sha512-gVQe+SLdNPfjlJn5VNGhlOhrXz4cajwFd5kAgWtZ9dCZf4XJf8xmgCTLIqec7aha3JwgLI2CK6GY1043FRxZwg==} + /@typescript-eslint/typescript-estree@6.19.0(typescript@5.3.3): + resolution: {integrity: sha512-o/zefXIbbLBZ8YJ51NlkSAt2BamrK6XOmuxSR3hynMIzzyMY33KuJ9vuMdFSXW+H0tVvdF9qBPTHA91HDb4BIQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: typescript: '*' @@ -1195,8 +1201,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 6.17.0 - '@typescript-eslint/visitor-keys': 6.17.0 + '@typescript-eslint/types': 6.19.0 + '@typescript-eslint/visitor-keys': 6.19.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -1208,8 +1214,8 @@ packages: - supports-color dev: true - /@typescript-eslint/utils@6.17.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-LofsSPjN/ITNkzV47hxas2JCsNCEnGhVvocfyOcLzT9c/tSZE7SfhS/iWtzP1lKNOEfLhRTZz6xqI8N2RzweSQ==} + /@typescript-eslint/utils@6.19.0(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-QR41YXySiuN++/dC9UArYOg4X86OAYP83OWTewpVx5ct1IZhjjgTLocj7QNxGhWoTqknsgpl7L+hGygCO+sdYw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -1217,9 +1223,9 @@ packages: '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) '@types/json-schema': 7.0.15 '@types/semver': 7.5.6 - '@typescript-eslint/scope-manager': 6.17.0 - '@typescript-eslint/types': 6.17.0 - '@typescript-eslint/typescript-estree': 6.17.0(typescript@5.3.3) + '@typescript-eslint/scope-manager': 6.19.0 + '@typescript-eslint/types': 6.19.0 + '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.3.3) eslint: 8.56.0 semver: 7.5.4 transitivePeerDependencies: @@ -1227,11 +1233,11 @@ packages: - typescript dev: true - /@typescript-eslint/visitor-keys@6.17.0: - resolution: {integrity: sha512-H6VwB/k3IuIeQOyYczyyKN8wH6ed8EwliaYHLxOIhyF0dYEIsN8+Bk3GE19qafeMKyZJJHP8+O1HiFhFLUNKSg==} + /@typescript-eslint/visitor-keys@6.19.0: + resolution: {integrity: sha512-hZaUCORLgubBvtGpp1JEFEazcuEdfxta9j4iUwdSAr7mEsYYAp3EAUyCZk3VEEqGj6W+AV4uWyrDGtrlawAsgQ==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.17.0 + '@typescript-eslint/types': 6.19.0 eslint-visitor-keys: 3.4.3 dev: true @@ -1280,7 +1286,7 @@ packages: pathe: 1.1.1 picocolors: 1.0.0 sirv: 2.0.4 - vitest: 1.1.3(@types/node@20.10.6)(@vitest/ui@1.1.3) + vitest: 1.1.3(@types/node@20.11.5)(@vitest/ui@1.1.3) dev: true /@vitest/utils@1.1.3: @@ -1560,7 +1566,7 @@ packages: dependencies: function-bind: 1.1.2 get-intrinsic: 1.2.2 - set-function-length: 1.1.1 + set-function-length: 1.2.0 dev: true /callsites@3.1.0: @@ -2071,8 +2077,8 @@ packages: object-keys: 1.1.1 object.assign: 4.1.5 regexp.prototype.flags: 1.5.1 - safe-array-concat: 1.0.1 - safe-regex-test: 1.0.0 + safe-array-concat: 1.1.0 + safe-regex-test: 1.0.2 string.prototype.trim: 1.2.8 string.prototype.trimend: 1.0.7 string.prototype.trimstart: 1.0.7 @@ -2390,8 +2396,8 @@ packages: engines: {node: '>=5.0.0'} dev: true - /eslint-plugin-prettier@5.1.2(eslint-config-prettier@9.1.0)(eslint@8.56.0)(prettier@3.1.1): - resolution: {integrity: sha512-dhlpWc9vOwohcWmClFcA+HjlvUpuyynYs0Rf+L/P6/0iQE6vlHW9l5bkfzN62/Stm9fbq8ku46qzde76T1xlSg==} + /eslint-plugin-prettier@5.1.3(eslint-config-prettier@9.1.0)(eslint@8.56.0)(prettier@3.2.4): + resolution: {integrity: sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: '@types/eslint': '>=8.0.0' @@ -2406,7 +2412,7 @@ packages: dependencies: eslint: 8.56.0 eslint-config-prettier: 9.1.0(eslint@8.56.0) - prettier: 3.1.1 + prettier: 3.2.4 prettier-linter-helpers: 1.0.0 synckit: 0.8.8 dev: true @@ -2433,7 +2439,7 @@ packages: '@eslint-community/regexpp': 4.10.0 '@eslint/eslintrc': 2.1.4 '@eslint/js': 8.56.0 - '@humanwhocodes/config-array': 0.11.13 + '@humanwhocodes/config-array': 0.11.14 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 '@ungap/structured-clone': 1.2.0 @@ -4325,12 +4331,12 @@ packages: fast-diff: 1.3.0 dev: true - /prettier-plugin-astro@0.12.3: - resolution: {integrity: sha512-GthUSu3zCvmtVyqlArosez0xE08vSJ0R1sWurxIWpABaCkNGYFANoUdFkqmIo54EV2uPLGcVJzOucWvCjPBWvg==} + /prettier-plugin-astro@0.13.0: + resolution: {integrity: sha512-5HrJNnPmZqTUNoA97zn4gNQv9BgVhv+et03314WpQ9H9N8m2L9OSV798olwmG2YLXPl1iSstlJCR1zB3x5xG4g==} engines: {node: ^14.15.0 || >=16.0.0} dependencies: '@astrojs/compiler': 1.8.2 - prettier: 3.1.1 + prettier: 3.2.4 sass-formatter: 0.7.8 dev: true @@ -4340,8 +4346,8 @@ packages: hasBin: true dev: true - /prettier@3.1.1: - resolution: {integrity: sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==} + /prettier@3.2.4: + resolution: {integrity: sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==} engines: {node: '>=14'} hasBin: true dev: true @@ -4650,8 +4656,8 @@ packages: resolution: {integrity: sha512-AUNrbEUHeKY8XsYr/DYpl+qk5+aM+DChopnWOPEzn8YKzOhv4l2zH6LzZms3tOZP3wwdOyc0RmTciyi46HLIuA==} dev: true - /safe-array-concat@1.0.1: - resolution: {integrity: sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==} + /safe-array-concat@1.1.0: + resolution: {integrity: sha512-ZdQ0Jeb9Ofti4hbt5lX3T2JcAamT9hfzYU1MNB+z/jaEbB6wfFfPIR/zEORmZqobkCCJhSjodobH6WHNmJ97dg==} engines: {node: '>=0.4'} dependencies: call-bind: 1.0.5 @@ -4664,8 +4670,9 @@ packages: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} dev: true - /safe-regex-test@1.0.0: - resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} + /safe-regex-test@1.0.2: + resolution: {integrity: sha512-83S9w6eFq12BBIJYvjMux6/dkirb8+4zJRA9cxNBVb7Wq5fJBW+Xze48WqR8pxua7bDuAaaAxtVVd4Idjp1dBQ==} + engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.5 get-intrinsic: 1.2.2 @@ -4706,11 +4713,12 @@ packages: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} dev: true - /set-function-length@1.1.1: - resolution: {integrity: sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==} + /set-function-length@1.2.0: + resolution: {integrity: sha512-4DBHDoyHlM1IRPGYcoxexgh67y4ueR53FKV1yyxwFMY7aCqcN/38M1+SwZ/qJQ8iLv7+ck385ot4CcisOAPT9w==} engines: {node: '>= 0.4'} dependencies: define-data-property: 1.1.1 + function-bind: 1.1.2 get-intrinsic: 1.2.2 gopd: 1.0.1 has-property-descriptors: 1.0.1 @@ -5072,7 +5080,7 @@ packages: resolution: {integrity: sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ==} engines: {node: ^14.18.0 || >=16.0.0} dependencies: - '@pkgr/core': 0.1.0 + '@pkgr/core': 0.1.1 tslib: 2.6.2 dev: true @@ -5600,7 +5608,7 @@ packages: vfile-message: 4.0.2 dev: false - /vite-node@1.1.3(@types/node@20.10.6): + /vite-node@1.1.3(@types/node@20.11.5): resolution: {integrity: sha512-BLSO72YAkIUuNrOx+8uznYICJfTEbvBAmWClY3hpath5+h1mbPS5OMn42lrTxXuyCazVyZoDkSRnju78GiVCqA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -5609,7 +5617,7 @@ packages: debug: 4.3.4 pathe: 1.1.1 picocolors: 1.0.0 - vite: 5.0.11(@types/node@20.10.6) + vite: 5.0.11(@types/node@20.11.5) transitivePeerDependencies: - '@types/node' - less @@ -5621,7 +5629,7 @@ packages: - terser dev: true - /vite@3.2.7(@types/node@20.10.6): + /vite@3.2.7(@types/node@20.11.5): resolution: {integrity: sha512-29pdXjk49xAP0QBr0xXqu2s5jiQIXNvE/xwd0vUizYT2Hzqe4BksNNoWllFVXJf4eLZ+UlVQmXfB4lWrc+t18g==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -5646,7 +5654,7 @@ packages: terser: optional: true dependencies: - '@types/node': 20.10.6 + '@types/node': 20.11.5 esbuild: 0.15.18 postcss: 8.4.33 resolve: 1.22.8 @@ -5655,7 +5663,7 @@ packages: fsevents: 2.3.3 dev: false - /vite@5.0.11(@types/node@20.10.6): + /vite@5.0.11(@types/node@20.11.5): resolution: {integrity: sha512-XBMnDjZcNAw/G1gEiskiM1v6yzM4GE5aMGvhWTlHAYYhxb7S3/V1s3m2LDHa8Vh6yIWYYB0iJwsEaS523c4oYA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -5683,7 +5691,7 @@ packages: terser: optional: true dependencies: - '@types/node': 20.10.6 + '@types/node': 20.11.5 esbuild: 0.19.11 postcss: 8.4.33 rollup: 4.9.4 @@ -5691,7 +5699,7 @@ packages: fsevents: 2.3.3 dev: true - /vitest@1.1.3(@types/node@20.10.6)(@vitest/ui@1.1.3): + /vitest@1.1.3(@types/node@20.11.5)(@vitest/ui@1.1.3): resolution: {integrity: sha512-2l8om1NOkiA90/Y207PsEvJLYygddsOyr81wLQ20Ra8IlLKbyQncWsGZjnbkyG2KwwuTXLQjEPOJuxGMG8qJBQ==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -5716,7 +5724,7 @@ packages: jsdom: optional: true dependencies: - '@types/node': 20.10.6 + '@types/node': 20.11.5 '@vitest/expect': 1.1.3 '@vitest/runner': 1.1.3 '@vitest/snapshot': 1.1.3 @@ -5736,8 +5744,8 @@ packages: strip-literal: 1.3.0 tinybench: 2.5.1 tinypool: 0.8.1 - vite: 5.0.11(@types/node@20.10.6) - vite-node: 1.1.3(@types/node@20.10.6) + vite: 5.0.11(@types/node@20.11.5) + vite-node: 1.1.3(@types/node@20.11.5) why-is-node-running: 2.2.2 transitivePeerDependencies: - less diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index f21cf215..2bafe42c 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,3 +1,4 @@ packages: - turbo - 'packages/*' + - 'examples/*'