tailwindcss 3.2.3 → 3.2.5

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 (103) hide show
  1. package/CHANGELOG.md +56 -1
  2. package/README.md +1 -1
  3. package/lib/cli/build/index.js +5 -1
  4. package/lib/cli/build/plugin.js +50 -34
  5. package/lib/cli/build/watching.js +6 -3
  6. package/lib/cli/index.js +231 -10
  7. package/lib/cli/init/index.js +2 -2
  8. package/lib/cli.js +4 -226
  9. package/lib/corePlugins.js +45 -27
  10. package/lib/featureFlags.js +8 -8
  11. package/lib/index.js +4 -46
  12. package/lib/lib/collapseAdjacentRules.js +2 -2
  13. package/lib/lib/collapseDuplicateDeclarations.js +2 -2
  14. package/lib/lib/content.js +16 -16
  15. package/lib/lib/defaultExtractor.js +10 -5
  16. package/lib/lib/detectNesting.js +7 -1
  17. package/lib/lib/evaluateTailwindFunctions.js +4 -4
  18. package/lib/lib/expandApplyAtRules.js +2 -2
  19. package/lib/lib/expandTailwindAtRules.js +35 -9
  20. package/lib/lib/findAtConfigPath.js +3 -3
  21. package/lib/lib/generateRules.js +105 -50
  22. package/lib/lib/offsets.js +88 -1
  23. package/lib/lib/remap-bitfield.js +87 -0
  24. package/lib/lib/resolveDefaultsAtRules.js +4 -4
  25. package/lib/lib/setupContextUtils.js +122 -79
  26. package/lib/lib/setupTrackingContext.js +25 -4
  27. package/lib/lib/sharedState.js +19 -1
  28. package/lib/oxide/cli/build/deps.js +81 -0
  29. package/lib/oxide/cli/build/index.js +47 -0
  30. package/lib/oxide/cli/build/plugin.js +364 -0
  31. package/lib/oxide/cli/build/utils.js +77 -0
  32. package/lib/oxide/cli/build/watching.js +177 -0
  33. package/lib/oxide/cli/help/index.js +70 -0
  34. package/lib/oxide/cli/index.js +220 -0
  35. package/lib/oxide/cli/init/index.js +35 -0
  36. package/lib/oxide/cli.js +5 -0
  37. package/lib/oxide/postcss-plugin.js +2 -0
  38. package/lib/plugin.js +98 -0
  39. package/lib/postcss-plugins/nesting/plugin.js +2 -2
  40. package/lib/util/cloneNodes.js +2 -2
  41. package/lib/util/color.js +20 -6
  42. package/lib/util/createUtilityPlugin.js +2 -2
  43. package/lib/util/dataTypes.js +26 -2
  44. package/lib/util/defaults.js +4 -4
  45. package/lib/util/escapeClassName.js +3 -3
  46. package/lib/util/formatVariantSelector.js +171 -105
  47. package/lib/util/getAllConfigs.js +2 -2
  48. package/lib/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +2 -2
  49. package/lib/util/negateValue.js +2 -2
  50. package/lib/util/normalizeConfig.js +36 -22
  51. package/lib/util/pluginUtils.js +38 -40
  52. package/lib/util/prefixSelector.js +22 -8
  53. package/lib/util/resolveConfig.js +8 -10
  54. package/oxide-node-api-shim/index.js +21 -0
  55. package/oxide-node-api-shim/package.json +5 -0
  56. package/package.json +32 -19
  57. package/peers/index.js +61 -42
  58. package/resolveConfig.d.ts +11 -2
  59. package/scripts/swap-engines.js +40 -0
  60. package/src/cli/build/index.js +6 -2
  61. package/src/cli/build/plugin.js +31 -9
  62. package/src/cli/build/watching.js +6 -3
  63. package/src/cli/index.js +234 -3
  64. package/src/cli.js +4 -220
  65. package/src/corePlugins.js +31 -3
  66. package/src/index.js +4 -46
  67. package/src/lib/content.js +12 -17
  68. package/src/lib/defaultExtractor.js +9 -3
  69. package/src/lib/detectNesting.js +9 -1
  70. package/src/lib/expandTailwindAtRules.js +37 -6
  71. package/src/lib/generateRules.js +90 -28
  72. package/src/lib/offsets.js +104 -1
  73. package/src/lib/remap-bitfield.js +82 -0
  74. package/src/lib/setupContextUtils.js +99 -56
  75. package/src/lib/setupTrackingContext.js +31 -6
  76. package/src/lib/sharedState.js +17 -0
  77. package/src/oxide/cli/build/deps.ts +91 -0
  78. package/src/oxide/cli/build/index.ts +47 -0
  79. package/src/oxide/cli/build/plugin.ts +436 -0
  80. package/src/oxide/cli/build/utils.ts +74 -0
  81. package/src/oxide/cli/build/watching.ts +225 -0
  82. package/src/oxide/cli/help/index.ts +69 -0
  83. package/src/oxide/cli/index.ts +212 -0
  84. package/src/oxide/cli/init/index.ts +32 -0
  85. package/src/oxide/cli.ts +1 -0
  86. package/src/oxide/postcss-plugin.ts +1 -0
  87. package/src/plugin.js +107 -0
  88. package/src/util/color.js +17 -2
  89. package/src/util/dataTypes.js +29 -4
  90. package/src/util/formatVariantSelector.js +215 -122
  91. package/src/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +1 -1
  92. package/src/util/negateValue.js +1 -1
  93. package/src/util/normalizeConfig.js +18 -0
  94. package/src/util/pluginUtils.js +22 -19
  95. package/src/util/prefixSelector.js +28 -10
  96. package/src/util/resolveConfig.js +0 -2
  97. package/stubs/defaultConfig.stub.js +149 -165
  98. package/types/config.d.ts +7 -2
  99. package/types/generated/default-theme.d.ts +77 -77
  100. package/lib/cli/shared.js +0 -12
  101. package/scripts/install-integrations.js +0 -27
  102. package/scripts/rebuildFixtures.js +0 -68
  103. package/src/cli/shared.js +0 -5
@@ -80,8 +80,8 @@ function asNegativeValue(modifier, lookup = {}, validate) {
80
80
  }
81
81
  }
82
82
  function asValue(modifier, options = {}, { validate =()=>true } = {}) {
83
- var ref;
84
- let value = (ref = options.values) === null || ref === void 0 ? void 0 : ref[modifier];
83
+ var _options_values;
84
+ let value = (_options_values = options.values) === null || _options_values === void 0 ? void 0 : _options_values[modifier];
85
85
  if (value !== undefined) {
86
86
  return value;
87
87
  }
@@ -123,19 +123,19 @@ function parseColorFormat(value) {
123
123
  }
124
124
  return value;
125
125
  }
126
- function asColor(_, options = {}, { tailwindConfig ={} , utilityModifier , rawModifier } = {}) {
127
- var ref;
128
- if (((ref = options.values) === null || ref === void 0 ? void 0 : ref[rawModifier]) !== undefined) {
129
- var ref1;
130
- return parseColorFormat((ref1 = options.values) === null || ref1 === void 0 ? void 0 : ref1[rawModifier]);
126
+ function asColor(modifier, options = {}, { tailwindConfig ={} } = {}) {
127
+ var _options_values;
128
+ if (((_options_values = options.values) === null || _options_values === void 0 ? void 0 : _options_values[modifier]) !== undefined) {
129
+ var _options_values1;
130
+ return parseColorFormat((_options_values1 = options.values) === null || _options_values1 === void 0 ? void 0 : _options_values1[modifier]);
131
131
  }
132
132
  // TODO: Hoist this up to getMatchingTypes or something
133
133
  // We do this here because we need the alpha value (if any)
134
- let [color, alpha] = splitUtilityModifier(rawModifier);
134
+ let [color, alpha] = splitUtilityModifier(modifier);
135
135
  if (alpha !== undefined) {
136
- var ref2, ref3, ref4;
137
- var ref5;
138
- let normalizedColor = (ref5 = (ref2 = options.values) === null || ref2 === void 0 ? void 0 : ref2[color]) !== null && ref5 !== void 0 ? ref5 : isArbitraryValue(color) ? color.slice(1, -1) : undefined;
136
+ var _options_values2, _tailwindConfig_theme, _tailwindConfig_theme_opacity;
137
+ var _options_values_color;
138
+ let normalizedColor = (_options_values_color = (_options_values2 = options.values) === null || _options_values2 === void 0 ? void 0 : _options_values2[color]) !== null && _options_values_color !== void 0 ? _options_values_color : isArbitraryValue(color) ? color.slice(1, -1) : undefined;
139
139
  if (normalizedColor === undefined) {
140
140
  return undefined;
141
141
  }
@@ -143,25 +143,22 @@ function asColor(_, options = {}, { tailwindConfig ={} , utilityModifier , rawMo
143
143
  if (isArbitraryValue(alpha)) {
144
144
  return (0, _withAlphaVariable.withAlphaValue)(normalizedColor, alpha.slice(1, -1));
145
145
  }
146
- if (((ref3 = tailwindConfig.theme) === null || ref3 === void 0 ? void 0 : (ref4 = ref3.opacity) === null || ref4 === void 0 ? void 0 : ref4[alpha]) === undefined) {
146
+ if (((_tailwindConfig_theme = tailwindConfig.theme) === null || _tailwindConfig_theme === void 0 ? void 0 : (_tailwindConfig_theme_opacity = _tailwindConfig_theme.opacity) === null || _tailwindConfig_theme_opacity === void 0 ? void 0 : _tailwindConfig_theme_opacity[alpha]) === undefined) {
147
147
  return undefined;
148
148
  }
149
149
  return (0, _withAlphaVariable.withAlphaValue)(normalizedColor, tailwindConfig.theme.opacity[alpha]);
150
150
  }
151
- return asValue(rawModifier, options, {
152
- rawModifier,
153
- utilityModifier,
151
+ return asValue(modifier, options, {
154
152
  validate: _dataTypes.color
155
153
  });
156
154
  }
157
155
  function asLookupValue(modifier, options = {}) {
158
- var ref;
159
- return (ref = options.values) === null || ref === void 0 ? void 0 : ref[modifier];
156
+ var _options_values;
157
+ return (_options_values = options.values) === null || _options_values === void 0 ? void 0 : _options_values[modifier];
160
158
  }
161
159
  function guess(validate) {
162
- return (modifier, options, extras)=>{
160
+ return (modifier, options)=>{
163
161
  return asValue(modifier, options, {
164
- ...extras,
165
162
  validate
166
163
  });
167
164
  };
@@ -197,6 +194,21 @@ function splitAtFirst(input, delim) {
197
194
  ];
198
195
  }
199
196
  function coerceValue(types, modifier, options, tailwindConfig) {
197
+ if (options.values && modifier in options.values) {
198
+ for (let { type } of types !== null && types !== void 0 ? types : []){
199
+ let result = typeMap[type](modifier, options, {
200
+ tailwindConfig
201
+ });
202
+ if (result === undefined) {
203
+ continue;
204
+ }
205
+ return [
206
+ result,
207
+ type,
208
+ null
209
+ ];
210
+ }
211
+ }
200
212
  if (isArbitraryValue(modifier)) {
201
213
  let arbitraryValue = modifier.slice(1, -1);
202
214
  let [explicitType, value] = splitAtFirst(arbitraryValue, ":");
@@ -238,39 +250,25 @@ function* getMatchingTypes(types, rawModifier, options, tailwindConfig) {
238
250
  // TODO: Move to asValue… somehow
239
251
  if (utilityModifier !== undefined) {
240
252
  if (typeof options.modifiers === "object") {
241
- var ref;
242
- var ref1;
243
- let configValue = (ref1 = (ref = options.modifiers) === null || ref === void 0 ? void 0 : ref[utilityModifier]) !== null && ref1 !== void 0 ? ref1 : null;
253
+ var _options_modifiers;
254
+ var _options_modifiers_utilityModifier;
255
+ let configValue = (_options_modifiers_utilityModifier = (_options_modifiers = options.modifiers) === null || _options_modifiers === void 0 ? void 0 : _options_modifiers[utilityModifier]) !== null && _options_modifiers_utilityModifier !== void 0 ? _options_modifiers_utilityModifier : null;
244
256
  if (configValue !== null) {
245
257
  utilityModifier = configValue;
246
258
  } else if (isArbitraryValue(utilityModifier)) {
247
259
  utilityModifier = utilityModifier.slice(1, -1);
248
260
  }
249
261
  }
250
- let result = asValue(rawModifier, options, {
251
- rawModifier,
252
- utilityModifier,
253
- tailwindConfig
254
- });
255
- if (result !== undefined) {
256
- yield [
257
- result,
258
- "any",
259
- null
260
- ];
261
- }
262
262
  }
263
- for (const { type } of types !== null && types !== void 0 ? types : []){
264
- let result1 = typeMap[type](modifier, options, {
265
- rawModifier,
266
- utilityModifier,
263
+ for (let { type } of types !== null && types !== void 0 ? types : []){
264
+ let result = typeMap[type](modifier, options, {
267
265
  tailwindConfig
268
266
  });
269
- if (result1 === undefined) {
267
+ if (result === undefined) {
270
268
  continue;
271
269
  }
272
270
  yield [
273
- result1,
271
+ result,
274
272
  type,
275
273
  utilityModifier !== null && utilityModifier !== void 0 ? utilityModifier : null
276
274
  ];
@@ -2,7 +2,18 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- Object.defineProperty(exports, "default", {
5
+ Object.defineProperty(exports, /**
6
+ * @template {string | import('postcss-selector-parser').Root} T
7
+ *
8
+ * Prefix all classes in the selector with the given prefix
9
+ *
10
+ * It can take either a string or a selector AST and will return the same type
11
+ *
12
+ * @param {string} prefix
13
+ * @param {T} selector
14
+ * @param {boolean} prependNegative
15
+ * @returns {T}
16
+ */ "default", {
6
17
  enumerable: true,
7
18
  get: ()=>_default
8
19
  });
@@ -13,11 +24,14 @@ function _interopRequireDefault(obj) {
13
24
  };
14
25
  }
15
26
  function _default(prefix, selector, prependNegative = false) {
16
- return (0, _postcssSelectorParser.default)((selectors)=>{
17
- selectors.walkClasses((classSelector)=>{
18
- let baseClass = classSelector.value;
19
- let shouldPlaceNegativeBeforePrefix = prependNegative && baseClass.startsWith("-");
20
- classSelector.value = shouldPlaceNegativeBeforePrefix ? `-${prefix}${baseClass.slice(1)}` : `${prefix}${baseClass}`;
21
- });
22
- }).processSync(selector);
27
+ if (prefix === "") {
28
+ return selector;
29
+ }
30
+ let ast = typeof selector === "string" ? (0, _postcssSelectorParser.default)().astSync(selector) : selector;
31
+ ast.walkClasses((classSelector)=>{
32
+ let baseClass = classSelector.value;
33
+ let shouldPlaceNegativeBeforePrefix = prependNegative && baseClass.startsWith("-");
34
+ classSelector.value = shouldPlaceNegativeBeforePrefix ? `-${prefix}${baseClass.slice(1)}` : `${prefix}${baseClass}`;
35
+ });
36
+ return typeof selector === "string" ? ast.toString() : ast;
23
37
  }
@@ -9,7 +9,6 @@ Object.defineProperty(exports, "default", {
9
9
  const _negateValue = /*#__PURE__*/ _interopRequireDefault(require("./negateValue"));
10
10
  const _corePluginList = /*#__PURE__*/ _interopRequireDefault(require("../corePluginList"));
11
11
  const _configurePlugins = /*#__PURE__*/ _interopRequireDefault(require("./configurePlugins"));
12
- const _defaultConfigStub = /*#__PURE__*/ _interopRequireDefault(require("../../stubs/defaultConfig.stub"));
13
12
  const _colors = /*#__PURE__*/ _interopRequireDefault(require("../public/colors"));
14
13
  const _defaults = require("./defaults");
15
14
  const _toPath = require("./toPath");
@@ -189,8 +188,8 @@ function extractPluginConfigs(configs) {
189
188
  ...allConfigs,
190
189
  config
191
190
  ];
192
- var ref;
193
- const plugins = (ref = config === null || config === void 0 ? void 0 : config.plugins) !== null && ref !== void 0 ? ref : [];
191
+ var _config_plugins;
192
+ const plugins = (_config_plugins = config === null || config === void 0 ? void 0 : config.plugins) !== null && _config_plugins !== void 0 ? _config_plugins : [];
194
193
  if (plugins.length === 0) {
195
194
  return;
196
195
  }
@@ -198,11 +197,11 @@ function extractPluginConfigs(configs) {
198
197
  if (plugin.__isOptionsFunction) {
199
198
  plugin = plugin();
200
199
  }
201
- var ref;
200
+ var _plugin_config;
202
201
  allConfigs = [
203
202
  ...allConfigs,
204
203
  ...extractPluginConfigs([
205
- (ref = plugin === null || plugin === void 0 ? void 0 : plugin.config) !== null && ref !== void 0 ? ref : {}
204
+ (_plugin_config = plugin === null || plugin === void 0 ? void 0 : plugin.config) !== null && _plugin_config !== void 0 ? _plugin_config : {}
206
205
  ])
207
206
  ];
208
207
  });
@@ -239,18 +238,17 @@ function resolveConfig(configs) {
239
238
  {
240
239
  prefix: "",
241
240
  important: false,
242
- separator: ":",
243
- variantOrder: _defaultConfigStub.default.variantOrder
241
+ separator: ":"
244
242
  }
245
243
  ];
246
- var ref, ref1;
244
+ var _t_theme, _c_plugins;
247
245
  return (0, _normalizeConfig.normalizeConfig)((0, _defaults.defaults)({
248
246
  theme: resolveFunctionKeys(mergeExtensions(mergeThemes(allConfigs.map((t)=>{
249
- return (ref = t === null || t === void 0 ? void 0 : t.theme) !== null && ref !== void 0 ? ref : {};
247
+ return (_t_theme = t === null || t === void 0 ? void 0 : t.theme) !== null && _t_theme !== void 0 ? _t_theme : {};
250
248
  })))),
251
249
  corePlugins: resolveCorePlugins(allConfigs.map((c)=>c.corePlugins)),
252
250
  plugins: resolvePluginLists(configs.map((c)=>{
253
- return (ref1 = c === null || c === void 0 ? void 0 : c.plugins) !== null && ref1 !== void 0 ? ref1 : [];
251
+ return (_c_plugins = c === null || c === void 0 ? void 0 : c.plugins) !== null && _c_plugins !== void 0 ? _c_plugins : [];
254
252
  }))
255
253
  }, ...allConfigs));
256
254
  }
@@ -0,0 +1,21 @@
1
+ let log = require('../lib/util/log').default
2
+
3
+ // This should be a temporary file.
4
+ //
5
+ // Right now we require `@tailwindcss/oxide` as one of the packages in package.json. This contains
6
+ // all the necessary Rust bindings. However, we won't ship those bindings by default yet, and
7
+ // therefore you need to install the explicit oxide-insiders version where the Rust bindings are
8
+ // available.
9
+ //
10
+ // To ensure that this doesn't break existing builds of the insiders release, we will use this shim
11
+ // to implement all the APIs and show a warning in case you are trying to run `OXIDE=1 npx
12
+ // tailwindcs ...` without having installed the oxide-insiders version.
13
+ module.exports.parseCandidateStringsFromFiles = function parseCandidateStringsFromFiles(
14
+ _changedContent
15
+ ) {
16
+ log.warn('oxide-required', [
17
+ 'It looks like you are trying to run Tailwind CSS with the OXIDE=1 environment variable.',
18
+ 'This version does not have the necessary Rust bindings, so please install the `tailwindcss@insiders-oxide` version instead.',
19
+ ])
20
+ return []
21
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "@tailwindcss/oxide-shim",
3
+ "main": "./index.js",
4
+ "license": "MIT"
5
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwindcss",
3
- "version": "3.2.3",
3
+ "version": "3.2.5",
4
4
  "description": "A utility-first CSS framework for rapidly building custom user interfaces.",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -12,12 +12,14 @@
12
12
  "tailwind": "lib/cli.js",
13
13
  "tailwindcss": "lib/cli.js"
14
14
  },
15
+ "tailwindcss": {
16
+ "engine": "stable"
17
+ },
15
18
  "scripts": {
16
- "preswcify": "npm run generate && rimraf lib",
17
- "swcify": "swc src --out-dir lib --copy-files",
18
- "postswcify": "esbuild lib/cli-peer-dependencies.js --bundle --platform=node --outfile=peers/index.js",
19
- "rebuild-fixtures": "npm run swcify && node -r @swc/register scripts/rebuildFixtures.js",
20
- "prepublishOnly": "npm install --force && npm run swcify",
19
+ "prebuild": "npm run generate && rimraf lib",
20
+ "build": "swc src --out-dir lib --copy-files",
21
+ "postbuild": "esbuild lib/cli-peer-dependencies.js --bundle --platform=node --outfile=peers/index.js --define:process.env.CSS_TRANSFORMER_WASM=false",
22
+ "rebuild-fixtures": "npm run build && node -r @swc/register scripts/rebuildFixtures.js",
21
23
  "style": "eslint .",
22
24
  "pretest": "npm run generate",
23
25
  "test": "jest",
@@ -27,7 +29,8 @@
27
29
  "generate:types": "node -r @swc/register scripts/generate-types.js",
28
30
  "generate": "npm run generate:plugin-list && npm run generate:types",
29
31
  "release-channel": "node ./scripts/release-channel.js",
30
- "release-notes": "node ./scripts/release-notes.js"
32
+ "release-notes": "node ./scripts/release-notes.js",
33
+ "prepublishOnly": "npm install --force && npm run build"
31
34
  },
32
35
  "files": [
33
36
  "src/*",
@@ -38,31 +41,37 @@
38
41
  "stubs/*.stub.js",
39
42
  "nesting/*",
40
43
  "types/**/*",
44
+ "oxide-node-api-shim",
41
45
  "*.d.ts",
42
46
  "*.css",
43
47
  "*.js"
44
48
  ],
45
49
  "devDependencies": {
46
- "@swc/cli": "^0.1.57",
47
- "@swc/core": "^1.3.11",
48
- "@swc/jest": "^0.2.23",
49
- "@swc/register": "^0.1.10",
50
+ "@swc/cli": "0.1.59",
51
+ "@swc/core": "1.3.24",
52
+ "@swc/jest": "0.2.24",
53
+ "@swc/register": "0.1.10",
50
54
  "autoprefixer": "^10.4.13",
55
+ "browserslist": "^4.21.4",
56
+ "concurrently": "^7.5.0",
51
57
  "cssnano": "^5.1.14",
52
- "esbuild": "^0.15.12",
53
- "eslint": "^8.26.0",
54
- "eslint-config-prettier": "^8.5.0",
58
+ "esbuild": "^0.16.10",
59
+ "eslint": "^8.31.0",
60
+ "eslint-config-prettier": "^8.6.0",
55
61
  "eslint-plugin-prettier": "^4.2.1",
56
62
  "jest": "^28.1.3",
57
63
  "jest-diff": "^28.1.3",
58
- "prettier": "^2.7.1",
64
+ "lightningcss": "^1.18.0",
65
+ "prettier": "^2.8.1",
59
66
  "rimraf": "^3.0.0",
60
- "source-map-js": "^1.0.2"
67
+ "source-map-js": "^1.0.2",
68
+ "turbo": "^1.6.3"
61
69
  },
62
70
  "peerDependencies": {
63
71
  "postcss": "^8.0.9"
64
72
  },
65
73
  "dependencies": {
74
+ "@tailwindcss/oxide": "file:./oxide-node-api-shim",
66
75
  "arg": "^5.0.2",
67
76
  "chokidar": "^3.5.3",
68
77
  "color-name": "^1.1.4",
@@ -77,12 +86,12 @@
77
86
  "normalize-path": "^3.0.0",
78
87
  "object-hash": "^3.0.0",
79
88
  "picocolors": "^1.0.0",
80
- "postcss": "^8.4.18",
89
+ "postcss": "^8.0.9",
81
90
  "postcss-import": "^14.1.0",
82
91
  "postcss-js": "^4.0.0",
83
92
  "postcss-load-config": "^3.1.4",
84
93
  "postcss-nested": "6.0.0",
85
- "postcss-selector-parser": "^6.0.10",
94
+ "postcss-selector-parser": "^6.0.11",
86
95
  "postcss-value-parser": "^4.2.0",
87
96
  "quick-lru": "^5.1.1",
88
97
  "resolve": "^1.22.1"
@@ -104,8 +113,12 @@
104
113
  "/standalone-cli/",
105
114
  "\\.test\\.skip\\.js$"
106
115
  ],
116
+ "transformIgnorePatterns": [
117
+ "node_modules/(?!lightningcss)"
118
+ ],
107
119
  "transform": {
108
- "\\.js$": "@swc/jest"
120
+ "\\.js$": "@swc/jest",
121
+ "\\.ts$": "@swc/jest"
109
122
  }
110
123
  },
111
124
  "engines": {
package/peers/index.js CHANGED
@@ -3248,7 +3248,7 @@ var require_input = __commonJS({
3248
3248
  if (line && typeof line === "object") {
3249
3249
  let start = line;
3250
3250
  let end = column;
3251
- if (typeof line.offset === "number") {
3251
+ if (typeof start.offset === "number") {
3252
3252
  let pos = this.fromOffset(start.offset);
3253
3253
  line = pos.line;
3254
3254
  column = pos.col;
@@ -3636,7 +3636,8 @@ var require_map_generator = __commonJS({
3636
3636
  }
3637
3637
  if (node && type !== "start") {
3638
3638
  let p = node.parent || { raws: {} };
3639
- if (node.type !== "decl" || node !== p.last || p.raws.semicolon) {
3639
+ let childless = node.type === "decl" || node.type === "atrule" && !node.nodes;
3640
+ if (!childless || node !== p.last || p.raws.semicolon) {
3640
3641
  if (node.source && node.source.end) {
3641
3642
  mapping.source = this.sourcePath(node);
3642
3643
  mapping.original.line = node.source.end.line;
@@ -3856,7 +3857,7 @@ var require_container = __commonJS({
3856
3857
  }
3857
3858
  insertBefore(exist, add) {
3858
3859
  let existIndex = this.index(exist);
3859
- let type = exist === 0 ? "prepend" : false;
3860
+ let type = existIndex === 0 ? "prepend" : false;
3860
3861
  let nodes = this.normalize(add, this.proxyOf.nodes[existIndex], type).reverse();
3861
3862
  existIndex = this.index(exist);
3862
3863
  for (let node of nodes)
@@ -5576,7 +5577,7 @@ var require_processor = __commonJS({
5576
5577
  var Root = require_root();
5577
5578
  var Processor = class {
5578
5579
  constructor(plugins = []) {
5579
- this.version = "8.4.18";
5580
+ this.version = "8.4.21";
5580
5581
  this.plugins = this.normalize(plugins);
5581
5582
  }
5582
5583
  use(plugin) {
@@ -56608,12 +56609,6 @@ var require_walker = __commonJS({
56608
56609
  var require_package = __commonJS({
56609
56610
  "node_modules/css-tree/package.json"(exports2, module2) {
56610
56611
  module2.exports = {
56611
- _args: [
56612
- [
56613
- "css-tree@1.1.3",
56614
- "/home/runner/work/tailwindcss/tailwindcss"
56615
- ]
56616
- ],
56617
56612
  _development: true,
56618
56613
  _from: "css-tree@1.1.3",
56619
56614
  _id: "css-tree@1.1.3",
@@ -56636,7 +56631,8 @@ var require_package = __commonJS({
56636
56631
  "/svgo"
56637
56632
  ],
56638
56633
  _resolved: "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz",
56639
- _spec: "1.1.3",
56634
+ _shasum: "eb4870fb6fd7707327ec95c2ff2ab09b5e8db91d",
56635
+ _spec: "css-tree@1.1.3",
56640
56636
  _where: "/home/runner/work/tailwindcss/tailwindcss",
56641
56637
  author: {
56642
56638
  name: "Roman Dvornov",
@@ -56646,10 +56642,12 @@ var require_package = __commonJS({
56646
56642
  bugs: {
56647
56643
  url: "https://github.com/csstree/csstree/issues"
56648
56644
  },
56645
+ bundleDependencies: false,
56649
56646
  dependencies: {
56650
56647
  "mdn-data": "2.0.14",
56651
56648
  "source-map": "^0.6.1"
56652
56649
  },
56650
+ deprecated: false,
56653
56651
  description: "A tool set for CSS: fast detailed parser (CSS \u2192 AST), walker (AST traversal), generator (AST \u2192 CSS) and lexer (validation and matching) based on specs and browser implementations",
56654
56652
  devDependencies: {
56655
56653
  "@rollup/plugin-commonjs": "^11.0.2",
@@ -60328,12 +60326,6 @@ var require_compress = __commonJS({
60328
60326
  var require_package2 = __commonJS({
60329
60327
  "node_modules/csso/package.json"(exports2, module2) {
60330
60328
  module2.exports = {
60331
- _args: [
60332
- [
60333
- "csso@4.2.0",
60334
- "/home/runner/work/tailwindcss/tailwindcss"
60335
- ]
60336
- ],
60337
60329
  _development: true,
60338
60330
  _from: "csso@4.2.0",
60339
60331
  _id: "csso@4.2.0",
@@ -60355,7 +60347,8 @@ var require_package2 = __commonJS({
60355
60347
  "/svgo"
60356
60348
  ],
60357
60349
  _resolved: "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz",
60358
- _spec: "4.2.0",
60350
+ _shasum: "ea3a561346e8dc9f546d6febedd50187cf389529",
60351
+ _spec: "csso@4.2.0",
60359
60352
  _where: "/home/runner/work/tailwindcss/tailwindcss",
60360
60353
  author: {
60361
60354
  name: "Sergey Kryzhanovsky",
@@ -60368,9 +60361,11 @@ var require_package2 = __commonJS({
60368
60361
  bugs: {
60369
60362
  url: "https://github.com/css/csso/issues"
60370
60363
  },
60364
+ bundleDependencies: false,
60371
60365
  dependencies: {
60372
60366
  "css-tree": "^1.1.2"
60373
60367
  },
60368
+ deprecated: false,
60374
60369
  description: "CSS minifier with structural optimisations",
60375
60370
  devDependencies: {
60376
60371
  "@rollup/plugin-commonjs": "^11.0.1",
@@ -69659,6 +69654,20 @@ var require_attribute = __commonJS({
69659
69654
  this._value = v;
69660
69655
  }
69661
69656
  }
69657
+ }, {
69658
+ key: "insensitive",
69659
+ get: function get() {
69660
+ return this._insensitive;
69661
+ },
69662
+ set: function set(insensitive) {
69663
+ if (!insensitive) {
69664
+ this._insensitive = false;
69665
+ if (this.raws && (this.raws.insensitiveFlag === "I" || this.raws.insensitiveFlag === "i")) {
69666
+ this.raws.insensitiveFlag = void 0;
69667
+ }
69668
+ }
69669
+ this._insensitive = insensitive;
69670
+ }
69662
69671
  }, {
69663
69672
  key: "attribute",
69664
69673
  get: function get() {
@@ -70462,7 +70471,7 @@ var require_parser4 = __commonJS({
70462
70471
  node.raws.attribute += content;
70463
70472
  }
70464
70473
  lastAdded = "attribute";
70465
- } else if (!node.value && node.value !== "" || lastAdded === "value" && !spaceAfterMeaningfulToken) {
70474
+ } else if (!node.value && node.value !== "" || lastAdded === "value" && !(spaceAfterMeaningfulToken || node.quoteMark)) {
70466
70475
  var _unescaped = (0, _util.unesc)(content);
70467
70476
  var _oldRawValue = (0, _util.getProp)(node, "raws", "value") || "";
70468
70477
  var oldValue = node.value || "";
@@ -79487,26 +79496,36 @@ function lazyAutoprefixer() {
79487
79496
  function lazyCssnano() {
79488
79497
  return require_src32();
79489
79498
  }
79490
- /*! https://mths.be/cssesc v3.0.0 by @mathias */
79491
- /**
79492
- * @author Ben Briggs
79493
- * @license MIT
79494
- * @module cssnano:preset:default
79495
- * @overview
79496
- *
79497
- * This default preset for cssnano only includes transforms that make no
79498
- * assumptions about your CSS other than what is passed in. In previous
79499
- * iterations of cssnano, assumptions were made about your CSS which caused
79500
- * output to look different in certain use cases, but not others. These
79501
- * transforms have been moved from the defaults to other presets, to make
79502
- * this preset require only minimal configuration.
79503
- */
79504
- /**
79505
- * @license Fraction.js v4.2.0 05/03/2022
79506
- * https://www.xarg.org/2014/03/rational-numbers-in-javascript/
79507
- *
79508
- * Copyright (c) 2021, Robert Eisele (robert@xarg.org)
79509
- * Dual licensed under the MIT or GPL Version 2 licenses.
79510
- **/
79511
- //! stable.js 0.1.8, https://github.com/Two-Screen/stable
79512
- //! © 2018 Angry Bytes and contributors. MIT licensed.
79499
+ /*! Bundled license information:
79500
+
79501
+ fraction.js/fraction.js:
79502
+ (**
79503
+ * @license Fraction.js v4.2.0 05/03/2022
79504
+ * https://www.xarg.org/2014/03/rational-numbers-in-javascript/
79505
+ *
79506
+ * Copyright (c) 2021, Robert Eisele (robert@xarg.org)
79507
+ * Dual licensed under the MIT or GPL Version 2 licenses.
79508
+ **)
79509
+
79510
+ stable/stable.js:
79511
+ (*! stable.js 0.1.8, https://github.com/Two-Screen/stable *)
79512
+ (*! © 2018 Angry Bytes and contributors. MIT licensed. *)
79513
+
79514
+ cssesc/cssesc.js:
79515
+ (*! https://mths.be/cssesc v3.0.0 by @mathias *)
79516
+
79517
+ cssnano-preset-default/src/index.js:
79518
+ (**
79519
+ * @author Ben Briggs
79520
+ * @license MIT
79521
+ * @module cssnano:preset:default
79522
+ * @overview
79523
+ *
79524
+ * This default preset for cssnano only includes transforms that make no
79525
+ * assumptions about your CSS other than what is passed in. In previous
79526
+ * iterations of cssnano, assumptions were made about your CSS which caused
79527
+ * output to look different in certain use cases, but not others. These
79528
+ * transforms have been moved from the defaults to other presets, to make
79529
+ * this preset require only minimal configuration.
79530
+ *)
79531
+ */
@@ -1,3 +1,12 @@
1
- import type { Config } from './types/config'
2
- declare function resolveConfig(config: Config): Config
1
+ import type { Config, ResolvableTo } from './types/config'
2
+
3
+ type UnwrapResolvables<T> = {
4
+ [K in keyof T]: T[K] extends ResolvableTo<infer R> ? R : T[K]
5
+ }
6
+
7
+ type ResolvedConfig<T extends Config> = Omit<T, 'theme'> & {
8
+ theme: UnwrapResolvables<T['theme']>
9
+ }
10
+
11
+ declare function resolveConfig<T extends Config>(config: T): ResolvedConfig<T>
3
12
  export = resolveConfig
@@ -0,0 +1,40 @@
1
+ let fs = require('fs')
2
+ let path = require('path')
3
+
4
+ let engines = {
5
+ stable: {
6
+ files: [
7
+ path.resolve(__dirname, '..', 'package.stable.json'),
8
+ path.resolve(__dirname, '..', 'package-lock.stable.json'),
9
+ ],
10
+ },
11
+ oxide: {
12
+ files: [
13
+ path.resolve(__dirname, '..', 'package.oxide.json'),
14
+ path.resolve(__dirname, '..', 'package-lock.oxide.json'),
15
+ ],
16
+ },
17
+ }
18
+
19
+ // Find out what the current engine is that we are using:
20
+ let [otherEngine, info] = Object.entries(engines).find(([, info]) =>
21
+ info.files.every((file) => fs.existsSync(file))
22
+ )
23
+ let currentEngine = otherEngine === 'oxide' ? 'stable' : 'oxide'
24
+
25
+ console.log(`Current engine: \`${currentEngine}\`, swapping to \`${otherEngine}\``)
26
+
27
+ // Swap the engines
28
+ for (let file of info.files) {
29
+ fs.renameSync(
30
+ file.replace(`.${otherEngine}`, ''),
31
+ file.replace(`.${otherEngine}`, `.${currentEngine}`)
32
+ )
33
+ }
34
+ for (let file of engines[otherEngine].files) {
35
+ fs.renameSync(file, file.replace(`.${otherEngine}`, ''))
36
+ }
37
+
38
+ console.log(
39
+ 'Engines have been swapped. Make sure to run `npm install` to update your dependencies.'
40
+ )
@@ -34,8 +34,12 @@ export async function build(args, configs) {
34
34
  let processor = await createProcessor(args, configPath)
35
35
 
36
36
  if (shouldWatch) {
37
- /* Abort the watcher if stdin is closed to avoid zombie processes */
38
- process.stdin.on('end', () => process.exit(0))
37
+ // Abort the watcher if stdin is closed to avoid zombie processes
38
+ // You can disable this behavior with --watch=always
39
+ if (args['--watch'] !== 'always') {
40
+ process.stdin.on('end', () => process.exit(0))
41
+ }
42
+
39
43
  process.stdin.resume()
40
44
 
41
45
  await processor.watch()