@csszyx/unplugin 0.10.11 → 0.10.12

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 CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const cssMangler = require('./css-mangler.cjs');
6
- const unplugin = require('./shared/unplugin.q0k37crS.cjs');
6
+ const unplugin = require('./shared/unplugin.CoiN0OSE.cjs');
7
7
  const types = require('@csszyx/types');
8
8
  require('postcss');
9
9
  require('postcss-selector-parser');
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  export { createPostCSSPlugin, escapeCSSClassName, mangleCSS, mangleCSSSync, unescapeTailwindClass } from './css-mangler.mjs';
2
- export { a as appendTailwindSourceDirective, b as assertNoRSCBoundaryViolation, c as assertNoRSCGraphViolation, d as collectMangleHybridHazards, e as computeSafelistRelPath, f as createGlobalVarAliasValidationOptions, g as createGlobalVarMapAssetSource, h as createGlobalVarScanCacheKey, i as createRSCModuleRecord, j as cssHasContentScope, k as cssImportsTailwind, u as default, l as deleteRSCModuleRecord, m as esbuildPlugin, n as extractGlobalVarAliasesForManifest, o as fileMayContainSafelistableSz, p as findRSCBoundaryViolation, q as findRSCGraphViolation, r as hasInjectableTailwindCandidate, s as hasTokens, t as hasUseClientDirective, v as hasUseServerDirective, w as isCompileSourceOptedIn, x as isHardIgnoredPath, y as isMonorepoPackage, z as isPackagesSkippedSource, A as isRSCServerModule, B as isTailwindReservedGlobalVar, C as mangleCodeClassesSync, D as mangleHybridHazardMessage, E as mergeThemes, F as missingTailwindEntryMessage, G as normalizeGlobalVarAliasesForCache, H as parseThemeBlocks, I as planGlobalVarAliases, J as readGlobalVarScanCache, K as recordGlobalVarSourceFile, L as resolveCompileSourceDirs, M as resolveGlobalVarScanCacheDir, N as resolveNativeCacheIdentity, O as rewriteGlobalVarCssAliases, P as rollupPlugin, Q as scanGlobalVarCss, R as shouldEmitWarning, S as shouldTrackGlobalVarSources, T as shouldWarnMissingTailwindEntry, U as shouldWarnUnscopedMonorepo, V as skippedSzFilesMessage, u as unplugin, W as unscopedMonorepoMessage, X as validateGlobalVarAliasInputs, Y as vitePlugin, Z as webpackPlugin, _ as writeGlobalVarScanCache } from './shared/unplugin.CiSDltfp.mjs';
2
+ export { a as appendTailwindSourceDirective, b as assertNoRSCBoundaryViolation, c as assertNoRSCGraphViolation, d as collectMangleHybridHazards, e as computeSafelistRelPath, f as createGlobalVarAliasValidationOptions, g as createGlobalVarMapAssetSource, h as createGlobalVarScanCacheKey, i as createRSCModuleRecord, j as cssHasContentScope, k as cssImportsTailwind, u as default, l as deleteRSCModuleRecord, m as esbuildPlugin, n as extractGlobalVarAliasesForManifest, o as fileMayContainSafelistableSz, p as findRSCBoundaryViolation, q as findRSCGraphViolation, r as hasInjectableTailwindCandidate, s as hasTokens, t as hasUseClientDirective, v as hasUseServerDirective, w as isCompileSourceOptedIn, x as isHardIgnoredPath, y as isMonorepoPackage, z as isPackagesSkippedSource, A as isRSCServerModule, B as isTailwindReservedGlobalVar, C as mangleCodeClassesSync, D as mangleHybridHazardMessage, E as mergeThemes, F as missingTailwindEntryMessage, G as normalizeGlobalVarAliasesForCache, H as parseThemeBlocks, I as planGlobalVarAliases, J as readGlobalVarScanCache, K as recordGlobalVarSourceFile, L as resolveCompileSourceDirs, M as resolveGlobalVarScanCacheDir, N as resolveNativeCacheIdentity, O as rewriteGlobalVarCssAliases, P as rollupPlugin, Q as scanGlobalVarCss, R as shouldEmitWarning, S as shouldTrackGlobalVarSources, T as shouldWarnMissingTailwindEntry, U as shouldWarnUnscopedMonorepo, V as skippedSzFilesMessage, u as unplugin, W as unscopedMonorepoMessage, X as validateGlobalVarAliasInputs, Y as vitePlugin, Z as webpackPlugin, _ as writeGlobalVarScanCache } from './shared/unplugin.DO7Y2Y-X.mjs';
3
3
  export { CSSZYX_GLOBAL_ALIAS_PREFIX, TAILWIND_RESERVED_PREFIXES } from '@csszyx/types';
4
4
  import 'postcss';
5
5
  import 'postcss-selector-parser';
@@ -1652,9 +1652,9 @@ let _hasWarnedTransformCacheVersion = false;
1652
1652
  let _hasWarnedNativeFallback = false;
1653
1653
  const _loggedActiveParsers = /* @__PURE__ */ new Set();
1654
1654
  const _babelFallbackFiles = /* @__PURE__ */ new Set();
1655
- const requireFromHere = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.q0k37crS.cjs', document.baseURI).href)));
1655
+ const requireFromHere = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.CoiN0OSE.cjs', document.baseURI).href)));
1656
1656
  const PLUGIN_VERSION = findPackageVersionFromFile(
1657
- node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.q0k37crS.cjs', document.baseURI).href))),
1657
+ node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.CoiN0OSE.cjs', document.baseURI).href))),
1658
1658
  UNKNOWN_PACKAGE_VERSION
1659
1659
  );
1660
1660
  const COMPILER_VERSION = findPackageVersionFromModule("@csszyx/compiler", UNKNOWN_PACKAGE_VERSION);
@@ -1918,7 +1918,7 @@ function shouldTrackGlobalVarSources(config) {
1918
1918
  }
1919
1919
  function recordGlobalVarSourceFile(state, filename, code) {
1920
1920
  const normalizedFilename = normalizeSourceFilename(filename);
1921
- if (!/\.[tj]sx?(?:\?.*)?$/.test(normalizedFilename)) {
1921
+ if (!matchesScriptExtension(normalizedFilename, SCRIPT_ID_EXTENSIONS)) {
1922
1922
  return;
1923
1923
  }
1924
1924
  if (code === null) {
@@ -2265,6 +2265,11 @@ function findPackageVersionFromFile(file, fallback) {
2265
2265
  function normalizeSourceFilename(filename) {
2266
2266
  return filename.replace(/\\/g, "/");
2267
2267
  }
2268
+ const SCRIPT_ID_EXTENSIONS = [".ts", ".tsx", ".js", ".jsx"];
2269
+ const SOURCE_MODULE_EXTENSIONS = [...SCRIPT_ID_EXTENSIONS, ".cts", ".mts", ".cjs", ".mjs"];
2270
+ function matchesScriptExtension(id, extensions) {
2271
+ return extensions.some((ext) => id.endsWith(ext) || id.includes(`${ext}?`));
2272
+ }
2268
2273
  function insertRuntimeImport(code, importStmt) {
2269
2274
  const directiveMatch = code.match(DIRECTIVE_PROLOGUE_PREFIX_RE);
2270
2275
  if (!directiveMatch) {
@@ -2666,7 +2671,7 @@ function createCsszyxPlugins(options = {}) {
2666
2671
  return isHardIgnoredPath(id, compileSourceDirs);
2667
2672
  }
2668
2673
  function shouldProcessSource(id) {
2669
- return !isHardIgnored(id) && !isUserExcluded(id) && isUserIncluded(id) && (/\.([cm]?[tj]s|[tj]sx)(\?.*)?$/.test(id) || id.endsWith(".vue") || id.endsWith(".svelte"));
2674
+ return !isHardIgnored(id) && !isUserExcluded(id) && isUserIncluded(id) && (matchesScriptExtension(id, SOURCE_MODULE_EXTENSIONS) || id.endsWith(".vue") || id.endsWith(".svelte"));
2670
2675
  }
2671
2676
  function shouldProcessCss(id) {
2672
2677
  return !isHardIgnored(id) && !isUserExcluded(id) && /\.css(\?.*)?$/.test(id);
@@ -3231,7 +3236,7 @@ function createCsszyxPlugins(options = {}) {
3231
3236
  if (shouldProcessSource(id)) {
3232
3237
  trackGlobalVarSourceFile(id, code);
3233
3238
  }
3234
- if (/\.[tj]sx?(\?.*)?$/.test(id)) {
3239
+ if (matchesScriptExtension(id, SCRIPT_ID_EXTENSIONS)) {
3235
3240
  assertNoRSCBoundaryViolation(code, id);
3236
3241
  }
3237
3242
  if (/\.css(\?.*)?$/.test(id)) {
@@ -3364,7 +3369,7 @@ function createCsszyxPlugins(options = {}) {
3364
3369
  ${transformedCode}`;
3365
3370
  transformed = true;
3366
3371
  }
3367
- if (/\.[tj]sx?(\?.*)?$/.test(id)) {
3372
+ if (matchesScriptExtension(id, SCRIPT_ID_EXTENSIONS)) {
3368
3373
  assertNoRSCBoundaryViolation(transformedCode, id);
3369
3374
  const record = createRSCModuleRecord(transformedCode, id);
3370
3375
  state.rscModules.set(record.id, record);
@@ -1898,7 +1898,7 @@ function shouldTrackGlobalVarSources(config) {
1898
1898
  }
1899
1899
  function recordGlobalVarSourceFile(state, filename, code) {
1900
1900
  const normalizedFilename = normalizeSourceFilename(filename);
1901
- if (!/\.[tj]sx?(?:\?.*)?$/.test(normalizedFilename)) {
1901
+ if (!matchesScriptExtension(normalizedFilename, SCRIPT_ID_EXTENSIONS)) {
1902
1902
  return;
1903
1903
  }
1904
1904
  if (code === null) {
@@ -2245,6 +2245,11 @@ function findPackageVersionFromFile(file, fallback) {
2245
2245
  function normalizeSourceFilename(filename) {
2246
2246
  return filename.replace(/\\/g, "/");
2247
2247
  }
2248
+ const SCRIPT_ID_EXTENSIONS = [".ts", ".tsx", ".js", ".jsx"];
2249
+ const SOURCE_MODULE_EXTENSIONS = [...SCRIPT_ID_EXTENSIONS, ".cts", ".mts", ".cjs", ".mjs"];
2250
+ function matchesScriptExtension(id, extensions) {
2251
+ return extensions.some((ext) => id.endsWith(ext) || id.includes(`${ext}?`));
2252
+ }
2248
2253
  function insertRuntimeImport(code, importStmt) {
2249
2254
  const directiveMatch = code.match(DIRECTIVE_PROLOGUE_PREFIX_RE);
2250
2255
  if (!directiveMatch) {
@@ -2646,7 +2651,7 @@ function createCsszyxPlugins(options = {}) {
2646
2651
  return isHardIgnoredPath(id, compileSourceDirs);
2647
2652
  }
2648
2653
  function shouldProcessSource(id) {
2649
- return !isHardIgnored(id) && !isUserExcluded(id) && isUserIncluded(id) && (/\.([cm]?[tj]s|[tj]sx)(\?.*)?$/.test(id) || id.endsWith(".vue") || id.endsWith(".svelte"));
2654
+ return !isHardIgnored(id) && !isUserExcluded(id) && isUserIncluded(id) && (matchesScriptExtension(id, SOURCE_MODULE_EXTENSIONS) || id.endsWith(".vue") || id.endsWith(".svelte"));
2650
2655
  }
2651
2656
  function shouldProcessCss(id) {
2652
2657
  return !isHardIgnored(id) && !isUserExcluded(id) && /\.css(\?.*)?$/.test(id);
@@ -3211,7 +3216,7 @@ function createCsszyxPlugins(options = {}) {
3211
3216
  if (shouldProcessSource(id)) {
3212
3217
  trackGlobalVarSourceFile(id, code);
3213
3218
  }
3214
- if (/\.[tj]sx?(\?.*)?$/.test(id)) {
3219
+ if (matchesScriptExtension(id, SCRIPT_ID_EXTENSIONS)) {
3215
3220
  assertNoRSCBoundaryViolation(code, id);
3216
3221
  }
3217
3222
  if (/\.css(\?.*)?$/.test(id)) {
@@ -3344,7 +3349,7 @@ function createCsszyxPlugins(options = {}) {
3344
3349
  ${transformedCode}`;
3345
3350
  transformed = true;
3346
3351
  }
3347
- if (/\.[tj]sx?(\?.*)?$/.test(id)) {
3352
+ if (matchesScriptExtension(id, SCRIPT_ID_EXTENSIONS)) {
3348
3353
  assertNoRSCBoundaryViolation(transformedCode, id);
3349
3354
  const record = createRSCModuleRecord(transformedCode, id);
3350
3355
  state.rscModules.set(record.id, record);
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.q0k37crS.cjs');
5
+ const unplugin = require('./shared/unplugin.CoiN0OSE.cjs');
6
6
  require('node:fs');
7
7
  require('node:module');
8
8
  require('node:path');
package/dist/vite.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { Y as vitePlugin } from './shared/unplugin.CiSDltfp.mjs';
1
+ import { Y as vitePlugin } from './shared/unplugin.DO7Y2Y-X.mjs';
2
2
  import 'node:fs';
3
3
  import 'node:module';
4
4
  import 'node:path';
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.q0k37crS.cjs');
5
+ const unplugin = require('./shared/unplugin.CoiN0OSE.cjs');
6
6
  require('node:fs');
7
7
  require('node:module');
8
8
  require('node:path');
package/dist/webpack.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { Z as webpackPlugin } from './shared/unplugin.CiSDltfp.mjs';
1
+ import { Z as webpackPlugin } from './shared/unplugin.DO7Y2Y-X.mjs';
2
2
  import 'node:fs';
3
3
  import 'node:module';
4
4
  import 'node:path';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@csszyx/unplugin",
3
- "version": "0.10.11",
3
+ "version": "0.10.12",
4
4
  "description": "Vite and Webpack integration for csszyx",
5
5
  "keywords": [
6
6
  "csszyx",
@@ -117,14 +117,14 @@
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.11",
121
- "@csszyx/core": "0.10.11",
122
- "@csszyx/types": "0.10.11",
123
- "@csszyx/vue-adapter": "0.10.11",
124
- "@csszyx/svelte-adapter": "0.10.11"
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"
125
125
  },
126
126
  "peerDependencies": {
127
- "@csszyx/runtime": "^0.10.11"
127
+ "@csszyx/runtime": "^0.10.12"
128
128
  },
129
129
  "devDependencies": {
130
130
  "@types/node": "^20.11.0",