weapp-tailwindcss 5.0.0-next.5 → 5.0.0-next.8
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/dist/bundlers/shared/css-cleanup/at-rules.d.ts +2 -0
- package/dist/bundlers/shared/css-cleanup/color-gamut.d.ts +3 -0
- package/dist/bundlers/shared/css-cleanup/root-cleanups.d.ts +4 -0
- package/dist/bundlers/shared/css-cleanup/selectors.d.ts +8 -0
- package/dist/bundlers/shared/css-cleanup.d.ts +1 -2
- package/dist/bundlers/shared/generator-css/config-directive.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/directives.d.ts +12 -0
- package/dist/bundlers/shared/generator-css/legacy-compat.d.ts +7 -0
- package/dist/bundlers/shared/generator-css/legacy-selectors.d.ts +5 -0
- package/dist/bundlers/shared/generator-css/legacy-units.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/markers.d.ts +16 -0
- package/dist/bundlers/shared/generator-css/source-files.d.ts +11 -0
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +10 -0
- package/dist/bundlers/shared/generator-css.d.ts +10 -23
- package/dist/bundlers/vite/css-finalizer.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/candidates.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +20 -0
- package/dist/bundlers/vite/generate-bundle/css-share-scope.d.ts +3 -0
- package/dist/bundlers/vite/generate-bundle/dirty-state.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/js-entries.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/js-handler-options.d.ts +8 -0
- package/dist/bundlers/vite/generate-bundle/js-linking.d.ts +13 -0
- package/dist/bundlers/vite/generate-bundle/metrics.d.ts +17 -0
- package/dist/bundlers/vite/generate-bundle/process-plan.d.ts +9 -0
- package/dist/bundlers/vite/generate-bundle/rollup-assets.d.ts +7 -0
- package/dist/bundlers/vite/generate-bundle/signatures.d.ts +8 -0
- package/dist/bundlers/vite/generate-bundle.d.ts +1 -1
- package/dist/bundlers/vite/official-tailwind-plugins.d.ts +5 -0
- package/dist/bundlers/vite/postcss-config.d.ts +6 -0
- package/dist/bundlers/vite/rewrite-css-imports.d.ts +1 -0
- package/dist/bundlers/vite/runtime-class-set.d.ts +22 -0
- package/dist/bundlers/vite/tailwind-basedir.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +2 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +1 -0
- package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +2 -0
- package/dist/cache-BVAiJV3J.js +502 -0
- package/dist/cache-CHs4DXui.mjs +434 -0
- package/dist/cli/helpers.d.ts +1 -2
- package/dist/cli/mount-options.d.ts +2 -2
- package/dist/cli/types.d.ts +0 -2
- package/dist/cli.js +107 -603
- package/dist/cli.mjs +118 -613
- package/dist/constants.d.ts +0 -1
- package/dist/context/tailwindcss.d.ts +1 -1
- package/dist/core.js +13 -20
- package/dist/core.mjs +8 -14
- package/dist/css-macro/postcss.js +1 -1
- package/dist/css-macro/postcss.mjs +1 -1
- package/dist/css-macro.js +2 -2
- package/dist/css-macro.mjs +2 -2
- package/dist/defaults.d.ts +15 -1
- package/dist/defaults.js +28 -7
- package/dist/defaults.mjs +25 -8
- package/dist/{generator-9UEp8OoQ.js → generator-DKkhJbOg.js} +24 -7
- package/dist/{generator-Dpp-5s8z.mjs → generator-UBmfduYg.mjs} +20 -3
- package/dist/{generator-css-MyjZhF0z.mjs → generator-css-BIapP56i.mjs} +691 -606
- package/dist/{generator-css-CGueCYbX.js → generator-css-Mksw8PgB.js} +703 -606
- package/dist/generator.js +1 -1
- package/dist/generator.mjs +1 -1
- package/dist/gulp.js +33 -21
- package/dist/gulp.mjs +29 -17
- package/dist/index.js +5 -5
- package/dist/index.mjs +4 -4
- package/dist/logger-BRy6XPQ2.js +1 -0
- package/dist/logger-Bub1jggA.mjs +2 -0
- package/dist/postcss/config-directive.d.ts +1 -0
- package/dist/postcss/context.d.ts +9 -0
- package/dist/postcss/source-files.d.ts +8 -0
- package/dist/postcss/tailwind-version.d.ts +3 -0
- package/dist/postcss-QIXwT40c.js +298 -0
- package/dist/postcss-w48mGIhe.mjs +288 -0
- package/dist/postcss.js +3 -285
- package/dist/postcss.mjs +1 -278
- package/dist/{recorder-D4BKt75Q.js → precheck-B32p-gLI.js} +139 -274
- package/dist/{recorder-BIW3Kuke.mjs → precheck-B4RH6ZNN.mjs} +105 -239
- package/dist/presets.js +6 -4
- package/dist/presets.mjs +4 -2
- package/dist/runtime-patch-CwN5ya72.mjs +71 -0
- package/dist/runtime-patch-D6mBo_KB.js +85 -0
- package/dist/tailwindcss/runtime-patch.d.ts +5 -0
- package/dist/tailwindcss/runtime.d.ts +2 -3
- package/dist/tailwindcss/targets.d.ts +1 -5
- package/dist/tailwindcss/v4/css-sources.d.ts +5 -0
- package/dist/tailwindcss/v4/patcher.d.ts +1 -1
- package/dist/{logger-D9clu_3f.js → tailwindcss-Bu-RWIHx.js} +70 -413
- package/dist/{logger-1gx9UllH.mjs → tailwindcss-C5IgPlQ0.mjs} +56 -382
- package/dist/types/index.d.ts +1 -6
- package/dist/uni-app-x/vite.d.ts +1 -1
- package/dist/{vite-fDM-UQpR.mjs → vite-BwgRVgxH.mjs} +677 -525
- package/dist/{vite-BkMGwDeH.js → vite-DyZuiyap.js} +704 -552
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +10 -1
- package/dist/{webpack-CICGEKT9.js → webpack-CNV2dx3Q.js} +72 -37
- package/dist/{webpack-D2Wdk28V.mjs → webpack-CT6EEENx.mjs} +58 -23
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +6 -9
- package/dist/bundlers/shared/generator-candidates.d.ts +0 -5
- package/dist/bundlers/webpack/shared/css-imports.d.ts +0 -6
- package/dist/cli/config.d.ts +0 -5
- package/dist/cli/helpers/patch-cwd.d.ts +0 -1
- package/dist/cli/mount-options/patch-status.d.ts +0 -2
- package/dist/cli/patch-options.d.ts +0 -6
- package/dist/cli/tokens.d.ts +0 -4
- package/dist/cli/workspace/package-dirs.d.ts +0 -3
- package/dist/cli/workspace/patch-package.d.ts +0 -3
- package/dist/cli/workspace/patch-utils.d.ts +0 -3
- package/dist/cli/workspace/types.d.ts +0 -11
- package/dist/cli/workspace/workspace-globs.d.ts +0 -2
- package/dist/cli/workspace/workspace-io.d.ts +0 -1
- package/dist/cli/workspace/workspace-lock.d.ts +0 -1
- package/dist/cli/workspace.d.ts +0 -2
- package/dist/js/syntax.d.ts +0 -10
- package/dist/patcher-options-DnqazL9E.js +0 -34
- package/dist/patcher-options-GuOwX0-k.mjs +0 -17
- package/dist/tailwindcss/recorder.d.ts +0 -13
- package/dist/tailwindcss/targets/paths.d.ts +0 -13
- package/dist/tailwindcss/targets/record-io.d.ts +0 -5
- package/dist/tailwindcss/targets/recorder.d.ts +0 -3
- package/dist/tailwindcss/targets/types.d.ts +0 -35
- package/dist/version-CWBxRFPB.js +0 -56
- package/dist/version-WNz3MwRv.mjs +0 -49
- /package/dist/{constants-p1dyh1x1.js → constants-BoB_6lFw.js} +0 -0
- /package/dist/{constants-B-_T5UnW.mjs → constants-E_loJC49.mjs} +0 -0
- /package/dist/{run-tasks-Cq5A5nVD.js → run-tasks-B50A3pxt.js} +0 -0
- /package/dist/{run-tasks-DUVrDJGl.mjs → run-tasks-DdNi-hkk.mjs} +0 -0
- /package/dist/{utils-DmC9_In3.js → utils-BiShvil9.js} +0 -0
- /package/dist/{utils-7DUGTFED.mjs → utils-Btw1iOVV.mjs} +0 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
const require_chunk = require("./chunk-8l464Juk.js");
|
|
2
|
+
const require_cache = require("./cache-BVAiJV3J.js");
|
|
3
|
+
let node_module = require("node:module");
|
|
4
|
+
let node_path = require("node:path");
|
|
5
|
+
node_path = require_chunk.__toESM(node_path);
|
|
6
|
+
let debug = require("debug");
|
|
7
|
+
debug = require_chunk.__toESM(debug);
|
|
8
|
+
//#region src/debug/index.ts
|
|
9
|
+
const _debug = (0, debug.default)("weapp-tw");
|
|
10
|
+
function createDebug(prefix) {
|
|
11
|
+
const debug$2 = ((formatter, ...args) => {
|
|
12
|
+
return _debug((prefix ?? "") + formatter, ...args);
|
|
13
|
+
});
|
|
14
|
+
Object.defineProperty(debug$2, "enabled", {
|
|
15
|
+
enumerable: false,
|
|
16
|
+
configurable: false,
|
|
17
|
+
get() {
|
|
18
|
+
return _debug.enabled;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return debug$2;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/tailwindcss/runtime-patch.ts
|
|
25
|
+
const debug$1 = createDebug("[tailwindcss:runtime-patch] ");
|
|
26
|
+
const require$1 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
|
|
27
|
+
const runtimePatchPromiseCache = /* @__PURE__ */ new WeakMap();
|
|
28
|
+
function getNestedPatchers(twPatcher) {
|
|
29
|
+
const nested = twPatcher[require_cache.runtimeSignaturePatchersSymbol];
|
|
30
|
+
return Array.isArray(nested) && nested.length > 0 ? nested : void 0;
|
|
31
|
+
}
|
|
32
|
+
function shouldApplyRuntimePatch(twPatcher) {
|
|
33
|
+
return twPatcher.majorVersion === 3 && typeof twPatcher.patch === "function";
|
|
34
|
+
}
|
|
35
|
+
function clearTailwindcssRequireCache(twPatcher) {
|
|
36
|
+
const rootPath = twPatcher.packageInfo?.rootPath;
|
|
37
|
+
if (!rootPath) return;
|
|
38
|
+
const normalizedRoot = node_path.default.resolve(rootPath);
|
|
39
|
+
let count = 0;
|
|
40
|
+
for (const id of Object.keys(require$1.cache)) {
|
|
41
|
+
const normalizedId = node_path.default.resolve(id);
|
|
42
|
+
if (normalizedId === normalizedRoot || normalizedId.startsWith(`${normalizedRoot}${node_path.default.sep}`)) {
|
|
43
|
+
delete require$1.cache[id];
|
|
44
|
+
count += 1;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (count > 0) debug$1("clear tailwindcss require cache after runtime patch, count=%d root=%s", count, normalizedRoot);
|
|
48
|
+
}
|
|
49
|
+
async function ensureTailwindcssRuntimePatch(twPatcher, options = {}) {
|
|
50
|
+
const nestedPatchers = getNestedPatchers(twPatcher);
|
|
51
|
+
if (nestedPatchers) {
|
|
52
|
+
await Promise.all(nestedPatchers.map((patcher) => ensureTailwindcssRuntimePatch(patcher)));
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (!shouldApplyRuntimePatch(twPatcher)) return;
|
|
56
|
+
const cached = runtimePatchPromiseCache.get(twPatcher);
|
|
57
|
+
if (cached) {
|
|
58
|
+
await cached;
|
|
59
|
+
if (options.clearRequireCache) clearTailwindcssRequireCache(twPatcher);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const task = Promise.resolve().then(async () => {
|
|
63
|
+
debug$1("apply tailwindcss runtime patch, package=%s version=%s root=%s", twPatcher.packageInfo?.name ?? "tailwindcss", twPatcher.packageInfo?.version ?? "unknown", twPatcher.packageInfo?.rootPath ?? "unknown");
|
|
64
|
+
await twPatcher.patch?.();
|
|
65
|
+
if (options.clearRequireCache) clearTailwindcssRequireCache(twPatcher);
|
|
66
|
+
}).catch((error) => {
|
|
67
|
+
runtimePatchPromiseCache.delete(twPatcher);
|
|
68
|
+
throw error;
|
|
69
|
+
});
|
|
70
|
+
runtimePatchPromiseCache.set(twPatcher, task);
|
|
71
|
+
return task;
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
Object.defineProperty(exports, "createDebug", {
|
|
75
|
+
enumerable: true,
|
|
76
|
+
get: function() {
|
|
77
|
+
return createDebug;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
Object.defineProperty(exports, "ensureTailwindcssRuntimePatch", {
|
|
81
|
+
enumerable: true,
|
|
82
|
+
get: function() {
|
|
83
|
+
return ensureTailwindcssRuntimePatch;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TailwindcssPatcherLike } from '../types';
|
|
2
|
+
export interface EnsureTailwindcssRuntimePatchOptions {
|
|
3
|
+
clearRequireCache?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function ensureTailwindcssRuntimePatch(twPatcher: TailwindcssPatcherLike, options?: EnsureTailwindcssRuntimePatchOptions): Promise<void>;
|
|
@@ -10,12 +10,11 @@ export interface RefreshTailwindRuntimeStateOptions {
|
|
|
10
10
|
force: boolean;
|
|
11
11
|
clearCache?: boolean;
|
|
12
12
|
}
|
|
13
|
-
export declare function
|
|
13
|
+
export declare function createTailwindRuntimeReadyPromise(twPatcher: TailwindcssPatcherLike): Promise<void>;
|
|
14
14
|
export interface TailwindRuntimeState {
|
|
15
15
|
twPatcher: TailwindcssPatcherLike;
|
|
16
|
-
|
|
16
|
+
readyPromise: Promise<void>;
|
|
17
17
|
refreshTailwindcssPatcher?: (options?: RefreshTailwindcssPatcherOptions) => Promise<TailwindcssPatcherLike>;
|
|
18
|
-
onPatchCompleted?: () => Promise<void> | void;
|
|
19
18
|
}
|
|
20
19
|
export declare function refreshTailwindRuntimeState(state: TailwindRuntimeState, forceOrOptions: boolean | RefreshTailwindRuntimeStateOptions): Promise<boolean>;
|
|
21
20
|
export interface EnsureRuntimeClassSetOptions {
|
|
@@ -1,6 +1,2 @@
|
|
|
1
1
|
import type { TailwindcssPatcherLike } from '../types';
|
|
2
|
-
|
|
3
|
-
import { createPatchTargetRecorder } from './targets/recorder';
|
|
4
|
-
export type { PatchTargetRecorder, PatchTargetRecorderOptions, SavePatchTargetRecordOptions } from './targets/types';
|
|
5
|
-
export declare function logTailwindcssTarget(kind: 'cli' | 'runtime', patcher: TailwindcssPatcherLike | undefined, baseDir?: string): void;
|
|
6
|
-
export { __resetPatchTargetRecordWarningsForTests, createPatchTargetRecorder, saveCliPatchTargetRecord, };
|
|
2
|
+
export declare function logTailwindcssTarget(patcher: TailwindcssPatcherLike | undefined, baseDir?: string): void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TailwindV4CssSource } from 'tailwindcss-patch';
|
|
2
|
+
import type { UserDefinedOptions } from '../../types';
|
|
3
|
+
export declare function hasCssSourcesValue(value: unknown): boolean;
|
|
4
|
+
export declare function hasConfiguredTailwindV4CssRoots(options: Pick<UserDefinedOptions, 'cssEntries' | 'tailwindcss' | 'tailwindcssPatcherOptions'>): boolean;
|
|
5
|
+
export declare function upsertTailwindV4CssSource(opts: UserDefinedOptions, source: TailwindV4CssSource): boolean;
|
|
@@ -11,5 +11,5 @@ export interface TailwindcssPatcherFactoryOptions {
|
|
|
11
11
|
appType: InternalUserDefinedOptions['appType'];
|
|
12
12
|
bareArbitraryValues?: InternalUserDefinedOptions['arbitraryValues']['bareArbitraryValues'];
|
|
13
13
|
}
|
|
14
|
-
export declare function createPatcherForBase(baseDir: string, cssEntries: string[] | undefined, options: TailwindcssPatcherFactoryOptions): TailwindcssPatcherLike;
|
|
14
|
+
export declare function createPatcherForBase(baseDir: string, cssEntries: string[] | undefined, options: TailwindcssPatcherFactoryOptions): TailwindcssPatcherLike | undefined;
|
|
15
15
|
export declare function tryCreateMultiTailwindcssPatcher(groups: Map<string, string[]>, options: TailwindcssPatcherFactoryOptions): TailwindcssPatcherLike | undefined;
|