tailwindcss-patch 9.4.2 → 9.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -0
- package/dist/{cli-DsXcyl2O.js → cli-BztQHMRp.js} +5 -6
- package/dist/{cli-D5D3Yj69.mjs → cli-D0jXMGXf.mjs} +1 -1
- package/dist/cli.js +3 -4
- package/dist/cli.mjs +2 -2
- package/dist/commands/cli-runtime.d.mts +1 -1
- package/dist/commands/cli-runtime.d.ts +1 -1
- package/dist/commands/cli-runtime.js +2 -2
- package/dist/commands/cli-runtime.mjs +2 -2
- package/dist/{dist-B1VBpHtd.js → dist-DDcbvOwe.js} +2 -2
- package/dist/index.d.mts +100 -2
- package/dist/index.d.ts +100 -2
- package/dist/index.js +259 -4
- package/dist/index.mjs +250 -2
- package/dist/{validate-CInDiiYy.mjs → validate-Bug_WYcU.mjs} +3 -3
- package/dist/{validate-CYB-90BG.d.ts → validate-BuqRodYI.d.ts} +58 -26
- package/dist/{validate-5eUbRAzl.js → validate-DbuKewV-.js} +38 -11
- package/dist/{validate-D6MO6lZo.d.mts → validate-oAkURzUC.d.mts} +58 -25
- package/package.json +9 -9
- package/src/public-api.ts +36 -2
- package/src/style-candidates.ts +35 -0
- package/src/style-generator.ts +80 -0
- package/src/v3/index.ts +11 -0
- package/src/v3/style-generator.ts +384 -0
- package/src/v4/index.ts +13 -6
- package/src/v4/style-generator.ts +44 -0
- package/src/v4/types.ts +23 -0
- package/dist/chunk-8l464Juk.js +0 -28
- /package/dist/{dist-BjUV1yEM.mjs → dist-CxmNpfyy.mjs} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const require_validate = require("./validate-5eUbRAzl.js");
|
|
2
|
+
const require_validate = require("./validate-DbuKewV-.js");
|
|
4
3
|
let node_module = require("node:module");
|
|
5
4
|
let node_process = require("node:process");
|
|
6
|
-
node_process =
|
|
5
|
+
node_process = require_validate.__toESM(node_process);
|
|
7
6
|
let pathe = require("pathe");
|
|
8
|
-
pathe =
|
|
7
|
+
pathe = require_validate.__toESM(pathe);
|
|
9
8
|
let node_fs = require("node:fs");
|
|
9
|
+
let postcss = require("postcss");
|
|
10
|
+
postcss = require_validate.__toESM(postcss);
|
|
10
11
|
//#region src/extraction/split-candidate-tokens.ts
|
|
11
12
|
const validateCandidateTokenRE = /[\w\u00A0-\uFFFF%-?]/;
|
|
12
13
|
function isValidCandidateToken(token = "") {
|
|
@@ -66,6 +67,196 @@ function splitCandidateTokens(code) {
|
|
|
66
67
|
return result;
|
|
67
68
|
}
|
|
68
69
|
//#endregion
|
|
70
|
+
//#region src/style-candidates.ts
|
|
71
|
+
async function collectTailwindStyleCandidates(options = {}) {
|
|
72
|
+
const candidates = /* @__PURE__ */ new Set();
|
|
73
|
+
for (const candidate of options.candidates ?? []) candidates.add(candidate);
|
|
74
|
+
for (const source of options.sources ?? []) {
|
|
75
|
+
const sourceCandidates = await require_validate.extractSourceCandidates(source.content, source.extension, { bareArbitraryValues: options.bareArbitraryValues });
|
|
76
|
+
for (const candidate of sourceCandidates) candidates.add(candidate);
|
|
77
|
+
}
|
|
78
|
+
return candidates;
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/v3/style-generator.ts
|
|
82
|
+
function createPackageRequire(cwd) {
|
|
83
|
+
return (0, node_module.createRequire)(pathe.default.join(pathe.default.resolve(cwd ?? node_process.default.cwd()), "package.json"));
|
|
84
|
+
}
|
|
85
|
+
function createDefaultTailwindV3Config(tokens) {
|
|
86
|
+
return {
|
|
87
|
+
content: [{
|
|
88
|
+
raw: [...tokens].join(" "),
|
|
89
|
+
extension: "html"
|
|
90
|
+
}],
|
|
91
|
+
theme: { extend: {} },
|
|
92
|
+
plugins: []
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function getDefaultExport(module) {
|
|
96
|
+
if (module && typeof module === "object" && "default" in module) return module.default;
|
|
97
|
+
return module;
|
|
98
|
+
}
|
|
99
|
+
function loadTailwindV3Modules(options) {
|
|
100
|
+
const packageName = options.packageName ?? "tailwindcss";
|
|
101
|
+
const moduleRequire = createPackageRequire(options.cwd);
|
|
102
|
+
const resolveConfig = getDefaultExport(moduleRequire(`${packageName}/lib/public/resolve-config`));
|
|
103
|
+
const contextModule = moduleRequire(`${packageName}/lib/lib/setupContextUtils`);
|
|
104
|
+
const generateRulesModule = moduleRequire(`${packageName}/lib/lib/generateRules`);
|
|
105
|
+
const collapseAdjacentRulesModule = moduleRequire(`${packageName}/lib/lib/collapseAdjacentRules`);
|
|
106
|
+
const collapseDuplicateDeclarationsModule = moduleRequire(`${packageName}/lib/lib/collapseDuplicateDeclarations`);
|
|
107
|
+
const processTailwindFeaturesModule = moduleRequire(`${packageName}/lib/processTailwindFeatures`);
|
|
108
|
+
const resolveDefaultsAtRulesModule = moduleRequire(`${packageName}/lib/lib/resolveDefaultsAtRules`);
|
|
109
|
+
const sharedStateModule = moduleRequire(`${packageName}/lib/lib/sharedState`);
|
|
110
|
+
const validateConfigModule = moduleRequire(`${packageName}/lib/util/validateConfig.js`);
|
|
111
|
+
return {
|
|
112
|
+
collapseAdjacentRules: getDefaultExport(collapseAdjacentRulesModule),
|
|
113
|
+
collapseDuplicateDeclarations: getDefaultExport(collapseDuplicateDeclarationsModule),
|
|
114
|
+
createContext: contextModule.createContext,
|
|
115
|
+
generateRules: generateRulesModule.generateRules,
|
|
116
|
+
notOnDemandCandidate: sharedStateModule.NOT_ON_DEMAND ?? "*",
|
|
117
|
+
processTailwindFeatures: getDefaultExport(processTailwindFeaturesModule),
|
|
118
|
+
resolveDefaultsAtRules: getDefaultExport(resolveDefaultsAtRulesModule),
|
|
119
|
+
resolveConfig,
|
|
120
|
+
validateConfig: validateConfigModule.validateConfig
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function createRawContentEntries(candidates, sources) {
|
|
124
|
+
const entries = [];
|
|
125
|
+
const candidateContent = [...candidates].join(" ");
|
|
126
|
+
if (candidateContent.length > 0) entries.push({
|
|
127
|
+
raw: candidateContent,
|
|
128
|
+
extension: "html"
|
|
129
|
+
});
|
|
130
|
+
for (const source of sources) entries.push({
|
|
131
|
+
raw: source.content,
|
|
132
|
+
extension: source.extension ?? "html"
|
|
133
|
+
});
|
|
134
|
+
return entries;
|
|
135
|
+
}
|
|
136
|
+
function createChangedContentEntries(candidates, sources) {
|
|
137
|
+
return createRawContentEntries(candidates, sources).map((entry) => ({
|
|
138
|
+
content: entry.raw,
|
|
139
|
+
extension: entry.extension
|
|
140
|
+
}));
|
|
141
|
+
}
|
|
142
|
+
function createTailwindConfigWithContent(config, tokens, sources) {
|
|
143
|
+
const userContent = config?.content;
|
|
144
|
+
return {
|
|
145
|
+
...createDefaultTailwindV3Config(tokens),
|
|
146
|
+
...config ?? {},
|
|
147
|
+
content: [...Array.isArray(userContent) ? userContent : [], ...createRawContentEntries(tokens, sources)]
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
function isDirectUtilitiesOnlyCss(css) {
|
|
151
|
+
return css.replace(/\s+/g, "") === "@tailwindutilities;";
|
|
152
|
+
}
|
|
153
|
+
function sortCandidates(candidates) {
|
|
154
|
+
return [...candidates].sort((a, z) => {
|
|
155
|
+
if (a === z) return 0;
|
|
156
|
+
return a < z ? -1 : 1;
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
function appendUtilityRules(root, context, rules) {
|
|
160
|
+
const sortedRules = context.offsets.sort(rules);
|
|
161
|
+
for (const [sort, rule] of sortedRules) {
|
|
162
|
+
const tailwindRaw = rule.raws.tailwind;
|
|
163
|
+
if (sort.layer === "utilities" || sort.layer === "variants" && tailwindRaw?.parentLayer === "utilities") root.append(rule.clone());
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function collectClassSet(context, notOnDemandCandidate) {
|
|
167
|
+
const classSet = /* @__PURE__ */ new Set();
|
|
168
|
+
for (const candidate of context.classCache.keys()) if (String(candidate) !== String(notOnDemandCandidate)) classSet.add(candidate);
|
|
169
|
+
return classSet;
|
|
170
|
+
}
|
|
171
|
+
function collectDependencyMessages(result) {
|
|
172
|
+
const dependencies = /* @__PURE__ */ new Set();
|
|
173
|
+
for (const message of result.messages) {
|
|
174
|
+
const file = message.file;
|
|
175
|
+
if (message.type === "dependency" && typeof file === "string") dependencies.add(file);
|
|
176
|
+
}
|
|
177
|
+
return [...dependencies];
|
|
178
|
+
}
|
|
179
|
+
function buildStylesheetNodes(rules, context, layers) {
|
|
180
|
+
const sortedRules = context.offsets.sort(rules);
|
|
181
|
+
const nodes = [];
|
|
182
|
+
const layerSet = new Set(layers);
|
|
183
|
+
for (const [sort, rule] of sortedRules) {
|
|
184
|
+
const layer = sort.layer === "defaults" ? "base" : sort.layer;
|
|
185
|
+
if (layerSet.has(layer)) nodes.push(rule.clone());
|
|
186
|
+
}
|
|
187
|
+
return nodes;
|
|
188
|
+
}
|
|
189
|
+
function createRootFromNodes(nodes) {
|
|
190
|
+
const root = postcss.default.root();
|
|
191
|
+
for (const node of nodes) root.append(node);
|
|
192
|
+
return root;
|
|
193
|
+
}
|
|
194
|
+
async function generateTailwindV3Style(options = {}) {
|
|
195
|
+
const tokens = await collectTailwindStyleCandidates(options);
|
|
196
|
+
const { createContext, generateRules, resolveConfig } = loadTailwindV3Modules(options);
|
|
197
|
+
const userContent = options.config?.content;
|
|
198
|
+
const config = resolveConfig({
|
|
199
|
+
...createDefaultTailwindV3Config(tokens),
|
|
200
|
+
...options.config ?? {},
|
|
201
|
+
content: [...Array.isArray(userContent) ? userContent : [], {
|
|
202
|
+
raw: [...tokens].join(" "),
|
|
203
|
+
extension: "html"
|
|
204
|
+
}]
|
|
205
|
+
});
|
|
206
|
+
const context = createContext(config, [], postcss.default.root());
|
|
207
|
+
return {
|
|
208
|
+
version: 3,
|
|
209
|
+
css: createRootFromNodes(buildStylesheetNodes(generateRules(tokens, context), context, options.layers ?? [
|
|
210
|
+
"base",
|
|
211
|
+
"components",
|
|
212
|
+
"utilities",
|
|
213
|
+
"variants"
|
|
214
|
+
])).toString(),
|
|
215
|
+
tokens,
|
|
216
|
+
classSet: new Set(context.classCache.keys()),
|
|
217
|
+
sources: options.sources ?? [],
|
|
218
|
+
config
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
async function generateTailwindV3RawStyle(options = {}) {
|
|
222
|
+
const tokens = await collectTailwindStyleCandidates(options);
|
|
223
|
+
const { collapseAdjacentRules, collapseDuplicateDeclarations, createContext, generateRules, notOnDemandCandidate, processTailwindFeatures, resolveConfig, resolveDefaultsAtRules, validateConfig } = loadTailwindV3Modules(options);
|
|
224
|
+
const css = options.css ?? "@tailwind utilities;";
|
|
225
|
+
const config = validateConfig(resolveConfig(createTailwindConfigWithContent(options.config, tokens, options.sources ?? [])));
|
|
226
|
+
const root = postcss.default.parse(css, { from: void 0 });
|
|
227
|
+
const result = {
|
|
228
|
+
css: "",
|
|
229
|
+
messages: []
|
|
230
|
+
};
|
|
231
|
+
const changedContent = createChangedContentEntries(tokens, options.sources ?? []);
|
|
232
|
+
const shouldUseDirectUtilities = options.directUtilitiesOnly === true || options.directUtilitiesOnly !== false && isDirectUtilitiesOnlyCss(css);
|
|
233
|
+
let context;
|
|
234
|
+
if (shouldUseDirectUtilities) {
|
|
235
|
+
context = createContext(config, changedContent, root);
|
|
236
|
+
generateRules(new Set(sortCandidates([notOnDemandCandidate, ...tokens])), context);
|
|
237
|
+
root.removeAll();
|
|
238
|
+
appendUtilityRules(root, context, [...context.ruleCache]);
|
|
239
|
+
resolveDefaultsAtRules(context)(root, result);
|
|
240
|
+
collapseAdjacentRules(context)(root, result);
|
|
241
|
+
collapseDuplicateDeclarations(context)(root, result);
|
|
242
|
+
} else {
|
|
243
|
+
const setupContext = () => {
|
|
244
|
+
return (currentRoot) => createContext(config, changedContent, currentRoot);
|
|
245
|
+
};
|
|
246
|
+
context = await processTailwindFeatures(setupContext)(root, result);
|
|
247
|
+
}
|
|
248
|
+
return {
|
|
249
|
+
version: 3,
|
|
250
|
+
css: root.toString(),
|
|
251
|
+
tokens,
|
|
252
|
+
classSet: collectClassSet(context, notOnDemandCandidate),
|
|
253
|
+
context,
|
|
254
|
+
dependencies: collectDependencyMessages(result),
|
|
255
|
+
sources: options.sources ?? [],
|
|
256
|
+
config
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
//#endregion
|
|
69
260
|
//#region src/v4/engine.ts
|
|
70
261
|
function resolveScanSources(options, source, compiledRoot, compiledSources) {
|
|
71
262
|
if (Array.isArray(options?.scanSources)) return options.scanSources;
|
|
@@ -267,6 +458,63 @@ async function resolveTailwindV4SourceFromPatchOptions(options) {
|
|
|
267
458
|
return resolveTailwindV4Source(tailwindV4SourceOptionsFromPatchOptions(options));
|
|
268
459
|
}
|
|
269
460
|
//#endregion
|
|
461
|
+
//#region src/v4/style-generator.ts
|
|
462
|
+
function createSourceOptions(options) {
|
|
463
|
+
return {
|
|
464
|
+
...options.projectRoot === void 0 ? {} : { projectRoot: options.projectRoot },
|
|
465
|
+
...options.cwd === void 0 ? {} : { cwd: options.cwd },
|
|
466
|
+
...options.base === void 0 ? {} : { base: options.base },
|
|
467
|
+
...options.baseFallbacks === void 0 ? {} : { baseFallbacks: options.baseFallbacks },
|
|
468
|
+
...options.css === void 0 ? {} : { css: options.css },
|
|
469
|
+
...options.cssSources === void 0 ? {} : { cssSources: options.cssSources },
|
|
470
|
+
...options.cssEntries === void 0 ? {} : { cssEntries: options.cssEntries },
|
|
471
|
+
...options.packageName === void 0 ? {} : { packageName: options.packageName }
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
async function collectTailwindV4StyleCandidates(options) {
|
|
475
|
+
return collectTailwindStyleCandidates(options);
|
|
476
|
+
}
|
|
477
|
+
async function generateTailwindV4Style(options = {}) {
|
|
478
|
+
const source = options.source ?? await resolveTailwindV4Source(createSourceOptions(options));
|
|
479
|
+
const candidates = await collectTailwindV4StyleCandidates(options);
|
|
480
|
+
const result = await createTailwindV4Engine(source).generate({
|
|
481
|
+
candidates,
|
|
482
|
+
...options.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: options.bareArbitraryValues },
|
|
483
|
+
...options.scanSources === void 0 ? {} : { scanSources: options.scanSources }
|
|
484
|
+
});
|
|
485
|
+
return {
|
|
486
|
+
...result,
|
|
487
|
+
tokens: result.rawCandidates,
|
|
488
|
+
source
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
//#endregion
|
|
492
|
+
//#region src/style-generator.ts
|
|
493
|
+
async function generateCustomStyle(options) {
|
|
494
|
+
const tokens = await collectTailwindStyleCandidates(options);
|
|
495
|
+
const classSet = new Set(tokens);
|
|
496
|
+
const sources = options.sources ?? [];
|
|
497
|
+
return {
|
|
498
|
+
version: "custom",
|
|
499
|
+
css: await options.generate({
|
|
500
|
+
tokens,
|
|
501
|
+
classSet,
|
|
502
|
+
sources
|
|
503
|
+
}),
|
|
504
|
+
tokens,
|
|
505
|
+
classSet,
|
|
506
|
+
sources
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
async function generateTailwindStyle(options) {
|
|
510
|
+
if (options.version === 3) return generateTailwindV3Style(options);
|
|
511
|
+
if (options.version === 4) return {
|
|
512
|
+
...await generateTailwindV4Style(options),
|
|
513
|
+
version: 4
|
|
514
|
+
};
|
|
515
|
+
return generateCustomStyle(options);
|
|
516
|
+
}
|
|
517
|
+
//#endregion
|
|
270
518
|
//#region src/public-api.ts
|
|
271
519
|
function defineConfig(config) {
|
|
272
520
|
return config;
|
|
@@ -298,6 +546,8 @@ exports.ValidateCommandError = require_validate.ValidateCommandError;
|
|
|
298
546
|
exports.canonicalizeBareArbitraryValueCandidates = require_validate.canonicalizeBareArbitraryValueCandidates;
|
|
299
547
|
exports.collectClassesFromContexts = require_validate.collectClassesFromContexts;
|
|
300
548
|
exports.collectClassesFromTailwindV4 = require_validate.collectClassesFromTailwindV4;
|
|
549
|
+
exports.collectTailwindStyleCandidates = collectTailwindStyleCandidates;
|
|
550
|
+
exports.collectTailwindV4StyleCandidates = collectTailwindV4StyleCandidates;
|
|
301
551
|
exports.createTailwindV4CompiledSourceEntries = require_validate.createTailwindV4CompiledSourceEntries;
|
|
302
552
|
exports.createTailwindV4DefaultIgnoreSources = require_validate.createTailwindV4DefaultIgnoreSources;
|
|
303
553
|
exports.createTailwindV4Engine = createTailwindV4Engine;
|
|
@@ -317,6 +567,11 @@ exports.extractRawCandidatesWithPositions = require_validate.extractRawCandidate
|
|
|
317
567
|
exports.extractSourceCandidates = require_validate.extractSourceCandidates;
|
|
318
568
|
exports.extractSourceCandidatesWithPositions = require_validate.extractSourceCandidatesWithPositions;
|
|
319
569
|
exports.extractValidCandidates = require_validate.extractValidCandidates;
|
|
570
|
+
exports.generateCustomStyle = generateCustomStyle;
|
|
571
|
+
exports.generateTailwindStyle = generateTailwindStyle;
|
|
572
|
+
exports.generateTailwindV3RawStyle = generateTailwindV3RawStyle;
|
|
573
|
+
exports.generateTailwindV3Style = generateTailwindV3Style;
|
|
574
|
+
exports.generateTailwindV4Style = generateTailwindV4Style;
|
|
320
575
|
exports.getPatchStatusReport = require_validate.getPatchStatusReport;
|
|
321
576
|
exports.groupTokensByFile = require_validate.groupTokensByFile;
|
|
322
577
|
exports.isBareArbitraryValuesEnabled = require_validate.isBareArbitraryValuesEnabled;
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { $ as resolveBareArbitraryValueCandidate, A as createTailwindV4RootSources, B as resolveSourceScanPath, C as resolveProjectSourceFiles, D as TAILWIND_V4_IGNORED_FILES, E as TAILWIND_V4_IGNORED_EXTENSIONS, F as isFileExcludedByTailwindV4SourceEntries, G as canonicalizeBareArbitraryValueCandidates, H as resolveTailwindV4SourceEntry, I as isFileMatchedByTailwindV4SourceEntries, J as resolveValidTailwindV4Candidates, K as extractTailwindV4InlineSourceCandidates, L as mergeTailwindV4SourceEntries, M as createTailwindV4SourceExclusionMatcher, N as expandTailwindV4SourceEntries, O as createTailwindV4CompiledSourceEntries, P as expandTailwindV4SourceEntryBraces, Q as isBareArbitraryValuesEnabled, R as normalizeTailwindV4ScannerSources, S as groupTokensByFile, T as TAILWIND_V4_IGNORED_CONTENT_DIRS, U as compileTailwindV4Source, V as resolveTailwindV4SourceBaseCandidates, W as loadTailwindV4DesignSystem, X as extractBareArbitraryValueSourceCandidates, Y as escapeCssClassName, Z as extractBareArbitraryValueSourceCandidatesWithPositions, _ as extractRawCandidates, a as tailwindcssPatchCommands, b as extractSourceCandidatesWithPositions, c as MIGRATION_REPORT_KIND, d as getPatchStatusReport, f as runTailwindBuild, g as extractProjectCandidatesWithPositions, h as collectClassesFromTailwindV4, it as logger, j as createTailwindV4SourceEntryMatcher, k as createTailwindV4DefaultIgnoreSources, l as MIGRATION_REPORT_SCHEMA_VERSION, m as collectClassesFromContexts, n as VALIDATE_FAILURE_REASONS, nt as normalizeOptions, o as migrateConfigFiles, p as loadRuntimeContexts, q as replaceBareArbitraryValueSelectors, r as ValidateCommandError, rt as CacheStore, s as restoreConfigFiles, t as VALIDATE_EXIT_CODES, u as TailwindcssPatcher, v as extractRawCandidatesWithPositions, w as TAILWIND_V4_AUTO_SOURCE_SCAN_PATTERN, x as extractValidCandidates, y as extractSourceCandidates, z as normalizeTailwindV4SourceEntries } from "./validate-
|
|
1
|
+
import { $ as resolveBareArbitraryValueCandidate, A as createTailwindV4RootSources, B as resolveSourceScanPath, C as resolveProjectSourceFiles, D as TAILWIND_V4_IGNORED_FILES, E as TAILWIND_V4_IGNORED_EXTENSIONS, F as isFileExcludedByTailwindV4SourceEntries, G as canonicalizeBareArbitraryValueCandidates, H as resolveTailwindV4SourceEntry, I as isFileMatchedByTailwindV4SourceEntries, J as resolveValidTailwindV4Candidates, K as extractTailwindV4InlineSourceCandidates, L as mergeTailwindV4SourceEntries, M as createTailwindV4SourceExclusionMatcher, N as expandTailwindV4SourceEntries, O as createTailwindV4CompiledSourceEntries, P as expandTailwindV4SourceEntryBraces, Q as isBareArbitraryValuesEnabled, R as normalizeTailwindV4ScannerSources, S as groupTokensByFile, T as TAILWIND_V4_IGNORED_CONTENT_DIRS, U as compileTailwindV4Source, V as resolveTailwindV4SourceBaseCandidates, W as loadTailwindV4DesignSystem, X as extractBareArbitraryValueSourceCandidates, Y as escapeCssClassName, Z as extractBareArbitraryValueSourceCandidatesWithPositions, _ as extractRawCandidates, a as tailwindcssPatchCommands, b as extractSourceCandidatesWithPositions, c as MIGRATION_REPORT_KIND, d as getPatchStatusReport, f as runTailwindBuild, g as extractProjectCandidatesWithPositions, h as collectClassesFromTailwindV4, it as logger, j as createTailwindV4SourceEntryMatcher, k as createTailwindV4DefaultIgnoreSources, l as MIGRATION_REPORT_SCHEMA_VERSION, m as collectClassesFromContexts, n as VALIDATE_FAILURE_REASONS, nt as normalizeOptions, o as migrateConfigFiles, p as loadRuntimeContexts, q as replaceBareArbitraryValueSelectors, r as ValidateCommandError, rt as CacheStore, s as restoreConfigFiles, t as VALIDATE_EXIT_CODES, u as TailwindcssPatcher, v as extractRawCandidatesWithPositions, w as TAILWIND_V4_AUTO_SOURCE_SCAN_PATTERN, x as extractValidCandidates, y as extractSourceCandidates, z as normalizeTailwindV4SourceEntries } from "./validate-Bug_WYcU.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import path from "pathe";
|
|
5
5
|
import { promises } from "node:fs";
|
|
6
|
+
import postcss from "postcss";
|
|
6
7
|
//#region src/extraction/split-candidate-tokens.ts
|
|
7
8
|
const validateCandidateTokenRE = /[\w\u00A0-\uFFFF%-?]/;
|
|
8
9
|
function isValidCandidateToken(token = "") {
|
|
@@ -62,6 +63,196 @@ function splitCandidateTokens(code) {
|
|
|
62
63
|
return result;
|
|
63
64
|
}
|
|
64
65
|
//#endregion
|
|
66
|
+
//#region src/style-candidates.ts
|
|
67
|
+
async function collectTailwindStyleCandidates(options = {}) {
|
|
68
|
+
const candidates = /* @__PURE__ */ new Set();
|
|
69
|
+
for (const candidate of options.candidates ?? []) candidates.add(candidate);
|
|
70
|
+
for (const source of options.sources ?? []) {
|
|
71
|
+
const sourceCandidates = await extractSourceCandidates(source.content, source.extension, { bareArbitraryValues: options.bareArbitraryValues });
|
|
72
|
+
for (const candidate of sourceCandidates) candidates.add(candidate);
|
|
73
|
+
}
|
|
74
|
+
return candidates;
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/v3/style-generator.ts
|
|
78
|
+
function createPackageRequire(cwd) {
|
|
79
|
+
return createRequire(path.join(path.resolve(cwd ?? process.cwd()), "package.json"));
|
|
80
|
+
}
|
|
81
|
+
function createDefaultTailwindV3Config(tokens) {
|
|
82
|
+
return {
|
|
83
|
+
content: [{
|
|
84
|
+
raw: [...tokens].join(" "),
|
|
85
|
+
extension: "html"
|
|
86
|
+
}],
|
|
87
|
+
theme: { extend: {} },
|
|
88
|
+
plugins: []
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function getDefaultExport(module) {
|
|
92
|
+
if (module && typeof module === "object" && "default" in module) return module.default;
|
|
93
|
+
return module;
|
|
94
|
+
}
|
|
95
|
+
function loadTailwindV3Modules(options) {
|
|
96
|
+
const packageName = options.packageName ?? "tailwindcss";
|
|
97
|
+
const moduleRequire = createPackageRequire(options.cwd);
|
|
98
|
+
const resolveConfig = getDefaultExport(moduleRequire(`${packageName}/lib/public/resolve-config`));
|
|
99
|
+
const contextModule = moduleRequire(`${packageName}/lib/lib/setupContextUtils`);
|
|
100
|
+
const generateRulesModule = moduleRequire(`${packageName}/lib/lib/generateRules`);
|
|
101
|
+
const collapseAdjacentRulesModule = moduleRequire(`${packageName}/lib/lib/collapseAdjacentRules`);
|
|
102
|
+
const collapseDuplicateDeclarationsModule = moduleRequire(`${packageName}/lib/lib/collapseDuplicateDeclarations`);
|
|
103
|
+
const processTailwindFeaturesModule = moduleRequire(`${packageName}/lib/processTailwindFeatures`);
|
|
104
|
+
const resolveDefaultsAtRulesModule = moduleRequire(`${packageName}/lib/lib/resolveDefaultsAtRules`);
|
|
105
|
+
const sharedStateModule = moduleRequire(`${packageName}/lib/lib/sharedState`);
|
|
106
|
+
const validateConfigModule = moduleRequire(`${packageName}/lib/util/validateConfig.js`);
|
|
107
|
+
return {
|
|
108
|
+
collapseAdjacentRules: getDefaultExport(collapseAdjacentRulesModule),
|
|
109
|
+
collapseDuplicateDeclarations: getDefaultExport(collapseDuplicateDeclarationsModule),
|
|
110
|
+
createContext: contextModule.createContext,
|
|
111
|
+
generateRules: generateRulesModule.generateRules,
|
|
112
|
+
notOnDemandCandidate: sharedStateModule.NOT_ON_DEMAND ?? "*",
|
|
113
|
+
processTailwindFeatures: getDefaultExport(processTailwindFeaturesModule),
|
|
114
|
+
resolveDefaultsAtRules: getDefaultExport(resolveDefaultsAtRulesModule),
|
|
115
|
+
resolveConfig,
|
|
116
|
+
validateConfig: validateConfigModule.validateConfig
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function createRawContentEntries(candidates, sources) {
|
|
120
|
+
const entries = [];
|
|
121
|
+
const candidateContent = [...candidates].join(" ");
|
|
122
|
+
if (candidateContent.length > 0) entries.push({
|
|
123
|
+
raw: candidateContent,
|
|
124
|
+
extension: "html"
|
|
125
|
+
});
|
|
126
|
+
for (const source of sources) entries.push({
|
|
127
|
+
raw: source.content,
|
|
128
|
+
extension: source.extension ?? "html"
|
|
129
|
+
});
|
|
130
|
+
return entries;
|
|
131
|
+
}
|
|
132
|
+
function createChangedContentEntries(candidates, sources) {
|
|
133
|
+
return createRawContentEntries(candidates, sources).map((entry) => ({
|
|
134
|
+
content: entry.raw,
|
|
135
|
+
extension: entry.extension
|
|
136
|
+
}));
|
|
137
|
+
}
|
|
138
|
+
function createTailwindConfigWithContent(config, tokens, sources) {
|
|
139
|
+
const userContent = config?.content;
|
|
140
|
+
return {
|
|
141
|
+
...createDefaultTailwindV3Config(tokens),
|
|
142
|
+
...config ?? {},
|
|
143
|
+
content: [...Array.isArray(userContent) ? userContent : [], ...createRawContentEntries(tokens, sources)]
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function isDirectUtilitiesOnlyCss(css) {
|
|
147
|
+
return css.replace(/\s+/g, "") === "@tailwindutilities;";
|
|
148
|
+
}
|
|
149
|
+
function sortCandidates(candidates) {
|
|
150
|
+
return [...candidates].sort((a, z) => {
|
|
151
|
+
if (a === z) return 0;
|
|
152
|
+
return a < z ? -1 : 1;
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
function appendUtilityRules(root, context, rules) {
|
|
156
|
+
const sortedRules = context.offsets.sort(rules);
|
|
157
|
+
for (const [sort, rule] of sortedRules) {
|
|
158
|
+
const tailwindRaw = rule.raws.tailwind;
|
|
159
|
+
if (sort.layer === "utilities" || sort.layer === "variants" && tailwindRaw?.parentLayer === "utilities") root.append(rule.clone());
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function collectClassSet(context, notOnDemandCandidate) {
|
|
163
|
+
const classSet = /* @__PURE__ */ new Set();
|
|
164
|
+
for (const candidate of context.classCache.keys()) if (String(candidate) !== String(notOnDemandCandidate)) classSet.add(candidate);
|
|
165
|
+
return classSet;
|
|
166
|
+
}
|
|
167
|
+
function collectDependencyMessages(result) {
|
|
168
|
+
const dependencies = /* @__PURE__ */ new Set();
|
|
169
|
+
for (const message of result.messages) {
|
|
170
|
+
const file = message.file;
|
|
171
|
+
if (message.type === "dependency" && typeof file === "string") dependencies.add(file);
|
|
172
|
+
}
|
|
173
|
+
return [...dependencies];
|
|
174
|
+
}
|
|
175
|
+
function buildStylesheetNodes(rules, context, layers) {
|
|
176
|
+
const sortedRules = context.offsets.sort(rules);
|
|
177
|
+
const nodes = [];
|
|
178
|
+
const layerSet = new Set(layers);
|
|
179
|
+
for (const [sort, rule] of sortedRules) {
|
|
180
|
+
const layer = sort.layer === "defaults" ? "base" : sort.layer;
|
|
181
|
+
if (layerSet.has(layer)) nodes.push(rule.clone());
|
|
182
|
+
}
|
|
183
|
+
return nodes;
|
|
184
|
+
}
|
|
185
|
+
function createRootFromNodes(nodes) {
|
|
186
|
+
const root = postcss.root();
|
|
187
|
+
for (const node of nodes) root.append(node);
|
|
188
|
+
return root;
|
|
189
|
+
}
|
|
190
|
+
async function generateTailwindV3Style(options = {}) {
|
|
191
|
+
const tokens = await collectTailwindStyleCandidates(options);
|
|
192
|
+
const { createContext, generateRules, resolveConfig } = loadTailwindV3Modules(options);
|
|
193
|
+
const userContent = options.config?.content;
|
|
194
|
+
const config = resolveConfig({
|
|
195
|
+
...createDefaultTailwindV3Config(tokens),
|
|
196
|
+
...options.config ?? {},
|
|
197
|
+
content: [...Array.isArray(userContent) ? userContent : [], {
|
|
198
|
+
raw: [...tokens].join(" "),
|
|
199
|
+
extension: "html"
|
|
200
|
+
}]
|
|
201
|
+
});
|
|
202
|
+
const context = createContext(config, [], postcss.root());
|
|
203
|
+
return {
|
|
204
|
+
version: 3,
|
|
205
|
+
css: createRootFromNodes(buildStylesheetNodes(generateRules(tokens, context), context, options.layers ?? [
|
|
206
|
+
"base",
|
|
207
|
+
"components",
|
|
208
|
+
"utilities",
|
|
209
|
+
"variants"
|
|
210
|
+
])).toString(),
|
|
211
|
+
tokens,
|
|
212
|
+
classSet: new Set(context.classCache.keys()),
|
|
213
|
+
sources: options.sources ?? [],
|
|
214
|
+
config
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
async function generateTailwindV3RawStyle(options = {}) {
|
|
218
|
+
const tokens = await collectTailwindStyleCandidates(options);
|
|
219
|
+
const { collapseAdjacentRules, collapseDuplicateDeclarations, createContext, generateRules, notOnDemandCandidate, processTailwindFeatures, resolveConfig, resolveDefaultsAtRules, validateConfig } = loadTailwindV3Modules(options);
|
|
220
|
+
const css = options.css ?? "@tailwind utilities;";
|
|
221
|
+
const config = validateConfig(resolveConfig(createTailwindConfigWithContent(options.config, tokens, options.sources ?? [])));
|
|
222
|
+
const root = postcss.parse(css, { from: void 0 });
|
|
223
|
+
const result = {
|
|
224
|
+
css: "",
|
|
225
|
+
messages: []
|
|
226
|
+
};
|
|
227
|
+
const changedContent = createChangedContentEntries(tokens, options.sources ?? []);
|
|
228
|
+
const shouldUseDirectUtilities = options.directUtilitiesOnly === true || options.directUtilitiesOnly !== false && isDirectUtilitiesOnlyCss(css);
|
|
229
|
+
let context;
|
|
230
|
+
if (shouldUseDirectUtilities) {
|
|
231
|
+
context = createContext(config, changedContent, root);
|
|
232
|
+
generateRules(new Set(sortCandidates([notOnDemandCandidate, ...tokens])), context);
|
|
233
|
+
root.removeAll();
|
|
234
|
+
appendUtilityRules(root, context, [...context.ruleCache]);
|
|
235
|
+
resolveDefaultsAtRules(context)(root, result);
|
|
236
|
+
collapseAdjacentRules(context)(root, result);
|
|
237
|
+
collapseDuplicateDeclarations(context)(root, result);
|
|
238
|
+
} else {
|
|
239
|
+
const setupContext = () => {
|
|
240
|
+
return (currentRoot) => createContext(config, changedContent, currentRoot);
|
|
241
|
+
};
|
|
242
|
+
context = await processTailwindFeatures(setupContext)(root, result);
|
|
243
|
+
}
|
|
244
|
+
return {
|
|
245
|
+
version: 3,
|
|
246
|
+
css: root.toString(),
|
|
247
|
+
tokens,
|
|
248
|
+
classSet: collectClassSet(context, notOnDemandCandidate),
|
|
249
|
+
context,
|
|
250
|
+
dependencies: collectDependencyMessages(result),
|
|
251
|
+
sources: options.sources ?? [],
|
|
252
|
+
config
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
//#endregion
|
|
65
256
|
//#region src/v4/engine.ts
|
|
66
257
|
function resolveScanSources(options, source, compiledRoot, compiledSources) {
|
|
67
258
|
if (Array.isArray(options?.scanSources)) return options.scanSources;
|
|
@@ -263,6 +454,63 @@ async function resolveTailwindV4SourceFromPatchOptions(options) {
|
|
|
263
454
|
return resolveTailwindV4Source(tailwindV4SourceOptionsFromPatchOptions(options));
|
|
264
455
|
}
|
|
265
456
|
//#endregion
|
|
457
|
+
//#region src/v4/style-generator.ts
|
|
458
|
+
function createSourceOptions(options) {
|
|
459
|
+
return {
|
|
460
|
+
...options.projectRoot === void 0 ? {} : { projectRoot: options.projectRoot },
|
|
461
|
+
...options.cwd === void 0 ? {} : { cwd: options.cwd },
|
|
462
|
+
...options.base === void 0 ? {} : { base: options.base },
|
|
463
|
+
...options.baseFallbacks === void 0 ? {} : { baseFallbacks: options.baseFallbacks },
|
|
464
|
+
...options.css === void 0 ? {} : { css: options.css },
|
|
465
|
+
...options.cssSources === void 0 ? {} : { cssSources: options.cssSources },
|
|
466
|
+
...options.cssEntries === void 0 ? {} : { cssEntries: options.cssEntries },
|
|
467
|
+
...options.packageName === void 0 ? {} : { packageName: options.packageName }
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
async function collectTailwindV4StyleCandidates(options) {
|
|
471
|
+
return collectTailwindStyleCandidates(options);
|
|
472
|
+
}
|
|
473
|
+
async function generateTailwindV4Style(options = {}) {
|
|
474
|
+
const source = options.source ?? await resolveTailwindV4Source(createSourceOptions(options));
|
|
475
|
+
const candidates = await collectTailwindV4StyleCandidates(options);
|
|
476
|
+
const result = await createTailwindV4Engine(source).generate({
|
|
477
|
+
candidates,
|
|
478
|
+
...options.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: options.bareArbitraryValues },
|
|
479
|
+
...options.scanSources === void 0 ? {} : { scanSources: options.scanSources }
|
|
480
|
+
});
|
|
481
|
+
return {
|
|
482
|
+
...result,
|
|
483
|
+
tokens: result.rawCandidates,
|
|
484
|
+
source
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
//#endregion
|
|
488
|
+
//#region src/style-generator.ts
|
|
489
|
+
async function generateCustomStyle(options) {
|
|
490
|
+
const tokens = await collectTailwindStyleCandidates(options);
|
|
491
|
+
const classSet = new Set(tokens);
|
|
492
|
+
const sources = options.sources ?? [];
|
|
493
|
+
return {
|
|
494
|
+
version: "custom",
|
|
495
|
+
css: await options.generate({
|
|
496
|
+
tokens,
|
|
497
|
+
classSet,
|
|
498
|
+
sources
|
|
499
|
+
}),
|
|
500
|
+
tokens,
|
|
501
|
+
classSet,
|
|
502
|
+
sources
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
async function generateTailwindStyle(options) {
|
|
506
|
+
if (options.version === 3) return generateTailwindV3Style(options);
|
|
507
|
+
if (options.version === 4) return {
|
|
508
|
+
...await generateTailwindV4Style(options),
|
|
509
|
+
version: 4
|
|
510
|
+
};
|
|
511
|
+
return generateCustomStyle(options);
|
|
512
|
+
}
|
|
513
|
+
//#endregion
|
|
266
514
|
//#region src/public-api.ts
|
|
267
515
|
function defineConfig(config) {
|
|
268
516
|
return config;
|
|
@@ -280,4 +528,4 @@ function createTailwindcssPatchCli(options = {}) {
|
|
|
280
528
|
return loadCliModule().createTailwindcssPatchCli(options);
|
|
281
529
|
}
|
|
282
530
|
//#endregion
|
|
283
|
-
export { CacheStore, MIGRATION_REPORT_KIND, MIGRATION_REPORT_SCHEMA_VERSION, TAILWIND_V4_AUTO_SOURCE_SCAN_PATTERN, TAILWIND_V4_IGNORED_CONTENT_DIRS, TAILWIND_V4_IGNORED_EXTENSIONS, TAILWIND_V4_IGNORED_FILES, TailwindcssPatcher, VALIDATE_EXIT_CODES, VALIDATE_FAILURE_REASONS, ValidateCommandError, canonicalizeBareArbitraryValueCandidates, collectClassesFromContexts, collectClassesFromTailwindV4, createTailwindV4CompiledSourceEntries, createTailwindV4DefaultIgnoreSources, createTailwindV4Engine, createTailwindV4RootSources, createTailwindV4SourceEntryMatcher, createTailwindV4SourceExclusionMatcher, createTailwindcssPatchCli, defineConfig, escapeCssClassName, expandTailwindV4SourceEntries, expandTailwindV4SourceEntryBraces, extractBareArbitraryValueSourceCandidates, extractBareArbitraryValueSourceCandidatesWithPositions, extractProjectCandidatesWithPositions, extractRawCandidates, extractRawCandidatesWithPositions, extractSourceCandidates, extractSourceCandidatesWithPositions, extractValidCandidates, getPatchStatusReport, groupTokensByFile, isBareArbitraryValuesEnabled, isFileExcludedByTailwindV4SourceEntries, isFileMatchedByTailwindV4SourceEntries, isValidCandidateToken, loadRuntimeContexts, loadTailwindV4DesignSystem, logger, mergeTailwindV4SourceEntries, migrateConfigFiles, mountTailwindcssPatchCommands, normalizeOptions, normalizeTailwindV4ScannerSources, normalizeTailwindV4SourceEntries, replaceBareArbitraryValueSelectors, resolveBareArbitraryValueCandidate, resolveProjectSourceFiles, resolveSourceScanPath, resolveTailwindV4Source, resolveTailwindV4SourceBaseCandidates, resolveTailwindV4SourceEntry, resolveTailwindV4SourceFromPatchOptions, resolveValidTailwindV4Candidates, restoreConfigFiles, runTailwindBuild, splitCandidateTokens, tailwindcssPatchCommands, validateCandidateTokenRE };
|
|
531
|
+
export { CacheStore, MIGRATION_REPORT_KIND, MIGRATION_REPORT_SCHEMA_VERSION, TAILWIND_V4_AUTO_SOURCE_SCAN_PATTERN, TAILWIND_V4_IGNORED_CONTENT_DIRS, TAILWIND_V4_IGNORED_EXTENSIONS, TAILWIND_V4_IGNORED_FILES, TailwindcssPatcher, VALIDATE_EXIT_CODES, VALIDATE_FAILURE_REASONS, ValidateCommandError, canonicalizeBareArbitraryValueCandidates, collectClassesFromContexts, collectClassesFromTailwindV4, collectTailwindStyleCandidates, collectTailwindV4StyleCandidates, createTailwindV4CompiledSourceEntries, createTailwindV4DefaultIgnoreSources, createTailwindV4Engine, createTailwindV4RootSources, createTailwindV4SourceEntryMatcher, createTailwindV4SourceExclusionMatcher, createTailwindcssPatchCli, defineConfig, escapeCssClassName, expandTailwindV4SourceEntries, expandTailwindV4SourceEntryBraces, extractBareArbitraryValueSourceCandidates, extractBareArbitraryValueSourceCandidatesWithPositions, extractProjectCandidatesWithPositions, extractRawCandidates, extractRawCandidatesWithPositions, extractSourceCandidates, extractSourceCandidatesWithPositions, extractValidCandidates, generateCustomStyle, generateTailwindStyle, generateTailwindV3RawStyle, generateTailwindV3Style, generateTailwindV4Style, getPatchStatusReport, groupTokensByFile, isBareArbitraryValuesEnabled, isFileExcludedByTailwindV4SourceEntries, isFileMatchedByTailwindV4SourceEntries, isValidCandidateToken, loadRuntimeContexts, loadTailwindV4DesignSystem, logger, mergeTailwindV4SourceEntries, migrateConfigFiles, mountTailwindcssPatchCommands, normalizeOptions, normalizeTailwindV4ScannerSources, normalizeTailwindV4SourceEntries, replaceBareArbitraryValueSelectors, resolveBareArbitraryValueCandidate, resolveProjectSourceFiles, resolveSourceScanPath, resolveTailwindV4Source, resolveTailwindV4SourceBaseCandidates, resolveTailwindV4SourceEntry, resolveTailwindV4SourceFromPatchOptions, resolveValidTailwindV4Candidates, restoreConfigFiles, runTailwindBuild, splitCandidateTokens, tailwindcssPatchCommands, validateCandidateTokenRE };
|
|
@@ -18,7 +18,7 @@ import _babelTraverse from "@babel/traverse";
|
|
|
18
18
|
import { parse, parse as parse$1 } from "@babel/parser";
|
|
19
19
|
import { loadConfig } from "tailwindcss-config";
|
|
20
20
|
//#region package.json
|
|
21
|
-
var version = "9.4.
|
|
21
|
+
var version = "9.4.3";
|
|
22
22
|
//#endregion
|
|
23
23
|
//#region src/constants.ts
|
|
24
24
|
const pkgName = "tailwindcss-patch";
|
|
@@ -1412,7 +1412,7 @@ function normalizeOptions(options = {}) {
|
|
|
1412
1412
|
};
|
|
1413
1413
|
}
|
|
1414
1414
|
//#endregion
|
|
1415
|
-
//#region ../../node_modules/.pnpm/tsdown@0.22.
|
|
1415
|
+
//#region ../../node_modules/.pnpm/tsdown@0.22.2_tsx@4.22.4_typescript@6.0.3_unrun@0.2.37_synckit@0.11.13_/node_modules/tsdown/esm-shims.js
|
|
1416
1416
|
const getFilename = () => fileURLToPath(import.meta.url);
|
|
1417
1417
|
const getDirname = () => path$1.dirname(getFilename());
|
|
1418
1418
|
const __dirname = /* @__PURE__ */ getDirname();
|
|
@@ -1444,7 +1444,7 @@ async function loadWorkspaceConfigModule() {
|
|
|
1444
1444
|
return configModulePromise;
|
|
1445
1445
|
}
|
|
1446
1446
|
async function loadWorkspaceDefu() {
|
|
1447
|
-
if (!defuPromise) defuPromise = import("./dist-
|
|
1447
|
+
if (!defuPromise) defuPromise = import("./dist-CxmNpfyy.mjs").then((mod) => mod.defu).catch(async (error) => {
|
|
1448
1448
|
if (!isMissingSharedModuleError(error)) throw error;
|
|
1449
1449
|
return (await import(pathToFileURL(path.resolve(__dirname, "../../../shared/src/utils.ts")).href)).defu;
|
|
1450
1450
|
});
|