tailwindcss 0.0.0-insiders.e2d5f21 → 0.0.0-insiders.e302ef1
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 +244 -3
- package/LICENSE +1 -2
- package/README.md +8 -4
- package/colors.js +2 -1
- package/defaultConfig.js +2 -1
- package/defaultTheme.js +2 -1
- package/lib/cli.js +123 -88
- package/lib/corePlugins.js +288 -360
- package/lib/css/preflight.css +4 -4
- package/lib/featureFlags.js +4 -5
- 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 +52 -1
- package/lib/lib/defaultExtractor.js +44 -0
- package/lib/lib/evaluateTailwindFunctions.js +1 -1
- package/lib/lib/expandApplyAtRules.js +265 -60
- package/lib/lib/expandTailwindAtRules.js +63 -48
- package/lib/lib/generateRules.js +136 -34
- package/lib/lib/normalizeTailwindDirectives.js +10 -2
- package/lib/lib/partitionApplyAtRules.js +53 -0
- package/lib/lib/resolveDefaultsAtRules.js +30 -12
- package/lib/lib/setupContextUtils.js +137 -81
- package/lib/lib/setupTrackingContext.js +8 -7
- package/lib/lib/sharedState.js +38 -5
- 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/cloneNodes.js +12 -1
- package/lib/util/color.js +23 -8
- package/lib/util/createPlugin.js +1 -2
- package/lib/util/createUtilityPlugin.js +4 -8
- package/lib/util/dataTypes.js +4 -2
- package/lib/util/defaults.js +6 -0
- package/lib/util/flattenColorPalette.js +1 -3
- package/lib/util/log.js +10 -6
- package/lib/util/normalizeConfig.js +47 -15
- package/lib/util/normalizeScreens.js +6 -5
- package/lib/util/parseBoxShadowValue.js +44 -4
- package/lib/util/pluginUtils.js +6 -13
- package/lib/util/prefixSelector.js +4 -5
- package/lib/util/resolveConfig.js +48 -27
- 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 +4 -8
- package/nesting/index.js +2 -12
- package/package.json +28 -33
- package/peers/index.js +3209 -4239
- package/plugin.js +2 -1
- package/resolveConfig.js +2 -1
- package/src/cli.js +62 -15
- package/src/corePlugins.js +212 -217
- package/src/css/preflight.css +4 -4
- 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/evaluateTailwindFunctions.js +1 -1
- package/src/lib/expandApplyAtRules.js +285 -56
- package/src/lib/expandTailwindAtRules.js +75 -37
- package/src/lib/generateRules.js +121 -27
- 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 +127 -45
- package/src/lib/setupTrackingContext.js +8 -7
- package/src/lib/sharedState.js +42 -4
- 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/cloneNodes.js +14 -1
- package/src/util/color.js +20 -7
- package/src/util/dataTypes.js +7 -5
- package/src/util/defaults.js +6 -0
- package/src/util/log.js +10 -6
- package/src/util/normalizeConfig.js +24 -3
- package/src/util/normalizeScreens.js +6 -3
- package/src/util/parseBoxShadowValue.js +51 -3
- package/src/util/pluginUtils.js +1 -1
- package/src/util/prefixSelector.js +7 -5
- package/src/util/resolveConfig.js +41 -1
- package/src/util/toPath.js +23 -1
- package/stubs/defaultConfig.stub.js +2 -2
- package/lib/lib/setupWatchingContext.js +0 -288
- package/nesting/plugin.js +0 -41
- package/src/lib/setupWatchingContext.js +0 -311
package/plugin.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
let createPlugin = require('./lib/public/create-plugin')
|
|
2
|
+
module.exports = (createPlugin.__esModule ? createPlugin : { default: createPlugin }).default
|
package/resolveConfig.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
let resolveConfig = require('./lib/public/resolve-config')
|
|
2
|
+
module.exports = (resolveConfig.__esModule ? resolveConfig : { default: resolveConfig }).default
|
package/src/cli.js
CHANGED
|
@@ -41,6 +41,26 @@ function formatNodes(root) {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
async function outputFile(file, contents) {
|
|
45
|
+
if (fs.existsSync(file) && (await fs.promises.readFile(file, 'utf8')) === contents) {
|
|
46
|
+
return // Skip writing the file
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Write the file
|
|
50
|
+
await fs.promises.writeFile(file, contents, 'utf8')
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function drainStdin() {
|
|
54
|
+
return new Promise((resolve, reject) => {
|
|
55
|
+
let result = ''
|
|
56
|
+
process.stdin.on('data', (chunk) => {
|
|
57
|
+
result += chunk
|
|
58
|
+
})
|
|
59
|
+
process.stdin.on('end', () => resolve(result))
|
|
60
|
+
process.stdin.on('error', (err) => reject(err))
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
|
|
44
64
|
function help({ message, usage, commands, options }) {
|
|
45
65
|
let indent = 2
|
|
46
66
|
|
|
@@ -355,7 +375,7 @@ async function build() {
|
|
|
355
375
|
input = args['--input'] = args['_'][1]
|
|
356
376
|
}
|
|
357
377
|
|
|
358
|
-
if (input && !fs.existsSync((input = path.resolve(input)))) {
|
|
378
|
+
if (input && input !== '-' && !fs.existsSync((input = path.resolve(input)))) {
|
|
359
379
|
console.error(`Specified input file ${args['--input']} does not exist.`)
|
|
360
380
|
process.exit(9)
|
|
361
381
|
}
|
|
@@ -417,7 +437,6 @@ async function build() {
|
|
|
417
437
|
|
|
418
438
|
function resolveConfig() {
|
|
419
439
|
let config = configPath ? require(configPath) : {}
|
|
420
|
-
let resolvedConfig = resolveConfigInternal(config)
|
|
421
440
|
|
|
422
441
|
if (args['--purge']) {
|
|
423
442
|
log.warn('purge-flag-deprecated', [
|
|
@@ -430,10 +449,13 @@ async function build() {
|
|
|
430
449
|
}
|
|
431
450
|
|
|
432
451
|
if (args['--content']) {
|
|
433
|
-
|
|
452
|
+
let files = args['--content'].split(/(?<!{[^}]+),/)
|
|
453
|
+
let resolvedConfig = resolveConfigInternal(config, { content: { files } })
|
|
454
|
+
resolvedConfig.content.files = files
|
|
455
|
+
return resolvedConfig
|
|
434
456
|
}
|
|
435
457
|
|
|
436
|
-
return
|
|
458
|
+
return resolveConfigInternal(config)
|
|
437
459
|
}
|
|
438
460
|
|
|
439
461
|
function extractFileGlobs(config) {
|
|
@@ -534,10 +556,11 @@ async function build() {
|
|
|
534
556
|
if (!output) {
|
|
535
557
|
return process.stdout.write(result.css)
|
|
536
558
|
}
|
|
559
|
+
|
|
537
560
|
return Promise.all(
|
|
538
561
|
[
|
|
539
|
-
|
|
540
|
-
result.map &&
|
|
562
|
+
outputFile(output, result.css),
|
|
563
|
+
result.map && outputFile(output + '.map', result.map.toString()),
|
|
541
564
|
].filter(Boolean)
|
|
542
565
|
)
|
|
543
566
|
})
|
|
@@ -548,9 +571,21 @@ async function build() {
|
|
|
548
571
|
})
|
|
549
572
|
}
|
|
550
573
|
|
|
551
|
-
let css =
|
|
552
|
-
|
|
553
|
-
|
|
574
|
+
let css = await (() => {
|
|
575
|
+
// Piping in data, let's drain the stdin
|
|
576
|
+
if (input === '-') {
|
|
577
|
+
return drainStdin()
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
// Input file has been provided
|
|
581
|
+
if (input) {
|
|
582
|
+
return fs.readFileSync(path.resolve(input), 'utf8')
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
// No input file provided, fallback to default atrules
|
|
586
|
+
return '@tailwind base; @tailwind components; @tailwind utilities'
|
|
587
|
+
})()
|
|
588
|
+
|
|
554
589
|
return processCSS(css)
|
|
555
590
|
}
|
|
556
591
|
|
|
@@ -664,10 +699,10 @@ async function build() {
|
|
|
664
699
|
return process.stdout.write(result.css)
|
|
665
700
|
}
|
|
666
701
|
|
|
667
|
-
|
|
702
|
+
return Promise.all(
|
|
668
703
|
[
|
|
669
|
-
|
|
670
|
-
result.map &&
|
|
704
|
+
outputFile(output, result.css),
|
|
705
|
+
result.map && outputFile(output + '.map', result.map.toString()),
|
|
671
706
|
].filter(Boolean)
|
|
672
707
|
)
|
|
673
708
|
})
|
|
@@ -684,9 +719,21 @@ async function build() {
|
|
|
684
719
|
})
|
|
685
720
|
}
|
|
686
721
|
|
|
687
|
-
let css =
|
|
688
|
-
|
|
689
|
-
|
|
722
|
+
let css = await (() => {
|
|
723
|
+
// Piping in data, let's drain the stdin
|
|
724
|
+
if (input === '-') {
|
|
725
|
+
return drainStdin()
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
// Input file has been provided
|
|
729
|
+
if (input) {
|
|
730
|
+
return fs.readFileSync(path.resolve(input), 'utf8')
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
// No input file provided, fallback to default atrules
|
|
734
|
+
return '@tailwind base; @tailwind components; @tailwind utilities'
|
|
735
|
+
})()
|
|
736
|
+
|
|
690
737
|
let result = await processCSS(css)
|
|
691
738
|
env.DEBUG && console.timeEnd('Finished in')
|
|
692
739
|
return result
|