@fluentic/style 0.1.0-beta.2 → 0.1.0-beta.20
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/CHANGELOG.md +228 -16
- package/README.md +182 -49
- package/atomic/className.ts +33 -12
- package/atomic/debug/className/className.ts +10 -15
- package/atomic/element.ts +2 -2
- package/atomic/layer/layer.ts +7 -3
- package/atomic/rule.ts +20 -6
- package/atomic/scope.ts +19 -0
- package/atomic/theme.ts +41 -2
- package/atomic/token.ts +13 -3
- package/atomic/utils/{css.ts → cssIdent.ts} +0 -20
- package/atomic/utils/cssVar.ts +19 -0
- package/atomic/utils/debug.ts +1 -1
- package/atomic/utils/hash.ts +1 -65
- package/atomic/utils/selector.ts +40 -1
- package/atomic/utils/types.ts +4 -2
- package/builder/classname/class_name_builder.ts +68 -24
- package/builder/classname/fns.ts +2 -2
- package/builder/classname/types.ts +7 -0
- package/builder/data/const.ts +10 -1
- package/builder/data/create.ts +46 -0
- package/builder/data/data.ts +26 -1
- package/builder/data/index.ts +0 -1
- package/builder/data/is.ts +23 -0
- package/builder/data/merge/scope.ts +27 -19
- package/builder/data/merge/style.ts +115 -46
- package/builder/data/state.ts +17 -2
- package/builder/extract/index.ts +1 -0
- package/builder/extract/sheet.ts +30 -0
- package/builder/extract/token.ts +40 -14
- package/builder/extract/utils.ts +2 -0
- package/builder/extract/withTokens.ts +2 -1
- package/builder/selector_override.noop.ts +11 -0
- package/builder/selector_override.ts +31 -0
- package/builder/selector_override_core.ts +99 -0
- package/builder/style_builder.ts +127 -3
- package/builder/style_data.ts +25 -0
- package/builder/style_fns.ts +24 -24
- package/builder/token/data.ts +30 -0
- package/builder/token/index.ts +3 -0
- package/builder/token/name.ts +54 -0
- package/builder/token/symbols.ts +6 -0
- package/builder/types/alias.ts +34 -6
- package/builder/types/fns.ts +13 -5
- package/builder/types/types.ts +32 -2
- package/builder/utils.ts +1 -0
- package/compiler/compiler/cache_identity.ts +115 -0
- package/compiler/compiler/compiler.ts +123 -18
- package/compiler/compiler/constants.ts +6 -0
- package/compiler/compiler/index.ts +1 -0
- package/compiler/compiler/persistent_cache.ts +310 -0
- package/compiler/compiler/types.ts +16 -1
- package/compiler/cssProp.ts +21 -0
- package/compiler/extract/collector.ts +2 -2
- package/compiler/extract/extract.ts +24 -45
- package/compiler/extract/types.ts +6 -0
- package/compiler/index.ts +1 -0
- package/compiler/transform/cssProp/index.ts +1 -0
- package/compiler/transform/cssProp/plugin.ts +161 -0
- package/compiler/transform/debug/plugin.ts +107 -1
- package/compiler/transform/debug/transform.ts +2 -1
- package/compiler/transform/evaluator/evaluator.ts +223 -38
- package/compiler/transform/evaluator/lazy_bindings.ts +63 -0
- package/compiler/transform/evaluator/metadata_cache.ts +124 -0
- package/compiler/transform/evaluator/tracer.ts +151 -89
- package/compiler/transform/extract/chain/chain.ts +794 -84
- package/compiler/transform/extract/chain/extract_chain.ts +28 -4
- package/compiler/transform/extract/chain/types.ts +3 -1
- package/compiler/transform/extract/plugin.ts +159 -42
- package/compiler/transform/extract/transform.ts +2 -1
- package/compiler/transform/extract/utils/imports.ts +8 -1
- package/compiler/transform/extract/utils/replacement.ts +92 -5
- package/compiler/transform/extract/utils/state.ts +8 -2
- package/compiler/transform/extract/utils/theme.ts +6 -6
- package/compiler/transform/extract/utils/token.ts +107 -0
- package/compiler/transform/index.ts +1 -0
- package/compiler/transform/syntax/isStaticStyleValue.ts +15 -9
- package/compiler/transform/syntax/static_ids.ts +1 -1
- package/compiler/transform/utils/babel.ts +1 -1
- package/compiler/utils/check_diagnostics.ts +18 -0
- package/compiler/utils/constants.ts +10 -5
- package/compiler/utils/file_resolver.ts +27 -1
- package/compiler/utils/import_source.ts +17 -7
- package/compiler/utils/imports.ts +11 -1
- package/config/build.ts +9 -2
- package/config/config/check.ts +25 -0
- package/config/config/css.ts +36 -1
- package/config/config/debug.ts +24 -1
- package/config/config/dev.ts +8 -0
- package/config/configure.ts +23 -2
- package/config/document.ts +23 -0
- package/css/globalSheet.ts +66 -0
- package/css/index.ts +5 -0
- package/css/sheet.ts +173 -0
- package/css/styleTarget.ts +251 -0
- package/dev/config.ts +2 -3
- package/dev/utils.ts +3 -3
- package/dialect/namedTokens.ts +30 -8
- package/dist/adapter/preact.js +2 -0
- package/dist/adapter/react.js +2 -0
- package/dist/adapter/solid.js +2 -0
- package/dist/className-CC5PHcXI.js +311 -0
- package/dist/className-CC5PHcXI.js.map +1 -0
- package/dist/{style-DUztHzBz.js → combine-CtR6MyD4.js} +402 -733
- package/dist/combine-CtR6MyD4.js.map +1 -0
- package/dist/compiler/index.mjs +2 -2
- package/dist/{compiler-BXcGyZUP.mjs → compiler-oXXProzz.mjs} +3092 -850
- package/dist/compiler-oXXProzz.mjs.map +1 -0
- package/dist/config/index.js +2 -2
- package/dist/config-BK7oK4Hx.js +57 -0
- package/dist/config-BK7oK4Hx.js.map +1 -0
- package/dist/config-BWFlaJ_v.js +6 -0
- package/dist/config-BWFlaJ_v.js.map +1 -0
- package/dist/config-BsF-QRgz.js +6 -0
- package/dist/{config-DcYrUB-M.js.map → config-BsF-QRgz.js.map} +1 -1
- package/dist/{config-C1k9vUrM.js → config-DKaGtG9O.js} +9 -7
- package/dist/config-DKaGtG9O.js.map +1 -0
- package/dist/config-IFmsTOQp.js +1 -0
- package/dist/css-B-7-Do-J.js +4541 -0
- package/dist/css-B-7-Do-J.js.map +1 -0
- package/dist/{css-CohHH2tn.js → css-BmIytNon.js} +185 -14
- package/dist/css-BmIytNon.js.map +1 -0
- package/dist/css-CYnQKnPu.js +563 -0
- package/dist/css-CYnQKnPu.js.map +1 -0
- package/dist/css.js +2 -2
- package/dist/{css_extra-DQdCrYoC.js → css_extra-Br7eDCrf.js} +2 -2
- package/dist/{css_extra-9BZ_jVET.js.map → css_extra-Br7eDCrf.js.map} +1 -1
- package/dist/{css_extra-9BZ_jVET.js → css_extra-qzi_eFFf.js} +2 -2
- package/dist/{css_extra-DQdCrYoC.js.map → css_extra-qzi_eFFf.js.map} +1 -1
- package/dist/data-D6dD67li.js +786 -0
- package/dist/data-D6dD67li.js.map +1 -0
- package/dist/debug-Bo43rBKc.js +73 -0
- package/dist/debug-Bo43rBKc.js.map +1 -0
- package/dist/dev/rsc.js +138 -28
- package/dist/dev/rsc.js.map +1 -1
- package/dist/{dev-C2u78xuv.js → dev-_DW5n4U4.js} +9 -10
- package/dist/dev-_DW5n4U4.js.map +1 -0
- package/dist/dev.js +1 -1
- package/dist/dialect/extracted/index.js +1 -1
- package/dist/dialect/index.js +1 -1
- package/dist/{elementMarker-BKzZyg5V.js → elementMarker-u0d2LH8r.js} +582 -61
- package/dist/elementMarker-u0d2LH8r.js.map +1 -0
- package/dist/entry/dev/adapter/preact.js +12 -0
- package/dist/entry/dev/adapter/preact.js.map +1 -0
- package/dist/entry/dev/adapter/react.js +12 -0
- package/dist/entry/dev/adapter/react.js.map +1 -0
- package/dist/entry/dev/adapter/solid.js +12 -0
- package/dist/entry/dev/adapter/solid.js.map +1 -0
- package/dist/entry/dev/css.js +3 -3
- package/dist/entry/dev/jsx-dev-runtime.js +2 -2
- package/dist/entry/dev/jsx-runtime.js +2 -2
- package/dist/entry/dev.js +13 -12
- package/dist/entry/prod/adapter/preact.js +12 -0
- package/dist/entry/prod/adapter/preact.js.map +1 -0
- package/dist/entry/prod/adapter/react.js +12 -0
- package/dist/entry/prod/adapter/react.js.map +1 -0
- package/dist/entry/prod/adapter/solid.js +12 -0
- package/dist/entry/prod/adapter/solid.js.map +1 -0
- package/dist/entry/prod/css.js +3 -3
- package/dist/entry/prod/extract.js +251 -3
- package/dist/entry/prod/extract.js.map +1 -0
- package/dist/entry/prod/jsx-dev-runtime.js +2 -2
- package/dist/entry/prod/jsx-runtime.js +2 -2
- package/dist/entry/prod/runtime.js +3 -4
- package/dist/entry/prod.js +84 -1201
- package/dist/entry/prod.js.map +1 -1
- package/dist/entry/rsc-dev/adapter/preact.js +13 -0
- package/dist/entry/rsc-dev/adapter/preact.js.map +1 -0
- package/dist/entry/rsc-dev/adapter/react.js +13 -0
- package/dist/entry/rsc-dev/adapter/react.js.map +1 -0
- package/dist/entry/rsc-dev/adapter/solid.js +13 -0
- package/dist/entry/rsc-dev/adapter/solid.js.map +1 -0
- package/dist/entry/rsc-dev/css.js +4 -3
- package/dist/entry/rsc-dev/dev.js +135 -32
- package/dist/entry/rsc-dev/dev.js.map +1 -1
- package/dist/entry/rsc-dev/jsx-dev-runtime.js +5 -4
- package/dist/entry/rsc-dev/jsx-dev-runtime.js.map +1 -1
- package/dist/entry/rsc-dev/jsx-runtime.js +2 -2
- package/dist/entry/rsc-dev.js +298 -616
- package/dist/entry/rsc-dev.js.map +1 -1
- package/dist/entry/rsc-prod/adapter/preact.js +2 -0
- package/dist/entry/rsc-prod/adapter/react.js +2 -0
- package/dist/entry/rsc-prod/adapter/solid.js +2 -0
- package/dist/entry/rsc-prod/css.js +9 -3
- package/dist/entry/rsc-prod/css.js.map +1 -0
- package/dist/entry/rsc-prod/jsx-dev-runtime.js +2 -2
- package/dist/entry/rsc-prod/jsx-runtime.js +2 -2
- package/dist/entry/rsc-prod/runtime.js +3 -4
- package/dist/entry/rsc-prod.js +251 -10
- package/dist/entry/rsc-prod.js.map +1 -0
- package/dist/{rules-Dz7Pu2K6.js → env-C8lKN1dB.js} +727 -147
- package/dist/env-C8lKN1dB.js.map +1 -0
- package/dist/{getClassName-C6690_nr.js → getClassName-BraU01Hd.js} +60 -15
- package/dist/getClassName-BraU01Hd.js.map +1 -0
- package/dist/getClassName-C35yO40s.js +548 -0
- package/dist/getClassName-C35yO40s.js.map +1 -0
- package/dist/getClassName-CfkGcBZy.js +49 -0
- package/dist/getClassName-CfkGcBZy.js.map +1 -0
- package/dist/{utils-D4YWF2K0.js → getClassName-i4oy2Up_.js} +27 -65
- package/dist/getClassName-i4oy2Up_.js.map +1 -0
- package/dist/{global-zaCE-g1C.js → global-DGcWZODV.js} +7 -8
- package/dist/global-DGcWZODV.js.map +1 -0
- package/dist/globalSheet-2ozCV1Zm.js +1091 -0
- package/dist/globalSheet-2ozCV1Zm.js.map +1 -0
- package/dist/hash-CGO13tOn.js +407 -0
- package/dist/hash-CGO13tOn.js.map +1 -0
- package/dist/index.js +10 -10
- package/dist/jsx/jsx-dev-runtime.js +2 -2
- package/dist/jsx/jsx-dev-runtime.server.js +3 -3
- package/dist/jsx/jsx-dev-runtime.server.js.map +1 -1
- package/dist/jsx/jsx-runtime.js +2 -2
- package/dist/jsx/jsx-runtime.server.js +4 -4
- package/dist/jsx/jsx-runtime.server.js.map +1 -1
- package/dist/jsx-C-v1b99-.js +39 -0
- package/dist/jsx-C-v1b99-.js.map +1 -0
- package/dist/{jsx_dev_runtime-DXlSD6kV.js → jsx_dev_runtime-Bd7FO7C1.js} +2 -3
- package/dist/{jsx_dev_runtime-DXlSD6kV.js.map → jsx_dev_runtime-Bd7FO7C1.js.map} +1 -1
- package/dist/jsx_runtime-BxumFGUy.js +13 -0
- package/dist/jsx_runtime-BxumFGUy.js.map +1 -0
- package/dist/{jsx_runtime-DPWo5qvV.js → jsx_runtime-gO4GQFcW.js} +3 -3
- package/dist/{jsx_runtime-CMdEXGNZ.js.map → jsx_runtime-gO4GQFcW.js.map} +1 -1
- package/dist/{loader-DCT1Q9yi.mjs → loader-A15L-NVK.mjs} +13 -14
- package/dist/loader-A15L-NVK.mjs.map +1 -0
- package/dist/{misc-o8pviMUi.mjs → misc-CRRQr1DT.mjs} +35 -8
- package/dist/misc-CRRQr1DT.mjs.map +1 -0
- package/dist/{namedTokens-BUa6raTb.js → namedTokens-paLD-Pdk.js} +15 -9
- package/dist/namedTokens-paLD-Pdk.js.map +1 -0
- package/dist/plugin/farm/index.mjs +5 -4
- package/dist/plugin/farm/index.mjs.map +1 -1
- package/dist/plugin/nextjs/index.mjs +153 -33
- package/dist/plugin/nextjs/index.mjs.map +1 -1
- package/dist/plugin/nextjs/loader.mjs +7 -5
- package/dist/plugin/nextjs/loader.mjs.map +1 -1
- package/dist/plugin/parcel/index.cjs +2 -0
- package/dist/plugin/parcel/index.mjs +3 -1
- package/dist/plugin/parcel/optimizer.cjs +3 -2
- package/dist/plugin/parcel/optimizer.cjs.map +1 -1
- package/dist/plugin/parcel/optimizer.mjs +3 -2
- package/dist/plugin/parcel/optimizer.mjs.map +1 -1
- package/dist/plugin/parcel/resolver.cjs +1 -1
- package/dist/plugin/parcel/resolver.mjs +2 -2
- package/dist/plugin/parcel/runtime.cjs +1 -1
- package/dist/plugin/parcel/runtime.mjs +1 -1
- package/dist/plugin/parcel/transformer.cjs +1 -1
- package/dist/plugin/parcel/transformer.mjs +2 -2
- package/dist/plugin/rspack/index.mjs +3 -2
- package/dist/plugin/rspack/index.mjs.map +1 -1
- package/dist/plugin/vite/index.mjs +26 -23
- package/dist/plugin/vite/index.mjs.map +1 -1
- package/dist/plugin/webpack/index.mjs +3 -2
- package/dist/plugin/webpack/loader.mjs +2 -2
- package/dist/presets/tailwind/index.js +32 -8
- package/dist/presets/tailwind/index.js.map +1 -1
- package/dist/{assert-BGdigdr5.js → presets-DSanixJV.js} +106 -2
- package/dist/presets-DSanixJV.js.map +1 -0
- package/dist/{registry-D3x1EDJm.mjs → registry-D2C6hTdx.mjs} +2 -2
- package/dist/{registry-D3x1EDJm.mjs.map → registry-D2C6hTdx.mjs.map} +1 -1
- package/dist/resolveClassNameRuntime-Cp8_UcxF.js +63 -0
- package/dist/resolveClassNameRuntime-Cp8_UcxF.js.map +1 -0
- package/dist/scope-Dg83Az-2.js +601 -0
- package/dist/scope-Dg83Az-2.js.map +1 -0
- package/dist/selector/index.js +1 -2
- package/dist/server.js +91 -17
- package/dist/server.js.map +1 -1
- package/dist/{shared-B_gJf5uj.cjs → shared-B7Nw_dcx.cjs} +3152 -891
- package/dist/shared-B7Nw_dcx.cjs.map +1 -0
- package/dist/{shared-uAzFeq0x.mjs → shared-BmJmaxu8.mjs} +5 -5
- package/dist/shared-BmJmaxu8.mjs.map +1 -0
- package/dist/sheet-CHnDkjn4.js +56 -0
- package/dist/sheet-CHnDkjn4.js.map +1 -0
- package/dist/sheet-PVxRQrOp.js +7 -0
- package/dist/sheet-PVxRQrOp.js.map +1 -0
- package/dist/sheet-ueNBw_2u.js +1 -0
- package/dist/{sidecar-BUO1hKXu.mjs → sidecar-DVegwGec.mjs} +3 -3
- package/dist/{sidecar-BUO1hKXu.mjs.map → sidecar-DVegwGec.mjs.map} +1 -1
- package/dist/{style-BkeAZl0n.js → style-B1tkE8zl.js} +329 -129
- package/dist/style-B1tkE8zl.js.map +1 -0
- package/dist/styleStore-BK2XBS8n.js +45 -0
- package/dist/styleStore-BK2XBS8n.js.map +1 -0
- package/dist/styleStore-D4umgIwQ.js +3457 -0
- package/dist/styleStore-D4umgIwQ.js.map +1 -0
- package/dist/token-BX5jRxMb.js +110 -0
- package/dist/token-BX5jRxMb.js.map +1 -0
- package/dist/token-CS0iRIIa.js +140 -0
- package/dist/token-CS0iRIIa.js.map +1 -0
- package/dist/{trace-D0IL6JT8.js → trace-DZYKSwdB.js} +2 -2
- package/dist/{trace-D0IL6JT8.js.map → trace-DZYKSwdB.js.map} +1 -1
- package/dist/{trace-DR7_Rpkg.js → trace-EEKXwKSr.js} +3 -3
- package/dist/{trace-DR7_Rpkg.js.map → trace-EEKXwKSr.js.map} +1 -1
- package/dist/{transform-BTJOg8Hg.js → transform-BZ4jPwy3.js} +2 -2
- package/dist/transform-BZ4jPwy3.js.map +1 -0
- package/dist/types/adapter/preact.d.ts +1 -0
- package/dist/types/adapter/react.d.ts +1 -0
- package/dist/types/adapter/solid.d.ts +1 -0
- package/dist/types/atomic/atRule/counterStyle.d.ts +10 -0
- package/dist/types/atomic/atRule/fontFace.d.ts +10 -0
- package/dist/types/atomic/atRule/fontPaletteValues.d.ts +10 -0
- package/dist/types/atomic/atRule/fontSrc.d.ts +1 -0
- package/dist/types/atomic/atRule/keyframes.d.ts +13 -0
- package/dist/types/atomic/atRule/positionTry.d.ts +13 -0
- package/dist/types/atomic/atRule/property.d.ts +13 -0
- package/dist/types/atomic/atRule/utils.d.ts +5 -0
- package/dist/types/atomic/className.d.ts +11 -0
- package/dist/types/atomic/debug/className/className.d.ts +9 -0
- package/dist/types/atomic/debug/className/index.d.ts +1 -0
- package/dist/types/atomic/debug/property/data.d.ts +3 -0
- package/dist/types/atomic/debug/property/index.d.ts +1 -0
- package/dist/types/atomic/debug/property/property.d.ts +5 -0
- package/dist/types/atomic/debug/selector.d.ts +2 -0
- package/dist/types/atomic/debug/value.d.ts +5 -0
- package/dist/types/atomic/element.d.ts +5 -0
- package/dist/types/atomic/layer/index.d.ts +3 -0
- package/dist/types/atomic/layer/layer.d.ts +12 -0
- package/dist/types/atomic/layer/types.d.ts +30 -0
- package/dist/types/atomic/layer/utils.d.ts +4 -0
- package/dist/types/atomic/property/index.d.ts +2 -0
- package/dist/types/atomic/property/presets.d.ts +4 -0
- package/dist/types/atomic/property/property.d.ts +3 -0
- package/dist/types/atomic/property/type_maps.d.ts +31 -0
- package/dist/types/atomic/property/types.d.ts +4 -0
- package/dist/types/atomic/rule.d.ts +5 -0
- package/dist/types/atomic/scope.d.ts +3 -0
- package/dist/types/atomic/theme.d.ts +7 -0
- package/dist/types/atomic/token.d.ts +7 -0
- package/dist/types/atomic/utils/cssIdent.d.ts +2 -0
- package/dist/types/atomic/utils/cssVar.d.ts +3 -0
- package/dist/types/atomic/utils/debug.d.ts +4 -0
- package/dist/types/atomic/utils/format.d.ts +5 -0
- package/dist/types/atomic/utils/hash.d.ts +1 -0
- package/dist/types/atomic/utils/selector.d.ts +7 -0
- package/dist/types/atomic/utils/types.d.ts +8 -0
- package/dist/types/atomic/value/index.d.ts +2 -0
- package/dist/types/atomic/value/unitless.d.ts +1 -0
- package/dist/types/atomic/value/value.d.ts +2 -0
- package/dist/types/atomic/var.d.ts +4 -0
- package/dist/types/builder/classname/class_name_builder.d.ts +4 -0
- package/dist/types/builder/classname/fns.d.ts +48 -0
- package/dist/types/builder/classname/index.d.ts +3 -0
- package/dist/types/builder/classname/types.d.ts +18 -0
- package/dist/types/builder/data/check_selector.d.ts +2 -0
- package/dist/types/builder/data/const.d.ts +27 -0
- package/dist/types/builder/data/create.d.ts +13 -0
- package/dist/types/builder/data/data.d.ts +44 -0
- package/dist/types/builder/data/debug.d.ts +38 -0
- package/dist/types/builder/data/index.d.ts +8 -0
- package/dist/types/builder/data/is.d.ts +16 -0
- package/dist/types/builder/data/merge/index.d.ts +2 -0
- package/dist/types/builder/data/merge/scope.d.ts +7 -0
- package/dist/types/builder/data/merge/style.d.ts +6 -0
- package/dist/types/builder/data/merge/utils.d.ts +10 -0
- package/dist/types/builder/data/selector.d.ts +8 -0
- package/dist/types/builder/data/state.d.ts +100 -0
- package/dist/types/builder/extract/index.d.ts +7 -0
- package/dist/types/builder/extract/scope.d.ts +14 -0
- package/dist/types/builder/extract/sheet.d.ts +10 -0
- package/dist/types/builder/extract/slot.d.ts +9 -0
- package/dist/types/builder/extract/style.d.ts +11 -0
- package/dist/types/builder/extract/theme.d.ts +2 -0
- package/dist/types/builder/extract/token.d.ts +12 -0
- package/dist/types/builder/extract/utils.d.ts +28 -0
- package/dist/types/builder/extract/withTokens.d.ts +10 -0
- package/dist/types/builder/index.d.ts +2 -0
- package/dist/types/builder/selector_override.d.ts +5 -0
- package/dist/types/builder/selector_override_core.d.ts +8 -0
- package/dist/types/builder/style_builder.d.ts +15 -0
- package/dist/types/builder/style_data.d.ts +8 -0
- package/dist/types/builder/style_fns.d.ts +14 -0
- package/dist/types/builder/token/data.d.ts +10 -0
- package/dist/types/builder/token/name.d.ts +3 -0
- package/dist/types/builder/token/symbols.d.ts +4 -0
- package/dist/types/builder/types/alias.d.ts +59 -0
- package/dist/types/builder/types/fns.d.ts +115 -0
- package/dist/types/builder/types/index.d.ts +1 -0
- package/dist/types/builder/types/types.d.ts +22 -0
- package/dist/types/builder/utils.d.ts +9 -0
- package/dist/types/compiler/compiler/cache.d.ts +24 -0
- package/dist/types/compiler/compiler/cache_identity.d.ts +4 -0
- package/dist/types/compiler/compiler/compiler.d.ts +40 -0
- package/dist/types/compiler/compiler/constants.d.ts +6 -0
- package/dist/types/compiler/compiler/index.d.ts +4 -0
- package/dist/types/compiler/compiler/persistent_cache.d.ts +14 -0
- package/dist/types/compiler/compiler/types.d.ts +64 -0
- package/dist/types/compiler/cssProp.d.ts +8 -0
- package/dist/types/compiler/extract/collector.d.ts +8 -0
- package/dist/types/compiler/extract/extract.d.ts +6 -0
- package/dist/types/compiler/extract/index.d.ts +3 -0
- package/dist/types/compiler/extract/types.d.ts +29 -0
- package/dist/types/compiler/index.d.ts +3 -0
- package/dist/types/compiler/transform/cssProp/index.d.ts +1 -0
- package/dist/types/compiler/transform/cssProp/plugin.d.ts +13 -0
- package/dist/types/compiler/transform/debug/index.d.ts +2 -0
- package/dist/types/compiler/transform/debug/plugin.d.ts +34 -0
- package/dist/types/compiler/transform/debug/transform.d.ts +7 -0
- package/dist/types/compiler/transform/debug/utils/debug_data.d.ts +11 -0
- package/dist/types/compiler/transform/debug/utils/source_url.d.ts +2 -0
- package/dist/types/compiler/transform/evaluator/evaluator.d.ts +58 -0
- package/dist/types/compiler/transform/evaluator/index.d.ts +3 -0
- package/dist/types/compiler/transform/evaluator/lazy_bindings.d.ts +22 -0
- package/dist/types/compiler/transform/evaluator/metadata_cache.d.ts +13 -0
- package/dist/types/compiler/transform/evaluator/tracer.d.ts +15 -0
- package/dist/types/compiler/transform/evaluator/types.d.ts +21 -0
- package/dist/types/compiler/transform/extract/chain/chain.d.ts +18 -0
- package/dist/types/compiler/transform/extract/chain/extract_chain.d.ts +21 -0
- package/dist/types/compiler/transform/extract/chain/index.d.ts +3 -0
- package/dist/types/compiler/transform/extract/chain/types.d.ts +32 -0
- package/dist/types/compiler/transform/extract/index.d.ts +2 -0
- package/dist/types/compiler/transform/extract/plugin.d.ts +20 -0
- package/dist/types/compiler/transform/extract/transform.d.ts +10 -0
- package/dist/types/compiler/transform/extract/utils/imports.d.ts +3 -0
- package/dist/types/compiler/transform/extract/utils/replacement.d.ts +11 -0
- package/dist/types/compiler/transform/extract/utils/slot.d.ts +4 -0
- package/dist/types/compiler/transform/extract/utils/state.d.ts +36 -0
- package/dist/types/compiler/transform/extract/utils/theme.d.ts +9 -0
- package/dist/types/compiler/transform/extract/utils/token.d.ts +4 -0
- package/dist/types/compiler/transform/index.d.ts +5 -0
- package/dist/types/compiler/transform/syntax/index.d.ts +5 -0
- package/dist/types/compiler/transform/syntax/isStaticStyleValue.d.ts +2 -0
- package/dist/types/compiler/transform/syntax/isStyleChainCall.d.ts +2 -0
- package/dist/types/compiler/transform/syntax/static_ids.d.ts +16 -0
- package/dist/types/compiler/transform/syntax/types.d.ts +4 -0
- package/dist/types/compiler/transform/syntax/utils.d.ts +5 -0
- package/dist/types/compiler/transform/utils/babel.d.ts +21 -0
- package/dist/types/compiler/transform/utils/import.d.ts +2 -0
- package/dist/types/compiler/transform/utils/path.d.ts +1 -0
- package/dist/types/compiler/transform/utils/selector.d.ts +18 -0
- package/dist/types/compiler/utils/check_diagnostics.d.ts +7 -0
- package/dist/types/compiler/utils/constants.d.ts +70 -0
- package/dist/types/compiler/utils/file_resolver.d.ts +16 -0
- package/dist/types/compiler/utils/import_source.d.ts +34 -0
- package/dist/types/compiler/utils/imports.d.ts +6 -0
- package/dist/types/compiler/utils/path.d.ts +4 -0
- package/dist/types/compiler/utils/sourcemap.d.ts +36 -0
- package/dist/types/config/build.d.ts +20 -0
- package/dist/types/config/config/check.d.ts +11 -0
- package/dist/types/config/config/css.d.ts +29 -0
- package/dist/types/config/config/css_extra.d.ts +13 -0
- package/dist/types/config/config/debug.d.ts +14 -0
- package/dist/types/config/config/dev.d.ts +36 -0
- package/dist/types/config/config/runtime.d.ts +10 -0
- package/dist/types/config/configure.d.ts +14 -0
- package/dist/types/config/constants.d.ts +1 -0
- package/dist/types/config/document.d.ts +3 -0
- package/dist/types/config/index.d.ts +2 -0
- package/dist/types/config/types.d.ts +47 -0
- package/dist/types/config/utils.d.ts +2 -0
- package/dist/types/css/counterStyle.d.ts +4 -0
- package/dist/types/css/fontFace.d.ts +5 -0
- package/dist/types/css/fontPaletteValues.d.ts +4 -0
- package/dist/types/css/globalSheet.d.ts +24 -0
- package/dist/types/css/index.d.ts +12 -0
- package/dist/types/css/keyframes.d.ts +4 -0
- package/dist/types/css/positionTry.d.ts +4 -0
- package/dist/types/css/property.d.ts +7 -0
- package/dist/types/css/sheet.d.ts +8 -0
- package/dist/types/css/styleTarget.d.ts +9 -0
- package/dist/types/css/utils.d.ts +19 -0
- package/dist/types/dev/config.d.ts +6 -0
- package/dist/types/dev/fns.d.ts +14 -0
- package/dist/types/dev/index.d.ts +2 -0
- package/dist/types/dev/trace.d.ts +8 -0
- package/dist/types/dev/utils.d.ts +5 -0
- package/dist/types/dialect/extracted/index.d.ts +1 -0
- package/dist/types/dialect/index.d.ts +1 -0
- package/dist/types/dialect/namedTokens.d.ts +9 -0
- package/dist/types/entry/dev/adapter/preact.d.ts +1 -0
- package/dist/types/entry/dev/adapter/react.d.ts +1 -0
- package/dist/types/entry/dev/adapter/solid.d.ts +1 -0
- package/dist/types/entry/dev/config.d.ts +2 -0
- package/dist/types/entry/dev/css.d.ts +2 -0
- package/dist/types/entry/dev/index.d.ts +3 -0
- package/dist/types/entry/dev/jsx_dev_runtime.d.ts +3 -0
- package/dist/types/entry/dev/sheet.d.ts +1 -0
- package/dist/types/entry/prod/adapter/preact.d.ts +1 -0
- package/dist/types/entry/prod/adapter/react.d.ts +1 -0
- package/dist/types/entry/prod/adapter/solid.d.ts +1 -0
- package/dist/types/entry/prod/config.d.ts +2 -0
- package/dist/types/entry/prod/config_debug.d.ts +2 -0
- package/dist/types/entry/prod/css.d.ts +2 -0
- package/dist/types/entry/prod/extract.d.ts +1 -0
- package/dist/types/entry/prod/index.d.ts +2 -0
- package/dist/types/entry/prod/jsx_runtime.d.ts +2 -0
- package/dist/types/entry/prod/runtime.d.ts +8 -0
- package/dist/types/entry/rsc_dev/adapter/preact.d.ts +1 -0
- package/dist/types/entry/rsc_dev/adapter/react.d.ts +1 -0
- package/dist/types/entry/rsc_dev/adapter/solid.d.ts +1 -0
- package/dist/types/entry/rsc_dev/config.d.ts +2 -0
- package/dist/types/entry/rsc_dev/css.d.ts +3 -0
- package/dist/types/entry/rsc_dev/index.d.ts +2 -0
- package/dist/types/entry/rsc_dev/server.d.ts +10 -0
- package/dist/types/entry/rsc_prod/adapter/preact.d.ts +1 -0
- package/dist/types/entry/rsc_prod/adapter/react.d.ts +1 -0
- package/dist/types/entry/rsc_prod/adapter/solid.d.ts +1 -0
- package/dist/types/entry/rsc_prod/config.d.ts +2 -0
- package/dist/types/entry/rsc_prod/config_debug.d.ts +2 -0
- package/dist/types/entry/rsc_prod/css.d.ts +2 -0
- package/dist/types/entry/rsc_prod/index.d.ts +2 -0
- package/dist/types/entry/rsc_prod/jsx_runtime.d.ts +2 -0
- package/dist/types/entry/rsc_prod/runtime.d.ts +4 -0
- package/dist/types/entry/rsc_prod/server.d.ts +6 -0
- package/dist/types/entry/shared/config.d.ts +1 -0
- package/dist/types/entry/shared/config_debug.d.ts +1 -0
- package/dist/types/entry/shared/config_dev.d.ts +1 -0
- package/dist/types/entry/shared/dev.d.ts +1 -0
- package/dist/types/entry/shared/prod.d.ts +1 -0
- package/dist/types/entry/shared/utils.d.ts +2 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/jsx/extracted/jsx_runtime.d.ts +7 -0
- package/dist/types/jsx/rsc/jsx_runtime.d.ts +7 -0
- package/dist/types/jsx/rsc_extracted/jsx_runtime.d.ts +2 -0
- package/dist/types/jsx/runtime/jsx_dev_runtime.d.ts +6 -0
- package/dist/types/jsx/runtime/jsx_runtime.d.ts +7 -0
- package/dist/types/jsx/types/index.d.ts +1 -0
- package/dist/types/jsx/types/preact.d.ts +12 -0
- package/dist/types/jsx/types/react.d.ts +10 -0
- package/dist/types/jsx/types/solid.d.ts +12 -0
- package/dist/types/jsx/utils.d.ts +19 -0
- package/dist/types/plugin/bundler/farm/index.d.ts +1 -0
- package/dist/types/plugin/bundler/farm/plugin.d.ts +97 -0
- package/dist/types/plugin/bundler/parcel/index.d.ts +1 -0
- package/dist/types/plugin/bundler/parcel/optimizer.d.ts +3 -0
- package/dist/types/plugin/bundler/parcel/plugin.d.ts +6 -0
- package/dist/types/plugin/bundler/parcel/resolver.d.ts +3 -0
- package/dist/types/plugin/bundler/parcel/runtime.d.ts +3 -0
- package/dist/types/plugin/bundler/parcel/shared.d.ts +37 -0
- package/dist/types/plugin/bundler/parcel/transformer.d.ts +3 -0
- package/dist/types/plugin/bundler/rspack/index.d.ts +1 -0
- package/dist/types/plugin/bundler/rspack/plugin.d.ts +7 -0
- package/dist/types/plugin/bundler/vite/index.d.ts +1 -0
- package/dist/types/plugin/bundler/vite/plugin.d.ts +6 -0
- package/dist/types/plugin/bundler/vite/state.d.ts +79 -0
- package/dist/types/plugin/bundler/webpack/index.d.ts +1 -0
- package/dist/types/plugin/bundler/webpack/loader.d.ts +2 -0
- package/dist/types/plugin/bundler/webpack/plugin.d.ts +11 -0
- package/dist/types/plugin/bundler/webpack/shared/loader.d.ts +31 -0
- package/dist/types/plugin/bundler/webpack/shared/registry.d.ts +4 -0
- package/dist/types/plugin/bundler/webpack/utils.d.ts +18 -0
- package/dist/types/plugin/nextjs/constants.d.ts +3 -0
- package/dist/types/plugin/nextjs/html.d.ts +1 -0
- package/dist/types/plugin/nextjs/index.d.ts +2 -0
- package/dist/types/plugin/nextjs/loader.d.ts +3 -0
- package/dist/types/plugin/nextjs/plugin.d.ts +5 -0
- package/dist/types/plugin/nextjs/types.d.ts +21 -0
- package/dist/types/plugin/nextjs/utils.d.ts +59 -0
- package/dist/types/plugin/utils/cache/css_cache.d.ts +34 -0
- package/dist/types/plugin/utils/cache/file.d.ts +4 -0
- package/dist/types/plugin/utils/cache/index.d.ts +2 -0
- package/dist/types/plugin/utils/compiler.d.ts +51 -0
- package/dist/types/plugin/utils/constants.d.ts +4 -0
- package/dist/types/plugin/utils/cssMarker.d.ts +4 -0
- package/dist/types/plugin/utils/cssOutput.d.ts +10 -0
- package/dist/types/plugin/utils/filter.d.ts +25 -0
- package/dist/types/plugin/utils/imports.d.ts +3 -0
- package/dist/types/plugin/utils/index.d.ts +10 -0
- package/dist/types/plugin/utils/injection.d.ts +3 -0
- package/dist/types/plugin/utils/misc.d.ts +1 -0
- package/dist/types/plugin/utils/runtimeEntry.d.ts +8 -0
- package/dist/types/plugin/utils/sidecar/index.d.ts +1 -0
- package/dist/types/plugin/utils/sidecar/server.d.ts +19 -0
- package/dist/types/plugin/utils/sidecar/sidecar.d.ts +17 -0
- package/dist/types/plugin/utils/sidecar/utils.d.ts +33 -0
- package/dist/types/plugin/utils/sourcemap.d.ts +9 -0
- package/dist/types/plugin/utils/virtual.d.ts +12 -0
- package/dist/types/presets/tailwind/classname/index.d.ts +2 -0
- package/dist/types/presets/tailwind/classname/transform.d.ts +8 -0
- package/dist/types/presets/tailwind/classname/types.d.ts +27 -0
- package/dist/types/presets/tailwind/index.d.ts +5 -0
- package/dist/types/presets/tailwind/selectors.d.ts +68 -0
- package/dist/types/presets/tailwind/style/index.d.ts +2 -0
- package/dist/types/presets/tailwind/style/transform.d.ts +8 -0
- package/dist/types/presets/tailwind/style/types.d.ts +149 -0
- package/dist/types/presets/tailwind/theme.d.ts +477 -0
- package/dist/types/presets/tailwind/types.d.ts +53 -0
- package/dist/types/runtime/adapter/utils.d.ts +12 -0
- package/dist/types/runtime/core/cache/combine.d.ts +6 -0
- package/dist/types/runtime/core/cache/combineRuntime.d.ts +1 -0
- package/dist/types/runtime/core/cache/item.d.ts +15 -0
- package/dist/types/runtime/core/cache/itemWithResolver.d.ts +4 -0
- package/dist/types/runtime/core/cache/pool.d.ts +16 -0
- package/dist/types/runtime/core/cache/prop.d.ts +19 -0
- package/dist/types/runtime/core/cache/propCache.d.ts +12 -0
- package/dist/types/runtime/core/cache/resolvedItem.d.ts +5 -0
- package/dist/types/runtime/core/cache/result.d.ts +9 -0
- package/dist/types/runtime/core/cache/stateItem.d.ts +14 -0
- package/dist/types/runtime/core/cache/token.d.ts +2 -0
- package/dist/types/runtime/core/cache/tokenValues.d.ts +26 -0
- package/dist/types/runtime/core/cache/utils/tree.d.ts +12 -0
- package/dist/types/runtime/core/cache/utils/walk.d.ts +1 -0
- package/dist/types/runtime/core/className.d.ts +18 -0
- package/dist/types/runtime/core/combinedStyle.d.ts +20 -0
- package/dist/types/runtime/core/createTransformElement.d.ts +4 -0
- package/dist/types/runtime/core/elementMarker.d.ts +12 -0
- package/dist/types/runtime/core/elementMarkerData.d.ts +7 -0
- package/dist/types/runtime/core/getClassName.d.ts +4 -0
- package/dist/types/runtime/core/getSheetRules.d.ts +3 -0
- package/dist/types/runtime/core/getToken.d.ts +3 -0
- package/dist/types/runtime/core/index.d.ts +5 -0
- package/dist/types/runtime/core/jsx.d.ts +1 -0
- package/dist/types/runtime/core/resolveClassNameRuntime.d.ts +8 -0
- package/dist/types/runtime/env.d.ts +2 -0
- package/dist/types/runtime/extract/combineStyle.d.ts +27 -0
- package/dist/types/runtime/extract/getClassName.d.ts +10 -0
- package/dist/types/runtime/extract/index.d.ts +6 -0
- package/dist/types/runtime/extract/jsx.d.ts +10 -0
- package/dist/types/runtime/extract/token.d.ts +5 -0
- package/dist/types/runtime/extract/tokenResolver.d.ts +2 -0
- package/dist/types/runtime/rsc/constants.d.ts +6 -0
- package/dist/types/runtime/rsc/dev.d.ts +11 -0
- package/dist/types/runtime/rsc/getClassName.d.ts +27 -0
- package/dist/types/runtime/rsc/globalSheet.d.ts +22 -0
- package/dist/types/runtime/rsc/index.d.ts +1 -0
- package/dist/types/runtime/rsc/jsx.d.ts +1 -0
- package/dist/types/runtime/rsc/observer.d.ts +10 -0
- package/dist/types/runtime/rsc/styleStore.d.ts +7 -0
- package/dist/types/runtime/sheet/document.d.ts +3 -0
- package/dist/types/runtime/sheet/element.d.ts +2 -0
- package/dist/types/runtime/sheet/global.d.ts +3 -0
- package/dist/types/runtime/sheet/index.d.ts +3 -0
- package/dist/types/runtime/sheet/insert.d.ts +5 -0
- package/dist/types/runtime/sheet/rule.d.ts +8 -0
- package/dist/types/runtime/sheet/rules.d.ts +10 -0
- package/dist/types/runtime/sheet/theme.d.ts +5 -0
- package/dist/types/runtime/style/index.d.ts +3 -0
- package/dist/types/runtime/style/scope.d.ts +4 -0
- package/dist/types/runtime/style/style.d.ts +27 -0
- package/dist/types/runtime/style/token.d.ts +1 -0
- package/dist/types/runtime/types.d.ts +31 -0
- package/dist/types/selector/assert.d.ts +13 -0
- package/dist/types/selector/index.d.ts +5 -0
- package/dist/types/selector/presets/default.d.ts +108 -0
- package/dist/types/selector/presets/index.d.ts +3 -0
- package/dist/types/selector/presets/minimal.d.ts +46 -0
- package/dist/types/selector/presets/selectors.d.ts +62 -0
- package/dist/types/selector/selector.d.ts +25 -0
- package/dist/types/selector/types.d.ts +12 -0
- package/dist/types/selector/validate.d.ts +5 -0
- package/dist/types/sheet/dev/dev_layer.d.ts +4 -0
- package/dist/types/sheet/dev/dev_sort.d.ts +2 -0
- package/dist/types/sheet/dev/index.d.ts +5 -0
- package/dist/types/sheet/dev/utils.d.ts +26 -0
- package/dist/types/sheet/index.d.ts +4 -0
- package/dist/types/sheet/ordered.d.ts +4 -0
- package/dist/types/sheet/ordering.d.ts +15 -0
- package/dist/types/sheet/prod.d.ts +2 -0
- package/dist/types/sheet/sheet.d.ts +2 -0
- package/dist/types/sheet/sourcemap.d.ts +11 -0
- package/dist/types/sheet/types.d.ts +37 -0
- package/dist/types/sheet/utils/dom.d.ts +5 -0
- package/dist/types/sheet/utils/index.d.ts +4 -0
- package/dist/types/sheet/utils/layer.d.ts +10 -0
- package/dist/types/sheet/utils/noop.d.ts +2 -0
- package/dist/types/sheet/utils/rule.d.ts +3 -0
- package/dist/types/sheet/utils/sourcemap.d.ts +12 -0
- package/dist/types/style/classname.d.ts +15 -0
- package/dist/types/style/important.d.ts +9 -0
- package/dist/types/style/index.d.ts +12 -0
- package/dist/types/style/keyframes.d.ts +10 -0
- package/dist/types/style/style.d.ts +426 -0
- package/dist/types/style/theme.d.ts +5 -0
- package/dist/types/style/token.d.ts +29 -0
- package/dist/types/style/tokens.d.ts +10 -0
- package/dist/types/style/transform.d.ts +22 -0
- package/dist/types/style/types.d.ts +22 -0
- package/dist/types/style/utils/expose.d.ts +8 -0
- package/dist/types/style/utils/index.d.ts +1 -0
- package/dist/types/style/value.d.ts +12 -0
- package/dist/types/style/valueRef.d.ts +13 -0
- package/dist/types/style/weight.d.ts +9 -0
- package/dist/types/utils/global.d.ts +4 -0
- package/dist/types/utils/hash.d.ts +3 -0
- package/dist/types/utils/id.d.ts +12 -0
- package/dist/types/utils/object.d.ts +10 -0
- package/dist/types/utils/symbol.d.ts +1 -0
- package/dist/types/utils/trace.d.ts +21 -0
- package/dist/types/utils/type.d.ts +11 -0
- package/dist/utils-0UTYm294.js +42 -0
- package/dist/utils-0UTYm294.js.map +1 -0
- package/dist/utils-CO1ZXzKK.mjs +182 -0
- package/dist/utils-CO1ZXzKK.mjs.map +1 -0
- package/dist/{utils-DQGa0uzS.mjs → utils-CxYxZSSk.mjs} +3 -3
- package/dist/{utils-DQGa0uzS.mjs.map → utils-CxYxZSSk.mjs.map} +1 -1
- package/dist/utils-D1duUYV9.js +72 -0
- package/dist/utils-D1duUYV9.js.map +1 -0
- package/dist/utils-DxCpyV2E.js +62 -0
- package/dist/utils-DxCpyV2E.js.map +1 -0
- package/dist/{utils-BsbfH6cd.js → utils-ymEmGz-T.js} +1274 -608
- package/dist/utils-ymEmGz-T.js.map +1 -0
- package/dist/utils.js +4 -4
- package/dist/utils.js.map +1 -1
- package/dist/{webpack-Fb9xF5jS.mjs → webpack-DF165M2x.mjs} +7 -7
- package/dist/webpack-DF165M2x.mjs.map +1 -0
- package/entry/dev/adapter/preact.ts +8 -0
- package/entry/dev/adapter/react.ts +8 -0
- package/entry/dev/adapter/solid.ts +8 -0
- package/entry/dev/sheet.ts +4 -2
- package/entry/prod/adapter/preact.ts +8 -0
- package/entry/prod/adapter/react.ts +8 -0
- package/entry/prod/adapter/solid.ts +8 -0
- package/entry/prod/config_debug.ts +2 -0
- package/entry/prod/index.ts +1 -1
- package/entry/prod/runtime.ts +3 -1
- package/entry/rsc_dev/adapter/preact.ts +9 -0
- package/entry/rsc_dev/adapter/react.ts +9 -0
- package/entry/rsc_dev/adapter/solid.ts +9 -0
- package/entry/rsc_dev/css.ts +2 -0
- package/entry/rsc_prod/adapter/preact.ts +1 -0
- package/entry/rsc_prod/adapter/react.ts +1 -0
- package/entry/rsc_prod/adapter/solid.ts +1 -0
- package/entry/rsc_prod/config_debug.ts +6 -0
- package/entry/rsc_prod/index.ts +1 -1
- package/entry/shared/config_debug.ts +9 -0
- package/entry/shared/config_dev.ts +9 -7
- package/index.ts +1 -0
- package/jsx/rsc/jsx_dev_runtime.ts +11 -2
- package/jsx/rsc/jsx_runtime.ts +14 -3
- package/jsx/types/index.ts +1 -0
- package/jsx/types/preact.ts +14 -0
- package/jsx/{types.ts → types/react.ts} +2 -2
- package/jsx/types/solid.ts +15 -0
- package/package.json +179 -74
- package/plugin/bundler/farm/plugin.ts +3 -1
- package/plugin/bundler/parcel/optimizer.ts +1 -0
- package/plugin/bundler/parcel/plugin.ts +2 -0
- package/plugin/bundler/parcel/shared.ts +1 -1
- package/plugin/bundler/rspack/plugin.ts +1 -0
- package/plugin/bundler/vite/plugin.ts +23 -25
- package/plugin/bundler/vite/state.ts +7 -8
- package/plugin/bundler/webpack/plugin.ts +4 -3
- package/plugin/bundler/webpack/shared/loader.ts +13 -7
- package/plugin/nextjs/loader.ts +18 -2
- package/plugin/nextjs/plugin.ts +248 -35
- package/plugin/nextjs/types.ts +1 -2
- package/plugin/nextjs/utils.ts +122 -1
- package/plugin/utils/compiler.ts +3 -2
- package/plugin/utils/filter.ts +65 -1
- package/plugin/utils/runtimeEntry.ts +3 -2
- package/presets/tailwind/classname/transform.ts +32 -1
- package/presets/tailwind/style/transform.ts +9 -3
- package/runtime/adapter/utils.ts +120 -0
- package/runtime/core/cache/combine.ts +76 -28
- package/runtime/core/cache/combineRuntime.ts +4 -0
- package/runtime/core/cache/index.ts +2 -1
- package/runtime/core/cache/item.ts +32 -13
- package/runtime/core/cache/itemWithResolver.ts +44 -0
- package/runtime/core/cache/pool.ts +15 -30
- package/runtime/core/cache/prop.ts +10 -8
- package/runtime/core/cache/result.ts +2 -2
- package/runtime/core/cache/stateItem.ts +19 -1
- package/runtime/core/cache/token.ts +20 -0
- package/runtime/core/cache/tokenValues.ts +19 -11
- package/runtime/core/combinedStyle.ts +4 -4
- package/runtime/core/elementMarker.ts +9 -3
- package/runtime/extract/combineStyle.ts +211 -0
- package/runtime/extract/getClassName.ts +61 -16
- package/runtime/extract/index.ts +3 -1
- package/runtime/extract/token.ts +41 -0
- package/runtime/extract/tokenResolver.ts +17 -0
- package/runtime/rsc/constants.ts +3 -0
- package/runtime/rsc/dev.ts +31 -15
- package/runtime/rsc/getClassName.ts +10 -0
- package/runtime/rsc/globalSheet.ts +130 -0
- package/runtime/rsc/observer.ts +125 -15
- package/runtime/rsc/styleStore.ts +10 -19
- package/runtime/sheet/document.ts +28 -0
- package/runtime/sheet/global-prod.ts +3 -5
- package/runtime/sheet/global.ts +3 -5
- package/runtime/sheet/rule.ts +18 -12
- package/runtime/sheet/rules.ts +11 -3
- package/runtime/style/scope.ts +0 -24
- package/runtime/style/style.ts +181 -6
- package/runtime/types.ts +3 -3
- package/sheet/dev/dev_layer.ts +76 -17
- package/sheet/dev/dev_sort.ts +70 -18
- package/sheet/dev/index.ts +23 -3
- package/sheet/ordered.ts +225 -0
- package/sheet/ordering.ts +156 -0
- package/sheet/prod.ts +39 -12
- package/sheet/types.ts +7 -0
- package/sheet/utils/layer.ts +34 -0
- package/style/classname.ts +12 -6
- package/style/important.ts +21 -0
- package/style/index.ts +2 -0
- package/style/style.ts +17 -5
- package/style/theme.ts +0 -1
- package/style/token.ts +28 -21
- package/style/tokens.ts +20 -13
- package/style/transform.ts +5 -4
- package/style/types.ts +6 -4
- package/style/utils/expose.ts +4 -3
- package/style/value.ts +26 -11
- package/style/valueRef.ts +1 -1
- package/style/weight.ts +21 -0
- package/utils/global.ts +1 -3
- package/utils/symbol.ts +3 -0
- package/utils/trace.ts +1 -0
- package/dist/assert-BGdigdr5.js.map +0 -1
- package/dist/className-Cuh2JNxO.js +0 -263
- package/dist/className-Cuh2JNxO.js.map +0 -1
- package/dist/className-W2kDyeVl.js +0 -144
- package/dist/className-W2kDyeVl.js.map +0 -1
- package/dist/compiler-BXcGyZUP.mjs.map +0 -1
- package/dist/config-C1k9vUrM.js.map +0 -1
- package/dist/config-CLYMN3_p.js +0 -26
- package/dist/config-CLYMN3_p.js.map +0 -1
- package/dist/config-DcYrUB-M.js +0 -6
- package/dist/config-oI_yS50f.js +0 -1
- package/dist/css-CELBp6Gu.js +0 -58
- package/dist/css-CELBp6Gu.js.map +0 -1
- package/dist/css-CohHH2tn.js.map +0 -1
- package/dist/css-D_DL1yOz.js +0 -237
- package/dist/css-D_DL1yOz.js.map +0 -1
- package/dist/css-DfH4Gb1c.js +0 -805
- package/dist/css-DfH4Gb1c.js.map +0 -1
- package/dist/data-Ze8GNiJm.js +0 -483
- package/dist/data-Ze8GNiJm.js.map +0 -1
- package/dist/debug-BefbXMq1.js +0 -15
- package/dist/debug-BefbXMq1.js.map +0 -1
- package/dist/debug-DLmUG3Vh.js +0 -172
- package/dist/debug-DLmUG3Vh.js.map +0 -1
- package/dist/debug-OG2wSB5R.js +0 -15
- package/dist/debug-OG2wSB5R.js.map +0 -1
- package/dist/dev-4TqJORRn.js +0 -75
- package/dist/dev-4TqJORRn.js.map +0 -1
- package/dist/dev-C2u78xuv.js.map +0 -1
- package/dist/elementMarker-BKzZyg5V.js.map +0 -1
- package/dist/extract-B9j4TBkU.js +0 -2
- package/dist/extract-CzWJeQi8.js +0 -121
- package/dist/extract-CzWJeQi8.js.map +0 -1
- package/dist/getClassName-C6690_nr.js.map +0 -1
- package/dist/global-C7GsCW6Y.js +0 -14
- package/dist/global-C7GsCW6Y.js.map +0 -1
- package/dist/global-zaCE-g1C.js.map +0 -1
- package/dist/hash-Bycpk3MR.js +0 -160
- package/dist/hash-Bycpk3MR.js.map +0 -1
- package/dist/jsx-Berx-L-r.js +0 -39
- package/dist/jsx-Berx-L-r.js.map +0 -1
- package/dist/jsx-DsMajv_M.js +0 -38
- package/dist/jsx-DsMajv_M.js.map +0 -1
- package/dist/jsx_runtime-CMdEXGNZ.js +0 -13
- package/dist/jsx_runtime-DPWo5qvV.js.map +0 -1
- package/dist/layer-DiNeeTgG.js +0 -94
- package/dist/layer-DiNeeTgG.js.map +0 -1
- package/dist/loader-DCT1Q9yi.mjs.map +0 -1
- package/dist/misc-o8pviMUi.mjs.map +0 -1
- package/dist/namedTokens-BUa6raTb.js.map +0 -1
- package/dist/presets-BhXa232U.js +0 -108
- package/dist/presets-BhXa232U.js.map +0 -1
- package/dist/property-BzZSTVIh.js +0 -406
- package/dist/property-BzZSTVIh.js.map +0 -1
- package/dist/rules-Dz7Pu2K6.js.map +0 -1
- package/dist/runtime-B3jHW9B1.js +0 -32
- package/dist/runtime-B3jHW9B1.js.map +0 -1
- package/dist/shared-B_gJf5uj.cjs.map +0 -1
- package/dist/shared-uAzFeq0x.mjs.map +0 -1
- package/dist/sheet-DasbRnvy.js +0 -7
- package/dist/sheet-DasbRnvy.js.map +0 -1
- package/dist/style-B0F1sgRZ.js +0 -5
- package/dist/style-BkeAZl0n.js.map +0 -1
- package/dist/style-CYXTs1iu.js +0 -771
- package/dist/style-CYXTs1iu.js.map +0 -1
- package/dist/style-DUztHzBz.js.map +0 -1
- package/dist/styleStore-BGJ2ZYtK.js +0 -2009
- package/dist/styleStore-BGJ2ZYtK.js.map +0 -1
- package/dist/styleStore-DVDp-gI-.js +0 -55
- package/dist/styleStore-DVDp-gI-.js.map +0 -1
- package/dist/token-CA1j7suG.js +0 -273
- package/dist/token-CA1j7suG.js.map +0 -1
- package/dist/token-CKXUECuU.js +0 -76
- package/dist/token-CKXUECuU.js.map +0 -1
- package/dist/token-DTOyFLmp.js +0 -58
- package/dist/token-DTOyFLmp.js.map +0 -1
- package/dist/transform-BTJOg8Hg.js.map +0 -1
- package/dist/utils-BsbfH6cd.js.map +0 -1
- package/dist/utils-CpA-dSpY.mjs +0 -97
- package/dist/utils-CpA-dSpY.mjs.map +0 -1
- package/dist/utils-D4YWF2K0.js.map +0 -1
- package/dist/utils-R6QadAsY.js +0 -170
- package/dist/utils-R6QadAsY.js.map +0 -1
- package/dist/value-CJG6EWe8.js +0 -85
- package/dist/value-CJG6EWe8.js.map +0 -1
- package/dist/value-D-ZcRzLA.js +0 -42
- package/dist/value-D-ZcRzLA.js.map +0 -1
- package/dist/value-DBtSe-9B.js +0 -1000
- package/dist/value-DBtSe-9B.js.map +0 -1
- package/dist/valueRef-CsLVJwjA.js +0 -16
- package/dist/valueRef-CsLVJwjA.js.map +0 -1
- package/dist/webpack-Fb9xF5jS.mjs.map +0 -1
- package/dist/withTokens-LRidu3Vc.js +0 -95
- package/dist/withTokens-LRidu3Vc.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as getSourcemapSidecar } from "./sidecar-
|
|
1
|
+
import { s as normalizePath } from "./compiler-oXXProzz.mjs";
|
|
2
|
+
import { B as createFileCssConfigHash, P as EXTRACTED_CSS_MARKER, R as writePluginCacheFile, T as getPluginCacheDir, _ as getStyleRuntimeMode, d as resolvePluginSourcemapFilePath, g as getStyleEntryDefines, h as getPluginBuildDevConfig, m as getPluginBuildConfig, t as formatError, w as createPluginCompiler, z as createFileCssCache } from "./misc-CRRQr1DT.mjs";
|
|
3
|
+
import { t as getSourcemapSidecar } from "./sidecar-DVegwGec.mjs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { Optimizer, Resolver, Runtime, Transformer } from "@parcel/plugin";
|
|
6
6
|
//#region plugin/bundler/parcel/shared.ts
|
|
@@ -12,7 +12,7 @@ let stateKey = "";
|
|
|
12
12
|
function getParcelState(options, pluginOptions = {}) {
|
|
13
13
|
const projectDir = options.projectRoot ?? process.cwd();
|
|
14
14
|
const dev = options.mode !== "production";
|
|
15
|
-
const cacheDir = getPluginCacheDir(projectDir, pluginOptions.
|
|
15
|
+
const cacheDir = getPluginCacheDir(projectDir, pluginOptions.cache?.location);
|
|
16
16
|
const key = JSON.stringify({
|
|
17
17
|
projectDir,
|
|
18
18
|
dev,
|
|
@@ -129,4 +129,4 @@ function createParcelError(error) {
|
|
|
129
129
|
//#endregion
|
|
130
130
|
export { createParcelError as a, getParcelExtractedCss as c, prependParcelRuntimeImport as d, replaceParcelDefines as f, writeParcelVirtualRuntimeFile as h, Transformer as i, getParcelState as l, writeParcelRuntimeFile as m, Resolver as n, createParcelRuntimeModuleSource as o, writeParcelCssFile as p, Runtime as r, ensureParcelSidecarStarted as s, Optimizer as t, isParcelGeneratedRuntimeFile as u };
|
|
131
131
|
|
|
132
|
-
//# sourceMappingURL=shared-
|
|
132
|
+
//# sourceMappingURL=shared-BmJmaxu8.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-BmJmaxu8.mjs","names":[],"sources":["../plugin/bundler/parcel/shared.ts"],"sourcesContent":["import { Optimizer, Resolver, Runtime, Transformer } from '@parcel/plugin';\nimport path from 'node:path';\nimport { normalizePath } from '../../../compiler/utils/path';\nimport type { BuildCssConfig } from '../../../config/build';\nimport {\n createFileCssCache,\n createFileCssConfigHash,\n createPluginCompiler,\n EXTRACTED_CSS_MARKER,\n type FileCssCache,\n getPluginBuildConfig,\n getPluginBuildDevConfig,\n getPluginCacheDir,\n type PluginCompiler,\n type PluginCssOutputOptions,\n type PluginOptions,\n resolvePluginSourcemapFilePath,\n writePluginCacheFile,\n} from '../../utils';\nimport { formatError } from '../../utils/misc';\nimport { getStyleEntryDefines, getStyleRuntimeMode } from '../../utils/runtimeEntry';\nimport { getSourcemapSidecar, type SourcemapSidecar } from '../../utils/sidecar';\n\nexport const PARCEL_RUNTIME_FILE = 'parcel-runtime.js';\nexport const PARCEL_VIRTUAL_RUNTIME_FILE = 'parcel-virtual-runtime.js';\nexport const PARCEL_CSS_FILE = 'parcel-style.css';\n\ntype ParcelPluginOptions = {\n mode?: string;\n projectRoot?: string;\n packageManager?: {\n resolve: (\n id: string,\n from: string,\n options?: Record<string, unknown> | null,\n ) => Promise<{ resolved: string; }>;\n };\n};\n\nexport type ParcelState = PluginCompiler & {\n entryDefines: Record<string, string>;\n cssCache: FileCssCache;\n cssConfig: BuildCssConfig;\n cssConfigHash: string;\n cssOutput: PluginCssOutputOptions | undefined;\n sidecar: SourcemapSidecar | null;\n};\n\nlet state: ParcelState | null = null;\nlet stateKey = '';\n\nexport { Optimizer, Resolver, Runtime, Transformer };\n\nexport function getParcelState(options: ParcelPluginOptions, pluginOptions: PluginOptions = {}) {\n const projectDir = options.projectRoot ?? process.cwd();\n const dev = options.mode !== 'production';\n const cacheDir = getPluginCacheDir(projectDir, pluginOptions.cache?.location);\n const key = JSON.stringify({ projectDir, dev, cacheDir });\n\n if (state && stateKey === key) return state;\n\n const devSourcemap = pluginOptions.devSourcemap ?? (dev ? 'sourceContent' : 'sourceUrl');\n\n const sidecar = devSourcemap === 'sidecarServer'\n ? getSourcemapSidecar({ projectDir, cacheDir })\n : null;\n\n const buildConfig = getPluginBuildConfig(pluginOptions);\n const buildDevConfig = getPluginBuildDevConfig(pluginOptions);\n const cssConfigHash = createFileCssConfigHash(buildConfig.css);\n\n const current = createPluginCompiler({\n projectDir,\n cacheDir,\n dev,\n options: {\n ...pluginOptions,\n devSourcemap,\n getSourcemapFilePath: resolvePluginSourcemapFilePath(\n pluginOptions.getSourcemapFilePath,\n sidecar,\n ),\n },\n runtimeMode: getStyleRuntimeMode(dev),\n });\n\n const cssCache = createFileCssCache({\n cacheDir,\n cacheSubdir: 'parcel-css',\n });\n\n state = {\n ...current,\n cssCache,\n cssConfig: buildConfig.css,\n cssConfigHash,\n cssOutput: pluginOptions.cssOutput,\n sidecar,\n entryDefines: getStyleEntryDefines(\n buildConfig,\n buildDevConfig,\n sidecar?.getBaseUrl() || null,\n ),\n };\n stateKey = key;\n\n return state;\n}\n\nexport async function ensureParcelSidecarStarted(current: ParcelState) {\n await current.sidecar?.ensureStarted();\n\n if (current.sidecar) {\n Object.assign(\n current.entryDefines,\n getStyleEntryDefines(\n getPluginBuildConfig({}),\n getPluginBuildDevConfig({}),\n current.sidecar.getBaseUrl(),\n ),\n );\n }\n}\n\nexport function replaceParcelDefines(code: string, current: ParcelState) {\n let next = code;\n\n for (const [key, value] of Object.entries(current.entryDefines)) {\n next = next.replace(new RegExp(`^\\\\s*declare\\\\s+const\\\\s+${key}\\\\s*:\\\\s*string\\\\s*;\\\\s*\\\\n?`, 'gm'), '');\n next = next.split(key).join(value);\n }\n\n return next;\n}\n\nexport function writeParcelRuntimeFile(current: ParcelState, source: string) {\n return writePluginCacheFile(current, PARCEL_RUNTIME_FILE, source);\n}\n\nexport function writeParcelVirtualRuntimeFile(current: ParcelState, source: string) {\n return writePluginCacheFile(current, PARCEL_VIRTUAL_RUNTIME_FILE, source);\n}\n\nexport function writeParcelCssFile(current: ParcelState) {\n return writePluginCacheFile(current, PARCEL_CSS_FILE, EXTRACTED_CSS_MARKER);\n}\n\nexport function createParcelRuntimeModuleSource(current: ParcelState) {\n const cssFilePath = !current.dev ? writeParcelCssFile(current) : null;\n\n return [\n cssFilePath && `import ${\n JSON.stringify(toParcelImportPath(path.relative(\n current.cacheDir,\n cssFilePath,\n )))\n };`,\n '',\n ].filter(Boolean).join('\\n');\n}\n\nexport function prependParcelRuntimeImport(\n code: string,\n current: ParcelState,\n sourceFilePath: string,\n) {\n const runtimeFilePath = writeParcelVirtualRuntimeFile(\n current,\n createParcelRuntimeModuleSource(current),\n );\n const runtimeImportPath = toParcelImportPath(path.relative(\n path.dirname(sourceFilePath),\n runtimeFilePath,\n ));\n\n if (code.includes(runtimeImportPath)) return code;\n\n return `import ${JSON.stringify(runtimeImportPath)};\\n${code}`;\n}\n\nexport function isParcelGeneratedRuntimeFile(current: ParcelState, filePath: string) {\n const normalized = normalizePath(filePath);\n\n return normalized === normalizePath(resolveParcelCacheFile(current, PARCEL_RUNTIME_FILE)) ||\n normalized === normalizePath(resolveParcelCacheFile(current, PARCEL_VIRTUAL_RUNTIME_FILE));\n}\n\nexport function getParcelExtractedCss(current: ParcelState) {\n const localCss = current.cssCache.getCss({\n ...current.cssConfig,\n configHash: current.cssConfigHash,\n });\n\n if (localCss) return localCss;\n\n let dir = current.projectDir;\n const seen = new Set([current.cacheDir]);\n\n while (true) {\n const cacheDir = getPluginCacheDir(dir);\n\n if (!seen.has(cacheDir)) {\n const css = createFileCssCache({\n cacheDir,\n cacheSubdir: 'parcel-css',\n }).getCss({\n ...current.cssConfig,\n configHash: current.cssConfigHash,\n });\n\n if (css) return css;\n seen.add(cacheDir);\n }\n\n const next = path.dirname(dir);\n if (next === dir) return '';\n dir = next;\n }\n}\n\nexport function resolveParcelCacheFile(current: ParcelState, fileName: string) {\n return path.join(current.cacheDir, fileName);\n}\n\nfunction toParcelImportPath(filePath: string) {\n const normalized = normalizePath(filePath);\n\n return normalized.startsWith('.') ? normalized : `./${normalized}`;\n}\n\nexport function createParcelError(error: unknown) {\n const message = error instanceof Error ? error.message : String(error);\n return new Error(formatError(message));\n}\n"],"mappings":";;;;;;AAuBA,MAAa,sBAAsB;AACnC,MAAa,8BAA8B;AAC3C,MAAa,kBAAkB;AAuB/B,IAAI,QAA4B;AAChC,IAAI,WAAW;AAIf,SAAgB,eAAe,SAA8B,gBAA+B,CAAC,GAAG;CAC9F,MAAM,aAAa,QAAQ,eAAe,QAAQ,IAAI;CACtD,MAAM,MAAM,QAAQ,SAAS;CAC7B,MAAM,WAAW,kBAAkB,YAAY,cAAc,OAAO,QAAQ;CAC5E,MAAM,MAAM,KAAK,UAAU;EAAE;EAAY;EAAK;CAAS,CAAC;CAExD,IAAI,SAAS,aAAa,KAAK,OAAO;CAEtC,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,QAAQ;EACnB;EAEA,MAAM,OAAO,KAAK,QAAQ,GAAG;EAC7B,IAAI,SAAS,KAAK,OAAO;EACzB,MAAM;CACR;AACF;AAEA,SAAgB,uBAAuB,SAAsB,UAAkB;CAC7E,OAAO,KAAK,KAAK,QAAQ,UAAU,QAAQ;AAC7C;AAEA,SAAS,mBAAmB,UAAkB;CAC5C,MAAM,aAAa,cAAc,QAAQ;CAEzC,OAAO,WAAW,WAAW,GAAG,IAAI,aAAa,KAAK;AACxD;AAEA,SAAgB,kBAAkB,OAAgB;CAChD,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;CACrE,OAAO,IAAI,MAAM,YAAY,OAAO,CAAC;AACvC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { $t as getRuntimeDocument, At as createStyleSheet, Gt as createNoopSheet, _n as RUNTIME_CONFIG, bn as getGlobalData, en as onRuntimeDocumentChange, ln as setBuildDebugClassName, on as set, rn as setBuildDevConfig, un as setBuildConfig, vn as SIDECAR_URL_GLOBAL_SYMBOL, xn as globalData, yn as clearGlobalData } from "./styleStore-D4umgIwQ.js";
|
|
2
|
+
//#region entry/shared/utils.ts
|
|
3
|
+
function readEntryDefine(key, readDefine, fallback) {
|
|
4
|
+
let defineValue;
|
|
5
|
+
try {
|
|
6
|
+
defineValue = readDefine();
|
|
7
|
+
} catch {
|
|
8
|
+
defineValue = void 0;
|
|
9
|
+
}
|
|
10
|
+
if (typeof defineValue === "string") return defineValue;
|
|
11
|
+
const value = globalThis[key];
|
|
12
|
+
return typeof value === "string" ? value : fallback;
|
|
13
|
+
}
|
|
14
|
+
function readEntryJsonDefine(key, readDefine, fallback) {
|
|
15
|
+
return JSON.parse(readEntryDefine(key, readDefine, JSON.stringify(fallback)));
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region entry/shared/config_dev.ts
|
|
19
|
+
const buildConfig = readEntryJsonDefine("FLUENTIC_STYLE_BUILD_CONFIG", () => FLUENTIC_STYLE_BUILD_CONFIG, {
|
|
20
|
+
hoist: false,
|
|
21
|
+
css: {}
|
|
22
|
+
});
|
|
23
|
+
setBuildConfig(buildConfig);
|
|
24
|
+
setBuildDebugClassName(buildConfig.css?.debugClassName, false);
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region entry/shared/dev.ts
|
|
27
|
+
set(globalThis, Symbol.for(SIDECAR_URL_GLOBAL_SYMBOL), readEntryDefine("FLUENTIC_STYLE_SIDECAR_SERVER_URL", () => FLUENTIC_STYLE_SIDECAR_SERVER_URL, ""));
|
|
28
|
+
setBuildDevConfig(readEntryJsonDefine("FLUENTIC_STYLE_DEV_CONFIG", () => FLUENTIC_STYLE_DEV_CONFIG, {}));
|
|
29
|
+
RUNTIME_CONFIG.isPlugin = true;
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region entry/rsc_dev/config.ts
|
|
32
|
+
RUNTIME_CONFIG.isRSC = true;
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region runtime/sheet/document.ts
|
|
35
|
+
const GLOBAL_KEY = "runtime.sheet.global";
|
|
36
|
+
const state = globalData("runtime.sheet.document", () => ({ document: getRuntimeDocument() }));
|
|
37
|
+
function resetSheet() {
|
|
38
|
+
getGlobalData(GLOBAL_KEY)?.destroy?.();
|
|
39
|
+
clearGlobalData(GLOBAL_KEY);
|
|
40
|
+
state.document = getRuntimeDocument();
|
|
41
|
+
}
|
|
42
|
+
onRuntimeDocumentChange(resetSheet);
|
|
43
|
+
function getDocumentSheet(create) {
|
|
44
|
+
const document = getRuntimeDocument();
|
|
45
|
+
if (state.document !== document) resetSheet();
|
|
46
|
+
return globalData(GLOBAL_KEY, () => document ? create({ document }) : createNoopSheet());
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region runtime/sheet/global.ts
|
|
50
|
+
function getGlobalSheet() {
|
|
51
|
+
return getDocumentSheet(createStyleSheet);
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { getGlobalSheet as t };
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=sheet-CHnDkjn4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet-CHnDkjn4.js","names":[],"sources":["../entry/shared/utils.ts","../entry/shared/config_dev.ts","../entry/shared/dev.ts","../entry/rsc_dev/config.ts","../runtime/sheet/document.ts","../runtime/sheet/global.ts"],"sourcesContent":["export function readEntryDefine(\n key: string,\n readDefine: () => unknown,\n fallback: string,\n) {\n let defineValue: unknown;\n\n try {\n defineValue = readDefine();\n } catch {\n defineValue = undefined;\n }\n\n if (typeof defineValue === 'string') return defineValue;\n\n const value = (globalThis as Record<string, unknown>)[key];\n return typeof value === 'string' ? value : fallback;\n}\n\nexport function readEntryJsonDefine<T>(\n key: string,\n readDefine: () => unknown,\n fallback: T,\n): T {\n return JSON.parse(\n readEntryDefine(key, readDefine, JSON.stringify(fallback)),\n ) as T;\n}\n","import { type BuildConfig, setBuildConfig } from '../../config/build';\nimport { setBuildDebugClassName } from '../../config/config/debug';\nimport { readEntryJsonDefine } from './utils';\n\ndeclare const FLUENTIC_STYLE_BUILD_CONFIG: string;\n\nconst buildConfig = readEntryJsonDefine<BuildConfig>(\n 'FLUENTIC_STYLE_BUILD_CONFIG',\n () => FLUENTIC_STYLE_BUILD_CONFIG,\n { hoist: false, css: {} } satisfies BuildConfig,\n);\n\nsetBuildConfig(buildConfig);\nsetBuildDebugClassName(buildConfig.css?.debugClassName, false);\n","import { setBuildDevConfig } from '../../config/config/dev';\nimport { RUNTIME_CONFIG } from '../../config/config/runtime';\nimport { SIDECAR_URL_GLOBAL_SYMBOL } from '../../config/utils';\nimport { set } from '../../utils/object';\nimport { readEntryDefine, readEntryJsonDefine } from './utils';\n\ndeclare const FLUENTIC_STYLE_SIDECAR_SERVER_URL: string;\ndeclare const FLUENTIC_STYLE_DEV_CONFIG: string;\n\nset(\n globalThis,\n Symbol.for(SIDECAR_URL_GLOBAL_SYMBOL),\n readEntryDefine(\n 'FLUENTIC_STYLE_SIDECAR_SERVER_URL',\n () => FLUENTIC_STYLE_SIDECAR_SERVER_URL,\n '',\n ),\n);\n\nsetBuildDevConfig(\n readEntryJsonDefine(\n 'FLUENTIC_STYLE_DEV_CONFIG',\n () => FLUENTIC_STYLE_DEV_CONFIG,\n {},\n ),\n);\n\nRUNTIME_CONFIG.isPlugin = true;\n","import { RUNTIME_CONFIG } from '../../config/config/runtime';\n\nimport '../shared/config_dev';\nimport '../shared/dev';\n\nRUNTIME_CONFIG.isRSC = true;\n","import { getRuntimeDocument, onRuntimeDocumentChange } from '../../config/document';\nimport type { SheetOptions, StyleSheet } from '../../sheet/types';\nimport { createNoopSheet } from '../../sheet/utils/noop';\nimport { clearGlobalData, getGlobalData, globalData, setGlobalData } from '../../utils/global';\n\nconst GLOBAL_KEY = 'runtime.sheet.global';\nconst state = globalData<{ document: Document | null; }>('runtime.sheet.document', () => ({\n document: getRuntimeDocument(),\n}));\n\nfunction resetSheet() {\n getGlobalData<StyleSheet>(GLOBAL_KEY)?.destroy?.();\n clearGlobalData(GLOBAL_KEY);\n state.document = getRuntimeDocument();\n}\n\nonRuntimeDocumentChange(resetSheet);\n\nexport function getDocumentSheet(create: (options: SheetOptions) => StyleSheet): StyleSheet {\n const document = getRuntimeDocument();\n if (state.document !== document) resetSheet();\n return globalData(GLOBAL_KEY, () => document ? create({ document }) : createNoopSheet());\n}\n\nexport function setDocumentSheet(sheet: StyleSheet) {\n state.document = getRuntimeDocument();\n setGlobalData(GLOBAL_KEY, sheet);\n}\n","import { createStyleSheet } from '../../sheet';\nimport type { StyleSheet } from '../../sheet';\nimport { getDocumentSheet, setDocumentSheet } from './document';\n\nexport function getGlobalSheet(): StyleSheet {\n return getDocumentSheet(createStyleSheet);\n}\n\nexport function setGlobalSheet(sheet: StyleSheet): void {\n setDocumentSheet(sheet);\n}\n"],"mappings":";;AAAA,SAAgB,gBACd,KACA,YACA,UACA;CACA,IAAI;CAEJ,IAAI;EACF,cAAc,WAAW;CAC3B,QAAQ;EACN,cAAc,KAAA;CAChB;CAEA,IAAI,OAAO,gBAAgB,UAAU,OAAO;CAE5C,MAAM,QAAS,WAAuC;CACtD,OAAO,OAAO,UAAU,WAAW,QAAQ;AAC7C;AAEA,SAAgB,oBACd,KACA,YACA,UACG;CACH,OAAO,KAAK,MACV,gBAAgB,KAAK,YAAY,KAAK,UAAU,QAAQ,CAAC,CAC3D;AACF;;;ACrBA,MAAM,cAAc,oBAClB,qCACM,6BACN;CAAE,OAAO;CAAO,KAAK,CAAC;AAAE,CAC1B;AAEA,eAAe,WAAW;AAC1B,uBAAuB,YAAY,KAAK,gBAAgB,KAAK;;;ACJ7D,IACE,YACA,OAAO,IAAI,yBAAyB,GACpC,gBACE,2CACM,mCACN,EACF,CACF;AAEA,kBACE,oBACE,mCACM,2BACN,CAAC,CACH,CACF;AAEA,eAAe,WAAW;;;ACtB1B,eAAe,QAAQ;;;ACAvB,MAAM,aAAa;AACnB,MAAM,QAAQ,WAA2C,iCAAiC,EACxF,UAAU,mBAAmB,EAC/B,EAAE;AAEF,SAAS,aAAa;CACpB,cAA0B,UAAU,GAAG,UAAU;CACjD,gBAAgB,UAAU;CAC1B,MAAM,WAAW,mBAAmB;AACtC;AAEA,wBAAwB,UAAU;AAElC,SAAgB,iBAAiB,QAA2D;CAC1F,MAAM,WAAW,mBAAmB;CACpC,IAAI,MAAM,aAAa,UAAU,WAAW;CAC5C,OAAO,WAAW,kBAAkB,WAAW,OAAO,EAAE,SAAS,CAAC,IAAI,gBAAgB,CAAC;AACzF;;;AClBA,SAAgB,iBAA6B;CAC3C,OAAO,iBAAiB,gBAAgB;AAC1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet-PVxRQrOp.js","names":[],"sources":["../entry/dev/sheet.ts"],"sourcesContent":["import { getDocumentSheet } from '../../runtime/sheet/document';\nimport { createDevSheet } from '../../sheet/dev';\n\n// Vite can evaluate this entry through both source imports and optimized dependencies.\n// Reuse the document sheet so previously injected global rules remain registered.\ngetDocumentSheet(createDevSheet);\n"],"mappings":";;;AAKA,iBAAiB,cAAc"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./env-C8lKN1dB.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as formatError } from "./misc-
|
|
1
|
+
import { h as globalData } from "./compiler-oXXProzz.mjs";
|
|
2
|
+
import { t as formatError } from "./misc-CRRQr1DT.mjs";
|
|
3
3
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { createServer } from "node:http";
|
|
@@ -233,4 +233,4 @@ async function startServer(state) {
|
|
|
233
233
|
//#endregion
|
|
234
234
|
export { getSourcemapSidecar as t };
|
|
235
235
|
|
|
236
|
-
//# sourceMappingURL=sidecar-
|
|
236
|
+
//# sourceMappingURL=sidecar-DVegwGec.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidecar-BUO1hKXu.mjs","names":[],"sources":["../plugin/utils/sidecar/utils.ts","../plugin/utils/sidecar/server.ts","../plugin/utils/sidecar/sidecar.ts"],"sourcesContent":["import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';\nimport path from 'node:path';\n\nexport type GetPortFilePathArgs = {\n cacheDir: string;\n};\n\nexport type GetRoutePathArgs = {\n filePath: string;\n projectDir: string;\n relativePath?: string | null;\n};\n\nexport type CreateSourceUrlArgs = {\n baseUrl: string;\n routePath: string;\n};\n\nexport type NormalizeRoutePathArgs = {\n routePath: string;\n};\n\nexport type ReadCachedPortArgs = {\n filePath: string;\n};\n\nexport type WriteCachedPortArgs = {\n filePath: string;\n port: number;\n};\n\nexport type IsPortUnavailableErrorArgs = {\n error: unknown;\n};\n\nexport function getPortFilePath(args: GetPortFilePathArgs) {\n return path.join(args.cacheDir, 'sidecar', 'port.json');\n}\n\nexport function getRoutePath(args: GetRoutePathArgs) {\n const routePath = normalizeRoutePath(\n args.relativePath || path.relative(args.projectDir, args.filePath),\n );\n\n return routePath || '/' + path.basename(args.filePath);\n}\n\nexport function normalizeSidecarRoutePath(args: NormalizeRoutePathArgs) {\n if (args.routePath.startsWith('source://@')) {\n return normalizeRoutePath(args.routePath.slice('source://'.length));\n }\n\n try {\n const url = new URL(args.routePath, 'http://127.0.0.1');\n return normalizeRoutePath(url.pathname);\n } catch {\n return normalizeRoutePath(args.routePath);\n }\n}\n\nexport function createSourceUrl(args: CreateSourceUrlArgs) {\n return `${args.baseUrl.replace(/\\/+$/, '')}${encodeURI(args.routePath)}`;\n}\n\nexport function getRequestPathname(url: string | undefined) {\n if (!url) return null;\n\n try {\n return decodeURI(new URL(url, 'http://127.0.0.1').pathname);\n } catch {\n return null;\n }\n}\n\nexport function readCachedPort(args: ReadCachedPortArgs) {\n try {\n const file = JSON.parse(readFileSync(args.filePath, 'utf8')) as { port?: unknown; };\n const port = file.port;\n return typeof port === 'number' && Number.isInteger(port) && port > 0 ? port : null;\n } catch {\n return null;\n }\n}\n\nexport function writeCachedPort(args: WriteCachedPortArgs) {\n try {\n mkdirSync(path.dirname(args.filePath), { recursive: true });\n writeFileSync(args.filePath, JSON.stringify({ port: args.port }), 'utf8');\n } catch {\n // The sidecar still works if the sticky-port cache cannot be written.\n }\n}\n\nexport function isPortUnavailableError(args: IsPortUnavailableErrorArgs) {\n if (!(args.error instanceof Error)) return false;\n\n const code = (args.error as NodeJS.ErrnoException).code;\n return code === 'EADDRINUSE' || code === 'EACCES';\n}\n\nfunction normalizeRoutePath(filePath: string) {\n const normalized = filePath\n .replace(/\\\\/g, '/')\n .replace(/^(\\.\\.\\/)+/, '')\n .replace(/^\\.?\\//, '')\n .replace(/\\/+/g, '/');\n\n return normalized ? `/${normalized}` : '';\n}\n","import { existsSync, readFileSync } from 'node:fs';\nimport { createServer, type Server } from 'node:http';\nimport path from 'node:path';\nimport { formatError } from '../misc';\nimport { getRequestPathname, isPortUnavailableError, readCachedPort, writeCachedPort } from './utils';\n\nexport const SIDECAR_HOST = '127.0.0.1';\n\nexport type CreateSidecarServerArgs = {\n projectDir: string;\n routes: Map<string, string>;\n handlers?: Map<string, SidecarRouteHandler>;\n};\n\nexport type SidecarRouteResponse = {\n body: string | Buffer;\n contentType?: string;\n};\n\nexport type SidecarRouteHandler = () => SidecarRouteResponse | null | Promise<SidecarRouteResponse | null>;\n\nexport type StartSidecarServerArgs = {\n host?: string;\n portFilePath: string;\n server: Server;\n};\n\nexport function createSidecarServer(args: CreateSidecarServerArgs) {\n return createServer(async (req, res) => {\n const pathname = getRequestPathname(req.url);\n const handler = pathname ? args.handlers?.get(pathname) : null;\n\n if (handler) {\n const response = await handler();\n\n if (!response) {\n res.statusCode = 404;\n res.end('Not found');\n return;\n }\n\n res.setHeader('Access-Control-Allow-Origin', '*');\n res.setHeader('Content-Type', response.contentType ?? 'text/plain; charset=utf-8');\n res.setHeader('X-Content-Type-Options', 'nosniff');\n\n res.statusCode = 200;\n res.end(response.body);\n return;\n }\n\n const filePath = pathname\n ? args.routes.get(pathname) ?? getProjectSourcePath(args.projectDir, pathname)\n : null;\n\n if (!filePath || !existsSync(filePath)) {\n res.statusCode = 404;\n res.end('Not found');\n return;\n }\n\n res.setHeader('Access-Control-Allow-Origin', '*');\n res.setHeader('Content-Type', 'text/plain; charset=utf-8');\n res.setHeader('X-Content-Type-Options', 'nosniff');\n\n res.statusCode = 200;\n res.end(readFileSync(filePath, 'utf8'));\n });\n}\n\nfunction getProjectSourcePath(projectDir: string, pathname: string) {\n const sourcePath = pathname\n .replace(/^\\/+/, '')\n .replace(/^@\\/?/, '');\n\n if (!sourcePath || sourcePath.startsWith('..')) return null;\n\n const filePath = path.resolve(projectDir, sourcePath);\n const projectPath = path.resolve(projectDir);\n\n return filePath === projectPath || filePath.startsWith(projectPath + path.sep)\n ? filePath\n : null;\n}\n\nexport async function startSidecarServer(args: StartSidecarServerArgs) {\n const host = args.host ?? SIDECAR_HOST;\n const cachedPort = readCachedPort({ filePath: args.portFilePath });\n\n if (cachedPort !== null) {\n try {\n return await listen({ server: args.server, host, port: cachedPort });\n } catch (error) {\n if (!isPortUnavailableError({ error })) throw error;\n }\n }\n\n const port = await listen({ server: args.server, host, port: 0 });\n\n writeCachedPort({ filePath: args.portFilePath, port });\n\n return port;\n}\n\ntype ListenArgs = {\n host: string;\n port: number;\n server: Server;\n};\n\nfunction listen(args: ListenArgs) {\n return new Promise<number>((resolve, reject) => {\n const cleanup = () => {\n args.server.off('error', onError);\n args.server.off('listening', onListening);\n };\n\n const onError = (error: Error) => {\n cleanup();\n reject(error);\n };\n\n const onListening = () => {\n cleanup();\n\n const address = args.server.address();\n\n if (\n !address ||\n typeof address !== 'object' ||\n typeof address.port !== 'number'\n ) {\n reject(new Error(formatError('Sourcemap sidecar server started without a TCP port.')));\n return;\n }\n\n resolve(address.port);\n };\n\n args.server.once('error', onError);\n args.server.once('listening', onListening);\n args.server.listen(args.port, args.host);\n });\n}\n","import type { Server } from 'node:http';\nimport path from 'node:path';\nimport { globalData } from '../../../utils/global';\nimport { formatError } from '../misc';\nimport { createSidecarServer, SIDECAR_HOST, type SidecarRouteHandler, startSidecarServer } from './server';\nimport { createSourceUrl, getPortFilePath, getRoutePath, normalizeSidecarRoutePath } from './utils';\n\ntype SidecarServer = {\n cacheDir: string;\n handlers: Map<string, SidecarRouteHandler>;\n projectDir: string;\n port: number | null;\n portFilePath: string;\n routes: Map<string, string>;\n server: Server;\n startError: Error | null;\n startPromise: Promise<void>;\n};\n\nexport type SourcemapSidecar = {\n cacheDir: string;\n projectDir: string;\n ensureStarted(): Promise<void>;\n getBaseUrl(): string | null;\n getRouteUrl(routePath: string): string;\n getSourceUrl(filePath: string, relativePath?: string | null): string;\n registerSource(filePath: string, routePath: string): string;\n registerRoute(routePath: string, handler: SidecarRouteHandler): string;\n};\n\nexport type SourcemapSidecarArgs = {\n cacheDir: string;\n projectDir: string;\n routes?: Record<string, SidecarRouteHandler>;\n};\n\nconst sidecarServers = globalData(\n 'plugin.sidecar.servers',\n () => new Map<string, SidecarServer>(),\n);\n\nexport function getSourcemapSidecar(args: SourcemapSidecarArgs): SourcemapSidecar {\n const normalizedProjectDir = path.resolve(args.projectDir);\n const normalizedCacheDir = path.resolve(args.cacheDir);\n const state = getOrCreateServer(normalizedProjectDir, normalizedCacheDir);\n\n if (args.routes) {\n for (const [routePath, handler] of Object.entries(args.routes)) {\n state.handlers.set(normalizeSidecarRoutePath({ routePath }), handler);\n }\n }\n\n return {\n cacheDir: normalizedCacheDir,\n projectDir: normalizedProjectDir,\n ensureStarted() {\n return state.startPromise;\n },\n getBaseUrl() {\n return createSidecarBaseUrl(state);\n },\n getRouteUrl(routePath) {\n return createSidecarSourceUrl(\n state,\n normalizeSidecarRoutePath({ routePath }),\n );\n },\n getSourceUrl(filePath, relativePath) {\n return createSidecarSourceUrl(\n state,\n getRoutePath({\n filePath,\n projectDir: normalizedProjectDir,\n relativePath,\n }),\n );\n },\n registerSource(filePath, routePath) {\n routePath = normalizeSidecarRoutePath({ routePath });\n\n state.routes.set(routePath, path.resolve(filePath));\n\n return createSidecarSourceUrl(state, routePath);\n },\n registerRoute(routePath, handler) {\n routePath = normalizeSidecarRoutePath({ routePath });\n\n state.handlers.set(routePath, handler);\n\n return createSidecarSourceUrl(state, routePath);\n },\n };\n}\n\nfunction createSidecarBaseUrl(state: SidecarServer) {\n if (state.startError || state.port === null) return null;\n\n return `http://${SIDECAR_HOST}:${state.port}`;\n}\n\nfunction createSidecarSourceUrl(state: SidecarServer, routePath: string) {\n if (state.startError) {\n throw new Error(formatError(\n `The sourcemap dev server could not start: ${state.startError.message}`,\n ));\n }\n\n if (state.port === null) {\n throw new Error(formatError(\n 'The sourcemap dev server is not ready yet. Try rebuilding after the dev server finishes starting.',\n ));\n }\n\n const baseUrl = createSidecarBaseUrl(state);\n\n if (baseUrl === null) {\n throw new Error(formatError(\n 'The sourcemap dev server is not ready yet. Try rebuilding after the dev server finishes starting.',\n ));\n }\n\n return createSourceUrl({\n baseUrl,\n routePath,\n });\n}\n\nfunction getOrCreateServer(projectDir: string, cacheDir: string) {\n const servers = sidecarServers;\n\n const existing = servers.get(cacheDir);\n if (existing) return existing;\n\n const routes = new Map<string, string>();\n const handlers = new Map<string, SidecarRouteHandler>();\n\n const state: SidecarServer = {\n cacheDir,\n handlers,\n projectDir,\n port: null,\n portFilePath: getPortFilePath({ cacheDir }),\n routes,\n server: createSidecarServer({ projectDir, routes, handlers }),\n startError: null,\n startPromise: Promise.resolve(),\n };\n\n state.startPromise = startServer(state).catch((error: Error) => {\n state.startError = error;\n throw error;\n });\n\n state.startPromise.catch(() => {});\n state.server.unref();\n servers.set(cacheDir, state);\n\n return state;\n}\n\nasync function startServer(state: SidecarServer) {\n state.port = await startSidecarServer({\n host: SIDECAR_HOST,\n portFilePath: state.portFilePath,\n server: state.server,\n });\n}\n"],"mappings":";;;;;;AAmCA,SAAgB,gBAAgB,MAA2B;CACzD,OAAO,KAAK,KAAK,KAAK,UAAU,WAAW,WAAW;AACxD;AAEA,SAAgB,aAAa,MAAwB;CAKnD,OAJkB,mBAChB,KAAK,gBAAgB,KAAK,SAAS,KAAK,YAAY,KAAK,QAAQ,CAGpD,KAAK,MAAM,KAAK,SAAS,KAAK,QAAQ;AACvD;AAEA,SAAgB,0BAA0B,MAA8B;CACtE,IAAI,KAAK,UAAU,WAAW,YAAY,GACxC,OAAO,mBAAmB,KAAK,UAAU,MAAM,CAAkB,CAAC;CAGpE,IAAI;EAEF,OAAO,mBAAmB,IADV,IAAI,KAAK,WAAW,kBACR,EAAE,QAAQ;CACxC,QAAQ;EACN,OAAO,mBAAmB,KAAK,SAAS;CAC1C;AACF;AAEA,SAAgB,gBAAgB,MAA2B;CACzD,OAAO,GAAG,KAAK,QAAQ,QAAQ,QAAQ,EAAE,IAAI,UAAU,KAAK,SAAS;AACvE;AAEA,SAAgB,mBAAmB,KAAyB;CAC1D,IAAI,CAAC,KAAK,OAAO;CAEjB,IAAI;EACF,OA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C;CACjC,MAAM,OAAO,MAAM;CACnB,QAAQ,IAAI,UAAU,KAAK;CAE3B,OAAO;AACT;AAEA,eAAe,YAAY,OAAsB;CAC/C,MAAM,OAAO,MAAM,mBAAmB;EACpC,MAAM;EACN,cAAc,MAAM;EACpB,QAAQ,MAAM;CAChB,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"sidecar-DVegwGec.mjs","names":[],"sources":["../plugin/utils/sidecar/utils.ts","../plugin/utils/sidecar/server.ts","../plugin/utils/sidecar/sidecar.ts"],"sourcesContent":["import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';\nimport path from 'node:path';\n\nexport type GetPortFilePathArgs = {\n cacheDir: string;\n};\n\nexport type GetRoutePathArgs = {\n filePath: string;\n projectDir: string;\n relativePath?: string | null;\n};\n\nexport type CreateSourceUrlArgs = {\n baseUrl: string;\n routePath: string;\n};\n\nexport type NormalizeRoutePathArgs = {\n routePath: string;\n};\n\nexport type ReadCachedPortArgs = {\n filePath: string;\n};\n\nexport type WriteCachedPortArgs = {\n filePath: string;\n port: number;\n};\n\nexport type IsPortUnavailableErrorArgs = {\n error: unknown;\n};\n\nexport function getPortFilePath(args: GetPortFilePathArgs) {\n return path.join(args.cacheDir, 'sidecar', 'port.json');\n}\n\nexport function getRoutePath(args: GetRoutePathArgs) {\n const routePath = normalizeRoutePath(\n args.relativePath || path.relative(args.projectDir, args.filePath),\n );\n\n return routePath || '/' + path.basename(args.filePath);\n}\n\nexport function normalizeSidecarRoutePath(args: NormalizeRoutePathArgs) {\n if (args.routePath.startsWith('source://@')) {\n return normalizeRoutePath(args.routePath.slice('source://'.length));\n }\n\n try {\n const url = new URL(args.routePath, 'http://127.0.0.1');\n return normalizeRoutePath(url.pathname);\n } catch {\n return normalizeRoutePath(args.routePath);\n }\n}\n\nexport function createSourceUrl(args: CreateSourceUrlArgs) {\n return `${args.baseUrl.replace(/\\/+$/, '')}${encodeURI(args.routePath)}`;\n}\n\nexport function getRequestPathname(url: string | undefined) {\n if (!url) return null;\n\n try {\n return decodeURI(new URL(url, 'http://127.0.0.1').pathname);\n } catch {\n return null;\n }\n}\n\nexport function readCachedPort(args: ReadCachedPortArgs) {\n try {\n const file = JSON.parse(readFileSync(args.filePath, 'utf8')) as { port?: unknown; };\n const port = file.port;\n return typeof port === 'number' && Number.isInteger(port) && port > 0 ? port : null;\n } catch {\n return null;\n }\n}\n\nexport function writeCachedPort(args: WriteCachedPortArgs) {\n try {\n mkdirSync(path.dirname(args.filePath), { recursive: true });\n writeFileSync(args.filePath, JSON.stringify({ port: args.port }), 'utf8');\n } catch {\n // The sidecar still works if the sticky-port cache cannot be written.\n }\n}\n\nexport function isPortUnavailableError(args: IsPortUnavailableErrorArgs) {\n if (!(args.error instanceof Error)) return false;\n\n const code = (args.error as NodeJS.ErrnoException).code;\n return code === 'EADDRINUSE' || code === 'EACCES';\n}\n\nfunction normalizeRoutePath(filePath: string) {\n const normalized = filePath\n .replace(/\\\\/g, '/')\n .replace(/^(\\.\\.\\/)+/, '')\n .replace(/^\\.?\\//, '')\n .replace(/\\/+/g, '/');\n\n return normalized ? `/${normalized}` : '';\n}\n","import { existsSync, readFileSync } from 'node:fs';\nimport { createServer, type Server } from 'node:http';\nimport path from 'node:path';\nimport { formatError } from '../misc';\nimport { getRequestPathname, isPortUnavailableError, readCachedPort, writeCachedPort } from './utils';\n\nexport const SIDECAR_HOST = '127.0.0.1';\n\nexport type CreateSidecarServerArgs = {\n projectDir: string;\n routes: Map<string, string>;\n handlers?: Map<string, SidecarRouteHandler>;\n};\n\nexport type SidecarRouteResponse = {\n body: string | Buffer;\n contentType?: string;\n};\n\nexport type SidecarRouteHandler = () => SidecarRouteResponse | null | Promise<SidecarRouteResponse | null>;\n\nexport type StartSidecarServerArgs = {\n host?: string;\n portFilePath: string;\n server: Server;\n};\n\nexport function createSidecarServer(args: CreateSidecarServerArgs) {\n return createServer(async (req, res) => {\n const pathname = getRequestPathname(req.url);\n const handler = pathname ? args.handlers?.get(pathname) : null;\n\n if (handler) {\n const response = await handler();\n\n if (!response) {\n res.statusCode = 404;\n res.end('Not found');\n return;\n }\n\n res.setHeader('Access-Control-Allow-Origin', '*');\n res.setHeader('Content-Type', response.contentType ?? 'text/plain; charset=utf-8');\n res.setHeader('X-Content-Type-Options', 'nosniff');\n\n res.statusCode = 200;\n res.end(response.body);\n return;\n }\n\n const filePath = pathname\n ? args.routes.get(pathname) ?? getProjectSourcePath(args.projectDir, pathname)\n : null;\n\n if (!filePath || !existsSync(filePath)) {\n res.statusCode = 404;\n res.end('Not found');\n return;\n }\n\n res.setHeader('Access-Control-Allow-Origin', '*');\n res.setHeader('Content-Type', 'text/plain; charset=utf-8');\n res.setHeader('X-Content-Type-Options', 'nosniff');\n\n res.statusCode = 200;\n res.end(readFileSync(filePath, 'utf8'));\n });\n}\n\nfunction getProjectSourcePath(projectDir: string, pathname: string) {\n const sourcePath = pathname\n .replace(/^\\/+/, '')\n .replace(/^@\\/?/, '');\n\n if (!sourcePath || sourcePath.startsWith('..')) return null;\n\n const filePath = path.resolve(projectDir, sourcePath);\n const projectPath = path.resolve(projectDir);\n\n return filePath === projectPath || filePath.startsWith(projectPath + path.sep)\n ? filePath\n : null;\n}\n\nexport async function startSidecarServer(args: StartSidecarServerArgs) {\n const host = args.host ?? SIDECAR_HOST;\n const cachedPort = readCachedPort({ filePath: args.portFilePath });\n\n if (cachedPort !== null) {\n try {\n return await listen({ server: args.server, host, port: cachedPort });\n } catch (error) {\n if (!isPortUnavailableError({ error })) throw error;\n }\n }\n\n const port = await listen({ server: args.server, host, port: 0 });\n\n writeCachedPort({ filePath: args.portFilePath, port });\n\n return port;\n}\n\ntype ListenArgs = {\n host: string;\n port: number;\n server: Server;\n};\n\nfunction listen(args: ListenArgs) {\n return new Promise<number>((resolve, reject) => {\n const cleanup = () => {\n args.server.off('error', onError);\n args.server.off('listening', onListening);\n };\n\n const onError = (error: Error) => {\n cleanup();\n reject(error);\n };\n\n const onListening = () => {\n cleanup();\n\n const address = args.server.address();\n\n if (\n !address ||\n typeof address !== 'object' ||\n typeof address.port !== 'number'\n ) {\n reject(new Error(formatError('Sourcemap sidecar server started without a TCP port.')));\n return;\n }\n\n resolve(address.port);\n };\n\n args.server.once('error', onError);\n args.server.once('listening', onListening);\n args.server.listen(args.port, args.host);\n });\n}\n","import type { Server } from 'node:http';\nimport path from 'node:path';\nimport { globalData } from '../../../utils/global';\nimport { formatError } from '../misc';\nimport { createSidecarServer, SIDECAR_HOST, type SidecarRouteHandler, startSidecarServer } from './server';\nimport { createSourceUrl, getPortFilePath, getRoutePath, normalizeSidecarRoutePath } from './utils';\n\ntype SidecarServer = {\n cacheDir: string;\n handlers: Map<string, SidecarRouteHandler>;\n projectDir: string;\n port: number | null;\n portFilePath: string;\n routes: Map<string, string>;\n server: Server;\n startError: Error | null;\n startPromise: Promise<void>;\n};\n\nexport type SourcemapSidecar = {\n cacheDir: string;\n projectDir: string;\n ensureStarted(): Promise<void>;\n getBaseUrl(): string | null;\n getRouteUrl(routePath: string): string;\n getSourceUrl(filePath: string, relativePath?: string | null): string;\n registerSource(filePath: string, routePath: string): string;\n registerRoute(routePath: string, handler: SidecarRouteHandler): string;\n};\n\nexport type SourcemapSidecarArgs = {\n cacheDir: string;\n projectDir: string;\n routes?: Record<string, SidecarRouteHandler>;\n};\n\nconst sidecarServers = globalData(\n 'plugin.sidecar.servers',\n () => new Map<string, SidecarServer>(),\n);\n\nexport function getSourcemapSidecar(args: SourcemapSidecarArgs): SourcemapSidecar {\n const normalizedProjectDir = path.resolve(args.projectDir);\n const normalizedCacheDir = path.resolve(args.cacheDir);\n const state = getOrCreateServer(normalizedProjectDir, normalizedCacheDir);\n\n if (args.routes) {\n for (const [routePath, handler] of Object.entries(args.routes)) {\n state.handlers.set(normalizeSidecarRoutePath({ routePath }), handler);\n }\n }\n\n return {\n cacheDir: normalizedCacheDir,\n projectDir: normalizedProjectDir,\n ensureStarted() {\n return state.startPromise;\n },\n getBaseUrl() {\n return createSidecarBaseUrl(state);\n },\n getRouteUrl(routePath) {\n return createSidecarSourceUrl(\n state,\n normalizeSidecarRoutePath({ routePath }),\n );\n },\n getSourceUrl(filePath, relativePath) {\n return createSidecarSourceUrl(\n state,\n getRoutePath({\n filePath,\n projectDir: normalizedProjectDir,\n relativePath,\n }),\n );\n },\n registerSource(filePath, routePath) {\n routePath = normalizeSidecarRoutePath({ routePath });\n\n state.routes.set(routePath, path.resolve(filePath));\n\n return createSidecarSourceUrl(state, routePath);\n },\n registerRoute(routePath, handler) {\n routePath = normalizeSidecarRoutePath({ routePath });\n\n state.handlers.set(routePath, handler);\n\n return createSidecarSourceUrl(state, routePath);\n },\n };\n}\n\nfunction createSidecarBaseUrl(state: SidecarServer) {\n if (state.startError || state.port === null) return null;\n\n return `http://${SIDECAR_HOST}:${state.port}`;\n}\n\nfunction createSidecarSourceUrl(state: SidecarServer, routePath: string) {\n if (state.startError) {\n throw new Error(formatError(\n `The sourcemap dev server could not start: ${state.startError.message}`,\n ));\n }\n\n if (state.port === null) {\n throw new Error(formatError(\n 'The sourcemap dev server is not ready yet. Try rebuilding after the dev server finishes starting.',\n ));\n }\n\n const baseUrl = createSidecarBaseUrl(state);\n\n if (baseUrl === null) {\n throw new Error(formatError(\n 'The sourcemap dev server is not ready yet. Try rebuilding after the dev server finishes starting.',\n ));\n }\n\n return createSourceUrl({\n baseUrl,\n routePath,\n });\n}\n\nfunction getOrCreateServer(projectDir: string, cacheDir: string) {\n const servers = sidecarServers;\n\n const existing = servers.get(cacheDir);\n if (existing) return existing;\n\n const routes = new Map<string, string>();\n const handlers = new Map<string, SidecarRouteHandler>();\n\n const state: SidecarServer = {\n cacheDir,\n handlers,\n projectDir,\n port: null,\n portFilePath: getPortFilePath({ cacheDir }),\n routes,\n server: createSidecarServer({ projectDir, routes, handlers }),\n startError: null,\n startPromise: Promise.resolve(),\n };\n\n state.startPromise = startServer(state).catch((error: Error) => {\n state.startError = error;\n throw error;\n });\n\n state.startPromise.catch(() => {});\n state.server.unref();\n servers.set(cacheDir, state);\n\n return state;\n}\n\nasync function startServer(state: SidecarServer) {\n state.port = await startSidecarServer({\n host: SIDECAR_HOST,\n portFilePath: state.portFilePath,\n server: state.server,\n });\n}\n"],"mappings":";;;;;;AAmCA,SAAgB,gBAAgB,MAA2B;CACzD,OAAO,KAAK,KAAK,KAAK,UAAU,WAAW,WAAW;AACxD;AAEA,SAAgB,aAAa,MAAwB;CAKnD,OAJkB,mBAChB,KAAK,gBAAgB,KAAK,SAAS,KAAK,YAAY,KAAK,QAAQ,CAGpD,KAAK,MAAM,KAAK,SAAS,KAAK,QAAQ;AACvD;AAEA,SAAgB,0BAA0B,MAA8B;CACtE,IAAI,KAAK,UAAU,WAAW,YAAY,GACxC,OAAO,mBAAmB,KAAK,UAAU,MAAM,CAAkB,CAAC;CAGpE,IAAI;EAEF,OAAO,mBAAmB,IADV,IAAI,KAAK,WAAW,kBACR,EAAE,QAAQ;CACxC,QAAQ;EACN,OAAO,mBAAmB,KAAK,SAAS;CAC1C;AACF;AAEA,SAAgB,gBAAgB,MAA2B;CACzD,OAAO,GAAG,KAAK,QAAQ,QAAQ,QAAQ,EAAE,IAAI,UAAU,KAAK,SAAS;AACvE;AAEA,SAAgB,mBAAmB,KAAyB;CAC1D,IAAI,CAAC,KAAK,OAAO;CAEjB,IAAI;EACF,OAAO,UAAU,IAAI,IAAI,KAAK,kBAAkB,EAAE,QAAQ;CAC5D,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAgB,eAAe,MAA0B;CACvD,IAAI;EAEF,MAAM,OADO,KAAK,MAAM,aAAa,KAAK,UAAU,MAAM,CAC1C,EAAE;EAClB,OAAO,OAAO,SAAS,YAAY,OAAO,UAAU,IAAI,KAAK,OAAO,IAAI,OAAO;CACjF,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAgB,gBAAgB,MAA2B;CACzD,IAAI;EACF,UAAU,KAAK,QAAQ,KAAK,QAAQ,GAAG,EAAE,WAAW,KAAK,CAAC;EAC1D,cAAc,K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