@csszyx/unplugin 0.8.0 → 0.9.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.
Files changed (48) hide show
  1. package/README.md +16 -7
  2. package/dist/css-mangler.cjs +4 -4
  3. package/dist/css-mangler.mjs +4 -4
  4. package/dist/index.cjs +23 -1
  5. package/dist/index.d.cts +100 -5
  6. package/dist/index.d.mts +99 -3
  7. package/dist/index.mjs +7 -1
  8. package/dist/next-prebuild.cjs +148 -0
  9. package/dist/next-prebuild.d.cts +66 -0
  10. package/dist/next-prebuild.d.mts +66 -0
  11. package/dist/next-prebuild.mjs +131 -0
  12. package/dist/next-turbo-loader.cjs +210 -0
  13. package/dist/next-turbo-loader.d.cts +68 -0
  14. package/dist/next-turbo-loader.d.mts +66 -0
  15. package/dist/next-turbo-loader.mjs +190 -0
  16. package/dist/next-watcher.cjs +237 -0
  17. package/dist/next-watcher.d.cts +106 -0
  18. package/dist/next-watcher.d.mts +106 -0
  19. package/dist/next-watcher.mjs +219 -0
  20. package/dist/shared/unplugin.8er8o6rn.mjs +276 -0
  21. package/dist/shared/unplugin.B_U4rZvG.cjs +281 -0
  22. package/dist/shared/unplugin.BbtspS8t.mjs +3271 -0
  23. package/dist/shared/unplugin.BceVw1eW.mjs +184 -0
  24. package/dist/shared/unplugin.BtQzlC2C.mjs +567 -0
  25. package/dist/shared/unplugin.CFp386gH.cjs +3321 -0
  26. package/dist/shared/unplugin.CPEWNSA0.d.cts +77 -0
  27. package/dist/shared/unplugin.CPEWNSA0.d.mts +77 -0
  28. package/dist/shared/unplugin.CScQRdTp.d.cts +15 -0
  29. package/dist/shared/unplugin.CScQRdTp.d.mts +15 -0
  30. package/dist/shared/unplugin.CdZxp0x-.d.mts +16 -0
  31. package/dist/shared/unplugin.DLrBgECN.d.cts +282 -0
  32. package/dist/shared/unplugin.DLrBgECN.d.mts +282 -0
  33. package/dist/shared/unplugin.DUxdYaSG.cjs +205 -0
  34. package/dist/shared/unplugin.s62yJbu1.cjs +591 -0
  35. package/dist/shared/unplugin.xeED_qwh.d.cts +16 -0
  36. package/dist/vite.cjs +7 -1
  37. package/dist/vite.d.cts +2 -1
  38. package/dist/vite.d.mts +2 -1
  39. package/dist/vite.mjs +7 -1
  40. package/dist/webpack.cjs +7 -1
  41. package/dist/webpack.d.cts +2 -1
  42. package/dist/webpack.d.mts +2 -1
  43. package/dist/webpack.mjs +7 -1
  44. package/package.json +41 -8
  45. package/dist/shared/unplugin.BNsv2szs.cjs +0 -1753
  46. package/dist/shared/unplugin.DCv0RtVZ.mjs +0 -1722
  47. package/dist/shared/unplugin.DUbr5w-N.d.cts +0 -49
  48. package/dist/shared/unplugin.DUbr5w-N.d.mts +0 -49
@@ -1,49 +0,0 @@
1
- import { PartialCsszyxConfig } from '@csszyx/types';
2
- import { Plugin } from 'esbuild';
3
- import { InputPluginOption } from 'rollup';
4
- import { UnpluginInstance, WebpackPluginInstance } from 'unplugin';
5
- import { PluginOption } from 'vite';
6
-
7
- /**
8
- * Mangles class strings in bundled code (JS/HTML assets) using the given mangle map.
9
- *
10
- * Exported for unit testing; the plugin calls this via the thin private wrapper that
11
- * supplies state.mangleMap.
12
- *
13
- * Pass 1: Direct `className="..."` / `class="..."` static strings
14
- * Pass 1.5: Template literal quasi (static) segments in `className:\`...\``
15
- * Pass 2: `className:EXPR` patterns with ternary operators containing quoted strings
16
- * Pass 3: Quoted string arguments to csszyx runtime helpers (_szMerge, _szIf, etc.)
17
- *
18
- * @param code bundled source code
19
- * @param mangleMap class-name → mangled-token mapping
20
- * @returns code with mangled class names
21
- */
22
- declare function mangleCodeClassesSync(code: string, mangleMap: Record<string, string>): string;
23
- declare const unplugin: UnpluginInstance<PartialCsszyxConfig, boolean>;
24
- /**
25
- * Creates a Vite plugin array with both pre-transform and post-mangle plugins.
26
- * @param options - csszyx configuration options
27
- * @returns array of Vite plugins for pre-transform and post-mangle phases
28
- */
29
- declare const vitePlugin: (options?: PartialCsszyxConfig) => PluginOption[];
30
- /**
31
- * Creates a combined Webpack plugin that applies both pre-transform and post-mangle phases.
32
- * @param options - csszyx configuration options
33
- * @returns a Webpack plugin instance combining both phases
34
- */
35
- declare const webpackPlugin: (options?: PartialCsszyxConfig) => WebpackPluginInstance;
36
- /**
37
- * Creates a Rollup plugin array with both pre-transform and post-mangle plugins.
38
- * @param options - csszyx configuration options
39
- * @returns array of Rollup plugins for pre-transform and post-mangle phases
40
- */
41
- declare const rollupPlugin: (options?: PartialCsszyxConfig) => InputPluginOption[];
42
- /**
43
- * Creates an esbuild plugin that delegates setup to both pre-transform and post-mangle plugins.
44
- * @param options - csszyx configuration options
45
- * @returns an esbuild plugin combining both pre-transform and post-mangle phases
46
- */
47
- declare const esbuildPlugin: (options?: PartialCsszyxConfig) => Plugin;
48
-
49
- export { esbuildPlugin as e, mangleCodeClassesSync as m, rollupPlugin as r, unplugin as u, vitePlugin as v, webpackPlugin as w };
@@ -1,49 +0,0 @@
1
- import { PartialCsszyxConfig } from '@csszyx/types';
2
- import { Plugin } from 'esbuild';
3
- import { InputPluginOption } from 'rollup';
4
- import { UnpluginInstance, WebpackPluginInstance } from 'unplugin';
5
- import { PluginOption } from 'vite';
6
-
7
- /**
8
- * Mangles class strings in bundled code (JS/HTML assets) using the given mangle map.
9
- *
10
- * Exported for unit testing; the plugin calls this via the thin private wrapper that
11
- * supplies state.mangleMap.
12
- *
13
- * Pass 1: Direct `className="..."` / `class="..."` static strings
14
- * Pass 1.5: Template literal quasi (static) segments in `className:\`...\``
15
- * Pass 2: `className:EXPR` patterns with ternary operators containing quoted strings
16
- * Pass 3: Quoted string arguments to csszyx runtime helpers (_szMerge, _szIf, etc.)
17
- *
18
- * @param code bundled source code
19
- * @param mangleMap class-name → mangled-token mapping
20
- * @returns code with mangled class names
21
- */
22
- declare function mangleCodeClassesSync(code: string, mangleMap: Record<string, string>): string;
23
- declare const unplugin: UnpluginInstance<PartialCsszyxConfig, boolean>;
24
- /**
25
- * Creates a Vite plugin array with both pre-transform and post-mangle plugins.
26
- * @param options - csszyx configuration options
27
- * @returns array of Vite plugins for pre-transform and post-mangle phases
28
- */
29
- declare const vitePlugin: (options?: PartialCsszyxConfig) => PluginOption[];
30
- /**
31
- * Creates a combined Webpack plugin that applies both pre-transform and post-mangle phases.
32
- * @param options - csszyx configuration options
33
- * @returns a Webpack plugin instance combining both phases
34
- */
35
- declare const webpackPlugin: (options?: PartialCsszyxConfig) => WebpackPluginInstance;
36
- /**
37
- * Creates a Rollup plugin array with both pre-transform and post-mangle plugins.
38
- * @param options - csszyx configuration options
39
- * @returns array of Rollup plugins for pre-transform and post-mangle phases
40
- */
41
- declare const rollupPlugin: (options?: PartialCsszyxConfig) => InputPluginOption[];
42
- /**
43
- * Creates an esbuild plugin that delegates setup to both pre-transform and post-mangle plugins.
44
- * @param options - csszyx configuration options
45
- * @returns an esbuild plugin combining both pre-transform and post-mangle phases
46
- */
47
- declare const esbuildPlugin: (options?: PartialCsszyxConfig) => Plugin;
48
-
49
- export { esbuildPlugin as e, mangleCodeClassesSync as m, rollupPlugin as r, unplugin as u, vitePlugin as v, webpackPlugin as w };