weapp-tailwindcss 5.1.16 → 5.2.0
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.en.md +6 -0
- package/README.md +6 -0
- package/bin/{weapp-tailwindcss.js → weapp-tailwindcss.cjs} +1 -1
- package/dist/bundlers/framework-selector.d.ts +2 -2
- package/dist/bundlers/gulp/asset-emission-plan.d.ts +10 -0
- package/dist/bundlers/gulp/frameworks/native/index.d.ts +10 -3
- package/dist/bundlers/gulp/index.d.ts +10 -3
- package/dist/bundlers/gulp/module-graph.d.ts +1 -1
- package/dist/bundlers/gulp/runtime-snapshot.d.ts +4 -2
- package/dist/bundlers/gulp/shared/create-native-framework-plugins/cache-state.d.ts +4 -4
- package/dist/bundlers/gulp/shared/create-native-framework-plugins/file-transforms.d.ts +5 -3
- package/dist/bundlers/gulp/shared/create-native-framework-plugins.d.ts +9 -2
- package/dist/bundlers/rspack/index.d.ts +2 -2
- package/dist/bundlers/shared/cache.d.ts +1 -1
- package/dist/bundlers/shared/css-imports.d.ts +1 -1
- package/dist/bundlers/shared/css-source-trace.d.ts +2 -2
- package/dist/bundlers/shared/framework-postcss.d.ts +9 -2
- package/dist/bundlers/shared/generator-css/candidates.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/generation-helpers/preflight.d.ts +4 -3
- package/dist/bundlers/shared/generator-css/generation-helpers/results.d.ts +3 -3
- package/dist/bundlers/shared/generator-css/generation-helpers/runtime-isolation.d.ts +4 -4
- package/dist/bundlers/shared/generator-css/generation-helpers.d.ts +4 -4
- package/dist/bundlers/shared/generator-css/legacy-compat.d.ts +2 -2
- package/dist/bundlers/shared/generator-css/pipeline/context.d.ts +58 -0
- package/dist/bundlers/shared/generator-css/pipeline/deferred-output.d.ts +3 -14
- package/dist/bundlers/shared/generator-css/pipeline/execution.d.ts +3 -12
- package/dist/bundlers/shared/generator-css/pipeline/fallback-output.d.ts +3 -12
- package/dist/bundlers/shared/generator-css/pipeline/ordered-output.d.ts +3 -25
- package/dist/bundlers/shared/generator-css/pipeline.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/result-helpers.d.ts +2 -2
- package/dist/bundlers/shared/generator-css/source-resolver/configuration.d.ts +3 -4
- package/dist/bundlers/shared/generator-css/source-resolver/matching.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/source-resolver/metadata.d.ts +13 -5
- package/dist/bundlers/shared/generator-css/source-resolver/postcss-source.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/source-resolver/resolve-source.d.ts +3 -3
- package/dist/bundlers/shared/generator-css/source-resolver/resolve-sources.d.ts +4 -3
- package/dist/bundlers/shared/generator-css/source-resolver/single-source.d.ts +9 -9
- package/dist/bundlers/shared/generator-css/source-resolver/source-entries.d.ts +3 -3
- package/dist/bundlers/shared/generator-css/source-resolver/source-matching.d.ts +4 -4
- package/dist/bundlers/shared/generator-css/source-resolver/types.d.ts +4 -4
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +7 -6
- package/dist/bundlers/shared/generator-css/types.d.ts +12 -3
- package/dist/bundlers/shared/generator-css/user-css/transform.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/user-css.d.ts +5 -5
- package/dist/bundlers/shared/generator-css/validate.d.ts +1 -1
- package/dist/bundlers/shared/generator-css.d.ts +9 -9
- package/dist/bundlers/shared/runtime-class-set/entries.d.ts +4 -0
- package/dist/bundlers/shared/runtime-class-set/escaped-candidates.d.ts +9 -0
- package/dist/bundlers/shared/runtime-class-set.d.ts +30 -0
- package/dist/bundlers/shared/runtime-entry-type.d.ts +8 -0
- package/dist/bundlers/shared/runtime-signatures.d.ts +8 -0
- package/dist/bundlers/shared/source-candidate-scan-signature.d.ts +13 -0
- package/dist/bundlers/{vite → shared}/source-candidates/collector.d.ts +1 -1
- package/dist/bundlers/shared/source-candidates/scan-root.d.ts +10 -0
- package/dist/bundlers/{vite → shared}/source-candidates/script.d.ts +1 -1
- package/dist/bundlers/{vite → shared}/source-candidates/store.d.ts +1 -1
- package/dist/bundlers/{vite → shared}/source-candidates/types-and-cache.d.ts +3 -3
- package/dist/bundlers/shared/source-candidates.d.ts +4 -0
- package/dist/bundlers/shared/source-scan/css-entries.d.ts +18 -0
- package/dist/bundlers/shared/source-scan.d.ts +16 -0
- package/dist/bundlers/shared/static-config-content.d.ts +5 -0
- package/dist/bundlers/shared/v4-generation-core.d.ts +8 -3
- package/dist/bundlers/vite/bundle-entries.d.ts +1 -1
- package/dist/bundlers/vite/bundle-state.d.ts +11 -38
- package/dist/bundlers/vite/css-asset-identity.d.ts +11 -0
- package/dist/bundlers/vite/css-finalizer/options.d.ts +3 -3
- package/dist/bundlers/vite/css-finalizer/plugin.d.ts +1 -1
- package/dist/bundlers/vite/css-finalizer.d.ts +1 -1
- package/dist/bundlers/vite/css-memory.d.ts +1 -2
- package/dist/bundlers/vite/frameworks/generic/index.d.ts +2 -2
- package/dist/bundlers/vite/frameworks/taro/index.d.ts +2 -2
- package/dist/bundlers/vite/frameworks/uni-app/index.d.ts +3 -3
- package/dist/bundlers/vite/frameworks/uni-app-x/index.d.ts +3 -3
- package/dist/bundlers/vite/frameworks/weapp-vite/index.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/asset-emission-plan.d.ts +8 -0
- package/dist/bundlers/vite/generate-bundle/bundle-markup-candidates.d.ts +4 -4
- package/dist/bundlers/vite/generate-bundle/configured-css-sources.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-assets.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-cache-task.d.ts +34 -0
- package/dist/bundlers/vite/generate-bundle/css-composition-plan.d.ts +58 -0
- package/dist/bundlers/vite/generate-bundle/css-config-directives.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-entry-processing.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-output-helpers.d.ts +21 -2
- package/dist/bundlers/vite/generate-bundle/css-output.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-share-scope.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-source-plan.d.ts +19 -0
- package/dist/bundlers/vite/generate-bundle/css-transform-decision-plan.d.ts +61 -0
- package/dist/bundlers/vite/generate-bundle/css-transform-result.d.ts +23 -0
- package/dist/bundlers/vite/generate-bundle/css-transform-task.d.ts +42 -0
- package/dist/bundlers/vite/generate-bundle/final-css-assets.d.ts +3 -2
- package/dist/bundlers/vite/generate-bundle/finalize/bundle.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/finalize/root-import-shell.d.ts +5 -5
- package/dist/bundlers/vite/generate-bundle/finalize.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/html-processing.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/js-entries.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/js-handler-options.d.ts +2 -1
- package/dist/bundlers/vite/generate-bundle/js-linking.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/js-processing.d.ts +6 -5
- package/dist/bundlers/vite/generate-bundle/memory-debug.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/process-plan.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/remembered-css-plan.d.ts +35 -0
- package/dist/bundlers/vite/generate-bundle/remembered-css-replay.d.ts +5 -6
- package/dist/bundlers/vite/generate-bundle/remembered-css.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/root-style-output.d.ts +20 -0
- package/dist/bundlers/vite/generate-bundle/runtime-configured-css.d.ts +54 -0
- package/dist/bundlers/vite/generate-bundle/runtime-linked-css.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/runtime-linked-source-memory.d.ts +3 -3
- package/dist/bundlers/vite/{generate-bundle-runtime.d.ts → generate-bundle/runtime.d.ts} +4 -4
- package/dist/bundlers/vite/generate-bundle/scoped-generator.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/sfc-style-source.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/signatures.d.ts +1 -8
- package/dist/bundlers/vite/generate-bundle/source-candidate-scope.d.ts +3 -3
- package/dist/bundlers/vite/generate-bundle/source-candidate-source.d.ts +5 -0
- package/dist/bundlers/vite/generate-bundle/subpackages.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/temporary-css-assets.d.ts +14 -1
- package/dist/bundlers/vite/generate-bundle/transform-filter.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/transform-scheduling.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/types.d.ts +8 -7
- package/dist/bundlers/vite/generate-bundle/uni-app-x-postprocess.d.ts +3 -2
- package/dist/bundlers/vite/generate-bundle/validate-runtime-candidates.d.ts +22 -0
- package/dist/bundlers/vite/generate-bundle.d.ts +6 -6
- package/dist/bundlers/vite/incremental-runtime-class-set/entries.d.ts +1 -4
- package/dist/bundlers/vite/incremental-runtime-class-set/escaped-candidates.d.ts +1 -3
- package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +2 -30
- package/dist/bundlers/vite/index.d.ts +3 -3
- package/dist/bundlers/vite/js-precheck.d.ts +1 -1
- package/dist/bundlers/vite/processed-css-assets/cleanup.d.ts +2 -1
- package/dist/bundlers/vite/processed-css-assets/collector.d.ts +1 -1
- package/dist/bundlers/vite/processed-css-assets/coverage.d.ts +1 -1
- package/dist/bundlers/vite/processed-css-assets/empty-at-rule.d.ts +1 -0
- package/dist/bundlers/vite/processed-css-assets/injection-plan.d.ts +4 -4
- package/dist/bundlers/vite/processed-css-assets/markers-imports.d.ts +5 -5
- package/dist/bundlers/vite/processed-css-assets.d.ts +4 -4
- package/dist/bundlers/vite/resolve-app-type.d.ts +1 -1
- package/dist/bundlers/vite/rewrite-css-imports.d.ts +3 -2
- package/dist/bundlers/vite/runtime-affecting-signature.d.ts +1 -2
- package/dist/bundlers/vite/runtime-candidate-entry.d.ts +9 -0
- package/dist/bundlers/vite/runtime-class-set.d.ts +4 -4
- package/dist/bundlers/vite/serve-css-generation.d.ts +2 -1
- package/dist/bundlers/vite/serve-js-transform.d.ts +1 -1
- package/dist/bundlers/vite/serve-root-import-shell.d.ts +1 -1
- package/dist/bundlers/vite/shared/create-framework-plugins.d.ts +7 -7
- package/dist/bundlers/vite/shared/framework-hmr-candidate-state.d.ts +45 -0
- package/dist/bundlers/vite/shared/framework-post-plugin.d.ts +2 -0
- package/dist/bundlers/vite/shared/framework-processed-css-registry.d.ts +22 -0
- package/dist/bundlers/vite/shared/framework-runtime-options.d.ts +1 -0
- package/dist/bundlers/vite/shared/framework-source-candidates-plugin.d.ts +2 -0
- package/dist/bundlers/vite/shared/framework-source-scan-session.d.ts +38 -0
- package/dist/bundlers/vite/shared/framework-strategy.d.ts +4 -4
- package/dist/bundlers/vite/source-candidate-scan-signature.d.ts +2 -13
- package/dist/bundlers/vite/source-candidates/scan-root.d.ts +1 -10
- package/dist/bundlers/vite/source-candidates.d.ts +1 -4
- package/dist/bundlers/vite/source-output-relations.d.ts +24 -0
- package/dist/bundlers/vite/source-scan/css-entries.d.ts +2 -18
- package/dist/bundlers/vite/source-scan.d.ts +2 -16
- package/dist/bundlers/vite/static-config-content.d.ts +1 -5
- package/dist/bundlers/vite/uni-app-x-css-options.d.ts +1 -1
- package/dist/bundlers/vite/web-css-compat.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/asset-emission-plan.d.ts +18 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/css-source-resolvers.d.ts +2 -2
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/finalize-assets.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/generated-css-task.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/helpers.d.ts +11 -41
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/html-js-tasks.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/js-module-graph.d.ts +4 -10
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/finalize.d.ts +4 -4
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/memory-trace.d.ts +3 -3
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/preflight-runtime.d.ts +6 -6
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/resources.d.ts +2 -2
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/sources.d.ts +4 -4
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/user-css.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers.d.ts +9 -9
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/source-candidate-cache.d.ts +3 -3
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/source-candidate-refresh.d.ts +3 -3
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +2 -2
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +4 -4
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +2 -2
- package/dist/bundlers/webpack/frameworks/generic/index.d.ts +2 -2
- package/dist/bundlers/webpack/frameworks/index.d.ts +7 -7
- package/dist/bundlers/webpack/frameworks/mpx/index.d.ts +2 -2
- package/dist/bundlers/webpack/frameworks/taro/index.d.ts +2 -2
- package/dist/bundlers/webpack/frameworks/uni-app/index.d.ts +2 -2
- package/dist/bundlers/webpack/frameworks/weapp-vite/index.d.ts +2 -2
- package/dist/bundlers/webpack/index.d.ts +1 -1
- package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +2 -2
- package/dist/bundlers/webpack/loaders/weapp-tw-css-generation-loader.d.ts +1 -1
- package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +1 -1
- package/dist/bundlers/webpack/loaders/weapp-tw-runtime-classset-loader.d.ts +1 -1
- package/dist/bundlers/webpack/shared/create-framework-plugin/plugin.d.ts +4 -4
- package/dist/bundlers/webpack/shared/create-framework-plugin.d.ts +3 -3
- package/dist/cli/context.d.ts +2 -2
- package/dist/cli/doctor.d.ts +1 -1
- package/dist/cli/helpers/options.d.ts +3 -3
- package/dist/cli/helpers.d.ts +1 -1
- package/dist/cli.cjs +37012 -0
- package/dist/cli.js +141 -168
- package/dist/compiler/artifact.d.ts +14 -0
- package/dist/compiler/candidate-index.d.ts +10 -0
- package/dist/compiler/compilation-change-coordinator.d.ts +28 -0
- package/dist/compiler/compilation-dependency-state.d.ts +16 -0
- package/dist/compiler/compilation-scope-graph.d.ts +31 -0
- package/dist/compiler/compilation-session-pool.d.ts +54 -0
- package/dist/compiler/compiler-owner-state.d.ts +3 -0
- package/dist/compiler/composition.d.ts +8 -0
- package/dist/compiler/emission-plan.d.ts +26 -0
- package/dist/compiler/index.d.ts +23 -0
- package/dist/compiler/invalidation.d.ts +3 -0
- package/dist/compiler/mode.d.ts +3 -0
- package/dist/compiler/owner-lifecycle.d.ts +1 -0
- package/dist/compiler/platform-adapter.d.ts +9 -0
- package/dist/compiler/runtime-affecting-signature.d.ts +2 -0
- package/dist/compiler/runtime-build-state.d.ts +6 -0
- package/dist/compiler/runtime-snapshot.d.ts +53 -0
- package/dist/compiler/scope-planner.d.ts +6 -0
- package/dist/compiler/semantic-css.d.ts +66 -0
- package/dist/compiler/session.d.ts +13 -0
- package/dist/compiler/shadow-gate.d.ts +26 -0
- package/dist/compiler/shadow-report-session.d.ts +37 -0
- package/dist/compiler/shadow-report.d.ts +15 -0
- package/dist/compiler/source-graph.d.ts +32 -0
- package/dist/compiler/tailwind-generation-session-pool.d.ts +22 -0
- package/dist/compiler/types.d.ts +95 -0
- package/dist/constants.d.ts +2 -2
- package/dist/context/compiler-context-cache.d.ts +1 -1
- package/dist/context/custom-attributes.d.ts +1 -1
- package/dist/context/handlers.d.ts +3 -3
- package/dist/context/index.d.ts +1 -1
- package/dist/context/runtime-package-replacements.d.ts +1 -1
- package/dist/context/style-options.d.ts +1 -1
- package/dist/context/tailwindcss.d.ts +3 -3
- package/dist/{context-BtLIID4m.js → context-PZXBqrAJ.cjs} +31 -93
- package/dist/{context-JzwzSX36.mjs → context-oTkxC5aZ.js} +22 -11
- package/dist/{core.mjs → core.cjs} +13 -12
- package/dist/core.d.ts +2 -2
- package/dist/core.js +12 -13
- package/dist/css-imports-DfNC3e6a.cjs +43 -0
- package/dist/css-loader-runtime-CSv0lKqV.cjs +11 -0
- package/dist/css-macro/postcss.cjs +19 -0
- package/dist/css-macro/postcss.js +2 -19
- package/dist/{css-macro.mjs → css-macro.cjs} +11 -8
- package/dist/css-macro.d.ts +2 -2
- package/dist/css-macro.js +8 -11
- package/dist/{defaults.mjs → defaults.cjs} +16 -11
- package/dist/defaults.d.ts +1 -1
- package/dist/defaults.js +11 -16
- package/dist/{escape.mjs → escape.cjs} +18 -4
- package/dist/escape.js +4 -18
- package/dist/framework/platform.d.ts +1 -1
- package/dist/{framework.mjs → framework.cjs} +47 -25
- package/dist/framework.d.ts +1 -1
- package/dist/framework.js +25 -47
- package/dist/generator/index.d.ts +6 -6
- package/dist/generator/options.d.ts +3 -3
- package/dist/generator/types.d.ts +2 -2
- package/dist/{generator-B91GhUJQ.js → generator-C8D5cnbe.cjs} +164 -33
- package/dist/{generator-Bv7myuhY.mjs → generator-CDdzqf1S.js} +155 -30
- package/dist/generator.cjs +12 -0
- package/dist/generator.d.ts +1 -1
- package/dist/generator.js +2 -12
- package/dist/{gulp-Q1wITegn.js → gulp-Cjcss8T_.cjs} +157 -103
- package/dist/{gulp-CKSklPlH.mjs → gulp-DNXQvDUw.js} +141 -90
- package/dist/gulp.cjs +5 -0
- package/dist/gulp.d.ts +4 -4
- package/dist/gulp.js +2 -5
- package/dist/{hmr-timing-BXg7nI8N.mjs → hmr-timing-CuJwQzDc.js} +3824 -1988
- package/dist/hmr-timing-DMLfNfGG.cjs +555 -0
- package/dist/index.cjs +45 -0
- package/dist/index.d.ts +9 -9
- package/dist/index.js +9 -45
- package/dist/js/JsTokenUpdater.d.ts +1 -1
- package/dist/js/ModuleGraph.d.ts +3 -3
- package/dist/js/NodePathWalker.d.ts +2 -2
- package/dist/js/babel/process.d.ts +2 -2
- package/dist/js/babel.d.ts +8 -8
- package/dist/js/evalTransforms.d.ts +2 -2
- package/dist/js/fast-path/oxc.d.ts +1 -1
- package/dist/js/handlers.d.ts +2 -2
- package/dist/js/index.d.ts +3 -3
- package/dist/js/literal-transform.d.ts +1 -1
- package/dist/js/module-graph/ignored-exports.d.ts +4 -4
- package/dist/js/module-graph/types.d.ts +2 -2
- package/dist/js/node-path-walker/export-handlers.d.ts +1 -1
- package/dist/js/precheck.d.ts +1 -1
- package/dist/js/replacement-cache.d.ts +1 -1
- package/dist/js/sourceAnalysis.d.ts +3 -3
- package/dist/js/taggedTemplateIgnore.d.ts +1 -1
- package/dist/object-Bvy6-w9r.js +47 -0
- package/dist/object-C_Vr6_S5.cjs +58 -0
- package/dist/options-DlvhQwWB.cjs +775 -0
- package/dist/pipeline-helpers-XtUmUlci.cjs +955 -0
- package/dist/postcss-html-transform.cjs +7 -0
- package/dist/postcss-html-transform.js +3 -5
- package/dist/postcss.cjs +15 -0
- package/dist/postcss.js +7 -11
- package/dist/presets/hbuilderx.d.ts +2 -2
- package/dist/presets/index.d.ts +4 -4
- package/dist/presets/shared.d.ts +1 -1
- package/dist/presets/taro.d.ts +2 -2
- package/dist/presets/uni-app-x.d.ts +1 -1
- package/dist/presets/uni-app.d.ts +2 -2
- package/dist/{presets.mjs → presets.cjs} +37 -24
- package/dist/presets.d.ts +1 -1
- package/dist/presets.js +24 -36
- package/dist/reset.cjs +19 -0
- package/dist/reset.d.ts +2 -2
- package/dist/reset.js +2 -19
- package/dist/{rolldown-runtime-emK7D4bc.js → rolldown-runtime-CVvi-lCc.cjs} +15 -0
- package/dist/{rspack.mjs → rspack.cjs} +10 -4
- package/dist/rspack.d.ts +3 -3
- package/dist/rspack.js +4 -10
- package/dist/runtime-branch/create-branch.d.ts +1 -1
- package/dist/runtime-branch/generator-target-env.d.ts +1 -1
- package/dist/runtime-branch/index.d.ts +2 -2
- package/dist/runtime-branch/mini-program.d.ts +1 -1
- package/dist/runtime-branch/native-app.d.ts +1 -1
- package/dist/runtime-branch/platform.d.ts +2 -2
- package/dist/runtime-branch/tailwind-version.d.ts +1 -1
- package/dist/runtime-branch/types.d.ts +2 -2
- package/dist/runtime-branch/web.d.ts +1 -1
- package/dist/runtime-branch.d.ts +1 -1
- package/dist/runtime-registry-Y7NrD2WH.cjs +31 -0
- package/dist/shared/classname-transform.d.ts +1 -1
- package/dist/shared/mpx.d.ts +1 -1
- package/dist/source-candidate-scan-signature-B0S7f5P7.js +421 -0
- package/dist/source-candidate-scan-signature-BmSuoxR9.cjs +555 -0
- package/dist/style-injector/internal.d.ts +6 -6
- package/dist/style-options-CEfXwZzX.cjs +75 -0
- package/dist/tailwindcss/candidates.d.ts +2 -2
- package/dist/tailwindcss/index.d.ts +1 -1
- package/dist/tailwindcss/runtime/cache.d.ts +1 -1
- package/dist/tailwindcss/runtime-factory.d.ts +2 -2
- package/dist/tailwindcss/runtime-options.d.ts +1 -1
- package/dist/tailwindcss/runtime-types.d.ts +2 -2
- package/dist/tailwindcss/runtime.d.ts +2 -2
- package/dist/tailwindcss/source-scan.d.ts +2 -2
- package/dist/tailwindcss/targets.d.ts +1 -1
- package/dist/tailwindcss/v4/config.d.ts +1 -1
- package/dist/tailwindcss/v4/css-sources.d.ts +2 -1
- package/dist/tailwindcss/v4/index.d.ts +2 -2
- package/dist/tailwindcss/v4/multi-runtime.d.ts +1 -1
- package/dist/tailwindcss/v4/runtime-factory.d.ts +5 -5
- package/dist/tailwindcss/v4/runtime-options.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/css-macro-source.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/css-compat.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/engine.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/incremental-cache.d.ts +4 -5
- package/dist/tailwindcss/v4-engine/generator/native-session.d.ts +17 -0
- package/dist/tailwindcss/v4-engine/generator/scan-sources.d.ts +2 -1
- package/dist/tailwindcss/v4-engine/generator.d.ts +2 -2
- package/dist/tailwindcss/v4-engine/index.d.ts +5 -5
- package/dist/tailwindcss/v4-engine/miniprogram.d.ts +2 -2
- package/dist/tailwindcss/v4-engine/source.d.ts +2 -2
- package/dist/tailwindcss/v4-engine/types.d.ts +1 -0
- package/dist/{tailwindcss-B4phC0kB.js → tailwindcss-Cs94gJgf.cjs} +9 -769
- package/dist/{tailwindcss-BTcXX8Ka.mjs → tailwindcss-D7TGiZR2.js} +22 -22
- package/dist/transform-BUEyOCT7.cjs +341 -0
- package/dist/transform-BbaPIji9.js +342 -0
- package/dist/typedoc.export.d.ts +4 -4
- package/dist/types/index.d.ts +7 -7
- package/dist/types/shared.d.ts +1 -1
- package/dist/types/typedoc-tailwindcss-runtime.d.ts +3 -3
- package/dist/types/user-defined-options/general.d.ts +5 -5
- package/dist/types/user-defined-options/important.d.ts +2 -2
- package/dist/types/user-defined-options/index.d.ts +9 -9
- package/dist/types/user-defined-options/matcher.d.ts +2 -2
- package/dist/types.cjs +0 -0
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -0
- package/dist/uni-app-x/harmony.d.ts +1 -0
- package/dist/uni-app-x/index.d.ts +2 -2
- package/dist/uni-app-x/options.d.ts +1 -1
- package/dist/uni-app-x/style-asset/harmony-apply.d.ts +1 -0
- package/dist/uni-app-x/style-asset/style-value.d.ts +3 -0
- package/dist/uni-app-x/style-asset.d.ts +5 -4
- package/dist/uni-app-x/transform.d.ts +1 -1
- package/dist/uni-app-x/vite/harmony-apply.d.ts +19 -0
- package/dist/uni-app-x/vite/native-target.d.ts +2 -0
- package/dist/uni-app-x/vite.d.ts +5 -2
- package/dist/unocss/index.d.ts +1 -1
- package/dist/utils/disabled.d.ts +1 -1
- package/dist/utils/index.d.ts +3 -3
- package/dist/{hmr-timing-CMPaWn9P.js → v4-generation-core-D7MuR5ZF.cjs} +3468 -2059
- package/dist/{vite-BwQWl9ft.mjs → vite-BI1TeUPO.js} +5968 -4456
- package/dist/{vite-DhVnXvAQ.js → vite-CBzmUTu-.cjs} +6159 -4672
- package/dist/vite.cjs +4 -0
- package/dist/vite.d.ts +3 -3
- package/dist/vite.js +2 -4
- package/dist/watch-dependencies-BZGubvuJ.cjs +40 -0
- package/dist/{weapp-tw-css-generation-loader.js → weapp-tw-css-generation-loader.cjs} +3 -2
- package/dist/weapp-tw-css-import-rewrite-loader.cjs +201 -0
- package/dist/{weapp-tw-runtime-classset-loader.js → weapp-tw-runtime-classset-loader.cjs} +9 -11
- package/dist/{webpack-kh78iMSS.js → webpack-Dao6bWEj.cjs} +208 -954
- package/dist/{webpack-Bo1QrFPf.mjs → webpack-dAY9h8r8.js} +105 -101
- package/dist/webpack.cjs +5 -0
- package/dist/webpack.d.ts +2 -2
- package/dist/webpack.js +2 -5
- package/dist/wxml/Tokenizer.d.ts +2 -2
- package/dist/wxml/custom-attributes.d.ts +1 -1
- package/dist/wxml/index.d.ts +2 -2
- package/dist/wxml/shared.d.ts +1 -1
- package/dist/wxml/utils/codegen/legacy-rewriter.d.ts +1 -1
- package/dist/wxml/utils/codegen/legacy-visitor.d.ts +2 -2
- package/dist/wxml/utils/codegen.d.ts +1 -1
- package/dist/wxml/utils/custom-template.d.ts +2 -2
- package/dist/wxml/utils/fragment-helpers.d.ts +2 -2
- package/dist/wxml/utils/fragment-updater.d.ts +2 -2
- package/dist/wxml/utils/template-fragments.d.ts +2 -2
- package/dist/wxml/utils.d.ts +5 -5
- package/dist/wxml-DSMNuUaP.cjs +38609 -0
- package/dist/{cli.mjs → wxml-IBzZSaQC.js} +237 -714
- package/package.json +56 -53
- package/dist/css-macro/postcss.mjs +0 -2
- package/dist/generator.mjs +0 -2
- package/dist/gulp.mjs +0 -2
- package/dist/index.mjs +0 -9
- package/dist/object-BJSWl-E5.mjs +0 -9
- package/dist/object-COs_Mw6p.js +0 -14
- package/dist/postcss-html-transform.mjs +0 -5
- package/dist/postcss.mjs +0 -11
- package/dist/reset.mjs +0 -2
- package/dist/source-candidate-scan-signature-BKZZk_e6.js +0 -1078
- package/dist/source-candidate-scan-signature-CtK-mB_C.mjs +0 -854
- package/dist/transform-B_KM9sLX.mjs +0 -14930
- package/dist/transform-CcYptivi.js +0 -14927
- package/dist/types.mjs +0 -1
- package/dist/vite.mjs +0 -2
- package/dist/watch-dependencies-bpG6kmAf.js +0 -80
- package/dist/weapp-tw-css-import-rewrite-loader-B0tVkJLH.js +0 -10524
- package/dist/weapp-tw-css-import-rewrite-loader.js +0 -10
- package/dist/webpack.mjs +0 -2
- package/dist/wxml-Ce10eREX.js +0 -3979
- package/dist/wxml-DdGdeqaH.mjs +0 -3861
- /package/dist/{auto-2dg_uhEJ.mjs → auto-2dg_uhEJ.js} +0 -0
- /package/dist/{auto-DtU6f3X6.js → auto-DtU6f3X6.cjs} +0 -0
- /package/dist/bundlers/{vite → shared}/source-scan/dependencies.d.ts +0 -0
- /package/dist/{cache-options-DavPxrhC.js → cache-options-DavPxrhC.cjs} +0 -0
- /package/dist/{cache-options-DwBtLwQe.mjs → cache-options-DwBtLwQe.js} +0 -0
- /package/dist/{logger-BNzxZbZj.mjs → logger-BNzxZbZj.js} +0 -0
- /package/dist/{logger-TlKT3xmR.js → logger-TlKT3xmR.cjs} +0 -0
- /package/dist/{utils-CuKLf1Zv.js → utils-CuKLf1Zv.cjs} +0 -0
- /package/dist/{utils-MVwpU07P.mjs → utils-MVwpU07P.js} +0 -0
package/dist/cli.js
CHANGED
|
@@ -1,71 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
let node_process = require("node:process");
|
|
24
|
-
node_process = __toESM(node_process);
|
|
25
|
-
let semver = require("semver");
|
|
26
|
-
semver = __toESM(semver);
|
|
27
|
-
let node_path = require("node:path");
|
|
28
|
-
node_path = __toESM(node_path);
|
|
29
|
-
let node_fs_promises = require("node:fs/promises");
|
|
30
|
-
let _weapp_tailwindcss_logger = require("@weapp-tailwindcss/logger");
|
|
31
|
-
let lru_cache = require("lru-cache");
|
|
32
|
-
let _weapp_tailwindcss_shared_node = require("@weapp-tailwindcss/shared/node");
|
|
33
|
-
let _weapp_core_escape = require("@weapp-core/escape");
|
|
34
|
-
require("@weapp-tailwindcss/shared");
|
|
35
|
-
let node_fs = require("node:fs");
|
|
36
|
-
node_fs = __toESM(node_fs);
|
|
37
|
-
let debug = require("debug");
|
|
38
|
-
debug = __toESM(debug);
|
|
39
|
-
let _tailwindcss_mangle_engine = require("@tailwindcss-mangle/engine");
|
|
40
|
-
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
41
|
-
let node_module = require("node:module");
|
|
42
|
-
require("micromatch");
|
|
43
|
-
require("fast-glob");
|
|
44
|
-
require("tailwindcss-config");
|
|
45
|
-
let _babel_traverse = require("@babel/traverse");
|
|
46
|
-
_babel_traverse = __toESM(_babel_traverse);
|
|
47
|
-
let _babel_parser = require("@babel/parser");
|
|
48
|
-
let magic_string = require("magic-string");
|
|
49
|
-
magic_string = __toESM(magic_string);
|
|
50
|
-
require("@babel/types");
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import process from "node:process";
|
|
3
|
+
import semver from "semver";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { access, mkdir, writeFile } from "node:fs/promises";
|
|
6
|
+
import { logger } from "@weapp-tailwindcss/logger";
|
|
7
|
+
import { LRUCache } from "lru-cache";
|
|
8
|
+
import { md5 as md5Hash } from "@weapp-tailwindcss/shared/node";
|
|
9
|
+
import { MappingChars2String, escape } from "@weapp-core/escape";
|
|
10
|
+
import "@weapp-tailwindcss/shared";
|
|
11
|
+
import { constants, existsSync, readFileSync } from "node:fs";
|
|
12
|
+
import _createDebug from "debug";
|
|
13
|
+
import { splitCandidateTokens } from "@tailwindcss-mangle/engine";
|
|
14
|
+
import { createStyleHandler } from "@weapp-tailwindcss/postcss";
|
|
15
|
+
import "micromatch";
|
|
16
|
+
import "fast-glob";
|
|
17
|
+
import "tailwindcss-config";
|
|
18
|
+
import _babelTraverse from "@babel/traverse";
|
|
19
|
+
import { parse } from "@babel/parser";
|
|
20
|
+
import MagicString from "magic-string";
|
|
21
|
+
import "@babel/types";
|
|
22
|
+
import "htmlparser2";
|
|
51
23
|
//#region src/js/babel/cache-options.ts
|
|
52
24
|
const DEFAULT_PARSE_CACHE_MAX_SOURCE_LENGTH = 5e4;
|
|
53
25
|
const HARD_PARSE_CACHE_MAX_ENTRIES = 1024;
|
|
54
26
|
//#endregion
|
|
55
27
|
//#region src/debug/index.ts
|
|
56
|
-
const _debug = (
|
|
28
|
+
const _debug = _createDebug("weapp-tw");
|
|
57
29
|
function createDebug(prefix) {
|
|
58
|
-
const debug
|
|
30
|
+
const debug = ((formatter, ...args) => {
|
|
59
31
|
return _debug((prefix ?? "") + formatter, ...args);
|
|
60
32
|
});
|
|
61
|
-
Object.defineProperty(debug
|
|
33
|
+
Object.defineProperty(debug, "enabled", {
|
|
62
34
|
enumerable: false,
|
|
63
35
|
configurable: false,
|
|
64
36
|
get() {
|
|
65
37
|
return _debug.enabled;
|
|
66
38
|
}
|
|
67
39
|
});
|
|
68
|
-
return debug
|
|
40
|
+
return debug;
|
|
69
41
|
}
|
|
70
42
|
//#endregion
|
|
71
43
|
//#region src/tailwindcss/v4-engine/generator/rpx-candidates.ts
|
|
@@ -73,23 +45,53 @@ const RPX_LENGTH_UTILITY_PATTERN = String.raw`text|border(?:-[trblxyse])?|bg|out
|
|
|
73
45
|
new RegExp(String.raw`(^|:)(!?)(${RPX_LENGTH_UTILITY_PATTERN})-\[([-+]?(?:\d+|\d*\.\d+)rpx)\](.*)$`, "u");
|
|
74
46
|
new RegExp(String.raw`(?:^|:)!?(${RPX_LENGTH_UTILITY_PATTERN})-\[length:([-+]?(?:\d+|\d*\.\d+)rpx)\].*$`, "u");
|
|
75
47
|
new RegExp(String.raw`(${RPX_LENGTH_UTILITY_PATTERN})-\\\[length\\:((?:\\[.+-]|[+\-.\d])+rpx)\\\]`, "g");
|
|
76
|
-
new
|
|
77
|
-
new
|
|
78
|
-
|
|
79
|
-
//#region src/utils/object.ts
|
|
80
|
-
function definedEntries(value) {
|
|
81
|
-
return Object.entries(value).filter(([, item]) => item !== void 0);
|
|
82
|
-
}
|
|
83
|
-
function omitUndefined(value) {
|
|
84
|
-
return Object.fromEntries(definedEntries(value));
|
|
85
|
-
}
|
|
86
|
-
(0, _weapp_tailwindcss_postcss.createStyleHandler)({
|
|
48
|
+
new LRUCache({ max: 8 });
|
|
49
|
+
new LRUCache({ max: 32 });
|
|
50
|
+
createStyleHandler({
|
|
87
51
|
cssChildCombinatorReplaceValue: ["view", "text"],
|
|
88
52
|
cssRemoveHoverPseudoClass: true,
|
|
89
53
|
isMainChunk: true,
|
|
90
54
|
majorVersion: 4
|
|
91
55
|
});
|
|
92
|
-
|
|
56
|
+
createRequire(import.meta.url);
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/typeof.js
|
|
59
|
+
function _typeof(o) {
|
|
60
|
+
"@babel/helpers - typeof";
|
|
61
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
62
|
+
return typeof o;
|
|
63
|
+
} : function(o) {
|
|
64
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
65
|
+
}, _typeof(o);
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPrimitive.js
|
|
69
|
+
function toPrimitive(t, r) {
|
|
70
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
71
|
+
var e = t[Symbol.toPrimitive];
|
|
72
|
+
if (void 0 !== e) {
|
|
73
|
+
var i = e.call(t, r || "default");
|
|
74
|
+
if ("object" != _typeof(i)) return i;
|
|
75
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
76
|
+
}
|
|
77
|
+
return ("string" === r ? String : Number)(t);
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPropertyKey.js
|
|
81
|
+
function toPropertyKey(t) {
|
|
82
|
+
var i = toPrimitive(t, "string");
|
|
83
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/defineProperty.js
|
|
87
|
+
function _defineProperty(e, r, t) {
|
|
88
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
89
|
+
value: t,
|
|
90
|
+
enumerable: !0,
|
|
91
|
+
configurable: !0,
|
|
92
|
+
writable: !0
|
|
93
|
+
}) : e[r] = t, e;
|
|
94
|
+
}
|
|
93
95
|
//#endregion
|
|
94
96
|
//#region src/tailwindcss/source-scan.ts
|
|
95
97
|
const DEFAULT_SOURCE_SCAN_EXTENSIONS = [
|
|
@@ -152,13 +154,21 @@ function createSourceScanPattern(extensions = DEFAULT_SOURCE_SCAN_EXTENSIONS) {
|
|
|
152
154
|
}
|
|
153
155
|
createSourceScanPattern(FULL_SOURCE_SCAN_EXTENSIONS);
|
|
154
156
|
new RegExp(`\\.(?:${FULL_SOURCE_SCAN_EXTENSIONS.map((extension) => extension.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")})$`);
|
|
155
|
-
|
|
157
|
+
//#endregion
|
|
158
|
+
//#region src/utils/object.ts
|
|
159
|
+
function definedEntries(value) {
|
|
160
|
+
return Object.entries(value).filter(([, item]) => item !== void 0);
|
|
161
|
+
}
|
|
162
|
+
function omitUndefined(value) {
|
|
163
|
+
return Object.fromEntries(definedEntries(value));
|
|
164
|
+
}
|
|
165
|
+
createRequire(import.meta.url);
|
|
156
166
|
createDebug("[tailwindcss:runtime] ");
|
|
157
167
|
//#endregion
|
|
158
168
|
//#region src/tailwindcss/runtime-logs.ts
|
|
159
169
|
const runtimeLogDedupeHolder = globalThis;
|
|
160
170
|
runtimeLogDedupeHolder.__WEAPP_TW_RUNTIME_LOG_DEDUPE__ ?? (runtimeLogDedupeHolder.__WEAPP_TW_RUNTIME_LOG_DEDUPE__ = /* @__PURE__ */ new Set());
|
|
161
|
-
|
|
171
|
+
createRequire(import.meta.url);
|
|
162
172
|
const globalCacheHolder = globalThis;
|
|
163
173
|
globalCacheHolder.__WEAPP_TW_COMPILER_CONTEXT_CACHE__ ?? (globalCacheHolder.__WEAPP_TW_COMPILER_CONTEXT_CACHE__ = /* @__PURE__ */ new Map());
|
|
164
174
|
//#endregion
|
|
@@ -166,7 +176,7 @@ globalCacheHolder.__WEAPP_TW_COMPILER_CONTEXT_CACHE__ ?? (globalCacheHolder.__WE
|
|
|
166
176
|
function _interopDefaultCompat(e) {
|
|
167
177
|
return e && typeof e === "object" && "default" in e ? e.default : e;
|
|
168
178
|
}
|
|
169
|
-
const traverse = _interopDefaultCompat(
|
|
179
|
+
const traverse = _interopDefaultCompat(_babelTraverse);
|
|
170
180
|
//#endregion
|
|
171
181
|
//#region src/utils/regex.ts
|
|
172
182
|
function escapeStringRegexp(str) {
|
|
@@ -235,10 +245,10 @@ function createNameMatcher(list, { exact = false } = {}) {
|
|
|
235
245
|
}
|
|
236
246
|
//#endregion
|
|
237
247
|
//#region src/js/babel/parse.ts
|
|
238
|
-
const parseCache = new
|
|
248
|
+
const parseCache = new LRUCache({ max: HARD_PARSE_CACHE_MAX_ENTRIES });
|
|
239
249
|
function genCacheKey(source, options) {
|
|
240
|
-
if (typeof options === "string") return `${(
|
|
241
|
-
return `${(
|
|
250
|
+
if (typeof options === "string") return `${md5Hash(source)}:${options}`;
|
|
251
|
+
return `${md5Hash(source)}:${JSON.stringify(options, (_, val) => typeof val === "function" ? val.toString() : val)}`;
|
|
242
252
|
}
|
|
243
253
|
function normalizeCacheMaxEntries(value) {
|
|
244
254
|
if (typeof value !== "number" || !Number.isFinite(value)) return 128;
|
|
@@ -264,7 +274,7 @@ function babelParse(code, opts = {}) {
|
|
|
264
274
|
}
|
|
265
275
|
if (!result) {
|
|
266
276
|
const { cache: _cache, cacheKey: _cacheKey, cacheMaxEntries: _cacheMaxEntries, cacheMaxSourceLength: _cacheMaxSourceLength, ...parseOptions } = opts;
|
|
267
|
-
result =
|
|
277
|
+
result = parse(code, parseOptions);
|
|
268
278
|
if (shouldCache) {
|
|
269
279
|
parseCache.set(cacheKeyString, result);
|
|
270
280
|
trimParseCache(maxEntries);
|
|
@@ -277,12 +287,12 @@ function babelParse(code, opts = {}) {
|
|
|
277
287
|
const NEWLINE_RE = /[\n\r]+/g;
|
|
278
288
|
function replaceWxml(original, options = {
|
|
279
289
|
keepEOL: false,
|
|
280
|
-
escapeMap:
|
|
290
|
+
escapeMap: MappingChars2String
|
|
281
291
|
}) {
|
|
282
292
|
const { keepEOL, escapeMap, ignoreHead } = options;
|
|
283
293
|
let res = original;
|
|
284
294
|
if (!keepEOL) res = res.replaceAll(NEWLINE_RE, "");
|
|
285
|
-
res =
|
|
295
|
+
res = escape(res, omitUndefined({
|
|
286
296
|
map: escapeMap,
|
|
287
297
|
ignoreHead
|
|
288
298
|
}));
|
|
@@ -527,7 +537,7 @@ function getReplacement(candidate, escapeMap, store = getReplacementCacheStore(e
|
|
|
527
537
|
}
|
|
528
538
|
//#endregion
|
|
529
539
|
//#region src/js/handlers.ts
|
|
530
|
-
const debug
|
|
540
|
+
const debug = createDebug("[js:handlers] ");
|
|
531
541
|
const WEAPP_TW_IGNORE_MARKER = "weapp-tw";
|
|
532
542
|
const IGNORE_MARKER = "ignore";
|
|
533
543
|
function hasIgnoreComment(node) {
|
|
@@ -619,9 +629,9 @@ function replaceHandleValue(path, options) {
|
|
|
619
629
|
if (hasIgnoreComment(path.node)) return;
|
|
620
630
|
if (isConditionTestLiteral(path)) return;
|
|
621
631
|
const { literal, original, offset } = extractLiteralValue(path, options);
|
|
622
|
-
const candidates =
|
|
632
|
+
const candidates = splitCandidateTokens(literal);
|
|
623
633
|
if (candidates.length === 0) return;
|
|
624
|
-
const debugEnabled = debug
|
|
634
|
+
const debugEnabled = debug.enabled;
|
|
625
635
|
const classContext = options.wrapExpression || isClassContextLiteralPath(path);
|
|
626
636
|
let transformed = literal;
|
|
627
637
|
let mutated = false;
|
|
@@ -657,7 +667,7 @@ function replaceHandleValue(path, options) {
|
|
|
657
667
|
}
|
|
658
668
|
const node = path.node;
|
|
659
669
|
if (!mutated || typeof node.start !== "number" || typeof node.end !== "number") return;
|
|
660
|
-
if (debugEnabled) debug
|
|
670
|
+
if (debugEnabled) debug("runtimeSet size=%d fallbackTriggered=%s candidates=%d matched=%d escapedHits=%d skipped=%d file=%s escapedSamples=%s skippedSamples=%s", classNameSet?.size ?? 0, fallbackDecisionCount > 0, candidates.length, matchedCandidateCount, escapedDecisionCount, skippedSamples?.length ?? 0, options.filename ?? "unknown", escapedSamples?.join(",") || "-", skippedSamples?.join(",") || "-");
|
|
661
671
|
const start = node.start + offset;
|
|
662
672
|
const end = node.end - offset;
|
|
663
673
|
if (start >= end || transformed === original) return;
|
|
@@ -738,7 +748,7 @@ function getNeedEscapedOptions(options, needEscaped) {
|
|
|
738
748
|
}
|
|
739
749
|
function processUpdatedSource(rawSource, options, analysis) {
|
|
740
750
|
const { targetPaths, jsTokenUpdater, ignoredPaths } = analysis;
|
|
741
|
-
if (targetPaths.length === 0 && !options.moduleSpecifierReplacements && jsTokenUpdater.length === 0) return new
|
|
751
|
+
if (targetPaths.length === 0 && !options.moduleSpecifierReplacements && jsTokenUpdater.length === 0) return new MagicString(rawSource);
|
|
742
752
|
const replacementTokens = [];
|
|
743
753
|
for (const path of targetPaths) {
|
|
744
754
|
if (ignoredPaths.has(path)) continue;
|
|
@@ -746,8 +756,8 @@ function processUpdatedSource(rawSource, options, analysis) {
|
|
|
746
756
|
if (token) replacementTokens.push(token);
|
|
747
757
|
}
|
|
748
758
|
if (options.moduleSpecifierReplacements) replacementTokens.push(...collectModuleSpecifierReplacementTokens(analysis, options.moduleSpecifierReplacements));
|
|
749
|
-
if (jsTokenUpdater.length + replacementTokens.length === 0) return new
|
|
750
|
-
const ms = new
|
|
759
|
+
if (jsTokenUpdater.length + replacementTokens.length === 0) return new MagicString(rawSource);
|
|
760
|
+
const ms = new MagicString(rawSource);
|
|
751
761
|
jsTokenUpdater.push(...replacementTokens).filter((token) => !ignoredPaths.has(token.path)).updateMagicString(ms);
|
|
752
762
|
return ms;
|
|
753
763
|
}
|
|
@@ -861,44 +871,6 @@ function walkEvalExpression(path, options, updater, handler) {
|
|
|
861
871
|
}
|
|
862
872
|
}
|
|
863
873
|
//#endregion
|
|
864
|
-
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/typeof.js
|
|
865
|
-
function _typeof(o) {
|
|
866
|
-
"@babel/helpers - typeof";
|
|
867
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
868
|
-
return typeof o;
|
|
869
|
-
} : function(o) {
|
|
870
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
871
|
-
}, _typeof(o);
|
|
872
|
-
}
|
|
873
|
-
//#endregion
|
|
874
|
-
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/toPrimitive.js
|
|
875
|
-
function toPrimitive(t, r) {
|
|
876
|
-
if ("object" != _typeof(t) || !t) return t;
|
|
877
|
-
var e = t[Symbol.toPrimitive];
|
|
878
|
-
if (void 0 !== e) {
|
|
879
|
-
var i = e.call(t, r || "default");
|
|
880
|
-
if ("object" != _typeof(i)) return i;
|
|
881
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
882
|
-
}
|
|
883
|
-
return ("string" === r ? String : Number)(t);
|
|
884
|
-
}
|
|
885
|
-
//#endregion
|
|
886
|
-
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/toPropertyKey.js
|
|
887
|
-
function toPropertyKey(t) {
|
|
888
|
-
var i = toPrimitive(t, "string");
|
|
889
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
890
|
-
}
|
|
891
|
-
//#endregion
|
|
892
|
-
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/defineProperty.js
|
|
893
|
-
function _defineProperty(e, r, t) {
|
|
894
|
-
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
895
|
-
value: t,
|
|
896
|
-
enumerable: !0,
|
|
897
|
-
configurable: !0,
|
|
898
|
-
writable: !0
|
|
899
|
-
}) : e[r] = t, e;
|
|
900
|
-
}
|
|
901
|
-
//#endregion
|
|
902
874
|
//#region src/js/JsTokenUpdater.ts
|
|
903
875
|
/**
|
|
904
876
|
* Lightweight helper that batches updates to {@link MagicString}.
|
|
@@ -1636,7 +1608,7 @@ function jsHandler(rawSource, options) {
|
|
|
1636
1608
|
return result;
|
|
1637
1609
|
}
|
|
1638
1610
|
defaultEvalHandler = jsHandler;
|
|
1639
|
-
|
|
1611
|
+
createRequire(import.meta.url);
|
|
1640
1612
|
Object.freeze({ wrapExpression: true });
|
|
1641
1613
|
//#endregion
|
|
1642
1614
|
//#region src/wxml/whitespace.ts
|
|
@@ -1781,15 +1753,15 @@ var Tokenizer = class {
|
|
|
1781
1753
|
new Tokenizer();
|
|
1782
1754
|
//#endregion
|
|
1783
1755
|
//#region src/constants.ts
|
|
1784
|
-
const WEAPP_TW_REQUIRED_NODE_VERSION_RANGE = "^
|
|
1756
|
+
const WEAPP_TW_REQUIRED_NODE_VERSION_RANGE = "^22.18.0 || >=24.11.0";
|
|
1785
1757
|
//#endregion
|
|
1786
1758
|
//#region src/cli/context.ts
|
|
1787
1759
|
function formatOutputPath(target, baseDir) {
|
|
1788
|
-
const root = baseDir ??
|
|
1789
|
-
const relative =
|
|
1760
|
+
const root = baseDir ?? process.cwd();
|
|
1761
|
+
const relative = path.relative(root, target);
|
|
1790
1762
|
if (!relative) return ".";
|
|
1791
|
-
if (relative.startsWith("..")) return
|
|
1792
|
-
return relative.startsWith(".") ? relative : `.${
|
|
1763
|
+
if (relative.startsWith("..")) return path.normalize(target);
|
|
1764
|
+
return relative.startsWith(".") ? relative : `.${path.sep}${relative}`;
|
|
1793
1765
|
}
|
|
1794
1766
|
//#endregion
|
|
1795
1767
|
//#region src/cli/doctor/constants.ts
|
|
@@ -1827,20 +1799,20 @@ const FRAMEWORK_DEPS = [
|
|
|
1827
1799
|
//#region src/cli/doctor.ts
|
|
1828
1800
|
function tryReadJson(file) {
|
|
1829
1801
|
try {
|
|
1830
|
-
return JSON.parse(
|
|
1802
|
+
return JSON.parse(readFileSync(file, "utf8"));
|
|
1831
1803
|
} catch {
|
|
1832
1804
|
return;
|
|
1833
1805
|
}
|
|
1834
1806
|
}
|
|
1835
1807
|
function findFirstExisting(cwd, files) {
|
|
1836
|
-
return files.find((file) =>
|
|
1808
|
+
return files.find((file) => existsSync(path.join(cwd, file)));
|
|
1837
1809
|
}
|
|
1838
1810
|
function readProjectPackageJson(cwd) {
|
|
1839
|
-
return tryReadJson(
|
|
1811
|
+
return tryReadJson(path.join(cwd, "package.json"));
|
|
1840
1812
|
}
|
|
1841
1813
|
function readDependencyVersion(cwd, packageName) {
|
|
1842
1814
|
try {
|
|
1843
|
-
return tryReadJson(
|
|
1815
|
+
return tryReadJson(createRequire(path.join(cwd, "package.json")).resolve(`${packageName}/package.json`))?.version;
|
|
1844
1816
|
} catch {
|
|
1845
1817
|
return;
|
|
1846
1818
|
}
|
|
@@ -1855,9 +1827,9 @@ function collectDependencySpecs(pkg) {
|
|
|
1855
1827
|
}
|
|
1856
1828
|
function detectPackageManager(cwd, pkg) {
|
|
1857
1829
|
if (pkg?.packageManager) return pkg.packageManager;
|
|
1858
|
-
if (
|
|
1859
|
-
if (
|
|
1860
|
-
if (
|
|
1830
|
+
if (existsSync(path.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
|
|
1831
|
+
if (existsSync(path.join(cwd, "package-lock.json"))) return "npm";
|
|
1832
|
+
if (existsSync(path.join(cwd, "yarn.lock"))) return "yarn";
|
|
1861
1833
|
}
|
|
1862
1834
|
function detectFrameworks(deps) {
|
|
1863
1835
|
return FRAMEWORK_DEPS.filter(([dependency]) => dependency in deps).map(([, label]) => label);
|
|
@@ -1881,15 +1853,15 @@ function hasDependency(deps, packageName) {
|
|
|
1881
1853
|
}
|
|
1882
1854
|
function getMajorVersion(version) {
|
|
1883
1855
|
if (!version) return;
|
|
1884
|
-
return semver.
|
|
1856
|
+
return semver.parse(version)?.major;
|
|
1885
1857
|
}
|
|
1886
1858
|
function getDependencyMajor(deps, packageName) {
|
|
1887
1859
|
const spec = deps[packageName];
|
|
1888
|
-
return spec ? semver.
|
|
1860
|
+
return spec ? semver.minVersion(spec)?.major : void 0;
|
|
1889
1861
|
}
|
|
1890
1862
|
function createDoctorReport(options = {}) {
|
|
1891
|
-
const cwd =
|
|
1892
|
-
const nodeVersion = options.nodeVersion ??
|
|
1863
|
+
const cwd = path.resolve(options.cwd ?? process.cwd());
|
|
1864
|
+
const nodeVersion = options.nodeVersion ?? process.versions.node;
|
|
1893
1865
|
const pkg = readProjectPackageJson(cwd);
|
|
1894
1866
|
const deps = collectDependencySpecs(pkg);
|
|
1895
1867
|
const checks = [];
|
|
@@ -1914,7 +1886,7 @@ function createDoctorReport(options = {}) {
|
|
|
1914
1886
|
message: "当前目录没有 package.json。",
|
|
1915
1887
|
suggestion: "请在项目根目录运行 doctor,或通过 --cwd 指向项目根目录。"
|
|
1916
1888
|
});
|
|
1917
|
-
addCheck(checks, semver.
|
|
1889
|
+
addCheck(checks, semver.satisfies(nodeVersion, "^22.18.0 || >=24.11.0") ? {
|
|
1918
1890
|
id: "node-version",
|
|
1919
1891
|
title: "Node.js",
|
|
1920
1892
|
status: "ok",
|
|
@@ -2080,18 +2052,18 @@ function toBoolean(value, fallback) {
|
|
|
2080
2052
|
function resolveCliCwd(value) {
|
|
2081
2053
|
const raw = readStringOption("cwd", value);
|
|
2082
2054
|
if (!raw) return;
|
|
2083
|
-
return
|
|
2055
|
+
return path.isAbsolute(raw) ? path.normalize(raw) : path.resolve(process.cwd(), raw);
|
|
2084
2056
|
}
|
|
2085
2057
|
//#endregion
|
|
2086
2058
|
//#region src/cli/helpers.ts
|
|
2087
2059
|
async function ensureDir(dir) {
|
|
2088
|
-
await
|
|
2060
|
+
await mkdir(dir, { recursive: true });
|
|
2089
2061
|
}
|
|
2090
2062
|
function handleCliError(error) {
|
|
2091
2063
|
if (error instanceof Error) {
|
|
2092
|
-
|
|
2093
|
-
if (error.stack &&
|
|
2094
|
-
} else
|
|
2064
|
+
logger.error(error.message);
|
|
2065
|
+
if (error.stack && process.env["WEAPP_TW_DEBUG"] === "1") logger.error(error.stack);
|
|
2066
|
+
} else logger.error(String(error));
|
|
2095
2067
|
}
|
|
2096
2068
|
function commandAction(handler) {
|
|
2097
2069
|
return async (...args) => {
|
|
@@ -2099,7 +2071,7 @@ function commandAction(handler) {
|
|
|
2099
2071
|
await handler(...args);
|
|
2100
2072
|
} catch (error) {
|
|
2101
2073
|
handleCliError(error);
|
|
2102
|
-
|
|
2074
|
+
process.exitCode = 1;
|
|
2103
2075
|
}
|
|
2104
2076
|
};
|
|
2105
2077
|
}
|
|
@@ -2115,11 +2087,11 @@ const obsoletePatchCommands = [
|
|
|
2115
2087
|
"validate"
|
|
2116
2088
|
];
|
|
2117
2089
|
function logPatchCommandObsoleteNotice() {
|
|
2118
|
-
|
|
2090
|
+
logger.warn(PATCH_COMMAND_OBSOLETE_NOTICE);
|
|
2119
2091
|
}
|
|
2120
2092
|
function logObsoletePatchCommand(command) {
|
|
2121
2093
|
logPatchCommandObsoleteNotice();
|
|
2122
|
-
|
|
2094
|
+
logger.warn(`命令 "${command}" 来自旧版 tailwindcss-patch 工作流,当前版本无需执行。`);
|
|
2123
2095
|
}
|
|
2124
2096
|
const DEFAULT_VSCODE_SOURCES = [
|
|
2125
2097
|
"not \"./dist\"",
|
|
@@ -2136,7 +2108,7 @@ function toPosixPath(filepath) {
|
|
|
2136
2108
|
}
|
|
2137
2109
|
async function assertFileExists(filepath) {
|
|
2138
2110
|
try {
|
|
2139
|
-
await
|
|
2111
|
+
await access(filepath, constants.F_OK);
|
|
2140
2112
|
} catch (error) {
|
|
2141
2113
|
const err = error;
|
|
2142
2114
|
if (err?.code === "ENOENT") throw new Error(`CSS entry file not found: ${filepath}`);
|
|
@@ -2145,7 +2117,7 @@ async function assertFileExists(filepath) {
|
|
|
2145
2117
|
}
|
|
2146
2118
|
async function assertCanWrite(filepath, force) {
|
|
2147
2119
|
try {
|
|
2148
|
-
await
|
|
2120
|
+
await access(filepath, constants.F_OK);
|
|
2149
2121
|
if (!force) throw new Error(`VS Code helper already exists at ${filepath}. Re-run with --force to overwrite it.`);
|
|
2150
2122
|
} catch (error) {
|
|
2151
2123
|
const err = error;
|
|
@@ -2176,15 +2148,15 @@ function formatSource(pattern) {
|
|
|
2176
2148
|
}
|
|
2177
2149
|
function resolveOutputPath(baseDir, output) {
|
|
2178
2150
|
const target = output ?? ".vscode/weapp-tailwindcss.intellisense.css";
|
|
2179
|
-
return
|
|
2151
|
+
return path.isAbsolute(target) ? path.normalize(target) : path.resolve(baseDir, target);
|
|
2180
2152
|
}
|
|
2181
2153
|
function resolveCssEntry(baseDir, entry) {
|
|
2182
|
-
return
|
|
2154
|
+
return path.isAbsolute(entry) ? path.normalize(entry) : path.resolve(baseDir, entry);
|
|
2183
2155
|
}
|
|
2184
2156
|
function toRelativeImport(fromFile, targetFile) {
|
|
2185
|
-
const fromDir =
|
|
2186
|
-
let relative =
|
|
2187
|
-
if (!relative) relative =
|
|
2157
|
+
const fromDir = path.dirname(fromFile);
|
|
2158
|
+
let relative = path.relative(fromDir, targetFile);
|
|
2159
|
+
if (!relative) relative = path.basename(targetFile);
|
|
2188
2160
|
if (!relative.startsWith(".")) relative = `./${relative}`;
|
|
2189
2161
|
return toPosixPath(relative);
|
|
2190
2162
|
}
|
|
@@ -2193,12 +2165,12 @@ async function generateVscodeIntellisenseEntry(options) {
|
|
|
2193
2165
|
const cssEntryPath = resolveCssEntry(baseDir, options.cssEntry);
|
|
2194
2166
|
await assertFileExists(cssEntryPath);
|
|
2195
2167
|
const outputPath = resolveOutputPath(baseDir, options.output);
|
|
2196
|
-
await ensureDir(
|
|
2168
|
+
await ensureDir(path.dirname(outputPath));
|
|
2197
2169
|
await assertCanWrite(outputPath, options.force);
|
|
2198
2170
|
const formattedSources = (options.sources && options.sources.length > 0 ? options.sources : DEFAULT_VSCODE_SOURCES).map(formatSource).filter((statement) => Boolean(statement));
|
|
2199
2171
|
const cssImport = toRelativeImport(outputPath, cssEntryPath);
|
|
2200
2172
|
const separator = formattedSources.length > 0 ? [""] : [];
|
|
2201
|
-
await
|
|
2173
|
+
await writeFile(outputPath, `${[
|
|
2202
2174
|
"/*",
|
|
2203
2175
|
" * Auto-generated by weapp-tailwindcss.",
|
|
2204
2176
|
" * This file exists solely to activate Tailwind CSS IntelliSense in VS Code.",
|
|
@@ -2218,8 +2190,8 @@ async function generateVscodeIntellisenseEntry(options) {
|
|
|
2218
2190
|
}
|
|
2219
2191
|
//#endregion
|
|
2220
2192
|
//#region src/cli.ts
|
|
2221
|
-
|
|
2222
|
-
if (!semver.
|
|
2193
|
+
process.title = "node (weapp-tailwindcss)";
|
|
2194
|
+
if (!semver.satisfies(process.versions.node, "^22.18.0 || >=24.11.0")) logger.warn(`You are using Node.js ${process.versions.node}. For weapp-tailwindcss, Node.js version ${WEAPP_TW_REQUIRED_NODE_VERSION_RANGE} is required.`);
|
|
2223
2195
|
function parseArgs(argv) {
|
|
2224
2196
|
const options = {};
|
|
2225
2197
|
const positional = [];
|
|
@@ -2251,7 +2223,7 @@ function parseArgs(argv) {
|
|
|
2251
2223
|
};
|
|
2252
2224
|
}
|
|
2253
2225
|
function printHelp() {
|
|
2254
|
-
|
|
2226
|
+
logger.log(`weapp-tailwindcss
|
|
2255
2227
|
|
|
2256
2228
|
Usage:
|
|
2257
2229
|
weapp-tw <command> [options]
|
|
@@ -2265,7 +2237,7 @@ Commands:
|
|
|
2265
2237
|
}
|
|
2266
2238
|
async function runPatch() {
|
|
2267
2239
|
logPatchCommandObsoleteNotice();
|
|
2268
|
-
|
|
2240
|
+
logger.success("已跳过:当前版本不需要手动执行 Tailwind CSS patch。");
|
|
2269
2241
|
}
|
|
2270
2242
|
async function runStatus(options) {
|
|
2271
2243
|
const payload = {
|
|
@@ -2274,15 +2246,15 @@ async function runStatus(options) {
|
|
|
2274
2246
|
message: PATCH_COMMAND_OBSOLETE_NOTICE
|
|
2275
2247
|
};
|
|
2276
2248
|
if (toBoolean(options["json"], false)) {
|
|
2277
|
-
|
|
2249
|
+
logger.log(JSON.stringify(payload, null, 2));
|
|
2278
2250
|
return;
|
|
2279
2251
|
}
|
|
2280
2252
|
logPatchCommandObsoleteNotice();
|
|
2281
|
-
|
|
2253
|
+
logger.success("无需检查 Tailwind CSS patch 状态。");
|
|
2282
2254
|
}
|
|
2283
2255
|
async function runVscodeEntry(options) {
|
|
2284
2256
|
const resolvedCwd = resolveCliCwd(options.cwd);
|
|
2285
|
-
const baseDir = resolvedCwd ??
|
|
2257
|
+
const baseDir = resolvedCwd ?? process.cwd();
|
|
2286
2258
|
const cssEntry = readStringOption("css", options["css"]);
|
|
2287
2259
|
if (!cssEntry) throw new Error("Option \"--css\" is required.");
|
|
2288
2260
|
const result = await generateVscodeIntellisenseEntry({
|
|
@@ -2292,16 +2264,16 @@ async function runVscodeEntry(options) {
|
|
|
2292
2264
|
sources: readStringArrayOption("source", options["source"]),
|
|
2293
2265
|
force: toBoolean(options["force"], false)
|
|
2294
2266
|
});
|
|
2295
|
-
|
|
2267
|
+
logger.success(`VS Code helper generated -> ${formatOutputPath(result.outputPath, resolvedCwd)}`);
|
|
2296
2268
|
}
|
|
2297
2269
|
async function runDoctor(options) {
|
|
2298
2270
|
const report = createDoctorReport({ cwd: resolveCliCwd(options.cwd) });
|
|
2299
|
-
if (toBoolean(options["json"], false))
|
|
2300
|
-
else
|
|
2301
|
-
if (hasDoctorFailure(report, toBoolean(options["strict"], false)))
|
|
2271
|
+
if (toBoolean(options["json"], false)) logger.log(JSON.stringify(report, null, 2));
|
|
2272
|
+
else logger.log(formatDoctorReport(report));
|
|
2273
|
+
if (hasDoctorFailure(report, toBoolean(options["strict"], false))) process.exitCode = 1;
|
|
2302
2274
|
}
|
|
2303
2275
|
async function main() {
|
|
2304
|
-
const { command, options } = parseArgs(
|
|
2276
|
+
const { command, options } = parseArgs(process.argv.slice(2));
|
|
2305
2277
|
await commandAction(async () => {
|
|
2306
2278
|
switch (command) {
|
|
2307
2279
|
case void 0:
|
|
@@ -2313,7 +2285,7 @@ async function main() {
|
|
|
2313
2285
|
case "-v":
|
|
2314
2286
|
case "--version":
|
|
2315
2287
|
case "version":
|
|
2316
|
-
|
|
2288
|
+
logger.log(process.env["npm_package_version"] ?? "0.0.0");
|
|
2317
2289
|
return;
|
|
2318
2290
|
case "patch":
|
|
2319
2291
|
case "install":
|
|
@@ -2339,3 +2311,4 @@ async function main() {
|
|
|
2339
2311
|
}
|
|
2340
2312
|
main();
|
|
2341
2313
|
//#endregion
|
|
2314
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CssFragment, CssFragmentKind, CssStage, GenerationArtifact, SourceScope } from './types.js';
|
|
2
|
+
export interface CreateCssFragmentOptions {
|
|
3
|
+
id: string;
|
|
4
|
+
kind: CssFragmentKind;
|
|
5
|
+
css: string;
|
|
6
|
+
sourceId: string;
|
|
7
|
+
scope: SourceScope;
|
|
8
|
+
order?: number | undefined;
|
|
9
|
+
stage?: CssStage | undefined;
|
|
10
|
+
}
|
|
11
|
+
export declare function createCssFragment(options: CreateCssFragmentOptions): CssFragment;
|
|
12
|
+
export declare function cloneCssFragment(fragment: CssFragment): CssFragment;
|
|
13
|
+
export declare function cloneGenerationArtifact(artifact: GenerationArtifact): GenerationArtifact;
|
|
14
|
+
export declare function createGenerationArtifact(fragments: CssFragment[], options: Omit<GenerationArtifact, 'fragments'>): GenerationArtifact;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CandidateChange } from './types.js';
|
|
2
|
+
export declare class CandidateIndex {
|
|
3
|
+
private readonly candidatesBySource;
|
|
4
|
+
sync(sourceId: string, candidates: Iterable<string>): CandidateChange;
|
|
5
|
+
remove(sourceId: string): CandidateChange;
|
|
6
|
+
values(): Set<string>;
|
|
7
|
+
get(sourceId: string): Set<string>;
|
|
8
|
+
entries(): Map<string, Set<string>>;
|
|
9
|
+
clear(): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { CompilationDependencyChange } from './compilation-scope-graph.js';
|
|
2
|
+
import type { CompilationSessionPool } from './compilation-session-pool.js';
|
|
3
|
+
import type { TailwindGenerationSessionPool } from './tailwind-generation-session-pool.js';
|
|
4
|
+
export declare class CompilationChangeCoordinator {
|
|
5
|
+
private readonly compilationPool;
|
|
6
|
+
private readonly generationPool;
|
|
7
|
+
private readonly pendingChangesByScope;
|
|
8
|
+
private disposed;
|
|
9
|
+
constructor(compilationPool: CompilationSessionPool, generationPool: TailwindGenerationSessionPool);
|
|
10
|
+
record(changes: Iterable<CompilationDependencyChange>): Set<string>;
|
|
11
|
+
consume(scopeId: string): {
|
|
12
|
+
id: string;
|
|
13
|
+
type: "dependency-changed" | "config-changed";
|
|
14
|
+
}[] | undefined;
|
|
15
|
+
invalidateScope(scopeId: string): void;
|
|
16
|
+
getScopeDependencyRevision(scopeId: string): number;
|
|
17
|
+
dispose(): void;
|
|
18
|
+
private ensureActive;
|
|
19
|
+
}
|
|
20
|
+
export declare function getCompilationChangeCoordinator(owner: object): CompilationChangeCoordinator;
|
|
21
|
+
export declare function recordCompilationDependencyChanges(owner: object, changes: Iterable<CompilationDependencyChange>): Set<string>;
|
|
22
|
+
export declare function consumeCompilationScopeChanges(owner: object, scopeId: string): {
|
|
23
|
+
id: string;
|
|
24
|
+
type: "dependency-changed" | "config-changed";
|
|
25
|
+
}[] | undefined;
|
|
26
|
+
export declare function getCompilationScopeDependencyRevision(owner: object, scopeId: string): number;
|
|
27
|
+
export declare function invalidateCompilationScope(owner: object, scopeId: string): void;
|
|
28
|
+
export declare function disposeCompilationChangeCoordinator(owner: object): void;
|