tailwindcss 0.0.0-insiders.776d5bf → 0.0.0-insiders.778bea7

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.
Files changed (45) hide show
  1. package/lib/cli/build/plugin.js +13 -9
  2. package/lib/cli/build/watching.js +1 -1
  3. package/lib/cli/help/index.js +2 -2
  4. package/lib/cli/index.js +3 -3
  5. package/lib/corePlugins.js +160 -162
  6. package/lib/featureFlags.js +6 -5
  7. package/lib/lib/content.js +2 -2
  8. package/lib/lib/evaluateTailwindFunctions.js +4 -4
  9. package/lib/lib/expandTailwindAtRules.js +10 -9
  10. package/lib/lib/generateRules.js +19 -11
  11. package/lib/lib/resolveDefaultsAtRules.js +1 -1
  12. package/lib/lib/setupContextUtils.js +66 -41
  13. package/lib/lib/setupTrackingContext.js +3 -2
  14. package/lib/lib/substituteScreenAtRules.js +2 -2
  15. package/lib/plugin.js +9 -5
  16. package/lib/postcss-plugins/nesting/index.js +1 -1
  17. package/lib/postcss-plugins/nesting/plugin.js +2 -2
  18. package/lib/processTailwindFeatures.js +3 -3
  19. package/lib/public/colors.js +1 -1
  20. package/lib/util/color.js +3 -3
  21. package/lib/util/createUtilityPlugin.js +2 -2
  22. package/lib/util/dataTypes.js +61 -7
  23. package/lib/util/defaults.js +4 -4
  24. package/lib/util/escapeClassName.js +2 -2
  25. package/lib/util/formatVariantSelector.js +11 -9
  26. package/lib/util/getAllConfigs.js +3 -2
  27. package/lib/util/normalizeConfig.js +26 -21
  28. package/lib/util/normalizeScreens.js +3 -3
  29. package/lib/util/pluginUtils.js +6 -6
  30. package/lib/util/prefixSelector.js +1 -1
  31. package/lib/util/resolveConfig.js +10 -6
  32. package/lib/util/withAlphaVariable.js +1 -1
  33. package/package.json +13 -13
  34. package/src/cli/build/plugin.js +8 -4
  35. package/src/corePlugins.js +14 -14
  36. package/src/lib/expandTailwindAtRules.js +15 -11
  37. package/src/lib/generateRules.js +13 -6
  38. package/src/lib/setupContextUtils.js +18 -5
  39. package/src/plugin.js +9 -4
  40. package/src/processTailwindFeatures.js +3 -2
  41. package/src/util/dataTypes.js +59 -11
  42. package/src/util/formatVariantSelector.js +4 -3
  43. package/src/util/normalizeConfig.js +1 -1
  44. package/src/util/prefixSelector.js +1 -0
  45. package/types/config.d.ts +6 -6
@@ -79,7 +79,10 @@ function _interop_require_wildcard(obj, nodeInterop) {
79
79
  }
80
80
  return newObj;
81
81
  }
82
- async function lightningcss(result, { map =true , minify =true } = {}) {
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 } = {}) {
83
86
  try {
84
87
  var _browserslist_findConfig;
85
88
  var _result_opts_from;
@@ -123,7 +126,7 @@ async function lightningcss(result, { map =true , minify =true } = {}) {
123
126
  let file = _path.default.resolve(customPostCssPath);
124
127
  // Implementation, see: https://unpkg.com/browse/postcss-load-config@3.1.0/src/index.js
125
128
  // @ts-ignore
126
- let { config ={} } = await (0, _lilconfig.lilconfig)("postcss").load(file);
129
+ let { config = {} } = await (0, _lilconfig.lilconfig)("postcss").load(file);
127
130
  if (typeof config === "function") {
128
131
  config = config();
129
132
  } else {
@@ -177,6 +180,7 @@ let state = {
177
180
  };
178
181
  },
179
182
  loadConfig (configPath, content) {
183
+ var _content;
180
184
  if (this.watcher && configPath) {
181
185
  this.refreshConfigDependencies();
182
186
  }
@@ -193,7 +197,7 @@ let state = {
193
197
  };
194
198
  this.configBag.config = (0, _validateConfig.validateConfig)((0, _resolveConfig.default)(this.configBag.config));
195
199
  // Override content files if `--content` has been passed explicitly
196
- if ((content === null || content === void 0 ? void 0 : content.length) > 0) {
200
+ if (((_content = content) === null || _content === void 0 ? void 0 : _content.length) > 0) {
197
201
  this.configBag.config.content.files = content;
198
202
  }
199
203
  return this.configBag.config;
@@ -226,7 +230,7 @@ let state = {
226
230
  let rawContent = this.config.content.files.filter((file)=>{
227
231
  return file !== null && typeof file === "object";
228
232
  });
229
- for (let { raw: htmlContent , extension ="html" } of rawContent){
233
+ for (let { raw: htmlContent, extension = "html" } of rawContent){
230
234
  content.push({
231
235
  content: htmlContent,
232
236
  extension
@@ -234,7 +238,7 @@ let state = {
234
238
  }
235
239
  return content;
236
240
  },
237
- getContext ({ createContext , cliConfigPath , root , result , content }) {
241
+ getContext ({ createContext, cliConfigPath, root, result, content }) {
238
242
  if (this.context) {
239
243
  this.context.changedContent = this.changedContent.splice(0);
240
244
  return this.context;
@@ -292,9 +296,9 @@ async function createProcessor(args, cliConfigPath) {
292
296
  let tailwindPlugin = ()=>{
293
297
  return {
294
298
  postcssPlugin: "tailwindcss",
295
- Once (root, { result }) {
299
+ async Once (root, { result }) {
296
300
  _sharedState.env.DEBUG && console.time("Compiling CSS");
297
- (0, _processTailwindFeatures.default)(({ createContext })=>{
301
+ await (0, _processTailwindFeatures.default)(({ createContext })=>{
298
302
  console.error();
299
303
  console.error("Rebuilding...");
300
304
  return ()=>{
@@ -360,11 +364,11 @@ async function createProcessor(args, cliConfigPath) {
360
364
  return result;
361
365
  }).then((result)=>{
362
366
  if (!output) {
363
- process.stdout.write(result.css);
367
+ process.stdout.write(license() + result.css);
364
368
  return;
365
369
  }
366
370
  return Promise.all([
367
- (0, _utils.outputFile)(result.opts.to, result.css),
371
+ (0, _utils.outputFile)(result.opts.to, license() + result.css),
368
372
  result.map && (0, _utils.outputFile)(result.opts.to + ".map", result.map.toString())
369
373
  ]);
370
374
  }).then(()=>{
@@ -20,7 +20,7 @@ function _interop_require_default(obj) {
20
20
  default: obj
21
21
  };
22
22
  }
23
- function createWatcher(args, { state , rebuild }) {
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
@@ -15,7 +15,7 @@ function _interop_require_default(obj) {
15
15
  default: obj
16
16
  };
17
17
  }
18
- function help({ message , usage , commands , options }) {
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 , description , deprecated } of Object.values(groupedOptions)){
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
@@ -144,15 +144,15 @@ if (commands[command] === undefined) {
144
144
  }
145
145
  }
146
146
  // Execute command
147
- let { args: flags , run } = commands[command];
147
+ let { args: flags, run } = commands[command];
148
148
  let args = (()=>{
149
149
  try {
150
150
  let result = (0, _arg.default)(Object.fromEntries(Object.entries({
151
151
  ...flags,
152
152
  ...sharedFlags
153
153
  }).filter(([_key, value])=>{
154
- var _value_type;
155
- return !(value === null || value === void 0 ? void 0 : (_value_type = value.type) === null || _value_type === void 0 ? void 0 : _value_type.manualParsing);
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);
156
156
  }).map(([key, value])=>[
157
157
  key,
158
158
  typeof value === "object" ? value.type : value