weapp-tailwindcss 3.5.2 → 3.6.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.
Files changed (49) hide show
  1. package/dist/bundlers/gulp/index.d.ts +1 -1
  2. package/dist/cache/index.d.ts +1 -1
  3. package/dist/cli.js +3370 -18
  4. package/dist/cli.mjs +3366 -20
  5. package/dist/constants.d.ts +1 -1
  6. package/dist/core.js +4 -3
  7. package/dist/core.mjs +4 -3
  8. package/dist/css-macro/index.d.ts +2 -2
  9. package/dist/css-macro/index.js +3 -3
  10. package/dist/css-macro/index.mjs +3 -3
  11. package/dist/{defaults-CWrYZAlE.mjs → defaults-5A8JI2hW.mjs} +1 -1
  12. package/dist/{defaults-Bo5n6a1r.js → defaults-CdqzSWsR.js} +1 -1
  13. package/dist/defaults.js +1 -1
  14. package/dist/defaults.mjs +1 -1
  15. package/dist/gulp.js +5 -4
  16. package/dist/gulp.mjs +5 -4
  17. package/dist/{index-DzdjmBcg.js → index-BUtdpYVL.js} +1 -1
  18. package/dist/{index-D_Im3H17.js → index-CW_nvc9M.js} +3 -3
  19. package/dist/{index-B2LUAr--.js → index-Cuz6je-V.js} +1 -1
  20. package/dist/{index-DnKMgPUl.mjs → index-O6zFVUnP.mjs} +3 -3
  21. package/dist/{index-CMRC3rPR.mjs → index-ejL1iIOn.mjs} +1 -1
  22. package/dist/{index-zFq7tKDr.mjs → index-mmbDSA4j.mjs} +1 -1
  23. package/dist/index.js +7 -6
  24. package/dist/index.mjs +7 -6
  25. package/dist/init.d.ts +34 -0
  26. package/dist/js/ast-grep.d.ts +1 -0
  27. package/dist/js/babel.d.ts +3 -0
  28. package/dist/js/handlers.d.ts +1 -3
  29. package/dist/logger.d.ts +1 -0
  30. package/dist/npm.d.ts +22 -0
  31. package/dist/{options-B9PPOdJv.mjs → options-BH4m6exr.mjs} +27 -22
  32. package/dist/{options-DgkOONy_.js → options-BI6mlQ4i.js} +27 -21
  33. package/dist/postcss/index.d.ts +1 -1
  34. package/dist/postcss/mp.d.ts +1 -1
  35. package/dist/postcss/selectorParser.d.ts +1 -1
  36. package/dist/postcss.js +1 -1
  37. package/dist/postcss.mjs +1 -1
  38. package/dist/tailwindcss/patcher.d.ts +1 -1
  39. package/dist/types.d.ts +1 -1
  40. package/dist/{v5-c6m3PupX.mjs → v5-CafWSEHV.mjs} +3 -3
  41. package/dist/{v5-CqteGjOW.js → v5-DknUknkv.js} +3 -3
  42. package/dist/vite.js +5 -4
  43. package/dist/vite.mjs +5 -4
  44. package/dist/webpack.js +5 -4
  45. package/dist/webpack.mjs +5 -4
  46. package/dist/webpack4.js +4 -3
  47. package/dist/webpack4.mjs +4 -3
  48. package/dist/wxml/utils.d.ts +1 -1
  49. package/package.json +15 -13
@@ -4,4 +4,4 @@ export declare const ManglePluginHooks = "ManglePluginHooks";
4
4
  export declare const WeappTailwindcssWebpackPluginOptimizeChunkAssetsHooks = "WeappTailwindcssWebpackPluginOptimizeChunkAssetsHooks";
5
5
  export declare const pluginName = "weapp-tailwindcss-webpack-plugin";
6
6
  export declare const vitePluginName = "vite-plugin-uni-app-weapp-tailwindcss-adaptor";
7
- export declare const WEAPP_TW_REQUIRED_NODE_VERSION = "16.6.0";
7
+ export declare const WEAPP_TW_REQUIRED_NODE_VERSION = "18.17.0";
package/dist/core.js CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var options = require('./options-DgkOONy_.js');
5
+ var options = require('./options-BI6mlQ4i.js');
6
6
  require('lru-cache');
7
7
  require('md5');
8
- require('./defaults-Bo5n6a1r.js');
8
+ require('./defaults-CdqzSWsR.js');
9
9
  require('@ast-core/escape');
10
10
  require('@weapp-core/escape');
11
11
  require('./defu-Cdz2PomB.js');
@@ -13,12 +13,13 @@ require('magic-string');
13
13
  require('@babel/generator');
14
14
  require('@babel/traverse');
15
15
  require('@babel/parser');
16
+ require('consola');
16
17
  require('@weapp-core/regex');
17
18
  require('./replace.js');
18
19
  require('./shared-r_GpWheO.js');
19
20
  require('@tailwindcss-mangle/shared');
20
21
  require('postcss');
21
- require('./index-B2LUAr--.js');
22
+ require('./index-Cuz6je-V.js');
22
23
  require('@csstools/postcss-is-pseudo-class');
23
24
  require('postcss-rem-to-responsive-pixel');
24
25
  require('postcss-selector-parser');
package/dist/core.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { g as getOptions } from './options-B9PPOdJv.mjs';
1
+ import { g as getOptions } from './options-BH4m6exr.mjs';
2
2
  import 'lru-cache';
3
3
  import 'md5';
4
- import './defaults-CWrYZAlE.mjs';
4
+ import './defaults-5A8JI2hW.mjs';
5
5
  import '@ast-core/escape';
6
6
  import '@weapp-core/escape';
7
7
  import './defu-n46TJT6t.mjs';
@@ -9,12 +9,13 @@ import 'magic-string';
9
9
  import '@babel/generator';
10
10
  import '@babel/traverse';
11
11
  import '@babel/parser';
12
+ import 'consola';
12
13
  import '@weapp-core/regex';
13
14
  import './replace.mjs';
14
15
  import './shared-COWjpokr.mjs';
15
16
  import '@tailwindcss-mangle/shared';
16
17
  import 'postcss';
17
- import './index-zFq7tKDr.mjs';
18
+ import './index-mmbDSA4j.mjs';
18
19
  import '@csstools/postcss-is-pseudo-class';
19
20
  import 'postcss-rem-to-responsive-pixel';
20
21
  import 'postcss-selector-parser';
@@ -5,11 +5,11 @@ export interface Options {
5
5
  }>;
6
6
  dynamic?: boolean;
7
7
  }
8
- declare const _default: {
8
+ declare const cssMacro: {
9
9
  (options: Options): {
10
10
  handler: import("tailwindcss/types/config").PluginCreator;
11
11
  config?: Partial<import("tailwindcss/types/config").Config>;
12
12
  };
13
13
  __isOptionsFunction: true;
14
14
  };
15
- export default _default;
15
+ export default cssMacro;
@@ -1,14 +1,14 @@
1
1
  'use strict';
2
2
 
3
- var defu = require('../defu-Cdz2PomB.js');
4
3
  var plugin = require('tailwindcss/plugin');
4
+ var defu = require('../defu-Cdz2PomB.js');
5
5
  var constants = require('../constants-CFM1J-h1.js');
6
6
 
7
7
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
8
8
 
9
9
  var plugin__default = /*#__PURE__*/_interopDefaultCompat(plugin);
10
10
 
11
- var index = plugin__default["default"].withOptions((options) => {
11
+ const cssMacro = plugin__default["default"].withOptions((options) => {
12
12
  const { dynamic: dynamicMode, variantsMap } = defu.defu(options, {
13
13
  dynamic: true,
14
14
  variantsMap: {},
@@ -33,4 +33,4 @@ var index = plugin__default["default"].withOptions((options) => {
33
33
  };
34
34
  });
35
35
 
36
- module.exports = index;
36
+ module.exports = cssMacro;
@@ -1,8 +1,8 @@
1
- import { d as defu } from '../defu-n46TJT6t.mjs';
2
1
  import plugin from 'tailwindcss/plugin';
2
+ import { d as defu } from '../defu-n46TJT6t.mjs';
3
3
  import { c as createMediaQuery, a as createNegativeMediaQuery } from '../constants-Dy2Dd3Fz.mjs';
4
4
 
5
- var index = plugin.withOptions((options) => {
5
+ const cssMacro = plugin.withOptions((options) => {
6
6
  const { dynamic: dynamicMode, variantsMap } = defu(options, {
7
7
  dynamic: true,
8
8
  variantsMap: {},
@@ -27,4 +27,4 @@ var index = plugin.withOptions((options) => {
27
27
  };
28
28
  });
29
29
 
30
- export { index as default };
30
+ export { cssMacro as default };
@@ -56,7 +56,7 @@ const defuOverrideArray = createDefu((obj, key, value) => {
56
56
 
57
57
  const defaultOptions = {
58
58
  cssMatcher: file => /.+\.(?:wx|ac|jx|tt|q|c|ty)ss$/.test(file),
59
- htmlMatcher: file => /.+\.(?:(?:wx|ax|jx|ks|tt|q|ty)ml|swan)$/.test(file),
59
+ htmlMatcher: file => /.+\.(?:(?:wx|ax|jx|ks|tt|q|ty|xhs)ml|swan)$/.test(file),
60
60
  jsMatcher: (file) => {
61
61
  if (file.includes('node_modules')) {
62
62
  return false;
@@ -58,7 +58,7 @@ const defuOverrideArray = defu.createDefu((obj, key, value) => {
58
58
 
59
59
  const defaultOptions = {
60
60
  cssMatcher: file => /.+\.(?:wx|ac|jx|tt|q|c|ty)ss$/.test(file),
61
- htmlMatcher: file => /.+\.(?:(?:wx|ax|jx|ks|tt|q|ty)ml|swan)$/.test(file),
61
+ htmlMatcher: file => /.+\.(?:(?:wx|ax|jx|ks|tt|q|ty|xhs)ml|swan)$/.test(file),
62
62
  jsMatcher: (file) => {
63
63
  if (file.includes('node_modules')) {
64
64
  return false;
package/dist/defaults.js CHANGED
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  require('@ast-core/escape');
6
6
  require('@weapp-core/escape');
7
- var defaults = require('./defaults-Bo5n6a1r.js');
7
+ var defaults = require('./defaults-CdqzSWsR.js');
8
8
  require('./defu-Cdz2PomB.js');
9
9
 
10
10
 
package/dist/defaults.mjs CHANGED
@@ -1,4 +1,4 @@
1
1
  import '@ast-core/escape';
2
2
  import '@weapp-core/escape';
3
- export { a as defaultOptions } from './defaults-CWrYZAlE.mjs';
3
+ export { a as defaultOptions } from './defaults-5A8JI2hW.mjs';
4
4
  import './defu-n46TJT6t.mjs';
package/dist/gulp.js CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./index-DzdjmBcg.js');
6
- require('./options-DgkOONy_.js');
5
+ var index = require('./index-BUtdpYVL.js');
6
+ require('./options-BI6mlQ4i.js');
7
7
  require('lru-cache');
8
8
  require('md5');
9
- require('./defaults-Bo5n6a1r.js');
9
+ require('./defaults-CdqzSWsR.js');
10
10
  require('@ast-core/escape');
11
11
  require('@weapp-core/escape');
12
12
  require('./defu-Cdz2PomB.js');
@@ -14,12 +14,13 @@ require('magic-string');
14
14
  require('@babel/generator');
15
15
  require('@babel/traverse');
16
16
  require('@babel/parser');
17
+ require('consola');
17
18
  require('@weapp-core/regex');
18
19
  require('./replace.js');
19
20
  require('./shared-r_GpWheO.js');
20
21
  require('@tailwindcss-mangle/shared');
21
22
  require('postcss');
22
- require('./index-B2LUAr--.js');
23
+ require('./index-Cuz6je-V.js');
23
24
  require('@csstools/postcss-is-pseudo-class');
24
25
  require('postcss-rem-to-responsive-pixel');
25
26
  require('postcss-selector-parser');
package/dist/gulp.mjs CHANGED
@@ -1,8 +1,8 @@
1
- export { c as createPlugins } from './index-CMRC3rPR.mjs';
2
- import './options-B9PPOdJv.mjs';
1
+ export { c as createPlugins } from './index-ejL1iIOn.mjs';
2
+ import './options-BH4m6exr.mjs';
3
3
  import 'lru-cache';
4
4
  import 'md5';
5
- import './defaults-CWrYZAlE.mjs';
5
+ import './defaults-5A8JI2hW.mjs';
6
6
  import '@ast-core/escape';
7
7
  import '@weapp-core/escape';
8
8
  import './defu-n46TJT6t.mjs';
@@ -10,12 +10,13 @@ import 'magic-string';
10
10
  import '@babel/generator';
11
11
  import '@babel/traverse';
12
12
  import '@babel/parser';
13
+ import 'consola';
13
14
  import '@weapp-core/regex';
14
15
  import './replace.mjs';
15
16
  import './shared-COWjpokr.mjs';
16
17
  import '@tailwindcss-mangle/shared';
17
18
  import 'postcss';
18
- import './index-zFq7tKDr.mjs';
19
+ import './index-mmbDSA4j.mjs';
19
20
  import '@csstools/postcss-is-pseudo-class';
20
21
  import 'postcss-rem-to-responsive-pixel';
21
22
  import 'postcss-selector-parser';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var options = require('./options-DgkOONy_.js');
3
+ var options = require('./options-BI6mlQ4i.js');
4
4
  var node_buffer = require('node:buffer');
5
5
  var stream = require('node:stream');
6
6
  var index = require('./index-HC-Qkn0i.js');
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var options = require('./options-DgkOONy_.js');
4
- var index = require('./index-B2LUAr--.js');
3
+ var options = require('./options-BI6mlQ4i.js');
4
+ var index = require('./index-Cuz6je-V.js');
5
5
  var index$1 = require('./index-HC-Qkn0i.js');
6
- var defaults = require('./defaults-Bo5n6a1r.js');
6
+ var defaults = require('./defaults-CdqzSWsR.js');
7
7
 
8
8
  const debug = index$1.createDebug();
9
9
  function UnifiedViteWeappTailwindcssPlugin(options$1 = {}) {
@@ -32,7 +32,7 @@ function createContext() {
32
32
  const postcssPlugin = 'postcss-weapp-tailwindcss-rename-plugin';
33
33
  const pluginName = 'weapp-tailwindcss-webpack-plugin';
34
34
  const vitePluginName = 'vite-plugin-uni-app-weapp-tailwindcss-adaptor';
35
- const WEAPP_TW_REQUIRED_NODE_VERSION = '16.6.0';
35
+ const WEAPP_TW_REQUIRED_NODE_VERSION = '18.17.0';
36
36
 
37
37
  var cssVars = [
38
38
  {
@@ -1,7 +1,7 @@
1
- import { g as getOptions, _ as __awaiter } from './options-B9PPOdJv.mjs';
2
- import { v as vitePluginName } from './index-zFq7tKDr.mjs';
1
+ import { g as getOptions, _ as __awaiter } from './options-BH4m6exr.mjs';
2
+ import { v as vitePluginName } from './index-mmbDSA4j.mjs';
3
3
  import { c as createDebug } from './index-BEIjgKpF.mjs';
4
- import { g as getGroupedEntries } from './defaults-CWrYZAlE.mjs';
4
+ import { g as getGroupedEntries } from './defaults-5A8JI2hW.mjs';
5
5
 
6
6
  const debug = createDebug();
7
7
  function UnifiedViteWeappTailwindcssPlugin(options = {}) {
@@ -1,4 +1,4 @@
1
- import { g as getOptions, _ as __awaiter } from './options-B9PPOdJv.mjs';
1
+ import { g as getOptions, _ as __awaiter } from './options-BH4m6exr.mjs';
2
2
  import { Buffer } from 'node:buffer';
3
3
  import stream from 'node:stream';
4
4
  import { c as createDebug } from './index-BEIjgKpF.mjs';
@@ -24,7 +24,7 @@ function createContext() {
24
24
  const postcssPlugin = 'postcss-weapp-tailwindcss-rename-plugin';
25
25
  const pluginName = 'weapp-tailwindcss-webpack-plugin';
26
26
  const vitePluginName = 'vite-plugin-uni-app-weapp-tailwindcss-adaptor';
27
- const WEAPP_TW_REQUIRED_NODE_VERSION = '16.6.0';
27
+ const WEAPP_TW_REQUIRED_NODE_VERSION = '18.17.0';
28
28
 
29
29
  var cssVars = [
30
30
  {
package/dist/index.js CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./index-DzdjmBcg.js');
6
- var index$1 = require('./index-D_Im3H17.js');
7
- var v5 = require('./v5-CqteGjOW.js');
8
- require('./options-DgkOONy_.js');
5
+ var index = require('./index-BUtdpYVL.js');
6
+ var index$1 = require('./index-CW_nvc9M.js');
7
+ var v5 = require('./v5-DknUknkv.js');
8
+ require('./options-BI6mlQ4i.js');
9
9
  require('lru-cache');
10
10
  require('md5');
11
- require('./defaults-Bo5n6a1r.js');
11
+ require('./defaults-CdqzSWsR.js');
12
12
  require('@ast-core/escape');
13
13
  require('@weapp-core/escape');
14
14
  require('./defu-Cdz2PomB.js');
@@ -16,12 +16,13 @@ require('magic-string');
16
16
  require('@babel/generator');
17
17
  require('@babel/traverse');
18
18
  require('@babel/parser');
19
+ require('consola');
19
20
  require('@weapp-core/regex');
20
21
  require('./replace.js');
21
22
  require('./shared-r_GpWheO.js');
22
23
  require('@tailwindcss-mangle/shared');
23
24
  require('postcss');
24
- require('./index-B2LUAr--.js');
25
+ require('./index-Cuz6je-V.js');
25
26
  require('@csstools/postcss-is-pseudo-class');
26
27
  require('postcss-rem-to-responsive-pixel');
27
28
  require('postcss-selector-parser');
package/dist/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
- export { c as createPlugins } from './index-CMRC3rPR.mjs';
2
- export { U as UnifiedViteWeappTailwindcssPlugin } from './index-DnKMgPUl.mjs';
3
- export { U as UnifiedWebpackPluginV5 } from './v5-c6m3PupX.mjs';
4
- import './options-B9PPOdJv.mjs';
1
+ export { c as createPlugins } from './index-ejL1iIOn.mjs';
2
+ export { U as UnifiedViteWeappTailwindcssPlugin } from './index-O6zFVUnP.mjs';
3
+ export { U as UnifiedWebpackPluginV5 } from './v5-CafWSEHV.mjs';
4
+ import './options-BH4m6exr.mjs';
5
5
  import 'lru-cache';
6
6
  import 'md5';
7
- import './defaults-CWrYZAlE.mjs';
7
+ import './defaults-5A8JI2hW.mjs';
8
8
  import '@ast-core/escape';
9
9
  import '@weapp-core/escape';
10
10
  import './defu-n46TJT6t.mjs';
@@ -12,12 +12,13 @@ import 'magic-string';
12
12
  import '@babel/generator';
13
13
  import '@babel/traverse';
14
14
  import '@babel/parser';
15
+ import 'consola';
15
16
  import '@weapp-core/regex';
16
17
  import './replace.mjs';
17
18
  import './shared-COWjpokr.mjs';
18
19
  import '@tailwindcss-mangle/shared';
19
20
  import 'postcss';
20
- import './index-zFq7tKDr.mjs';
21
+ import './index-mmbDSA4j.mjs';
21
22
  import '@csstools/postcss-is-pseudo-class';
22
23
  import 'postcss-rem-to-responsive-pixel';
23
24
  import 'postcss-selector-parser';
package/dist/init.d.ts ADDED
@@ -0,0 +1,34 @@
1
+ import type { PackageJson } from 'pkg-types';
2
+ import type { FetchOptions } from './npm';
3
+ export interface CreateContextOptions {
4
+ cwd: string;
5
+ pkgJsonBasename?: string;
6
+ postcssConfigBasename?: string;
7
+ tailwindConfigBasename?: string;
8
+ fetchOptions?: FetchOptions;
9
+ }
10
+ export declare function createContext(options: Required<CreateContextOptions>): Promise<{
11
+ pkgJson: PackageJson;
12
+ pkgJsonPath: string;
13
+ cwd: string;
14
+ versions: {
15
+ tailwindcss: string;
16
+ postcss: string;
17
+ autoprefixer: string;
18
+ 'weapp-tailwindcss': string;
19
+ };
20
+ postcssConfigBasename: string;
21
+ tailwindConfigBasename: string;
22
+ readonly type: "module" | "commonjs" | undefined;
23
+ } | undefined>;
24
+ export type Context = Exclude<Awaited<ReturnType<typeof createContext>>, undefined>;
25
+ export declare function updatePackageJson(ctx: Context): Promise<void>;
26
+ export declare function touchPostcssConfig(ctx: Context): Promise<void>;
27
+ export declare function touchTailwindConfig(ctx: Context): Promise<void>;
28
+ export declare function getInitDefaults(): {
29
+ cwd: string;
30
+ postcssConfigBasename: string;
31
+ tailwindConfigBasename: string;
32
+ pkgJsonBasename: string;
33
+ };
34
+ export declare function init(options?: CreateContextOptions): Promise<void>;
@@ -0,0 +1 @@
1
+ export declare function getAstGrep(): Promise<typeof import("@ast-grep/napi").js>;
@@ -0,0 +1,3 @@
1
+ import type { NodePath } from '@babel/traverse';
2
+ import type { Node } from '@babel/types';
3
+ export declare function isEvalPath(p: NodePath<Node>): boolean;
@@ -1,6 +1,6 @@
1
1
  import type MagicString from 'magic-string';
2
2
  import type { IJsHandlerOptions } from '../types';
3
- interface ReplaceNode {
3
+ export interface ReplaceNode {
4
4
  leadingComments?: {
5
5
  value: string;
6
6
  }[] | null | undefined;
@@ -8,6 +8,4 @@ interface ReplaceNode {
8
8
  end?: number | null;
9
9
  }
10
10
  export declare function toUnicodeEscapedString(str: string): string;
11
- export declare function toUnicodeEscapedString2(str: string): string;
12
11
  export declare function replaceHandleValue(str: string, node: ReplaceNode, options: IJsHandlerOptions, ms: MagicString, offset?: number): string;
13
- export {};
@@ -0,0 +1 @@
1
+ export declare const logger: import("consola").ConsolaInstance;
package/dist/npm.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ import type { Options } from 'npm-registry-fetch';
2
+ export type FetchOptions = Options;
3
+ export declare function fetchPackage(packageName: string, options?: FetchOptions): Promise<{
4
+ "dist-tags": {
5
+ latest: string;
6
+ };
7
+ "versions": Record<string, unknown>;
8
+ }>;
9
+ export declare function getLatestVersion(packageName: string, options?: FetchOptions): Promise<string>;
10
+ export declare function getLatestVersionInRange(packageName: string, versionRange: string, options?: FetchOptions): Promise<string>;
11
+ export declare const defaultDevDeps: {
12
+ tailwindcss: string;
13
+ postcss: string;
14
+ autoprefixer: string;
15
+ 'weapp-tailwindcss': string;
16
+ };
17
+ export declare function getDevDepsVersions(options?: FetchOptions): Promise<{
18
+ tailwindcss: string;
19
+ postcss: string;
20
+ autoprefixer: string;
21
+ 'weapp-tailwindcss': string;
22
+ }>;
@@ -1,17 +1,18 @@
1
1
  import { LRUCache } from 'lru-cache';
2
2
  import md5 from 'md5';
3
- import { d as defuOverrideArray, a as defaultOptions, i as isMap } from './defaults-CWrYZAlE.mjs';
3
+ import { d as defuOverrideArray, a as defaultOptions, i as isMap } from './defaults-5A8JI2hW.mjs';
4
4
  import MagicString from 'magic-string';
5
5
  import _babelGenerate from '@babel/generator';
6
6
  import _babelTraverse from '@babel/traverse';
7
7
  import { parse, parseExpression } from '@babel/parser';
8
8
  import { jsStringEscape } from '@ast-core/escape';
9
9
  import '@weapp-core/escape';
10
+ import { createConsola } from 'consola';
10
11
  import { escapeStringRegexp } from '@weapp-core/regex';
11
12
  import { replaceJs as replaceWxml } from './replace.mjs';
12
13
  import { ClassGenerator, defaultMangleClassFilter } from '@tailwindcss-mangle/shared';
13
14
  import postcss from 'postcss';
14
- import { g as getPlugins } from './index-zFq7tKDr.mjs';
15
+ import { g as getPlugins } from './index-mmbDSA4j.mjs';
15
16
  import path from 'node:path';
16
17
  import process from 'node:process';
17
18
  import { TailwindcssPatcher } from 'tailwindcss-patch';
@@ -139,6 +140,29 @@ function _interopDefaultCompat(e) {
139
140
  _interopDefaultCompat(_babelGenerate);
140
141
  const traverse = _interopDefaultCompat(_babelTraverse);
141
142
 
143
+ const logger = createConsola();
144
+
145
+ function getAstGrep() {
146
+ return __awaiter(this, void 0, void 0, function* () {
147
+ try {
148
+ const { js } = yield import('@ast-grep/napi');
149
+ return js;
150
+ }
151
+ catch (error) {
152
+ logger.warn('请先安装 `@ast-grep/napi` , 安装完成后再尝试运行!');
153
+ throw error;
154
+ }
155
+ });
156
+ }
157
+
158
+ function isEvalPath(p) {
159
+ if (p.isCallExpression()) {
160
+ const calleePath = p.get('callee');
161
+ return calleePath.isIdentifier() && calleePath.node.name === 'eval';
162
+ }
163
+ return false;
164
+ }
165
+
142
166
  const validateFilterRE = /[\w\u00A0-\uFFFF%-?]/;
143
167
  function isValidSelector(selector = '') {
144
168
  return validateFilterRE.test(selector);
@@ -186,25 +210,6 @@ function replaceHandleValue(str, node, options, ms, offset = 0) {
186
210
  return rawStr;
187
211
  }
188
212
 
189
- function isEvalPath(p) {
190
- if (p.isCallExpression()) {
191
- const calleePath = p.get('callee');
192
- return calleePath.isIdentifier() && calleePath.node.name === 'eval';
193
- }
194
- return false;
195
- }
196
- function getAstGrep() {
197
- return __awaiter(this, void 0, void 0, function* () {
198
- try {
199
- const { js } = yield import('@ast-grep/napi');
200
- return js;
201
- }
202
- catch (error) {
203
- console.warn('请先安装 `@ast-grep/napi` , 安装完成后再尝试运行!');
204
- throw error;
205
- }
206
- });
207
- }
208
213
  function astGrepUpdateString(ast, options, ms) {
209
214
  return __awaiter(this, void 0, void 0, function* () {
210
215
  const js = yield getAstGrep();
@@ -836,4 +841,4 @@ function getOptions(opts) {
836
841
  return result;
837
842
  }
838
843
 
839
- export { __awaiter as _, getOptions as g };
844
+ export { __awaiter as _, getOptions as g, logger as l };
@@ -2,18 +2,19 @@
2
2
 
3
3
  var lruCache = require('lru-cache');
4
4
  var md5 = require('md5');
5
- var defaults = require('./defaults-Bo5n6a1r.js');
5
+ var defaults = require('./defaults-CdqzSWsR.js');
6
6
  var MagicString = require('magic-string');
7
7
  var _babelGenerate = require('@babel/generator');
8
8
  var _babelTraverse = require('@babel/traverse');
9
9
  var parser = require('@babel/parser');
10
10
  var escape = require('@ast-core/escape');
11
11
  require('@weapp-core/escape');
12
+ var consola = require('consola');
12
13
  var regex = require('@weapp-core/regex');
13
14
  var replace = require('./replace.js');
14
15
  var shared = require('@tailwindcss-mangle/shared');
15
16
  var postcss = require('postcss');
16
- var index = require('./index-B2LUAr--.js');
17
+ var index = require('./index-Cuz6je-V.js');
17
18
  var path = require('node:path');
18
19
  var process = require('node:process');
19
20
  var tailwindcssPatch = require('tailwindcss-patch');
@@ -170,6 +171,29 @@ function _interopDefaultCompat$1(e) {
170
171
  _interopDefaultCompat$1(_babelGenerate__default["default"]);
171
172
  const traverse = _interopDefaultCompat$1(_babelTraverse__default["default"]);
172
173
 
174
+ const logger = consola.createConsola();
175
+
176
+ function getAstGrep() {
177
+ return __awaiter(this, void 0, void 0, function* () {
178
+ try {
179
+ const { js } = yield import('@ast-grep/napi');
180
+ return js;
181
+ }
182
+ catch (error) {
183
+ logger.warn('请先安装 `@ast-grep/napi` , 安装完成后再尝试运行!');
184
+ throw error;
185
+ }
186
+ });
187
+ }
188
+
189
+ function isEvalPath(p) {
190
+ if (p.isCallExpression()) {
191
+ const calleePath = p.get('callee');
192
+ return calleePath.isIdentifier() && calleePath.node.name === 'eval';
193
+ }
194
+ return false;
195
+ }
196
+
173
197
  const validateFilterRE = /[\w\u00A0-\uFFFF%-?]/;
174
198
  function isValidSelector(selector = '') {
175
199
  return validateFilterRE.test(selector);
@@ -217,25 +241,6 @@ function replaceHandleValue(str, node, options, ms, offset = 0) {
217
241
  return rawStr;
218
242
  }
219
243
 
220
- function isEvalPath(p) {
221
- if (p.isCallExpression()) {
222
- const calleePath = p.get('callee');
223
- return calleePath.isIdentifier() && calleePath.node.name === 'eval';
224
- }
225
- return false;
226
- }
227
- function getAstGrep() {
228
- return __awaiter(this, void 0, void 0, function* () {
229
- try {
230
- const { js } = yield import('@ast-grep/napi');
231
- return js;
232
- }
233
- catch (error) {
234
- console.warn('请先安装 `@ast-grep/napi` , 安装完成后再尝试运行!');
235
- throw error;
236
- }
237
- });
238
- }
239
244
  function astGrepUpdateString(ast, options, ms) {
240
245
  return __awaiter(this, void 0, void 0, function* () {
241
246
  const js = yield getAstGrep();
@@ -869,3 +874,4 @@ function getOptions(opts) {
869
874
 
870
875
  exports.__awaiter = __awaiter;
871
876
  exports.getOptions = getOptions;
877
+ exports.logger = logger;
@@ -1,4 +1,4 @@
1
- import postcss from 'postcss';
2
1
  import type { IStyleHandlerOptions } from '../types';
2
+ import postcss from 'postcss';
3
3
  export declare function styleHandler(rawSource: string, options: IStyleHandlerOptions): Promise<postcss.Result<postcss.Document | postcss.Root>>;
4
4
  export declare function createStyleHandler(options: Partial<IStyleHandlerOptions>): (rawSource: string, opt?: Partial<IStyleHandlerOptions>) => Promise<postcss.Result<postcss.Document | postcss.Root>>;
@@ -1,5 +1,5 @@
1
- import { Rule } from 'postcss';
2
1
  import type { IStyleHandlerOptions } from '../types';
2
+ import { Rule } from 'postcss';
3
3
  export declare function testIfVariablesScope(node: Rule, count?: number): boolean;
4
4
  export declare function testIfTwBackdrop(node: Rule, count?: number): boolean;
5
5
  export declare function makePseudoVarRule(): Rule;
@@ -1,6 +1,6 @@
1
- import selectorParser from 'postcss-selector-parser';
2
1
  import type { Rule } from 'postcss';
3
2
  import type { IStyleHandlerOptions } from '../types';
3
+ import selectorParser from 'postcss-selector-parser';
4
4
  export declare function ruleTransformSync(rule: Rule, options: IStyleHandlerOptions): void;
5
5
  export declare function isOnlyBeforeAndAfterPseudoElement(node: Rule): boolean;
6
6
  export declare const fallbackRemove: selectorParser.Processor<void, selectorParser.Selectors>;
package/dist/postcss.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./index-B2LUAr--.js');
5
+ var index = require('./index-Cuz6je-V.js');
6
6
  var postcssIsPseudoClass = require('@csstools/postcss-is-pseudo-class');
7
7
  var postcssRem2rpx = require('postcss-rem-to-responsive-pixel');
8
8
  require('postcss');
package/dist/postcss.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { g as getPlugins, p as postcssWeappTailwindcssPostPlugin, a as postcssWeappTailwindcssPrePlugin } from './index-zFq7tKDr.mjs';
1
+ export { g as getPlugins, p as postcssWeappTailwindcssPostPlugin, a as postcssWeappTailwindcssPrePlugin } from './index-mmbDSA4j.mjs';
2
2
  export { default as postcssIsPseudoClass } from '@csstools/postcss-is-pseudo-class';
3
3
  export { default as postcssRem2rpx } from 'postcss-rem-to-responsive-pixel';
4
4
  import 'postcss';
@@ -1,3 +1,3 @@
1
- import { TailwindcssPatcher } from 'tailwindcss-patch';
2
1
  import type { ILengthUnitsPatchOptions } from 'tailwindcss-patch';
2
+ import { TailwindcssPatcher } from 'tailwindcss-patch';
3
3
  export declare function createTailwindcssPatcher(basedir?: string, cacheDir?: string, supportCustomLengthUnitsPatch?: boolean | ILengthUnitsPatchOptions): TailwindcssPatcher;