create-nuclo 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -0
- package/package.json +35 -0
- package/src/create-nuclo.mjs +193 -0
- package/templates/basic/README.md +16 -0
- package/templates/basic/_gitignore +5 -0
- package/templates/basic/index.html +26 -0
- package/templates/basic/node_modules/.package-lock.json +348 -0
- package/templates/basic/node_modules/.vite/deps/_metadata.json +15 -0
- package/templates/basic/node_modules/.vite/deps/nuclo.js +1665 -0
- package/templates/basic/node_modules/.vite/deps/nuclo.js.map +1 -0
- package/templates/basic/node_modules/.vite/deps/package.json +3 -0
- package/templates/basic/node_modules/@oxc-project/types/LICENSE +22 -0
- package/templates/basic/node_modules/@oxc-project/types/README.md +3 -0
- package/templates/basic/node_modules/@oxc-project/types/package.json +26 -0
- package/templates/basic/node_modules/@oxc-project/types/types.d.ts +1912 -0
- package/templates/basic/node_modules/@rolldown/binding-darwin-arm64/README.md +3 -0
- package/templates/basic/node_modules/@rolldown/binding-darwin-arm64/package.json +37 -0
- package/templates/basic/node_modules/@rolldown/binding-darwin-arm64/rolldown-binding.darwin-arm64.node +0 -0
- package/templates/basic/node_modules/@rolldown/pluginutils/LICENSE +21 -0
- package/templates/basic/node_modules/@rolldown/pluginutils/README.md +145 -0
- package/templates/basic/node_modules/@rolldown/pluginutils/dist/filter/index.d.mts +194 -0
- package/templates/basic/node_modules/@rolldown/pluginutils/dist/filter/index.mjs +2 -0
- package/templates/basic/node_modules/@rolldown/pluginutils/dist/filter-B_mD-HGz.mjs +323 -0
- package/templates/basic/node_modules/@rolldown/pluginutils/dist/index.d.mts +2 -0
- package/templates/basic/node_modules/@rolldown/pluginutils/dist/index.mjs +2 -0
- package/templates/basic/node_modules/@rolldown/pluginutils/package.json +40 -0
- package/templates/basic/node_modules/detect-libc/LICENSE +201 -0
- package/templates/basic/node_modules/detect-libc/README.md +163 -0
- package/templates/basic/node_modules/detect-libc/index.d.ts +14 -0
- package/templates/basic/node_modules/detect-libc/lib/detect-libc.js +313 -0
- package/templates/basic/node_modules/detect-libc/lib/elf.js +39 -0
- package/templates/basic/node_modules/detect-libc/lib/filesystem.js +51 -0
- package/templates/basic/node_modules/detect-libc/lib/process.js +24 -0
- package/templates/basic/node_modules/detect-libc/package.json +44 -0
- package/templates/basic/node_modules/fdir/LICENSE +7 -0
- package/templates/basic/node_modules/fdir/README.md +91 -0
- package/templates/basic/node_modules/fdir/dist/index.cjs +588 -0
- package/templates/basic/node_modules/fdir/dist/index.d.cts +155 -0
- package/templates/basic/node_modules/fdir/dist/index.d.mts +155 -0
- package/templates/basic/node_modules/fdir/dist/index.mjs +570 -0
- package/templates/basic/node_modules/fdir/package.json +103 -0
- package/templates/basic/node_modules/lightningcss/LICENSE +373 -0
- package/templates/basic/node_modules/lightningcss/README.md +105 -0
- package/templates/basic/node_modules/lightningcss/node/ast.d.ts +9892 -0
- package/templates/basic/node_modules/lightningcss/node/ast.js.flow +10539 -0
- package/templates/basic/node_modules/lightningcss/node/browserslistToTargets.js +48 -0
- package/templates/basic/node_modules/lightningcss/node/composeVisitors.js +450 -0
- package/templates/basic/node_modules/lightningcss/node/flags.js +28 -0
- package/templates/basic/node_modules/lightningcss/node/index.d.ts +494 -0
- package/templates/basic/node_modules/lightningcss/node/index.js +59 -0
- package/templates/basic/node_modules/lightningcss/node/index.js.flow +843 -0
- package/templates/basic/node_modules/lightningcss/node/index.mjs +4 -0
- package/templates/basic/node_modules/lightningcss/node/targets.d.ts +40 -0
- package/templates/basic/node_modules/lightningcss/node/targets.js.flow +39 -0
- package/templates/basic/node_modules/lightningcss/package.json +110 -0
- package/templates/basic/node_modules/lightningcss-darwin-arm64/LICENSE +373 -0
- package/templates/basic/node_modules/lightningcss-darwin-arm64/README.md +1 -0
- package/templates/basic/node_modules/lightningcss-darwin-arm64/lightningcss.darwin-arm64.node +0 -0
- package/templates/basic/node_modules/lightningcss-darwin-arm64/package.json +34 -0
- package/templates/basic/node_modules/nanoid/LICENSE +20 -0
- package/templates/basic/node_modules/nanoid/README.md +36 -0
- package/templates/basic/node_modules/nanoid/async/index.browser.cjs +42 -0
- package/templates/basic/node_modules/nanoid/async/index.browser.js +42 -0
- package/templates/basic/node_modules/nanoid/async/index.cjs +44 -0
- package/templates/basic/node_modules/nanoid/async/index.d.ts +56 -0
- package/templates/basic/node_modules/nanoid/async/index.js +44 -0
- package/templates/basic/node_modules/nanoid/async/index.native.js +35 -0
- package/templates/basic/node_modules/nanoid/async/package.json +12 -0
- package/templates/basic/node_modules/nanoid/bin/nanoid.cjs +55 -0
- package/templates/basic/node_modules/nanoid/index.browser.cjs +44 -0
- package/templates/basic/node_modules/nanoid/index.browser.js +44 -0
- package/templates/basic/node_modules/nanoid/index.cjs +57 -0
- package/templates/basic/node_modules/nanoid/index.d.cts +91 -0
- package/templates/basic/node_modules/nanoid/index.d.ts +91 -0
- package/templates/basic/node_modules/nanoid/index.js +62 -0
- package/templates/basic/node_modules/nanoid/nanoid.js +1 -0
- package/templates/basic/node_modules/nanoid/non-secure/index.cjs +24 -0
- package/templates/basic/node_modules/nanoid/non-secure/index.d.ts +33 -0
- package/templates/basic/node_modules/nanoid/non-secure/index.js +24 -0
- package/templates/basic/node_modules/nanoid/non-secure/package.json +6 -0
- package/templates/basic/node_modules/nanoid/package.json +89 -0
- package/templates/basic/node_modules/nanoid/url-alphabet/index.cjs +4 -0
- package/templates/basic/node_modules/nanoid/url-alphabet/index.js +4 -0
- package/templates/basic/node_modules/nanoid/url-alphabet/package.json +6 -0
- package/templates/basic/node_modules/nuclo/LICENSE.md +45 -0
- package/templates/basic/node_modules/nuclo/README.md +727 -0
- package/templates/basic/node_modules/nuclo/dist/bootstrap.d.ts +5 -0
- package/templates/basic/node_modules/nuclo/dist/bootstrap.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/element/attributes.d.ts +3 -0
- package/templates/basic/node_modules/nuclo/dist/element/attributes.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/element/class-name.d.ts +6 -0
- package/templates/basic/node_modules/nuclo/dist/element/class-name.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/element/events.d.ts +35 -0
- package/templates/basic/node_modules/nuclo/dist/element/events.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/element/factory.d.ts +32 -0
- package/templates/basic/node_modules/nuclo/dist/element/factory.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/element/inline-style.d.ts +9 -0
- package/templates/basic/node_modules/nuclo/dist/element/inline-style.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/element/modifiers.d.ts +11 -0
- package/templates/basic/node_modules/nuclo/dist/element/modifiers.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/element/tags.d.ts +5 -0
- package/templates/basic/node_modules/nuclo/dist/element/tags.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/hydration.d.ts +73 -0
- package/templates/basic/node_modules/nuclo/dist/hydration.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/index.d.ts +17 -0
- package/templates/basic/node_modules/nuclo/dist/index.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/list/index.d.ts +7 -0
- package/templates/basic/node_modules/nuclo/dist/list/index.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/list/runtime.d.ts +6 -0
- package/templates/basic/node_modules/nuclo/dist/list/runtime.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/list/types.d.ts +18 -0
- package/templates/basic/node_modules/nuclo/dist/list/types.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/nuclo.cjs +2 -0
- package/templates/basic/node_modules/nuclo/dist/nuclo.cjs.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/nuclo.mjs +2 -0
- package/templates/basic/node_modules/nuclo/dist/nuclo.mjs.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/nuclo.umd.js +2 -0
- package/templates/basic/node_modules/nuclo/dist/nuclo.umd.js.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/polyfill/Document.d.ts +19 -0
- package/templates/basic/node_modules/nuclo/dist/polyfill/Document.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/polyfill/Element.d.ts +48 -0
- package/templates/basic/node_modules/nuclo/dist/polyfill/Element.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/polyfill/Event.d.ts +43 -0
- package/templates/basic/node_modules/nuclo/dist/polyfill/Event.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/polyfill/Node.d.ts +13 -0
- package/templates/basic/node_modules/nuclo/dist/polyfill/Node.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/polyfill/Text.d.ts +11 -0
- package/templates/basic/node_modules/nuclo/dist/polyfill/Text.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/polyfill/index.d.ts +24 -0
- package/templates/basic/node_modules/nuclo/dist/polyfill/index.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/polyfill/nuclo.polyfill.cjs +2 -0
- package/templates/basic/node_modules/nuclo/dist/polyfill/nuclo.polyfill.cjs.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/polyfill/nuclo.polyfill.mjs +2 -0
- package/templates/basic/node_modules/nuclo/dist/polyfill/nuclo.polyfill.mjs.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/render.d.ts +33 -0
- package/templates/basic/node_modules/nuclo/dist/render.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/shared/conditions.d.ts +4 -0
- package/templates/basic/node_modules/nuclo/dist/shared/conditions.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/shared/dom.d.ts +69 -0
- package/templates/basic/node_modules/nuclo/dist/shared/dom.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/shared/environment.d.ts +5 -0
- package/templates/basic/node_modules/nuclo/dist/shared/environment.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/shared/errors.d.ts +2 -0
- package/templates/basic/node_modules/nuclo/dist/shared/errors.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/shared/renderables.d.ts +4 -0
- package/templates/basic/node_modules/nuclo/dist/shared/renderables.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/shared/strings.d.ts +19 -0
- package/templates/basic/node_modules/nuclo/dist/shared/strings.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/shared/type-guards.d.ts +16 -0
- package/templates/basic/node_modules/nuclo/dist/shared/type-guards.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/ssr/index.d.ts +19 -0
- package/templates/basic/node_modules/nuclo/dist/ssr/index.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/ssr/nuclo.ssr.cjs +2 -0
- package/templates/basic/node_modules/nuclo/dist/ssr/nuclo.ssr.cjs.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/ssr/nuclo.ssr.mjs +2 -0
- package/templates/basic/node_modules/nuclo/dist/ssr/nuclo.ssr.mjs.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/ssr/render-to-string.d.ts +41 -0
- package/templates/basic/node_modules/nuclo/dist/ssr/render-to-string.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/style/css.d.ts +19 -0
- package/templates/basic/node_modules/nuclo/dist/style/css.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/style/engine.d.ts +34 -0
- package/templates/basic/node_modules/nuclo/dist/style/engine.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/style/index.d.ts +3 -0
- package/templates/basic/node_modules/nuclo/dist/style/index.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/update/conditional.d.ts +3 -0
- package/templates/basic/node_modules/nuclo/dist/update/conditional.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/update/reactive-attributes.d.ts +45 -0
- package/templates/basic/node_modules/nuclo/dist/update/reactive-attributes.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/update/reactive-text.d.ts +38 -0
- package/templates/basic/node_modules/nuclo/dist/update/reactive-text.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/update/registry.d.ts +97 -0
- package/templates/basic/node_modules/nuclo/dist/update/registry.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/update/scope.d.ts +7 -0
- package/templates/basic/node_modules/nuclo/dist/update/scope.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/update/update.d.ts +4 -0
- package/templates/basic/node_modules/nuclo/dist/update/update.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/when/builder.d.ts +16 -0
- package/templates/basic/node_modules/nuclo/dist/when/builder.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/when/index.d.ts +44 -0
- package/templates/basic/node_modules/nuclo/dist/when/index.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/dist/when/runtime.d.ts +59 -0
- package/templates/basic/node_modules/nuclo/dist/when/runtime.d.ts.map +1 -0
- package/templates/basic/node_modules/nuclo/package.json +88 -0
- package/templates/basic/node_modules/nuclo/types/core/base.d.ts +113 -0
- package/templates/basic/node_modules/nuclo/types/features/list.d.ts +38 -0
- package/templates/basic/node_modules/nuclo/types/features/on.d.ts +59 -0
- package/templates/basic/node_modules/nuclo/types/features/render.d.ts +49 -0
- package/templates/basic/node_modules/nuclo/types/features/scope.d.ts +6 -0
- package/templates/basic/node_modules/nuclo/types/features/style.d.ts +77 -0
- package/templates/basic/node_modules/nuclo/types/features/update.d.ts +6 -0
- package/templates/basic/node_modules/nuclo/types/features/when.d.ts +18 -0
- package/templates/basic/node_modules/nuclo/types/html/tags.d.ts +119 -0
- package/templates/basic/node_modules/nuclo/types/index.d.ts +137 -0
- package/templates/basic/node_modules/nuclo/types/polyfill.d.ts +131 -0
- package/templates/basic/node_modules/nuclo/types/ssr.d.ts +45 -0
- package/templates/basic/node_modules/nuclo/types/style.d.ts +404 -0
- package/templates/basic/node_modules/nuclo/types/svg/base.d.ts +118 -0
- package/templates/basic/node_modules/nuclo/types/svg/tags.d.ts +68 -0
- package/templates/basic/node_modules/picocolors/LICENSE +15 -0
- package/templates/basic/node_modules/picocolors/README.md +21 -0
- package/templates/basic/node_modules/picocolors/package.json +25 -0
- package/templates/basic/node_modules/picocolors/picocolors.browser.js +4 -0
- package/templates/basic/node_modules/picocolors/picocolors.d.ts +5 -0
- package/templates/basic/node_modules/picocolors/picocolors.js +75 -0
- package/templates/basic/node_modules/picocolors/types.d.ts +51 -0
- package/templates/basic/node_modules/picomatch/LICENSE +21 -0
- package/templates/basic/node_modules/picomatch/README.md +743 -0
- package/templates/basic/node_modules/picomatch/index.js +17 -0
- package/templates/basic/node_modules/picomatch/lib/constants.js +184 -0
- package/templates/basic/node_modules/picomatch/lib/parse.js +1416 -0
- package/templates/basic/node_modules/picomatch/lib/picomatch.js +361 -0
- package/templates/basic/node_modules/picomatch/lib/scan.js +391 -0
- package/templates/basic/node_modules/picomatch/lib/utils.js +72 -0
- package/templates/basic/node_modules/picomatch/package.json +83 -0
- package/templates/basic/node_modules/picomatch/posix.js +3 -0
- package/templates/basic/node_modules/postcss/LICENSE +20 -0
- package/templates/basic/node_modules/postcss/README.md +25 -0
- package/templates/basic/node_modules/postcss/lib/at-rule.d.ts +139 -0
- package/templates/basic/node_modules/postcss/lib/at-rule.js +25 -0
- package/templates/basic/node_modules/postcss/lib/comment.d.ts +67 -0
- package/templates/basic/node_modules/postcss/lib/comment.js +13 -0
- package/templates/basic/node_modules/postcss/lib/container.d.ts +478 -0
- package/templates/basic/node_modules/postcss/lib/container.js +447 -0
- package/templates/basic/node_modules/postcss/lib/css-syntax-error.d.ts +247 -0
- package/templates/basic/node_modules/postcss/lib/css-syntax-error.js +133 -0
- package/templates/basic/node_modules/postcss/lib/declaration.d.ts +150 -0
- package/templates/basic/node_modules/postcss/lib/declaration.js +24 -0
- package/templates/basic/node_modules/postcss/lib/document.d.ts +68 -0
- package/templates/basic/node_modules/postcss/lib/document.js +33 -0
- package/templates/basic/node_modules/postcss/lib/fromJSON.d.ts +9 -0
- package/templates/basic/node_modules/postcss/lib/fromJSON.js +68 -0
- package/templates/basic/node_modules/postcss/lib/input.d.ts +226 -0
- package/templates/basic/node_modules/postcss/lib/input.js +276 -0
- package/templates/basic/node_modules/postcss/lib/lazy-result.d.ts +189 -0
- package/templates/basic/node_modules/postcss/lib/lazy-result.js +563 -0
- package/templates/basic/node_modules/postcss/lib/list.d.ts +60 -0
- package/templates/basic/node_modules/postcss/lib/list.js +58 -0
- package/templates/basic/node_modules/postcss/lib/map-generator.js +376 -0
- package/templates/basic/node_modules/postcss/lib/no-work-result.d.ts +45 -0
- package/templates/basic/node_modules/postcss/lib/no-work-result.js +137 -0
- package/templates/basic/node_modules/postcss/lib/node.d.ts +555 -0
- package/templates/basic/node_modules/postcss/lib/node.js +456 -0
- package/templates/basic/node_modules/postcss/lib/parse.d.ts +9 -0
- package/templates/basic/node_modules/postcss/lib/parse.js +42 -0
- package/templates/basic/node_modules/postcss/lib/parser.js +618 -0
- package/templates/basic/node_modules/postcss/lib/postcss.d.mts +66 -0
- package/templates/basic/node_modules/postcss/lib/postcss.d.ts +461 -0
- package/templates/basic/node_modules/postcss/lib/postcss.js +101 -0
- package/templates/basic/node_modules/postcss/lib/postcss.mjs +30 -0
- package/templates/basic/node_modules/postcss/lib/previous-map.d.ts +80 -0
- package/templates/basic/node_modules/postcss/lib/previous-map.js +161 -0
- package/templates/basic/node_modules/postcss/lib/processor.d.ts +114 -0
- package/templates/basic/node_modules/postcss/lib/processor.js +67 -0
- package/templates/basic/node_modules/postcss/lib/result.d.ts +204 -0
- package/templates/basic/node_modules/postcss/lib/result.js +42 -0
- package/templates/basic/node_modules/postcss/lib/root.d.ts +86 -0
- package/templates/basic/node_modules/postcss/lib/root.js +61 -0
- package/templates/basic/node_modules/postcss/lib/rule.d.ts +126 -0
- package/templates/basic/node_modules/postcss/lib/rule.js +27 -0
- package/templates/basic/node_modules/postcss/lib/stringifier.d.ts +45 -0
- package/templates/basic/node_modules/postcss/lib/stringifier.js +374 -0
- package/templates/basic/node_modules/postcss/lib/stringify.d.ts +9 -0
- package/templates/basic/node_modules/postcss/lib/stringify.js +11 -0
- package/templates/basic/node_modules/postcss/lib/symbols.js +5 -0
- package/templates/basic/node_modules/postcss/lib/terminal-highlight.js +70 -0
- package/templates/basic/node_modules/postcss/lib/tokenize.js +270 -0
- package/templates/basic/node_modules/postcss/lib/warn-once.js +13 -0
- package/templates/basic/node_modules/postcss/lib/warning.d.ts +146 -0
- package/templates/basic/node_modules/postcss/lib/warning.js +37 -0
- package/templates/basic/node_modules/postcss/package.json +88 -0
- package/templates/basic/node_modules/rolldown/LICENSE +25 -0
- package/templates/basic/node_modules/rolldown/README.md +11 -0
- package/templates/basic/node_modules/rolldown/bin/cli.mjs +2 -0
- package/templates/basic/node_modules/rolldown/dist/cli.d.mts +1 -0
- package/templates/basic/node_modules/rolldown/dist/cli.mjs +1202 -0
- package/templates/basic/node_modules/rolldown/dist/config.d.mts +14 -0
- package/templates/basic/node_modules/rolldown/dist/config.mjs +4 -0
- package/templates/basic/node_modules/rolldown/dist/experimental-index.d.mts +280 -0
- package/templates/basic/node_modules/rolldown/dist/experimental-index.mjs +331 -0
- package/templates/basic/node_modules/rolldown/dist/experimental-runtime-types.d.ts +107 -0
- package/templates/basic/node_modules/rolldown/dist/filter-index.d.mts +195 -0
- package/templates/basic/node_modules/rolldown/dist/filter-index.mjs +380 -0
- package/templates/basic/node_modules/rolldown/dist/get-log-filter.d.mts +3 -0
- package/templates/basic/node_modules/rolldown/dist/get-log-filter.mjs +68 -0
- package/templates/basic/node_modules/rolldown/dist/index.d.mts +4 -0
- package/templates/basic/node_modules/rolldown/dist/index.mjs +50 -0
- package/templates/basic/node_modules/rolldown/dist/parallel-plugin-worker.d.mts +1 -0
- package/templates/basic/node_modules/rolldown/dist/parallel-plugin-worker.mjs +29 -0
- package/templates/basic/node_modules/rolldown/dist/parallel-plugin.d.mts +13 -0
- package/templates/basic/node_modules/rolldown/dist/parallel-plugin.mjs +6 -0
- package/templates/basic/node_modules/rolldown/dist/parse-ast-index.d.mts +32 -0
- package/templates/basic/node_modules/rolldown/dist/parse-ast-index.mjs +60 -0
- package/templates/basic/node_modules/rolldown/dist/plugins-index.d.mts +33 -0
- package/templates/basic/node_modules/rolldown/dist/plugins-index.mjs +40 -0
- package/templates/basic/node_modules/rolldown/dist/shared/binding-B1q9aYT-.d.mts +1947 -0
- package/templates/basic/node_modules/rolldown/dist/shared/binding-BmkJW3Wy.mjs +588 -0
- package/templates/basic/node_modules/rolldown/dist/shared/bindingify-input-options-BsDhfYrS.mjs +2240 -0
- package/templates/basic/node_modules/rolldown/dist/shared/constructors-2i1T9YcF.d.mts +36 -0
- package/templates/basic/node_modules/rolldown/dist/shared/constructors-CE6zZSUt.mjs +65 -0
- package/templates/basic/node_modules/rolldown/dist/shared/define-config-BBz954-q.d.mts +3901 -0
- package/templates/basic/node_modules/rolldown/dist/shared/define-config-Demdg3_4.mjs +6 -0
- package/templates/basic/node_modules/rolldown/dist/shared/error-BlQ0-ek7.mjs +85 -0
- package/templates/basic/node_modules/rolldown/dist/shared/get-log-filter-BpNVNJ5-.d.mts +35 -0
- package/templates/basic/node_modules/rolldown/dist/shared/load-config-FRmAU9xl.mjs +120 -0
- package/templates/basic/node_modules/rolldown/dist/shared/logging-BSNejiLS.d.mts +50 -0
- package/templates/basic/node_modules/rolldown/dist/shared/logs-aMKUxRpj.mjs +180 -0
- package/templates/basic/node_modules/rolldown/dist/shared/misc-CoQm4NHO.mjs +21 -0
- package/templates/basic/node_modules/rolldown/dist/shared/normalize-string-or-regex-BYkbbGqQ.mjs +68 -0
- package/templates/basic/node_modules/rolldown/dist/shared/parse-DVMnkavl.mjs +74 -0
- package/templates/basic/node_modules/rolldown/dist/shared/prompt-B1Yc1NPt.mjs +847 -0
- package/templates/basic/node_modules/rolldown/dist/shared/resolve-tsconfig-CdIAR1Eb.mjs +124 -0
- package/templates/basic/node_modules/rolldown/dist/shared/rolldown-build-aV0QeeTW.mjs +3264 -0
- package/templates/basic/node_modules/rolldown/dist/shared/rolldown-tbHvKzVl.mjs +40 -0
- package/templates/basic/node_modules/rolldown/dist/shared/transform-CEmFsvJW.d.mts +149 -0
- package/templates/basic/node_modules/rolldown/dist/shared/watch-DIhJ-T1s.mjs +374 -0
- package/templates/basic/node_modules/rolldown/dist/utils-index.d.mts +376 -0
- package/templates/basic/node_modules/rolldown/dist/utils-index.mjs +2414 -0
- package/templates/basic/node_modules/rolldown/package.json +153 -0
- package/templates/basic/node_modules/source-map-js/LICENSE +28 -0
- package/templates/basic/node_modules/source-map-js/README.md +765 -0
- package/templates/basic/node_modules/source-map-js/lib/array-set.js +121 -0
- package/templates/basic/node_modules/source-map-js/lib/base64-vlq.js +140 -0
- package/templates/basic/node_modules/source-map-js/lib/base64.js +67 -0
- package/templates/basic/node_modules/source-map-js/lib/binary-search.js +111 -0
- package/templates/basic/node_modules/source-map-js/lib/mapping-list.js +79 -0
- package/templates/basic/node_modules/source-map-js/lib/quick-sort.js +132 -0
- package/templates/basic/node_modules/source-map-js/lib/source-map-consumer.d.ts +1 -0
- package/templates/basic/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
- package/templates/basic/node_modules/source-map-js/lib/source-map-generator.d.ts +1 -0
- package/templates/basic/node_modules/source-map-js/lib/source-map-generator.js +444 -0
- package/templates/basic/node_modules/source-map-js/lib/source-node.d.ts +1 -0
- package/templates/basic/node_modules/source-map-js/lib/source-node.js +413 -0
- package/templates/basic/node_modules/source-map-js/lib/util.js +594 -0
- package/templates/basic/node_modules/source-map-js/package.json +71 -0
- package/templates/basic/node_modules/source-map-js/source-map.d.ts +104 -0
- package/templates/basic/node_modules/source-map-js/source-map.js +8 -0
- package/templates/basic/node_modules/tinyglobby/LICENSE +21 -0
- package/templates/basic/node_modules/tinyglobby/README.md +25 -0
- package/templates/basic/node_modules/tinyglobby/dist/index.cjs +335 -0
- package/templates/basic/node_modules/tinyglobby/dist/index.d.cts +148 -0
- package/templates/basic/node_modules/tinyglobby/dist/index.d.mts +148 -0
- package/templates/basic/node_modules/tinyglobby/dist/index.mjs +307 -0
- package/templates/basic/node_modules/tinyglobby/package.json +70 -0
- package/templates/basic/node_modules/typescript/LICENSE.txt +55 -0
- package/templates/basic/node_modules/typescript/README.md +50 -0
- package/templates/basic/node_modules/typescript/SECURITY.md +39 -0
- package/templates/basic/node_modules/typescript/ThirdPartyNoticeText.txt +193 -0
- package/templates/basic/node_modules/typescript/bin/tsc +2 -0
- package/templates/basic/node_modules/typescript/bin/tsserver +2 -0
- package/templates/basic/node_modules/typescript/lib/_tsc.js +134465 -0
- package/templates/basic/node_modules/typescript/lib/_tsserver.js +659 -0
- package/templates/basic/node_modules/typescript/lib/_typingsInstaller.js +222 -0
- package/templates/basic/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +2129 -0
- package/templates/basic/node_modules/typescript/lib/de/diagnosticMessages.generated.json +2125 -0
- package/templates/basic/node_modules/typescript/lib/es/diagnosticMessages.generated.json +2129 -0
- package/templates/basic/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +2129 -0
- package/templates/basic/node_modules/typescript/lib/it/diagnosticMessages.generated.json +2125 -0
- package/templates/basic/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +2129 -0
- package/templates/basic/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +2129 -0
- package/templates/basic/node_modules/typescript/lib/lib.d.ts +20 -0
- package/templates/basic/node_modules/typescript/lib/lib.decorators.d.ts +382 -0
- package/templates/basic/node_modules/typescript/lib/lib.decorators.legacy.d.ts +20 -0
- package/templates/basic/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +18 -0
- package/templates/basic/node_modules/typescript/lib/lib.dom.d.ts +45125 -0
- package/templates/basic/node_modules/typescript/lib/lib.dom.iterable.d.ts +18 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2015.collection.d.ts +150 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2015.core.d.ts +595 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2015.d.ts +26 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2015.generator.d.ts +75 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2015.iterable.d.ts +603 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2015.promise.d.ts +79 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2015.proxy.d.ts +126 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2015.reflect.d.ts +142 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2015.symbol.d.ts +44 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +324 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2016.array.include.d.ts +114 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2016.d.ts +19 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2016.full.d.ts +21 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2016.intl.d.ts +29 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +19 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2017.d.ts +24 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2017.date.d.ts +29 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2017.full.d.ts +21 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2017.intl.d.ts +42 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2017.object.d.ts +47 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +133 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2017.string.d.ts +43 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +51 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +75 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +51 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2018.d.ts +22 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2018.full.d.ts +22 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2018.intl.d.ts +81 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2018.promise.d.ts +28 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2018.regexp.d.ts +35 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2019.array.d.ts +77 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2019.d.ts +22 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2019.full.d.ts +22 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2019.intl.d.ts +21 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2019.object.d.ts +31 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2019.string.d.ts +35 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2019.symbol.d.ts +22 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2020.bigint.d.ts +763 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2020.d.ts +25 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2020.date.d.ts +40 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2020.full.d.ts +22 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2020.intl.d.ts +472 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2020.number.d.ts +26 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2020.promise.d.ts +45 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +97 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2020.string.d.ts +42 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +39 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2021.d.ts +21 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2021.full.d.ts +22 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2021.intl.d.ts +164 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2021.promise.d.ts +46 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2021.string.d.ts +31 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2021.weakref.d.ts +76 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2022.array.d.ts +119 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2022.d.ts +23 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2022.error.d.ts +73 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2022.full.d.ts +22 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2022.intl.d.ts +143 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2022.object.d.ts +24 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2022.regexp.d.ts +37 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2022.string.d.ts +23 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2023.array.d.ts +922 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2023.collection.d.ts +19 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2023.d.ts +20 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2023.full.d.ts +22 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2023.intl.d.ts +62 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +63 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2024.collection.d.ts +27 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2024.d.ts +24 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2024.full.d.ts +22 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2024.object.d.ts +27 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2024.promise.d.ts +33 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2024.regexp.d.ts +23 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +66 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2024.string.d.ts +27 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2025.collection.d.ts +94 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2025.d.ts +23 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2025.float16.d.ts +443 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2025.full.d.ts +22 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2025.intl.d.ts +200 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2025.iterator.d.ts +146 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2025.promise.d.ts +32 -0
- package/templates/basic/node_modules/typescript/lib/lib.es2025.regexp.d.ts +30 -0
- package/templates/basic/node_modules/typescript/lib/lib.es5.d.ts +4599 -0
- package/templates/basic/node_modules/typescript/lib/lib.es6.d.ts +21 -0
- package/templates/basic/node_modules/typescript/lib/lib.esnext.array.d.ts +33 -0
- package/templates/basic/node_modules/typescript/lib/lib.esnext.collection.d.ts +47 -0
- package/templates/basic/node_modules/typescript/lib/lib.esnext.d.ts +27 -0
- package/templates/basic/node_modules/typescript/lib/lib.esnext.date.d.ts +21 -0
- package/templates/basic/node_modules/typescript/lib/lib.esnext.decorators.d.ts +26 -0
- package/templates/basic/node_modules/typescript/lib/lib.esnext.disposable.d.ts +191 -0
- package/templates/basic/node_modules/typescript/lib/lib.esnext.error.d.ts +22 -0
- package/templates/basic/node_modules/typescript/lib/lib.esnext.full.d.ts +22 -0
- package/templates/basic/node_modules/typescript/lib/lib.esnext.intl.d.ts +107 -0
- package/templates/basic/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +23 -0
- package/templates/basic/node_modules/typescript/lib/lib.esnext.temporal.d.ts +485 -0
- package/templates/basic/node_modules/typescript/lib/lib.esnext.typedarrays.d.ts +90 -0
- package/templates/basic/node_modules/typescript/lib/lib.scripthost.d.ts +320 -0
- package/templates/basic/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +18 -0
- package/templates/basic/node_modules/typescript/lib/lib.webworker.d.ts +15606 -0
- package/templates/basic/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +21 -0
- package/templates/basic/node_modules/typescript/lib/lib.webworker.iterable.d.ts +18 -0
- package/templates/basic/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +2129 -0
- package/templates/basic/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +2129 -0
- package/templates/basic/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +2125 -0
- package/templates/basic/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +2129 -0
- package/templates/basic/node_modules/typescript/lib/tsc.js +8 -0
- package/templates/basic/node_modules/typescript/lib/tsserver.js +8 -0
- package/templates/basic/node_modules/typescript/lib/tsserverlibrary.d.ts +17 -0
- package/templates/basic/node_modules/typescript/lib/tsserverlibrary.js +21 -0
- package/templates/basic/node_modules/typescript/lib/typesMap.json +497 -0
- package/templates/basic/node_modules/typescript/lib/typescript.d.ts +11448 -0
- package/templates/basic/node_modules/typescript/lib/typescript.js +201039 -0
- package/templates/basic/node_modules/typescript/lib/typingsInstaller.js +8 -0
- package/templates/basic/node_modules/typescript/lib/watchGuard.js +53 -0
- package/templates/basic/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +2129 -0
- package/templates/basic/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +2125 -0
- package/templates/basic/node_modules/typescript/package.json +118 -0
- package/templates/basic/node_modules/vite/LICENSE.md +2287 -0
- package/templates/basic/node_modules/vite/README.md +20 -0
- package/templates/basic/node_modules/vite/bin/openChrome.js +68 -0
- package/templates/basic/node_modules/vite/bin/vite.js +79 -0
- package/templates/basic/node_modules/vite/client.d.ts +285 -0
- package/templates/basic/node_modules/vite/dist/client/client.mjs +1269 -0
- package/templates/basic/node_modules/vite/dist/client/env.mjs +18 -0
- package/templates/basic/node_modules/vite/dist/node/chunks/build.js +5371 -0
- package/templates/basic/node_modules/vite/dist/node/chunks/dist.js +6784 -0
- package/templates/basic/node_modules/vite/dist/node/chunks/lib.js +371 -0
- package/templates/basic/node_modules/vite/dist/node/chunks/logger.js +364 -0
- package/templates/basic/node_modules/vite/dist/node/chunks/moduleRunnerTransport.d.ts +96 -0
- package/templates/basic/node_modules/vite/dist/node/chunks/node.js +35836 -0
- package/templates/basic/node_modules/vite/dist/node/chunks/postcss-import.js +467 -0
- package/templates/basic/node_modules/vite/dist/node/cli.js +836 -0
- package/templates/basic/node_modules/vite/dist/node/index.d.ts +4011 -0
- package/templates/basic/node_modules/vite/dist/node/index.js +3 -0
- package/templates/basic/node_modules/vite/dist/node/internal.d.ts +2 -0
- package/templates/basic/node_modules/vite/dist/node/internal.js +2 -0
- package/templates/basic/node_modules/vite/dist/node/module-runner.d.ts +314 -0
- package/templates/basic/node_modules/vite/dist/node/module-runner.js +1274 -0
- package/templates/basic/node_modules/vite/misc/false.js +1 -0
- package/templates/basic/node_modules/vite/misc/true.js +1 -0
- package/templates/basic/node_modules/vite/package.json +194 -0
- package/templates/basic/node_modules/vite/types/customEvent.d.ts +79 -0
- package/templates/basic/node_modules/vite/types/hmrPayload.d.ts +80 -0
- package/templates/basic/node_modules/vite/types/hot.d.ts +39 -0
- package/templates/basic/node_modules/vite/types/import-meta.d.ts +5 -0
- package/templates/basic/node_modules/vite/types/importGlob.d.ts +131 -0
- package/templates/basic/node_modules/vite/types/importMeta.d.ts +30 -0
- package/templates/basic/node_modules/vite/types/internal/cssPreprocessorOptions.d.ts +44 -0
- package/templates/basic/node_modules/vite/types/internal/esbuildOptions.d.ts +28 -0
- package/templates/basic/node_modules/vite/types/internal/lightningcssOptions.d.ts +18 -0
- package/templates/basic/node_modules/vite/types/internal/rollupTypeCompat.d.ts +24 -0
- package/templates/basic/node_modules/vite/types/internal/terserOptions.d.ts +11 -0
- package/templates/basic/node_modules/vite/types/metadata.d.ts +47 -0
- package/templates/basic/package-lock.json +926 -0
- package/templates/basic/package.json +18 -0
- package/templates/basic/public/apple-touch-icon.png +0 -0
- package/templates/basic/public/favicon-16x16.png +0 -0
- package/templates/basic/public/favicon-32x32.png +0 -0
- package/templates/basic/public/favicon.ico +0 -0
- package/templates/basic/public/icon-192.png +0 -0
- package/templates/basic/public/icon-512.png +0 -0
- package/templates/basic/public/nuclo-logo.svg +24 -0
- package/templates/basic/public/site.webmanifest +23 -0
- package/templates/basic/src/app.ts +37 -0
- package/templates/basic/src/main.ts +5 -0
- package/templates/basic/src/styles.ts +85 -0
- package/templates/basic/tsconfig.json +23 -0
- package/templates/basic/vite.config.ts +3 -0
|
@@ -0,0 +1,1269 @@
|
|
|
1
|
+
import "@vite/env";
|
|
2
|
+
//#region ../../node_modules/.pnpm/nanoid@5.1.16/node_modules/nanoid/non-secure/index.js
|
|
3
|
+
let urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
4
|
+
let nanoid = (size = 21) => {
|
|
5
|
+
let id = "";
|
|
6
|
+
let i = size | 0;
|
|
7
|
+
while (i-- > 0) id += urlAlphabet[Math.random() * 64 | 0];
|
|
8
|
+
return id;
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/typeof.js
|
|
12
|
+
function _typeof(o) {
|
|
13
|
+
"@babel/helpers - typeof";
|
|
14
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
15
|
+
return typeof o;
|
|
16
|
+
} : function(o) {
|
|
17
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
18
|
+
}, _typeof(o);
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPrimitive.js
|
|
22
|
+
function toPrimitive(t, r) {
|
|
23
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
24
|
+
var e = t[Symbol.toPrimitive];
|
|
25
|
+
if (void 0 !== e) {
|
|
26
|
+
var i = e.call(t, r || "default");
|
|
27
|
+
if ("object" != _typeof(i)) return i;
|
|
28
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
29
|
+
}
|
|
30
|
+
return ("string" === r ? String : Number)(t);
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPropertyKey.js
|
|
34
|
+
function toPropertyKey(t) {
|
|
35
|
+
var i = toPrimitive(t, "string");
|
|
36
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/defineProperty.js
|
|
40
|
+
function _defineProperty(e, r, t) {
|
|
41
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
42
|
+
value: t,
|
|
43
|
+
enumerable: !0,
|
|
44
|
+
configurable: !0,
|
|
45
|
+
writable: !0
|
|
46
|
+
}) : e[r] = t, e;
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/shared/hmr.ts
|
|
50
|
+
var HMRContext = class {
|
|
51
|
+
constructor(hmrClient, ownerPath) {
|
|
52
|
+
this.hmrClient = hmrClient;
|
|
53
|
+
this.ownerPath = ownerPath;
|
|
54
|
+
_defineProperty(this, "newListeners", void 0);
|
|
55
|
+
if (!hmrClient.dataMap.has(ownerPath)) hmrClient.dataMap.set(ownerPath, {});
|
|
56
|
+
const mod = hmrClient.hotModulesMap.get(ownerPath);
|
|
57
|
+
if (mod) mod.callbacks = [];
|
|
58
|
+
const staleListeners = hmrClient.ctxToListenersMap.get(ownerPath);
|
|
59
|
+
if (staleListeners) for (const [event, staleFns] of staleListeners) {
|
|
60
|
+
const listeners = hmrClient.customListenersMap.get(event);
|
|
61
|
+
if (listeners) hmrClient.customListenersMap.set(event, listeners.filter((l) => !staleFns.includes(l)));
|
|
62
|
+
}
|
|
63
|
+
this.newListeners = /* @__PURE__ */ new Map();
|
|
64
|
+
hmrClient.ctxToListenersMap.set(ownerPath, this.newListeners);
|
|
65
|
+
}
|
|
66
|
+
get data() {
|
|
67
|
+
return this.hmrClient.dataMap.get(this.ownerPath);
|
|
68
|
+
}
|
|
69
|
+
accept(deps, callback) {
|
|
70
|
+
if (typeof deps === "function" || !deps) this.acceptDeps([this.ownerPath], ([mod]) => deps?.(mod));
|
|
71
|
+
else if (typeof deps === "string") this.acceptDeps([deps], ([mod]) => callback?.(mod));
|
|
72
|
+
else if (Array.isArray(deps)) this.acceptDeps(deps, callback);
|
|
73
|
+
else throw new Error(`invalid hot.accept() usage.`);
|
|
74
|
+
}
|
|
75
|
+
acceptExports(_, callback) {
|
|
76
|
+
this.acceptDeps([this.ownerPath], ([mod]) => callback?.(mod));
|
|
77
|
+
}
|
|
78
|
+
dispose(cb) {
|
|
79
|
+
this.hmrClient.disposeMap.set(this.ownerPath, cb);
|
|
80
|
+
}
|
|
81
|
+
prune(cb) {
|
|
82
|
+
this.hmrClient.pruneMap.set(this.ownerPath, cb);
|
|
83
|
+
}
|
|
84
|
+
decline() {}
|
|
85
|
+
invalidate(message) {
|
|
86
|
+
const firstInvalidatedBy = this.hmrClient.currentFirstInvalidatedBy ?? this.ownerPath;
|
|
87
|
+
this.hmrClient.notifyListeners("vite:invalidate", {
|
|
88
|
+
path: this.ownerPath,
|
|
89
|
+
message,
|
|
90
|
+
firstInvalidatedBy
|
|
91
|
+
});
|
|
92
|
+
this.send("vite:invalidate", {
|
|
93
|
+
path: this.ownerPath,
|
|
94
|
+
message,
|
|
95
|
+
firstInvalidatedBy
|
|
96
|
+
});
|
|
97
|
+
this.hmrClient.logger.debug(`invalidate ${this.ownerPath}${message ? `: ${message}` : ""}`);
|
|
98
|
+
}
|
|
99
|
+
on(event, cb) {
|
|
100
|
+
const addToMap = (map) => {
|
|
101
|
+
const existing = map.get(event) || [];
|
|
102
|
+
existing.push(cb);
|
|
103
|
+
map.set(event, existing);
|
|
104
|
+
};
|
|
105
|
+
addToMap(this.hmrClient.customListenersMap);
|
|
106
|
+
addToMap(this.newListeners);
|
|
107
|
+
}
|
|
108
|
+
off(event, cb) {
|
|
109
|
+
const removeFromMap = (map) => {
|
|
110
|
+
const existing = map.get(event);
|
|
111
|
+
if (existing === void 0) return;
|
|
112
|
+
const pruned = existing.filter((l) => l !== cb);
|
|
113
|
+
if (pruned.length === 0) {
|
|
114
|
+
map.delete(event);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
map.set(event, pruned);
|
|
118
|
+
};
|
|
119
|
+
removeFromMap(this.hmrClient.customListenersMap);
|
|
120
|
+
removeFromMap(this.newListeners);
|
|
121
|
+
}
|
|
122
|
+
send(event, data) {
|
|
123
|
+
this.hmrClient.send({
|
|
124
|
+
type: "custom",
|
|
125
|
+
event,
|
|
126
|
+
data
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
acceptDeps(deps, callback = () => {}) {
|
|
130
|
+
const mod = this.hmrClient.hotModulesMap.get(this.ownerPath) || {
|
|
131
|
+
id: this.ownerPath,
|
|
132
|
+
callbacks: []
|
|
133
|
+
};
|
|
134
|
+
mod.callbacks.push({
|
|
135
|
+
deps,
|
|
136
|
+
fn: callback
|
|
137
|
+
});
|
|
138
|
+
this.hmrClient.hotModulesMap.set(this.ownerPath, mod);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
var HMRClient = class {
|
|
142
|
+
constructor(logger, transport, importUpdatedModule) {
|
|
143
|
+
this.logger = logger;
|
|
144
|
+
this.transport = transport;
|
|
145
|
+
this.importUpdatedModule = importUpdatedModule;
|
|
146
|
+
_defineProperty(this, "hotModulesMap", /* @__PURE__ */ new Map());
|
|
147
|
+
_defineProperty(this, "disposeMap", /* @__PURE__ */ new Map());
|
|
148
|
+
_defineProperty(this, "pruneMap", /* @__PURE__ */ new Map());
|
|
149
|
+
_defineProperty(this, "dataMap", /* @__PURE__ */ new Map());
|
|
150
|
+
_defineProperty(this, "customListenersMap", /* @__PURE__ */ new Map());
|
|
151
|
+
_defineProperty(this, "ctxToListenersMap", /* @__PURE__ */ new Map());
|
|
152
|
+
_defineProperty(this, "currentFirstInvalidatedBy", void 0);
|
|
153
|
+
_defineProperty(this, "updateQueue", []);
|
|
154
|
+
_defineProperty(this, "pendingUpdateQueue", false);
|
|
155
|
+
}
|
|
156
|
+
async notifyListeners(event, data) {
|
|
157
|
+
const cbs = this.customListenersMap.get(event);
|
|
158
|
+
if (cbs) await Promise.allSettled(cbs.map((cb) => cb(data)));
|
|
159
|
+
}
|
|
160
|
+
send(payload) {
|
|
161
|
+
this.transport.send(payload).catch((err) => {
|
|
162
|
+
this.logger.error(err);
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
clear() {
|
|
166
|
+
this.hotModulesMap.clear();
|
|
167
|
+
this.disposeMap.clear();
|
|
168
|
+
this.pruneMap.clear();
|
|
169
|
+
this.dataMap.clear();
|
|
170
|
+
this.customListenersMap.clear();
|
|
171
|
+
this.ctxToListenersMap.clear();
|
|
172
|
+
}
|
|
173
|
+
async prunePaths(paths) {
|
|
174
|
+
await Promise.all(paths.map((path) => {
|
|
175
|
+
const disposer = this.disposeMap.get(path);
|
|
176
|
+
if (disposer) return disposer(this.dataMap.get(path));
|
|
177
|
+
}));
|
|
178
|
+
await Promise.all(paths.map((path) => {
|
|
179
|
+
const fn = this.pruneMap.get(path);
|
|
180
|
+
if (fn) return fn(this.dataMap.get(path));
|
|
181
|
+
}));
|
|
182
|
+
}
|
|
183
|
+
warnFailedUpdate(err, path) {
|
|
184
|
+
if (!(err instanceof Error) || !err.message.includes("fetch")) this.logger.error(err);
|
|
185
|
+
this.logger.error(`Failed to reload ${path}. This could be due to syntax errors or importing non-existent modules. (see errors above)`);
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* buffer multiple hot updates triggered by the same src change
|
|
189
|
+
* so that they are invoked in the same order they were sent.
|
|
190
|
+
* (otherwise the order may be inconsistent because of the http request round trip)
|
|
191
|
+
*/
|
|
192
|
+
async queueUpdate(payload) {
|
|
193
|
+
this.updateQueue.push(this.fetchUpdate(payload));
|
|
194
|
+
if (!this.pendingUpdateQueue) {
|
|
195
|
+
this.pendingUpdateQueue = true;
|
|
196
|
+
await Promise.resolve();
|
|
197
|
+
this.pendingUpdateQueue = false;
|
|
198
|
+
const loading = [...this.updateQueue];
|
|
199
|
+
this.updateQueue = [];
|
|
200
|
+
(await Promise.all(loading)).forEach((fn) => fn && fn());
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
async fetchUpdate(update) {
|
|
204
|
+
const { path, acceptedPath, firstInvalidatedBy } = update;
|
|
205
|
+
const mod = this.hotModulesMap.get(path);
|
|
206
|
+
if (!mod) return;
|
|
207
|
+
let fetchedModule;
|
|
208
|
+
const isSelfUpdate = path === acceptedPath;
|
|
209
|
+
const qualifiedCallbacks = mod.callbacks.filter(({ deps }) => deps.includes(acceptedPath));
|
|
210
|
+
if (isSelfUpdate || qualifiedCallbacks.length > 0) {
|
|
211
|
+
const disposer = this.disposeMap.get(acceptedPath);
|
|
212
|
+
if (disposer) await disposer(this.dataMap.get(acceptedPath));
|
|
213
|
+
try {
|
|
214
|
+
fetchedModule = await this.importUpdatedModule(update);
|
|
215
|
+
} catch (e) {
|
|
216
|
+
this.warnFailedUpdate(e, acceptedPath);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
return () => {
|
|
220
|
+
try {
|
|
221
|
+
this.currentFirstInvalidatedBy = firstInvalidatedBy;
|
|
222
|
+
for (const { deps, fn } of qualifiedCallbacks) fn(deps.map((dep) => dep === acceptedPath ? fetchedModule : void 0));
|
|
223
|
+
const loggedPath = isSelfUpdate ? path : `${acceptedPath} via ${path}`;
|
|
224
|
+
this.logger.debug(`hot updated: ${loggedPath}`);
|
|
225
|
+
} finally {
|
|
226
|
+
this.currentFirstInvalidatedBy = void 0;
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
//#endregion
|
|
232
|
+
//#region src/shared/constants.ts
|
|
233
|
+
let SOURCEMAPPING_URL = "sourceMa";
|
|
234
|
+
SOURCEMAPPING_URL += "ppingURL";
|
|
235
|
+
typeof process !== "undefined" && process.platform;
|
|
236
|
+
(async function() {}).constructor;
|
|
237
|
+
function promiseWithResolvers() {
|
|
238
|
+
let resolve;
|
|
239
|
+
let reject;
|
|
240
|
+
return {
|
|
241
|
+
promise: new Promise((_resolve, _reject) => {
|
|
242
|
+
resolve = _resolve;
|
|
243
|
+
reject = _reject;
|
|
244
|
+
}),
|
|
245
|
+
resolve,
|
|
246
|
+
reject
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
//#endregion
|
|
250
|
+
//#region src/shared/moduleRunnerTransport.ts
|
|
251
|
+
function reviveInvokeError(e) {
|
|
252
|
+
const error = new Error(e.message || "Unknown invoke error");
|
|
253
|
+
Object.assign(error, e, { runnerError: /* @__PURE__ */ new Error("RunnerError") });
|
|
254
|
+
return error;
|
|
255
|
+
}
|
|
256
|
+
const createInvokeableTransport = (transport) => {
|
|
257
|
+
if (transport.invoke) return {
|
|
258
|
+
...transport,
|
|
259
|
+
async invoke(name, data) {
|
|
260
|
+
const result = await transport.invoke({
|
|
261
|
+
type: "custom",
|
|
262
|
+
event: "vite:invoke",
|
|
263
|
+
data: {
|
|
264
|
+
id: "send",
|
|
265
|
+
name,
|
|
266
|
+
data
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
if ("error" in result) throw reviveInvokeError(result.error);
|
|
270
|
+
return result.result;
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
if (!transport.send || !transport.connect) throw new Error("transport must implement send and connect when invoke is not implemented");
|
|
274
|
+
const rpcPromises = /* @__PURE__ */ new Map();
|
|
275
|
+
return {
|
|
276
|
+
...transport,
|
|
277
|
+
connect({ onMessage, onDisconnection }) {
|
|
278
|
+
return transport.connect({
|
|
279
|
+
onMessage(payload) {
|
|
280
|
+
if (payload.type === "custom" && payload.event === "vite:invoke") {
|
|
281
|
+
const data = payload.data;
|
|
282
|
+
if (data.id.startsWith("response:")) {
|
|
283
|
+
const invokeId = data.id.slice(9);
|
|
284
|
+
const promise = rpcPromises.get(invokeId);
|
|
285
|
+
if (!promise) return;
|
|
286
|
+
if (promise.timeoutId) clearTimeout(promise.timeoutId);
|
|
287
|
+
rpcPromises.delete(invokeId);
|
|
288
|
+
const { error, result } = data.data;
|
|
289
|
+
if (error) promise.reject(error);
|
|
290
|
+
else promise.resolve(result);
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
onMessage(payload);
|
|
295
|
+
},
|
|
296
|
+
onDisconnection
|
|
297
|
+
});
|
|
298
|
+
},
|
|
299
|
+
disconnect() {
|
|
300
|
+
rpcPromises.forEach((promise) => {
|
|
301
|
+
promise.reject(/* @__PURE__ */ new Error(`transport was disconnected, cannot call ${JSON.stringify(promise.name)}`));
|
|
302
|
+
});
|
|
303
|
+
rpcPromises.clear();
|
|
304
|
+
return transport.disconnect?.();
|
|
305
|
+
},
|
|
306
|
+
send(data) {
|
|
307
|
+
return transport.send(data);
|
|
308
|
+
},
|
|
309
|
+
async invoke(name, data) {
|
|
310
|
+
const promiseId = nanoid();
|
|
311
|
+
const wrappedData = {
|
|
312
|
+
type: "custom",
|
|
313
|
+
event: "vite:invoke",
|
|
314
|
+
data: {
|
|
315
|
+
name,
|
|
316
|
+
id: `send:${promiseId}`,
|
|
317
|
+
data
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
const sendPromise = transport.send(wrappedData);
|
|
321
|
+
const { promise, resolve, reject } = promiseWithResolvers();
|
|
322
|
+
const timeout = transport.timeout ?? 6e4;
|
|
323
|
+
let timeoutId;
|
|
324
|
+
if (timeout > 0) {
|
|
325
|
+
timeoutId = setTimeout(() => {
|
|
326
|
+
rpcPromises.delete(promiseId);
|
|
327
|
+
reject(/* @__PURE__ */ new Error(`transport invoke timed out after ${timeout}ms (data: ${JSON.stringify(wrappedData)})`));
|
|
328
|
+
}, timeout);
|
|
329
|
+
timeoutId?.unref?.();
|
|
330
|
+
}
|
|
331
|
+
rpcPromises.set(promiseId, {
|
|
332
|
+
resolve,
|
|
333
|
+
reject,
|
|
334
|
+
name,
|
|
335
|
+
timeoutId
|
|
336
|
+
});
|
|
337
|
+
if (sendPromise) sendPromise.catch((err) => {
|
|
338
|
+
clearTimeout(timeoutId);
|
|
339
|
+
rpcPromises.delete(promiseId);
|
|
340
|
+
reject(err);
|
|
341
|
+
});
|
|
342
|
+
try {
|
|
343
|
+
return await promise;
|
|
344
|
+
} catch (err) {
|
|
345
|
+
throw reviveInvokeError(err);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
const normalizeModuleRunnerTransport = (transport) => {
|
|
351
|
+
const invokeableTransport = createInvokeableTransport(transport);
|
|
352
|
+
let isConnected = !invokeableTransport.connect;
|
|
353
|
+
let connectingPromise;
|
|
354
|
+
return {
|
|
355
|
+
...transport,
|
|
356
|
+
...invokeableTransport.connect ? { async connect(onMessage) {
|
|
357
|
+
if (isConnected) return;
|
|
358
|
+
if (connectingPromise) {
|
|
359
|
+
await connectingPromise;
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
const maybePromise = invokeableTransport.connect({
|
|
363
|
+
onMessage: onMessage ?? (() => {}),
|
|
364
|
+
onDisconnection() {
|
|
365
|
+
isConnected = false;
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
if (maybePromise) {
|
|
369
|
+
connectingPromise = maybePromise;
|
|
370
|
+
await connectingPromise;
|
|
371
|
+
connectingPromise = void 0;
|
|
372
|
+
}
|
|
373
|
+
isConnected = true;
|
|
374
|
+
} } : {},
|
|
375
|
+
...invokeableTransport.disconnect ? { async disconnect() {
|
|
376
|
+
if (!isConnected) return;
|
|
377
|
+
if (connectingPromise) await connectingPromise;
|
|
378
|
+
isConnected = false;
|
|
379
|
+
await invokeableTransport.disconnect();
|
|
380
|
+
} } : {},
|
|
381
|
+
async send(data) {
|
|
382
|
+
if (!invokeableTransport.send) return;
|
|
383
|
+
if (!isConnected) if (connectingPromise) await connectingPromise;
|
|
384
|
+
else throw new SendBeforeConnectError("send was called before connect");
|
|
385
|
+
await invokeableTransport.send(data);
|
|
386
|
+
},
|
|
387
|
+
async invoke(name, data) {
|
|
388
|
+
if (!isConnected) if (connectingPromise) await connectingPromise;
|
|
389
|
+
else throw new SendBeforeConnectError("invoke was called before connect");
|
|
390
|
+
return invokeableTransport.invoke(name, data);
|
|
391
|
+
}
|
|
392
|
+
};
|
|
393
|
+
};
|
|
394
|
+
var SendBeforeConnectError = class extends Error {
|
|
395
|
+
constructor(message) {
|
|
396
|
+
super(message);
|
|
397
|
+
this.name = "SendBeforeConnectError";
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
const createWebSocketModuleRunnerTransport = (options) => {
|
|
401
|
+
const pingInterval = options.pingInterval ?? 3e4;
|
|
402
|
+
let ws;
|
|
403
|
+
let pingIntervalId;
|
|
404
|
+
return {
|
|
405
|
+
async connect({ onMessage, onDisconnection }) {
|
|
406
|
+
const socket = options.createConnection();
|
|
407
|
+
socket.addEventListener("message", ({ data }) => {
|
|
408
|
+
onMessage(JSON.parse(data));
|
|
409
|
+
});
|
|
410
|
+
let isOpened = socket.readyState === socket.OPEN;
|
|
411
|
+
if (!isOpened) await new Promise((resolve, reject) => {
|
|
412
|
+
socket.addEventListener("open", () => {
|
|
413
|
+
isOpened = true;
|
|
414
|
+
resolve();
|
|
415
|
+
}, { once: true });
|
|
416
|
+
socket.addEventListener("close", () => {
|
|
417
|
+
if (!isOpened) {
|
|
418
|
+
reject(/* @__PURE__ */ new Error("WebSocket closed without opened."));
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
onMessage({
|
|
422
|
+
type: "custom",
|
|
423
|
+
event: "vite:ws:disconnect",
|
|
424
|
+
data: { webSocket: socket }
|
|
425
|
+
});
|
|
426
|
+
onDisconnection();
|
|
427
|
+
});
|
|
428
|
+
});
|
|
429
|
+
onMessage({
|
|
430
|
+
type: "custom",
|
|
431
|
+
event: "vite:ws:connect",
|
|
432
|
+
data: { webSocket: socket }
|
|
433
|
+
});
|
|
434
|
+
ws = socket;
|
|
435
|
+
pingIntervalId = setInterval(() => {
|
|
436
|
+
if (socket.readyState === socket.OPEN) socket.send(JSON.stringify({ type: "ping" }));
|
|
437
|
+
}, pingInterval);
|
|
438
|
+
},
|
|
439
|
+
disconnect() {
|
|
440
|
+
clearInterval(pingIntervalId);
|
|
441
|
+
ws?.close();
|
|
442
|
+
},
|
|
443
|
+
send(data) {
|
|
444
|
+
ws.send(JSON.stringify(data));
|
|
445
|
+
}
|
|
446
|
+
};
|
|
447
|
+
};
|
|
448
|
+
//#endregion
|
|
449
|
+
//#region src/shared/hmrHandler.ts
|
|
450
|
+
function createHMRHandler(handler) {
|
|
451
|
+
const queue = new Queue();
|
|
452
|
+
return (payload) => queue.enqueue(() => handler(payload));
|
|
453
|
+
}
|
|
454
|
+
var Queue = class {
|
|
455
|
+
constructor() {
|
|
456
|
+
_defineProperty(this, "queue", []);
|
|
457
|
+
_defineProperty(this, "pending", false);
|
|
458
|
+
}
|
|
459
|
+
enqueue(promise) {
|
|
460
|
+
return new Promise((resolve, reject) => {
|
|
461
|
+
this.queue.push({
|
|
462
|
+
promise,
|
|
463
|
+
resolve,
|
|
464
|
+
reject
|
|
465
|
+
});
|
|
466
|
+
this.dequeue();
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
dequeue() {
|
|
470
|
+
if (this.pending) return false;
|
|
471
|
+
const item = this.queue.shift();
|
|
472
|
+
if (!item) return false;
|
|
473
|
+
this.pending = true;
|
|
474
|
+
item.promise().then(item.resolve).catch(item.reject).finally(() => {
|
|
475
|
+
this.pending = false;
|
|
476
|
+
this.dequeue();
|
|
477
|
+
});
|
|
478
|
+
return true;
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
//#endregion
|
|
482
|
+
//#region src/shared/forwardConsole.ts
|
|
483
|
+
function setupForwardConsoleHandler(transport, options, console = globalThis.console) {
|
|
484
|
+
if (!options.enabled) return;
|
|
485
|
+
async function sendError(type, error) {
|
|
486
|
+
await transport.send({
|
|
487
|
+
type: "custom",
|
|
488
|
+
event: "vite:forward-console",
|
|
489
|
+
data: {
|
|
490
|
+
type,
|
|
491
|
+
data: {
|
|
492
|
+
name: error?.name || "Unknown Error",
|
|
493
|
+
message: error?.message || String(error),
|
|
494
|
+
stack: error?.stack
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
async function sendLog(level, args) {
|
|
500
|
+
try {
|
|
501
|
+
await transport.send({
|
|
502
|
+
type: "custom",
|
|
503
|
+
event: "vite:forward-console",
|
|
504
|
+
data: {
|
|
505
|
+
type: "log",
|
|
506
|
+
data: {
|
|
507
|
+
level,
|
|
508
|
+
message: formatConsoleArgs(args)
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
});
|
|
512
|
+
} catch (err) {
|
|
513
|
+
try {
|
|
514
|
+
await sendError("unhandled-rejection", err);
|
|
515
|
+
} catch (err) {
|
|
516
|
+
if (!(err instanceof SendBeforeConnectError)) originalConsoleError("Failed to send error to Vite server:", err);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
const originalConsoleError = console.error;
|
|
521
|
+
for (const level of options.logLevels) {
|
|
522
|
+
const original = console[level];
|
|
523
|
+
if (typeof original !== "function") continue;
|
|
524
|
+
console[level] = (...args) => {
|
|
525
|
+
original(...args);
|
|
526
|
+
sendLog(level, args);
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
if (options.unhandledErrors && typeof window !== "undefined") {
|
|
530
|
+
window.addEventListener("error", async (event) => {
|
|
531
|
+
const error = event.error ?? (event.message ? new Error(event.message) : event);
|
|
532
|
+
try {
|
|
533
|
+
await sendError("error", error);
|
|
534
|
+
} catch (err) {
|
|
535
|
+
if (!(err instanceof SendBeforeConnectError)) originalConsoleError("Failed to send error to Vite server:", err);
|
|
536
|
+
}
|
|
537
|
+
});
|
|
538
|
+
window.addEventListener("unhandledrejection", async (event) => {
|
|
539
|
+
try {
|
|
540
|
+
await sendError("unhandled-rejection", event.reason);
|
|
541
|
+
} catch (err) {
|
|
542
|
+
if (!(err instanceof SendBeforeConnectError)) originalConsoleError("Failed to send error to Vite server:", err);
|
|
543
|
+
}
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
function formatConsoleArgs(args) {
|
|
548
|
+
if (args.length === 0) return "";
|
|
549
|
+
if (typeof args[0] !== "string") return args.map((arg) => stringifyConsoleArg(arg)).join(" ");
|
|
550
|
+
const len = args.length;
|
|
551
|
+
let i = 1;
|
|
552
|
+
let message = args[0].replace(/%[sdjifoOc%]/g, (specifier) => {
|
|
553
|
+
if (specifier === "%%") return "%";
|
|
554
|
+
if (i >= len) return specifier;
|
|
555
|
+
const arg = args[i++];
|
|
556
|
+
switch (specifier) {
|
|
557
|
+
case "%s":
|
|
558
|
+
if (typeof arg === "bigint") return `${arg.toString()}n`;
|
|
559
|
+
return typeof arg === "object" && arg != null ? stringifyConsoleArg(arg) : String(arg);
|
|
560
|
+
case "%d":
|
|
561
|
+
if (typeof arg === "bigint") return `${arg.toString()}n`;
|
|
562
|
+
if (typeof arg === "symbol") return "NaN";
|
|
563
|
+
return Number(arg).toString();
|
|
564
|
+
case "%i":
|
|
565
|
+
if (typeof arg === "bigint") return `${arg.toString()}n`;
|
|
566
|
+
return Number.parseInt(String(arg), 10).toString();
|
|
567
|
+
case "%f": return Number.parseFloat(String(arg)).toString();
|
|
568
|
+
case "%o":
|
|
569
|
+
case "%O": return stringifyConsoleArg(arg);
|
|
570
|
+
case "%j": try {
|
|
571
|
+
return JSON.stringify(arg) ?? "undefined";
|
|
572
|
+
} catch {
|
|
573
|
+
return "[Circular]";
|
|
574
|
+
}
|
|
575
|
+
case "%c": return "";
|
|
576
|
+
default: return specifier;
|
|
577
|
+
}
|
|
578
|
+
});
|
|
579
|
+
for (let arg = args[i]; i < len; arg = args[++i]) if (arg == null || typeof arg !== "object") message += ` ${typeof arg === "symbol" ? arg.toString() : String(arg)}`;
|
|
580
|
+
else message += ` ${stringifyConsoleArg(arg)}`;
|
|
581
|
+
return message;
|
|
582
|
+
}
|
|
583
|
+
function stringifyConsoleArg(value) {
|
|
584
|
+
if (typeof value === "string") return value;
|
|
585
|
+
if (typeof value === "number" || typeof value === "boolean" || typeof value === "undefined") return String(value);
|
|
586
|
+
if (typeof value === "symbol") return value.toString();
|
|
587
|
+
if (typeof value === "function") return value.name ? `[Function: ${value.name}]` : "[Function]";
|
|
588
|
+
if (value instanceof Error) return value.stack || `${value.name}: ${value.message}`;
|
|
589
|
+
if (typeof value === "bigint") return `${value}n`;
|
|
590
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
591
|
+
try {
|
|
592
|
+
return JSON.stringify(value, (_, nested) => {
|
|
593
|
+
if (typeof nested === "bigint") return `${nested}n`;
|
|
594
|
+
if (nested instanceof Error) return {
|
|
595
|
+
name: nested.name,
|
|
596
|
+
message: nested.message,
|
|
597
|
+
stack: nested.stack
|
|
598
|
+
};
|
|
599
|
+
if (nested && typeof nested === "object") {
|
|
600
|
+
if (seen.has(nested)) return "[Circular]";
|
|
601
|
+
seen.add(nested);
|
|
602
|
+
}
|
|
603
|
+
return nested;
|
|
604
|
+
}) ?? String(value);
|
|
605
|
+
} catch {
|
|
606
|
+
return String(value);
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
//#endregion
|
|
610
|
+
//#region src/client/overlay.ts
|
|
611
|
+
const hmrConfigName = __HMR_CONFIG_NAME__;
|
|
612
|
+
const base$1 = __BASE__ || "/";
|
|
613
|
+
const cspNonce = "document" in globalThis ? document.querySelector("meta[property=csp-nonce]")?.nonce : void 0;
|
|
614
|
+
function h(e, attrs = {}, ...children) {
|
|
615
|
+
const elem = document.createElement(e);
|
|
616
|
+
for (const [k, v] of Object.entries(attrs)) if (v !== void 0) elem.setAttribute(k, v);
|
|
617
|
+
elem.append(...children);
|
|
618
|
+
return elem;
|
|
619
|
+
}
|
|
620
|
+
const templateStyle = `
|
|
621
|
+
:host {
|
|
622
|
+
position: fixed;
|
|
623
|
+
top: 0;
|
|
624
|
+
left: 0;
|
|
625
|
+
width: 100%;
|
|
626
|
+
height: 100%;
|
|
627
|
+
z-index: 99999;
|
|
628
|
+
--monospace: 'SFMono-Regular', Consolas,
|
|
629
|
+
'Liberation Mono', Menlo, Courier, monospace;
|
|
630
|
+
--red: #ff5555;
|
|
631
|
+
--yellow: #e2aa53;
|
|
632
|
+
--purple: #cfa4ff;
|
|
633
|
+
--cyan: #2dd9da;
|
|
634
|
+
--dim: #c9c9c9;
|
|
635
|
+
|
|
636
|
+
--window-background: #181818;
|
|
637
|
+
--window-color: #d8d8d8;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
.backdrop {
|
|
641
|
+
position: fixed;
|
|
642
|
+
z-index: 99999;
|
|
643
|
+
top: 0;
|
|
644
|
+
left: 0;
|
|
645
|
+
width: 100%;
|
|
646
|
+
height: 100%;
|
|
647
|
+
overflow-y: scroll;
|
|
648
|
+
margin: 0;
|
|
649
|
+
background: rgba(0, 0, 0, 0.66);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
.window {
|
|
653
|
+
font-family: var(--monospace);
|
|
654
|
+
line-height: 1.5;
|
|
655
|
+
max-width: 80vw;
|
|
656
|
+
color: var(--window-color);
|
|
657
|
+
box-sizing: border-box;
|
|
658
|
+
margin: 30px auto;
|
|
659
|
+
padding: 2.5vh 4vw;
|
|
660
|
+
position: relative;
|
|
661
|
+
background: var(--window-background);
|
|
662
|
+
border-radius: 6px 6px 8px 8px;
|
|
663
|
+
box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);
|
|
664
|
+
overflow: hidden;
|
|
665
|
+
border-top: 8px solid var(--red);
|
|
666
|
+
direction: ltr;
|
|
667
|
+
text-align: left;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
pre {
|
|
671
|
+
font-family: var(--monospace);
|
|
672
|
+
font-size: 16px;
|
|
673
|
+
margin-top: 0;
|
|
674
|
+
margin-bottom: 1em;
|
|
675
|
+
overflow-x: scroll;
|
|
676
|
+
scrollbar-width: none;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
pre::-webkit-scrollbar {
|
|
680
|
+
display: none;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
pre.frame::-webkit-scrollbar {
|
|
684
|
+
display: block;
|
|
685
|
+
height: 5px;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
pre.frame::-webkit-scrollbar-thumb {
|
|
689
|
+
background: #999;
|
|
690
|
+
border-radius: 5px;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
pre.frame {
|
|
694
|
+
scrollbar-width: thin;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
.message {
|
|
698
|
+
line-height: 1.3;
|
|
699
|
+
font-weight: 600;
|
|
700
|
+
white-space: pre-wrap;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
.message-body {
|
|
704
|
+
color: var(--red);
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
.plugin {
|
|
708
|
+
color: var(--purple);
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
.file {
|
|
712
|
+
color: var(--cyan);
|
|
713
|
+
margin-bottom: 0;
|
|
714
|
+
white-space: pre-wrap;
|
|
715
|
+
word-break: break-all;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
.frame {
|
|
719
|
+
color: var(--yellow);
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
.stack {
|
|
723
|
+
font-size: 13px;
|
|
724
|
+
color: var(--dim);
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
.tip {
|
|
728
|
+
font-size: 13px;
|
|
729
|
+
color: #999;
|
|
730
|
+
border-top: 1px dotted #999;
|
|
731
|
+
padding-top: 13px;
|
|
732
|
+
line-height: 1.8;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
code {
|
|
736
|
+
font-size: 13px;
|
|
737
|
+
font-family: var(--monospace);
|
|
738
|
+
color: var(--yellow);
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
.file-link {
|
|
742
|
+
text-decoration: underline;
|
|
743
|
+
cursor: pointer;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
kbd {
|
|
747
|
+
line-height: 1.5;
|
|
748
|
+
font-family: ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
|
749
|
+
font-size: 0.75rem;
|
|
750
|
+
font-weight: 700;
|
|
751
|
+
background-color: rgb(38, 40, 44);
|
|
752
|
+
color: rgb(166, 167, 171);
|
|
753
|
+
padding: 0.15rem 0.3rem;
|
|
754
|
+
border-radius: 0.25rem;
|
|
755
|
+
border-width: 0.0625rem 0.0625rem 0.1875rem;
|
|
756
|
+
border-style: solid;
|
|
757
|
+
border-color: rgb(54, 57, 64);
|
|
758
|
+
border-image: initial;
|
|
759
|
+
}
|
|
760
|
+
`;
|
|
761
|
+
const createTemplate = () => h("div", {
|
|
762
|
+
class: "backdrop",
|
|
763
|
+
part: "backdrop"
|
|
764
|
+
}, h("div", {
|
|
765
|
+
class: "window",
|
|
766
|
+
part: "window"
|
|
767
|
+
}, h("pre", {
|
|
768
|
+
class: "message",
|
|
769
|
+
part: "message"
|
|
770
|
+
}, h("span", {
|
|
771
|
+
class: "plugin",
|
|
772
|
+
part: "plugin"
|
|
773
|
+
}), h("span", {
|
|
774
|
+
class: "message-body",
|
|
775
|
+
part: "message-body"
|
|
776
|
+
})), h("pre", {
|
|
777
|
+
class: "file",
|
|
778
|
+
part: "file"
|
|
779
|
+
}), h("pre", {
|
|
780
|
+
class: "frame",
|
|
781
|
+
part: "frame"
|
|
782
|
+
}), h("pre", {
|
|
783
|
+
class: "stack",
|
|
784
|
+
part: "stack"
|
|
785
|
+
}), h("div", {
|
|
786
|
+
class: "tip",
|
|
787
|
+
part: "tip"
|
|
788
|
+
}, "Click outside, press ", h("kbd", {}, "Esc"), " key, or fix the code to dismiss.", h("br"), "You can also disable this overlay by setting ", h("code", { part: "config-option-name" }, "server.hmr.overlay"), " to ", h("code", { part: "config-option-value" }, "false"), " in ", h("code", { part: "config-file-name" }, hmrConfigName), ".")), h("style", { nonce: cspNonce }, templateStyle));
|
|
789
|
+
const fileRE = /(?:file:\/\/)?(?:[a-zA-Z]:\\|\/).*?:\d+:\d+/g;
|
|
790
|
+
const codeframeRE = /^(?:>?\s*\d+\s+\|.*|\s+\|\s*\^.*)\r?\n/gm;
|
|
791
|
+
const { HTMLElement = class {} } = globalThis;
|
|
792
|
+
var ErrorOverlay = class extends HTMLElement {
|
|
793
|
+
constructor(err, links = true) {
|
|
794
|
+
super();
|
|
795
|
+
this.root = this.attachShadow({ mode: "open" });
|
|
796
|
+
this.root.appendChild(createTemplate());
|
|
797
|
+
codeframeRE.lastIndex = 0;
|
|
798
|
+
const hasFrame = err.frame && codeframeRE.test(err.frame);
|
|
799
|
+
const message = hasFrame ? err.message.replace(codeframeRE, "") : err.message;
|
|
800
|
+
if (err.plugin) this.text(".plugin", `[plugin:${err.plugin}] `);
|
|
801
|
+
this.text(".message-body", message.trim());
|
|
802
|
+
const [file] = (err.loc?.file || err.id || "unknown file").split(`?`);
|
|
803
|
+
if (err.loc) this.text(".file", `${file}:${err.loc.line}:${err.loc.column}`, links);
|
|
804
|
+
else if (err.id) this.text(".file", file);
|
|
805
|
+
if (hasFrame) this.text(".frame", err.frame.trim());
|
|
806
|
+
this.text(".stack", err.stack, links);
|
|
807
|
+
this.root.querySelector(".window").addEventListener("click", (e) => {
|
|
808
|
+
e.stopPropagation();
|
|
809
|
+
});
|
|
810
|
+
this.addEventListener("click", () => {
|
|
811
|
+
this.close();
|
|
812
|
+
});
|
|
813
|
+
this.closeOnEsc = (e) => {
|
|
814
|
+
if (e.key === "Escape" || e.code === "Escape") this.close();
|
|
815
|
+
};
|
|
816
|
+
document.addEventListener("keydown", this.closeOnEsc);
|
|
817
|
+
}
|
|
818
|
+
text(selector, text, linkFiles = false) {
|
|
819
|
+
const el = this.root.querySelector(selector);
|
|
820
|
+
if (!linkFiles) el.textContent = text;
|
|
821
|
+
else {
|
|
822
|
+
let curIndex = 0;
|
|
823
|
+
let match;
|
|
824
|
+
fileRE.lastIndex = 0;
|
|
825
|
+
while (match = fileRE.exec(text)) {
|
|
826
|
+
const { 0: file, index } = match;
|
|
827
|
+
const frag = text.slice(curIndex, index);
|
|
828
|
+
el.appendChild(document.createTextNode(frag));
|
|
829
|
+
const link = document.createElement("a");
|
|
830
|
+
link.textContent = file;
|
|
831
|
+
link.className = "file-link";
|
|
832
|
+
link.onclick = () => {
|
|
833
|
+
fetch(new URL(`${base$1}__open-in-editor?file=${encodeURIComponent(file)}`, import.meta.url));
|
|
834
|
+
};
|
|
835
|
+
el.appendChild(link);
|
|
836
|
+
curIndex += frag.length + file.length;
|
|
837
|
+
}
|
|
838
|
+
if (curIndex < text.length) el.appendChild(document.createTextNode(text.slice(curIndex)));
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
close() {
|
|
842
|
+
this.parentNode?.removeChild(this);
|
|
843
|
+
document.removeEventListener("keydown", this.closeOnEsc);
|
|
844
|
+
}
|
|
845
|
+
};
|
|
846
|
+
const overlayId = "vite-error-overlay";
|
|
847
|
+
const { customElements } = globalThis;
|
|
848
|
+
if (customElements && !customElements.get("vite-error-overlay")) customElements.define(overlayId, ErrorOverlay);
|
|
849
|
+
//#endregion
|
|
850
|
+
//#region src/client/client.ts
|
|
851
|
+
console.debug("[vite] connecting...");
|
|
852
|
+
const importMetaUrl = new URL(import.meta.url);
|
|
853
|
+
const serverHost = __SERVER_HOST__;
|
|
854
|
+
const socketProtocol = __HMR_PROTOCOL__ || (importMetaUrl.protocol === "https:" ? "wss" : "ws");
|
|
855
|
+
const hmrPort = __HMR_PORT__;
|
|
856
|
+
const socketHost = `${__HMR_HOSTNAME__ || importMetaUrl.hostname}:${hmrPort || importMetaUrl.port}${__HMR_BASE__}`;
|
|
857
|
+
const directSocketHost = __HMR_DIRECT_TARGET__;
|
|
858
|
+
const base = __BASE__ || "/";
|
|
859
|
+
const hmrTimeout = __HMR_TIMEOUT__;
|
|
860
|
+
const wsToken = __WS_TOKEN__;
|
|
861
|
+
const isBundleMode = __BUNDLED_DEV__;
|
|
862
|
+
const forwardConsole = __SERVER_FORWARD_CONSOLE__;
|
|
863
|
+
const transport = normalizeModuleRunnerTransport((() => {
|
|
864
|
+
let wsTransport = createWebSocketModuleRunnerTransport({
|
|
865
|
+
createConnection: () => new WebSocket(`${socketProtocol}://${socketHost}?token=${wsToken}`, "vite-hmr"),
|
|
866
|
+
pingInterval: hmrTimeout
|
|
867
|
+
});
|
|
868
|
+
return {
|
|
869
|
+
async connect(handlers) {
|
|
870
|
+
try {
|
|
871
|
+
await wsTransport.connect(handlers);
|
|
872
|
+
} catch (e) {
|
|
873
|
+
if (!hmrPort) {
|
|
874
|
+
wsTransport = createWebSocketModuleRunnerTransport({
|
|
875
|
+
createConnection: () => new WebSocket(`${socketProtocol}://${directSocketHost}?token=${wsToken}`, "vite-hmr"),
|
|
876
|
+
pingInterval: hmrTimeout
|
|
877
|
+
});
|
|
878
|
+
try {
|
|
879
|
+
await wsTransport.connect(handlers);
|
|
880
|
+
console.info("[vite] Direct websocket connection fallback. Check out https://vite.dev/config/server-options.html#server-hmr to remove the previous connection error.");
|
|
881
|
+
} catch (e) {
|
|
882
|
+
if (e instanceof Error && e.message.includes("WebSocket closed without opened.")) {
|
|
883
|
+
const currentScriptHostURL = new URL(import.meta.url);
|
|
884
|
+
const currentScriptHost = currentScriptHostURL.host + currentScriptHostURL.pathname.replace(/@vite\/client$/, "");
|
|
885
|
+
console.error(`[vite] failed to connect to websocket.
|
|
886
|
+
your current setup:
|
|
887
|
+
(browser) ${currentScriptHost} <--[HTTP]--> ${serverHost} (server)\n (browser) ${socketHost} <--[WebSocket (failing)]--> ${directSocketHost} (server)\nCheck out your Vite / network configuration and https://vite.dev/config/server-options.html#server-hmr .`);
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
return;
|
|
891
|
+
}
|
|
892
|
+
console.error(`[vite] failed to connect to websocket (${e}). `);
|
|
893
|
+
throw e;
|
|
894
|
+
}
|
|
895
|
+
},
|
|
896
|
+
async disconnect() {
|
|
897
|
+
await wsTransport.disconnect();
|
|
898
|
+
},
|
|
899
|
+
send(data) {
|
|
900
|
+
wsTransport.send(data);
|
|
901
|
+
}
|
|
902
|
+
};
|
|
903
|
+
})());
|
|
904
|
+
let willUnload = false;
|
|
905
|
+
if (typeof window !== "undefined") window.addEventListener?.("beforeunload", () => {
|
|
906
|
+
willUnload = true;
|
|
907
|
+
});
|
|
908
|
+
function cleanUrl(pathname) {
|
|
909
|
+
const url = new URL(pathname, "http://vite.dev");
|
|
910
|
+
url.searchParams.delete("direct");
|
|
911
|
+
return url.pathname + url.search;
|
|
912
|
+
}
|
|
913
|
+
let isFirstUpdate = true;
|
|
914
|
+
const outdatedLinkTags = /* @__PURE__ */ new WeakSet();
|
|
915
|
+
const debounceReload = (time) => {
|
|
916
|
+
let timer;
|
|
917
|
+
return () => {
|
|
918
|
+
if (timer) {
|
|
919
|
+
clearTimeout(timer);
|
|
920
|
+
timer = null;
|
|
921
|
+
}
|
|
922
|
+
timer = setTimeout(() => {
|
|
923
|
+
location.reload();
|
|
924
|
+
}, time);
|
|
925
|
+
};
|
|
926
|
+
};
|
|
927
|
+
const pageReload = debounceReload(20);
|
|
928
|
+
const hmrClient = new HMRClient({
|
|
929
|
+
error: (err) => console.error("[vite]", err),
|
|
930
|
+
debug: (...msg) => console.debug("[vite]", ...msg)
|
|
931
|
+
}, transport, isBundleMode ? async function importUpdatedModule({ url, acceptedPath, isWithinCircularImport }) {
|
|
932
|
+
const importPromise = import(base + url).then(() => globalThis.__rolldown_runtime__.loadExports(acceptedPath));
|
|
933
|
+
if (isWithinCircularImport) importPromise.catch(() => {
|
|
934
|
+
console.info(`[hmr] ${acceptedPath} failed to apply HMR as it's within a circular import. Reloading page to reset the execution order. To debug and break the circular import, you can run \`vite --debug hmr\` to log the circular dependency path if a file change triggered it.`);
|
|
935
|
+
pageReload();
|
|
936
|
+
});
|
|
937
|
+
return await importPromise;
|
|
938
|
+
} : async function importUpdatedModule({ acceptedPath, timestamp, explicitImportRequired, isWithinCircularImport }) {
|
|
939
|
+
const [acceptedPathWithoutQuery, query] = acceptedPath.split(`?`);
|
|
940
|
+
const importPromise = import(
|
|
941
|
+
/* @vite-ignore */
|
|
942
|
+
base + acceptedPathWithoutQuery.slice(1) + `?${explicitImportRequired ? "import&" : ""}t=${timestamp}${query ? `&${query}` : ""}`
|
|
943
|
+
);
|
|
944
|
+
if (isWithinCircularImport) importPromise.catch(() => {
|
|
945
|
+
console.info(`[hmr] ${acceptedPath} failed to apply HMR as it's within a circular import. Reloading page to reset the execution order. To debug and break the circular import, you can run \`vite --debug hmr\` to log the circular dependency path if a file change triggered it.`);
|
|
946
|
+
pageReload();
|
|
947
|
+
});
|
|
948
|
+
return await importPromise;
|
|
949
|
+
});
|
|
950
|
+
transport.connect(createHMRHandler(handleMessage));
|
|
951
|
+
setupForwardConsoleHandler(transport, forwardConsole);
|
|
952
|
+
async function handleMessage(payload) {
|
|
953
|
+
switch (payload.type) {
|
|
954
|
+
case "connected":
|
|
955
|
+
console.debug(`[vite] connected.`);
|
|
956
|
+
break;
|
|
957
|
+
case "update":
|
|
958
|
+
await hmrClient.notifyListeners("vite:beforeUpdate", payload);
|
|
959
|
+
if (hasDocument) if (isFirstUpdate && hasErrorOverlay()) {
|
|
960
|
+
location.reload();
|
|
961
|
+
return;
|
|
962
|
+
} else {
|
|
963
|
+
if (enableOverlay) clearErrorOverlay();
|
|
964
|
+
isFirstUpdate = false;
|
|
965
|
+
}
|
|
966
|
+
await Promise.all(payload.updates.map(async (update) => {
|
|
967
|
+
if (update.type === "js-update") return hmrClient.queueUpdate(update);
|
|
968
|
+
const { path, timestamp } = update;
|
|
969
|
+
const searchUrl = cleanUrl(path);
|
|
970
|
+
const el = Array.from(document.querySelectorAll("link")).find((e) => !outdatedLinkTags.has(e) && cleanUrl(e.href).includes(searchUrl));
|
|
971
|
+
if (!el) return;
|
|
972
|
+
const newPath = `${base}${searchUrl.slice(1)}${searchUrl.includes("?") ? "&" : "?"}t=${timestamp}`;
|
|
973
|
+
return new Promise((resolve) => {
|
|
974
|
+
const newLinkTag = el.cloneNode();
|
|
975
|
+
newLinkTag.href = new URL(newPath, el.href).href;
|
|
976
|
+
const removeOldEl = () => {
|
|
977
|
+
el.remove();
|
|
978
|
+
console.debug(`[vite] css hot updated: ${searchUrl}`);
|
|
979
|
+
resolve();
|
|
980
|
+
};
|
|
981
|
+
newLinkTag.addEventListener("load", removeOldEl);
|
|
982
|
+
newLinkTag.addEventListener("error", removeOldEl);
|
|
983
|
+
outdatedLinkTags.add(el);
|
|
984
|
+
el.after(newLinkTag);
|
|
985
|
+
});
|
|
986
|
+
}));
|
|
987
|
+
await hmrClient.notifyListeners("vite:afterUpdate", payload);
|
|
988
|
+
break;
|
|
989
|
+
case "custom":
|
|
990
|
+
await hmrClient.notifyListeners(payload.event, payload.data);
|
|
991
|
+
if (payload.event === "vite:ws:disconnect") {
|
|
992
|
+
if (hasDocument && !willUnload) {
|
|
993
|
+
console.log(`[vite] server connection lost. Polling for restart...`);
|
|
994
|
+
const socket = payload.data.webSocket;
|
|
995
|
+
const url = new URL(socket.url);
|
|
996
|
+
url.search = "";
|
|
997
|
+
await waitForSuccessfulPing(url.href);
|
|
998
|
+
location.reload();
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
break;
|
|
1002
|
+
case "full-reload":
|
|
1003
|
+
await hmrClient.notifyListeners("vite:beforeFullReload", payload);
|
|
1004
|
+
if (hasDocument) if (payload.path && payload.path.endsWith(".html")) {
|
|
1005
|
+
const pagePath = decodeURI(location.pathname);
|
|
1006
|
+
const payloadPath = base + payload.path.slice(1);
|
|
1007
|
+
if (pagePath === payloadPath || payload.path === "/index.html" || pagePath.endsWith("/") && pagePath + "index.html" === payloadPath) pageReload();
|
|
1008
|
+
return;
|
|
1009
|
+
} else pageReload();
|
|
1010
|
+
break;
|
|
1011
|
+
case "prune":
|
|
1012
|
+
await hmrClient.notifyListeners("vite:beforePrune", payload);
|
|
1013
|
+
await hmrClient.prunePaths(payload.paths);
|
|
1014
|
+
break;
|
|
1015
|
+
case "error":
|
|
1016
|
+
await hmrClient.notifyListeners("vite:error", payload);
|
|
1017
|
+
if (hasDocument) {
|
|
1018
|
+
const err = payload.err;
|
|
1019
|
+
if (enableOverlay) createErrorOverlay(err);
|
|
1020
|
+
else console.error(`[vite] Internal Server Error\n${err.message}\n${err.stack}`);
|
|
1021
|
+
}
|
|
1022
|
+
break;
|
|
1023
|
+
case "ping": break;
|
|
1024
|
+
default: return payload;
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
const enableOverlay = __HMR_ENABLE_OVERLAY__;
|
|
1028
|
+
const hasDocument = "document" in globalThis;
|
|
1029
|
+
function createErrorOverlay(err) {
|
|
1030
|
+
clearErrorOverlay();
|
|
1031
|
+
const { customElements } = globalThis;
|
|
1032
|
+
if (customElements) {
|
|
1033
|
+
const ErrorOverlayConstructor = customElements.get(overlayId);
|
|
1034
|
+
document.body.appendChild(new ErrorOverlayConstructor(err));
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
function clearErrorOverlay() {
|
|
1038
|
+
document.querySelectorAll(overlayId).forEach((n) => n.close());
|
|
1039
|
+
}
|
|
1040
|
+
function hasErrorOverlay() {
|
|
1041
|
+
return document.querySelectorAll(overlayId).length;
|
|
1042
|
+
}
|
|
1043
|
+
function waitForSuccessfulPing(socketUrl) {
|
|
1044
|
+
if (typeof SharedWorker === "undefined") {
|
|
1045
|
+
const visibilityManager = {
|
|
1046
|
+
currentState: document.visibilityState,
|
|
1047
|
+
listeners: /* @__PURE__ */ new Set()
|
|
1048
|
+
};
|
|
1049
|
+
const onVisibilityChange = () => {
|
|
1050
|
+
visibilityManager.currentState = document.visibilityState;
|
|
1051
|
+
for (const listener of visibilityManager.listeners) listener(visibilityManager.currentState);
|
|
1052
|
+
};
|
|
1053
|
+
document.addEventListener("visibilitychange", onVisibilityChange);
|
|
1054
|
+
return waitForSuccessfulPingInternal(socketUrl, visibilityManager);
|
|
1055
|
+
}
|
|
1056
|
+
const blob = new Blob([
|
|
1057
|
+
"\"use strict\";",
|
|
1058
|
+
`const waitForSuccessfulPingInternal = ${waitForSuccessfulPingInternal.toString()};`,
|
|
1059
|
+
`const fn = ${pingWorkerContentMain.toString()};`,
|
|
1060
|
+
`fn(${JSON.stringify(socketUrl)})`
|
|
1061
|
+
], { type: "application/javascript" });
|
|
1062
|
+
const objURL = URL.createObjectURL(blob);
|
|
1063
|
+
const sharedWorker = new SharedWorker(objURL);
|
|
1064
|
+
return new Promise((resolve, reject) => {
|
|
1065
|
+
const onVisibilityChange = () => {
|
|
1066
|
+
sharedWorker.port.postMessage({ visibility: document.visibilityState });
|
|
1067
|
+
};
|
|
1068
|
+
document.addEventListener("visibilitychange", onVisibilityChange);
|
|
1069
|
+
sharedWorker.port.addEventListener("message", (event) => {
|
|
1070
|
+
document.removeEventListener("visibilitychange", onVisibilityChange);
|
|
1071
|
+
sharedWorker.port.close();
|
|
1072
|
+
const data = event.data;
|
|
1073
|
+
if (data.type === "error") {
|
|
1074
|
+
reject(data.error);
|
|
1075
|
+
return;
|
|
1076
|
+
}
|
|
1077
|
+
resolve();
|
|
1078
|
+
});
|
|
1079
|
+
onVisibilityChange();
|
|
1080
|
+
sharedWorker.port.start();
|
|
1081
|
+
});
|
|
1082
|
+
}
|
|
1083
|
+
function pingWorkerContentMain(socketUrl) {
|
|
1084
|
+
self.addEventListener("connect", (_event) => {
|
|
1085
|
+
const port = _event.ports[0];
|
|
1086
|
+
if (!socketUrl) {
|
|
1087
|
+
port.postMessage({
|
|
1088
|
+
type: "error",
|
|
1089
|
+
error: /* @__PURE__ */ new Error("socketUrl not found")
|
|
1090
|
+
});
|
|
1091
|
+
return;
|
|
1092
|
+
}
|
|
1093
|
+
const visibilityManager = {
|
|
1094
|
+
currentState: "visible",
|
|
1095
|
+
listeners: /* @__PURE__ */ new Set()
|
|
1096
|
+
};
|
|
1097
|
+
port.addEventListener("message", (event) => {
|
|
1098
|
+
const { visibility } = event.data;
|
|
1099
|
+
visibilityManager.currentState = visibility;
|
|
1100
|
+
console.debug("[vite] new window visibility", visibility);
|
|
1101
|
+
for (const listener of visibilityManager.listeners) listener(visibility);
|
|
1102
|
+
});
|
|
1103
|
+
port.start();
|
|
1104
|
+
console.debug("[vite] connected from window");
|
|
1105
|
+
waitForSuccessfulPingInternal(socketUrl, visibilityManager).then(() => {
|
|
1106
|
+
console.debug("[vite] ping successful");
|
|
1107
|
+
try {
|
|
1108
|
+
port.postMessage({ type: "success" });
|
|
1109
|
+
} catch (error) {
|
|
1110
|
+
port.postMessage({
|
|
1111
|
+
type: "error",
|
|
1112
|
+
error
|
|
1113
|
+
});
|
|
1114
|
+
}
|
|
1115
|
+
}, (error) => {
|
|
1116
|
+
console.debug("[vite] error happened", error);
|
|
1117
|
+
try {
|
|
1118
|
+
port.postMessage({
|
|
1119
|
+
type: "error",
|
|
1120
|
+
error
|
|
1121
|
+
});
|
|
1122
|
+
} catch (error) {
|
|
1123
|
+
port.postMessage({
|
|
1124
|
+
type: "error",
|
|
1125
|
+
error
|
|
1126
|
+
});
|
|
1127
|
+
}
|
|
1128
|
+
});
|
|
1129
|
+
});
|
|
1130
|
+
}
|
|
1131
|
+
async function waitForSuccessfulPingInternal(socketUrl, visibilityManager, ms = 1e3) {
|
|
1132
|
+
function wait(ms) {
|
|
1133
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
1134
|
+
}
|
|
1135
|
+
async function ping() {
|
|
1136
|
+
try {
|
|
1137
|
+
const socket = new WebSocket(socketUrl, "vite-ping");
|
|
1138
|
+
return new Promise((resolve) => {
|
|
1139
|
+
function onOpen() {
|
|
1140
|
+
resolve(true);
|
|
1141
|
+
close();
|
|
1142
|
+
}
|
|
1143
|
+
function onError() {
|
|
1144
|
+
resolve(false);
|
|
1145
|
+
close();
|
|
1146
|
+
}
|
|
1147
|
+
function close() {
|
|
1148
|
+
socket.removeEventListener("open", onOpen);
|
|
1149
|
+
socket.removeEventListener("error", onError);
|
|
1150
|
+
socket.close();
|
|
1151
|
+
}
|
|
1152
|
+
socket.addEventListener("open", onOpen);
|
|
1153
|
+
socket.addEventListener("error", onError);
|
|
1154
|
+
});
|
|
1155
|
+
} catch {
|
|
1156
|
+
return false;
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
function waitForWindowShow(visibilityManager) {
|
|
1160
|
+
return new Promise((resolve) => {
|
|
1161
|
+
const onChange = (newVisibility) => {
|
|
1162
|
+
if (newVisibility === "visible") {
|
|
1163
|
+
resolve();
|
|
1164
|
+
visibilityManager.listeners.delete(onChange);
|
|
1165
|
+
}
|
|
1166
|
+
};
|
|
1167
|
+
visibilityManager.listeners.add(onChange);
|
|
1168
|
+
});
|
|
1169
|
+
}
|
|
1170
|
+
if (await ping()) return;
|
|
1171
|
+
await wait(ms);
|
|
1172
|
+
while (true) if (visibilityManager.currentState === "visible") {
|
|
1173
|
+
if (await ping()) break;
|
|
1174
|
+
await wait(ms);
|
|
1175
|
+
} else await waitForWindowShow(visibilityManager);
|
|
1176
|
+
}
|
|
1177
|
+
const sheetsMap = /* @__PURE__ */ new Map();
|
|
1178
|
+
const linkSheetsMap = /* @__PURE__ */ new Map();
|
|
1179
|
+
if ("document" in globalThis) {
|
|
1180
|
+
document.querySelectorAll("style[data-vite-dev-id]").forEach((el) => {
|
|
1181
|
+
sheetsMap.set(el.getAttribute("data-vite-dev-id"), el);
|
|
1182
|
+
});
|
|
1183
|
+
document.querySelectorAll("link[rel=\"stylesheet\"][data-vite-dev-id]").forEach((el) => {
|
|
1184
|
+
linkSheetsMap.set(el.getAttribute("data-vite-dev-id"), el);
|
|
1185
|
+
});
|
|
1186
|
+
}
|
|
1187
|
+
let lastInsertedStyle;
|
|
1188
|
+
function updateStyle(id, content) {
|
|
1189
|
+
if (linkSheetsMap.has(id)) return;
|
|
1190
|
+
let style = sheetsMap.get(id);
|
|
1191
|
+
if (!style) {
|
|
1192
|
+
style = document.createElement("style");
|
|
1193
|
+
style.setAttribute("type", "text/css");
|
|
1194
|
+
style.setAttribute("data-vite-dev-id", id);
|
|
1195
|
+
style.textContent = content;
|
|
1196
|
+
if (cspNonce) style.setAttribute("nonce", cspNonce);
|
|
1197
|
+
if (!lastInsertedStyle) {
|
|
1198
|
+
document.head.appendChild(style);
|
|
1199
|
+
setTimeout(() => {
|
|
1200
|
+
lastInsertedStyle = void 0;
|
|
1201
|
+
}, 0);
|
|
1202
|
+
} else lastInsertedStyle.insertAdjacentElement("afterend", style);
|
|
1203
|
+
lastInsertedStyle = style;
|
|
1204
|
+
} else style.textContent = content;
|
|
1205
|
+
sheetsMap.set(id, style);
|
|
1206
|
+
}
|
|
1207
|
+
function removeStyle(id) {
|
|
1208
|
+
if (linkSheetsMap.has(id)) {
|
|
1209
|
+
document.querySelectorAll(`link[rel="stylesheet"][data-vite-dev-id="${CSS.escape(id)}"]`).forEach((el) => el.remove());
|
|
1210
|
+
linkSheetsMap.delete(id);
|
|
1211
|
+
}
|
|
1212
|
+
const style = sheetsMap.get(id);
|
|
1213
|
+
if (style) {
|
|
1214
|
+
document.head.removeChild(style);
|
|
1215
|
+
sheetsMap.delete(id);
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
function createHotContext(ownerPath) {
|
|
1219
|
+
return new HMRContext(hmrClient, ownerPath);
|
|
1220
|
+
}
|
|
1221
|
+
/**
|
|
1222
|
+
* urls here are dynamic import() urls that couldn't be statically analyzed
|
|
1223
|
+
*/
|
|
1224
|
+
function injectQuery(url, queryToInject) {
|
|
1225
|
+
if (url[0] !== "." && url[0] !== "/") return url;
|
|
1226
|
+
const pathname = url.replace(/[?#].*$/, "");
|
|
1227
|
+
const { search, hash } = new URL(url, "http://vite.dev");
|
|
1228
|
+
return `${pathname}?${queryToInject}${search ? `&` + search.slice(1) : ""}${hash || ""}`;
|
|
1229
|
+
}
|
|
1230
|
+
if (isBundleMode && typeof DevRuntime !== "undefined") {
|
|
1231
|
+
var _ref;
|
|
1232
|
+
class ViteDevRuntime extends DevRuntime {
|
|
1233
|
+
createModuleHotContext(moduleId) {
|
|
1234
|
+
const ctx = createHotContext(moduleId);
|
|
1235
|
+
ctx._internal = {
|
|
1236
|
+
updateStyle,
|
|
1237
|
+
removeStyle
|
|
1238
|
+
};
|
|
1239
|
+
return ctx;
|
|
1240
|
+
}
|
|
1241
|
+
applyUpdates(_boundaries) {}
|
|
1242
|
+
}
|
|
1243
|
+
const clientId = nanoid();
|
|
1244
|
+
transport.send({
|
|
1245
|
+
type: "custom",
|
|
1246
|
+
event: "vite:module-loaded",
|
|
1247
|
+
data: {
|
|
1248
|
+
modules: [],
|
|
1249
|
+
clientId
|
|
1250
|
+
}
|
|
1251
|
+
});
|
|
1252
|
+
(_ref = globalThis).__rolldown_runtime__ ?? (_ref.__rolldown_runtime__ = new ViteDevRuntime({ send(message) {
|
|
1253
|
+
switch (message.type) {
|
|
1254
|
+
case "hmr:module-registered":
|
|
1255
|
+
transport.send({
|
|
1256
|
+
type: "custom",
|
|
1257
|
+
event: "vite:module-loaded",
|
|
1258
|
+
data: {
|
|
1259
|
+
modules: message.modules.slice(),
|
|
1260
|
+
clientId
|
|
1261
|
+
}
|
|
1262
|
+
});
|
|
1263
|
+
break;
|
|
1264
|
+
default: throw new Error(`Unknown message type: ${JSON.stringify(message)}`);
|
|
1265
|
+
}
|
|
1266
|
+
} }, clientId));
|
|
1267
|
+
}
|
|
1268
|
+
//#endregion
|
|
1269
|
+
export { ErrorOverlay, createHotContext, injectQuery, removeStyle, updateStyle };
|