@csszyx/unplugin 0.10.12 → 0.11.1

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.
@@ -310,6 +310,21 @@ declare function assertNoRSCGraphViolation(records: Map<string, RSCModuleRecord>
310
310
  * @param id module ID/path
311
311
  */
312
312
  declare function assertNoRSCBoundaryViolation(code: string, id: string): void;
313
+ /**
314
+ * Finds relative static, re-export, and dynamic imports.
315
+ *
316
+ * @param code module source
317
+ * @returns local import specifiers
318
+ */
319
+ /**
320
+ * Extract relative/absolute local module specifiers from `code`. Exported for
321
+ * the linear-scan equivalence test; the module graph consumes it via
322
+ * {@link createRSCModuleRecord}.
323
+ *
324
+ * @param code - Module source.
325
+ * @returns Local (`.`/`/`) import specifiers, in the legacy pass order.
326
+ */
327
+ declare function findLocalImportSources(code: string): string[];
313
328
 
314
329
  /**
315
330
  * Theme Scanner — parses Tailwind v4 @theme blocks from CSS files.
@@ -364,6 +379,21 @@ declare function mergeThemes(themes: ParsedTheme[]): ParsedTheme;
364
379
  * @returns True if at least one category has tokens
365
380
  */
366
381
  declare function hasTokens(theme: ParsedTheme): boolean;
382
+ /**
383
+ * Yield the NAME of every `--name: value;` / `--name;` custom-property
384
+ * declaration in `block`, exactly as `/--([a-z][a-z0-9-]*)(?:\s*:[^;]+)?;/g`
385
+ * captured group 1 — including its terminator rules (a value, when present,
386
+ * must be non-empty and end at a `;`; otherwise the `;` follows the name
387
+ * directly). Linear: each `--` is examined once, with a single forward scan to
388
+ * the terminating `;`, so a `;`-less block can no longer drive the quadratic
389
+ * `[^;]+` re-scan.
390
+ *
391
+ * Exported for the equivalence test.
392
+ *
393
+ * @param block - The inside of a `@theme { … }` block.
394
+ * @returns The declared custom-property names, in source order.
395
+ */
396
+ declare function scanCustomPropertyNames(block: string): string[];
367
397
 
368
398
  /**
369
399
  * Plugin state for mangle map management.
@@ -806,5 +836,5 @@ declare const rollupPlugin: (options?: PartialCsszyxConfig) => InputPluginOption
806
836
  */
807
837
  declare const esbuildPlugin: (options?: PartialCsszyxConfig) => Plugin;
808
838
 
809
- export { normalizeGlobalVarAliasesForCache as $, unplugin as A, deleteRSCModuleRecord as B, esbuildPlugin as D, extractGlobalVarAliasesForManifest as E, fileMayContainSafelistableSz as F, findRSCBoundaryViolation as H, findRSCGraphViolation as I, hasInjectableTailwindCandidate as J, hasTokens as K, hasUseClientDirective as L, hasUseServerDirective as N, isCompileSourceOptedIn as O, isHardIgnoredPath as Q, isMonorepoPackage as T, isPackagesSkippedSource as U, isRSCServerModule as W, mangleCodeClassesSync as X, mangleHybridHazardMessage as Y, mergeThemes as Z, missingTailwindEntryMessage as _, parseThemeBlocks as a0, recordGlobalVarSourceFile as a1, resolveCompileSourceDirs as a2, resolveNativeCacheIdentity as a3, rollupPlugin as a4, shouldEmitWarning as a5, shouldTrackGlobalVarSources as a6, shouldWarnMissingTailwindEntry as a7, shouldWarnUnscopedMonorepo as a8, skippedSzFilesMessage as a9, unscopedMonorepoMessage as aa, vitePlugin as ab, webpackPlugin as ac, appendTailwindSourceDirective as r, assertNoRSCBoundaryViolation as s, assertNoRSCGraphViolation as t, collectMangleHybridHazards as u, computeSafelistRelPath as v, createGlobalVarMapAssetSource as w, createRSCModuleRecord as x, cssHasContentScope as y, cssImportsTailwind as z };
839
+ export { missingTailwindEntryMessage as $, unplugin as A, deleteRSCModuleRecord as B, esbuildPlugin as D, extractGlobalVarAliasesForManifest as E, fileMayContainSafelistableSz as F, findLocalImportSources as H, findRSCBoundaryViolation as I, findRSCGraphViolation as J, hasInjectableTailwindCandidate as K, hasTokens as L, hasUseClientDirective as N, hasUseServerDirective as O, isCompileSourceOptedIn as Q, isHardIgnoredPath as T, isMonorepoPackage as U, isPackagesSkippedSource as W, isRSCServerModule as X, mangleCodeClassesSync as Y, mangleHybridHazardMessage as Z, mergeThemes as _, normalizeGlobalVarAliasesForCache as a0, parseThemeBlocks as a1, recordGlobalVarSourceFile as a2, resolveCompileSourceDirs as a3, resolveNativeCacheIdentity as a4, rollupPlugin as a5, scanCustomPropertyNames as a6, shouldEmitWarning as a7, shouldTrackGlobalVarSources as a8, shouldWarnMissingTailwindEntry as a9, shouldWarnUnscopedMonorepo as aa, skippedSzFilesMessage as ab, unscopedMonorepoMessage as ac, vitePlugin as ad, webpackPlugin as ae, appendTailwindSourceDirective as r, assertNoRSCBoundaryViolation as s, assertNoRSCGraphViolation as t, collectMangleHybridHazards as u, computeSafelistRelPath as v, createGlobalVarMapAssetSource as w, createRSCModuleRecord as x, cssHasContentScope as y, cssImportsTailwind as z };
810
840
  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 };
@@ -310,6 +310,21 @@ declare function assertNoRSCGraphViolation(records: Map<string, RSCModuleRecord>
310
310
  * @param id module ID/path
311
311
  */
312
312
  declare function assertNoRSCBoundaryViolation(code: string, id: string): void;
313
+ /**
314
+ * Finds relative static, re-export, and dynamic imports.
315
+ *
316
+ * @param code module source
317
+ * @returns local import specifiers
318
+ */
319
+ /**
320
+ * Extract relative/absolute local module specifiers from `code`. Exported for
321
+ * the linear-scan equivalence test; the module graph consumes it via
322
+ * {@link createRSCModuleRecord}.
323
+ *
324
+ * @param code - Module source.
325
+ * @returns Local (`.`/`/`) import specifiers, in the legacy pass order.
326
+ */
327
+ declare function findLocalImportSources(code: string): string[];
313
328
 
314
329
  /**
315
330
  * Theme Scanner — parses Tailwind v4 @theme blocks from CSS files.
@@ -364,6 +379,21 @@ declare function mergeThemes(themes: ParsedTheme[]): ParsedTheme;
364
379
  * @returns True if at least one category has tokens
365
380
  */
366
381
  declare function hasTokens(theme: ParsedTheme): boolean;
382
+ /**
383
+ * Yield the NAME of every `--name: value;` / `--name;` custom-property
384
+ * declaration in `block`, exactly as `/--([a-z][a-z0-9-]*)(?:\s*:[^;]+)?;/g`
385
+ * captured group 1 — including its terminator rules (a value, when present,
386
+ * must be non-empty and end at a `;`; otherwise the `;` follows the name
387
+ * directly). Linear: each `--` is examined once, with a single forward scan to
388
+ * the terminating `;`, so a `;`-less block can no longer drive the quadratic
389
+ * `[^;]+` re-scan.
390
+ *
391
+ * Exported for the equivalence test.
392
+ *
393
+ * @param block - The inside of a `@theme { … }` block.
394
+ * @returns The declared custom-property names, in source order.
395
+ */
396
+ declare function scanCustomPropertyNames(block: string): string[];
367
397
 
368
398
  /**
369
399
  * Plugin state for mangle map management.
@@ -806,5 +836,5 @@ declare const rollupPlugin: (options?: PartialCsszyxConfig) => InputPluginOption
806
836
  */
807
837
  declare const esbuildPlugin: (options?: PartialCsszyxConfig) => Plugin;
808
838
 
809
- export { normalizeGlobalVarAliasesForCache as $, unplugin as A, deleteRSCModuleRecord as B, esbuildPlugin as D, extractGlobalVarAliasesForManifest as E, fileMayContainSafelistableSz as F, findRSCBoundaryViolation as H, findRSCGraphViolation as I, hasInjectableTailwindCandidate as J, hasTokens as K, hasUseClientDirective as L, hasUseServerDirective as N, isCompileSourceOptedIn as O, isHardIgnoredPath as Q, isMonorepoPackage as T, isPackagesSkippedSource as U, isRSCServerModule as W, mangleCodeClassesSync as X, mangleHybridHazardMessage as Y, mergeThemes as Z, missingTailwindEntryMessage as _, parseThemeBlocks as a0, recordGlobalVarSourceFile as a1, resolveCompileSourceDirs as a2, resolveNativeCacheIdentity as a3, rollupPlugin as a4, shouldEmitWarning as a5, shouldTrackGlobalVarSources as a6, shouldWarnMissingTailwindEntry as a7, shouldWarnUnscopedMonorepo as a8, skippedSzFilesMessage as a9, unscopedMonorepoMessage as aa, vitePlugin as ab, webpackPlugin as ac, appendTailwindSourceDirective as r, assertNoRSCBoundaryViolation as s, assertNoRSCGraphViolation as t, collectMangleHybridHazards as u, computeSafelistRelPath as v, createGlobalVarMapAssetSource as w, createRSCModuleRecord as x, cssHasContentScope as y, cssImportsTailwind as z };
839
+ export { missingTailwindEntryMessage as $, unplugin as A, deleteRSCModuleRecord as B, esbuildPlugin as D, extractGlobalVarAliasesForManifest as E, fileMayContainSafelistableSz as F, findLocalImportSources as H, findRSCBoundaryViolation as I, findRSCGraphViolation as J, hasInjectableTailwindCandidate as K, hasTokens as L, hasUseClientDirective as N, hasUseServerDirective as O, isCompileSourceOptedIn as Q, isHardIgnoredPath as T, isMonorepoPackage as U, isPackagesSkippedSource as W, isRSCServerModule as X, mangleCodeClassesSync as Y, mangleHybridHazardMessage as Z, mergeThemes as _, normalizeGlobalVarAliasesForCache as a0, parseThemeBlocks as a1, recordGlobalVarSourceFile as a2, resolveCompileSourceDirs as a3, resolveNativeCacheIdentity as a4, rollupPlugin as a5, scanCustomPropertyNames as a6, shouldEmitWarning as a7, shouldTrackGlobalVarSources as a8, shouldWarnMissingTailwindEntry as a9, shouldWarnUnscopedMonorepo as aa, skippedSzFilesMessage as ab, unscopedMonorepoMessage as ac, vitePlugin as ad, webpackPlugin as ae, appendTailwindSourceDirective as r, assertNoRSCBoundaryViolation as s, assertNoRSCGraphViolation as t, collectMangleHybridHazards as u, computeSafelistRelPath as v, createGlobalVarMapAssetSource as w, createRSCModuleRecord as x, cssHasContentScope as y, cssImportsTailwind as z };
810
840
  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 };
@@ -0,0 +1,32 @@
1
+ 'use strict';
2
+
3
+ const RUNTIME_IMPORT_CLAUSE_RE = /(?:import|export)\s+\{([^{}]*)\}\s*from\s*['"]@csszyx\/runtime['"]/g;
4
+ function clauseNames(clauseBody) {
5
+ const names = [];
6
+ for (const part of clauseBody.split(",")) {
7
+ const trimmed = part.trim();
8
+ if (!trimmed) {
9
+ continue;
10
+ }
11
+ const spaceAt = trimmed.search(/\s/);
12
+ names.push(spaceAt === -1 ? trimmed : trimmed.slice(0, spaceAt));
13
+ }
14
+ return names;
15
+ }
16
+ function importsRuntimeHelper(code, helper) {
17
+ RUNTIME_IMPORT_CLAUSE_RE.lastIndex = 0;
18
+ for (let match = RUNTIME_IMPORT_CLAUSE_RE.exec(code); match; match = RUNTIME_IMPORT_CLAUSE_RE.exec(code)) {
19
+ if (clauseNames(match[1]).includes(helper)) {
20
+ return true;
21
+ }
22
+ }
23
+ return false;
24
+ }
25
+ const RUNTIME_IMPORT_APPEND_RE = /(import\s+\{[^{}]*)\}\s*from\s*['"]@csszyx\/runtime['"]/;
26
+ function findRuntimeImportClause(code) {
27
+ const match = RUNTIME_IMPORT_APPEND_RE.exec(code);
28
+ return match ? { statement: match[0], prefixWithBody: match[1] } : null;
29
+ }
30
+
31
+ exports.findRuntimeImportClause = findRuntimeImportClause;
32
+ exports.importsRuntimeHelper = importsRuntimeHelper;
package/dist/vite.cjs CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const unplugin = require('./shared/unplugin.CoiN0OSE.cjs');
5
+ const unplugin = require('./shared/unplugin.CP2cz9bA.cjs');
6
+ require('node:crypto');
6
7
  require('node:fs');
7
8
  require('node:module');
8
9
  require('node:path');
@@ -19,8 +20,8 @@ require('./css-mangler.cjs');
19
20
  require('postcss');
20
21
  require('postcss-selector-parser');
21
22
  require('./shared/unplugin.BCwRIUs_.cjs');
22
- require('node:crypto');
23
- require('./shared/unplugin.D32Rb29j.cjs');
23
+ require('./shared/unplugin.Rov-j_Wm.cjs');
24
+ require('./shared/unplugin.D0N9bprz.cjs');
24
25
  require('postcss-value-parser');
25
26
 
26
27
 
package/dist/vite.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { ab as vitePlugin } from './shared/unplugin.D3qsS8Pe.cjs';
1
+ import { ad as vitePlugin } from './shared/unplugin.PhOFTQpB.cjs';
2
2
  import '@csszyx/compiler';
3
3
  import '@csszyx/types';
4
4
  import 'esbuild';
package/dist/vite.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { ab as vitePlugin } from './shared/unplugin.D3qsS8Pe.mjs';
1
+ import { ad as vitePlugin } from './shared/unplugin.PhOFTQpB.mjs';
2
2
  import '@csszyx/compiler';
3
3
  import '@csszyx/types';
4
4
  import 'esbuild';
package/dist/vite.mjs CHANGED
@@ -1,4 +1,5 @@
1
- import { Y as vitePlugin } from './shared/unplugin.DO7Y2Y-X.mjs';
1
+ import { _ as vitePlugin } from './shared/unplugin.BS60onPk.mjs';
2
+ import 'node:crypto';
2
3
  import 'node:fs';
3
4
  import 'node:module';
4
5
  import 'node:path';
@@ -15,8 +16,8 @@ import './css-mangler.mjs';
15
16
  import 'postcss';
16
17
  import 'postcss-selector-parser';
17
18
  import './shared/unplugin.B1mblcm-.mjs';
18
- import 'node:crypto';
19
- import './shared/unplugin.CGqFVGlB.mjs';
19
+ import './shared/unplugin.B3RHYokB.mjs';
20
+ import './shared/unplugin.ByzV6iZE.mjs';
20
21
  import 'postcss-value-parser';
21
22
 
22
23
 
package/dist/webpack.cjs CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const unplugin = require('./shared/unplugin.CoiN0OSE.cjs');
5
+ const unplugin = require('./shared/unplugin.CP2cz9bA.cjs');
6
+ require('node:crypto');
6
7
  require('node:fs');
7
8
  require('node:module');
8
9
  require('node:path');
@@ -19,8 +20,8 @@ require('./css-mangler.cjs');
19
20
  require('postcss');
20
21
  require('postcss-selector-parser');
21
22
  require('./shared/unplugin.BCwRIUs_.cjs');
22
- require('node:crypto');
23
- require('./shared/unplugin.D32Rb29j.cjs');
23
+ require('./shared/unplugin.Rov-j_Wm.cjs');
24
+ require('./shared/unplugin.D0N9bprz.cjs');
24
25
  require('postcss-value-parser');
25
26
 
26
27
 
@@ -1,4 +1,4 @@
1
- import { ac as webpackPlugin } from './shared/unplugin.D3qsS8Pe.cjs';
1
+ import { ae as webpackPlugin } from './shared/unplugin.PhOFTQpB.cjs';
2
2
  import '@csszyx/compiler';
3
3
  import '@csszyx/types';
4
4
  import 'esbuild';
@@ -1,4 +1,4 @@
1
- import { ac as webpackPlugin } from './shared/unplugin.D3qsS8Pe.mjs';
1
+ import { ae as webpackPlugin } from './shared/unplugin.PhOFTQpB.mjs';
2
2
  import '@csszyx/compiler';
3
3
  import '@csszyx/types';
4
4
  import 'esbuild';
package/dist/webpack.mjs CHANGED
@@ -1,4 +1,5 @@
1
- import { Z as webpackPlugin } from './shared/unplugin.DO7Y2Y-X.mjs';
1
+ import { $ as webpackPlugin } from './shared/unplugin.BS60onPk.mjs';
2
+ import 'node:crypto';
2
3
  import 'node:fs';
3
4
  import 'node:module';
4
5
  import 'node:path';
@@ -15,8 +16,8 @@ import './css-mangler.mjs';
15
16
  import 'postcss';
16
17
  import 'postcss-selector-parser';
17
18
  import './shared/unplugin.B1mblcm-.mjs';
18
- import 'node:crypto';
19
- import './shared/unplugin.CGqFVGlB.mjs';
19
+ import './shared/unplugin.B3RHYokB.mjs';
20
+ import './shared/unplugin.ByzV6iZE.mjs';
20
21
  import 'postcss-value-parser';
21
22
 
22
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@csszyx/unplugin",
3
- "version": "0.10.12",
3
+ "version": "0.11.1",
4
4
  "description": "Vite and Webpack integration for csszyx",
5
5
  "keywords": [
6
6
  "csszyx",
@@ -117,16 +117,17 @@
117
117
  "postcss-value-parser": "^4.2.0",
118
118
  "proper-lockfile": "^4.1.2",
119
119
  "unplugin": "^1.10.1",
120
- "@csszyx/compiler": "0.10.12",
121
- "@csszyx/core": "0.10.12",
122
- "@csszyx/vue-adapter": "0.10.12",
123
- "@csszyx/types": "0.10.12",
124
- "@csszyx/svelte-adapter": "0.10.12"
120
+ "@csszyx/compiler": "0.11.1",
121
+ "@csszyx/svelte-adapter": "0.11.1",
122
+ "@csszyx/types": "0.11.1",
123
+ "@csszyx/vue-adapter": "0.11.1",
124
+ "@csszyx/core": "0.11.1"
125
125
  },
126
126
  "peerDependencies": {
127
- "@csszyx/runtime": "^0.10.12"
127
+ "@csszyx/runtime": "^0.11.1"
128
128
  },
129
129
  "devDependencies": {
130
+ "@tailwindcss/node": "4.3.2",
130
131
  "@types/node": "^20.11.0",
131
132
  "@types/proper-lockfile": "^4.1.4",
132
133
  "esbuild": "^0.28.1",