@htyf-mp/taro-rn-style-transformer 0.0.2
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 +174 -0
- package/dist/config/rn-stylelint.json +4 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +86 -0
- package/dist/index.js.map +1 -0
- package/dist/transforms/StyleSheet/ColorPropType.d.ts +10 -0
- package/dist/transforms/StyleSheet/ColorPropType.js +76 -0
- package/dist/transforms/StyleSheet/ColorPropType.js.map +1 -0
- package/dist/transforms/StyleSheet/ImageResizeMode.d.ts +6 -0
- package/dist/transforms/StyleSheet/ImageResizeMode.js +54 -0
- package/dist/transforms/StyleSheet/ImageResizeMode.js.map +1 -0
- package/dist/transforms/StyleSheet/ImageStylePropTypes.d.ts +106 -0
- package/dist/transforms/StyleSheet/ImageStylePropTypes.js +81 -0
- package/dist/transforms/StyleSheet/ImageStylePropTypes.js.map +1 -0
- package/dist/transforms/StyleSheet/LayoutPropTypes.d.ts +399 -0
- package/dist/transforms/StyleSheet/LayoutPropTypes.js +566 -0
- package/dist/transforms/StyleSheet/LayoutPropTypes.js.map +1 -0
- package/dist/transforms/StyleSheet/ShadowPropTypesIOS.d.ts +32 -0
- package/dist/transforms/StyleSheet/ShadowPropTypesIOS.js +86 -0
- package/dist/transforms/StyleSheet/ShadowPropTypesIOS.js.map +1 -0
- package/dist/transforms/StyleSheet/StyleSheetValidation.d.ts +15 -0
- package/dist/transforms/StyleSheet/StyleSheetValidation.js +71 -0
- package/dist/transforms/StyleSheet/StyleSheetValidation.js.map +1 -0
- package/dist/transforms/StyleSheet/TextStylePropTypes.d.ts +154 -0
- package/dist/transforms/StyleSheet/TextStylePropTypes.js +127 -0
- package/dist/transforms/StyleSheet/TextStylePropTypes.js.map +1 -0
- package/dist/transforms/StyleSheet/TransformPropTypes.d.ts +45 -0
- package/dist/transforms/StyleSheet/TransformPropTypes.js +129 -0
- package/dist/transforms/StyleSheet/TransformPropTypes.js.map +1 -0
- package/dist/transforms/StyleSheet/ViewStylePropTypes.d.ts +126 -0
- package/dist/transforms/StyleSheet/ViewStylePropTypes.js +72 -0
- package/dist/transforms/StyleSheet/ViewStylePropTypes.js.map +1 -0
- package/dist/transforms/StyleSheet/deprecatedPropType.d.ts +13 -0
- package/dist/transforms/StyleSheet/deprecatedPropType.js +32 -0
- package/dist/transforms/StyleSheet/deprecatedPropType.js.map +1 -0
- package/dist/transforms/StyleSheet/index.d.ts +2 -0
- package/dist/transforms/StyleSheet/index.js +9 -0
- package/dist/transforms/StyleSheet/index.js.map +1 -0
- package/dist/transforms/StyleSheet/normalizeColor.d.ts +10 -0
- package/dist/transforms/StyleSheet/normalizeColor.js +341 -0
- package/dist/transforms/StyleSheet/normalizeColor.js.map +1 -0
- package/dist/transforms/index.d.ts +56 -0
- package/dist/transforms/index.js +221 -0
- package/dist/transforms/index.js.map +1 -0
- package/dist/transforms/less.d.ts +2 -0
- package/dist/transforms/less.js +70 -0
- package/dist/transforms/less.js.map +1 -0
- package/dist/transforms/postcss.d.ts +13 -0
- package/dist/transforms/postcss.js +135 -0
- package/dist/transforms/postcss.js.map +1 -0
- package/dist/transforms/sass.d.ts +2 -0
- package/dist/transforms/sass.js +162 -0
- package/dist/transforms/sass.js.map +1 -0
- package/dist/transforms/stylus.d.ts +3 -0
- package/dist/transforms/stylus.js +110 -0
- package/dist/transforms/stylus.js.map +1 -0
- package/dist/types/index.d.ts +205 -0
- package/dist/types/index.js +6 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/index.d.ts +21 -0
- package/dist/utils/index.js +240 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/lessImport.d.ts +5 -0
- package/dist/utils/lessImport.js +45 -0
- package/dist/utils/lessImport.js.map +1 -0
- package/dist/utils/reporterSkip.d.ts +7 -0
- package/dist/utils/reporterSkip.js +27 -0
- package/dist/utils/reporterSkip.js.map +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.default = transform;
|
|
37
|
+
const fs = __importStar(require("node:fs"));
|
|
38
|
+
const path = __importStar(require("node:path"));
|
|
39
|
+
const utils_1 = require("../utils");
|
|
40
|
+
/**
|
|
41
|
+
* 用过用户手动安装了 node-sass,启用node-sass,默认使用 sass
|
|
42
|
+
*/
|
|
43
|
+
function getSassImplementation() {
|
|
44
|
+
let sassImplPkg = 'node-sass';
|
|
45
|
+
try {
|
|
46
|
+
require.resolve('node-sass');
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
try {
|
|
50
|
+
require.resolve('sass');
|
|
51
|
+
sassImplPkg = 'sass';
|
|
52
|
+
}
|
|
53
|
+
catch (ignoreError) {
|
|
54
|
+
sassImplPkg = 'sass';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return require(sassImplPkg);
|
|
58
|
+
}
|
|
59
|
+
const sassImplementation = getSassImplementation();
|
|
60
|
+
function makeURL(resource, rootDir) {
|
|
61
|
+
const url = path.resolve(rootDir, resource);
|
|
62
|
+
if (!fs.existsSync(url)) {
|
|
63
|
+
throw new Error(`全局注入 scss 文件路径错误: ${url}`);
|
|
64
|
+
}
|
|
65
|
+
return url;
|
|
66
|
+
}
|
|
67
|
+
function makeImportStatement(filePath, resource, rootDir) {
|
|
68
|
+
const url = makeURL(resource, rootDir);
|
|
69
|
+
const relativePath = path.relative(filePath, url).replace(/\\/g, '/'); // fix window path error
|
|
70
|
+
return `@import './${relativePath}'`;
|
|
71
|
+
}
|
|
72
|
+
function getGlobalResource(filename, config) {
|
|
73
|
+
var _a;
|
|
74
|
+
let resource = '';
|
|
75
|
+
const projectDirectory = config.projectDirectory || process.cwd();
|
|
76
|
+
const filePath = path.dirname(path.resolve(projectDirectory, filename));
|
|
77
|
+
if (typeof config.resource === 'string') {
|
|
78
|
+
resource = makeImportStatement(filePath, config.resource, projectDirectory);
|
|
79
|
+
}
|
|
80
|
+
if (Array.isArray(config.resource)) {
|
|
81
|
+
const resources = ((_a = config.resource) === null || _a === void 0 ? void 0 : _a.map(source => makeImportStatement(filePath, source, projectDirectory))) || [];
|
|
82
|
+
resource = resources.join(';\n');
|
|
83
|
+
}
|
|
84
|
+
// https://taro-docs.jd.com/taro/docs/config-detail/#sassdata, data 覆盖 resurce 配置
|
|
85
|
+
return (0, utils_1.insertAfter)(resource, config === null || config === void 0 ? void 0 : config.data);
|
|
86
|
+
}
|
|
87
|
+
function combineResource(src, filename, config) {
|
|
88
|
+
// sass config
|
|
89
|
+
const globalResource = getGlobalResource(filename, config.sass || {});
|
|
90
|
+
// sass tranform config
|
|
91
|
+
const additionalData = (0, utils_1.getAdditionalData)(src, config.additionalData);
|
|
92
|
+
return (0, utils_1.insertAfter)(globalResource, additionalData);
|
|
93
|
+
}
|
|
94
|
+
// @ts-ignore
|
|
95
|
+
function renderToCSS(src, filename, options, transformOptions) {
|
|
96
|
+
const defaultOpts = {
|
|
97
|
+
// @ts-ignore
|
|
98
|
+
importer: function (...params) {
|
|
99
|
+
let [url, prev] = params;
|
|
100
|
+
// url is the path in import as is, which LibSass encountered.
|
|
101
|
+
// prev is the previously resolved path.
|
|
102
|
+
// done is an optional callback, either consume it or return value synchronously.
|
|
103
|
+
// this.options contains this options hash, this.callback contains the node-style callback
|
|
104
|
+
let basedir = '';
|
|
105
|
+
let defaultExt = '';
|
|
106
|
+
if (process.platform === 'win32') {
|
|
107
|
+
prev = decodeURIComponent(prev);
|
|
108
|
+
}
|
|
109
|
+
if (path.isAbsolute(prev)) {
|
|
110
|
+
({ dir: basedir, ext: defaultExt } = path.parse(prev));
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
({ dir: basedir, ext: defaultExt } = path.parse(path.resolve(process.cwd(), filename)));
|
|
114
|
+
}
|
|
115
|
+
// 外部 sass importer 配置
|
|
116
|
+
if (typeof options.importer === 'function') {
|
|
117
|
+
({ file: url } = options.importer(params));
|
|
118
|
+
}
|
|
119
|
+
try {
|
|
120
|
+
const file = (0, utils_1.resolveStyle)(url, {
|
|
121
|
+
basedir,
|
|
122
|
+
defaultExt,
|
|
123
|
+
alias: options.alias,
|
|
124
|
+
platform: transformOptions.platform
|
|
125
|
+
});
|
|
126
|
+
const contents = fs.readFileSync(file, 'utf8');
|
|
127
|
+
return { file, contents };
|
|
128
|
+
}
|
|
129
|
+
catch (err) {
|
|
130
|
+
return err;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
const opts = Object.assign(Object.assign(Object.assign({}, options), defaultOpts), { data: src });
|
|
135
|
+
return new Promise((resolve, reject) => {
|
|
136
|
+
// @ts-ignore
|
|
137
|
+
sassImplementation.render(opts, (err, result) => {
|
|
138
|
+
if (err) {
|
|
139
|
+
reject(err);
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
resolve(result);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
function transform(src, filename, config, transformOptions) {
|
|
148
|
+
const additionalData = combineResource(src, filename, config);
|
|
149
|
+
let data = (0, utils_1.insertBefore)(src, additionalData);
|
|
150
|
+
data = (0, utils_1.sortStyle)(data);
|
|
151
|
+
if (!data) {
|
|
152
|
+
data = `\n${data}`; // fix empty file error. reference https://github.com/sass/node-sass/blob/91c40a0bf0a3923ab9f91b82dcd479c25486235a/lib/index.js#L430
|
|
153
|
+
}
|
|
154
|
+
return renderToCSS(data, filename, Object.assign({
|
|
155
|
+
// file: filename, // fix[issues/11983]: with file option,dart-sass importer donot execute。
|
|
156
|
+
outFile: `${filename}.map`, sourceMap: true, alias: config.alias }, config.options), transformOptions
|
|
157
|
+
// @ts-ignore
|
|
158
|
+
).then((result) => {
|
|
159
|
+
return Object.assign(Object.assign({}, result), { additionalData });
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=sass.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sass.js","sourceRoot":"","sources":["../../src/transforms/sass.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,EAAE,oCAAe;AAC7B,MAAY,IAAI,sCAAiB;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AChE,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.defaultOptions = void 0;
|
|
7
|
+
exports.default = transform;
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
const stylus_1 = __importDefault(require("stylus"));
|
|
10
|
+
const utils_1 = require("../utils");
|
|
11
|
+
exports.defaultOptions = {
|
|
12
|
+
use: [],
|
|
13
|
+
include: [],
|
|
14
|
+
import: [],
|
|
15
|
+
define: {},
|
|
16
|
+
includeCSS: false,
|
|
17
|
+
// resolveURL: { nocheck: false },
|
|
18
|
+
lineNumbers: false,
|
|
19
|
+
hoistAtrules: false,
|
|
20
|
+
disableCache: false
|
|
21
|
+
};
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
function renderToCSS(src, filename, options = {}) {
|
|
24
|
+
const stylusOptions = Object.assign({ filename }, options);
|
|
25
|
+
const styl = (0, stylus_1.default)(src, stylusOptions);
|
|
26
|
+
styl.set('sourcemap', {
|
|
27
|
+
comment: true,
|
|
28
|
+
sourceRoot: '.', // stylusOptions.dest
|
|
29
|
+
basePath: '.'
|
|
30
|
+
});
|
|
31
|
+
// include regular CSS on @import
|
|
32
|
+
if (stylusOptions.includeCSS) {
|
|
33
|
+
styl.set('include css', true);
|
|
34
|
+
}
|
|
35
|
+
if (stylusOptions.hoistAtrules) {
|
|
36
|
+
styl.set('hoist atrules', true);
|
|
37
|
+
}
|
|
38
|
+
if (stylusOptions.lineNumbers) {
|
|
39
|
+
styl.set('linenos', true);
|
|
40
|
+
}
|
|
41
|
+
if (stylusOptions.disableCache) {
|
|
42
|
+
styl.set('cache', false);
|
|
43
|
+
}
|
|
44
|
+
if (typeof stylusOptions.use !== 'undefined' &&
|
|
45
|
+
stylusOptions.use.length > 0) {
|
|
46
|
+
let { length } = stylusOptions.use;
|
|
47
|
+
// eslint-disable-next-line no-plusplus
|
|
48
|
+
while (length--) {
|
|
49
|
+
const [item] = stylusOptions.use.splice(length, 1);
|
|
50
|
+
let useIn = item;
|
|
51
|
+
if (typeof item === 'string') {
|
|
52
|
+
try {
|
|
53
|
+
const resolved = require.resolve(item);
|
|
54
|
+
// eslint-disable-next-line import/no-dynamic-require, global-require
|
|
55
|
+
useIn = require(resolved)(stylusOptions);
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
const msg = `Failed to load "${item}" Stylus plugin.Are you sure it's installed?\n${error}`;
|
|
59
|
+
throw new Error(msg);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
styl.use(useIn);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (typeof stylusOptions.import !== 'undefined') {
|
|
66
|
+
for (const imported of stylusOptions.import) {
|
|
67
|
+
styl.import(imported);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (typeof stylusOptions.include !== 'undefined') {
|
|
71
|
+
for (const included of stylusOptions.include) {
|
|
72
|
+
styl.include(included);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// if (stylusOptions.resolveURL !== false) {
|
|
76
|
+
// styl.define('url', urlResolver(stylusOptions.resolveURL))
|
|
77
|
+
// }
|
|
78
|
+
if (typeof stylusOptions.define !== 'undefined') {
|
|
79
|
+
const definitions = Array.isArray(stylusOptions.define)
|
|
80
|
+
? stylusOptions.define
|
|
81
|
+
: Object.entries(stylusOptions.define);
|
|
82
|
+
for (const defined of definitions) {
|
|
83
|
+
styl.define.apply(null, defined);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return new Promise((resolve, reject) => {
|
|
87
|
+
// @ts-ignore
|
|
88
|
+
styl.render((err, css) => {
|
|
89
|
+
if (err) {
|
|
90
|
+
reject(err);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
resolve({
|
|
94
|
+
css,
|
|
95
|
+
map: styl.sourcemap
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function transform(src, filename, config) {
|
|
102
|
+
const additionalData = (0, utils_1.getAdditionalData)(src, config.additionalData);
|
|
103
|
+
const data = (0, utils_1.insertBefore)(src, additionalData);
|
|
104
|
+
return renderToCSS(data, filename, config.options
|
|
105
|
+
// @ts-ignore
|
|
106
|
+
).then((result) => {
|
|
107
|
+
return Object.assign(Object.assign({}, result), { additionalData });
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=stylus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stylus.js","sourceRoot":"","sources":["../../src/transforms/stylus.ts"],"names":[],"mappings":";;;;;;;AAAA,aAAa;AACb,oDAA2B;AAG3B,oCAA0D;AAE7C,QAAA,cAAc,GAAwB;IACjD,GAAG,EAAE,EAAE;IACP,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,EAAE;IACV,UAAU,EAAE,KAAK;IACjB,kCAAkC;IAClC,WAAW,EAAE,KAAK;IAClB,YAAY,EAAE,KAAK;IACnB,YAAY,EAAE,KAAK;CACpB,CAAA;AAED,aAAa;AACb,SAAS,WAAW,CAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,GAAG,EAAyB;IACtE,MAAM,aAAa,mBAAK,QAAQ,IAAK,OAAO,CAAE,CAAA;IAC9C,MAAM,IAAI,GAAG,IAAA,gBAAM,EAAC,GAAG,EAAE,aAAa,CAAC,CAAA;IAEvC,IAAI,CAAC,GAAG,CACN,WAAW,EACX;QACE,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,GAAG,EAAE,qBAAqB;QACtC,QAAQ,EAAE,GAAG;KACd,CACF,CAAA;IAED,iCAAiC;IACjC,IAAI,aAAa,CAAC,UAAU,EA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C;AAED,mBAAmC,GAAW,EAAE,QAAgB,EAAE,MAAoB;IACpF,MAAM,cAAc,GAAG,IAAA,yBAAiB,EAAC,GAAG,EAAE,MAAM,CAAC,cAAc,CAAC,CAAA;IACpE,MAAM,IAAI,GAAG,IAAA,oBAAY,EAAC,GAAG,EAAE,cAAc,CAAC,CAAA;IAE9C,OAAO,WAAW,CAChB,IAAI,EACJ,QAAQ,EACR,MAAM,CAAC,OAAO;IAClB,aAAa;KACV,CAAC,IAAI,CAAC,CAAC,MAAoB,EAAE,EAAE;QAC9B,OAAO,gCAAK,MAAM,KAAE,cAAc,GAA4B,CAAA;IAChE,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import type { ProcessOptions } from 'postcss';
|
|
2
|
+
import type { Options } from 'sass';
|
|
3
|
+
export interface SassConfig {
|
|
4
|
+
sass?: SassGlobalConfig;
|
|
5
|
+
alias?: Record<string, string>;
|
|
6
|
+
options: Options<'sync'>;
|
|
7
|
+
additionalData?: string | ((key: string) => string);
|
|
8
|
+
}
|
|
9
|
+
export interface SassGlobalConfig {
|
|
10
|
+
resource?: string | string[];
|
|
11
|
+
projectDirectory?: string;
|
|
12
|
+
data?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface PostcssConfig {
|
|
15
|
+
options: ProcessOptions;
|
|
16
|
+
scalable: boolean;
|
|
17
|
+
pxtransform?: {
|
|
18
|
+
enable: boolean;
|
|
19
|
+
config: any;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
interface SourceMapOption {
|
|
23
|
+
sourceMapURL?: string;
|
|
24
|
+
sourceMapBasepath?: string;
|
|
25
|
+
sourceMapRootpath?: string;
|
|
26
|
+
outputSourceFiles?: boolean;
|
|
27
|
+
sourceMapFileInline?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface LessOptions {
|
|
30
|
+
sourceMap?: SourceMapOption;
|
|
31
|
+
/** Filename of the main file to be passed to less.render() */
|
|
32
|
+
filename?: string;
|
|
33
|
+
/** The locations for less looking for files in @import rules */
|
|
34
|
+
paths?: string[];
|
|
35
|
+
/** True, if run the less parser and just reports errors without any output. */
|
|
36
|
+
lint?: boolean;
|
|
37
|
+
/** Pre-load global Less.js plugins */
|
|
38
|
+
plugins?: Plugin[];
|
|
39
|
+
/** @deprecated If true, compress using less built-in compression. */
|
|
40
|
+
compress?: boolean;
|
|
41
|
+
strictImports?: boolean;
|
|
42
|
+
/** If true, allow imports from insecure https hosts. */
|
|
43
|
+
insecure?: boolean;
|
|
44
|
+
depends?: boolean;
|
|
45
|
+
maxLineLen?: number;
|
|
46
|
+
/** @deprecated If false, No color in compiling. */
|
|
47
|
+
color?: boolean;
|
|
48
|
+
/** @deprecated False by default. */
|
|
49
|
+
ieCompat?: boolean;
|
|
50
|
+
/** @deprecated If true, enable evaluation of JavaScript inline in `.less` files. */
|
|
51
|
+
javascriptEnabled?: boolean;
|
|
52
|
+
/** Whether output file information and line numbers in compiled CSS code. */
|
|
53
|
+
dumpLineNumbers?: 'comment' | string;
|
|
54
|
+
/** Add a path to every generated import and url in output css files. */
|
|
55
|
+
rootpath?: string;
|
|
56
|
+
/** Math mode options for avoiding symbol conficts on math expressions. */
|
|
57
|
+
math?: 'always' | 'strict' | 'parens-division' | 'parens' | 'strict-legacy' | number;
|
|
58
|
+
/** If true, stops any warnings from being shown. */
|
|
59
|
+
silent?: boolean;
|
|
60
|
+
/** Without this option, Less attempts to guess at the output unit when it does maths. */
|
|
61
|
+
strictUnits?: boolean;
|
|
62
|
+
/** Defines a variable that can be referenced by the file. */
|
|
63
|
+
globalVars?: {
|
|
64
|
+
[key: string]: string;
|
|
65
|
+
};
|
|
66
|
+
/** Puts Var declaration at the end of base file. */
|
|
67
|
+
modifyVars?: {
|
|
68
|
+
[key: string]: string;
|
|
69
|
+
};
|
|
70
|
+
/** Read files synchronously in Node.js */
|
|
71
|
+
syncImport?: boolean;
|
|
72
|
+
}
|
|
73
|
+
export interface LessConfig {
|
|
74
|
+
alias?: Record<string, string>;
|
|
75
|
+
options: LessOptions;
|
|
76
|
+
additionalData?: string | ((key: string) => string);
|
|
77
|
+
}
|
|
78
|
+
declare class Evaluator {
|
|
79
|
+
}
|
|
80
|
+
interface Dictionary<T> {
|
|
81
|
+
[key: string]: T;
|
|
82
|
+
}
|
|
83
|
+
export interface StylusRenderOptions {
|
|
84
|
+
globals?: Dictionary<any>;
|
|
85
|
+
functions?: Dictionary<any>;
|
|
86
|
+
imports?: string[];
|
|
87
|
+
paths?: string[];
|
|
88
|
+
filename?: string;
|
|
89
|
+
Evaluator?: typeof Evaluator;
|
|
90
|
+
/**
|
|
91
|
+
* Specify Stylus plugins to use. Plugins may be passed as
|
|
92
|
+
* strings instead of importing them in your Webpack config.
|
|
93
|
+
*
|
|
94
|
+
* @type {(string|Function)[]}
|
|
95
|
+
* @default []
|
|
96
|
+
*/
|
|
97
|
+
use: (string | ((string: any) => string))[];
|
|
98
|
+
/**
|
|
99
|
+
* Add path(s) to the import lookup paths.
|
|
100
|
+
*
|
|
101
|
+
* @type {string[]}
|
|
102
|
+
* @default []
|
|
103
|
+
*/
|
|
104
|
+
include: string[];
|
|
105
|
+
/**
|
|
106
|
+
* Import the specified Stylus files/paths.
|
|
107
|
+
*
|
|
108
|
+
* @type {string[]}
|
|
109
|
+
* @default []
|
|
110
|
+
*/
|
|
111
|
+
import: string[];
|
|
112
|
+
/**
|
|
113
|
+
* Define Stylus variables or functions.
|
|
114
|
+
*
|
|
115
|
+
* @type {Array|Object}
|
|
116
|
+
* @default {}
|
|
117
|
+
*/
|
|
118
|
+
define: Array<any> | Record<string, any>;
|
|
119
|
+
/**
|
|
120
|
+
* Include regular CSS on @import.
|
|
121
|
+
*
|
|
122
|
+
* @type {boolean}
|
|
123
|
+
* @default false
|
|
124
|
+
*/
|
|
125
|
+
includeCSS: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Resolve relative url()'s inside imported files.
|
|
128
|
+
*
|
|
129
|
+
* @see https://stylus-lang.com/docs/js.html#stylusresolveroptions
|
|
130
|
+
*
|
|
131
|
+
* @type {boolean|Object}
|
|
132
|
+
* @default { nocheck: true }
|
|
133
|
+
*/
|
|
134
|
+
/**
|
|
135
|
+
* Emits comments in the generated CSS indicating the corresponding Stylus line.
|
|
136
|
+
*
|
|
137
|
+
* @see https://stylus-lang.com/docs/executable.html
|
|
138
|
+
*
|
|
139
|
+
* @type {boolean}
|
|
140
|
+
* @default false
|
|
141
|
+
*/
|
|
142
|
+
lineNumbers: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* @type {boolean}
|
|
145
|
+
* @default false
|
|
146
|
+
*/
|
|
147
|
+
disableCache: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Move @import and @charset to the top.
|
|
150
|
+
*
|
|
151
|
+
* @see https://stylus-lang.com/docs/executable.html
|
|
152
|
+
*
|
|
153
|
+
* @type {boolean}
|
|
154
|
+
* @default false
|
|
155
|
+
*/
|
|
156
|
+
hoistAtrules: boolean;
|
|
157
|
+
}
|
|
158
|
+
export interface StylusConfig {
|
|
159
|
+
alias?: Record<string, string>;
|
|
160
|
+
options: StylusRenderOptions;
|
|
161
|
+
additionalData?: string | ((key: string) => string);
|
|
162
|
+
}
|
|
163
|
+
interface RNConfig {
|
|
164
|
+
postcss?: PostcssConfig;
|
|
165
|
+
sass?: SassConfig;
|
|
166
|
+
less?: LessConfig;
|
|
167
|
+
stylus?: StylusConfig;
|
|
168
|
+
}
|
|
169
|
+
export interface Config {
|
|
170
|
+
designWidth?: number | ((size?: string | number) => number);
|
|
171
|
+
deviceRatio?: Record<string, number>;
|
|
172
|
+
sass?: SassGlobalConfig;
|
|
173
|
+
alias?: Record<string, string>;
|
|
174
|
+
htyf?: RNConfig;
|
|
175
|
+
}
|
|
176
|
+
export interface TransformOptions {
|
|
177
|
+
dev?: boolean;
|
|
178
|
+
hot?: boolean;
|
|
179
|
+
minify?: boolean;
|
|
180
|
+
platform: 'android' | 'ios' | 'harmony';
|
|
181
|
+
projectRoot?: string;
|
|
182
|
+
publicPath?: string;
|
|
183
|
+
customTransformOptions?: any;
|
|
184
|
+
config?: Config;
|
|
185
|
+
}
|
|
186
|
+
export declare const enum ResolveLogLevelEnum {
|
|
187
|
+
ERROR = "error",
|
|
188
|
+
WARNING = "warning"
|
|
189
|
+
}
|
|
190
|
+
export interface ResolveStyleOptions {
|
|
191
|
+
basedir: string;
|
|
192
|
+
platform: 'android' | 'ios' | 'harmony';
|
|
193
|
+
paths?: string[];
|
|
194
|
+
logLevel?: ResolveLogLevelEnum;
|
|
195
|
+
defaultExt?: string;
|
|
196
|
+
alias?: Record<string, string>;
|
|
197
|
+
}
|
|
198
|
+
export interface RenderResult {
|
|
199
|
+
css: string | Buffer;
|
|
200
|
+
map?: string | Buffer;
|
|
201
|
+
}
|
|
202
|
+
export interface RenderAdditionalResult extends RenderResult {
|
|
203
|
+
additionalData: string;
|
|
204
|
+
}
|
|
205
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;AAwFA,SAAS;AACT,MAAM,SAAS;CAAI"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ResolveStyleOptions } from '../types';
|
|
2
|
+
export declare function insertBefore(source?: string, additional?: string): string | undefined;
|
|
3
|
+
/**
|
|
4
|
+
* sort scss source by \@use
|
|
5
|
+
* @param source scss source
|
|
6
|
+
* @returns sorted scss source
|
|
7
|
+
*/
|
|
8
|
+
export declare function sortStyle(source: any): any;
|
|
9
|
+
export declare function insertAfter(source?: string, additional?: string): string | undefined;
|
|
10
|
+
export declare function findVariant(name: any, extensions: any, includePaths: any): string;
|
|
11
|
+
/**
|
|
12
|
+
* 返回存在的文件path
|
|
13
|
+
* @param id import id
|
|
14
|
+
* @param opts { basedir, platform, paths }
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveStyle(id: string, opts: ResolveStyleOptions): string;
|
|
17
|
+
export declare function normalizePath(file: any): any;
|
|
18
|
+
export declare function normalizeSourceMap(map: any, resourcePath: any): any;
|
|
19
|
+
export declare function getAdditionalData(data: string, config?: string | ((key: string) => string)): string;
|
|
20
|
+
declare const _default: {};
|
|
21
|
+
export default _default;
|