weapp-tailwindcss 2.3.3
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/LICENSE +21 -0
- package/README.md +674 -0
- package/bin/weapp-tailwindcss.js +7 -0
- package/dist/babel/index.d.ts +4 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +26 -0
- package/dist/cli.mjs +24 -0
- package/dist/constants.d.ts +6 -0
- package/dist/defaults.d.ts +2 -0
- package/dist/dic.d.ts +44 -0
- package/dist/env.d.ts +2 -0
- package/dist/escape.d.ts +3 -0
- package/dist/extractors/split.d.ts +3 -0
- package/dist/gulp/index.d.ts +8 -0
- package/dist/gulp.d.ts +1 -0
- package/dist/gulp.js +86 -0
- package/dist/gulp.mjs +78 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +31 -0
- package/dist/index.mjs +21 -0
- package/dist/js/index.d.ts +5 -0
- package/dist/mangle/store.d.ts +15 -0
- package/dist/options-3a695e84.js +574 -0
- package/dist/options-ed6f4a3a.mjs +542 -0
- package/dist/options.d.ts +4 -0
- package/dist/postcss/index.d.ts +3 -0
- package/dist/postcss/mp.d.ts +4 -0
- package/dist/postcss/plugin.d.ts +6 -0
- package/dist/postcss/preflight.d.ts +3 -0
- package/dist/postcss/selectorParser.d.ts +3 -0
- package/dist/postcss/shared.d.ts +1 -0
- package/dist/postcss-1f9a5153.mjs +105 -0
- package/dist/postcss-dc9eeafc.js +114 -0
- package/dist/postcss.d.ts +1 -0
- package/dist/postcss.js +22 -0
- package/dist/postcss.mjs +6 -0
- package/dist/reg.d.ts +26 -0
- package/dist/replace.d.ts +4 -0
- package/dist/replace.js +36 -0
- package/dist/replace.mjs +27 -0
- package/dist/shared-c2953d9d.js +354 -0
- package/dist/shared-eae1dc7a.mjs +333 -0
- package/dist/tailwindcss/patcher.d.ts +8 -0
- package/dist/tailwindcss/supportCustomUnit.d.ts +6 -0
- package/dist/types.d.ts +118 -0
- package/dist/utils.d.ts +9 -0
- package/dist/vite/index.d.ts +3 -0
- package/dist/vite.d.ts +1 -0
- package/dist/vite.js +82 -0
- package/dist/vite.mjs +78 -0
- package/dist/webpack/BaseUnifiedPlugin/v5.d.ts +9 -0
- package/dist/webpack/index.d.ts +1 -0
- package/dist/webpack.d.ts +1 -0
- package/dist/webpack.js +101 -0
- package/dist/webpack.mjs +97 -0
- package/dist/wxml/index.d.ts +3 -0
- package/dist/wxml/shared.d.ts +2 -0
- package/dist/wxml/utils.d.ts +7 -0
- package/package.json +224 -0
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var options = require('./options-3a695e84.js');
|
|
4
|
+
require('./shared-c2953d9d.js');
|
|
5
|
+
require('tailwindcss-mangle-shared');
|
|
6
|
+
require('micromatch');
|
|
7
|
+
require('@babel/generator');
|
|
8
|
+
require('@babel/parser');
|
|
9
|
+
require('@babel/traverse');
|
|
10
|
+
require('./replace.js');
|
|
11
|
+
require('@babel/types');
|
|
12
|
+
require('postcss');
|
|
13
|
+
require('./postcss-dc9eeafc.js');
|
|
14
|
+
require('postcss-selector-parser');
|
|
15
|
+
require('@csstools/postcss-is-pseudo-class');
|
|
16
|
+
require('path');
|
|
17
|
+
require('fs');
|
|
18
|
+
require('semver');
|
|
19
|
+
require('tailwindcss-patch');
|
|
20
|
+
|
|
21
|
+
const args = process.argv.slice(2);
|
|
22
|
+
if (args[0] === 'patch') {
|
|
23
|
+
const options$1 = options.getOptions();
|
|
24
|
+
const patch = options.createPatch(options$1.supportCustomLengthUnitsPatch);
|
|
25
|
+
patch();
|
|
26
|
+
}
|
package/dist/cli.mjs
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { g as getOptions, c as createPatch } from './options-ed6f4a3a.mjs';
|
|
2
|
+
import './shared-eae1dc7a.mjs';
|
|
3
|
+
import 'tailwindcss-mangle-shared';
|
|
4
|
+
import 'micromatch';
|
|
5
|
+
import '@babel/generator';
|
|
6
|
+
import '@babel/parser';
|
|
7
|
+
import '@babel/traverse';
|
|
8
|
+
import './replace.mjs';
|
|
9
|
+
import '@babel/types';
|
|
10
|
+
import 'postcss';
|
|
11
|
+
import './postcss-1f9a5153.mjs';
|
|
12
|
+
import 'postcss-selector-parser';
|
|
13
|
+
import '@csstools/postcss-is-pseudo-class';
|
|
14
|
+
import 'path';
|
|
15
|
+
import 'fs';
|
|
16
|
+
import 'semver';
|
|
17
|
+
import 'tailwindcss-patch';
|
|
18
|
+
|
|
19
|
+
const args = process.argv.slice(2);
|
|
20
|
+
if (args[0] === 'patch') {
|
|
21
|
+
const options = getOptions();
|
|
22
|
+
const patch = createPatch(options.supportCustomLengthUnitsPatch);
|
|
23
|
+
patch();
|
|
24
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const NS = "jsx-rename-loader";
|
|
2
|
+
export declare const postcssPlugin = "postcss-weapp-tailwindcss-rename-plugin";
|
|
3
|
+
export declare const ManglePluginHooks = "ManglePluginHooks";
|
|
4
|
+
export declare const WeappTailwindcssWebpackPluginOptimizeChunkAssetsHooks = "WeappTailwindcssWebpackPluginOptimizeChunkAssetsHooks";
|
|
5
|
+
export declare const pluginName = "weapp-tailwindcss-webpack-plugin";
|
|
6
|
+
export declare const vitePluginName = "vite-plugin-uni-app-weapp-tailwindcss-adaptor";
|
package/dist/dic.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export declare const SYMBOL_TABLE: {
|
|
2
|
+
readonly BACKQUOTE: "`";
|
|
3
|
+
readonly TILDE: "~";
|
|
4
|
+
readonly EXCLAM: "!";
|
|
5
|
+
readonly AT: "@";
|
|
6
|
+
readonly NUMBERSIGN: "#";
|
|
7
|
+
readonly DOLLAR: "$";
|
|
8
|
+
readonly PERCENT: "%";
|
|
9
|
+
readonly CARET: "^";
|
|
10
|
+
readonly AMPERSAND: "&";
|
|
11
|
+
readonly ASTERISK: "*";
|
|
12
|
+
readonly PARENLEFT: "(";
|
|
13
|
+
readonly PARENRIGHT: ")";
|
|
14
|
+
readonly MINUS: "-";
|
|
15
|
+
readonly UNDERSCORE: "_";
|
|
16
|
+
readonly EQUAL: "=";
|
|
17
|
+
readonly PLUS: "+";
|
|
18
|
+
readonly BRACKETLEFT: "[";
|
|
19
|
+
readonly BRACELEFT: "{";
|
|
20
|
+
readonly BRACKETRIGHT: "]";
|
|
21
|
+
readonly BRACERIGHT: "}";
|
|
22
|
+
readonly SEMICOLON: ";";
|
|
23
|
+
readonly COLON: ":";
|
|
24
|
+
readonly QUOTE: "'";
|
|
25
|
+
readonly DOUBLEQUOTE: "\"";
|
|
26
|
+
readonly BACKSLASH: "\\";
|
|
27
|
+
readonly BAR: "|";
|
|
28
|
+
readonly COMMA: ",";
|
|
29
|
+
readonly LESS: "<";
|
|
30
|
+
readonly PERIOD: ".";
|
|
31
|
+
readonly GREATER: ">";
|
|
32
|
+
readonly SLASH: "/";
|
|
33
|
+
readonly QUESTION: "?";
|
|
34
|
+
readonly SPACE: " ";
|
|
35
|
+
readonly DOT: ".";
|
|
36
|
+
readonly HASH: "#";
|
|
37
|
+
};
|
|
38
|
+
export type SYMBOL_TABLE_TYPE = typeof SYMBOL_TABLE;
|
|
39
|
+
export type SYMBOL_TABLE_TYPE_VALUES = SYMBOL_TABLE_TYPE[keyof SYMBOL_TABLE_TYPE];
|
|
40
|
+
export type MappingStringDictionary = Record<Exclude<SYMBOL_TABLE_TYPE_VALUES, '-' | '_' | ' '>, string>;
|
|
41
|
+
export declare const MappingChars2String: MappingStringDictionary;
|
|
42
|
+
export declare const MappingChars2StringEntries: [string, string][];
|
|
43
|
+
export declare const SimpleMappingChars2String: MappingStringDictionary;
|
|
44
|
+
export declare const SimpleMappingChars2StringEntries: [string, string][];
|
package/dist/env.d.ts
ADDED
package/dist/escape.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { UserDefinedOptions } from "../types";
|
|
3
|
+
import stream from 'stream';
|
|
4
|
+
export declare function createPlugins(options?: UserDefinedOptions): {
|
|
5
|
+
transformWxss: () => stream.Transform;
|
|
6
|
+
transformWxml: () => stream.Transform;
|
|
7
|
+
transformJs: () => stream.Transform;
|
|
8
|
+
};
|
package/dist/gulp.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './gulp/index';
|
package/dist/gulp.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var options = require('./options-3a695e84.js');
|
|
6
|
+
var stream = require('stream');
|
|
7
|
+
var shared = require('./shared-c2953d9d.js');
|
|
8
|
+
require('micromatch');
|
|
9
|
+
require('@babel/generator');
|
|
10
|
+
require('@babel/parser');
|
|
11
|
+
require('@babel/traverse');
|
|
12
|
+
require('./replace.js');
|
|
13
|
+
require('@babel/types');
|
|
14
|
+
require('postcss');
|
|
15
|
+
require('./postcss-dc9eeafc.js');
|
|
16
|
+
require('postcss-selector-parser');
|
|
17
|
+
require('@csstools/postcss-is-pseudo-class');
|
|
18
|
+
require('path');
|
|
19
|
+
require('fs');
|
|
20
|
+
require('semver');
|
|
21
|
+
require('tailwindcss-patch');
|
|
22
|
+
require('tailwindcss-mangle-shared');
|
|
23
|
+
|
|
24
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
25
|
+
|
|
26
|
+
var stream__default = /*#__PURE__*/_interopDefaultCompat(stream);
|
|
27
|
+
|
|
28
|
+
const Transform = stream__default["default"].Transform;
|
|
29
|
+
function createPlugins(options$1 = {}) {
|
|
30
|
+
if (typeof options$1.customReplaceDictionary === 'undefined') {
|
|
31
|
+
options$1.customReplaceDictionary = 'simple';
|
|
32
|
+
}
|
|
33
|
+
const opts = options.getOptions(options$1, ['patch', 'style', 'templete', 'js']);
|
|
34
|
+
const { templeteHandler, styleHandler, patch, jsHandler, mangle } = opts;
|
|
35
|
+
let set = new Set();
|
|
36
|
+
patch === null || patch === void 0 ? void 0 : patch();
|
|
37
|
+
shared.initStore(mangle);
|
|
38
|
+
const twPatcher = options.createTailwindcssPatcher();
|
|
39
|
+
function transformWxss() {
|
|
40
|
+
const transformStream = new Transform({ objectMode: true });
|
|
41
|
+
transformStream._transform = function (file, encoding, callback) {
|
|
42
|
+
set = twPatcher.getClassSet();
|
|
43
|
+
shared.setRuntimeSet(set);
|
|
44
|
+
const error = null;
|
|
45
|
+
if (file.contents) {
|
|
46
|
+
const code = styleHandler(file.contents.toString(), {
|
|
47
|
+
isMainChunk: true
|
|
48
|
+
});
|
|
49
|
+
file.contents = Buffer.from(code);
|
|
50
|
+
}
|
|
51
|
+
callback(error, file);
|
|
52
|
+
};
|
|
53
|
+
return transformStream;
|
|
54
|
+
}
|
|
55
|
+
function transformJs() {
|
|
56
|
+
const transformStream = new Transform({ objectMode: true });
|
|
57
|
+
transformStream._transform = function (file, encoding, callback) {
|
|
58
|
+
const error = null;
|
|
59
|
+
if (file.contents) {
|
|
60
|
+
const { code } = jsHandler(file.contents.toString(), set);
|
|
61
|
+
file.contents = Buffer.from(code);
|
|
62
|
+
}
|
|
63
|
+
callback(error, file);
|
|
64
|
+
};
|
|
65
|
+
return transformStream;
|
|
66
|
+
}
|
|
67
|
+
function transformWxml() {
|
|
68
|
+
const transformStream = new Transform({ objectMode: true });
|
|
69
|
+
transformStream._transform = function (file, encoding, callback) {
|
|
70
|
+
const error = null;
|
|
71
|
+
if (file.contents) {
|
|
72
|
+
const code = templeteHandler(file.contents.toString());
|
|
73
|
+
file.contents = Buffer.from(code);
|
|
74
|
+
}
|
|
75
|
+
callback(error, file);
|
|
76
|
+
};
|
|
77
|
+
return transformStream;
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
transformWxss,
|
|
81
|
+
transformWxml,
|
|
82
|
+
transformJs
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
exports.createPlugins = createPlugins;
|
package/dist/gulp.mjs
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { g as getOptions, a as createTailwindcssPatcher } from './options-ed6f4a3a.mjs';
|
|
2
|
+
import stream from 'stream';
|
|
3
|
+
import { c as initStore, d as setRuntimeSet } from './shared-eae1dc7a.mjs';
|
|
4
|
+
import 'micromatch';
|
|
5
|
+
import '@babel/generator';
|
|
6
|
+
import '@babel/parser';
|
|
7
|
+
import '@babel/traverse';
|
|
8
|
+
import './replace.mjs';
|
|
9
|
+
import '@babel/types';
|
|
10
|
+
import 'postcss';
|
|
11
|
+
import './postcss-1f9a5153.mjs';
|
|
12
|
+
import 'postcss-selector-parser';
|
|
13
|
+
import '@csstools/postcss-is-pseudo-class';
|
|
14
|
+
import 'path';
|
|
15
|
+
import 'fs';
|
|
16
|
+
import 'semver';
|
|
17
|
+
import 'tailwindcss-patch';
|
|
18
|
+
import 'tailwindcss-mangle-shared';
|
|
19
|
+
|
|
20
|
+
const Transform = stream.Transform;
|
|
21
|
+
function createPlugins(options = {}) {
|
|
22
|
+
if (typeof options.customReplaceDictionary === 'undefined') {
|
|
23
|
+
options.customReplaceDictionary = 'simple';
|
|
24
|
+
}
|
|
25
|
+
const opts = getOptions(options, ['patch', 'style', 'templete', 'js']);
|
|
26
|
+
const { templeteHandler, styleHandler, patch, jsHandler, mangle } = opts;
|
|
27
|
+
let set = new Set();
|
|
28
|
+
patch === null || patch === void 0 ? void 0 : patch();
|
|
29
|
+
initStore(mangle);
|
|
30
|
+
const twPatcher = createTailwindcssPatcher();
|
|
31
|
+
function transformWxss() {
|
|
32
|
+
const transformStream = new Transform({ objectMode: true });
|
|
33
|
+
transformStream._transform = function (file, encoding, callback) {
|
|
34
|
+
set = twPatcher.getClassSet();
|
|
35
|
+
setRuntimeSet(set);
|
|
36
|
+
const error = null;
|
|
37
|
+
if (file.contents) {
|
|
38
|
+
const code = styleHandler(file.contents.toString(), {
|
|
39
|
+
isMainChunk: true
|
|
40
|
+
});
|
|
41
|
+
file.contents = Buffer.from(code);
|
|
42
|
+
}
|
|
43
|
+
callback(error, file);
|
|
44
|
+
};
|
|
45
|
+
return transformStream;
|
|
46
|
+
}
|
|
47
|
+
function transformJs() {
|
|
48
|
+
const transformStream = new Transform({ objectMode: true });
|
|
49
|
+
transformStream._transform = function (file, encoding, callback) {
|
|
50
|
+
const error = null;
|
|
51
|
+
if (file.contents) {
|
|
52
|
+
const { code } = jsHandler(file.contents.toString(), set);
|
|
53
|
+
file.contents = Buffer.from(code);
|
|
54
|
+
}
|
|
55
|
+
callback(error, file);
|
|
56
|
+
};
|
|
57
|
+
return transformStream;
|
|
58
|
+
}
|
|
59
|
+
function transformWxml() {
|
|
60
|
+
const transformStream = new Transform({ objectMode: true });
|
|
61
|
+
transformStream._transform = function (file, encoding, callback) {
|
|
62
|
+
const error = null;
|
|
63
|
+
if (file.contents) {
|
|
64
|
+
const code = templeteHandler(file.contents.toString());
|
|
65
|
+
file.contents = Buffer.from(code);
|
|
66
|
+
}
|
|
67
|
+
callback(error, file);
|
|
68
|
+
};
|
|
69
|
+
return transformStream;
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
transformWxss,
|
|
73
|
+
transformWxml,
|
|
74
|
+
transformJs
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export { createPlugins };
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var webpack = require('./webpack.js');
|
|
6
|
+
var vite = require('./vite.js');
|
|
7
|
+
var gulp = require('./gulp.js');
|
|
8
|
+
require('./options-3a695e84.js');
|
|
9
|
+
require('./shared-c2953d9d.js');
|
|
10
|
+
require('tailwindcss-mangle-shared');
|
|
11
|
+
require('micromatch');
|
|
12
|
+
require('@babel/generator');
|
|
13
|
+
require('@babel/parser');
|
|
14
|
+
require('@babel/traverse');
|
|
15
|
+
require('./replace.js');
|
|
16
|
+
require('@babel/types');
|
|
17
|
+
require('postcss');
|
|
18
|
+
require('./postcss-dc9eeafc.js');
|
|
19
|
+
require('postcss-selector-parser');
|
|
20
|
+
require('@csstools/postcss-is-pseudo-class');
|
|
21
|
+
require('path');
|
|
22
|
+
require('fs');
|
|
23
|
+
require('semver');
|
|
24
|
+
require('tailwindcss-patch');
|
|
25
|
+
require('stream');
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
exports.UnifiedWebpackPluginV5 = webpack.UnifiedWebpackPluginV5;
|
|
30
|
+
exports.UnifiedViteWeappTailwindcssPlugin = vite.UnifiedViteWeappTailwindcssPlugin;
|
|
31
|
+
exports.createPlugins = gulp.createPlugins;
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { UnifiedWebpackPluginV5 } from './webpack.mjs';
|
|
2
|
+
export { UnifiedViteWeappTailwindcssPlugin } from './vite.mjs';
|
|
3
|
+
export { createPlugins } from './gulp.mjs';
|
|
4
|
+
import './options-ed6f4a3a.mjs';
|
|
5
|
+
import './shared-eae1dc7a.mjs';
|
|
6
|
+
import 'tailwindcss-mangle-shared';
|
|
7
|
+
import 'micromatch';
|
|
8
|
+
import '@babel/generator';
|
|
9
|
+
import '@babel/parser';
|
|
10
|
+
import '@babel/traverse';
|
|
11
|
+
import './replace.mjs';
|
|
12
|
+
import '@babel/types';
|
|
13
|
+
import 'postcss';
|
|
14
|
+
import './postcss-1f9a5153.mjs';
|
|
15
|
+
import 'postcss-selector-parser';
|
|
16
|
+
import '@csstools/postcss-is-pseudo-class';
|
|
17
|
+
import 'path';
|
|
18
|
+
import 'fs';
|
|
19
|
+
import 'semver';
|
|
20
|
+
import 'tailwindcss-patch';
|
|
21
|
+
import 'stream';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IJsHandlerOptions } from "../types";
|
|
2
|
+
import type { StringLiteral, TemplateElement } from '@babel/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;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ClassGenerator } from 'tailwindcss-mangle-shared';
|
|
2
|
+
import { UserDefinedOptions } from "../types";
|
|
3
|
+
export interface IMangleScopeStore {
|
|
4
|
+
rawOptions: UserDefinedOptions['mangle'];
|
|
5
|
+
runtimeSet: Set<string>;
|
|
6
|
+
classGenerator: ClassGenerator;
|
|
7
|
+
filter: (className: string) => boolean;
|
|
8
|
+
cssHandler: (rawSource: string) => string;
|
|
9
|
+
jsHandler: (rawSource: string) => string;
|
|
10
|
+
wxmlHandler: (rawSource: string) => string;
|
|
11
|
+
}
|
|
12
|
+
export declare function useStore(): IMangleScopeStore;
|
|
13
|
+
export declare function resetStore(): IMangleScopeStore;
|
|
14
|
+
export declare function initStore(options: UserDefinedOptions['mangle']): void;
|
|
15
|
+
export declare function setRuntimeSet(runtimeSet: Set<string>): void;
|