tailwindcss 0.0.0-insiders.e4a37ce → 0.0.0-insiders.e4b398b
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 +1 -1
- package/index.css +5 -0
- package/lib/cli/build/index.js +3 -0
- package/lib/cli/build/plugin.js +112 -59
- package/lib/cli/build/watching.js +1 -1
- package/lib/cli/help/index.js +2 -2
- package/lib/cli/index.js +4 -3
- package/lib/cli.js +1 -5
- package/lib/corePluginList.js +1 -0
- package/lib/corePlugins.js +182 -160
- package/lib/css/preflight.css +7 -1
- package/lib/featureFlags.js +16 -14
- package/lib/lib/content.js +28 -2
- package/lib/lib/evaluateTailwindFunctions.js +9 -7
- package/lib/lib/expandTailwindAtRules.js +59 -18
- package/lib/lib/generateRules.js +24 -19
- package/lib/lib/handleImportAtRules.js +50 -0
- package/lib/lib/normalizeTailwindDirectives.js +0 -15
- package/lib/lib/offsets.js +2 -2
- package/lib/lib/resolveDefaultsAtRules.js +1 -1
- package/lib/lib/setupContextUtils.js +71 -56
- package/lib/lib/setupTrackingContext.js +4 -2
- package/lib/lib/sharedState.js +2 -10
- package/lib/lib/substituteScreenAtRules.js +2 -2
- package/lib/plugin.js +90 -24
- package/lib/postcss-plugins/nesting/index.js +1 -1
- package/lib/postcss-plugins/nesting/plugin.js +2 -2
- package/lib/processTailwindFeatures.js +3 -3
- package/lib/public/colors.js +1 -1
- package/lib/util/color.js +3 -3
- package/lib/util/createUtilityPlugin.js +2 -2
- package/lib/util/dataTypes.js +75 -13
- package/lib/util/defaults.js +4 -4
- package/lib/util/escapeClassName.js +2 -2
- package/lib/util/formatVariantSelector.js +11 -9
- package/lib/util/getAllConfigs.js +3 -2
- package/lib/util/log.js +17 -0
- package/lib/util/normalizeConfig.js +59 -28
- package/lib/util/normalizeScreens.js +3 -3
- package/lib/util/pluginUtils.js +7 -9
- package/lib/util/prefixSelector.js +1 -1
- package/lib/util/pseudoElements.js +10 -30
- package/lib/util/resolveConfig.js +10 -6
- package/lib/util/validateConfig.js +11 -0
- package/lib/util/withAlphaVariable.js +1 -1
- package/lib/value-parser/LICENSE +22 -0
- package/lib/value-parser/README.md +3 -0
- package/lib/value-parser/index.d.js +2 -0
- package/lib/value-parser/index.js +22 -0
- package/lib/value-parser/parse.js +259 -0
- package/lib/value-parser/stringify.js +38 -0
- package/lib/value-parser/unit.js +86 -0
- package/lib/value-parser/walk.js +16 -0
- package/package.json +33 -42
- package/src/cli/build/index.js +4 -0
- package/src/cli/build/plugin.js +73 -48
- package/src/cli/index.js +1 -0
- package/src/cli.js +1 -5
- package/src/corePluginList.js +1 -1
- package/src/corePlugins.js +46 -18
- package/src/css/preflight.css +7 -1
- package/src/featureFlags.js +7 -9
- package/src/lib/content.js +33 -1
- package/src/lib/evaluateTailwindFunctions.js +4 -1
- package/src/lib/expandTailwindAtRules.js +69 -33
- package/src/lib/generateRules.js +18 -15
- package/src/lib/handleImportAtRules.js +34 -0
- package/src/lib/normalizeTailwindDirectives.js +0 -27
- package/src/lib/offsets.js +3 -3
- package/src/lib/setupContextUtils.js +24 -20
- package/src/lib/setupTrackingContext.js +1 -3
- package/src/lib/sharedState.js +0 -4
- package/src/plugin.js +86 -60
- package/src/processTailwindFeatures.js +3 -2
- package/src/util/dataTypes.js +75 -16
- package/src/util/formatVariantSelector.js +4 -3
- package/src/util/log.js +24 -0
- package/src/util/normalizeConfig.js +38 -11
- package/src/util/pluginUtils.js +0 -4
- package/src/util/prefixSelector.js +1 -0
- package/src/util/pseudoElements.js +10 -13
- package/src/util/validateConfig.js +10 -0
- package/src/value-parser/LICENSE +22 -0
- package/src/value-parser/README.md +3 -0
- package/src/value-parser/index.d.ts +177 -0
- package/src/value-parser/index.js +28 -0
- package/src/value-parser/parse.js +303 -0
- package/src/value-parser/stringify.js +41 -0
- package/src/value-parser/unit.js +118 -0
- package/src/value-parser/walk.js +18 -0
- package/stubs/config.full.js +14 -1
- package/stubs/config.simple.js +1 -1
- package/stubs/postcss.config.cjs +0 -1
- package/stubs/postcss.config.js +0 -1
- package/types/config.d.ts +2 -1
- package/types/generated/corePluginList.d.ts +1 -1
- package/types/generated/default-theme.d.ts +2 -1
- package/lib/cli/build/deps.js +0 -62
- package/lib/cli-peer-dependencies.js +0 -36
- package/lib/oxide/cli/build/deps.js +0 -89
- package/lib/oxide/cli/build/index.js +0 -53
- package/lib/oxide/cli/build/plugin.js +0 -375
- package/lib/oxide/cli/build/utils.js +0 -87
- package/lib/oxide/cli/build/watching.js +0 -179
- package/lib/oxide/cli/help/index.js +0 -72
- package/lib/oxide/cli/index.js +0 -214
- package/lib/oxide/cli/init/index.js +0 -52
- package/lib/oxide/cli.js +0 -5
- package/lib/oxide/postcss-plugin.js +0 -2
- package/peers/index.js +0 -96419
- package/scripts/swap-engines.js +0 -40
- package/src/cli/build/deps.js +0 -56
- package/src/cli-peer-dependencies.js +0 -15
- package/src/oxide/cli/build/deps.ts +0 -91
- package/src/oxide/cli/build/index.ts +0 -47
- package/src/oxide/cli/build/plugin.ts +0 -442
- package/src/oxide/cli/build/utils.ts +0 -74
- package/src/oxide/cli/build/watching.ts +0 -225
- package/src/oxide/cli/help/index.ts +0 -69
- package/src/oxide/cli/index.ts +0 -204
- package/src/oxide/cli/init/index.ts +0 -59
- package/src/oxide/cli.ts +0 -1
- package/src/oxide/postcss-plugin.ts +0 -1
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
<p align="center">
|
|
17
|
-
<a href="https://github.com/tailwindlabs/tailwindcss/actions"><img src="https://img.shields.io/github/actions/workflow/status/tailwindlabs/tailwindcss/ci
|
|
17
|
+
<a href="https://github.com/tailwindlabs/tailwindcss/actions"><img src="https://img.shields.io/github/actions/workflow/status/tailwindlabs/tailwindcss/ci.yml?branch=master" alt="Build Status"></a>
|
|
18
18
|
<a href="https://www.npmjs.com/package/tailwindcss"><img src="https://img.shields.io/npm/dt/tailwindcss.svg" alt="Total Downloads"></a>
|
|
19
19
|
<a href="https://github.com/tailwindcss/tailwindcss/releases"><img src="https://img.shields.io/npm/v/tailwindcss.svg" alt="Latest Release"></a>
|
|
20
20
|
<a href="https://github.com/tailwindcss/tailwindcss/blob/master/LICENSE"><img src="https://img.shields.io/npm/l/tailwindcss.svg" alt="License"></a>
|
package/index.css
ADDED
package/lib/cli/build/index.js
CHANGED
|
@@ -34,6 +34,9 @@ async function build(args) {
|
|
|
34
34
|
console.error(`Specified config file ${args["--config"]} does not exist.`);
|
|
35
35
|
process.exit(9);
|
|
36
36
|
}
|
|
37
|
+
if (args["--no-autoprefixer"]) {
|
|
38
|
+
console.error("[deprecation] The --no-autoprefixer flag is deprecated and has no effect.");
|
|
39
|
+
}
|
|
37
40
|
// TODO: Reference the @config path here if exists
|
|
38
41
|
let configPath = args["--config"] ? args["--config"] : (0, _resolveConfigPath.resolveDefaultConfigPath)();
|
|
39
42
|
let processor = await (0, _plugin.createProcessor)(args, configPath);
|
package/lib/cli/build/plugin.js
CHANGED
|
@@ -9,16 +9,19 @@ Object.defineProperty(exports, "createProcessor", {
|
|
|
9
9
|
return createProcessor;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
const _packagejson = /*#__PURE__*/ _interop_require_default(require("../../../package.json"));
|
|
12
13
|
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
13
14
|
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
15
|
+
const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss"));
|
|
14
16
|
const _postcssloadconfig = /*#__PURE__*/ _interop_require_default(require("postcss-load-config"));
|
|
17
|
+
const _browserslist = /*#__PURE__*/ _interop_require_default(require("browserslist"));
|
|
18
|
+
const _lightningcss = /*#__PURE__*/ _interop_require_wildcard(require("lightningcss"));
|
|
15
19
|
const _lilconfig = require("lilconfig");
|
|
16
20
|
const _plugins = /*#__PURE__*/ _interop_require_default(require("postcss-load-config/src/plugins" // Little bit scary, looking at private/internal API
|
|
17
21
|
));
|
|
18
22
|
const _options = /*#__PURE__*/ _interop_require_default(require("postcss-load-config/src/options" // Little bit scary, looking at private/internal API
|
|
19
23
|
));
|
|
20
24
|
const _processTailwindFeatures = /*#__PURE__*/ _interop_require_default(require("../../processTailwindFeatures"));
|
|
21
|
-
const _deps = require("./deps");
|
|
22
25
|
const _utils = require("./utils");
|
|
23
26
|
const _sharedState = require("../../lib/sharedState");
|
|
24
27
|
const _resolveConfig = /*#__PURE__*/ _interop_require_default(require("../../../resolveConfig.js"));
|
|
@@ -29,11 +32,91 @@ const _findAtConfigPath = require("../../lib/findAtConfigPath.js");
|
|
|
29
32
|
const _log = /*#__PURE__*/ _interop_require_default(require("../../util/log"));
|
|
30
33
|
const _loadconfig = require("../../lib/load-config");
|
|
31
34
|
const _getModuleDependencies = /*#__PURE__*/ _interop_require_default(require("../../lib/getModuleDependencies"));
|
|
35
|
+
const _validateConfig = require("../../util/validateConfig");
|
|
36
|
+
const _handleImportAtRules = require("../../lib/handleImportAtRules");
|
|
37
|
+
const _featureFlags = require("../../featureFlags");
|
|
32
38
|
function _interop_require_default(obj) {
|
|
33
39
|
return obj && obj.__esModule ? obj : {
|
|
34
40
|
default: obj
|
|
35
41
|
};
|
|
36
42
|
}
|
|
43
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
44
|
+
if (typeof WeakMap !== "function") return null;
|
|
45
|
+
var cacheBabelInterop = new WeakMap();
|
|
46
|
+
var cacheNodeInterop = new WeakMap();
|
|
47
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
48
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
49
|
+
})(nodeInterop);
|
|
50
|
+
}
|
|
51
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
52
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
53
|
+
return obj;
|
|
54
|
+
}
|
|
55
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
56
|
+
return {
|
|
57
|
+
default: obj
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
61
|
+
if (cache && cache.has(obj)) {
|
|
62
|
+
return cache.get(obj);
|
|
63
|
+
}
|
|
64
|
+
var newObj = {};
|
|
65
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
66
|
+
for(var key in obj){
|
|
67
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
68
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
69
|
+
if (desc && (desc.get || desc.set)) {
|
|
70
|
+
Object.defineProperty(newObj, key, desc);
|
|
71
|
+
} else {
|
|
72
|
+
newObj[key] = obj[key];
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
newObj.default = obj;
|
|
77
|
+
if (cache) {
|
|
78
|
+
cache.set(obj, newObj);
|
|
79
|
+
}
|
|
80
|
+
return newObj;
|
|
81
|
+
}
|
|
82
|
+
function license() {
|
|
83
|
+
return `/* ! tailwindcss v${_packagejson.default.version} | MIT License | https://tailwindcss.com */\n`;
|
|
84
|
+
}
|
|
85
|
+
async function lightningcss(result, { map = true, minify = true } = {}) {
|
|
86
|
+
try {
|
|
87
|
+
var _browserslist_findConfig;
|
|
88
|
+
var _result_opts_from;
|
|
89
|
+
let resolvedBrowsersListConfig = (_browserslist_findConfig = _browserslist.default.findConfig((_result_opts_from = result.opts.from) !== null && _result_opts_from !== void 0 ? _result_opts_from : process.cwd())) === null || _browserslist_findConfig === void 0 ? void 0 : _browserslist_findConfig.defaults;
|
|
90
|
+
let defaultBrowsersListConfig = _packagejson.default.browserslist;
|
|
91
|
+
let browsersListConfig = resolvedBrowsersListConfig !== null && resolvedBrowsersListConfig !== void 0 ? resolvedBrowsersListConfig : defaultBrowsersListConfig;
|
|
92
|
+
let transformed = _lightningcss.default.transform({
|
|
93
|
+
filename: result.opts.from || "input.css",
|
|
94
|
+
code: Buffer.from(result.css, "utf-8"),
|
|
95
|
+
minify,
|
|
96
|
+
sourceMap: result.map === undefined ? map : !!result.map,
|
|
97
|
+
inputSourceMap: result.map ? result.map.toString() : undefined,
|
|
98
|
+
targets: _lightningcss.default.browserslistToTargets((0, _browserslist.default)(browsersListConfig)),
|
|
99
|
+
drafts: {
|
|
100
|
+
nesting: true
|
|
101
|
+
},
|
|
102
|
+
include: _lightningcss.Features.Nesting,
|
|
103
|
+
exclude: _lightningcss.Features.LogicalProperties
|
|
104
|
+
});
|
|
105
|
+
return Object.assign(result, {
|
|
106
|
+
css: transformed.code.toString("utf8"),
|
|
107
|
+
map: result.map ? Object.assign(result.map, {
|
|
108
|
+
toString () {
|
|
109
|
+
var _transformed_map;
|
|
110
|
+
return (_transformed_map = transformed.map) === null || _transformed_map === void 0 ? void 0 : _transformed_map.toString();
|
|
111
|
+
}
|
|
112
|
+
}) : result.map
|
|
113
|
+
});
|
|
114
|
+
} catch (err) {
|
|
115
|
+
console.error("Unable to use Lightning CSS. Using raw version instead.");
|
|
116
|
+
console.error(err);
|
|
117
|
+
return result;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
37
120
|
/**
|
|
38
121
|
*
|
|
39
122
|
* @param {string} [customPostCssPath ]
|
|
@@ -43,7 +126,7 @@ function _interop_require_default(obj) {
|
|
|
43
126
|
let file = _path.default.resolve(customPostCssPath);
|
|
44
127
|
// Implementation, see: https://unpkg.com/browse/postcss-load-config@3.1.0/src/index.js
|
|
45
128
|
// @ts-ignore
|
|
46
|
-
let { config ={}
|
|
129
|
+
let { config = {} } = await (0, _lilconfig.lilconfig)("postcss").load(file);
|
|
47
130
|
if (typeof config === "function") {
|
|
48
131
|
config = config();
|
|
49
132
|
} else {
|
|
@@ -76,43 +159,11 @@ function _interop_require_default(obj) {
|
|
|
76
159
|
config.options
|
|
77
160
|
];
|
|
78
161
|
}
|
|
79
|
-
function loadBuiltinPostcssPlugins() {
|
|
80
|
-
let postcss = (0, _deps.loadPostcss)();
|
|
81
|
-
let IMPORT_COMMENT = "__TAILWIND_RESTORE_IMPORT__: ";
|
|
82
|
-
return [
|
|
83
|
-
[
|
|
84
|
-
(root)=>{
|
|
85
|
-
root.walkAtRules("import", (rule)=>{
|
|
86
|
-
if (rule.params.slice(1).startsWith("tailwindcss/")) {
|
|
87
|
-
rule.after(postcss.comment({
|
|
88
|
-
text: IMPORT_COMMENT + rule.params
|
|
89
|
-
}));
|
|
90
|
-
rule.remove();
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
},
|
|
94
|
-
(0, _deps.loadPostcssImport)(),
|
|
95
|
-
(root)=>{
|
|
96
|
-
root.walkComments((rule)=>{
|
|
97
|
-
if (rule.text.startsWith(IMPORT_COMMENT)) {
|
|
98
|
-
rule.after(postcss.atRule({
|
|
99
|
-
name: "import",
|
|
100
|
-
params: rule.text.replace(IMPORT_COMMENT, "")
|
|
101
|
-
}));
|
|
102
|
-
rule.remove();
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
],
|
|
107
|
-
[],
|
|
108
|
-
{}
|
|
109
|
-
];
|
|
110
|
-
}
|
|
111
162
|
let state = {
|
|
112
163
|
/** @type {any} */ context: null,
|
|
113
164
|
/** @type {ReturnType<typeof createWatcher> | null} */ watcher: null,
|
|
114
165
|
/** @type {{content: string, extension: string}[]} */ changedContent: [],
|
|
115
|
-
/** @type {
|
|
166
|
+
/** @type {{config: import('../../../types').Config, dependencies: Set<string>, dispose: Function } | null} */ configBag: null,
|
|
116
167
|
contextDependencies: new Set(),
|
|
117
168
|
/** @type {import('../../lib/content.js').ContentPath[]} */ contentPaths: [],
|
|
118
169
|
refreshContentPaths () {
|
|
@@ -129,6 +180,7 @@ let state = {
|
|
|
129
180
|
};
|
|
130
181
|
},
|
|
131
182
|
loadConfig (configPath, content) {
|
|
183
|
+
var _content;
|
|
132
184
|
if (this.watcher && configPath) {
|
|
133
185
|
this.refreshConfigDependencies();
|
|
134
186
|
}
|
|
@@ -143,14 +195,9 @@ let state = {
|
|
|
143
195
|
}
|
|
144
196
|
}
|
|
145
197
|
};
|
|
146
|
-
|
|
147
|
-
this.configBag.config = (0, _resolveConfig.default)(this.configBag.config, {
|
|
148
|
-
content: {
|
|
149
|
-
files: []
|
|
150
|
-
}
|
|
151
|
-
});
|
|
198
|
+
this.configBag.config = (0, _validateConfig.validateConfig)((0, _resolveConfig.default)(this.configBag.config));
|
|
152
199
|
// Override content files if `--content` has been passed explicitly
|
|
153
|
-
if ((content === null ||
|
|
200
|
+
if (((_content = content) === null || _content === void 0 ? void 0 : _content.length) > 0) {
|
|
154
201
|
this.configBag.config.content.files = content;
|
|
155
202
|
}
|
|
156
203
|
return this.configBag.config;
|
|
@@ -167,7 +214,7 @@ let state = {
|
|
|
167
214
|
// TODO: When we make the postcss plugin async-capable this can become async
|
|
168
215
|
let files = _fastglob.default.sync(this.contentPatterns.all);
|
|
169
216
|
for (let file of files){
|
|
170
|
-
if (
|
|
217
|
+
if ((0, _featureFlags.flagEnabled)(this.config, "oxideParser")) {
|
|
171
218
|
content.push({
|
|
172
219
|
file,
|
|
173
220
|
extension: _path.default.extname(file).slice(1)
|
|
@@ -183,7 +230,7 @@ let state = {
|
|
|
183
230
|
let rawContent = this.config.content.files.filter((file)=>{
|
|
184
231
|
return file !== null && typeof file === "object";
|
|
185
232
|
});
|
|
186
|
-
for (let { raw: htmlContent
|
|
233
|
+
for (let { raw: htmlContent, extension = "html" } of rawContent){
|
|
187
234
|
content.push({
|
|
188
235
|
content: htmlContent,
|
|
189
236
|
extension
|
|
@@ -191,7 +238,7 @@ let state = {
|
|
|
191
238
|
}
|
|
192
239
|
return content;
|
|
193
240
|
},
|
|
194
|
-
getContext ({ createContext
|
|
241
|
+
getContext ({ createContext, cliConfigPath, root, result, content }) {
|
|
195
242
|
if (this.context) {
|
|
196
243
|
this.context.changedContent = this.changedContent.splice(0);
|
|
197
244
|
return this.context;
|
|
@@ -225,12 +272,16 @@ let state = {
|
|
|
225
272
|
};
|
|
226
273
|
async function createProcessor(args, cliConfigPath) {
|
|
227
274
|
var _args_content;
|
|
228
|
-
let postcss = (0, _deps.loadPostcss)();
|
|
229
275
|
let input = args["--input"];
|
|
230
276
|
let output = args["--output"];
|
|
231
277
|
let includePostCss = args["--postcss"];
|
|
232
278
|
let customPostCssPath = typeof args["--postcss"] === "string" ? args["--postcss"] : undefined;
|
|
233
|
-
let [beforePlugins, afterPlugins, postcssOptions] = includePostCss ? await loadPostCssPlugins(customPostCssPath) :
|
|
279
|
+
let [beforePlugins, afterPlugins, postcssOptions] = includePostCss ? await loadPostCssPlugins(customPostCssPath) : [
|
|
280
|
+
[],
|
|
281
|
+
[],
|
|
282
|
+
{}
|
|
283
|
+
];
|
|
284
|
+
beforePlugins.unshift(...(0, _handleImportAtRules.handleImportAtRules)());
|
|
234
285
|
if (args["--purge"]) {
|
|
235
286
|
_log.default.warn("purge-flag-deprecated", [
|
|
236
287
|
"The `--purge` flag has been deprecated.",
|
|
@@ -245,9 +296,9 @@ async function createProcessor(args, cliConfigPath) {
|
|
|
245
296
|
let tailwindPlugin = ()=>{
|
|
246
297
|
return {
|
|
247
298
|
postcssPlugin: "tailwindcss",
|
|
248
|
-
Once (root, { result
|
|
299
|
+
async Once (root, { result }) {
|
|
249
300
|
_sharedState.env.DEBUG && console.time("Compiling CSS");
|
|
250
|
-
(0, _processTailwindFeatures.default)(({ createContext
|
|
301
|
+
await (0, _processTailwindFeatures.default)(({ createContext })=>{
|
|
251
302
|
console.error();
|
|
252
303
|
console.error("Rebuilding...");
|
|
253
304
|
return ()=>{
|
|
@@ -269,12 +320,10 @@ async function createProcessor(args, cliConfigPath) {
|
|
|
269
320
|
...beforePlugins,
|
|
270
321
|
tailwindPlugin,
|
|
271
322
|
!args["--minify"] && _utils.formatNodes,
|
|
272
|
-
...afterPlugins
|
|
273
|
-
!args["--no-autoprefixer"] && (0, _deps.loadAutoprefixer)(),
|
|
274
|
-
args["--minify"] && (0, _deps.loadCssNano)()
|
|
323
|
+
...afterPlugins
|
|
275
324
|
].filter(Boolean);
|
|
276
325
|
/** @type {import('postcss').Processor} */ // @ts-ignore
|
|
277
|
-
let processor =
|
|
326
|
+
let processor = (0, _postcss.default)(plugins);
|
|
278
327
|
async function readInput() {
|
|
279
328
|
// Piping in data, let's drain the stdin
|
|
280
329
|
if (input === "-") {
|
|
@@ -289,10 +338,14 @@ async function createProcessor(args, cliConfigPath) {
|
|
|
289
338
|
}
|
|
290
339
|
async function build() {
|
|
291
340
|
let start = process.hrtime.bigint();
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
341
|
+
let options = {
|
|
342
|
+
...postcssOptions,
|
|
343
|
+
from: input,
|
|
344
|
+
to: output
|
|
345
|
+
};
|
|
346
|
+
return readInput().then((css)=>processor.process(css, options)).then((result)=>lightningcss(result, {
|
|
347
|
+
...options,
|
|
348
|
+
minify: !!args["--minify"]
|
|
296
349
|
})).then((result)=>{
|
|
297
350
|
if (!state.watcher) {
|
|
298
351
|
return result;
|
|
@@ -311,11 +364,11 @@ async function createProcessor(args, cliConfigPath) {
|
|
|
311
364
|
return result;
|
|
312
365
|
}).then((result)=>{
|
|
313
366
|
if (!output) {
|
|
314
|
-
process.stdout.write(result.css);
|
|
367
|
+
process.stdout.write(license() + result.css);
|
|
315
368
|
return;
|
|
316
369
|
}
|
|
317
370
|
return Promise.all([
|
|
318
|
-
(0, _utils.outputFile)(result.opts.to, result.css),
|
|
371
|
+
(0, _utils.outputFile)(result.opts.to, license() + result.css),
|
|
319
372
|
result.map && (0, _utils.outputFile)(result.opts.to + ".map", result.map.toString())
|
|
320
373
|
]);
|
|
321
374
|
}).then(()=>{
|
|
@@ -20,7 +20,7 @@ function _interop_require_default(obj) {
|
|
|
20
20
|
default: obj
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
function createWatcher(args, { state
|
|
23
|
+
function createWatcher(args, { state, rebuild }) {
|
|
24
24
|
let shouldPoll = args["--poll"];
|
|
25
25
|
let shouldCoalesceWriteEvents = shouldPoll || process.platform === "win32";
|
|
26
26
|
// Polling interval in milliseconds
|
package/lib/cli/help/index.js
CHANGED
|
@@ -15,7 +15,7 @@ function _interop_require_default(obj) {
|
|
|
15
15
|
default: obj
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
function help({ message
|
|
18
|
+
function help({ message, usage, commands, options }) {
|
|
19
19
|
let indent = 2;
|
|
20
20
|
// Render header
|
|
21
21
|
console.log();
|
|
@@ -60,7 +60,7 @@ function help({ message , usage , commands , options }) {
|
|
|
60
60
|
}
|
|
61
61
|
console.log();
|
|
62
62
|
console.log("Options:");
|
|
63
|
-
for (let { flags
|
|
63
|
+
for (let { flags, description, deprecated } of Object.values(groupedOptions)){
|
|
64
64
|
if (deprecated) continue;
|
|
65
65
|
if (flags.length === 1) {
|
|
66
66
|
console.log(" ".repeat(indent + 4 /* 4 = "-i, ".length */ ), flags.slice().reverse().join(", ").padEnd(20, " "), description);
|
package/lib/cli/index.js
CHANGED
|
@@ -91,6 +91,7 @@ let commands = {
|
|
|
91
91
|
description: "Path to a custom config file"
|
|
92
92
|
},
|
|
93
93
|
"--no-autoprefixer": {
|
|
94
|
+
deprecated: true,
|
|
94
95
|
type: Boolean,
|
|
95
96
|
description: "Disable autoprefixer"
|
|
96
97
|
},
|
|
@@ -143,15 +144,15 @@ if (commands[command] === undefined) {
|
|
|
143
144
|
}
|
|
144
145
|
}
|
|
145
146
|
// Execute command
|
|
146
|
-
let { args: flags
|
|
147
|
+
let { args: flags, run } = commands[command];
|
|
147
148
|
let args = (()=>{
|
|
148
149
|
try {
|
|
149
150
|
let result = (0, _arg.default)(Object.fromEntries(Object.entries({
|
|
150
151
|
...flags,
|
|
151
152
|
...sharedFlags
|
|
152
153
|
}).filter(([_key, value])=>{
|
|
153
|
-
var _value_type;
|
|
154
|
-
return !(value === null ||
|
|
154
|
+
var _value_type, _value;
|
|
155
|
+
return !((_value = value) === null || _value === void 0 ? void 0 : (_value_type = _value.type) === null || _value_type === void 0 ? void 0 : _value_type.manualParsing);
|
|
155
156
|
}).map(([key, value])=>[
|
|
156
157
|
key,
|
|
157
158
|
typeof value === "object" ? value.type : value
|
package/lib/cli.js
CHANGED