diff --git a/babel.config.js b/babel.config.js index 10dcec920a..7493af59ae 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,10 +1,11 @@ -module.exports = function (api) { +import mangle from './mangle.json' with { type: 'json' }; + +export default function (api) { api.cache(true); const noModules = String(process.env.BABEL_NO_MODULES) === 'true'; const rename = {}; - const mangle = require('./mangle.json'); for (let prop in mangle.props.props) { let name = prop; if (name[0] === '$') { @@ -47,4 +48,4 @@ module.exports = function (api) { } ] }; -}; +} diff --git a/compat/client.d.ts b/compat/client.d.ts index 029e3dee7f..d6027de920 100644 --- a/compat/client.d.ts +++ b/compat/client.d.ts @@ -1,4 +1,4 @@ -import * as preact from '../src/index'; +import * as preact from '../src/index.js'; export function createRoot(container: preact.ContainerNode): { render(children: preact.ComponentChild): void; diff --git a/compat/client.js b/compat/client.js index bc48c21bf2..f9d1814e18 100644 --- a/compat/client.js +++ b/compat/client.js @@ -1,6 +1,6 @@ -const { render, hydrate, unmountComponentAtNode } = require('preact/compat'); +import { render, hydrate, unmountComponentAtNode } from 'preact/compat'; -function createRoot(container) { +export function createRoot(container) { return { // eslint-disable-next-line render: function (children) { @@ -13,9 +13,12 @@ function createRoot(container) { }; } -exports.createRoot = createRoot; - -exports.hydrateRoot = function (container, children) { +export function hydrateRoot(container, children) { hydrate(children, container); return createRoot(container); +} + +export default { + createRoot, + hydrateRoot }; diff --git a/compat/client.mjs b/compat/client.mjs deleted file mode 100644 index f9d1814e18..0000000000 --- a/compat/client.mjs +++ /dev/null @@ -1,24 +0,0 @@ -import { render, hydrate, unmountComponentAtNode } from 'preact/compat'; - -export function createRoot(container) { - return { - // eslint-disable-next-line - render: function (children) { - render(children, container); - }, - // eslint-disable-next-line - unmount: function () { - unmountComponentAtNode(container); - } - }; -} - -export function hydrateRoot(container, children) { - hydrate(children, container); - return createRoot(container); -} - -export default { - createRoot, - hydrateRoot -}; diff --git a/compat/jsx-dev-runtime.js b/compat/jsx-dev-runtime.js index 32054c4908..e7e3aef044 100644 --- a/compat/jsx-dev-runtime.js +++ b/compat/jsx-dev-runtime.js @@ -1,3 +1,3 @@ -require('preact/compat'); +import 'preact/compat'; -module.exports = require('preact/jsx-runtime'); +export * from 'preact/jsx-runtime'; diff --git a/compat/jsx-dev-runtime.mjs b/compat/jsx-dev-runtime.mjs deleted file mode 100644 index e7e3aef044..0000000000 --- a/compat/jsx-dev-runtime.mjs +++ /dev/null @@ -1,3 +0,0 @@ -import 'preact/compat'; - -export * from 'preact/jsx-runtime'; diff --git a/compat/jsx-runtime.js b/compat/jsx-runtime.js index 32054c4908..e7e3aef044 100644 --- a/compat/jsx-runtime.js +++ b/compat/jsx-runtime.js @@ -1,3 +1,3 @@ -require('preact/compat'); +import 'preact/compat'; -module.exports = require('preact/jsx-runtime'); +export * from 'preact/jsx-runtime'; diff --git a/compat/jsx-runtime.mjs b/compat/jsx-runtime.mjs deleted file mode 100644 index e7e3aef044..0000000000 --- a/compat/jsx-runtime.mjs +++ /dev/null @@ -1,3 +0,0 @@ -import 'preact/compat'; - -export * from 'preact/jsx-runtime'; diff --git a/compat/package.json b/compat/package.json index 2b73b8e4c0..eb07ac7230 100644 --- a/compat/package.json +++ b/compat/package.json @@ -1,11 +1,9 @@ { "name": "preact-compat", - "amdName": "preactCompat", "private": true, "description": "A React compatibility layer for Preact", + "type": "module", "main": "dist/compat.js", - "module": "dist/compat.mjs", - "umd:main": "dist/compat.umd.js", "source": "src/index.js", "types": "src/index.d.ts", "license": "MIT", diff --git a/compat/scheduler.js b/compat/scheduler.js index 01c4ceba0c..c51bd4bfda 100644 --- a/compat/scheduler.js +++ b/compat/scheduler.js @@ -1,15 +1,23 @@ -// see scheduler.mjs +/* eslint-disable */ -function unstable_runWithPriority(priority, callback) { +// This file includes experimental React APIs exported from the "scheduler" +// npm package. Despite being explicitely marked as unstable some libraries +// already make use of them. This file is not a full replacement for the +// scheduler package, but includes the necessary shims to make those libraries +// work with Preact. + +export var unstable_ImmediatePriority = 1; +export var unstable_UserBlockingPriority = 2; +export var unstable_NormalPriority = 3; +export var unstable_LowPriority = 4; +export var unstable_IdlePriority = 5; + +/** + * @param {number} priority + * @param {() => void} callback + */ +export function unstable_runWithPriority(priority, callback) { return callback(); } -module.exports = { - unstable_ImmediatePriority: 1, - unstable_UserBlockingPriority: 2, - unstable_NormalPriority: 3, - unstable_LowPriority: 4, - unstable_IdlePriority: 5, - unstable_runWithPriority, - unstable_now: performance.now.bind(performance) -}; +export var unstable_now = performance.now.bind(performance); diff --git a/compat/scheduler.mjs b/compat/scheduler.mjs deleted file mode 100644 index c51bd4bfda..0000000000 --- a/compat/scheduler.mjs +++ /dev/null @@ -1,23 +0,0 @@ -/* eslint-disable */ - -// This file includes experimental React APIs exported from the "scheduler" -// npm package. Despite being explicitely marked as unstable some libraries -// already make use of them. This file is not a full replacement for the -// scheduler package, but includes the necessary shims to make those libraries -// work with Preact. - -export var unstable_ImmediatePriority = 1; -export var unstable_UserBlockingPriority = 2; -export var unstable_NormalPriority = 3; -export var unstable_LowPriority = 4; -export var unstable_IdlePriority = 5; - -/** - * @param {number} priority - * @param {() => void} callback - */ -export function unstable_runWithPriority(priority, callback) { - return callback(); -} - -export var unstable_now = performance.now.bind(performance); diff --git a/compat/server.d.ts b/compat/server.d.ts index 6a27985c47..71bfbb471f 100644 --- a/compat/server.d.ts +++ b/compat/server.d.ts @@ -1,10 +1,3 @@ -// @ts-nocheck TS loses its mind over the mixed module systems here. -// It's not ideal, but works at runtime and we're not shipping mixed type definitions. - -import { renderToString } from 'preact-render-to-string'; -import { renderToPipeableStream } from 'preact-render-to-string/stream-node'; -import { renderToReadableStream } from 'preact-render-to-string/stream'; - export { renderToString, renderToString as renderToStaticMarkup @@ -12,9 +5,3 @@ export { export { renderToPipeableStream } from 'preact-render-to-string/stream-node'; export { renderToReadableStream } from 'preact-render-to-string/stream'; -export = { - renderToString: typeof renderToString, - renderToStaticMarkup: typeof renderToString, - renderToPipeableStream: typeof renderToPipeableStream, - renderToReadableStream: typeof renderToReadableStream -}; diff --git a/compat/server.js b/compat/server.js index ad24ef4590..9a3995aa56 100644 --- a/compat/server.js +++ b/compat/server.js @@ -1,36 +1,17 @@ -/* eslint-disable */ -var renderToString; -try { - const mod = require('preact-render-to-string'); - renderToString = mod.default || mod.renderToString || mod; -} catch (e) { - throw Error( - 'renderToString() error: missing "preact-render-to-string" dependency.' - ); -} +import { renderToString } from 'preact-render-to-string'; +import { renderToPipeableStream } from 'preact-render-to-string/stream-node'; +import { renderToReadableStream } from 'preact-render-to-string/stream'; -var renderToReadableStream; -try { - const mod = require('preact-render-to-string/stream'); - renderToReadableStream = mod.default || mod.renderToReadableStream || mod; -} catch (e) { - throw Error( - 'renderToReadableStream() error: update "preact-render-to-string" dependency to at least 6.5.0.' - ); -} -var renderToPipeableStream; -try { - const mod = require('preact-render-to-string/stream-node'); - renderToPipeableStream = mod.default || mod.renderToPipeableStream || mod; -} catch (e) { - throw Error( - 'renderToPipeableStream() error: update "preact-render-to-string" dependency to at least 6.5.0.' - ); -} +export { + renderToString, + renderToString as renderToStaticMarkup +} from 'preact-render-to-string'; -module.exports = { - renderToString: renderToString, +export { renderToPipeableStream } from 'preact-render-to-string/stream-node'; +export { renderToReadableStream } from 'preact-render-to-string/stream'; +export default { + renderToString, renderToStaticMarkup: renderToString, - renderToPipeableStream: renderToPipeableStream, - renderToReadableStream: renderToReadableStream + renderToPipeableStream, + renderToReadableStream }; diff --git a/compat/server.mjs b/compat/server.mjs deleted file mode 100644 index 9a3995aa56..0000000000 --- a/compat/server.mjs +++ /dev/null @@ -1,17 +0,0 @@ -import { renderToString } from 'preact-render-to-string'; -import { renderToPipeableStream } from 'preact-render-to-string/stream-node'; -import { renderToReadableStream } from 'preact-render-to-string/stream'; - -export { - renderToString, - renderToString as renderToStaticMarkup -} from 'preact-render-to-string'; - -export { renderToPipeableStream } from 'preact-render-to-string/stream-node'; -export { renderToReadableStream } from 'preact-render-to-string/stream'; -export default { - renderToString, - renderToStaticMarkup: renderToString, - renderToPipeableStream, - renderToReadableStream -}; diff --git a/compat/src/index.cjs b/compat/src/index.cjs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/compat/src/index.d.ts b/compat/src/index.d.cts similarity index 99% rename from compat/src/index.d.ts rename to compat/src/index.d.cts index 2ea4e22c50..ac12b877af 100644 --- a/compat/src/index.d.ts +++ b/compat/src/index.d.cts @@ -1,4 +1,4 @@ -import * as _preact from '../../src/index'; +import * as _preact from '../../src'; import { JSXInternal } from '../../src/jsx'; import * as _hooks from '../../hooks'; import * as _Suspense from './suspense'; diff --git a/compat/src/internal.d.ts b/compat/src/internal.d.ts index 31795ba123..8f1a8eb02c 100644 --- a/compat/src/internal.d.ts +++ b/compat/src/internal.d.ts @@ -1,12 +1,12 @@ -import { +import type { Component as PreactComponent, VNode as PreactVNode, FunctionComponent as PreactFunctionComponent, PreactElement -} from '../../src/internal'; -import { SuspenseProps } from './suspense'; +} from '../../src/internal.d.ts'; +import type { SuspenseProps } from './suspense.d.ts'; -export { ComponentChildren } from '../..'; +export type { ComponentChildren } from 'preact'; export { PreactElement }; diff --git a/compat/src/suspense.d.ts b/compat/src/suspense.d.ts index 21bdc80482..7ada435557 100644 --- a/compat/src/suspense.d.ts +++ b/compat/src/suspense.d.ts @@ -1,4 +1,4 @@ -import { Component, ComponentChild, ComponentChildren } from '../../src/index'; +import { Component, ComponentChild, ComponentChildren } from '../../src/index.js'; // // Suspense/lazy diff --git a/compat/test-utils.js b/compat/test-utils.js index 2dac062212..16b6d0b293 100644 --- a/compat/test-utils.js +++ b/compat/test-utils.js @@ -1 +1 @@ -module.exports = require('preact/test-utils'); +export * from 'preact/test-utils'; diff --git a/compat/test-utils.mjs b/compat/test-utils.mjs deleted file mode 100644 index 16b6d0b293..0000000000 --- a/compat/test-utils.mjs +++ /dev/null @@ -1 +0,0 @@ -export * from 'preact/test-utils'; diff --git a/compat/test/ts/forward-ref.tsx b/compat/test/ts/forward-ref.tsx index 98aa52b82e..1768d72559 100644 --- a/compat/test/ts/forward-ref.tsx +++ b/compat/test/ts/forward-ref.tsx @@ -1,4 +1,4 @@ -import React from '../../src'; +import React from '../../src/index.cjs'; const MyInput: React.ForwardRefRenderFunction< { focus(): void }, diff --git a/compat/test/ts/index.tsx b/compat/test/ts/index.tsx index 51dbd60adc..d1110e46a7 100644 --- a/compat/test/ts/index.tsx +++ b/compat/test/ts/index.tsx @@ -1,4 +1,4 @@ -import React from '../../src'; +import React from '../../src/index.cjs'; React.render(
, document.createElement('div')); React.render(
, document.createDocumentFragment()); diff --git a/compat/test/ts/lazy.tsx b/compat/test/ts/lazy.tsx index b3797c19a2..5441a97342 100644 --- a/compat/test/ts/lazy.tsx +++ b/compat/test/ts/lazy.tsx @@ -1,4 +1,4 @@ -import * as React from '../../src'; +import * as React from '../../src/index.cjs'; export interface LazyProps { isProp: boolean; diff --git a/compat/test/ts/memo.tsx b/compat/test/ts/memo.tsx index 4e89e2687f..f0ea063d9b 100644 --- a/compat/test/ts/memo.tsx +++ b/compat/test/ts/memo.tsx @@ -1,4 +1,4 @@ -import * as React from '../../src'; +import * as React from '../../src/index.cjs'; import { expectType } from './utils'; interface MemoProps { diff --git a/compat/test/ts/react-default.tsx b/compat/test/ts/react-default.tsx index f46c0b4e0c..463f86bf6e 100644 --- a/compat/test/ts/react-default.tsx +++ b/compat/test/ts/react-default.tsx @@ -1,4 +1,4 @@ -import React from '../../src'; +import React from '../../src/index.cjs'; class ReactIsh extends React.Component { render() { return
Text
; diff --git a/compat/test/ts/react-star.tsx b/compat/test/ts/react-star.tsx index da826906c2..e58dddacf0 100644 --- a/compat/test/ts/react-star.tsx +++ b/compat/test/ts/react-star.tsx @@ -1,5 +1,5 @@ // import React from '../../src'; -import * as React from '../../src'; +import * as React from '../../src/index.cjs'; class ReactIsh extends React.Component { render() { return
Text
; diff --git a/compat/test/ts/scheduler.ts b/compat/test/ts/scheduler.ts index 999e652963..32215be2ad 100644 --- a/compat/test/ts/scheduler.ts +++ b/compat/test/ts/scheduler.ts @@ -6,7 +6,7 @@ import { unstable_UserBlockingPriority, unstable_ImmediatePriority, unstable_now -} from '../../src'; +} from '../../src/index.cjs'; const noop = () => null; unstable_runWithPriority(unstable_IdlePriority, noop); diff --git a/compat/test/ts/suspense.tsx b/compat/test/ts/suspense.tsx index 3b6268f8a2..160493d739 100644 --- a/compat/test/ts/suspense.tsx +++ b/compat/test/ts/suspense.tsx @@ -1,4 +1,4 @@ -import * as React from '../../src'; +import * as React from '../../src/index.cjs'; interface LazyProps { isProp: boolean; diff --git a/config/compat-entries.js b/config/compat-entries.js index 6fd771b146..56708ad5e1 100644 --- a/config/compat-entries.js +++ b/config/compat-entries.js @@ -1,9 +1,11 @@ -const path = require('path'); -const fs = require('fs'); -const kl = require('kolorist'); +import path from 'node:path'; +import fs from 'node:fs'; +import * as kl from 'kolorist'; -const pkgFiles = new Set(require('../package.json').files); -const compatDir = path.join(__dirname, '..', 'compat'); +import pkg from '../package.json' with { type: 'json' }; + +const pkgFiles = new Set(pkg.files); +const compatDir = path.resolve('compat'); const files = fs.readdirSync(compatDir); let missing = 0; diff --git a/debug/package.json b/debug/package.json index f3eb5466e4..10770c12bd 100644 --- a/debug/package.json +++ b/debug/package.json @@ -1,11 +1,9 @@ { "name": "preact-debug", - "amdName": "preactDebug", "private": true, "description": "Preact extensions for development", + "type": "module", "main": "dist/debug.js", - "module": "dist/debug.mjs", - "umd:main": "dist/debug.umd.js", "source": "src/index.js", "types": "src/index.d.ts", "license": "MIT", diff --git a/devtools/package.json b/devtools/package.json index 95ada7e679..85e24a15af 100644 --- a/devtools/package.json +++ b/devtools/package.json @@ -1,11 +1,9 @@ { "name": "preact-devtools", - "amdName": "preactDevtools", "private": true, "description": "Preact bridge for Preact devtools", + "type": "module", "main": "dist/devtools.js", - "module": "dist/devtools.mjs", - "umd:main": "dist/devtools.umd.js", "source": "src/index.js", "types": "src/index.d.ts", "license": "MIT", diff --git a/hooks/package.json b/hooks/package.json index 6a5db76483..b44eaabb3c 100644 --- a/hooks/package.json +++ b/hooks/package.json @@ -1,11 +1,9 @@ { "name": "preact-hooks", - "amdName": "preactHooks", "private": true, "description": "Hook addon for Preact", + "type": "module", "main": "dist/hooks.js", - "module": "dist/hooks.mjs", - "umd:main": "dist/hooks.umd.js", "source": "src/index.js", "types": "src/index.d.ts", "license": "MIT", diff --git a/hooks/src/index.d.ts b/hooks/src/index.d.ts index 5acc8ffee3..01a87619ff 100644 --- a/hooks/src/index.d.ts +++ b/hooks/src/index.d.ts @@ -1,4 +1,4 @@ -import { ErrorInfo, PreactContext, Ref, RefObject } from '../../src/index'; +import { ErrorInfo, PreactContext, Ref, RefObject } from '../../src/index.js'; type Inputs = ReadonlyArray; diff --git a/hooks/src/internal.d.ts b/hooks/src/internal.d.ts index e2b9d6ddb0..0522576300 100644 --- a/hooks/src/internal.d.ts +++ b/hooks/src/internal.d.ts @@ -1,12 +1,12 @@ -import { +import type { Options as PreactOptions, Component as PreactComponent, VNode as PreactVNode, PreactContext, HookType, ErrorInfo -} from '../../src/internal'; -import { Reducer, StateUpdater } from '.'; +} from '../../src/internal.d.ts'; +import type { Reducer, StateUpdater } from './index.d.ts'; export { PreactContext }; diff --git a/jsconfig.json b/jsconfig.json index cc72eb92ea..542332348d 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -9,10 +9,11 @@ "moduleResolution": "node", "resolveJsonModule": true, "paths": { - "preact": ["."], + "preact": ["./src/index.d.ts"], "preact/*": ["./*"] }, "target": "es5", + "module": "esnext", "noEmit": true, "skipLibCheck": false, "types": ["vitest/globals"] diff --git a/jsx-runtime/package.json b/jsx-runtime/package.json index a76a8b733a..c1d39b71e9 100644 --- a/jsx-runtime/package.json +++ b/jsx-runtime/package.json @@ -1,11 +1,9 @@ { "name": "jsx-runtime", - "amdName": "jsxRuntime", "private": true, "description": "Preact JSX runtime", + "type": "module", "main": "dist/jsxRuntime.js", - "module": "dist/jsxRuntime.mjs", - "umd:main": "dist/jsxRuntime.umd.js", "source": "src/index.js", "types": "src/index.d.ts", "license": "MIT", diff --git a/jsx-runtime/src/index.d.ts b/jsx-runtime/src/index.d.ts index 82b1c708ca..70d5868585 100644 --- a/jsx-runtime/src/index.d.ts +++ b/jsx-runtime/src/index.d.ts @@ -1,4 +1,4 @@ -export { Fragment } from '../../src/index'; +export { Fragment } from '../../src/index.js'; import { ComponentType, ComponentChild, @@ -7,8 +7,8 @@ import { Attributes, HTMLAttributes, SVGAttributes -} from '../../src/index'; -import { JSXInternal } from '../../src/jsx'; +} from '../../src/index.js'; +import { JSXInternal } from '../../src/jsx.js'; export function jsx( type: string, diff --git a/package-lock.json b/package-lock.json index 3f2caf988d..04d9e6e5d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,8 +30,9 @@ "microbundle": "^0.15.1", "npm-run-all2": "^7.0.0", "oxlint": "^1.8.0", + "patch-package": "^8.0.1", "playwright": "^1.54.1", - "preact-render-to-string": "^6.5.0", + "preact-render-to-string": "^6.6.5", "prop-types": "^15.8.1", "sade": "^1.8.1", "terser": "5.16.0", @@ -4083,6 +4084,13 @@ "node": ">=12" } }, + "node_modules/@yarnpkg/lockfile": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", + "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", + "dev": true, + "license": "BSD-2-Clause" + }, "node_modules/@zip.js/zip.js": { "version": "2.7.62", "resolved": "https://registry.npmjs.org/@zip.js/zip.js/-/zip.js-2.7.62.tgz", @@ -4663,6 +4671,19 @@ "concat-map": "0.0.1" } }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/brotli-size": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/brotli-size/-/brotli-size-4.0.0.tgz", @@ -4779,13 +4800,50 @@ } }, "node_modules/call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", "dev": true, + "license": "MIT", "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -5093,6 +5151,22 @@ "devtools-protocol": "*" } }, + "node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -5649,6 +5723,24 @@ "node": ">=16.0.0" } }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/define-lazy-prop": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", @@ -5783,6 +5875,21 @@ "url": "https://github.com/fb55/domutils?sponsor=1" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/duplexer": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", @@ -5991,6 +6098,26 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-module-lexer": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", @@ -5998,6 +6125,19 @@ "dev": true, "license": "MIT" }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -6325,6 +6465,19 @@ "node": ">= 0.4.0" } }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/find-cache-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", @@ -6352,6 +6505,16 @@ "node": ">=8" } }, + "node_modules/find-yarn-workspace-root": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", + "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "micromatch": "^4.0.2" + } + }, "node_modules/foreground-child": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", @@ -6585,14 +6748,25 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "dev": true, + "license": "MIT", "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -6612,6 +6786,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/get-stream": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", @@ -6714,6 +6902,19 @@ "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==", "dev": true }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -6818,22 +7019,24 @@ } }, "node_modules/has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dev": true, + "license": "MIT", "dependencies": { - "get-intrinsic": "^1.1.1" + "es-define-property": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -7329,6 +7532,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, "node_modules/is-number-object": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", @@ -7711,6 +7924,33 @@ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, + "node_modules/json-stable-stringify": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.3.0.tgz", + "integrity": "sha512-qtYiSSFlwot9XHtF9bD9c7rwKjr+RecWT//ZnPvSmEjpV5mmPOCN4j8UjY5hbjNkOwZ/jQv3J6R1/pL7RwgMsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "isarray": "^2.0.5", + "jsonify": "^0.0.1", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/json-stable-stringify/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -7741,6 +7981,16 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/jsonify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz", + "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==", + "dev": true, + "license": "Public Domain", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -7807,6 +8057,16 @@ "node": ">=0.10.0" } }, + "node_modules/klaw-sync": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", + "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.11" + } + }, "node_modules/kleur": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", @@ -8106,6 +8366,16 @@ "semver": "bin/semver" } }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/maxmin": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/maxmin/-/maxmin-2.1.0.tgz", @@ -8337,6 +8607,20 @@ "node": ">=4.2.0" } }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, "node_modules/mime-db": { "version": "1.51.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", @@ -8999,6 +9283,93 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, + "node_modules/patch-package": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-8.0.1.tgz", + "integrity": "sha512-VsKRIA8f5uqHQ7NGhwIna6Bx6D9s/1iXlA1hthBVBEbkq+t4kXD0HHt+rJhf/Z+Ci0F/HCB2hvn0qLdLG+Qxlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@yarnpkg/lockfile": "^1.1.0", + "chalk": "^4.1.2", + "ci-info": "^3.7.0", + "cross-spawn": "^7.0.3", + "find-yarn-workspace-root": "^2.0.0", + "fs-extra": "^10.0.0", + "json-stable-stringify": "^1.0.2", + "klaw-sync": "^6.0.0", + "minimist": "^1.2.6", + "open": "^7.4.2", + "semver": "^7.5.3", + "slash": "^2.0.0", + "tmp": "^0.2.4", + "yaml": "^2.2.2" + }, + "bin": { + "patch-package": "index.js" + }, + "engines": { + "node": ">=14", + "npm": ">5" + } + }, + "node_modules/patch-package/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/patch-package/node_modules/open": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", + "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0", + "is-wsl": "^2.1.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/patch-package/node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/patch-package/node_modules/slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -9805,16 +10176,13 @@ } }, "node_modules/preact-render-to-string": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/preact-render-to-string/-/preact-render-to-string-6.5.0.tgz", - "integrity": "sha512-4vTsKlL51D6zAJObcyjDEnFCY5OBH/oaW+97X8z4IM6DK/BYD6exzaRZblTZhCeqzdBpQejPsfoS20xFc05SPA==", + "version": "6.6.5", + "resolved": "https://registry.npmjs.org/preact-render-to-string/-/preact-render-to-string-6.6.5.tgz", + "integrity": "sha512-O6MHzYNIKYaiSX3bOw0gGZfEbOmlIDtDfWwN1JJdc/T3ihzRT6tGGSEWE088dWrEDGa1u7101q+6fzQnO9XCPA==", "dev": true, "license": "MIT", - "dependencies": { - "pretty-format": "^3.8.0" - }, "peerDependencies": { - "preact": ">=10" + "preact": ">=10 || >= 11.0.0-0" } }, "node_modules/pretty-bytes": { @@ -9829,12 +10197,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/pretty-format": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-3.8.0.tgz", - "integrity": "sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew==", - "dev": true - }, "node_modules/process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", @@ -10696,6 +11058,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", @@ -11504,6 +11884,29 @@ "node": ">=14.0.0" } }, + "node_modules/tmp": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.5.tgz", + "integrity": "sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.14" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, "node_modules/totalist": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", @@ -12449,8 +12852,6 @@ "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.1.tgz", "integrity": "sha512-10ULxpnOCQXxJvBgxsn9ptjq6uviG/htZKk9veJGhlqn3w/DxQ631zFF+nlQXLwmImeS5amR2dl2U8sg6U9jsQ==", "dev": true, - "optional": true, - "peer": true, "bin": { "yaml": "bin.mjs" }, diff --git a/package.json b/package.json index 115779660b..a53f136e3a 100644 --- a/package.json +++ b/package.json @@ -1,87 +1,56 @@ { "name": "preact", - "amdName": "preact", "version": "11.0.0-beta.1", "private": false, "description": "Fast 4kb React-compatible Virtual DOM library.", - "main": "dist/preact.js", - "module": "dist/preact.mjs", - "umd:main": "dist/preact.umd.js", + "type": "module", + "main": "dist/preact.esm.js", "source": "src/index.js", "exports": { ".": { "types": "./src/index.d.ts", - "module": "./dist/preact.mjs", - "umd": "./dist/preact.umd.js", - "import": "./dist/preact.mjs", - "require": "./dist/preact.js" + "import": "./dist/preact.esm.js" }, "./compat": { - "types": "./compat/src/index.d.ts", - "module": "./compat/dist/compat.mjs", - "umd": "./compat/dist/compat.umd.js", - "import": "./compat/dist/compat.mjs", - "require": "./compat/dist/compat.js" + "types": "./compat/src/index.d.cts", + "import": "./compat/dist/compat.esm.js" }, "./debug": { "types": "./debug/src/index.d.ts", - "module": "./debug/dist/debug.mjs", - "umd": "./debug/dist/debug.umd.js", - "import": "./debug/dist/debug.mjs", - "require": "./debug/dist/debug.js" + "import": "./debug/dist/debug.esm.js" }, "./devtools": { "types": "./devtools/src/index.d.ts", - "module": "./devtools/dist/devtools.mjs", - "umd": "./devtools/dist/devtools.umd.js", - "import": "./devtools/dist/devtools.mjs", - "require": "./devtools/dist/devtools.js" + "import": "./devtools/dist/devtools.esm.js" }, "./hooks": { "types": "./hooks/src/index.d.ts", - "module": "./hooks/dist/hooks.mjs", - "umd": "./hooks/dist/hooks.umd.js", - "import": "./hooks/dist/hooks.mjs", - "require": "./hooks/dist/hooks.js" + "import": "./hooks/dist/hooks.esm.js" }, "./test-utils": { "types": "./test-utils/src/index.d.ts", - "module": "./test-utils/dist/testUtils.mjs", - "umd": "./test-utils/dist/testUtils.umd.js", - "import": "./test-utils/dist/testUtils.mjs", - "require": "./test-utils/dist/testUtils.js" + "import": "./test-utils/dist/testUtils.esm.js" }, "./compat/test-utils": { "types": "./test-utils/src/index.d.ts", - "module": "./test-utils/dist/testUtils.mjs", - "umd": "./test-utils/dist/testUtils.umd.js", - "import": "./test-utils/dist/testUtils.mjs", - "require": "./test-utils/dist/testUtils.js" + "import": "./test-utils/dist/testUtils.esm.js" }, "./jsx-runtime": { "types": "./jsx-runtime/src/index.d.ts", - "module": "./jsx-runtime/dist/jsxRuntime.mjs", - "umd": "./jsx-runtime/dist/jsxRuntime.umd.js", - "import": "./jsx-runtime/dist/jsxRuntime.mjs", - "require": "./jsx-runtime/dist/jsxRuntime.js" + "import": "./jsx-runtime/dist/jsxRuntime.esm.js" }, "./jsx-dev-runtime": { "types": "./jsx-runtime/src/index.d.ts", - "module": "./jsx-runtime/dist/jsxRuntime.mjs", - "umd": "./jsx-runtime/dist/jsxRuntime.umd.js", - "import": "./jsx-runtime/dist/jsxRuntime.mjs", - "require": "./jsx-runtime/dist/jsxRuntime.js" + "import": "./jsx-runtime/dist/jsxRuntime.esm.js" }, "./compat/client": { "types": "./compat/client.d.ts", - "import": "./compat/client.mjs", - "require": "./compat/client.js" + "import": "./compat/client.js" }, "./compat/server": { "types": "./compat/server.d.ts", "browser": "./compat/server.browser.js", - "import": "./compat/server.mjs", - "require": "./compat/server.js" + "import": "./compat/server.js" }, "./compat/server.browser": { "types": "./compat/server.d.ts", @@ -89,18 +58,15 @@ }, "./compat/jsx-runtime": { "types": "./jsx-runtime/src/index.d.ts", - "import": "./compat/jsx-runtime.mjs", - "require": "./compat/jsx-runtime.js" + "import": "./compat/jsx-runtime.js" }, "./compat/jsx-dev-runtime": { "types": "./jsx-runtime/src/index.d.ts", - "import": "./compat/jsx-dev-runtime.mjs", - "require": "./compat/jsx-dev-runtime.js" + "import": "./compat/jsx-dev-runtime.js" }, "./compat/scheduler": { "types": "./compat/scheduler.d.ts", - "import": "./compat/scheduler.mjs", - "require": "./compat/scheduler.js" + "import": "./compat/scheduler.js" }, "./package.json": "./package.json", "./compat/package.json": "./compat/package.json", @@ -119,17 +85,14 @@ "scripts": { "prepare": "husky && npm run test:install && run-s build", "build": "npm-run-all --parallel 'build:*'", - "build:core": "microbundle build --raw --no-generateTypes -f cjs,esm,umd", - "build:debug": "microbundle build --raw --no-generateTypes -f cjs,esm,umd --cwd debug", - "build:devtools": "microbundle build --raw --no-generateTypes -f cjs,esm,umd --cwd devtools", - "build:hooks": "microbundle build --raw --no-generateTypes -f cjs,esm,umd --cwd hooks", - "build:test-utils": "microbundle build --raw --no-generateTypes -f cjs,esm,umd --cwd test-utils", - "build:compat": "microbundle build --raw --no-generateTypes -f cjs,esm,umd --cwd compat --globals 'preact/hooks=preactHooks'", - "build:jsx": "microbundle build --raw --no-generateTypes -f cjs,esm,umd --cwd jsx-runtime", + "build:core": "microbundle build --raw --no-generateTypes -f esm -o dist/preact.js", + "build:debug": "microbundle build --raw --no-generateTypes -f esm --cwd debug -o dist/debug.js", + "build:devtools": "microbundle build --raw --no-generateTypes -f esm --cwd devtools -o dist/devtools.js", + "build:hooks": "microbundle build --raw --no-generateTypes -f esm --cwd hooks -o dist/hooks.js", + "build:test-utils": "microbundle build --raw --no-generateTypes -f esm --cwd test-utils -o dist/testUtils.js", + "build:compat": "microbundle build --raw --no-generateTypes -f esm --cwd compat -o dist/compat.js", + "build:jsx": "microbundle build --raw --no-generateTypes -f esm --cwd jsx-runtime -o dist/jsxRuntime.js", "postbuild": "node ./config/compat-entries.js", - "dev": "microbundle watch --raw --no-generateTypes --format cjs", - "dev:hooks": "microbundle watch --raw --no-generateTypes --format cjs --cwd hooks", - "dev:compat": "microbundle watch --raw --no-generateTypes --format cjs --cwd compat --globals 'preact/hooks=preactHooks'", "test": "npm-run-all build lint test:unit", "test:install": "playwright install chromium", "test:unit": "run-p test:vitest:min test:ts", @@ -143,7 +106,8 @@ "tsc": "tsc -p jsconfig-lint.json", "oxlint": "oxlint src test/browser test/node test/shared debug compat hooks test-utils", "format": "biome format --write .", - "format:check": "biome format ." + "format:check": "biome format .", + "postinstall": "patch-package" }, "nano-staged": { "**/*.{js,jsx,mjs,cjs,ts,tsx,yml,json,html,md,css,scss}": [ @@ -157,20 +121,14 @@ "compat/src", "compat/client.d.ts", "compat/client.js", - "compat/client.mjs", "compat/server.d.ts", "compat/server.browser.js", "compat/server.js", - "compat/server.mjs", "compat/scheduler.d.ts", "compat/scheduler.js", - "compat/scheduler.mjs", "compat/test-utils.js", - "compat/test-utils.mjs", "compat/jsx-runtime.js", - "compat/jsx-runtime.mjs", "compat/jsx-dev-runtime.js", - "compat/jsx-dev-runtime.mjs", "compat/package.json", "debug/dist", "debug/src", @@ -228,6 +186,7 @@ "microbundle": "^0.15.1", "npm-run-all2": "^7.0.0", "oxlint": "^1.8.0", + "patch-package": "^8.0.1", "playwright": "^1.54.1", "preact-render-to-string": "^6.5.0", "prop-types": "^15.8.1", diff --git a/patches/preact-render-to-string+6.6.5.patch b/patches/preact-render-to-string+6.6.5.patch new file mode 100644 index 0000000000..aa5e96d100 --- /dev/null +++ b/patches/preact-render-to-string+6.6.5.patch @@ -0,0 +1,27 @@ +diff --git a/node_modules/preact-render-to-string/dist/index.d.ts b/node_modules/preact-render-to-string/dist/index.d.ts +index 81db2bd..081b441 100644 +--- a/node_modules/preact-render-to-string/dist/index.d.ts ++++ b/node_modules/preact-render-to-string/dist/index.d.ts +@@ -1,3 +1,4 @@ ++// @ts-nocheck + import { VNode } from 'preact'; + + export default function renderToString

( +diff --git a/node_modules/preact-render-to-string/dist/stream-node.d.ts b/node_modules/preact-render-to-string/dist/stream-node.d.ts +index 990147b..ea8ada6 100644 +--- a/node_modules/preact-render-to-string/dist/stream-node.d.ts ++++ b/node_modules/preact-render-to-string/dist/stream-node.d.ts +@@ -1,3 +1,4 @@ ++// @ts-nocheck + import { VNode } from 'preact'; + import { WritableStream } from 'node:stream'; + +diff --git a/node_modules/preact-render-to-string/dist/stream.d.ts b/node_modules/preact-render-to-string/dist/stream.d.ts +index 1ab9aa5..8547ee9 100644 +--- a/node_modules/preact-render-to-string/dist/stream.d.ts ++++ b/node_modules/preact-render-to-string/dist/stream.d.ts +@@ -1,3 +1,4 @@ ++// @ts-nocheck + import { VNode } from 'preact'; + + interface RenderStream extends ReadableStream { diff --git a/src/dom.d.ts b/src/dom.d.ts index 2deef9eacb..e5af7a8315 100644 --- a/src/dom.d.ts +++ b/src/dom.d.ts @@ -1,6 +1,6 @@ // Most of our DOM-ish types -import { ClassAttributes, PreactDOMAttributes } from './index'; +import { ClassAttributes, PreactDOMAttributes } from './index.js'; // Implementations of some DOM events that are not available in TS 5.1 interface ToggleEvent extends Event { diff --git a/src/index.d.ts b/src/index.d.ts index 96f9b42dde..6dd221435a 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -1,10 +1,10 @@ export as namespace preact; -import { JSXInternal } from './jsx'; -import { DOMAttributes, HTMLAttributes, SVGAttributes } from './dom'; +import type { JSXInternal } from './jsx.d.ts'; +import type { DOMAttributes, HTMLAttributes, SVGAttributes } from './dom.d.ts'; -export import JSX = JSXInternal; -export * from './dom'; +export { JSXInternal as JSX } +export type * from './dom.d.ts'; // // Preact Virtual DOM @@ -230,7 +230,7 @@ export function createElement

( ...children: ComponentChildren[] ): VNode

; export namespace createElement { - export import JSX = JSXInternal; + export { JSXInternal as JSX }; } export function h( @@ -280,7 +280,7 @@ export function h

( ...children: ComponentChildren[] ): VNode; export namespace h { - export import JSX = JSXInternal; + export { JSXInternal as JSX }; } // diff --git a/src/internal.d.ts b/src/internal.d.ts index 06021f43b8..7cb522f513 100644 --- a/src/internal.d.ts +++ b/src/internal.d.ts @@ -1,4 +1,4 @@ -import * as preact from './index'; +import * as preact from './index.js'; export enum HookType { useState = 1, diff --git a/src/jsx.d.ts b/src/jsx.d.ts index 438dc0336e..36c2216c00 100644 --- a/src/jsx.d.ts +++ b/src/jsx.d.ts @@ -1,7 +1,7 @@ // Users who only use Preact for SSR might not specify "dom" in their lib in tsconfig.json /// -import * as preact from './index'; +import * as preact from './index.js'; type Defaultize = // Distribute over unions diff --git a/test-utils/package.json b/test-utils/package.json index bca4c3fb24..812c888d57 100644 --- a/test-utils/package.json +++ b/test-utils/package.json @@ -1,11 +1,9 @@ { "name": "test-utils", - "amdName": "preactTestUtils", "private": true, "description": "Test-utils for Preact", + "type": "module", "main": "dist/testUtils.js", - "module": "dist/testUtils.mjs", - "umd:main": "dist/testUtils.umd.js", "source": "src/index.js", "types": "src/index.d.ts", "license": "MIT", diff --git a/vitest.config.mjs b/vitest.config.js similarity index 77% rename from vitest.config.mjs rename to vitest.config.js index c61a399c94..f5d3e1fc37 100644 --- a/vitest.config.mjs +++ b/vitest.config.js @@ -10,24 +10,24 @@ const root = path.resolve(__dirname); const alias = { '^react$': path.join( root, - MINIFY ? 'compat/dist/compat.mjs' : 'compat/src/index.js' + MINIFY ? 'compat/dist/compat.esm.js' : 'compat/src/index.js' ), '^react-dom$': path.join( root, - MINIFY ? 'compat/dist/compat.mjs' : 'compat/src/index.js' + MINIFY ? 'compat/dist/compat.esm.js' : 'compat/src/index.js' ), - '^preact$': path.join(root, MINIFY ? 'dist/preact.mjs' : 'src/index.js'), + '^preact$': path.join(root, MINIFY ? 'dist/preact.esm.js' : 'src/index.js'), '^preact/compat$': path.join( root, - MINIFY ? 'compat/dist/compat.mjs' : 'compat/src/index.js' + MINIFY ? 'compat/dist/compat.esm.js' : 'compat/src/index.js' ), '^preact/jsx-runtime$': path.join( root, - MINIFY ? 'jsx-runtime/dist/jsxRuntime.mjs' : 'jsx-runtime/src/index.js' + MINIFY ? 'jsx-runtime/dist/jsxRuntime.esm.js' : 'jsx-runtime/src/index.js' ), '^preact/jsx-runtime/src$': path.join( root, - MINIFY ? 'jsx-runtime/dist/jsxRuntime.mjs' : 'jsx-runtime/src' + MINIFY ? 'jsx-runtime/dist/jsxRuntime.esm.js' : 'jsx-runtime/src' ), '^preact/jsx-dev-runtime$': path.join( root, @@ -37,7 +37,7 @@ const alias = { ), '^preact/debug$': path.join( root, - MINIFY ? 'debug/dist/debug.mjs' : 'debug/src/index.js' + MINIFY ? 'debug/dist/debug.esm.js' : 'debug/src/index.js' ), '^preact/devtools$': path.join( root, @@ -45,11 +45,11 @@ const alias = { ), '^preact/hooks$': path.join( root, - MINIFY ? 'hooks/dist/hooks.mjs' : 'hooks/src/index.js' + MINIFY ? 'hooks/dist/hooks.esm.js' : 'hooks/src/index.js' ), '^preact/test-utils$': path.join( root, - MINIFY ? 'test-utils/dist/testUtils.mjs' : 'test-utils/src/index.js' + MINIFY ? 'test-utils/dist/testUtils.esm.js' : 'test-utils/src/index.js' ) }; @@ -57,62 +57,62 @@ const rollupAlias = [ { find: /^react$/, replacement: MINIFY - ? path.join(root, 'compat/dist/compat.mjs') + ? path.join(root, 'compat/dist/compat.esm.js') : path.join(root, 'compat/src/index.js') }, { find: /^react-dom$/, replacement: MINIFY - ? path.join(root, 'compat/dist/compat.mjs') + ? path.join(root, 'compat/dist/compat.esm.js') : path.join(root, 'compat/src/index.js') }, { find: /^preact$/, replacement: path.join(root, 'src/index.js') }, { find: /^preact\/compat$/, replacement: MINIFY - ? path.join(root, 'compat/dist/compat.mjs') + ? path.join(root, 'compat/dist/compat.esm.js') : path.join(root, 'compat/src/index.js') }, { find: /^preact\/jsx-runtime$/, replacement: MINIFY - ? path.join(root, 'jsx-runtime/dist/jsxRuntime.mjs') + ? path.join(root, 'jsx-runtime/dist/jsxRuntime.esm.js') : path.join(root, 'jsx-runtime/src/index.js') }, { find: /^preact\/jsx-runtime\/src$/, replacement: MINIFY - ? path.join(root, 'jsx-runtime/dist/jsxRuntime.mjs') + ? path.join(root, 'jsx-runtime/dist/jsxRuntime.esm.js') : path.join(root, 'jsx-runtime/src') }, { find: /^preact\/jsx-dev-runtime$/, replacement: MINIFY - ? path.join(root, 'jsx-runtime/dist/jsxRuntime.mjs') + ? path.join(root, 'jsx-runtime/dist/jsxRuntime.esm.js') : path.join(root, 'jsx-runtime/src/index.js') }, { find: /^preact\/debug$/, replacement: MINIFY - ? path.join(root, 'debug/dist/debug.mjs') + ? path.join(root, 'debug/dist/debug.esm.js') : path.join(root, 'debug/src/index.js') }, { find: /^preact\/devtools$/, replacement: MINIFY - ? path.join(root, 'devtools/dist/devtools.mjs') + ? path.join(root, 'devtools/dist/devtools.esm.js') : path.join(root, 'devtools/src/index.js') }, { find: /^preact\/hooks$/, replacement: MINIFY - ? path.join(root, 'hooks/dist/hooks.mjs') + ? path.join(root, 'hooks/dist/hooks.esm.js') : path.join(root, 'hooks/src/index.js') }, { find: /^preact\/test-utils$/, replacement: MINIFY - ? path.join(root, 'test-utils/dist/testUtils.mjs') + ? path.join(root, 'test-utils/dist/testUtils.esm.js') : path.join(root, 'test-utils/src/index.js') } ]; @@ -201,13 +201,13 @@ export default defineConfig({ enabled: COVERAGE, include: MINIFY ? [ - 'dist/preact.mjs', - 'compat/dist/compat.mjs', - 'devtools/dist/devtools.mjs', - 'jsx-runtime/dist/jsxRuntime.mjs', - 'debug/dist/debug.mjs', - 'hooks/dist/hooks.mjs', - 'test-utils/dist/testUtils.mjs' + 'dist/preact.esm.js', + 'compat/dist/compat.esm.js', + 'devtools/dist/devtools.esm.js', + 'jsx-runtime/dist/jsxRuntime.esm.js', + 'debug/dist/debug.esm.js', + 'hooks/dist/hooks.esm.js', + 'test-utils/dist/testUtils.esm.js' ] : [ 'src/**/*',