@csszyx/unplugin 0.11.11 → 0.12.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.
@@ -0,0 +1,108 @@
1
+ const LEADING_WHITESPACE_RE = /^\s+/;
2
+ const LINE_COMMENT_RE = /^\/\/[^\n]*(?:\n|$)/;
3
+ const BLOCK_COMMENT_RE = /^\/\*[\s\S]*?\*\//;
4
+ const USE_DIRECTIVE_RE = /^['"]use (?:client|server)['"];?\s*/;
5
+ function insertAfterUseDirective(code, insertion) {
6
+ let offset = 0;
7
+ while (offset < code.length) {
8
+ const triviaLength = leadingTriviaLength(code.slice(offset));
9
+ if (triviaLength === 0) break;
10
+ offset += triviaLength;
11
+ }
12
+ const directive = USE_DIRECTIVE_RE.exec(code.slice(offset));
13
+ if (!directive) return `${insertion}${code}`;
14
+ const insertionOffset = offset + directive[0].length;
15
+ return `${code.slice(0, insertionOffset)}${insertion}${code.slice(insertionOffset)}`;
16
+ }
17
+ function leadingTriviaLength(source) {
18
+ return LEADING_WHITESPACE_RE.exec(source)?.[0].length ?? LINE_COMMENT_RE.exec(source)?.[0].length ?? BLOCK_COMMENT_RE.exec(source)?.[0].length ?? 0;
19
+ }
20
+
21
+ const RUNTIME_IMPORT_CLAUSE_RE = /(?:import|export)\s+\{([^{}]*)\}\s*from\s*['"]@csszyx\/runtime['"]/g;
22
+ function clauseNames(clauseBody) {
23
+ const names = [];
24
+ for (const part of clauseBody.split(",")) {
25
+ const trimmed = part.trim();
26
+ if (!trimmed) {
27
+ continue;
28
+ }
29
+ const spaceAt = trimmed.search(/\s/);
30
+ names.push(spaceAt === -1 ? trimmed : trimmed.slice(0, spaceAt));
31
+ }
32
+ return names;
33
+ }
34
+ function importsRuntimeHelper(code, helper) {
35
+ RUNTIME_IMPORT_CLAUSE_RE.lastIndex = 0;
36
+ for (let match = RUNTIME_IMPORT_CLAUSE_RE.exec(code); match; match = RUNTIME_IMPORT_CLAUSE_RE.exec(code)) {
37
+ if (clauseNames(match[1]).includes(helper)) {
38
+ return true;
39
+ }
40
+ }
41
+ return false;
42
+ }
43
+ const RUNTIME_IMPORT_APPEND_RE = /(import\s+\{[^{}]*)\}\s*from\s*['"]@csszyx\/runtime['"]/;
44
+ function findRuntimeImportClause(code) {
45
+ const match = RUNTIME_IMPORT_APPEND_RE.exec(code);
46
+ return match ? { statement: match[0], prefixWithBody: match[1] } : null;
47
+ }
48
+
49
+ function runtimeHelperGroupsFromUsage(usage) {
50
+ const slim = usage.usesSzPart === true && usage.szPartArgsProvable === true && usage.usesRuntime !== true && usage.usesMerge !== true;
51
+ const groups = { all: [], barrel: [], merge: [] };
52
+ const append = (helper, toMerge = false) => {
53
+ groups.all.push(helper);
54
+ (toMerge ? groups.merge : groups.barrel).push(helper);
55
+ };
56
+ if (usage.usesRuntime) append("_sz");
57
+ if (usage.usesMerge) append("_szMerge");
58
+ if (usage.usesSzcn) append("_szcn", slim);
59
+ if (usage.usesSzPart) append("_szPart", slim);
60
+ if (usage.usesSzvPick) append("__szvPick");
61
+ if (usage.usesSzvPick1) append("__szvPick1");
62
+ if (usage.usesColorVar) append("__szColorVar");
63
+ if (usage.usesSpacingVar) append("__szSpacingVar");
64
+ if (usage.usesUnitVar) append("__szUnitVar");
65
+ return groups;
66
+ }
67
+ function injectNextRuntimeImports(code, usage) {
68
+ const groups = runtimeHelperGroupsFromUsage(usage);
69
+ const helpers = groups.all;
70
+ if (helpers.length === 0) {
71
+ return { code, injected: [] };
72
+ }
73
+ const hasRuntimeImport = code.includes("@csszyx/runtime");
74
+ const missing = hasRuntimeImport ? helpers.filter((helper) => !importsRuntimeHelper(code, helper)) : helpers;
75
+ if (missing.length === 0) {
76
+ return { code, injected: [] };
77
+ }
78
+ if (groups.merge.length > 0) {
79
+ const mergeHelpers = missing.filter((helper) => groups.merge.includes(helper));
80
+ const barrelHelpers = missing.filter((helper) => groups.barrel.includes(helper));
81
+ let next = insertRuntimeImport(
82
+ code,
83
+ `import { ${mergeHelpers.join(", ")} } from '@csszyx/runtime/merge';
84
+ `
85
+ );
86
+ if (barrelHelpers.length > 0) {
87
+ next = insertRuntimeImport(
88
+ next,
89
+ `import { ${barrelHelpers.join(", ")} } from '@csszyx/runtime';
90
+ `
91
+ );
92
+ }
93
+ return { code: next, injected: missing };
94
+ }
95
+ return {
96
+ code: insertRuntimeImport(
97
+ code,
98
+ `import { ${missing.join(", ")} } from '@csszyx/runtime';
99
+ `
100
+ ),
101
+ injected: missing
102
+ };
103
+ }
104
+ function insertRuntimeImport(code, importStmt) {
105
+ return insertAfterUseDirective(code, importStmt);
106
+ }
107
+
108
+ export { importsRuntimeHelper as a, insertAfterUseDirective as b, findRuntimeImportClause as f, injectNextRuntimeImports as i, runtimeHelperGroupsFromUsage as r };
@@ -15,7 +15,7 @@ function babelFallbackReason(error) {
15
15
  return error instanceof Error ? error.message : String(error);
16
16
  }
17
17
 
18
- const CACHE_SCHEMA_VERSION = 10;
18
+ const CACHE_SCHEMA_VERSION = 15;
19
19
  function resolveTransformCacheDir(rootDir, cacheDir) {
20
20
  return path.resolve(rootDir, cacheDir ?? ".csszyx/cache", "transform");
21
21
  }
@@ -33,6 +33,7 @@ function createTransformCacheKey(input) {
33
33
  `mangleVars=${input.mangleVars === true}`,
34
34
  `mangleVarHoistMaxDepth=${input.mangleVarHoistMaxDepth ?? "default"}`,
35
35
  `globalVarAliases=${JSON.stringify(globalVarAliases)}`,
36
+ `crossModuleStatics=${input.crossModuleStatics ?? "none"}`,
36
37
  `filename=${input.filename}`,
37
38
  `source=${inputSha256}`
38
39
  ].join("\n");
@@ -129,6 +130,9 @@ function serializeResult(result) {
129
130
  usesMerge: result.usesMerge,
130
131
  usesSzcn: result.usesSzcn,
131
132
  usesSzPart: result.usesSzPart,
133
+ usesSzvPick: result.usesSzvPick,
134
+ usesSzvPick1: result.usesSzvPick1,
135
+ szPartArgsProvable: result.szPartArgsProvable,
132
136
  usesColorVar: result.usesColorVar,
133
137
  usesSpacingVar: result.usesSpacingVar,
134
138
  usesUnitVar: result.usesUnitVar,
@@ -147,6 +151,9 @@ function deserializeResult(result) {
147
151
  usesMerge: result.usesMerge,
148
152
  usesSzcn: result.usesSzcn,
149
153
  usesSzPart: result.usesSzPart,
154
+ usesSzvPick: result.usesSzvPick,
155
+ usesSzvPick1: result.usesSzvPick1,
156
+ szPartArgsProvable: result.szPartArgsProvable,
150
157
  usesColorVar: result.usesColorVar,
151
158
  usesSpacingVar: result.usesSpacingVar,
152
159
  usesUnitVar: result.usesUnitVar,
@@ -659,6 +659,23 @@ declare function unscopedMonorepoMessage(): string;
659
659
  * @returns true when the warning should be printed.
660
660
  */
661
661
  declare function shouldEmitWarning(quiet: boolean, devOnly: boolean, isProduction: boolean): boolean;
662
+ /**
663
+ * Whether a transform diagnostic describes missing CSS and may be printed.
664
+ *
665
+ * @param quiet - Whether all build warnings are muted.
666
+ * @param message - Compiler diagnostic to classify.
667
+ * @returns True when the diagnostic is an unsilenced missing-CSS failure.
668
+ */
669
+ declare function shouldEmitMissingCssFallback(quiet: boolean, message: string): boolean;
670
+ /**
671
+ * Emit one missing-CSS fallback through the caller's output channel.
672
+ *
673
+ * @param quiet - Whether all build warnings are muted.
674
+ * @param message - Compiler diagnostic to classify and emit.
675
+ * @param id - Bundler module identifier included in the warning.
676
+ * @param emit - Warning output channel.
677
+ */
678
+ declare function emitMissingCssFallback(quiet: boolean, message: string, id: string, emit: (message: string) => void): void;
662
679
  /**
663
680
  * Resolve `compileSources` entries to absolute, realpath-resolved directories.
664
681
  * Each entry resolves like a Vite config path: relative to the project `root`
@@ -869,5 +886,5 @@ declare const rollupPlugin: (options?: PartialCsszyxConfig) => InputPluginOption
869
886
  */
870
887
  declare const esbuildPlugin: (options?: PartialCsszyxConfig) => Plugin;
871
888
 
872
- export { mangleHybridHazardMessage as $, cssImportsTailwind as A, unplugin as B, deleteRSCModuleRecord as D, esbuildPlugin as E, extractGlobalVarAliasesForManifest as F, fileMayContainSafelistableSz as H, findLocalImportSources as I, findRSCBoundaryViolation as J, findRSCGraphViolation as K, hasInjectableTailwindCandidate as L, hasTokens as N, hasUseClientDirective as O, hasUseServerDirective as Q, isCompileSourceOptedIn as T, isHardIgnoredPath as U, isMonorepoPackage as W, isPackagesSkippedSource as X, isRSCServerModule as Y, mangleCodeClassesSync as Z, mangleEligibleClasses as _, mergeThemes as a0, missingTailwindEntryMessage as a1, normalizeGlobalVarAliasesForCache as a2, parseThemeBlocks as a3, recordGlobalVarSourceFile as a4, resolveCompileSourceDirs as a5, resolveNativeCacheIdentity as a6, rollupPlugin as a7, scanCustomPropertyNames as a8, shouldEmitWarning as a9, shouldTrackGlobalVarSources as aa, shouldWarnMissingTailwindEntry as ab, shouldWarnUnscopedMonorepo as ac, skippedSzFilesMessage as ad, unscopedMonorepoMessage as ae, vitePlugin as af, webpackPlugin as ag, 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 };
889
+ export { mangleEligibleClasses 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 Q, hasUseServerDirective as T, isCompileSourceOptedIn as U, isHardIgnoredPath as W, isMonorepoPackage as X, isPackagesSkippedSource as Y, isRSCServerModule as Z, mangleCodeClassesSync as _, mangleHybridHazardMessage as a0, mergeThemes as a1, missingTailwindEntryMessage as a2, normalizeGlobalVarAliasesForCache as a3, parseThemeBlocks as a4, recordGlobalVarSourceFile as a5, resolveCompileSourceDirs as a6, resolveNativeCacheIdentity as a7, rollupPlugin as a8, scanCustomPropertyNames as a9, shouldEmitMissingCssFallback as aa, shouldEmitWarning as ab, shouldTrackGlobalVarSources as ac, shouldWarnMissingTailwindEntry as ad, shouldWarnUnscopedMonorepo as ae, skippedSzFilesMessage as af, unscopedMonorepoMessage as ag, vitePlugin as ah, webpackPlugin as ai, 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 };
873
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 };
@@ -659,6 +659,23 @@ declare function unscopedMonorepoMessage(): string;
659
659
  * @returns true when the warning should be printed.
660
660
  */
661
661
  declare function shouldEmitWarning(quiet: boolean, devOnly: boolean, isProduction: boolean): boolean;
662
+ /**
663
+ * Whether a transform diagnostic describes missing CSS and may be printed.
664
+ *
665
+ * @param quiet - Whether all build warnings are muted.
666
+ * @param message - Compiler diagnostic to classify.
667
+ * @returns True when the diagnostic is an unsilenced missing-CSS failure.
668
+ */
669
+ declare function shouldEmitMissingCssFallback(quiet: boolean, message: string): boolean;
670
+ /**
671
+ * Emit one missing-CSS fallback through the caller's output channel.
672
+ *
673
+ * @param quiet - Whether all build warnings are muted.
674
+ * @param message - Compiler diagnostic to classify and emit.
675
+ * @param id - Bundler module identifier included in the warning.
676
+ * @param emit - Warning output channel.
677
+ */
678
+ declare function emitMissingCssFallback(quiet: boolean, message: string, id: string, emit: (message: string) => void): void;
662
679
  /**
663
680
  * Resolve `compileSources` entries to absolute, realpath-resolved directories.
664
681
  * Each entry resolves like a Vite config path: relative to the project `root`
@@ -869,5 +886,5 @@ declare const rollupPlugin: (options?: PartialCsszyxConfig) => InputPluginOption
869
886
  */
870
887
  declare const esbuildPlugin: (options?: PartialCsszyxConfig) => Plugin;
871
888
 
872
- export { mangleHybridHazardMessage as $, cssImportsTailwind as A, unplugin as B, deleteRSCModuleRecord as D, esbuildPlugin as E, extractGlobalVarAliasesForManifest as F, fileMayContainSafelistableSz as H, findLocalImportSources as I, findRSCBoundaryViolation as J, findRSCGraphViolation as K, hasInjectableTailwindCandidate as L, hasTokens as N, hasUseClientDirective as O, hasUseServerDirective as Q, isCompileSourceOptedIn as T, isHardIgnoredPath as U, isMonorepoPackage as W, isPackagesSkippedSource as X, isRSCServerModule as Y, mangleCodeClassesSync as Z, mangleEligibleClasses as _, mergeThemes as a0, missingTailwindEntryMessage as a1, normalizeGlobalVarAliasesForCache as a2, parseThemeBlocks as a3, recordGlobalVarSourceFile as a4, resolveCompileSourceDirs as a5, resolveNativeCacheIdentity as a6, rollupPlugin as a7, scanCustomPropertyNames as a8, shouldEmitWarning as a9, shouldTrackGlobalVarSources as aa, shouldWarnMissingTailwindEntry as ab, shouldWarnUnscopedMonorepo as ac, skippedSzFilesMessage as ad, unscopedMonorepoMessage as ae, vitePlugin as af, webpackPlugin as ag, 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 };
889
+ export { mangleEligibleClasses 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 Q, hasUseServerDirective as T, isCompileSourceOptedIn as U, isHardIgnoredPath as W, isMonorepoPackage as X, isPackagesSkippedSource as Y, isRSCServerModule as Z, mangleCodeClassesSync as _, mangleHybridHazardMessage as a0, mergeThemes as a1, missingTailwindEntryMessage as a2, normalizeGlobalVarAliasesForCache as a3, parseThemeBlocks as a4, recordGlobalVarSourceFile as a5, resolveCompileSourceDirs as a6, resolveNativeCacheIdentity as a7, rollupPlugin as a8, scanCustomPropertyNames as a9, shouldEmitMissingCssFallback as aa, shouldEmitWarning as ab, shouldTrackGlobalVarSources as ac, shouldWarnMissingTailwindEntry as ad, shouldWarnUnscopedMonorepo as ae, skippedSzFilesMessage as af, unscopedMonorepoMessage as ag, vitePlugin as ah, webpackPlugin as ai, 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 };
873
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 };
@@ -1,6 +1,6 @@
1
1
  import { readFileSync } from 'node:fs';
2
2
  import { ensureRustTransformAvailable, transformSourceCode, transformRust, transformOxc, transform } from '@csszyx/compiler';
3
- import { c as createTransformCacheKey, a as readTransformCache, w as writeTransformCache, n as normalizePathSeparators, b as babelFallbackReason } from './unplugin.fOnGXWgS.mjs';
3
+ import { c as createTransformCacheKey, a as readTransformCache, w as writeTransformCache, n as normalizePathSeparators, b as babelFallbackReason } from './unplugin.CDqY7kmk.mjs';
4
4
  import { createHash } from 'node:crypto';
5
5
  import { s as sortStrings } from './unplugin.B3XoSRB8.mjs';
6
6
 
@@ -32,7 +32,7 @@ function babelFallbackReason(error) {
32
32
  return error instanceof Error ? error.message : String(error);
33
33
  }
34
34
 
35
- const CACHE_SCHEMA_VERSION = 10;
35
+ const CACHE_SCHEMA_VERSION = 15;
36
36
  function resolveTransformCacheDir(rootDir, cacheDir) {
37
37
  return path__namespace.resolve(rootDir, cacheDir ?? ".csszyx/cache", "transform");
38
38
  }
@@ -50,6 +50,7 @@ function createTransformCacheKey(input) {
50
50
  `mangleVars=${input.mangleVars === true}`,
51
51
  `mangleVarHoistMaxDepth=${input.mangleVarHoistMaxDepth ?? "default"}`,
52
52
  `globalVarAliases=${JSON.stringify(globalVarAliases)}`,
53
+ `crossModuleStatics=${input.crossModuleStatics ?? "none"}`,
53
54
  `filename=${input.filename}`,
54
55
  `source=${inputSha256}`
55
56
  ].join("\n");
@@ -146,6 +147,9 @@ function serializeResult(result) {
146
147
  usesMerge: result.usesMerge,
147
148
  usesSzcn: result.usesSzcn,
148
149
  usesSzPart: result.usesSzPart,
150
+ usesSzvPick: result.usesSzvPick,
151
+ usesSzvPick1: result.usesSzvPick1,
152
+ szPartArgsProvable: result.szPartArgsProvable,
149
153
  usesColorVar: result.usesColorVar,
150
154
  usesSpacingVar: result.usesSpacingVar,
151
155
  usesUnitVar: result.usesUnitVar,
@@ -164,6 +168,9 @@ function deserializeResult(result) {
164
168
  usesMerge: result.usesMerge,
165
169
  usesSzcn: result.usesSzcn,
166
170
  usesSzPart: result.usesSzPart,
171
+ usesSzvPick: result.usesSzvPick,
172
+ usesSzvPick1: result.usesSzvPick1,
173
+ szPartArgsProvable: result.szPartArgsProvable,
167
174
  usesColorVar: result.usesColorVar,
168
175
  usesSpacingVar: result.usesSpacingVar,
169
176
  usesUnitVar: result.usesUnitVar,
package/dist/vite.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const unplugin = require('./shared/unplugin.CJcFsJcf.cjs');
5
+ const unplugin = require('./shared/unplugin.BK3XVHe8.cjs');
6
6
  require('node:crypto');
7
7
  require('node:fs');
8
8
  require('node:module');
@@ -16,12 +16,13 @@ require('@csszyx/svelte-adapter');
16
16
  require('@csszyx/types');
17
17
  require('@csszyx/vue-adapter');
18
18
  require('unplugin');
19
- require('./shared/unplugin.CKIOVNOg.cjs');
19
+ require('./shared/unplugin.DbZ7tCfN.cjs');
20
20
  require('./css-mangler.cjs');
21
21
  require('postcss');
22
22
  require('postcss-selector-parser');
23
- require('./shared/unplugin.Cnxm1DcC.cjs');
23
+ require('./shared/unplugin.C2lHQFii.cjs');
24
24
  require('./shared/unplugin.BkRah5Ot.cjs');
25
+ require('node:zlib');
25
26
  require('postcss-value-parser');
26
27
 
27
28
 
package/dist/vite.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { af } from './shared/unplugin.BK7BIeBn.cjs';
2
- export = af;
1
+ import { ah } from './shared/unplugin.CtnKJhAi.cjs';
2
+ export = ah;
3
3
  import '@csszyx/compiler';
4
4
  import '@csszyx/types';
5
5
  import 'esbuild';
package/dist/vite.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- export { af as default } from './shared/unplugin.BK7BIeBn.mjs';
1
+ export { ah as default } from './shared/unplugin.CtnKJhAi.mjs';
2
2
  import '@csszyx/compiler';
3
3
  import '@csszyx/types';
4
4
  import 'esbuild';
package/dist/vite.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { a0 as default } from './shared/unplugin.B2RUVK6Z.mjs';
1
+ export { a2 as default } from './shared/unplugin.B9vpjOhD.mjs';
2
2
  import 'node:crypto';
3
3
  import 'node:fs';
4
4
  import 'node:module';
@@ -12,10 +12,11 @@ import '@csszyx/svelte-adapter';
12
12
  import '@csszyx/types';
13
13
  import '@csszyx/vue-adapter';
14
14
  import 'unplugin';
15
- import './shared/unplugin.fOnGXWgS.mjs';
15
+ import './shared/unplugin.CDqY7kmk.mjs';
16
16
  import './css-mangler.mjs';
17
17
  import 'postcss';
18
18
  import 'postcss-selector-parser';
19
- import './shared/unplugin.Lhzkcj-A.mjs';
19
+ import './shared/unplugin.CBMJufQ8.mjs';
20
20
  import './shared/unplugin.B3XoSRB8.mjs';
21
+ import 'node:zlib';
21
22
  import 'postcss-value-parser';
package/dist/webpack.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const unplugin = require('./shared/unplugin.CJcFsJcf.cjs');
5
+ const unplugin = require('./shared/unplugin.BK3XVHe8.cjs');
6
6
  require('node:crypto');
7
7
  require('node:fs');
8
8
  require('node:module');
@@ -16,12 +16,13 @@ require('@csszyx/svelte-adapter');
16
16
  require('@csszyx/types');
17
17
  require('@csszyx/vue-adapter');
18
18
  require('unplugin');
19
- require('./shared/unplugin.CKIOVNOg.cjs');
19
+ require('./shared/unplugin.DbZ7tCfN.cjs');
20
20
  require('./css-mangler.cjs');
21
21
  require('postcss');
22
22
  require('postcss-selector-parser');
23
- require('./shared/unplugin.Cnxm1DcC.cjs');
23
+ require('./shared/unplugin.C2lHQFii.cjs');
24
24
  require('./shared/unplugin.BkRah5Ot.cjs');
25
+ require('node:zlib');
25
26
  require('postcss-value-parser');
26
27
 
27
28
 
@@ -1,5 +1,5 @@
1
- import { ag } from './shared/unplugin.BK7BIeBn.cjs';
2
- export = ag;
1
+ import { ai } from './shared/unplugin.CtnKJhAi.cjs';
2
+ export = ai;
3
3
  import '@csszyx/compiler';
4
4
  import '@csszyx/types';
5
5
  import 'esbuild';
@@ -1,4 +1,4 @@
1
- export { ag as default } from './shared/unplugin.BK7BIeBn.mjs';
1
+ export { ai as default } from './shared/unplugin.CtnKJhAi.mjs';
2
2
  import '@csszyx/compiler';
3
3
  import '@csszyx/types';
4
4
  import 'esbuild';
package/dist/webpack.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { a1 as default } from './shared/unplugin.B2RUVK6Z.mjs';
1
+ export { a3 as default } from './shared/unplugin.B9vpjOhD.mjs';
2
2
  import 'node:crypto';
3
3
  import 'node:fs';
4
4
  import 'node:module';
@@ -12,10 +12,11 @@ import '@csszyx/svelte-adapter';
12
12
  import '@csszyx/types';
13
13
  import '@csszyx/vue-adapter';
14
14
  import 'unplugin';
15
- import './shared/unplugin.fOnGXWgS.mjs';
15
+ import './shared/unplugin.CDqY7kmk.mjs';
16
16
  import './css-mangler.mjs';
17
17
  import 'postcss';
18
18
  import 'postcss-selector-parser';
19
- import './shared/unplugin.Lhzkcj-A.mjs';
19
+ import './shared/unplugin.CBMJufQ8.mjs';
20
20
  import './shared/unplugin.B3XoSRB8.mjs';
21
+ import 'node:zlib';
21
22
  import 'postcss-value-parser';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@csszyx/unplugin",
3
- "version": "0.11.11",
3
+ "version": "0.12.0",
4
4
  "description": "Vite and Webpack integration for csszyx",
5
5
  "keywords": [
6
6
  "csszyx",
@@ -112,31 +112,33 @@
112
112
  "dist"
113
113
  ],
114
114
  "dependencies": {
115
- "postcss": "^8.5.19",
115
+ "postcss": "^8.5.23",
116
116
  "postcss-selector-parser": "^7.1.4",
117
117
  "postcss-value-parser": "^4.2.0",
118
118
  "proper-lockfile": "^4.1.2",
119
119
  "unplugin": "^3.3.0",
120
- "@csszyx/compiler": "0.11.11",
121
- "@csszyx/svelte-adapter": "0.11.11",
122
- "@csszyx/core": "0.11.11",
123
- "@csszyx/types": "0.11.11",
124
- "@csszyx/vue-adapter": "0.11.11"
120
+ "@csszyx/compiler": "0.12.0",
121
+ "@csszyx/core": "0.12.0",
122
+ "@csszyx/svelte-adapter": "0.12.0",
123
+ "@csszyx/vue-adapter": "0.12.0",
124
+ "@csszyx/types": "0.12.0"
125
125
  },
126
126
  "peerDependencies": {
127
- "@csszyx/runtime": "^0.11.11"
127
+ "@csszyx/runtime": "^0.12.0"
128
128
  },
129
129
  "devDependencies": {
130
130
  "@tailwindcss/node": "4.3.3",
131
131
  "@types/node": "^22.20.1",
132
132
  "@types/proper-lockfile": "^4.1.4",
133
- "esbuild": "^0.28.1",
134
- "rollup": "^4.62.2",
133
+ "esbuild": "0.28.1",
134
+ "rollup": "^4.62.3",
135
135
  "typescript": "^6.0.3",
136
136
  "unbuild": "^3.6.1",
137
137
  "vite": "^8.1.5",
138
138
  "vitest": "^4.1.10",
139
- "webpack": "^5.108.4"
139
+ "webpack": "^5.109.0",
140
+ "@csszyx/runtime": "0.12.0",
141
+ "@csszyx/tooling-metadata": "0.12.0"
140
142
  },
141
143
  "sideEffects": false,
142
144
  "engines": {
@@ -1,53 +0,0 @@
1
- 'use strict';
2
-
3
- const LEADING_WHITESPACE_RE = /^\s+/;
4
- const LINE_COMMENT_RE = /^\/\/[^\n]*(?:\n|$)/;
5
- const BLOCK_COMMENT_RE = /^\/\*[\s\S]*?\*\//;
6
- const USE_DIRECTIVE_RE = /^['"]use (?:client|server)['"];?\s*/;
7
- function insertAfterUseDirective(code, insertion) {
8
- let offset = 0;
9
- while (offset < code.length) {
10
- const triviaLength = leadingTriviaLength(code.slice(offset));
11
- if (triviaLength === 0) break;
12
- offset += triviaLength;
13
- }
14
- const directive = USE_DIRECTIVE_RE.exec(code.slice(offset));
15
- if (!directive) return `${insertion}${code}`;
16
- const insertionOffset = offset + directive[0].length;
17
- return `${code.slice(0, insertionOffset)}${insertion}${code.slice(insertionOffset)}`;
18
- }
19
- function leadingTriviaLength(source) {
20
- return LEADING_WHITESPACE_RE.exec(source)?.[0].length ?? LINE_COMMENT_RE.exec(source)?.[0].length ?? BLOCK_COMMENT_RE.exec(source)?.[0].length ?? 0;
21
- }
22
-
23
- const RUNTIME_IMPORT_CLAUSE_RE = /(?:import|export)\s+\{([^{}]*)\}\s*from\s*['"]@csszyx\/runtime['"]/g;
24
- function clauseNames(clauseBody) {
25
- const names = [];
26
- for (const part of clauseBody.split(",")) {
27
- const trimmed = part.trim();
28
- if (!trimmed) {
29
- continue;
30
- }
31
- const spaceAt = trimmed.search(/\s/);
32
- names.push(spaceAt === -1 ? trimmed : trimmed.slice(0, spaceAt));
33
- }
34
- return names;
35
- }
36
- function importsRuntimeHelper(code, helper) {
37
- RUNTIME_IMPORT_CLAUSE_RE.lastIndex = 0;
38
- for (let match = RUNTIME_IMPORT_CLAUSE_RE.exec(code); match; match = RUNTIME_IMPORT_CLAUSE_RE.exec(code)) {
39
- if (clauseNames(match[1]).includes(helper)) {
40
- return true;
41
- }
42
- }
43
- return false;
44
- }
45
- const RUNTIME_IMPORT_APPEND_RE = /(import\s+\{[^{}]*)\}\s*from\s*['"]@csszyx\/runtime['"]/;
46
- function findRuntimeImportClause(code) {
47
- const match = RUNTIME_IMPORT_APPEND_RE.exec(code);
48
- return match ? { statement: match[0], prefixWithBody: match[1] } : null;
49
- }
50
-
51
- exports.findRuntimeImportClause = findRuntimeImportClause;
52
- exports.importsRuntimeHelper = importsRuntimeHelper;
53
- exports.insertAfterUseDirective = insertAfterUseDirective;
@@ -1,49 +0,0 @@
1
- const LEADING_WHITESPACE_RE = /^\s+/;
2
- const LINE_COMMENT_RE = /^\/\/[^\n]*(?:\n|$)/;
3
- const BLOCK_COMMENT_RE = /^\/\*[\s\S]*?\*\//;
4
- const USE_DIRECTIVE_RE = /^['"]use (?:client|server)['"];?\s*/;
5
- function insertAfterUseDirective(code, insertion) {
6
- let offset = 0;
7
- while (offset < code.length) {
8
- const triviaLength = leadingTriviaLength(code.slice(offset));
9
- if (triviaLength === 0) break;
10
- offset += triviaLength;
11
- }
12
- const directive = USE_DIRECTIVE_RE.exec(code.slice(offset));
13
- if (!directive) return `${insertion}${code}`;
14
- const insertionOffset = offset + directive[0].length;
15
- return `${code.slice(0, insertionOffset)}${insertion}${code.slice(insertionOffset)}`;
16
- }
17
- function leadingTriviaLength(source) {
18
- return LEADING_WHITESPACE_RE.exec(source)?.[0].length ?? LINE_COMMENT_RE.exec(source)?.[0].length ?? BLOCK_COMMENT_RE.exec(source)?.[0].length ?? 0;
19
- }
20
-
21
- const RUNTIME_IMPORT_CLAUSE_RE = /(?:import|export)\s+\{([^{}]*)\}\s*from\s*['"]@csszyx\/runtime['"]/g;
22
- function clauseNames(clauseBody) {
23
- const names = [];
24
- for (const part of clauseBody.split(",")) {
25
- const trimmed = part.trim();
26
- if (!trimmed) {
27
- continue;
28
- }
29
- const spaceAt = trimmed.search(/\s/);
30
- names.push(spaceAt === -1 ? trimmed : trimmed.slice(0, spaceAt));
31
- }
32
- return names;
33
- }
34
- function importsRuntimeHelper(code, helper) {
35
- RUNTIME_IMPORT_CLAUSE_RE.lastIndex = 0;
36
- for (let match = RUNTIME_IMPORT_CLAUSE_RE.exec(code); match; match = RUNTIME_IMPORT_CLAUSE_RE.exec(code)) {
37
- if (clauseNames(match[1]).includes(helper)) {
38
- return true;
39
- }
40
- }
41
- return false;
42
- }
43
- const RUNTIME_IMPORT_APPEND_RE = /(import\s+\{[^{}]*)\}\s*from\s*['"]@csszyx\/runtime['"]/;
44
- function findRuntimeImportClause(code) {
45
- const match = RUNTIME_IMPORT_APPEND_RE.exec(code);
46
- return match ? { statement: match[0], prefixWithBody: match[1] } : null;
47
- }
48
-
49
- export { insertAfterUseDirective as a, findRuntimeImportClause as f, importsRuntimeHelper as i };