weapp-tailwindcss 3.7.0-alpha.1 → 3.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/dist/cli.js CHANGED
@@ -3,7 +3,7 @@
3
3
  var process$1 = require('node:process');
4
4
  var semver = require('semver');
5
5
  var index = require('./index-h2-ZMO3S.js');
6
- var options = require('./options-DW1MHPWk.js');
6
+ var options = require('./options-Bv-1GQJY.js');
7
7
  var require$$0$2 = require('fs');
8
8
  var require$$0 = require('constants');
9
9
  var require$$0$1 = require('stream');
package/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import process$1 from 'node:process';
2
2
  import semver from 'semver';
3
3
  import { W as WEAPP_TW_REQUIRED_NODE_VERSION } from './index-BF8k8rHr.mjs';
4
- import { _ as __awaiter, l as logger, g as getOptions } from './options-B9bqXmm1.mjs';
4
+ import { _ as __awaiter, l as logger, g as getOptions } from './options-yXyCFCtr.mjs';
5
5
  import require$$0$2 from 'fs';
6
6
  import require$$0 from 'constants';
7
7
  import require$$0$1 from 'stream';
package/dist/core.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var options = require('./options-DW1MHPWk.js');
5
+ var options = require('./options-Bv-1GQJY.js');
6
6
  require('lru-cache');
7
7
  require('md5');
8
8
  require('./defaults-CdqzSWsR.js');
package/dist/core.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { g as getOptions } from './options-B9bqXmm1.mjs';
1
+ import { g as getOptions } from './options-yXyCFCtr.mjs';
2
2
  import 'lru-cache';
3
3
  import 'md5';
4
4
  import './defaults-5A8JI2hW.mjs';
package/dist/gulp.js CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./index-BE6wE0No.js');
6
- require('./options-DW1MHPWk.js');
5
+ var index = require('./index-ClSBbhnm.js');
6
+ require('./options-Bv-1GQJY.js');
7
7
  require('lru-cache');
8
8
  require('md5');
9
9
  require('./defaults-CdqzSWsR.js');
package/dist/gulp.mjs CHANGED
@@ -1,5 +1,5 @@
1
- export { c as createPlugins } from './index-CoTUirpU.mjs';
2
- import './options-B9bqXmm1.mjs';
1
+ export { c as createPlugins } from './index-DoMb0-xW.mjs';
2
+ import './options-yXyCFCtr.mjs';
3
3
  import 'lru-cache';
4
4
  import 'md5';
5
5
  import './defaults-5A8JI2hW.mjs';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var options = require('./options-DW1MHPWk.js');
3
+ var options = require('./options-Bv-1GQJY.js');
4
4
  var index = require('./index-h2-ZMO3S.js');
5
5
  var index$1 = require('./index-HC-Qkn0i.js');
6
6
  var defaults = require('./defaults-CdqzSWsR.js');
@@ -1,4 +1,4 @@
1
- import { g as getOptions, _ as __awaiter } from './options-B9bqXmm1.mjs';
1
+ import { g as getOptions, _ as __awaiter } from './options-yXyCFCtr.mjs';
2
2
  import { v as vitePluginName } from './index-BF8k8rHr.mjs';
3
3
  import { c as createDebug } from './index-BEIjgKpF.mjs';
4
4
  import { g as getGroupedEntries } from './defaults-5A8JI2hW.mjs';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var options = require('./options-DW1MHPWk.js');
3
+ var options = require('./options-Bv-1GQJY.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,4 +1,4 @@
1
- import { g as getOptions, _ as __awaiter } from './options-B9bqXmm1.mjs';
1
+ import { g as getOptions, _ as __awaiter } from './options-yXyCFCtr.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';
package/dist/index.js CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./index-BE6wE0No.js');
6
- var index$1 = require('./index-Da8_sCz_.js');
7
- var v5 = require('./v5-Bil5avxf.js');
8
- require('./options-DW1MHPWk.js');
5
+ var index = require('./index-ClSBbhnm.js');
6
+ var index$1 = require('./index-BTXkyxen.js');
7
+ var v5 = require('./v5-DwFXG7m_.js');
8
+ require('./options-Bv-1GQJY.js');
9
9
  require('lru-cache');
10
10
  require('md5');
11
11
  require('./defaults-CdqzSWsR.js');
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
- export { c as createPlugins } from './index-CoTUirpU.mjs';
2
- export { U as UnifiedViteWeappTailwindcssPlugin } from './index-DQWPK2Gk.mjs';
3
- export { U as UnifiedWebpackPluginV5 } from './v5-D0HXtisF.mjs';
4
- import './options-B9bqXmm1.mjs';
1
+ export { c as createPlugins } from './index-DoMb0-xW.mjs';
2
+ export { U as UnifiedViteWeappTailwindcssPlugin } from './index-C0QsyqD6.mjs';
3
+ export { U as UnifiedWebpackPluginV5 } from './v5-N5BYJ5JY.mjs';
4
+ import './options-yXyCFCtr.mjs';
5
5
  import 'lru-cache';
6
6
  import 'md5';
7
7
  import './defaults-5A8JI2hW.mjs';
@@ -241,6 +241,7 @@ function replaceHandleValue(str, node, options, ms, offset = 0) {
241
241
  return rawStr;
242
242
  }
243
243
 
244
+ const ignoreIdentifier = 'weappTwIgnore';
244
245
  function astGrepUpdateString(ast, options, ms) {
245
246
  return __awaiter(this, void 0, void 0, function* () {
246
247
  const js = yield getAstGrep();
@@ -255,6 +256,13 @@ function astGrepUpdateString(ast, options, ms) {
255
256
  }
256
257
  const templateNodes = ast.findAll(js.kind('template_string'));
257
258
  for (const node of templateNodes) {
259
+ const p = node.parent();
260
+ if (p && p.kind() === 'call_expression') {
261
+ const c = p.child(0);
262
+ if (c && c.kind() === 'identifier' && c.text() === ignoreIdentifier) {
263
+ continue;
264
+ }
265
+ }
258
266
  const fragments = node.findAll(js.kind('string_fragment'));
259
267
  for (const fragment of fragments) {
260
268
  const range = fragment.range();
@@ -292,8 +300,14 @@ function jsHandler(rawSource, options) {
292
300
  },
293
301
  TemplateElement: {
294
302
  enter(p) {
295
- if (p.parentPath.isTemplateLiteral() && isEvalPath(p.parentPath.parentPath)) {
296
- return;
303
+ if (p.parentPath.isTemplateLiteral()) {
304
+ if ((p.parentPath.parentPath.isTaggedTemplateExpression()
305
+ && p.parentPath.parentPath.get('tag').isIdentifier({
306
+ name: ignoreIdentifier,
307
+ }))
308
+ || isEvalPath(p.parentPath.parentPath)) {
309
+ return;
310
+ }
297
311
  }
298
312
  const n = p.node;
299
313
  replaceHandleValue(n.value.raw, n, Object.assign(Object.assign({}, options), { needEscaped: false }), ms, 0);
@@ -210,6 +210,7 @@ function replaceHandleValue(str, node, options, ms, offset = 0) {
210
210
  return rawStr;
211
211
  }
212
212
 
213
+ const ignoreIdentifier = 'weappTwIgnore';
213
214
  function astGrepUpdateString(ast, options, ms) {
214
215
  return __awaiter(this, void 0, void 0, function* () {
215
216
  const js = yield getAstGrep();
@@ -224,6 +225,13 @@ function astGrepUpdateString(ast, options, ms) {
224
225
  }
225
226
  const templateNodes = ast.findAll(js.kind('template_string'));
226
227
  for (const node of templateNodes) {
228
+ const p = node.parent();
229
+ if (p && p.kind() === 'call_expression') {
230
+ const c = p.child(0);
231
+ if (c && c.kind() === 'identifier' && c.text() === ignoreIdentifier) {
232
+ continue;
233
+ }
234
+ }
227
235
  const fragments = node.findAll(js.kind('string_fragment'));
228
236
  for (const fragment of fragments) {
229
237
  const range = fragment.range();
@@ -261,8 +269,14 @@ function jsHandler(rawSource, options) {
261
269
  },
262
270
  TemplateElement: {
263
271
  enter(p) {
264
- if (p.parentPath.isTemplateLiteral() && isEvalPath(p.parentPath.parentPath)) {
265
- return;
272
+ if (p.parentPath.isTemplateLiteral()) {
273
+ if ((p.parentPath.parentPath.isTaggedTemplateExpression()
274
+ && p.parentPath.parentPath.get('tag').isIdentifier({
275
+ name: ignoreIdentifier,
276
+ }))
277
+ || isEvalPath(p.parentPath.parentPath)) {
278
+ return;
279
+ }
266
280
  }
267
281
  const n = p.node;
268
282
  replaceHandleValue(n.value.raw, n, Object.assign(Object.assign({}, options), { needEscaped: false }), ms, 0);
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var options = require('./options-DW1MHPWk.js');
3
+ var options = require('./options-Bv-1GQJY.js');
4
4
  var fs = require('node:fs');
5
5
  var path = require('node:path');
6
6
  var index = require('./index-h2-ZMO3S.js');
@@ -1,4 +1,4 @@
1
- import { g as getOptions, _ as __awaiter } from './options-B9bqXmm1.mjs';
1
+ import { g as getOptions, _ as __awaiter } from './options-yXyCFCtr.mjs';
2
2
  import fs from 'node:fs';
3
3
  import path from 'node:path';
4
4
  import { b as pluginName } from './index-BF8k8rHr.mjs';
package/dist/vite.js CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./index-Da8_sCz_.js');
6
- require('./options-DW1MHPWk.js');
5
+ var index = require('./index-BTXkyxen.js');
6
+ require('./options-Bv-1GQJY.js');
7
7
  require('lru-cache');
8
8
  require('md5');
9
9
  require('./defaults-CdqzSWsR.js');
package/dist/vite.mjs CHANGED
@@ -1,5 +1,5 @@
1
- export { U as UnifiedViteWeappTailwindcssPlugin } from './index-DQWPK2Gk.mjs';
2
- import './options-B9bqXmm1.mjs';
1
+ export { U as UnifiedViteWeappTailwindcssPlugin } from './index-C0QsyqD6.mjs';
2
+ import './options-yXyCFCtr.mjs';
3
3
  import 'lru-cache';
4
4
  import 'md5';
5
5
  import './defaults-5A8JI2hW.mjs';
package/dist/webpack.js CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var v5 = require('./v5-Bil5avxf.js');
6
- require('./options-DW1MHPWk.js');
5
+ var v5 = require('./v5-DwFXG7m_.js');
6
+ require('./options-Bv-1GQJY.js');
7
7
  require('lru-cache');
8
8
  require('md5');
9
9
  require('./defaults-CdqzSWsR.js');
package/dist/webpack.mjs CHANGED
@@ -1,5 +1,5 @@
1
- export { U as UnifiedWebpackPluginV5 } from './v5-D0HXtisF.mjs';
2
- import './options-B9bqXmm1.mjs';
1
+ export { U as UnifiedWebpackPluginV5 } from './v5-N5BYJ5JY.mjs';
2
+ import './options-yXyCFCtr.mjs';
3
3
  import 'lru-cache';
4
4
  import 'md5';
5
5
  import './defaults-5A8JI2hW.mjs';
package/dist/webpack4.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var options = require('./options-DW1MHPWk.js');
5
+ var options = require('./options-Bv-1GQJY.js');
6
6
  var fs = require('node:fs');
7
7
  var path = require('node:path');
8
8
  var webpackSources = require('webpack-sources');
package/dist/webpack4.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { g as getOptions, _ as __awaiter } from './options-B9bqXmm1.mjs';
1
+ import { g as getOptions, _ as __awaiter } from './options-yXyCFCtr.mjs';
2
2
  import fs from 'node:fs';
3
3
  import path from 'node:path';
4
4
  import { ConcatSource, RawSource } from 'webpack-sources';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weapp-tailwindcss",
3
- "version": "3.7.0-alpha.1",
3
+ "version": "3.7.0",
4
4
  "description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
5
5
  "author": "ice breaker <1324318532@qq.com>",
6
6
  "license": "MIT",