weapp-tailwindcss 2.6.2 → 2.7.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.
package/README.md CHANGED
@@ -21,7 +21,8 @@
21
21
  [![test](https://github.com/sonofmagic/weapp-tailwindcss/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/sonofmagic/weapp-tailwindcss/actions/workflows/test.yml)
22
22
  [![codecov](https://codecov.io/gh/sonofmagic/weapp-tailwindcss/branch/main/graph/badge.svg?token=zn05qXYznt)](https://codecov.io/gh/sonofmagic/weapp-tailwindcss)
23
23
 
24
- > `小程序` + `tailwindcss` 全方面解决方案
24
+ > `小程序` + `tailwindcss` 全方面解决方案
25
+ > 想试试在小程序里使用 `CSS-in-JS` 思想? 👉🏻👉🏻试试 [`weapp-pandacss`](https://github.com/sonofmagic/weapp-pandacss)
25
26
 
26
27
  \[[国内部署的文档地址](https://weapp-tw.icebreaker.top)\] \| \[[备用Github Page](https://sonofmagic.github.io/weapp-tailwindcss/)\] \| \[[1.x文档]('./v1.md')\]
27
28
 
@@ -70,7 +71,7 @@
70
71
 
71
72
  目前,这些插件支持最新版本的 `tailwindcss v3.x.x` 版本和 `webpack5`,`vite` 和 `gulp`。
72
73
 
73
- > 如果你还在使用 `tailwindcss@2` 版本,那你应该使用本插件的 `1.x` 版本。另外请确保你的 `nodejs` 版本 `>=16`。目前低于 `16` 的长期维护版本(`偶数版本`) 都已经结束了生命周期,建议安装 `nodejs` 的 `LTS`版本,详见 [nodejs/release](https://github.com/nodejs/release)
74
+ > 如果你还在使用 `tailwindcss@2` 版本,那你应该使用本插件的 `1.x` 版本。另外请确保你的 `nodejs` 版本 `>=16.6.0`。目前低于 `16` 的长期维护版本(`偶数版本`) 都已经结束了生命周期,建议安装 `nodejs` 的 `LTS`版本,详见 [nodejs/release](https://github.com/nodejs/release)
74
75
 
75
76
  ## [安装与使用方式](https://weapp-tw.icebreaker.top/docs/quick-start/install)
76
77
 
package/dist/cli.js CHANGED
@@ -1,24 +1,26 @@
1
1
  'use strict';
2
2
 
3
- var options = require('./options-c5e1d1b4.js');
3
+ var options = require('./options-7a4ffa6a.js');
4
4
  require('micromatch');
5
- require('@babel/types');
5
+ require('magic-string');
6
+ require('./replace.js');
7
+ require('@weapp-core/escape');
8
+ require('./shared-df9de23f.js');
9
+ require('@weapp-core/regex');
6
10
  require('@babel/generator');
7
11
  require('@babel/parser');
8
12
  require('@babel/traverse');
9
- require('./replace.js');
10
- require('./dic-05980807.js');
11
- require('./shared-4eed0e5c.js');
12
- require('./defaults-d79e9245.js');
13
+ require('./defaults-344ba6d9.js');
14
+ require('@babel/types');
13
15
  require('postcss');
14
- require('./postcss-4c88cd6d.js');
16
+ require('./postcss-4e99a8e8.js');
15
17
  require('postcss-selector-parser');
16
18
  require('@csstools/postcss-is-pseudo-class');
17
19
  require('node:path');
18
20
  require('node:fs');
19
21
  require('semver');
20
22
  require('tailwindcss-patch');
21
- require('tailwindcss-mangle-shared');
23
+ require('@tailwindcss-mangle/shared');
22
24
 
23
25
  const args = process.argv.slice(2);
24
26
  if (args[0] === 'patch') {
package/dist/cli.mjs CHANGED
@@ -1,22 +1,24 @@
1
- import { g as getOptions, c as createPatch } from './options-244dcceb.mjs';
1
+ import { g as getOptions, c as createPatch } from './options-5a3070c1.mjs';
2
2
  import 'micromatch';
3
- import '@babel/types';
3
+ import 'magic-string';
4
+ import './replace.mjs';
5
+ import '@weapp-core/escape';
6
+ import './shared-fd149084.mjs';
7
+ import '@weapp-core/regex';
4
8
  import '@babel/generator';
5
9
  import '@babel/parser';
6
10
  import '@babel/traverse';
7
- import './replace.mjs';
8
- import './dic-3790a3a4.mjs';
9
- import './shared-686bfc32.mjs';
10
- import './defaults-c397b5f9.mjs';
11
+ import './defaults-0743f523.mjs';
12
+ import '@babel/types';
11
13
  import 'postcss';
12
- import './postcss-99efb521.mjs';
14
+ import './postcss-a551ddc0.mjs';
13
15
  import 'postcss-selector-parser';
14
16
  import '@csstools/postcss-is-pseudo-class';
15
17
  import 'node:path';
16
18
  import 'node:fs';
17
19
  import 'semver';
18
20
  import 'tailwindcss-patch';
19
- import 'tailwindcss-mangle-shared';
21
+ import '@tailwindcss-mangle/shared';
20
22
 
21
23
  const args = process.argv.slice(2);
22
24
  if (args[0] === 'patch') {
@@ -1,8 +1,5 @@
1
- import { S as SimpleMappingChars2String } from './dic-3790a3a4.mjs';
1
+ import { SimpleMappingChars2String } from '@weapp-core/escape';
2
2
 
3
- function isRegexp(value) {
4
- return Object.prototype.toString.call(value) === '[object RegExp]';
5
- }
6
3
  function isMap(value) {
7
4
  return Object.prototype.toString.call(value) === '[object Map]';
8
5
  }
@@ -86,7 +83,7 @@ const defaultOptions = {
86
83
  }
87
84
  }
88
85
  },
89
- wxsMatcher: (file) => {
86
+ wxsMatcher: () => {
90
87
  return false;
91
88
  },
92
89
  cssPreflight: {
@@ -128,7 +125,8 @@ const defaultOptions = {
128
125
  }
129
126
  return false;
130
127
  },
131
- disabledDefaultTemplateHandler: false
128
+ disabledDefaultTemplateHandler: false,
129
+ jsEscapeStrategy: 'regenerate'
132
130
  };
133
131
 
134
- export { isMap as a, defaultOptions as d, getGroupedEntries as g, isRegexp as i, noop as n };
132
+ export { defaultOptions as d, getGroupedEntries as g, isMap as i, noop as n };
@@ -1,10 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var dic = require('./dic-05980807.js');
3
+ var escape = require('@weapp-core/escape');
4
4
 
5
- function isRegexp(value) {
6
- return Object.prototype.toString.call(value) === '[object RegExp]';
7
- }
8
5
  function isMap(value) {
9
6
  return Object.prototype.toString.call(value) === '[object Map]';
10
7
  }
@@ -88,7 +85,7 @@ const defaultOptions = {
88
85
  }
89
86
  }
90
87
  },
91
- wxsMatcher: (file) => {
88
+ wxsMatcher: () => {
92
89
  return false;
93
90
  },
94
91
  cssPreflight: {
@@ -106,7 +103,7 @@ const defaultOptions = {
106
103
  onEnd: noop,
107
104
  onUpdate: noop,
108
105
  customAttributes: {},
109
- customReplaceDictionary: dic.SimpleMappingChars2String,
106
+ customReplaceDictionary: escape.SimpleMappingChars2String,
110
107
  supportCustomLengthUnitsPatch: {
111
108
  units: ['rpx'],
112
109
  dangerousOptions: {
@@ -130,11 +127,11 @@ const defaultOptions = {
130
127
  }
131
128
  return false;
132
129
  },
133
- disabledDefaultTemplateHandler: false
130
+ disabledDefaultTemplateHandler: false,
131
+ jsEscapeStrategy: 'regenerate'
134
132
  };
135
133
 
136
134
  exports.defaultOptions = defaultOptions;
137
135
  exports.getGroupedEntries = getGroupedEntries;
138
136
  exports.isMap = isMap;
139
- exports.isRegexp = isRegexp;
140
137
  exports.noop = noop;
package/dist/defaults.js CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var defaults = require('./defaults-d79e9245.js');
6
- require('./dic-05980807.js');
5
+ var defaults = require('./defaults-344ba6d9.js');
6
+ require('@weapp-core/escape');
7
7
 
8
8
 
9
9
 
package/dist/defaults.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export { d as defaultOptions } from './defaults-c397b5f9.mjs';
2
- import './dic-3790a3a4.mjs';
1
+ export { d as defaultOptions } from './defaults-0743f523.mjs';
2
+ import '@weapp-core/escape';
package/dist/escape.d.ts CHANGED
@@ -1,3 +1 @@
1
- export declare function escape(selectors: string, options?: {
2
- map?: Record<string, string>;
3
- }): string;
1
+ export * from '@weapp-core/escape';
package/dist/gulp.js CHANGED
@@ -3,25 +3,27 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var stream = require('node:stream');
6
- var options = require('./options-c5e1d1b4.js');
6
+ var options = require('./options-7a4ffa6a.js');
7
7
  require('micromatch');
8
- require('@babel/types');
8
+ require('magic-string');
9
+ require('./replace.js');
10
+ require('@weapp-core/escape');
11
+ require('./shared-df9de23f.js');
12
+ require('@weapp-core/regex');
9
13
  require('@babel/generator');
10
14
  require('@babel/parser');
11
15
  require('@babel/traverse');
12
- require('./replace.js');
13
- require('./dic-05980807.js');
14
- require('./shared-4eed0e5c.js');
15
- require('./defaults-d79e9245.js');
16
+ require('./defaults-344ba6d9.js');
17
+ require('@babel/types');
16
18
  require('postcss');
17
- require('./postcss-4c88cd6d.js');
19
+ require('./postcss-4e99a8e8.js');
18
20
  require('postcss-selector-parser');
19
21
  require('@csstools/postcss-is-pseudo-class');
20
22
  require('node:path');
21
23
  require('node:fs');
22
24
  require('semver');
23
25
  require('tailwindcss-patch');
24
- require('tailwindcss-mangle-shared');
26
+ require('@tailwindcss-mangle/shared');
25
27
 
26
28
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
27
29
 
package/dist/gulp.mjs CHANGED
@@ -1,23 +1,25 @@
1
1
  import stream from 'node:stream';
2
- import { g as getOptions, a as createTailwindcssPatcher } from './options-244dcceb.mjs';
2
+ import { g as getOptions, a as createTailwindcssPatcher } from './options-5a3070c1.mjs';
3
3
  import 'micromatch';
4
- import '@babel/types';
4
+ import 'magic-string';
5
+ import './replace.mjs';
6
+ import '@weapp-core/escape';
7
+ import './shared-fd149084.mjs';
8
+ import '@weapp-core/regex';
5
9
  import '@babel/generator';
6
10
  import '@babel/parser';
7
11
  import '@babel/traverse';
8
- import './replace.mjs';
9
- import './dic-3790a3a4.mjs';
10
- import './shared-686bfc32.mjs';
11
- import './defaults-c397b5f9.mjs';
12
+ import './defaults-0743f523.mjs';
13
+ import '@babel/types';
12
14
  import 'postcss';
13
- import './postcss-99efb521.mjs';
15
+ import './postcss-a551ddc0.mjs';
14
16
  import 'postcss-selector-parser';
15
17
  import '@csstools/postcss-is-pseudo-class';
16
18
  import 'node:path';
17
19
  import 'node:fs';
18
20
  import 'semver';
19
21
  import 'tailwindcss-patch';
20
- import 'tailwindcss-mangle-shared';
22
+ import '@tailwindcss-mangle/shared';
21
23
 
22
24
  const Transform = stream.Transform;
23
25
  function createPlugins(options = {}) {
package/dist/index.js CHANGED
@@ -7,23 +7,25 @@ var vite = require('./vite.js');
7
7
  var gulp = require('./gulp.js');
8
8
  require('node:path');
9
9
  require('node:fs');
10
- require('./options-c5e1d1b4.js');
10
+ require('./options-7a4ffa6a.js');
11
11
  require('micromatch');
12
- require('@babel/types');
12
+ require('magic-string');
13
+ require('./replace.js');
14
+ require('@weapp-core/escape');
15
+ require('./shared-df9de23f.js');
16
+ require('@weapp-core/regex');
13
17
  require('@babel/generator');
14
18
  require('@babel/parser');
15
19
  require('@babel/traverse');
16
- require('./replace.js');
17
- require('./dic-05980807.js');
18
- require('./shared-4eed0e5c.js');
19
- require('./defaults-d79e9245.js');
20
+ require('./defaults-344ba6d9.js');
21
+ require('@babel/types');
20
22
  require('postcss');
21
- require('./postcss-4c88cd6d.js');
23
+ require('./postcss-4e99a8e8.js');
22
24
  require('postcss-selector-parser');
23
25
  require('@csstools/postcss-is-pseudo-class');
24
26
  require('semver');
25
27
  require('tailwindcss-patch');
26
- require('tailwindcss-mangle-shared');
28
+ require('@tailwindcss-mangle/shared');
27
29
  require('node:stream');
28
30
 
29
31
 
package/dist/index.mjs CHANGED
@@ -3,21 +3,23 @@ export { UnifiedViteWeappTailwindcssPlugin } from './vite.mjs';
3
3
  export { createPlugins } from './gulp.mjs';
4
4
  import 'node:path';
5
5
  import 'node:fs';
6
- import './options-244dcceb.mjs';
6
+ import './options-5a3070c1.mjs';
7
7
  import 'micromatch';
8
- import '@babel/types';
8
+ import 'magic-string';
9
+ import './replace.mjs';
10
+ import '@weapp-core/escape';
11
+ import './shared-fd149084.mjs';
12
+ import '@weapp-core/regex';
9
13
  import '@babel/generator';
10
14
  import '@babel/parser';
11
15
  import '@babel/traverse';
12
- import './replace.mjs';
13
- import './dic-3790a3a4.mjs';
14
- import './shared-686bfc32.mjs';
15
- import './defaults-c397b5f9.mjs';
16
+ import './defaults-0743f523.mjs';
17
+ import '@babel/types';
16
18
  import 'postcss';
17
- import './postcss-99efb521.mjs';
19
+ import './postcss-a551ddc0.mjs';
18
20
  import 'postcss-selector-parser';
19
21
  import '@csstools/postcss-is-pseudo-class';
20
22
  import 'semver';
21
23
  import 'tailwindcss-patch';
22
- import 'tailwindcss-mangle-shared';
24
+ import '@tailwindcss-mangle/shared';
23
25
  import 'node:stream';
@@ -0,0 +1,5 @@
1
+ import type { StringLiteral, TemplateElement } from '@babel/types';
2
+ import MagicString from 'magic-string';
3
+ import type { IJsHandlerOptions } from "../types";
4
+ export declare function regenerateHandleValue(str: string, node: StringLiteral | TemplateElement, options: IJsHandlerOptions): string;
5
+ export declare function replaceHandleValue(str: string, node: StringLiteral | TemplateElement, options: IJsHandlerOptions, ms: MagicString, offset?: number): string;
@@ -1,5 +1,7 @@
1
- import type { StringLiteral, TemplateElement } from '@babel/types';
2
1
  import type { IJsHandlerOptions } from "../types";
3
- export declare function handleValue(str: string, node: StringLiteral | TemplateElement, options: IJsHandlerOptions): string;
4
- export declare function jsHandler(rawSource: string, options: IJsHandlerOptions): import("@babel/generator").GeneratorResult;
5
- export declare function createjsHandler(options: Omit<IJsHandlerOptions, 'classNameSet'>): (rawSource: string, set: Set<string>) => import("@babel/generator").GeneratorResult;
2
+ export declare function jsHandler(rawSource: string, options: IJsHandlerOptions): import("@babel/generator").GeneratorResult | {
3
+ code: string;
4
+ };
5
+ export declare function createjsHandler(options: Omit<IJsHandlerOptions, 'classNameSet'>): (rawSource: string, set: Set<string>) => import("@babel/generator").GeneratorResult | {
6
+ code: string;
7
+ };