@csszyx/unplugin 0.12.0 → 0.13.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/dist/index.cjs +8 -7
- package/dist/index.d.cts +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +3 -3
- package/dist/next-config.cjs +3 -0
- package/dist/next-config.d.cts +10 -0
- package/dist/next-config.d.mts +10 -0
- package/dist/next-config.mjs +3 -0
- package/dist/next-prebuild.cjs +12 -5
- package/dist/next-prebuild.d.cts +7 -0
- package/dist/next-prebuild.d.mts +7 -0
- package/dist/next-prebuild.mjs +12 -5
- package/dist/next-turbo-loader.cjs +29 -11
- package/dist/next-turbo-loader.d.cts +10 -0
- package/dist/next-turbo-loader.d.mts +10 -0
- package/dist/next-turbo-loader.mjs +28 -10
- package/dist/next-watcher.cjs +1 -1
- package/dist/next-watcher.mjs +1 -1
- package/dist/shared/unplugin.4du3qMst.cjs +529 -0
- package/dist/shared/unplugin.5l4RHMQh.mjs +578 -0
- package/dist/shared/unplugin.BB0iWSds.mjs +495 -0
- package/dist/shared/{unplugin.DMcbmP01.mjs → unplugin.BU0O4IkX.mjs} +4 -1
- package/dist/shared/{unplugin.BK3XVHe8.cjs → unplugin.Bf4fNbp7.cjs} +318 -532
- package/dist/shared/{unplugin.Bb5TeU9B.cjs → unplugin.CUTa6bY9.cjs} +89 -1
- package/dist/shared/{unplugin.DblMogcN.cjs → unplugin.Cji6O5jv.cjs} +4 -1
- package/dist/shared/{unplugin.DXgxFHzO.mjs → unplugin.CogPHmDs.mjs} +73 -3
- package/dist/shared/{unplugin.CtnKJhAi.d.cts → unplugin.DCT7DDG6.d.cts} +75 -30
- package/dist/shared/{unplugin.CtnKJhAi.d.mts → unplugin.DCT7DDG6.d.mts} +75 -30
- package/dist/shared/unplugin.X9a9SL_s.cjs +612 -0
- package/dist/shared/{unplugin.B9vpjOhD.mjs → unplugin.ymMe428s.mjs} +288 -499
- package/dist/vite.cjs +3 -3
- package/dist/vite.d.cts +2 -2
- package/dist/vite.d.mts +1 -1
- package/dist/vite.mjs +3 -3
- package/dist/webpack.cjs +3 -3
- package/dist/webpack.d.cts +2 -2
- package/dist/webpack.d.mts +1 -1
- package/dist/webpack.mjs +3 -3
- package/package.json +9 -9
- package/dist/shared/unplugin.C2lHQFii.cjs +0 -114
- package/dist/shared/unplugin.CBMJufQ8.mjs +0 -108
- package/dist/shared/unplugin.CDqY7kmk.mjs +0 -224
- package/dist/shared/unplugin.DbZ7tCfN.cjs +0 -248
|
@@ -1,11 +1,89 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const fs = require('node:fs');
|
|
4
|
+
const path = require('node:path');
|
|
4
5
|
const compiler = require('@csszyx/compiler');
|
|
5
|
-
const
|
|
6
|
+
const types = require('@csszyx/types');
|
|
7
|
+
const transformCache = require('./unplugin.4du3qMst.cjs');
|
|
6
8
|
const node_crypto = require('node:crypto');
|
|
7
9
|
const htmlEscape = require('./unplugin.BkRah5Ot.cjs');
|
|
8
10
|
|
|
11
|
+
function _interopNamespaceCompat(e) {
|
|
12
|
+
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
13
|
+
const n = Object.create(null);
|
|
14
|
+
if (e) {
|
|
15
|
+
for (const k in e) {
|
|
16
|
+
n[k] = e[k];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
n.default = e;
|
|
20
|
+
return n;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const path__namespace = /*#__PURE__*/_interopNamespaceCompat(path);
|
|
24
|
+
|
|
25
|
+
function resolveImportedStaticSz(value) {
|
|
26
|
+
return value ?? types.DEFAULT_IMPORTED_STATIC_SZ;
|
|
27
|
+
}
|
|
28
|
+
const aliasesByRoot = /* @__PURE__ */ new Map();
|
|
29
|
+
function resolveNextCrossModule(input) {
|
|
30
|
+
const empty = { statics: {}, providers: [] };
|
|
31
|
+
if (!input.source.includes("from")) return empty;
|
|
32
|
+
let aliases = aliasesByRoot.get(input.root);
|
|
33
|
+
if (aliases === void 0) {
|
|
34
|
+
aliases = transformCache.collectSpecifierAliases(input.root);
|
|
35
|
+
aliasesByRoot.set(input.root, aliases);
|
|
36
|
+
}
|
|
37
|
+
const directory = path__namespace.dirname(input.filename);
|
|
38
|
+
const statics = {};
|
|
39
|
+
const providers = [];
|
|
40
|
+
const seen = /* @__PURE__ */ new Set();
|
|
41
|
+
for (const specifier of transformCache.importedSpecifiersIn(input.source)) {
|
|
42
|
+
if (seen.has(specifier)) continue;
|
|
43
|
+
seen.add(specifier);
|
|
44
|
+
for (const base of transformCache.specifierBases(specifier, directory, aliases)) {
|
|
45
|
+
const provider = transformCache.resolveProviderPathWith(base, transformCache.isReadableProviderFile);
|
|
46
|
+
if (provider === void 0) continue;
|
|
47
|
+
providers.push(provider);
|
|
48
|
+
recordEntries(statics, specifier, readProviderEntries(provider), input);
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return { statics, providers };
|
|
53
|
+
}
|
|
54
|
+
function readProviderEntries(provider) {
|
|
55
|
+
try {
|
|
56
|
+
return compiler.extractCrossModuleRegistryEntries(fs.readFileSync(provider, "utf8"), provider);
|
|
57
|
+
} catch {
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function recordEntries(statics, specifier, entries, input) {
|
|
62
|
+
for (const entry of entries) {
|
|
63
|
+
if (entry.kind === "sz-object" && !resolveImportedStaticSz(input.importedStaticSz)) {
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
transformCache.recordResolvedEntry(statics, entry.kind, specifier, entry.exportName, entry.value);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function withCrossModuleStatics(options, statics) {
|
|
70
|
+
if (statics.szvConfigs === void 0 && statics.szObjects === void 0) return options;
|
|
71
|
+
return {
|
|
72
|
+
...options,
|
|
73
|
+
...statics.szvConfigs === void 0 ? {} : { crossModuleStatics: statics.szvConfigs },
|
|
74
|
+
...statics.szObjects === void 0 ? {} : { crossModuleSzObjects: statics.szObjects }
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function configWithImportedStaticSz(config, importedStaticSz) {
|
|
78
|
+
return {
|
|
79
|
+
...config,
|
|
80
|
+
importedStaticSz: resolveImportedStaticSz(importedStaticSz)
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function normalizeProviderPaths(providers) {
|
|
84
|
+
return [...new Set(providers.map(transformCache.normalizePathSeparators))];
|
|
85
|
+
}
|
|
86
|
+
|
|
9
87
|
function readPackageVersion(relativePackageJson, fromUrl) {
|
|
10
88
|
try {
|
|
11
89
|
const packageJson = JSON.parse(
|
|
@@ -169,6 +247,12 @@ function createNextSourceTransformCacheInput(input, filename, producer) {
|
|
|
169
247
|
globalVarAliases: normalizeGlobalVarAliasesForCache(
|
|
170
248
|
input.compilerOptions?.globalVarAliases
|
|
171
249
|
),
|
|
250
|
+
// The registry slice this file was compiled against is part of its
|
|
251
|
+
// identity. Without it an edited provider serves its importers the
|
|
252
|
+
// cached output built from the value it used to have — the one failure
|
|
253
|
+
// this lane refused to risk before it resolved anything at all.
|
|
254
|
+
crossModuleStatics: input.compilerOptions?.crossModuleStatics === void 0 ? void 0 : JSON.stringify(input.compilerOptions.crossModuleStatics),
|
|
255
|
+
crossModuleSzObjects: input.compilerOptions?.crossModuleSzObjects === void 0 ? void 0 : JSON.stringify(input.compilerOptions.crossModuleSzObjects),
|
|
172
256
|
filename,
|
|
173
257
|
source: input.source
|
|
174
258
|
};
|
|
@@ -278,6 +362,10 @@ function collectTransformClasses(result, discoveredClasses) {
|
|
|
278
362
|
}
|
|
279
363
|
|
|
280
364
|
exports.collectNextTransformMetadata = collectNextTransformMetadata;
|
|
365
|
+
exports.configWithImportedStaticSz = configWithImportedStaticSz;
|
|
281
366
|
exports.createNextSafelistShardFromMetadata = createNextSafelistShardFromMetadata;
|
|
367
|
+
exports.normalizeProviderPaths = normalizeProviderPaths;
|
|
282
368
|
exports.readPackageVersion = readPackageVersion;
|
|
369
|
+
exports.resolveNextCrossModule = resolveNextCrossModule;
|
|
283
370
|
exports.transformNextSource = transformNextSource;
|
|
371
|
+
exports.withCrossModuleStatics = withCrossModuleStatics;
|
|
@@ -185,11 +185,14 @@ function atomicRenameWithRetry(from, to, options = {}) {
|
|
|
185
185
|
function isExistingShardEquivalent(filePath, shard) {
|
|
186
186
|
try {
|
|
187
187
|
const parsed = JSON.parse(fs__namespace.readFileSync(filePath, "utf8"));
|
|
188
|
-
return parsed.version === 1 && parsed.sourcePath === shard.sourcePath && parsed.sourceHash === shard.sourceHash;
|
|
188
|
+
return parsed.version === 1 && parsed.sourcePath === shard.sourcePath && parsed.sourceHash === shard.sourceHash && sameClasses(parsed.classes, shard.classes);
|
|
189
189
|
} catch {
|
|
190
190
|
return false;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
+
function sameClasses(left, right) {
|
|
194
|
+
return Array.isArray(left) && left.length === right.length && left.every((value, index) => value === right[index]);
|
|
195
|
+
}
|
|
193
196
|
function normalizeShardInput(input) {
|
|
194
197
|
const sourcePath = path__namespace.resolve(input.sourcePath);
|
|
195
198
|
const classes = htmlEscape.sortStrings(
|
|
@@ -1,9 +1,73 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import { extractCrossModuleRegistryEntries, ensureRustTransformAvailable, transformSourceCode, transformRust, transformOxc, transform } from '@csszyx/compiler';
|
|
4
|
+
import { DEFAULT_IMPORTED_STATIC_SZ } from '@csszyx/types';
|
|
5
|
+
import { c as collectSpecifierAliases, i as importedSpecifiersIn, s as specifierBases, a as resolveProviderPathWith, n as normalizePathSeparators, b as recordResolvedEntry, d as isReadableProviderFile, e as createTransformCacheKey, f as readTransformCache, w as writeTransformCache, g as babelFallbackReason } from './unplugin.BB0iWSds.mjs';
|
|
4
6
|
import { createHash } from 'node:crypto';
|
|
5
7
|
import { s as sortStrings } from './unplugin.B3XoSRB8.mjs';
|
|
6
8
|
|
|
9
|
+
function resolveImportedStaticSz(value) {
|
|
10
|
+
return value ?? DEFAULT_IMPORTED_STATIC_SZ;
|
|
11
|
+
}
|
|
12
|
+
const aliasesByRoot = /* @__PURE__ */ new Map();
|
|
13
|
+
function resolveNextCrossModule(input) {
|
|
14
|
+
const empty = { statics: {}, providers: [] };
|
|
15
|
+
if (!input.source.includes("from")) return empty;
|
|
16
|
+
let aliases = aliasesByRoot.get(input.root);
|
|
17
|
+
if (aliases === void 0) {
|
|
18
|
+
aliases = collectSpecifierAliases(input.root);
|
|
19
|
+
aliasesByRoot.set(input.root, aliases);
|
|
20
|
+
}
|
|
21
|
+
const directory = path.dirname(input.filename);
|
|
22
|
+
const statics = {};
|
|
23
|
+
const providers = [];
|
|
24
|
+
const seen = /* @__PURE__ */ new Set();
|
|
25
|
+
for (const specifier of importedSpecifiersIn(input.source)) {
|
|
26
|
+
if (seen.has(specifier)) continue;
|
|
27
|
+
seen.add(specifier);
|
|
28
|
+
for (const base of specifierBases(specifier, directory, aliases)) {
|
|
29
|
+
const provider = resolveProviderPathWith(base, isReadableProviderFile);
|
|
30
|
+
if (provider === void 0) continue;
|
|
31
|
+
providers.push(provider);
|
|
32
|
+
recordEntries(statics, specifier, readProviderEntries(provider), input);
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return { statics, providers };
|
|
37
|
+
}
|
|
38
|
+
function readProviderEntries(provider) {
|
|
39
|
+
try {
|
|
40
|
+
return extractCrossModuleRegistryEntries(readFileSync(provider, "utf8"), provider);
|
|
41
|
+
} catch {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function recordEntries(statics, specifier, entries, input) {
|
|
46
|
+
for (const entry of entries) {
|
|
47
|
+
if (entry.kind === "sz-object" && !resolveImportedStaticSz(input.importedStaticSz)) {
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
recordResolvedEntry(statics, entry.kind, specifier, entry.exportName, entry.value);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function withCrossModuleStatics(options, statics) {
|
|
54
|
+
if (statics.szvConfigs === void 0 && statics.szObjects === void 0) return options;
|
|
55
|
+
return {
|
|
56
|
+
...options,
|
|
57
|
+
...statics.szvConfigs === void 0 ? {} : { crossModuleStatics: statics.szvConfigs },
|
|
58
|
+
...statics.szObjects === void 0 ? {} : { crossModuleSzObjects: statics.szObjects }
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function configWithImportedStaticSz(config, importedStaticSz) {
|
|
62
|
+
return {
|
|
63
|
+
...config,
|
|
64
|
+
importedStaticSz: resolveImportedStaticSz(importedStaticSz)
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function normalizeProviderPaths(providers) {
|
|
68
|
+
return [...new Set(providers.map(normalizePathSeparators))];
|
|
69
|
+
}
|
|
70
|
+
|
|
7
71
|
function readPackageVersion(relativePackageJson, fromUrl) {
|
|
8
72
|
try {
|
|
9
73
|
const packageJson = JSON.parse(
|
|
@@ -167,6 +231,12 @@ function createNextSourceTransformCacheInput(input, filename, producer) {
|
|
|
167
231
|
globalVarAliases: normalizeGlobalVarAliasesForCache(
|
|
168
232
|
input.compilerOptions?.globalVarAliases
|
|
169
233
|
),
|
|
234
|
+
// The registry slice this file was compiled against is part of its
|
|
235
|
+
// identity. Without it an edited provider serves its importers the
|
|
236
|
+
// cached output built from the value it used to have — the one failure
|
|
237
|
+
// this lane refused to risk before it resolved anything at all.
|
|
238
|
+
crossModuleStatics: input.compilerOptions?.crossModuleStatics === void 0 ? void 0 : JSON.stringify(input.compilerOptions.crossModuleStatics),
|
|
239
|
+
crossModuleSzObjects: input.compilerOptions?.crossModuleSzObjects === void 0 ? void 0 : JSON.stringify(input.compilerOptions.crossModuleSzObjects),
|
|
170
240
|
filename,
|
|
171
241
|
source: input.source
|
|
172
242
|
};
|
|
@@ -275,4 +345,4 @@ function collectTransformClasses(result, discoveredClasses) {
|
|
|
275
345
|
}
|
|
276
346
|
}
|
|
277
347
|
|
|
278
|
-
export {
|
|
348
|
+
export { resolveNextCrossModule as a, collectNextTransformMetadata as b, configWithImportedStaticSz as c, createNextSafelistShardFromMetadata as d, normalizeProviderPaths as n, readPackageVersion as r, transformNextSource as t, withCrossModuleStatics as w };
|
|
@@ -65,7 +65,7 @@ interface GlobalVarScanCacheKeyInput {
|
|
|
65
65
|
/** Source file mtime in milliseconds. */
|
|
66
66
|
mtimeMs: number;
|
|
67
67
|
}
|
|
68
|
-
/** CSS source supplied to the
|
|
68
|
+
/** CSS source supplied to the global-variable validation orchestrator. */
|
|
69
69
|
interface GlobalVarCssSource {
|
|
70
70
|
/** Source file path. */
|
|
71
71
|
filePath: string;
|
|
@@ -74,7 +74,7 @@ interface GlobalVarCssSource {
|
|
|
74
74
|
/** Source file mtime in milliseconds, used when cacheDir is set. */
|
|
75
75
|
mtimeMs?: number;
|
|
76
76
|
}
|
|
77
|
-
/** JS/TS/JSX/TSX source supplied to the
|
|
77
|
+
/** JS/TS/JSX/TSX source supplied to the global-variable validation orchestrator. */
|
|
78
78
|
interface GlobalVarCodeSource {
|
|
79
79
|
/** Source file path. */
|
|
80
80
|
filePath: string;
|
|
@@ -101,7 +101,7 @@ type GlobalVarAliasDiagnosticSeverity = 'error';
|
|
|
101
101
|
interface GlobalVarAliasDiagnostic {
|
|
102
102
|
/** Machine-readable diagnostic code. */
|
|
103
103
|
code: 'missing-definition' | 'tailwind-reserved' | 'tailwind-owned' | 'registered-property' | 'alias-collision';
|
|
104
|
-
/** Diagnostic severity.
|
|
104
|
+
/** Diagnostic severity. Every finding fails the build. */
|
|
105
105
|
severity: GlobalVarAliasDiagnosticSeverity;
|
|
106
106
|
/** Related custom-property name. */
|
|
107
107
|
name: string;
|
|
@@ -141,7 +141,7 @@ interface GlobalVarAliasPlan {
|
|
|
141
141
|
/** Planner diagnostics. */
|
|
142
142
|
diagnostics: GlobalVarAliasDiagnostic[];
|
|
143
143
|
}
|
|
144
|
-
/** Input for
|
|
144
|
+
/** Input for the global-variable scanner/planner/diagnostics integration. */
|
|
145
145
|
interface ValidateGlobalVarAliasInputsOptions {
|
|
146
146
|
/** CSS sources that define or reference custom properties. */
|
|
147
147
|
cssFiles: GlobalVarCssSource[];
|
|
@@ -177,7 +177,7 @@ interface CreateGlobalVarAliasValidationOptionsInput {
|
|
|
177
177
|
/** Optional global-var scan cache directory. */
|
|
178
178
|
cacheDir?: string;
|
|
179
179
|
}
|
|
180
|
-
/** Output from
|
|
180
|
+
/** Output from the global-variable scanner/planner/diagnostics integration. */
|
|
181
181
|
interface GlobalVarAliasValidationResult {
|
|
182
182
|
/** CSS scan results. */
|
|
183
183
|
scans: CssVarScanResult[];
|
|
@@ -405,12 +405,21 @@ interface PluginState {
|
|
|
405
405
|
* Drives the `@source` safelist; NOT the mangle map.
|
|
406
406
|
*/
|
|
407
407
|
classes: Set<string>;
|
|
408
|
-
/**
|
|
408
|
+
/**
|
|
409
|
+
* Merged @theme scan result — the ONLY consumer is the theme-groups virtual
|
|
410
|
+
* module, so this is a merge-correctness input, not a typing one.
|
|
411
|
+
*/
|
|
409
412
|
parsedTheme: ParsedTheme | null;
|
|
410
413
|
/**
|
|
411
|
-
*
|
|
412
|
-
*
|
|
413
|
-
*
|
|
414
|
+
* Tokens from the files `build.scanCss` lists, kept apart from the
|
|
415
|
+
* project-wide discovery so a token deleted from either source disappears
|
|
416
|
+
* from the merged result instead of lingering across a re-scan.
|
|
417
|
+
*/
|
|
418
|
+
scanCssTheme: ParsedTheme | null;
|
|
419
|
+
/**
|
|
420
|
+
* CSS files the project-wide @theme scan found tokens in. Dev HMR re-scans
|
|
421
|
+
* when one of these — or any other .css file — changes, mirroring the
|
|
422
|
+
* explicit scanCss reload path.
|
|
414
423
|
*/
|
|
415
424
|
autoThemeCssFiles: string[];
|
|
416
425
|
/**
|
|
@@ -450,11 +459,21 @@ interface PluginState {
|
|
|
450
459
|
/** Unresolvable-spread warnings surfaced to the build log in every mode. */
|
|
451
460
|
spreadWarnings: Set<string>;
|
|
452
461
|
/**
|
|
453
|
-
* Workspace-package files under `/packages/` that
|
|
462
|
+
* Workspace-package files under `/packages/` that use csszyx but were
|
|
454
463
|
* skipped by the hard-ignore (not under any `compileSources` dir). Surfaced at
|
|
455
464
|
* build end so the silent no-op (skipped `sz` → no CSS) becomes visible.
|
|
456
465
|
*/
|
|
457
466
|
skippedSzFiles: Set<string>;
|
|
467
|
+
/**
|
|
468
|
+
* The subset of {@link skippedSzFiles} that may export szv factories.
|
|
469
|
+
*
|
|
470
|
+
* Skipping one of these does more than lose a file's own CSS: it keeps the
|
|
471
|
+
* module out of the cross-module registry, so every importer — compiled or
|
|
472
|
+
* not — silently falls back to the runtime path. That is dropped csszyx
|
|
473
|
+
* output rather than a usage nudge, so its presence promotes the warning
|
|
474
|
+
* out of dev-only.
|
|
475
|
+
*/
|
|
476
|
+
skippedSzvExportFiles: Set<string>;
|
|
458
477
|
/** Guards the skipped-sz-files warning so it fires at most once. */
|
|
459
478
|
skipWarningEmitted: boolean;
|
|
460
479
|
/**
|
|
@@ -648,34 +667,58 @@ declare function shouldWarnUnscopedMonorepo(sawTailwindEntry: boolean, tailwindE
|
|
|
648
667
|
*/
|
|
649
668
|
declare function unscopedMonorepoMessage(): string;
|
|
650
669
|
/**
|
|
651
|
-
*
|
|
652
|
-
*
|
|
653
|
-
*
|
|
654
|
-
*
|
|
670
|
+
* The `quiet` option, normalized.
|
|
671
|
+
*
|
|
672
|
+
* `'all'` is the blunt setting a plain `true` selects; `'nudges'` keeps every
|
|
673
|
+
* report that the build produced less output than it was asked for.
|
|
674
|
+
*/
|
|
675
|
+
type QuietMode = 'off' | 'nudges' | 'all';
|
|
676
|
+
/**
|
|
677
|
+
* Normalize the authored `quiet` value. Idempotent, so a already-normalized
|
|
678
|
+
* mode passes through unchanged.
|
|
655
679
|
*
|
|
656
|
-
* @param quiet -
|
|
657
|
-
* @
|
|
680
|
+
* @param quiet - Authored option value, or an already-resolved mode.
|
|
681
|
+
* @returns The mode the gates read.
|
|
682
|
+
*/
|
|
683
|
+
declare function resolveQuietMode(quiet: boolean | 'nudges' | QuietMode | undefined): QuietMode;
|
|
684
|
+
/**
|
|
685
|
+
* Whether a csszyx build warning should be emitted.
|
|
686
|
+
*
|
|
687
|
+
* `devOnly` is already this plugin's marker for "usage nudge": it suppresses
|
|
688
|
+
* the warning in a production build so it cannot noise a host app's output.
|
|
689
|
+
* `'nudges'` mutes exactly that same set, which keeps one axis instead of
|
|
690
|
+
* inventing a second classification for the same distinction. `true` mutes
|
|
691
|
+
* everything. Pure so the gating policy is unit-tested without the
|
|
692
|
+
* worker-based buildEnd wiring.
|
|
693
|
+
*
|
|
694
|
+
* @param quiet - Resolved quiet mode.
|
|
695
|
+
* @param devOnly - This warning is a usage nudge.
|
|
658
696
|
* @param isProduction - Whether this is a production build.
|
|
659
697
|
* @returns true when the warning should be printed.
|
|
660
698
|
*/
|
|
661
|
-
declare function shouldEmitWarning(quiet:
|
|
699
|
+
declare function shouldEmitWarning(quiet: QuietMode, devOnly: boolean, isProduction: boolean): boolean;
|
|
662
700
|
/**
|
|
663
701
|
* Whether a transform diagnostic describes missing CSS and may be printed.
|
|
664
702
|
*
|
|
665
|
-
*
|
|
703
|
+
* Only the blunt mode hides these. A missing-CSS diagnostic says classes never
|
|
704
|
+
* reached the safelist, so the styles are absent from the output — a build
|
|
705
|
+
* result, not a style opinion, and `'nudges'` exists so a calmer log does not
|
|
706
|
+
* have to cost it.
|
|
707
|
+
*
|
|
708
|
+
* @param quiet - Resolved quiet mode.
|
|
666
709
|
* @param message - Compiler diagnostic to classify.
|
|
667
710
|
* @returns True when the diagnostic is an unsilenced missing-CSS failure.
|
|
668
711
|
*/
|
|
669
|
-
declare function shouldEmitMissingCssFallback(quiet:
|
|
712
|
+
declare function shouldEmitMissingCssFallback(quiet: QuietMode, message: string): boolean;
|
|
670
713
|
/**
|
|
671
714
|
* Emit one missing-CSS fallback through the caller's output channel.
|
|
672
715
|
*
|
|
673
|
-
* @param quiet -
|
|
716
|
+
* @param quiet - Resolved quiet mode.
|
|
674
717
|
* @param message - Compiler diagnostic to classify and emit.
|
|
675
718
|
* @param id - Bundler module identifier included in the warning.
|
|
676
719
|
* @param emit - Warning output channel.
|
|
677
720
|
*/
|
|
678
|
-
declare function emitMissingCssFallback(quiet:
|
|
721
|
+
declare function emitMissingCssFallback(quiet: QuietMode, message: string, id: string, emit: (message: string) => void): void;
|
|
679
722
|
/**
|
|
680
723
|
* Resolve `compileSources` entries to absolute, realpath-resolved directories.
|
|
681
724
|
* Each entry resolves like a Vite config path: relative to the project `root`
|
|
@@ -770,14 +813,16 @@ declare function allocateMangleTokens(eligibleClasses: readonly string[], forbid
|
|
|
770
813
|
*/
|
|
771
814
|
declare function isPackagesSkippedSource(id: string, sourceDirs?: readonly string[]): boolean;
|
|
772
815
|
/**
|
|
773
|
-
* Build the workspace-package skip warning. Lists the skipped files that
|
|
774
|
-
*
|
|
816
|
+
* Build the workspace-package skip warning. Lists the skipped files that use
|
|
817
|
+
* csszyx so the developer can add the package directory to `compileSources`
|
|
775
818
|
* instead of silently shipping no CSS for them.
|
|
776
819
|
*
|
|
777
|
-
* @param files - skipped `/packages/` file paths that
|
|
820
|
+
* @param files - skipped `/packages/` file paths that use csszyx.
|
|
821
|
+
* @param szvExportFiles - the subset that may export `szv` factories, whose
|
|
822
|
+
* skip also costs every importer its cross-module precompile.
|
|
778
823
|
* @returns the warning string.
|
|
779
824
|
*/
|
|
780
|
-
declare function skippedSzFilesMessage(files: readonly string[]): string;
|
|
825
|
+
declare function skippedSzFilesMessage(files: readonly string[], szvExportFiles?: readonly string[]): string;
|
|
781
826
|
/**
|
|
782
827
|
* Computes the `@source` target path for a CSS module: the location of the
|
|
783
828
|
* generated safelist file relative to the CSS file, in posix form and always
|
|
@@ -807,8 +852,8 @@ declare function shouldTrackGlobalVarSources(config?: {
|
|
|
807
852
|
enabled?: boolean;
|
|
808
853
|
}): boolean;
|
|
809
854
|
/**
|
|
810
|
-
* Records source text available before bundling/minification for
|
|
811
|
-
*
|
|
855
|
+
* Records source text available before bundling/minification for global-var
|
|
856
|
+
* diagnostics.
|
|
812
857
|
*
|
|
813
858
|
* @param state Plugin state to update.
|
|
814
859
|
* @param filename Source filename that owns the text.
|
|
@@ -816,7 +861,7 @@ declare function shouldTrackGlobalVarSources(config?: {
|
|
|
816
861
|
*/
|
|
817
862
|
declare function recordGlobalVarSourceFile(state: Pick<PluginState, 'globalVarSourceFilesByFile'>, filename: string, code: string | null): void;
|
|
818
863
|
/**
|
|
819
|
-
* Extracts
|
|
864
|
+
* Extracts global custom-property aliases for manifest/debug tooling.
|
|
820
865
|
*
|
|
821
866
|
* The legacy `varMangleMap` also carries dynamic s/c-tier CSS variables. This
|
|
822
867
|
* helper keeps manifest consumers from guessing tiers by exposing only aliases
|
|
@@ -886,5 +931,5 @@ declare const rollupPlugin: (options?: PartialCsszyxConfig) => InputPluginOption
|
|
|
886
931
|
*/
|
|
887
932
|
declare const esbuildPlugin: (options?: PartialCsszyxConfig) => Plugin;
|
|
888
933
|
|
|
889
|
-
export {
|
|
890
|
-
export type { CssVarScanResult as C, GlobalVarScanCacheKeyInput as G, MangleHybridHazards as M, PlanGlobalVarAliasesInput as P, RewriteGlobalVarCssAliasesOptions as R, ScanGlobalVarCssOptions as S, ValidateGlobalVarAliasInputsOptions as V, GlobalVarAliasPlan as a, GlobalVarCssAliasRewriteResult as b, CreateGlobalVarAliasValidationOptionsInput as c, GlobalVarAliasValidationResult as d, CssVarDefinition as e, CssVarLocation as f, CssVarReference as g, GlobalVarAliasDiagnostic as h, GlobalVarAliasDiagnosticSeverity as i, GlobalVarAliasEntry as j, GlobalVarCodeSource as k, GlobalVarCssAssetSource as l, GlobalVarCssSource as m, GlobalVarScanCacheEntry as n, ParsedTheme as o, RSCBoundaryViolation as p, RSCModuleRecord as q };
|
|
934
|
+
export { mangleCodeClassesSync as $, cssImportsTailwind as A, unplugin as B, deleteRSCModuleRecord as D, emitMissingCssFallback as E, esbuildPlugin as F, extractGlobalVarAliasesForManifest as H, fileMayContainSafelistableSz as I, findLocalImportSources as J, findRSCBoundaryViolation as K, findRSCGraphViolation as L, hasInjectableTailwindCandidate as N, hasTokens as O, hasUseClientDirective as T, hasUseServerDirective as U, isCompileSourceOptedIn as W, isHardIgnoredPath as X, isMonorepoPackage as Y, isPackagesSkippedSource as Z, isRSCServerModule as _, mangleEligibleClasses as a0, mangleHybridHazardMessage as a1, mergeThemes as a2, missingTailwindEntryMessage as a3, normalizeGlobalVarAliasesForCache as a4, parseThemeBlocks as a5, recordGlobalVarSourceFile as a6, resolveCompileSourceDirs as a7, resolveNativeCacheIdentity as a8, resolveQuietMode as a9, rollupPlugin as aa, scanCustomPropertyNames as ab, shouldEmitMissingCssFallback as ac, shouldEmitWarning as ad, shouldTrackGlobalVarSources as ae, shouldWarnMissingTailwindEntry as af, shouldWarnUnscopedMonorepo as ag, skippedSzFilesMessage as ah, unscopedMonorepoMessage as ai, vitePlugin as aj, webpackPlugin as ak, allocateMangleTokens as r, appendTailwindSourceDirective as s, assertNoRSCBoundaryViolation as t, assertNoRSCGraphViolation as u, collectMangleHybridHazards as v, computeSafelistRelPath as w, createGlobalVarMapAssetSource as x, createRSCModuleRecord as y, cssHasContentScope as z };
|
|
935
|
+
export type { CssVarScanResult as C, GlobalVarScanCacheKeyInput as G, MangleHybridHazards as M, PlanGlobalVarAliasesInput as P, QuietMode as Q, RewriteGlobalVarCssAliasesOptions as R, ScanGlobalVarCssOptions as S, ValidateGlobalVarAliasInputsOptions as V, GlobalVarAliasPlan as a, GlobalVarCssAliasRewriteResult as b, CreateGlobalVarAliasValidationOptionsInput as c, GlobalVarAliasValidationResult as d, CssVarDefinition as e, CssVarLocation as f, CssVarReference as g, GlobalVarAliasDiagnostic as h, GlobalVarAliasDiagnosticSeverity as i, GlobalVarAliasEntry as j, GlobalVarCodeSource as k, GlobalVarCssAssetSource as l, GlobalVarCssSource as m, GlobalVarScanCacheEntry as n, ParsedTheme as o, RSCBoundaryViolation as p, RSCModuleRecord as q };
|