tailwindcss 0.0.0-insiders.ea6f14a → 0.0.0-insiders.ea80db2
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/CHANGELOG.md +310 -3
- package/LICENSE +1 -2
- package/README.md +8 -4
- package/colors.d.ts +3 -0
- package/colors.js +2 -1
- package/defaultConfig.d.ts +3 -0
- package/defaultConfig.js +2 -1
- package/defaultTheme.d.ts +3 -0
- package/defaultTheme.js +2 -1
- package/lib/cli.js +123 -68
- package/lib/constants.js +1 -1
- package/lib/corePluginList.js +9 -1
- package/lib/corePlugins.js +504 -386
- package/lib/css/preflight.css +6 -5
- package/lib/featureFlags.js +7 -8
- package/lib/index.js +12 -3
- package/lib/lib/cacheInvalidation.js +69 -0
- package/lib/lib/collapseAdjacentRules.js +14 -1
- package/lib/lib/collapseDuplicateDeclarations.js +54 -3
- package/lib/lib/defaultExtractor.js +44 -0
- package/lib/lib/detectNesting.js +17 -2
- package/lib/lib/evaluateTailwindFunctions.js +10 -6
- package/lib/lib/expandApplyAtRules.js +264 -59
- package/lib/lib/expandTailwindAtRules.js +63 -44
- package/lib/lib/generateRules.js +249 -85
- package/lib/lib/normalizeTailwindDirectives.js +10 -2
- package/lib/lib/partitionApplyAtRules.js +53 -0
- package/lib/lib/resolveDefaultsAtRules.js +32 -14
- package/lib/lib/setupContextUtils.js +170 -156
- package/lib/lib/setupTrackingContext.js +8 -7
- package/lib/lib/sharedState.js +38 -5
- package/lib/lib/substituteScreenAtRules.js +7 -4
- package/{nesting → lib/postcss-plugins/nesting}/README.md +0 -0
- package/lib/postcss-plugins/nesting/index.js +17 -0
- package/lib/postcss-plugins/nesting/plugin.js +85 -0
- package/lib/processTailwindFeatures.js +10 -2
- package/lib/util/buildMediaQuery.js +13 -24
- package/lib/util/cloneNodes.js +12 -1
- package/lib/util/color.js +27 -11
- package/lib/util/createPlugin.js +1 -2
- package/lib/util/createUtilityPlugin.js +6 -10
- package/lib/util/dataTypes.js +38 -7
- package/lib/util/defaults.js +6 -0
- package/lib/util/flattenColorPalette.js +1 -3
- package/lib/util/formatVariantSelector.js +93 -9
- package/lib/util/isValidArbitraryValue.js +64 -0
- package/lib/util/log.js +10 -6
- package/lib/util/nameClass.js +1 -0
- package/lib/util/normalizeConfig.js +54 -22
- package/lib/util/normalizeScreens.js +59 -0
- package/lib/util/parseBoxShadowValue.js +117 -0
- package/lib/util/pluginUtils.js +26 -26
- package/lib/util/prefixSelector.js +4 -5
- package/lib/util/resolveConfig.js +52 -31
- package/lib/util/resolveConfigPath.js +1 -2
- package/lib/util/toColorValue.js +1 -2
- package/lib/util/toPath.js +6 -1
- package/lib/util/transformThemeValue.js +19 -13
- package/nesting/index.js +2 -12
- package/package.json +38 -40
- package/peers/index.js +7243 -9188
- package/plugin.d.ts +6 -0
- package/plugin.js +2 -1
- package/resolveConfig.js +2 -1
- package/scripts/generate-types.js +52 -0
- package/src/cli.js +97 -27
- package/src/corePluginList.js +1 -1
- package/src/corePlugins.js +404 -265
- package/src/css/preflight.css +6 -5
- package/src/featureFlags.js +3 -3
- package/src/index.js +14 -6
- package/src/lib/cacheInvalidation.js +52 -0
- package/src/lib/collapseAdjacentRules.js +16 -1
- package/src/lib/collapseDuplicateDeclarations.js +66 -1
- package/src/lib/defaultExtractor.js +50 -0
- package/src/lib/detectNesting.js +22 -3
- package/src/lib/evaluateTailwindFunctions.js +6 -3
- package/src/lib/expandApplyAtRules.js +285 -56
- package/src/lib/expandTailwindAtRules.js +75 -33
- package/src/lib/generateRules.js +237 -76
- package/src/lib/normalizeTailwindDirectives.js +7 -1
- package/src/lib/partitionApplyAtRules.js +52 -0
- package/src/lib/resolveDefaultsAtRules.js +35 -10
- package/src/lib/setupContextUtils.js +153 -106
- package/src/lib/setupTrackingContext.js +8 -7
- package/src/lib/sharedState.js +42 -4
- package/src/lib/substituteScreenAtRules.js +6 -3
- package/src/postcss-plugins/nesting/README.md +42 -0
- package/src/postcss-plugins/nesting/index.js +13 -0
- package/src/postcss-plugins/nesting/plugin.js +80 -0
- package/src/processTailwindFeatures.js +12 -2
- package/src/util/buildMediaQuery.js +14 -18
- package/src/util/cloneNodes.js +14 -1
- package/src/util/color.js +25 -10
- package/src/util/dataTypes.js +43 -11
- package/src/util/defaults.js +6 -0
- package/src/util/formatVariantSelector.js +92 -1
- package/src/util/isValidArbitraryValue.js +61 -0
- package/src/util/log.js +10 -6
- package/src/util/nameClass.js +1 -1
- package/src/util/normalizeConfig.js +24 -3
- package/src/util/normalizeScreens.js +45 -0
- package/src/util/parseBoxShadowValue.js +119 -0
- package/src/util/pluginUtils.js +14 -3
- package/src/util/prefixSelector.js +7 -5
- package/src/util/resolveConfig.js +41 -1
- package/src/util/toPath.js +23 -1
- package/src/util/transformThemeValue.js +22 -7
- package/stubs/defaultConfig.stub.js +45 -16
- package/types/config.d.ts +323 -0
- package/types/generated/.gitkeep +0 -0
- package/types/generated/colors.d.ts +276 -0
- package/types/generated/corePluginList.d.ts +1 -0
- package/types/index.d.ts +1 -0
- package/types.d.ts +1 -0
- package/lib/lib/setupWatchingContext.js +0 -288
- package/nesting/plugin.js +0 -41
- package/src/lib/setupWatchingContext.js +0 -311
package/lib/cli.js
CHANGED
|
@@ -6,7 +6,7 @@ var _path = _interopRequireDefault(require("path"));
|
|
|
6
6
|
var _arg = _interopRequireDefault(require("arg"));
|
|
7
7
|
var _fs = _interopRequireDefault(require("fs"));
|
|
8
8
|
var _postcssLoadConfig = _interopRequireDefault(require("postcss-load-config"));
|
|
9
|
-
var
|
|
9
|
+
var _lilconfig = require("lilconfig");
|
|
10
10
|
var _plugins // Little bit scary, looking at private/internal API
|
|
11
11
|
= _interopRequireDefault(require("postcss-load-config/src/plugins"));
|
|
12
12
|
var _processTailwindFeatures = _interopRequireDefault(require("./processTailwindFeatures"));
|
|
@@ -22,7 +22,7 @@ function _interopRequireDefault(obj) {
|
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
let env = {
|
|
25
|
-
DEBUG: process.env.DEBUG !== undefined
|
|
25
|
+
DEBUG: process.env.DEBUG !== undefined && process.env.DEBUG !== '0'
|
|
26
26
|
};
|
|
27
27
|
// ---
|
|
28
28
|
function indentRecursive(node, indent = 0) {
|
|
@@ -40,7 +40,26 @@ function formatNodes(root) {
|
|
|
40
40
|
root.first.raws.before = '';
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
async function outputFile(file, contents) {
|
|
44
|
+
if (_fs.default.existsSync(file) && await _fs.default.promises.readFile(file, 'utf8') === contents) {
|
|
45
|
+
return; // Skip writing the file
|
|
46
|
+
}
|
|
47
|
+
// Write the file
|
|
48
|
+
await _fs.default.promises.writeFile(file, contents, 'utf8');
|
|
49
|
+
}
|
|
50
|
+
function drainStdin() {
|
|
51
|
+
return new Promise((resolve, reject)=>{
|
|
52
|
+
let result = '';
|
|
53
|
+
process.stdin.on('data', (chunk)=>{
|
|
54
|
+
result += chunk;
|
|
55
|
+
});
|
|
56
|
+
process.stdin.on('end', ()=>resolve(result)
|
|
57
|
+
);
|
|
58
|
+
process.stdin.on('error', (err)=>reject(err)
|
|
59
|
+
);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function help({ message , usage , commands: commands1 , options }) {
|
|
44
63
|
let indent = 2;
|
|
45
64
|
// Render header
|
|
46
65
|
console.log();
|
|
@@ -61,17 +80,16 @@ function help({ message , usage , commands , options }) {
|
|
|
61
80
|
}
|
|
62
81
|
}
|
|
63
82
|
// Render commands
|
|
64
|
-
if (
|
|
83
|
+
if (commands1 && commands1.length > 0) {
|
|
65
84
|
console.log();
|
|
66
85
|
console.log('Commands:');
|
|
67
|
-
for (let
|
|
68
|
-
console.log(' '.repeat(indent),
|
|
86
|
+
for (let command1 of commands1){
|
|
87
|
+
console.log(' '.repeat(indent), command1);
|
|
69
88
|
}
|
|
70
89
|
}
|
|
71
90
|
// Render options
|
|
72
91
|
if (options) {
|
|
73
|
-
let groupedOptions = {
|
|
74
|
-
};
|
|
92
|
+
let groupedOptions = {};
|
|
75
93
|
for (let [key, value] of Object.entries(options)){
|
|
76
94
|
if (typeof value === 'object') {
|
|
77
95
|
groupedOptions[key] = {
|
|
@@ -86,12 +104,12 @@ function help({ message , usage , commands , options }) {
|
|
|
86
104
|
}
|
|
87
105
|
console.log();
|
|
88
106
|
console.log('Options:');
|
|
89
|
-
for (let { flags , description , deprecated } of Object.values(groupedOptions)){
|
|
107
|
+
for (let { flags: flags1 , description , deprecated } of Object.values(groupedOptions)){
|
|
90
108
|
if (deprecated) continue;
|
|
91
|
-
if (
|
|
92
|
-
console.log(' '.repeat(indent + 4 /* 4 = "-i, ".length */ ),
|
|
109
|
+
if (flags1.length === 1) {
|
|
110
|
+
console.log(' '.repeat(indent + 4 /* 4 = "-i, ".length */ ), flags1.slice().reverse().join(', ').padEnd(20, ' '), description);
|
|
93
111
|
} else {
|
|
94
|
-
console.log(' '.repeat(indent),
|
|
112
|
+
console.log(' '.repeat(indent), flags1.slice().reverse().join(', ').padEnd(24, ' '), description);
|
|
95
113
|
}
|
|
96
114
|
}
|
|
97
115
|
}
|
|
@@ -122,6 +140,10 @@ let commands = {
|
|
|
122
140
|
type: Boolean,
|
|
123
141
|
description: 'Initialize a `postcss.config.js` file'
|
|
124
142
|
},
|
|
143
|
+
'--types': {
|
|
144
|
+
type: Boolean,
|
|
145
|
+
description: 'Add TypeScript types for the `tailwind.config.js` file'
|
|
146
|
+
},
|
|
125
147
|
'-f': '--full',
|
|
126
148
|
'-p': '--postcss'
|
|
127
149
|
}
|
|
@@ -141,6 +163,10 @@ let commands = {
|
|
|
141
163
|
type: Boolean,
|
|
142
164
|
description: 'Watch for changes and rebuild as needed'
|
|
143
165
|
},
|
|
166
|
+
'--poll': {
|
|
167
|
+
type: Boolean,
|
|
168
|
+
description: 'Use polling instead of filesystem events when watching'
|
|
169
|
+
},
|
|
144
170
|
'--content': {
|
|
145
171
|
type: String,
|
|
146
172
|
description: 'Content paths to use for removing unused classes'
|
|
@@ -169,7 +195,8 @@ let commands = {
|
|
|
169
195
|
'-i': '--input',
|
|
170
196
|
'-o': '--output',
|
|
171
197
|
'-m': '--minify',
|
|
172
|
-
'-w': '--watch'
|
|
198
|
+
'-w': '--watch',
|
|
199
|
+
'-p': '--poll'
|
|
173
200
|
}
|
|
174
201
|
}
|
|
175
202
|
};
|
|
@@ -185,10 +212,10 @@ if (process.stdout.isTTY /* Detect redirecting output to a file */ && (process.
|
|
|
185
212
|
help({
|
|
186
213
|
usage: [
|
|
187
214
|
'tailwindcss [--input input.css] [--output output.css] [--watch] [options...]',
|
|
188
|
-
'tailwindcss init [--full] [--postcss] [options...]',
|
|
215
|
+
'tailwindcss init [--full] [--postcss] [--types] [options...]',
|
|
189
216
|
],
|
|
190
|
-
commands: Object.keys(commands).filter((
|
|
191
|
-
).map((
|
|
217
|
+
commands: Object.keys(commands).filter((command2)=>command2 !== 'build'
|
|
218
|
+
).map((command3)=>`${command3} [options]`
|
|
192
219
|
),
|
|
193
220
|
options: {
|
|
194
221
|
...commands.build.args,
|
|
@@ -210,8 +237,8 @@ if (commands[command] === undefined) {
|
|
|
210
237
|
usage: [
|
|
211
238
|
'tailwindcss <command> [options]'
|
|
212
239
|
],
|
|
213
|
-
commands: Object.keys(commands).filter((
|
|
214
|
-
).map((
|
|
240
|
+
commands: Object.keys(commands).filter((command4)=>command4 !== 'build'
|
|
241
|
+
).map((command5)=>`${command5} [options]`
|
|
215
242
|
),
|
|
216
243
|
options: sharedFlags
|
|
217
244
|
});
|
|
@@ -247,16 +274,16 @@ let args = (()=>{
|
|
|
247
274
|
handler = flags[handler];
|
|
248
275
|
}
|
|
249
276
|
if (!handler) continue;
|
|
250
|
-
let
|
|
277
|
+
let args1 = [];
|
|
251
278
|
let offset = i + 1;
|
|
252
279
|
// Parse args for current flag
|
|
253
280
|
while(result['_'][offset] && !result['_'][offset].startsWith('-')){
|
|
254
|
-
|
|
281
|
+
args1.push(result['_'][offset++]);
|
|
255
282
|
}
|
|
256
283
|
// Cleanup manually parsed flags + args
|
|
257
|
-
result['_'].splice(i, 1 +
|
|
284
|
+
result['_'].splice(i, 1 + args1.length);
|
|
258
285
|
// Set the resolved value in the `result` object
|
|
259
|
-
result[flagName] = handler.type(
|
|
286
|
+
result[flagName] = handler.type(args1.length === 0 ? undefined : args1.length === 1 ? args1[0] : args1, flagName);
|
|
260
287
|
}
|
|
261
288
|
// Ensure that the `command` is always the first argument in the `args`.
|
|
262
289
|
// This is important so that we don't have to check if a default command
|
|
@@ -304,6 +331,10 @@ function init() {
|
|
|
304
331
|
messages.push(`${_path.default.basename(tailwindConfigLocation)} already exists.`);
|
|
305
332
|
} else {
|
|
306
333
|
let stubFile = _fs.default.readFileSync(args['--full'] ? _path.default.resolve(__dirname, '../stubs/defaultConfig.stub.js') : _path.default.resolve(__dirname, '../stubs/simpleConfig.stub.js'), 'utf8');
|
|
334
|
+
if (args['--types']) {
|
|
335
|
+
let typesHeading = "/** @type {import('tailwindcss/types').Config} */";
|
|
336
|
+
stubFile = stubFile.replace(`module.exports = `, `${typesHeading}\nconst config = `) + '\nmodule.exports = config';
|
|
337
|
+
}
|
|
307
338
|
// Change colors import
|
|
308
339
|
stubFile = stubFile.replace('../colors', 'tailwindcss/colors');
|
|
309
340
|
_fs.default.writeFileSync(tailwindConfigLocation, stubFile, 'utf8');
|
|
@@ -330,13 +361,18 @@ async function build() {
|
|
|
330
361
|
let input = args['--input'];
|
|
331
362
|
let output = args['--output'];
|
|
332
363
|
let shouldWatch = args['--watch'];
|
|
364
|
+
let shouldPoll = args['--poll'];
|
|
365
|
+
let shouldCoalesceWriteEvents = shouldPoll || process.platform === 'win32';
|
|
333
366
|
let includePostCss = args['--postcss'];
|
|
367
|
+
// Polling interval in milliseconds
|
|
368
|
+
// Used only when polling or coalescing add/change events on Windows
|
|
369
|
+
let pollInterval = 10;
|
|
334
370
|
// TODO: Deprecate this in future versions
|
|
335
371
|
if (!input && args['_'][1]) {
|
|
336
372
|
console.error('[deprecation] Running tailwindcss without -i, please provide an input file.');
|
|
337
373
|
input = args['--input'] = args['_'][1];
|
|
338
374
|
}
|
|
339
|
-
if (input && !_fs.default.existsSync(input = _path.default.resolve(input))) {
|
|
375
|
+
if (input && input !== '-' && !_fs.default.existsSync(input = _path.default.resolve(input))) {
|
|
340
376
|
console.error(`Specified input file ${args['--input']} does not exist.`);
|
|
341
377
|
process.exit(9);
|
|
342
378
|
}
|
|
@@ -350,14 +386,12 @@ async function build() {
|
|
|
350
386
|
let customPostCssPath = typeof args['--postcss'] === 'string' ? args['--postcss'] : undefined;
|
|
351
387
|
let { plugins: configPlugins } = customPostCssPath ? await (async ()=>{
|
|
352
388
|
let file = _path.default.resolve(customPostCssPath);
|
|
353
|
-
// Implementation, see: https://unpkg.com/browse/postcss-load-config@3.0
|
|
354
|
-
let { config ={
|
|
355
|
-
} } = await (0, _cosmiconfig).cosmiconfig('postcss').load(file);
|
|
389
|
+
// Implementation, see: https://unpkg.com/browse/postcss-load-config@3.1.0/src/index.js
|
|
390
|
+
let { config ={} } = await (0, _lilconfig).lilconfig('postcss').load(file);
|
|
356
391
|
if (typeof config === 'function') {
|
|
357
392
|
config = config();
|
|
358
393
|
} else {
|
|
359
|
-
config = Object.assign({
|
|
360
|
-
}, config);
|
|
394
|
+
config = Object.assign({}, config);
|
|
361
395
|
}
|
|
362
396
|
if (!config.plugins) {
|
|
363
397
|
config.plugins = [];
|
|
@@ -383,9 +417,7 @@ async function build() {
|
|
|
383
417
|
];
|
|
384
418
|
}
|
|
385
419
|
function resolveConfig() {
|
|
386
|
-
let config = configPath ? require(configPath) : {
|
|
387
|
-
};
|
|
388
|
-
let resolvedConfig = (0, _resolveConfig).default(config);
|
|
420
|
+
let config = configPath ? require(configPath) : {};
|
|
389
421
|
if (args['--purge']) {
|
|
390
422
|
_log.default.warn('purge-flag-deprecated', [
|
|
391
423
|
'The `--purge` flag has been deprecated.',
|
|
@@ -396,9 +428,16 @@ async function build() {
|
|
|
396
428
|
}
|
|
397
429
|
}
|
|
398
430
|
if (args['--content']) {
|
|
399
|
-
|
|
431
|
+
let files = args['--content'].split(/(?<!{[^}]+),/);
|
|
432
|
+
let resolvedConfig = (0, _resolveConfig).default(config, {
|
|
433
|
+
content: {
|
|
434
|
+
files
|
|
435
|
+
}
|
|
436
|
+
});
|
|
437
|
+
resolvedConfig.content.files = files;
|
|
438
|
+
return resolvedConfig;
|
|
400
439
|
}
|
|
401
|
-
return
|
|
440
|
+
return (0, _resolveConfig).default(config);
|
|
402
441
|
}
|
|
403
442
|
function extractFileGlobs(config) {
|
|
404
443
|
return config.content.files.filter((file)=>{
|
|
@@ -463,8 +502,7 @@ async function build() {
|
|
|
463
502
|
// Try to load a local `autoprefixer` version first
|
|
464
503
|
try {
|
|
465
504
|
return require('autoprefixer');
|
|
466
|
-
} catch {
|
|
467
|
-
}
|
|
505
|
+
} catch {}
|
|
468
506
|
return (0, _indexJs).lazyAutoprefixer();
|
|
469
507
|
})(),
|
|
470
508
|
args['--minify'] && (()=>{
|
|
@@ -479,8 +517,7 @@ async function build() {
|
|
|
479
517
|
// Try to load a local `cssnano` version first
|
|
480
518
|
try {
|
|
481
519
|
return require('cssnano');
|
|
482
|
-
} catch {
|
|
483
|
-
}
|
|
520
|
+
} catch {}
|
|
484
521
|
return (0, _indexJs).lazyCssnano()(options);
|
|
485
522
|
})(),
|
|
486
523
|
].filter(Boolean);
|
|
@@ -499,10 +536,8 @@ async function build() {
|
|
|
499
536
|
return process.stdout.write(result.css);
|
|
500
537
|
}
|
|
501
538
|
return Promise.all([
|
|
502
|
-
|
|
503
|
-
),
|
|
504
|
-
result.map && _fs.default.writeFile(output + '.map', result.map.toString(), ()=>true
|
|
505
|
-
),
|
|
539
|
+
outputFile(output, result.css),
|
|
540
|
+
result.map && outputFile(output + '.map', result.map.toString()),
|
|
506
541
|
].filter(Boolean));
|
|
507
542
|
}).then(()=>{
|
|
508
543
|
let end = process.hrtime.bigint();
|
|
@@ -510,8 +545,19 @@ async function build() {
|
|
|
510
545
|
console.error('Done in', (end - start) / BigInt(1000000) + 'ms.');
|
|
511
546
|
});
|
|
512
547
|
}
|
|
513
|
-
let
|
|
514
|
-
|
|
548
|
+
let css1 = await (()=>{
|
|
549
|
+
// Piping in data, let's drain the stdin
|
|
550
|
+
if (input === '-') {
|
|
551
|
+
return drainStdin();
|
|
552
|
+
}
|
|
553
|
+
// Input file has been provided
|
|
554
|
+
if (input) {
|
|
555
|
+
return _fs.default.readFileSync(_path.default.resolve(input), 'utf8');
|
|
556
|
+
}
|
|
557
|
+
// No input file provided, fallback to default atrules
|
|
558
|
+
return '@tailwind base; @tailwind components; @tailwind utilities';
|
|
559
|
+
})();
|
|
560
|
+
return processCSS(css1);
|
|
515
561
|
}
|
|
516
562
|
let context = null;
|
|
517
563
|
async function startWatcher() {
|
|
@@ -521,8 +567,8 @@ async function build() {
|
|
|
521
567
|
let watcher = null;
|
|
522
568
|
function refreshConfig() {
|
|
523
569
|
env.DEBUG && console.time('Module dependencies');
|
|
524
|
-
for (let
|
|
525
|
-
delete require.cache[require.resolve(
|
|
570
|
+
for (let file1 of configDependencies){
|
|
571
|
+
delete require.cache[require.resolve(file1)];
|
|
526
572
|
}
|
|
527
573
|
if (configPath) {
|
|
528
574
|
configDependencies = (0, _getModuleDependencies).default(configPath).map(({ file })=>file
|
|
@@ -547,8 +593,7 @@ async function build() {
|
|
|
547
593
|
// Try to load a local `autoprefixer` version first
|
|
548
594
|
try {
|
|
549
595
|
return require('autoprefixer');
|
|
550
|
-
} catch {
|
|
551
|
-
}
|
|
596
|
+
} catch {}
|
|
552
597
|
return (0, _indexJs).lazyAutoprefixer();
|
|
553
598
|
})(),
|
|
554
599
|
args['--minify'] && (()=>{
|
|
@@ -563,8 +608,7 @@ async function build() {
|
|
|
563
608
|
// Try to load a local `cssnano` version first
|
|
564
609
|
try {
|
|
565
610
|
return require('cssnano');
|
|
566
|
-
} catch {
|
|
567
|
-
}
|
|
611
|
+
} catch {}
|
|
568
612
|
return (0, _indexJs).lazyCssnano()(options);
|
|
569
613
|
})(),
|
|
570
614
|
].filter(Boolean);
|
|
@@ -619,11 +663,9 @@ async function build() {
|
|
|
619
663
|
if (!output) {
|
|
620
664
|
return process.stdout.write(result.css);
|
|
621
665
|
}
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
),
|
|
625
|
-
result.map && _fs.default.writeFile(output + '.map', result.map.toString(), ()=>true
|
|
626
|
-
),
|
|
666
|
+
return Promise.all([
|
|
667
|
+
outputFile(output, result.css),
|
|
668
|
+
result.map && outputFile(output + '.map', result.map.toString()),
|
|
627
669
|
].filter(Boolean));
|
|
628
670
|
}).then(()=>{
|
|
629
671
|
let end = process.hrtime.bigint();
|
|
@@ -636,23 +678,36 @@ async function build() {
|
|
|
636
678
|
}
|
|
637
679
|
});
|
|
638
680
|
}
|
|
639
|
-
let
|
|
640
|
-
|
|
681
|
+
let css2 = await (()=>{
|
|
682
|
+
// Piping in data, let's drain the stdin
|
|
683
|
+
if (input === '-') {
|
|
684
|
+
return drainStdin();
|
|
685
|
+
}
|
|
686
|
+
// Input file has been provided
|
|
687
|
+
if (input) {
|
|
688
|
+
return _fs.default.readFileSync(_path.default.resolve(input), 'utf8');
|
|
689
|
+
}
|
|
690
|
+
// No input file provided, fallback to default atrules
|
|
691
|
+
return '@tailwind base; @tailwind components; @tailwind utilities';
|
|
692
|
+
})();
|
|
693
|
+
let result1 = await processCSS(css2);
|
|
641
694
|
env.DEBUG && console.timeEnd('Finished in');
|
|
642
695
|
return result1;
|
|
643
696
|
}
|
|
644
|
-
let
|
|
697
|
+
let config1 = refreshConfig(configPath);
|
|
645
698
|
if (input) {
|
|
646
699
|
contextDependencies.add(_path.default.resolve(input));
|
|
647
700
|
}
|
|
648
701
|
watcher = _chokidar.default.watch([
|
|
649
702
|
...contextDependencies,
|
|
650
|
-
...extractFileGlobs(
|
|
703
|
+
...extractFileGlobs(config1)
|
|
651
704
|
], {
|
|
705
|
+
usePolling: shouldPoll,
|
|
706
|
+
interval: shouldPoll ? pollInterval : undefined,
|
|
652
707
|
ignoreInitial: true,
|
|
653
|
-
awaitWriteFinish:
|
|
708
|
+
awaitWriteFinish: shouldCoalesceWriteEvents ? {
|
|
654
709
|
stabilityThreshold: 50,
|
|
655
|
-
pollInterval:
|
|
710
|
+
pollInterval: pollInterval
|
|
656
711
|
} : false
|
|
657
712
|
});
|
|
658
713
|
let chain = Promise.resolve();
|
|
@@ -660,16 +715,16 @@ async function build() {
|
|
|
660
715
|
if (contextDependencies.has(file)) {
|
|
661
716
|
env.DEBUG && console.time('Resolve config');
|
|
662
717
|
context = null;
|
|
663
|
-
|
|
718
|
+
config1 = refreshConfig(configPath);
|
|
664
719
|
env.DEBUG && console.timeEnd('Resolve config');
|
|
665
720
|
env.DEBUG && console.time('Watch new files');
|
|
666
|
-
let globs = extractFileGlobs(
|
|
721
|
+
let globs = extractFileGlobs(config1);
|
|
667
722
|
watcher.add(configDependencies);
|
|
668
723
|
watcher.add(globs);
|
|
669
724
|
env.DEBUG && console.timeEnd('Watch new files');
|
|
670
725
|
chain = chain.then(async ()=>{
|
|
671
|
-
changedContent.push(...getChangedContent(
|
|
672
|
-
await rebuild(
|
|
726
|
+
changedContent.push(...getChangedContent(config1));
|
|
727
|
+
await rebuild(config1);
|
|
673
728
|
});
|
|
674
729
|
} else {
|
|
675
730
|
chain = chain.then(async ()=>{
|
|
@@ -677,7 +732,7 @@ async function build() {
|
|
|
677
732
|
content: _fs.default.readFileSync(_path.default.resolve(file), 'utf8'),
|
|
678
733
|
extension: _path.default.extname(file).slice(1)
|
|
679
734
|
});
|
|
680
|
-
await rebuild(
|
|
735
|
+
await rebuild(config1);
|
|
681
736
|
});
|
|
682
737
|
}
|
|
683
738
|
});
|
|
@@ -687,12 +742,12 @@ async function build() {
|
|
|
687
742
|
content: _fs.default.readFileSync(_path.default.resolve(file), 'utf8'),
|
|
688
743
|
extension: _path.default.extname(file).slice(1)
|
|
689
744
|
});
|
|
690
|
-
await rebuild(
|
|
745
|
+
await rebuild(config1);
|
|
691
746
|
});
|
|
692
747
|
});
|
|
693
748
|
chain = chain.then(()=>{
|
|
694
|
-
changedContent.push(...getChangedContent(
|
|
695
|
-
return rebuild(
|
|
749
|
+
changedContent.push(...getChangedContent(config1));
|
|
750
|
+
return rebuild(config1);
|
|
696
751
|
});
|
|
697
752
|
}
|
|
698
753
|
if (shouldWatch) {
|
package/lib/constants.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
exports.
|
|
5
|
+
exports.defaultPostCssConfigStubFile = exports.simpleConfigStubFile = exports.defaultConfigStubFile = exports.supportedPostCssConfigFile = exports.supportedConfigFiles = exports.cjsPostCssConfigFile = exports.cjsConfigFile = exports.defaultPostCssConfigFile = exports.defaultConfigFile = exports.cli = void 0;
|
|
6
6
|
var _path = _interopRequireDefault(require("path"));
|
|
7
7
|
function _interopRequireDefault(obj) {
|
|
8
8
|
return obj && obj.__esModule ? obj : {
|
package/lib/corePluginList.js
CHANGED
|
@@ -38,6 +38,7 @@ var _default = [
|
|
|
38
38
|
"flexBasis",
|
|
39
39
|
"tableLayout",
|
|
40
40
|
"borderCollapse",
|
|
41
|
+
"borderSpacing",
|
|
41
42
|
"transformOrigin",
|
|
42
43
|
"translate",
|
|
43
44
|
"rotate",
|
|
@@ -126,6 +127,9 @@ var _default = [
|
|
|
126
127
|
"textOpacity",
|
|
127
128
|
"textDecoration",
|
|
128
129
|
"textDecorationColor",
|
|
130
|
+
"textDecorationStyle",
|
|
131
|
+
"textDecorationThickness",
|
|
132
|
+
"textUnderlineOffset",
|
|
129
133
|
"fontSmoothing",
|
|
130
134
|
"placeholderColor",
|
|
131
135
|
"placeholderOpacity",
|
|
@@ -135,7 +139,11 @@ var _default = [
|
|
|
135
139
|
"backgroundBlendMode",
|
|
136
140
|
"mixBlendMode",
|
|
137
141
|
"boxShadow",
|
|
138
|
-
"
|
|
142
|
+
"boxShadowColor",
|
|
143
|
+
"outlineStyle",
|
|
144
|
+
"outlineWidth",
|
|
145
|
+
"outlineOffset",
|
|
146
|
+
"outlineColor",
|
|
139
147
|
"ringWidth",
|
|
140
148
|
"ringColor",
|
|
141
149
|
"ringOpacity",
|