From 962ba862f4825736a5b84475717dabb544108f57 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Sun, 19 Jan 2025 17:36:13 +0100 Subject: [PATCH 1/7] migrate to ts --- dist/index.d.ts | 28 + dist/index.js | 314 ++++++++ lib/index.js | 2 - package.json | 12 +- pnpm-lock.yaml | 1000 ++++++++++++++++++++++++++ lib/core.js => src/core.ts | 29 +- lib/index.d.ts => src/index.d.ts.txt | 0 src/index.ts | 2 + lib/module.js => src/module.ts | 14 + lib/render.js => src/render.ts | 8 +- tsconfig.json | 8 + 11 files changed, 1399 insertions(+), 18 deletions(-) create mode 100644 dist/index.d.ts create mode 100644 dist/index.js delete mode 100644 lib/index.js rename lib/core.js => src/core.ts (90%) rename lib/index.d.ts => src/index.d.ts.txt (100%) create mode 100644 src/index.ts rename lib/module.js => src/module.ts (85%) rename lib/render.js => src/render.ts (79%) create mode 100644 tsconfig.json diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..0526c69 --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,28 @@ +import * as React from 'react'; +import React__default from 'react'; + +declare function DevJar({ files, getModuleUrl, onError, ...props }: { + files: any; + getModuleUrl?: (name: string) => string; + onError?: (...data: any[]) => void; +}): React__default.DetailedReactHTMLElement, any>; + +declare global { + interface Window { + esmsInitOptions: { + shimMode: boolean; + mapOverrides: boolean; + }; + } + function importShim(url: string): Promise; +} + +declare function useLiveCode({ getModuleUrl }: { + getModuleUrl?: (name: string) => string; +}): { + ref: React.RefObject; + error: undefined; + load: (files: any) => Promise; +}; + +export { DevJar, useLiveCode }; diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..15be6ec --- /dev/null +++ b/dist/index.js @@ -0,0 +1,314 @@ +import React, { useRef, useState, useId, useEffect, useCallback } from 'react'; +import { transform } from 'sucrase'; +import { init, parse } from 'es-module-lexer'; + +// declare esmsInitOptions on global window +async function createModule(files, { getModuleUrl }) { + let currentImportMap; + let shim; + async function setupImportMap() { + if (shim) return shim; + window.esmsInitOptions = { + shimMode: true, + mapOverrides: true + }; + shim = import(/* webpackIgnore: true */ getModuleUrl('es-module-shims')); + await shim; + } + function updateImportMap(imports) { + imports['react'] = getModuleUrl('react'); + imports['react-dom'] = getModuleUrl('react-dom'); + imports['react-dom/client'] = getModuleUrl('react-dom/client'); + const script = document.createElement('script'); + script.type = 'importmap-shim'; + script.innerHTML = JSON.stringify({ + imports + }); + document.body.appendChild(script); + if (currentImportMap) { + currentImportMap.parentNode.removeChild(currentImportMap); + } + currentImportMap = script; + } + function createInlinedModule(code, type) { + if (type === 'css') return `data:text/css;utf-8,${encodeURIComponent(code)}`; + return `data:text/javascript;utf-8,${encodeURIComponent(code)}`; + } + await setupImportMap(); + const imports = Object.fromEntries(Object.entries(files).map(([fileName, code])=>[ + fileName, + createInlinedModule(code, fileName.endsWith('.css') ? 'css' : 'js') + ])); + updateImportMap(imports); + return self.importShim('index.js'); +} + +let esModuleLexerInit; +const isRelative = (s)=>s.startsWith('./'); +function transformCode(_code, getModuleUrl, externals) { + const code = transform(_code, { + transforms: [ + 'jsx', + 'typescript' + ] + }).code; + return replaceImports(code, getModuleUrl, externals); +} +function replaceImports(source, getModuleUrl, externals) { + let code = ''; + let lastIndex = 0; + let hasReactImports = false; + const [imports] = parse(source); + const cssImports = []; + let cssImportIndex = 0; + // start, end, statementStart, statementEnd, assertion, name + imports.forEach(({ s, e, ss, se, a, n })=>{ + code += source.slice(lastIndex, ss) // content from last import to beginning of this line + ; + // handle imports + if (n.endsWith('.css')) { + // Map './styles.css' -> '@styles.css', and collect it + const cssPath = `${'@' + n.slice(2)}`; + cssImports.push(cssPath); + } else { + code += source.substring(ss, s); + code += isRelative(n) ? '@' + n.slice(2) : externals.has(n) ? n : getModuleUrl(n); + code += source.substring(e, se); + } + lastIndex = se; + if (n === 'react') { + const statement = source.slice(ss, se); + if (statement.includes('React')) { + hasReactImports = true; + } + } + cssImports.forEach((cssPath)=>{ + code += `\nimport sheet${cssImportIndex} from "${cssPath}" assert { type: "css" };\n`; + cssImportIndex++; + }); + }); + if (cssImports.length) { + code += `const __customStyleSheets = [`; + for(let i = 0; i < cssImports.length; i++){ + code += `sheet${i}`; + if (i < cssImports.length - 1) { + code += `, `; + } + } + code += `];\n`; + code += `document.adoptedStyleSheets = [...document.adoptedStyleSheets, ...__customStyleSheets];\n`; + } + code += source.substring(lastIndex); + if (!hasReactImports) { + code = `import React from 'react';\n${code}`; + } + return code; +} +function createRenderer(createModule_, getModuleUrl) { + let reactRoot; + async function render(files) { + const mod = await createModule_(files, { + getModuleUrl + }); + const ReactMod = await self.importShim('react'); + const ReactDOMMod = await self.importShim('react-dom/client'); + const _jsx = ReactMod.createElement; + const root = document.getElementById('__reactRoot'); + class ErrorBoundary extends ReactMod.Component { + componentDidCatch(error) { + this.setState({ + error + }); + } + render() { + if (this.state.error) { + return _jsx('div', null, this.state.error?.message); + } + return this.props.children; + } + constructor(props){ + super(props); + this.state = { + error: null + }; + } + } + if (!reactRoot) { + reactRoot = ReactDOMMod.createRoot(root); + } + const Component = mod.default; + const element = _jsx(ErrorBoundary, null, _jsx(Component)); + reactRoot.render(element); + } + return render; +} +function createMainScript({ uid }) { + const code = `\ +'use strict'; +const _createModule = ${createModule.toString()}; +const _createRenderer = ${createRenderer.toString()}; + +const getModuleUrl = (m) => window.parent.__devjar__[globalThis.uid].getModuleUrl(m) + +globalThis.uid = ${JSON.stringify(uid)}; +globalThis.__render__ = _createRenderer(_createModule, getModuleUrl); +`; + return code; +} +function createEsShimOptionsScript() { + return `\ +window.esmsInitOptions = { + polyfillEnable: ['css-modules', 'json-modules'], + onerror: error => console.log(error), +}`; +} +function useScript() { + return useRef(typeof window !== 'undefined' ? document.createElement('script') : null); +} +function createScript(scriptRef, { content, src, type } = {}) { + const script = scriptRef.current; + if (type) script.type = type; + if (content) { + script.src = `data:text/javascript;utf-8,${encodeURIComponent(content)}`; + } + if (src) { + script.src = src; + } + return script; +} +function useLiveCode({ getModuleUrl }) { + const iframeRef = useRef(null); + const [error, setError] = useState(); + const rerender = useState({})[1]; + const appScriptRef = useScript(); + const esShimOptionsScriptRef = useScript(); + const tailwindcssScriptRef = useScript(); + const uid = useId(); + // Let getModuleUrl executed on parent window side since it might involve + // variables that iframe cannot access. + useEffect(()=>{ + if (!globalThis.__devjar__) { + globalThis.__devjar__ = {}; + } + globalThis.__devjar__[uid] = { + getModuleUrl + }; + return ()=>{ + if (globalThis.__devjar__) { + delete globalThis.__devjar__[uid]; + } + }; + }, []); + useEffect(()=>{ + const iframe = iframeRef.current; + if (!iframe || !iframe.contentDocument) return; + const doc = iframe.contentDocument; + const body = doc.body; + const div = document.createElement('div'); + div.id = '__reactRoot'; + const appScriptContent = createMainScript({ + uid + }); + const scriptOptionsContent = createEsShimOptionsScript(); + const esmShimOptionsScript = createScript(esShimOptionsScriptRef, { + content: scriptOptionsContent + }); + const appScript = createScript(appScriptRef, { + content: appScriptContent, + type: 'module' + }); + const tailwindScript = createScript(tailwindcssScriptRef, { + src: 'https://cdn.tailwindcss.com' + }); + body.appendChild(div); + body.appendChild(esmShimOptionsScript); + body.appendChild(appScript); + body.appendChild(tailwindScript); + return ()=>{ + if (!iframe || !iframe.contentDocument) return; + body.removeChild(div); + body.removeChild(esmShimOptionsScript); + body.removeChild(appScript); + body.removeChild(tailwindScript); + }; + }, []); + const load = useCallback(async (files)=>{ + if (!esModuleLexerInit) { + await init; + esModuleLexerInit = true; + } + if (files) { + // { 'react', 'react-dom' } + const overrideExternals = new Set(Object.keys(files).filter((name)=>!isRelative(name) && name !== 'index.js')); + // Always share react as externals + overrideExternals.add('react'); + overrideExternals.add('react-dom'); + try { + /** + * transformedFiles + * { + * 'index.js': '...', + * '@mod1': '...', + * '@mod2': '...', + */ const transformedFiles = Object.keys(files).reduce((res, filename)=>{ + const key = isRelative(filename) ? '@' + filename.slice(2) : filename; + if (filename.endsWith('.css')) { + res[key] = files[filename]; + } else { + res[key] = transformCode(files[filename], getModuleUrl, overrideExternals); + } + return res; + }, {}); + const iframe = iframeRef.current; + const script = appScriptRef.current; + if (iframe) { + const render = iframe.contentWindow.__render__; + if (render) { + render(transformedFiles); + } else { + // if render is not loaded yet, wait until it's loaded + script.onload = ()=>{ + iframe.contentWindow.__render__(transformedFiles); + }; + } + } + setError(undefined); + } catch (e) { + console.error(e); + setError(e); + } + } + rerender({}); + }, []); + return { + ref: iframeRef, + error, + load + }; +} + +const defaultOnError = typeof window !== 'undefined' ? console.error : ()=>{}; +function DevJar({ files, getModuleUrl, onError = defaultOnError, ...props }) { + const onErrorRef = useRef(onError); + const { ref, error, load } = useLiveCode({ + getModuleUrl + }); + useEffect(()=>{ + onErrorRef.current(error); + }, [ + error + ]); + // load code files and execute them as live code + useEffect(()=>{ + load(files); + }, [ + files + ]); + // Attach the ref to an iframe element for runtime of code execution + return React.createElement('iframe', { + ...props, + ref + }); +} + +export { DevJar, useLiveCode }; diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index d159f50..0000000 --- a/lib/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { DevJar } from './render.js' -export { useLiveCode } from './core.js' diff --git a/package.json b/package.json index 99647e5..9c127f2 100644 --- a/package.json +++ b/package.json @@ -3,15 +3,17 @@ "version": "0.5.0", "type": "module", "exports": { - ".": "./lib/index.js", + ".": "./dist/index.js", "./package.json": "./package.json" }, "license": "MIT", "files": [ "lib" ], - "types": "./lib/index.d.ts", + "types": "./dist/index.d.ts", "scripts": { + "build": "bunchee", + "prepublishOnly": "pnpm run build", "build:site": "next build ./site", "start": "next start ./site", "dev": "next dev ./site" @@ -25,12 +27,16 @@ "sucrase": "3.35.0" }, "devDependencies": { + "@types/react": "^19.0.7", + "@types/react-dom": "^19.0.3", + "bunchee": "^6.3.2", "codice": "^0.4.4", "devjar": "link:", "next": "^15.1.5", "react": "^19.0.0", "react-dom": "^19.0.0", - "sugar-high": "^0.8.2" + "sugar-high": "^0.8.2", + "typescript": "^5.7.3" }, "packageManager": "pnpm@9.15.4" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e64b67a..ef20853 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,6 +18,15 @@ importers: specifier: 3.35.0 version: 3.35.0 devDependencies: + '@types/react': + specifier: ^19.0.7 + version: 19.0.7 + '@types/react-dom': + specifier: ^19.0.3 + version: 19.0.3(@types/react@19.0.7) + bunchee: + specifier: ^6.3.2 + version: 6.3.2(typescript@5.7.3) codice: specifier: ^0.4.4 version: 0.4.4(react@19.0.0) @@ -36,12 +45,26 @@ importers: sugar-high: specifier: ^0.8.2 version: 0.8.2 + typescript: + specifier: ^5.7.3 + version: 5.7.3 packages: + '@babel/code-frame@7.26.2': + resolution: {integrity: sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-identifier@7.25.9': + resolution: {integrity: sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==} + engines: {node: '>=6.9.0'} + '@emnapi/runtime@1.3.1': resolution: {integrity: sha512-kEBmG8KyqtxJZv+ygbEim+KCGtIq1fC22Ms3S4ziXmYKm8uyoLX0MHONVKwp+9opg390VaKRNt4a7A9NwmpNhw==} + '@fastify/deepmerge@1.3.0': + resolution: {integrity: sha512-J8TOSBq3SoZbDhM9+R/u77hP93gz/rajSA+K2kGyijPpORPWUXHUpTaleoj+92As0S9uPRP7Oi8IqMf0u+ro6A==} + '@img/sharp-darwin-arm64@0.33.5': resolution: {integrity: sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} @@ -220,16 +243,263 @@ packages: cpu: [x64] os: [win32] + '@nodelib/fs.scandir@2.1.5': + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + + '@nodelib/fs.stat@2.0.5': + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + + '@nodelib/fs.walk@1.2.8': + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} + '@rollup/plugin-commonjs@28.0.2': + resolution: {integrity: sha512-BEFI2EDqzl+vA1rl97IDRZ61AIwGH093d9nz8+dThxJNH8oSoB7MjWvPCX3dkaK1/RCJ/1v/R1XB15FuSs0fQw==} + engines: {node: '>=16.0.0 || 14 >= 14.17'} + peerDependencies: + rollup: ^2.68.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + + '@rollup/plugin-json@6.1.0': + resolution: {integrity: sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + + '@rollup/plugin-node-resolve@16.0.0': + resolution: {integrity: sha512-0FPvAeVUT/zdWoO0jnb/V5BlBsUSNfkIOtFHzMO4H9MOklrmQFY6FduVHKucNb/aTFxvnGhj4MNj/T1oNdDfNg==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^2.78.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + + '@rollup/plugin-replace@6.0.2': + resolution: {integrity: sha512-7QaYCf8bqF04dOy7w/eHmJeNExxTYwvKAmlSAH/EaWWUzbT0h5sbF6bktFoX/0F/0qwng5/dWFMyf3gzaM8DsQ==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + + '@rollup/plugin-wasm@6.2.2': + resolution: {integrity: sha512-gpC4R1G9Ni92ZIRTexqbhX7U+9estZrbhP+9SRb0DW9xpB9g7j34r+J2hqrcW/lRI7dJaU84MxZM0Rt82tqYPQ==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + + '@rollup/pluginutils@5.1.4': + resolution: {integrity: sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + + '@rollup/rollup-android-arm-eabi@4.31.0': + resolution: {integrity: sha512-9NrR4033uCbUBRgvLcBrJofa2KY9DzxL2UKZ1/4xA/mnTNyhZCWBuD8X3tPm1n4KxcgaraOYgrFKSgwjASfmlA==} + cpu: [arm] + os: [android] + + '@rollup/rollup-android-arm64@4.31.0': + resolution: {integrity: sha512-iBbODqT86YBFHajxxF8ebj2hwKm1k8PTBQSojSt3d1FFt1gN+xf4CowE47iN0vOSdnd+5ierMHBbu/rHc7nq5g==} + cpu: [arm64] + os: [android] + + '@rollup/rollup-darwin-arm64@4.31.0': + resolution: {integrity: sha512-WHIZfXgVBX30SWuTMhlHPXTyN20AXrLH4TEeH/D0Bolvx9PjgZnn4H677PlSGvU6MKNsjCQJYczkpvBbrBnG6g==} + cpu: [arm64] + os: [darwin] + + '@rollup/rollup-darwin-x64@4.31.0': + resolution: {integrity: sha512-hrWL7uQacTEF8gdrQAqcDy9xllQ0w0zuL1wk1HV8wKGSGbKPVjVUv/DEwT2+Asabf8Dh/As+IvfdU+H8hhzrQQ==} + cpu: [x64] + os: [darwin] + + '@rollup/rollup-freebsd-arm64@4.31.0': + resolution: {integrity: sha512-S2oCsZ4hJviG1QjPY1h6sVJLBI6ekBeAEssYKad1soRFv3SocsQCzX6cwnk6fID6UQQACTjeIMB+hyYrFacRew==} + cpu: [arm64] + os: [freebsd] + + '@rollup/rollup-freebsd-x64@4.31.0': + resolution: {integrity: sha512-pCANqpynRS4Jirn4IKZH4tnm2+2CqCNLKD7gAdEjzdLGbH1iO0zouHz4mxqg0uEMpO030ejJ0aA6e1PJo2xrPA==} + cpu: [x64] + os: [freebsd] + + '@rollup/rollup-linux-arm-gnueabihf@4.31.0': + resolution: {integrity: sha512-0O8ViX+QcBd3ZmGlcFTnYXZKGbFu09EhgD27tgTdGnkcYXLat4KIsBBQeKLR2xZDCXdIBAlWLkiXE1+rJpCxFw==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm-musleabihf@4.31.0': + resolution: {integrity: sha512-w5IzG0wTVv7B0/SwDnMYmbr2uERQp999q8FMkKG1I+j8hpPX2BYFjWe69xbhbP6J9h2gId/7ogesl9hwblFwwg==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm64-gnu@4.31.0': + resolution: {integrity: sha512-JyFFshbN5xwy6fulZ8B/8qOqENRmDdEkcIMF0Zz+RsfamEW+Zabl5jAb0IozP/8UKnJ7g2FtZZPEUIAlUSX8cA==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-arm64-musl@4.31.0': + resolution: {integrity: sha512-kpQXQ0UPFeMPmPYksiBL9WS/BDiQEjRGMfklVIsA0Sng347H8W2iexch+IEwaR7OVSKtr2ZFxggt11zVIlZ25g==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-loongarch64-gnu@4.31.0': + resolution: {integrity: sha512-pMlxLjt60iQTzt9iBb3jZphFIl55a70wexvo8p+vVFK+7ifTRookdoXX3bOsRdmfD+OKnMozKO6XM4zR0sHRrQ==} + cpu: [loong64] + os: [linux] + + '@rollup/rollup-linux-powerpc64le-gnu@4.31.0': + resolution: {integrity: sha512-D7TXT7I/uKEuWiRkEFbed1UUYZwcJDU4vZQdPTcepK7ecPhzKOYk4Er2YR4uHKme4qDeIh6N3XrLfpuM7vzRWQ==} + cpu: [ppc64] + os: [linux] + + '@rollup/rollup-linux-riscv64-gnu@4.31.0': + resolution: {integrity: sha512-wal2Tc8O5lMBtoePLBYRKj2CImUCJ4UNGJlLwspx7QApYny7K1cUYlzQ/4IGQBLmm+y0RS7dwc3TDO/pmcneTw==} + cpu: [riscv64] + os: [linux] + + '@rollup/rollup-linux-s390x-gnu@4.31.0': + resolution: {integrity: sha512-O1o5EUI0+RRMkK9wiTVpk2tyzXdXefHtRTIjBbmFREmNMy7pFeYXCFGbhKFwISA3UOExlo5GGUuuj3oMKdK6JQ==} + cpu: [s390x] + os: [linux] + + '@rollup/rollup-linux-x64-gnu@4.31.0': + resolution: {integrity: sha512-zSoHl356vKnNxwOWnLd60ixHNPRBglxpv2g7q0Cd3Pmr561gf0HiAcUBRL3S1vPqRC17Zo2CX/9cPkqTIiai1g==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-linux-x64-musl@4.31.0': + resolution: {integrity: sha512-ypB/HMtcSGhKUQNiFwqgdclWNRrAYDH8iMYH4etw/ZlGwiTVxBz2tDrGRrPlfZu6QjXwtd+C3Zib5pFqID97ZA==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-win32-arm64-msvc@4.31.0': + resolution: {integrity: sha512-JuhN2xdI/m8Hr+aVO3vspO7OQfUFO6bKLIRTAy0U15vmWjnZDLrEgCZ2s6+scAYaQVpYSh9tZtRijApw9IXyMw==} + cpu: [arm64] + os: [win32] + + '@rollup/rollup-win32-ia32-msvc@4.31.0': + resolution: {integrity: sha512-U1xZZXYkvdf5MIWmftU8wrM5PPXzyaY1nGCI4KI4BFfoZxHamsIe+BtnPLIvvPykvQWlVbqUXdLa4aJUuilwLQ==} + cpu: [ia32] + os: [win32] + + '@rollup/rollup-win32-x64-msvc@4.31.0': + resolution: {integrity: sha512-ul8rnCsUumNln5YWwz0ted2ZHFhzhRRnkpBZ+YRuHoRAlUji9KChpOUOndY7uykrPEPXVbHLlsdo6v5yXo/TXw==} + cpu: [x64] + os: [win32] + + '@swc/core-darwin-arm64@1.10.8': + resolution: {integrity: sha512-FtacTu9zS5YuepujQqujveNw8BQ8ESJ+pN1Z7C+WrKCHlCl+5dh0n6gMAlEj+3iRvY6UAYqkzTVeiX/bOMoJKA==} + engines: {node: '>=10'} + cpu: [arm64] + os: [darwin] + + '@swc/core-darwin-x64@1.10.8': + resolution: {integrity: sha512-nfk+iq7EKQwADaCERzZLSi9ovzjJcqDWaO4e2ztyCNaLFi6fP1m6+ij21aki5KAd8AXoY4fue4Mo2fuYbesX9Q==} + engines: {node: '>=10'} + cpu: [x64] + os: [darwin] + + '@swc/core-linux-arm-gnueabihf@1.10.8': + resolution: {integrity: sha512-CL2zfbnrEc6nIiWbgshOz0mjn/zY8JcYqO12vGcTxmZOrh0n+mmHN2ejX91pYWQnQDtbhCmFTaEndExFpA7Gww==} + engines: {node: '>=10'} + cpu: [arm] + os: [linux] + + '@swc/core-linux-arm64-gnu@1.10.8': + resolution: {integrity: sha512-quS8F18DDScW3B7qnbWkz95abZ5p0xp/W8N498NAAls/YQj4jQIlf8WlAWoxVVjY/SmSus5kN5tuwhHD8t0NPw==} + engines: {node: '>=10'} + cpu: [arm64] + os: [linux] + + '@swc/core-linux-arm64-musl@1.10.8': + resolution: {integrity: sha512-wI0Hny8fHbBK/OjJ7eFYP0uDKiCMMMr5OBWGKMRRUvWs2zlGeJQZbwUeCnWuLLXzDfL+feMfh5TieYlqKTTtRw==} + engines: {node: '>=10'} + cpu: [arm64] + os: [linux] + + '@swc/core-linux-x64-gnu@1.10.8': + resolution: {integrity: sha512-24FCRUFO8gzPP2eu3soHTm3lk+ktcsIhdM2DTOlXGA+2TBYFWgAZX/yZV+eeRrtIZYSr4OcOWsNWnQ5Ma4budA==} + engines: {node: '>=10'} + cpu: [x64] + os: [linux] + + '@swc/core-linux-x64-musl@1.10.8': + resolution: {integrity: sha512-mBo7M/FmUhoWpUG17MLbS98iRA7t6ThxQBWDJZd322whkN1GqrvumYm2wvvjmoMTeDOPwAL3hIIa5H+Q4vb1zA==} + engines: {node: '>=10'} + cpu: [x64] + os: [linux] + + '@swc/core-win32-arm64-msvc@1.10.8': + resolution: {integrity: sha512-rXJ9y77JZZXoZkgFR0mObKa3TethRBJ6Exs/pwhScl9pz4qsfxhj/bQbEu1g1i/ihmd0l+IKZwGSC7Ibh3HA2Q==} + engines: {node: '>=10'} + cpu: [arm64] + os: [win32] + + '@swc/core-win32-ia32-msvc@1.10.8': + resolution: {integrity: sha512-n6ekYFJEBPvTpRIqJiu6EHXVzVnuCtDTpFnn/0KVGJI1yQHriGVEovnb/+qyLh8Rwx2AZM9qgZVgMhVtfcFQJg==} + engines: {node: '>=10'} + cpu: [ia32] + os: [win32] + + '@swc/core-win32-x64-msvc@1.10.8': + resolution: {integrity: sha512-vplXxtH/lFc/epELnAyvdCvqlDJrM+OKtkphYcbPqq50g/dEZYZ8FYHU5Df9Uo19UooWSo1LaxPk4R7n6i1Axw==} + engines: {node: '>=10'} + cpu: [x64] + os: [win32] + + '@swc/core@1.10.8': + resolution: {integrity: sha512-I3G+n9qbHNu6KNraaAG1+Z1S1x5S7MGRA6OEppT8Pt3Z9uD5a/kYAGU33eXy7zY+BoKuKA2X1H0r4vSimAgU8w==} + engines: {node: '>=10'} + peerDependencies: + '@swc/helpers': '*' + peerDependenciesMeta: + '@swc/helpers': + optional: true + '@swc/counter@0.1.3': resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==} '@swc/helpers@0.5.15': resolution: {integrity: sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==} + '@swc/types@0.1.17': + resolution: {integrity: sha512-V5gRru+aD8YVyCOMAjMpWR1Ui577DD5KSJsHP8RAxopAH22jFz6GZd/qxqjO6MJHQhcsjvjOFXyDhyLQUnMveQ==} + + '@types/estree@1.0.6': + resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} + + '@types/react-dom@19.0.3': + resolution: {integrity: sha512-0Knk+HJiMP/qOZgMyNFamlIjw9OFCsyC2ZbigmEEyXXixgre6IQpm/4V+r3qH4GC1JPvRJKInw+on2rV6YZLeA==} + peerDependencies: + '@types/react': ^19.0.0 + + '@types/react@19.0.7': + resolution: {integrity: sha512-MoFsEJKkAtZCrC1r6CM8U22GzhG7u2Wir8ons/aCKH6MBdD1ibV24zOSSkdZVUKqN5i396zG5VKLYZ3yaUZdLA==} + + '@types/resolve@1.20.2': + resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} + ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} @@ -255,6 +525,20 @@ packages: brace-expansion@2.0.1: resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + bunchee@6.3.2: + resolution: {integrity: sha512-f7EIySdCuzCsT4TLKQSH9OgH57R8HqEwToebt60P3b1sW4UYID8lRZ+wvZPoR01CW0jNzNuRGKGzY5ZNAMtZVQ==} + engines: {node: '>= 18.0.0'} + hasBin: true + peerDependencies: + typescript: ^4.1 || ^5.0 + peerDependenciesMeta: + typescript: + optional: true + busboy@1.6.0: resolution: {integrity: sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==} engines: {node: '>=10.16.0'} @@ -262,9 +546,29 @@ packages: caniuse-lite@1.0.30001695: resolution: {integrity: sha512-vHyLade6wTgI2u1ec3WQBxv+2BrTERV28UXQu9LO6lZ9pYeMk34vjXFLOxo1A4UBA8XTL4njRQZdno/yYaSmWw==} + chalk@5.4.1: + resolution: {integrity: sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + + clean-css@5.3.3: + resolution: {integrity: sha512-D5J+kHaVb/wKSFcyyV75uCn8fiY4sV38XJoe4CUyGQ+mOU/fMVYUdH1hJC+CJQ5uY3EnW27SbJYS4X8BiLrAFg==} + engines: {node: '>= 10.0'} + + cli-cursor@5.0.0: + resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} + engines: {node: '>=18'} + + cli-spinners@2.9.2: + resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} + engines: {node: '>=6'} + client-only@0.0.1: resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} + cliui@8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} + codice@0.4.4: resolution: {integrity: sha512-fap+veIf259XZyiBmfr44zlh8+iU9Nj43YpxHT+BLpSA3gLckva20YAL5Lq8+AOSE8RFQzT0/bOS3RFEFggQBw==} peerDependencies: @@ -288,10 +592,20 @@ packages: resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} engines: {node: '>= 6'} + commondir@1.0.1: + resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} + cross-spawn@7.0.6: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} + csstype@3.1.3: + resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} + + deepmerge@4.3.1: + resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} + engines: {node: '>=0.10.0'} + detect-libc@2.0.3: resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} engines: {node: '>=8'} @@ -299,6 +613,9 @@ packages: eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} + emoji-regex@10.4.0: + resolution: {integrity: sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==} + emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -311,33 +628,142 @@ packages: es-module-shims@2.0.3: resolution: {integrity: sha512-s2pl2DJQZRXRR5peNZj0hl6d/oUFw7J6gMBiQ8jvjjX4ZR7JrkhFqeLSvlw5ARdnd5I9KBxEvtrtSC/bbqwnmw==} + escalade@3.2.0: + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} + engines: {node: '>=6'} + + estree-walker@2.0.2: + resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} + + fast-glob@3.3.3: + resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} + engines: {node: '>=8.6.0'} + + fastq@1.18.0: + resolution: {integrity: sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw==} + + fdir@6.4.3: + resolution: {integrity: sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + foreground-child@3.3.0: resolution: {integrity: sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==} engines: {node: '>=14'} + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + + get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + + get-east-asian-width@1.3.0: + resolution: {integrity: sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ==} + engines: {node: '>=18'} + + get-tsconfig@4.8.1: + resolution: {integrity: sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==} + + glob-parent@5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + glob@10.4.5: resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==} hasBin: true + hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} + is-arrayish@0.3.2: resolution: {integrity: sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==} + is-core-module@2.16.1: + resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==} + engines: {node: '>= 0.4'} + + is-extglob@2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + is-fullwidth-code-point@3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} + is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + + is-interactive@2.0.0: + resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==} + engines: {node: '>=12'} + + is-module@1.0.0: + resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-reference@1.2.1: + resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==} + + is-unicode-supported@1.3.0: + resolution: {integrity: sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==} + engines: {node: '>=12'} + + is-unicode-supported@2.1.0: + resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} + engines: {node: '>=18'} + isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} jackspeak@3.4.3: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} + js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + log-symbols@6.0.0: + resolution: {integrity: sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==} + engines: {node: '>=18'} + lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} + magic-string@0.30.17: + resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==} + + merge2@1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + + mimic-function@5.0.1: + resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} + engines: {node: '>=18'} + minimatch@9.0.5: resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} engines: {node: '>=16 || 14 >=14.17'} @@ -379,6 +805,14 @@ packages: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} + onetime@7.0.0: + resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} + engines: {node: '>=18'} + + ora@8.1.1: + resolution: {integrity: sha512-YWielGi1XzG1UTvOaCFaNgEnuhZVMSHYkW/FQ7UX8O26PtlpdM84c0f7wLPlkvx2RfiQmnzd61d/MGxmpQeJPw==} + engines: {node: '>=18'} + package-json-from-dist@1.0.1: resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} @@ -386,6 +820,9 @@ packages: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} + path-parse@1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + path-scurry@1.11.1: resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} engines: {node: '>=16 || 14 >=14.18'} @@ -393,6 +830,14 @@ packages: picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + picomatch@2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + + picomatch@4.0.2: + resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} + engines: {node: '>=12'} + pirates@4.0.6: resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} engines: {node: '>= 6'} @@ -401,6 +846,13 @@ packages: resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} engines: {node: ^10 || ^12 || >=14} + pretty-bytes@5.6.0: + resolution: {integrity: sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==} + engines: {node: '>=6'} + + queue-microtask@1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + react-dom@19.0.0: resolution: {integrity: sha512-4GV5sHFG0e/0AD4X+ySy6UJd3jVl1iNsNHdpad0qhABJ11twS3TTBnseqsKurKcsNqCEFeGL3uLpVChpIO3QfQ==} peerDependencies: @@ -410,6 +862,53 @@ packages: resolution: {integrity: sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ==} engines: {node: '>=0.10.0'} + require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + + resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + + resolve@1.22.10: + resolution: {integrity: sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==} + engines: {node: '>= 0.4'} + hasBin: true + + restore-cursor@5.1.0: + resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} + engines: {node: '>=18'} + + reusify@1.0.4: + resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + + rollup-plugin-dts@6.1.1: + resolution: {integrity: sha512-aSHRcJ6KG2IHIioYlvAOcEq6U99sVtqDDKVhnwt70rW6tsz3tv5OSjEiWcgzfsHdLyGXZ/3b/7b/+Za3Y6r1XA==} + engines: {node: '>=16'} + peerDependencies: + rollup: ^3.29.4 || ^4 + typescript: ^4.5 || ^5.0 + + rollup-plugin-swc3@0.11.2: + resolution: {integrity: sha512-o1ih9B806fV2wBSNk46T0cYfTF2eiiKmYXRpWw3K4j/Cp3tCAt10UCVsTqvUhGP58pcB3/GZcAVl5e7TCSKN6Q==} + engines: {node: '>=12'} + peerDependencies: + '@swc/core': '>=1.2.165' + rollup: ^2.0.0 || ^3.0.0 || ^4.0.0 + + rollup-preserve-directives@1.1.3: + resolution: {integrity: sha512-oXqxd6ZzkoQej8Qt0k+S/yvO2+S4CEVEVv2g85oL15o0cjAKTKEuo2MzyA8FcsBBXbtytBzBMFAbhvQg4YyPUQ==} + peerDependencies: + rollup: ^2.0.0 || ^3.0.0 || ^4.0.0 + + rollup@4.31.0: + resolution: {integrity: sha512-9cCE8P4rZLx9+PjoyqHLs31V9a9Vpvfo4qNcs6JCiGWYhw2gijSetFbH6SSy1whnkgcefnUwr8sad7tgqsGvnw==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + + run-parallel@1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + scheduler@0.25.0: resolution: {integrity: sha512-xFVuu11jh+xcO7JOAGJNOXld8/TcEHK/4CituBUeUb5hqxJLj9YuemAEuvm9gQ/+pgXYfbQuqAkiYu+u7YEsNA==} @@ -441,6 +940,14 @@ packages: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} + source-map@0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + engines: {node: '>=0.10.0'} + + stdin-discarder@0.2.2: + resolution: {integrity: sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ==} + engines: {node: '>=18'} + streamsearch@1.1.0: resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} engines: {node: '>=10.0.0'} @@ -453,6 +960,10 @@ packages: resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} engines: {node: '>=12'} + string-width@7.2.0: + resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} + engines: {node: '>=18'} + strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} @@ -482,6 +993,10 @@ packages: sugar-high@0.8.2: resolution: {integrity: sha512-u/U1idCsHBMG9p5z88XYdEh9bxU19o5kueS0a3TKBYSFbTqtRqSyVqdbkFNXv/sDc9WYALCFT56EosyA0k1+3Q==} + supports-preserve-symlinks-flag@1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + thenify-all@1.6.0: resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} engines: {node: '>=0.8'} @@ -489,12 +1004,21 @@ packages: thenify@3.3.1: resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + typescript@5.7.3: + resolution: {integrity: sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==} + engines: {node: '>=14.17'} + hasBin: true + which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -508,13 +1032,37 @@ packages: resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} engines: {node: '>=12'} + y18n@5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + + yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + + yargs@17.7.2: + resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} + engines: {node: '>=12'} + snapshots: + '@babel/code-frame@7.26.2': + dependencies: + '@babel/helper-validator-identifier': 7.25.9 + js-tokens: 4.0.0 + picocolors: 1.1.1 + optional: true + + '@babel/helper-validator-identifier@7.25.9': + optional: true + '@emnapi/runtime@1.3.1': dependencies: tslib: 2.8.1 optional: true + '@fastify/deepmerge@1.3.0': {} + '@img/sharp-darwin-arm64@0.33.5': optionalDependencies: '@img/sharp-libvips-darwin-arm64': 1.0.4 @@ -642,15 +1190,196 @@ snapshots: '@next/swc-win32-x64-msvc@15.1.5': optional: true + '@nodelib/fs.scandir@2.1.5': + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + + '@nodelib/fs.stat@2.0.5': {} + + '@nodelib/fs.walk@1.2.8': + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.18.0 + '@pkgjs/parseargs@0.11.0': optional: true + '@rollup/plugin-commonjs@28.0.2(rollup@4.31.0)': + dependencies: + '@rollup/pluginutils': 5.1.4(rollup@4.31.0) + commondir: 1.0.1 + estree-walker: 2.0.2 + fdir: 6.4.3(picomatch@4.0.2) + is-reference: 1.2.1 + magic-string: 0.30.17 + picomatch: 4.0.2 + optionalDependencies: + rollup: 4.31.0 + + '@rollup/plugin-json@6.1.0(rollup@4.31.0)': + dependencies: + '@rollup/pluginutils': 5.1.4(rollup@4.31.0) + optionalDependencies: + rollup: 4.31.0 + + '@rollup/plugin-node-resolve@16.0.0(rollup@4.31.0)': + dependencies: + '@rollup/pluginutils': 5.1.4(rollup@4.31.0) + '@types/resolve': 1.20.2 + deepmerge: 4.3.1 + is-module: 1.0.0 + resolve: 1.22.10 + optionalDependencies: + rollup: 4.31.0 + + '@rollup/plugin-replace@6.0.2(rollup@4.31.0)': + dependencies: + '@rollup/pluginutils': 5.1.4(rollup@4.31.0) + magic-string: 0.30.17 + optionalDependencies: + rollup: 4.31.0 + + '@rollup/plugin-wasm@6.2.2(rollup@4.31.0)': + dependencies: + '@rollup/pluginutils': 5.1.4(rollup@4.31.0) + optionalDependencies: + rollup: 4.31.0 + + '@rollup/pluginutils@5.1.4(rollup@4.31.0)': + dependencies: + '@types/estree': 1.0.6 + estree-walker: 2.0.2 + picomatch: 4.0.2 + optionalDependencies: + rollup: 4.31.0 + + '@rollup/rollup-android-arm-eabi@4.31.0': + optional: true + + '@rollup/rollup-android-arm64@4.31.0': + optional: true + + '@rollup/rollup-darwin-arm64@4.31.0': + optional: true + + '@rollup/rollup-darwin-x64@4.31.0': + optional: true + + '@rollup/rollup-freebsd-arm64@4.31.0': + optional: true + + '@rollup/rollup-freebsd-x64@4.31.0': + optional: true + + '@rollup/rollup-linux-arm-gnueabihf@4.31.0': + optional: true + + '@rollup/rollup-linux-arm-musleabihf@4.31.0': + optional: true + + '@rollup/rollup-linux-arm64-gnu@4.31.0': + optional: true + + '@rollup/rollup-linux-arm64-musl@4.31.0': + optional: true + + '@rollup/rollup-linux-loongarch64-gnu@4.31.0': + optional: true + + '@rollup/rollup-linux-powerpc64le-gnu@4.31.0': + optional: true + + '@rollup/rollup-linux-riscv64-gnu@4.31.0': + optional: true + + '@rollup/rollup-linux-s390x-gnu@4.31.0': + optional: true + + '@rollup/rollup-linux-x64-gnu@4.31.0': + optional: true + + '@rollup/rollup-linux-x64-musl@4.31.0': + optional: true + + '@rollup/rollup-win32-arm64-msvc@4.31.0': + optional: true + + '@rollup/rollup-win32-ia32-msvc@4.31.0': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.31.0': + optional: true + + '@swc/core-darwin-arm64@1.10.8': + optional: true + + '@swc/core-darwin-x64@1.10.8': + optional: true + + '@swc/core-linux-arm-gnueabihf@1.10.8': + optional: true + + '@swc/core-linux-arm64-gnu@1.10.8': + optional: true + + '@swc/core-linux-arm64-musl@1.10.8': + optional: true + + '@swc/core-linux-x64-gnu@1.10.8': + optional: true + + '@swc/core-linux-x64-musl@1.10.8': + optional: true + + '@swc/core-win32-arm64-msvc@1.10.8': + optional: true + + '@swc/core-win32-ia32-msvc@1.10.8': + optional: true + + '@swc/core-win32-x64-msvc@1.10.8': + optional: true + + '@swc/core@1.10.8(@swc/helpers@0.5.15)': + dependencies: + '@swc/counter': 0.1.3 + '@swc/types': 0.1.17 + optionalDependencies: + '@swc/core-darwin-arm64': 1.10.8 + '@swc/core-darwin-x64': 1.10.8 + '@swc/core-linux-arm-gnueabihf': 1.10.8 + '@swc/core-linux-arm64-gnu': 1.10.8 + '@swc/core-linux-arm64-musl': 1.10.8 + '@swc/core-linux-x64-gnu': 1.10.8 + '@swc/core-linux-x64-musl': 1.10.8 + '@swc/core-win32-arm64-msvc': 1.10.8 + '@swc/core-win32-ia32-msvc': 1.10.8 + '@swc/core-win32-x64-msvc': 1.10.8 + '@swc/helpers': 0.5.15 + '@swc/counter@0.1.3': {} '@swc/helpers@0.5.15': dependencies: tslib: 2.8.1 + '@swc/types@0.1.17': + dependencies: + '@swc/counter': 0.1.3 + + '@types/estree@1.0.6': {} + + '@types/react-dom@19.0.3(@types/react@19.0.7)': + dependencies: + '@types/react': 19.0.7 + + '@types/react@19.0.7': + dependencies: + csstype: 3.1.3 + + '@types/resolve@1.20.2': {} + ansi-regex@5.0.1: {} ansi-regex@6.1.0: {} @@ -669,14 +1398,61 @@ snapshots: dependencies: balanced-match: 1.0.2 + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + bunchee@6.3.2(typescript@5.7.3): + dependencies: + '@rollup/plugin-commonjs': 28.0.2(rollup@4.31.0) + '@rollup/plugin-json': 6.1.0(rollup@4.31.0) + '@rollup/plugin-node-resolve': 16.0.0(rollup@4.31.0) + '@rollup/plugin-replace': 6.0.2(rollup@4.31.0) + '@rollup/plugin-wasm': 6.2.2(rollup@4.31.0) + '@rollup/pluginutils': 5.1.4(rollup@4.31.0) + '@swc/core': 1.10.8(@swc/helpers@0.5.15) + '@swc/helpers': 0.5.15 + clean-css: 5.3.3 + fast-glob: 3.3.3 + magic-string: 0.30.17 + ora: 8.1.1 + picomatch: 4.0.2 + pretty-bytes: 5.6.0 + rollup: 4.31.0 + rollup-plugin-dts: 6.1.1(rollup@4.31.0)(typescript@5.7.3) + rollup-plugin-swc3: 0.11.2(@swc/core@1.10.8(@swc/helpers@0.5.15))(rollup@4.31.0) + rollup-preserve-directives: 1.1.3(rollup@4.31.0) + tslib: 2.8.1 + yargs: 17.7.2 + optionalDependencies: + typescript: 5.7.3 + busboy@1.6.0: dependencies: streamsearch: 1.1.0 caniuse-lite@1.0.30001695: {} + chalk@5.4.1: {} + + clean-css@5.3.3: + dependencies: + source-map: 0.6.1 + + cli-cursor@5.0.0: + dependencies: + restore-cursor: 5.1.0 + + cli-spinners@2.9.2: {} + client-only@0.0.1: {} + cliui@8.0.1: + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + codice@0.4.4(react@19.0.0): dependencies: react: 19.0.0 @@ -701,17 +1477,25 @@ snapshots: commander@4.1.1: {} + commondir@1.0.1: {} + cross-spawn@7.0.6: dependencies: path-key: 3.1.1 shebang-command: 2.0.0 which: 2.0.2 + csstype@3.1.3: {} + + deepmerge@4.3.1: {} + detect-libc@2.0.3: optional: true eastasianwidth@0.2.0: {} + emoji-regex@10.4.0: {} + emoji-regex@8.0.0: {} emoji-regex@9.2.2: {} @@ -720,11 +1504,52 @@ snapshots: es-module-shims@2.0.3: {} + escalade@3.2.0: {} + + estree-walker@2.0.2: {} + + fast-glob@3.3.3: + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.8 + + fastq@1.18.0: + dependencies: + reusify: 1.0.4 + + fdir@6.4.3(picomatch@4.0.2): + optionalDependencies: + picomatch: 4.0.2 + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + foreground-child@3.3.0: dependencies: cross-spawn: 7.0.6 signal-exit: 4.1.0 + fsevents@2.3.3: + optional: true + + function-bind@1.1.2: {} + + get-caller-file@2.0.5: {} + + get-east-asian-width@1.3.0: {} + + get-tsconfig@4.8.1: + dependencies: + resolve-pkg-maps: 1.0.0 + + glob-parent@5.1.2: + dependencies: + is-glob: 4.0.3 + glob@10.4.5: dependencies: foreground-child: 3.3.0 @@ -734,11 +1559,39 @@ snapshots: package-json-from-dist: 1.0.1 path-scurry: 1.11.1 + hasown@2.0.2: + dependencies: + function-bind: 1.1.2 + is-arrayish@0.3.2: optional: true + is-core-module@2.16.1: + dependencies: + hasown: 2.0.2 + + is-extglob@2.1.1: {} + is-fullwidth-code-point@3.0.0: {} + is-glob@4.0.3: + dependencies: + is-extglob: 2.1.1 + + is-interactive@2.0.0: {} + + is-module@1.0.0: {} + + is-number@7.0.0: {} + + is-reference@1.2.1: + dependencies: + '@types/estree': 1.0.6 + + is-unicode-supported@1.3.0: {} + + is-unicode-supported@2.1.0: {} + isexe@2.0.0: {} jackspeak@3.4.3: @@ -747,10 +1600,31 @@ snapshots: optionalDependencies: '@pkgjs/parseargs': 0.11.0 + js-tokens@4.0.0: + optional: true + lines-and-columns@1.2.4: {} + log-symbols@6.0.0: + dependencies: + chalk: 5.4.1 + is-unicode-supported: 1.3.0 + lru-cache@10.4.3: {} + magic-string@0.30.17: + dependencies: + '@jridgewell/sourcemap-codec': 1.5.0 + + merge2@1.4.1: {} + + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.1 + + mimic-function@5.0.1: {} + minimatch@9.0.5: dependencies: brace-expansion: 2.0.1 @@ -792,10 +1666,28 @@ snapshots: object-assign@4.1.1: {} + onetime@7.0.0: + dependencies: + mimic-function: 5.0.1 + + ora@8.1.1: + dependencies: + chalk: 5.4.1 + cli-cursor: 5.0.0 + cli-spinners: 2.9.2 + is-interactive: 2.0.0 + is-unicode-supported: 2.1.0 + log-symbols: 6.0.0 + stdin-discarder: 0.2.2 + string-width: 7.2.0 + strip-ansi: 7.1.0 + package-json-from-dist@1.0.1: {} path-key@3.1.1: {} + path-parse@1.0.7: {} + path-scurry@1.11.1: dependencies: lru-cache: 10.4.3 @@ -803,6 +1695,10 @@ snapshots: picocolors@1.1.1: {} + picomatch@2.3.1: {} + + picomatch@4.0.2: {} + pirates@4.0.6: {} postcss@8.4.31: @@ -811,6 +1707,10 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 + pretty-bytes@5.6.0: {} + + queue-microtask@1.2.3: {} + react-dom@19.0.0(react@19.0.0): dependencies: react: 19.0.0 @@ -818,6 +1718,74 @@ snapshots: react@19.0.0: {} + require-directory@2.1.1: {} + + resolve-pkg-maps@1.0.0: {} + + resolve@1.22.10: + dependencies: + is-core-module: 2.16.1 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + + restore-cursor@5.1.0: + dependencies: + onetime: 7.0.0 + signal-exit: 4.1.0 + + reusify@1.0.4: {} + + rollup-plugin-dts@6.1.1(rollup@4.31.0)(typescript@5.7.3): + dependencies: + magic-string: 0.30.17 + rollup: 4.31.0 + typescript: 5.7.3 + optionalDependencies: + '@babel/code-frame': 7.26.2 + + rollup-plugin-swc3@0.11.2(@swc/core@1.10.8(@swc/helpers@0.5.15))(rollup@4.31.0): + dependencies: + '@fastify/deepmerge': 1.3.0 + '@rollup/pluginutils': 5.1.4(rollup@4.31.0) + '@swc/core': 1.10.8(@swc/helpers@0.5.15) + get-tsconfig: 4.8.1 + rollup: 4.31.0 + rollup-preserve-directives: 1.1.3(rollup@4.31.0) + + rollup-preserve-directives@1.1.3(rollup@4.31.0): + dependencies: + magic-string: 0.30.17 + rollup: 4.31.0 + + rollup@4.31.0: + dependencies: + '@types/estree': 1.0.6 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.31.0 + '@rollup/rollup-android-arm64': 4.31.0 + '@rollup/rollup-darwin-arm64': 4.31.0 + '@rollup/rollup-darwin-x64': 4.31.0 + '@rollup/rollup-freebsd-arm64': 4.31.0 + '@rollup/rollup-freebsd-x64': 4.31.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.31.0 + '@rollup/rollup-linux-arm-musleabihf': 4.31.0 + '@rollup/rollup-linux-arm64-gnu': 4.31.0 + '@rollup/rollup-linux-arm64-musl': 4.31.0 + '@rollup/rollup-linux-loongarch64-gnu': 4.31.0 + '@rollup/rollup-linux-powerpc64le-gnu': 4.31.0 + '@rollup/rollup-linux-riscv64-gnu': 4.31.0 + '@rollup/rollup-linux-s390x-gnu': 4.31.0 + '@rollup/rollup-linux-x64-gnu': 4.31.0 + '@rollup/rollup-linux-x64-musl': 4.31.0 + '@rollup/rollup-win32-arm64-msvc': 4.31.0 + '@rollup/rollup-win32-ia32-msvc': 4.31.0 + '@rollup/rollup-win32-x64-msvc': 4.31.0 + fsevents: 2.3.3 + + run-parallel@1.2.0: + dependencies: + queue-microtask: 1.2.3 + scheduler@0.25.0: {} semver@7.6.3: @@ -865,6 +1833,10 @@ snapshots: source-map-js@1.2.1: {} + source-map@0.6.1: {} + + stdin-discarder@0.2.2: {} + streamsearch@1.1.0: {} string-width@4.2.3: @@ -879,6 +1851,12 @@ snapshots: emoji-regex: 9.2.2 strip-ansi: 7.1.0 + string-width@7.2.0: + dependencies: + emoji-regex: 10.4.0 + get-east-asian-width: 1.3.0 + strip-ansi: 7.1.0 + strip-ansi@6.0.1: dependencies: ansi-regex: 5.0.1 @@ -904,6 +1882,8 @@ snapshots: sugar-high@0.8.2: {} + supports-preserve-symlinks-flag@1.0.0: {} + thenify-all@1.6.0: dependencies: thenify: 3.3.1 @@ -912,10 +1892,16 @@ snapshots: dependencies: any-promise: 1.3.0 + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + ts-interface-checker@0.1.13: {} tslib@2.8.1: {} + typescript@5.7.3: {} + which@2.0.2: dependencies: isexe: 2.0.0 @@ -931,3 +1917,17 @@ snapshots: ansi-styles: 6.2.1 string-width: 5.1.2 strip-ansi: 7.1.0 + + y18n@5.0.8: {} + + yargs-parser@21.1.1: {} + + yargs@17.7.2: + dependencies: + cliui: 8.0.1 + escalade: 3.2.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 21.1.1 diff --git a/lib/core.js b/src/core.ts similarity index 90% rename from lib/core.js rename to src/core.ts index fac9b3f..5e00b29 100644 --- a/lib/core.js +++ b/src/core.ts @@ -1,5 +1,5 @@ import { useEffect, useCallback, useState, useId, useRef } from 'react' -import { createModule } from './module.js' +import { createModule } from './module' import { transform } from 'sucrase' import { init, parse } from 'es-module-lexer' @@ -80,15 +80,15 @@ function replaceImports(source, getModuleUrl, externals) { function createRenderer(createModule_, getModuleUrl) { let reactRoot - async function render(files) { + async function render(files: Record) { const mod = await createModule_(files, { getModuleUrl }) - const ReactMod = await self.importShim('react') - const ReactDOMMod = await self.importShim('react-dom/client') + const ReactMod: typeof import('react') = await self.importShim('react') + const ReactDOMMod: typeof import('react-dom/client') = await self.importShim('react-dom/client') const _jsx = ReactMod.createElement const root = document.getElementById('__reactRoot') - class ErrorBoundary extends ReactMod.Component { - constructor(props) { + class ErrorBoundary extends ReactMod.Component { + constructor(props: any) { super(props) this.state = { error: null } } @@ -97,7 +97,7 @@ function createRenderer(createModule_, getModuleUrl) { } render() { if (this.state.error) { - return _jsx('div', null, this.state.error.message) + return _jsx('div', null, (this.state.error as any)?.message) } return this.props.children } @@ -140,7 +140,14 @@ function useScript() { return useRef(typeof window !== 'undefined' ? document.createElement('script') : null) } -function createScript(scriptRef, { content, src, type } = {}) { +function createScript( + scriptRef: React.RefObject, + { content, src, type }: { + content?: string + src?: string + type?: string + } = {} +) { const script = scriptRef.current if (type) script.type = type @@ -153,8 +160,8 @@ function createScript(scriptRef, { content, src, type } = {}) { return script } -function useLiveCode({ getModuleUrl }) { - const iframeRef = useRef() +function useLiveCode({ getModuleUrl }: { getModuleUrl?: (name: string) => string }) { + const iframeRef = useRef(null) const [error, setError] = useState() const rerender = useState({})[1] const appScriptRef = useScript() @@ -255,7 +262,7 @@ function useLiveCode({ getModuleUrl }) { } } } - setError() + setError(undefined) } catch (e) { console.error(e) setError(e) diff --git a/lib/index.d.ts b/src/index.d.ts.txt similarity index 100% rename from lib/index.d.ts rename to src/index.d.ts.txt diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..4af5c7c --- /dev/null +++ b/src/index.ts @@ -0,0 +1,2 @@ +export { DevJar } from './render' +export { useLiveCode } from './core' diff --git a/lib/module.js b/src/module.ts similarity index 85% rename from lib/module.js rename to src/module.ts index 827786e..23db476 100644 --- a/lib/module.js +++ b/src/module.ts @@ -1,3 +1,17 @@ +// declare esmsInitOptions on global window + +declare global { + interface Window { + esmsInitOptions: { + shimMode: boolean + mapOverrides: boolean + } + } + + // importShim + function importShim(url: string): Promise +} + async function createModule(files, { getModuleUrl }) { let currentImportMap let shim diff --git a/lib/render.js b/src/render.ts similarity index 79% rename from lib/render.js rename to src/render.ts index c2ef886..d4ea72c 100644 --- a/lib/render.js +++ b/src/render.ts @@ -1,9 +1,13 @@ import React, { useEffect, useRef } from 'react' -import { useLiveCode } from './core.js' +import { useLiveCode } from './core' const defaultOnError = typeof window !== 'undefined' ? console.error : (() => {}) -export function DevJar({ files, getModuleUrl, onError = defaultOnError, ...props }) { +export function DevJar({ files, getModuleUrl, onError = defaultOnError, ...props }: { + files: any + getModuleUrl?: (name: string) => string + onError?: (...data: any[]) => void +}) { const onErrorRef = useRef(onError) const { ref, error, load } = useLiveCode({ getModuleUrl }) diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..f68e934 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "ESNext", + "moduleResolution": "Node", + "allowSyntheticDefaultImports": true + } +} \ No newline at end of file From a8d11924236b67726d18355d3afbc7b9ac4b2438 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Sun, 19 Jan 2025 17:36:53 +0100 Subject: [PATCH 2/7] rm pkg and update files --- package.json | 2 +- src/index.d.ts.txt | 13 ------------- 2 files changed, 1 insertion(+), 14 deletions(-) delete mode 100644 src/index.d.ts.txt diff --git a/package.json b/package.json index 9c127f2..081f101 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ }, "license": "MIT", "files": [ - "lib" + "dist" ], "types": "./dist/index.d.ts", "scripts": { diff --git a/src/index.d.ts.txt b/src/index.d.ts.txt deleted file mode 100644 index 27460f7..0000000 --- a/src/index.d.ts.txt +++ /dev/null @@ -1,13 +0,0 @@ -import React from 'react' - -type LiveCodeHandles = { - load(files: Record): void - ref: React.Ref - error?: unknown -} - -type Options = { - getModuleUrl(modulePath: string): string -} - -export function useLiveCode(options: Options): LiveCodeHandles From 6e9302cbe7daa68790656978ed155d99fd451cc4 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Sun, 19 Jan 2025 17:39:13 +0100 Subject: [PATCH 3/7] rm dist from git --- .gitignore | 1 + dist/index.d.ts | 28 ----- dist/index.js | 314 ------------------------------------------------ src/render.ts | 2 +- 4 files changed, 2 insertions(+), 343 deletions(-) delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js diff --git a/.gitignore b/.gitignore index f74c781..50ad4e5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .next node_modules +dist diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 0526c69..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import * as React from 'react'; -import React__default from 'react'; - -declare function DevJar({ files, getModuleUrl, onError, ...props }: { - files: any; - getModuleUrl?: (name: string) => string; - onError?: (...data: any[]) => void; -}): React__default.DetailedReactHTMLElement, any>; - -declare global { - interface Window { - esmsInitOptions: { - shimMode: boolean; - mapOverrides: boolean; - }; - } - function importShim(url: string): Promise; -} - -declare function useLiveCode({ getModuleUrl }: { - getModuleUrl?: (name: string) => string; -}): { - ref: React.RefObject; - error: undefined; - load: (files: any) => Promise; -}; - -export { DevJar, useLiveCode }; diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index 15be6ec..0000000 --- a/dist/index.js +++ /dev/null @@ -1,314 +0,0 @@ -import React, { useRef, useState, useId, useEffect, useCallback } from 'react'; -import { transform } from 'sucrase'; -import { init, parse } from 'es-module-lexer'; - -// declare esmsInitOptions on global window -async function createModule(files, { getModuleUrl }) { - let currentImportMap; - let shim; - async function setupImportMap() { - if (shim) return shim; - window.esmsInitOptions = { - shimMode: true, - mapOverrides: true - }; - shim = import(/* webpackIgnore: true */ getModuleUrl('es-module-shims')); - await shim; - } - function updateImportMap(imports) { - imports['react'] = getModuleUrl('react'); - imports['react-dom'] = getModuleUrl('react-dom'); - imports['react-dom/client'] = getModuleUrl('react-dom/client'); - const script = document.createElement('script'); - script.type = 'importmap-shim'; - script.innerHTML = JSON.stringify({ - imports - }); - document.body.appendChild(script); - if (currentImportMap) { - currentImportMap.parentNode.removeChild(currentImportMap); - } - currentImportMap = script; - } - function createInlinedModule(code, type) { - if (type === 'css') return `data:text/css;utf-8,${encodeURIComponent(code)}`; - return `data:text/javascript;utf-8,${encodeURIComponent(code)}`; - } - await setupImportMap(); - const imports = Object.fromEntries(Object.entries(files).map(([fileName, code])=>[ - fileName, - createInlinedModule(code, fileName.endsWith('.css') ? 'css' : 'js') - ])); - updateImportMap(imports); - return self.importShim('index.js'); -} - -let esModuleLexerInit; -const isRelative = (s)=>s.startsWith('./'); -function transformCode(_code, getModuleUrl, externals) { - const code = transform(_code, { - transforms: [ - 'jsx', - 'typescript' - ] - }).code; - return replaceImports(code, getModuleUrl, externals); -} -function replaceImports(source, getModuleUrl, externals) { - let code = ''; - let lastIndex = 0; - let hasReactImports = false; - const [imports] = parse(source); - const cssImports = []; - let cssImportIndex = 0; - // start, end, statementStart, statementEnd, assertion, name - imports.forEach(({ s, e, ss, se, a, n })=>{ - code += source.slice(lastIndex, ss) // content from last import to beginning of this line - ; - // handle imports - if (n.endsWith('.css')) { - // Map './styles.css' -> '@styles.css', and collect it - const cssPath = `${'@' + n.slice(2)}`; - cssImports.push(cssPath); - } else { - code += source.substring(ss, s); - code += isRelative(n) ? '@' + n.slice(2) : externals.has(n) ? n : getModuleUrl(n); - code += source.substring(e, se); - } - lastIndex = se; - if (n === 'react') { - const statement = source.slice(ss, se); - if (statement.includes('React')) { - hasReactImports = true; - } - } - cssImports.forEach((cssPath)=>{ - code += `\nimport sheet${cssImportIndex} from "${cssPath}" assert { type: "css" };\n`; - cssImportIndex++; - }); - }); - if (cssImports.length) { - code += `const __customStyleSheets = [`; - for(let i = 0; i < cssImports.length; i++){ - code += `sheet${i}`; - if (i < cssImports.length - 1) { - code += `, `; - } - } - code += `];\n`; - code += `document.adoptedStyleSheets = [...document.adoptedStyleSheets, ...__customStyleSheets];\n`; - } - code += source.substring(lastIndex); - if (!hasReactImports) { - code = `import React from 'react';\n${code}`; - } - return code; -} -function createRenderer(createModule_, getModuleUrl) { - let reactRoot; - async function render(files) { - const mod = await createModule_(files, { - getModuleUrl - }); - const ReactMod = await self.importShim('react'); - const ReactDOMMod = await self.importShim('react-dom/client'); - const _jsx = ReactMod.createElement; - const root = document.getElementById('__reactRoot'); - class ErrorBoundary extends ReactMod.Component { - componentDidCatch(error) { - this.setState({ - error - }); - } - render() { - if (this.state.error) { - return _jsx('div', null, this.state.error?.message); - } - return this.props.children; - } - constructor(props){ - super(props); - this.state = { - error: null - }; - } - } - if (!reactRoot) { - reactRoot = ReactDOMMod.createRoot(root); - } - const Component = mod.default; - const element = _jsx(ErrorBoundary, null, _jsx(Component)); - reactRoot.render(element); - } - return render; -} -function createMainScript({ uid }) { - const code = `\ -'use strict'; -const _createModule = ${createModule.toString()}; -const _createRenderer = ${createRenderer.toString()}; - -const getModuleUrl = (m) => window.parent.__devjar__[globalThis.uid].getModuleUrl(m) - -globalThis.uid = ${JSON.stringify(uid)}; -globalThis.__render__ = _createRenderer(_createModule, getModuleUrl); -`; - return code; -} -function createEsShimOptionsScript() { - return `\ -window.esmsInitOptions = { - polyfillEnable: ['css-modules', 'json-modules'], - onerror: error => console.log(error), -}`; -} -function useScript() { - return useRef(typeof window !== 'undefined' ? document.createElement('script') : null); -} -function createScript(scriptRef, { content, src, type } = {}) { - const script = scriptRef.current; - if (type) script.type = type; - if (content) { - script.src = `data:text/javascript;utf-8,${encodeURIComponent(content)}`; - } - if (src) { - script.src = src; - } - return script; -} -function useLiveCode({ getModuleUrl }) { - const iframeRef = useRef(null); - const [error, setError] = useState(); - const rerender = useState({})[1]; - const appScriptRef = useScript(); - const esShimOptionsScriptRef = useScript(); - const tailwindcssScriptRef = useScript(); - const uid = useId(); - // Let getModuleUrl executed on parent window side since it might involve - // variables that iframe cannot access. - useEffect(()=>{ - if (!globalThis.__devjar__) { - globalThis.__devjar__ = {}; - } - globalThis.__devjar__[uid] = { - getModuleUrl - }; - return ()=>{ - if (globalThis.__devjar__) { - delete globalThis.__devjar__[uid]; - } - }; - }, []); - useEffect(()=>{ - const iframe = iframeRef.current; - if (!iframe || !iframe.contentDocument) return; - const doc = iframe.contentDocument; - const body = doc.body; - const div = document.createElement('div'); - div.id = '__reactRoot'; - const appScriptContent = createMainScript({ - uid - }); - const scriptOptionsContent = createEsShimOptionsScript(); - const esmShimOptionsScript = createScript(esShimOptionsScriptRef, { - content: scriptOptionsContent - }); - const appScript = createScript(appScriptRef, { - content: appScriptContent, - type: 'module' - }); - const tailwindScript = createScript(tailwindcssScriptRef, { - src: 'https://cdn.tailwindcss.com' - }); - body.appendChild(div); - body.appendChild(esmShimOptionsScript); - body.appendChild(appScript); - body.appendChild(tailwindScript); - return ()=>{ - if (!iframe || !iframe.contentDocument) return; - body.removeChild(div); - body.removeChild(esmShimOptionsScript); - body.removeChild(appScript); - body.removeChild(tailwindScript); - }; - }, []); - const load = useCallback(async (files)=>{ - if (!esModuleLexerInit) { - await init; - esModuleLexerInit = true; - } - if (files) { - // { 'react', 'react-dom' } - const overrideExternals = new Set(Object.keys(files).filter((name)=>!isRelative(name) && name !== 'index.js')); - // Always share react as externals - overrideExternals.add('react'); - overrideExternals.add('react-dom'); - try { - /** - * transformedFiles - * { - * 'index.js': '...', - * '@mod1': '...', - * '@mod2': '...', - */ const transformedFiles = Object.keys(files).reduce((res, filename)=>{ - const key = isRelative(filename) ? '@' + filename.slice(2) : filename; - if (filename.endsWith('.css')) { - res[key] = files[filename]; - } else { - res[key] = transformCode(files[filename], getModuleUrl, overrideExternals); - } - return res; - }, {}); - const iframe = iframeRef.current; - const script = appScriptRef.current; - if (iframe) { - const render = iframe.contentWindow.__render__; - if (render) { - render(transformedFiles); - } else { - // if render is not loaded yet, wait until it's loaded - script.onload = ()=>{ - iframe.contentWindow.__render__(transformedFiles); - }; - } - } - setError(undefined); - } catch (e) { - console.error(e); - setError(e); - } - } - rerender({}); - }, []); - return { - ref: iframeRef, - error, - load - }; -} - -const defaultOnError = typeof window !== 'undefined' ? console.error : ()=>{}; -function DevJar({ files, getModuleUrl, onError = defaultOnError, ...props }) { - const onErrorRef = useRef(onError); - const { ref, error, load } = useLiveCode({ - getModuleUrl - }); - useEffect(()=>{ - onErrorRef.current(error); - }, [ - error - ]); - // load code files and execute them as live code - useEffect(()=>{ - load(files); - }, [ - files - ]); - // Attach the ref to an iframe element for runtime of code execution - return React.createElement('iframe', { - ...props, - ref - }); -} - -export { DevJar, useLiveCode }; diff --git a/src/render.ts b/src/render.ts index d4ea72c..2ec6724 100644 --- a/src/render.ts +++ b/src/render.ts @@ -4,7 +4,7 @@ import { useLiveCode } from './core' const defaultOnError = typeof window !== 'undefined' ? console.error : (() => {}) export function DevJar({ files, getModuleUrl, onError = defaultOnError, ...props }: { - files: any + files: Record getModuleUrl?: (name: string) => string onError?: (...data: any[]) => void }) { From 3803ec8e4e056546f33b1ab6dd10993616854789 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Sun, 19 Jan 2025 17:43:01 +0100 Subject: [PATCH 4/7] update types --- src/index.ts | 2 +- src/{render.ts => render.tsx} | 4 ++-- tsconfig.json | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) rename src/{render.ts => render.tsx} (86%) diff --git a/src/index.ts b/src/index.ts index 4af5c7c..bce4170 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,2 +1,2 @@ -export { DevJar } from './render' export { useLiveCode } from './core' +export { DevJar } from './render' diff --git a/src/render.ts b/src/render.tsx similarity index 86% rename from src/render.ts rename to src/render.tsx index 2ec6724..af4d687 100644 --- a/src/render.ts +++ b/src/render.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useRef } from 'react' +import { useEffect, useRef } from 'react' import { useLiveCode } from './core' const defaultOnError = typeof window !== 'undefined' ? console.error : (() => {}) @@ -21,5 +21,5 @@ export function DevJar({ files, getModuleUrl, onError = defaultOnError, ...props }, [files]) // Attach the ref to an iframe element for runtime of code execution - return React.createElement('iframe', { ...props, ref }) + return