Skip to content

Commit

Permalink
chore: collect tailwindcss 3.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
sonofmagic committed Jul 16, 2024
1 parent bcbebab commit a767989
Show file tree
Hide file tree
Showing 18 changed files with 942 additions and 127 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@types/fs-extra": "^11.0.4",
"@types/lodash-es": "^4.17.12",
"@types/node": "^20.14.10",
"@vitest/coverage-v8": "^2.0.2",
"@vitest/coverage-v8": "^2.0.3",
"bumpp": "^9.4.1",
"cross-env": "^7.0.3",
"dedent": "^1.5.3",
Expand All @@ -59,6 +59,6 @@
"unplugin": "^1.11.0",
"unplugin-tailwindcss-mangle": "workspace:*",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^2.0.2"
"vitest": "^2.0.3"
}
}
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@ast-core/escape": "^1.0.1",
"@babel/parser": "^7.24.8",
"@babel/traverse": "^7.24.8",
"@babel/types": "^7.24.8",
"@babel/types": "^7.24.9",
"@tailwindcss-mangle/config": "workspace:^",
"@tailwindcss-mangle/shared": "workspace:^",
"fast-sort": "^3.4.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/tailwindcss-patch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@
}
},
"dependencies": {
"@babel/generator": "^7.24.8",
"@babel/generator": "^7.24.9",
"@babel/parser": "^7.24.8",
"@babel/traverse": "^7.24.8",
"@babel/types": "^7.24.8",
"@babel/types": "^7.24.9",
"@tailwindcss-mangle/config": "workspace:^",
"cac": "^6.7.14",
"jiti": "^1.21.6",
Expand All @@ -68,7 +68,7 @@
"@types/semver": "^7.5.8",
"pkg-types": "^1.1.3",
"postcss7": "npm:postcss@7",
"tailwindcss": "^3.4.4",
"tailwindcss": "^3.4.5",
"tailwindcss2": "npm:@tailwindcss/postcss7-compat@^2.2.17"
},
"directories": {
Expand Down
122 changes: 122 additions & 0 deletions packages/tailwindcss-patch/test/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3015,3 +3015,125 @@ function processTailwindFeatures(setupContext) {
}",
}
`;

exports[`versions-patch > patch tailwindcss3.4.5 1`] = `
{
"plugin": ""use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const _setupTrackingContext = /*#__PURE__*/_interop_require_default(require("./lib/setupTrackingContext"));
const _processTailwindFeatures = /*#__PURE__*/_interop_require_default(require("./processTailwindFeatures"));
const _sharedState = require("./lib/sharedState");
const _findAtConfigPath = require("./lib/findAtConfigPath");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
const contextRef = {
value: []
};
module.exports = function tailwindcss(configOrPath) {
return {
postcssPlugin: "tailwindcss",
plugins: [_sharedState.env.DEBUG && function (root) {
console.log("\\n");
console.time("JIT TOTAL");
return root;
}, async function (root, result) {
contextRef.value.length = 0;
var _findAtConfigPath1;
// Use the path for the \`@config\` directive if it exists, otherwise use the
// path for the file being processed
configOrPath = (_findAtConfigPath1 = (0, _findAtConfigPath.findAtConfigPath)(root, result)) !== null && _findAtConfigPath1 !== void 0 ? _findAtConfigPath1 : configOrPath;
let context = (0, _setupTrackingContext.default)(configOrPath);
if (root.type === "document") {
let roots = root.nodes.filter(node => node.type === "root");
for (const root of roots) {
if (root.type === "root") {
contextRef.value.push(await (0, _processTailwindFeatures.default)(context)(root, result));
}
}
return;
}
contextRef.value.push(await (0, _processTailwindFeatures.default)(context)(root, result));
}, _sharedState.env.DEBUG && function (root) {
console.timeEnd("JIT TOTAL");
console.log("\\n");
return root;
}].filter(Boolean)
};
};
module.exports.postcss = true;
module.exports.contextRef = contextRef;",
"processTailwindFeatures": ""use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function () {
return processTailwindFeatures;
}
});
const _normalizeTailwindDirectives = /*#__PURE__*/_interop_require_default(require("./lib/normalizeTailwindDirectives"));
const _expandTailwindAtRules = /*#__PURE__*/_interop_require_default(require("./lib/expandTailwindAtRules"));
const _expandApplyAtRules = /*#__PURE__*/_interop_require_default(require("./lib/expandApplyAtRules"));
const _evaluateTailwindFunctions = /*#__PURE__*/_interop_require_default(require("./lib/evaluateTailwindFunctions"));
const _substituteScreenAtRules = /*#__PURE__*/_interop_require_default(require("./lib/substituteScreenAtRules"));
const _resolveDefaultsAtRules = /*#__PURE__*/_interop_require_default(require("./lib/resolveDefaultsAtRules"));
const _collapseAdjacentRules = /*#__PURE__*/_interop_require_default(require("./lib/collapseAdjacentRules"));
const _collapseDuplicateDeclarations = /*#__PURE__*/_interop_require_default(require("./lib/collapseDuplicateDeclarations"));
const _partitionApplyAtRules = /*#__PURE__*/_interop_require_default(require("./lib/partitionApplyAtRules"));
const _setupContextUtils = require("./lib/setupContextUtils");
const _featureFlags = require("./featureFlags");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function processTailwindFeatures(setupContext) {
return async function (root, result) {
let {
tailwindDirectives,
applyDirectives
} = (0, _normalizeTailwindDirectives.default)(root);
// Partition apply rules that are found in the css
// itself.
(0, _partitionApplyAtRules.default)()(root, result);
let context = setupContext({
tailwindDirectives,
applyDirectives,
registerDependency(dependency) {
result.messages.push({
plugin: "tailwindcss",
parent: result.opts.from,
...dependency
});
},
createContext(tailwindConfig, changedContent) {
return (0, _setupContextUtils.createContext)(tailwindConfig, changedContent, root);
}
})(root, result);
if (context.tailwindConfig.separator === "-") {
throw new Error("The '-' character cannot be used as a custom separator in JIT mode due to parsing ambiguity. Please use another character like '_' instead.");
}
(0, _featureFlags.issueFlagNotices)(context.tailwindConfig);
await (0, _expandTailwindAtRules.default)(context)(root, result);
// Partition apply rules that are generated by
// addComponents, addUtilities and so on.
(0, _partitionApplyAtRules.default)()(root, result);
(0, _expandApplyAtRules.default)(context)(root, result);
(0, _evaluateTailwindFunctions.default)(context)(root, result);
(0, _substituteScreenAtRules.default)(context)(root, result);
(0, _resolveDefaultsAtRules.default)(context)(root, result);
(0, _collapseAdjacentRules.default)(context)(root, result);
(0, _collapseDuplicateDeclarations.default)(context)(root, result);
return context;
};
}",
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`postcss > getCss 0.common 1`] = `
"/*
! tailwindcss v3.4.4 | MIT License | https://tailwindcss.com
! tailwindcss v3.4.5 | MIT License | https://tailwindcss.com
*//*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"use strict";
module.exports = require("./plugin");
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const _setupTrackingContext = /*#__PURE__*/ _interop_require_default(require("./lib/setupTrackingContext"));
const _processTailwindFeatures = /*#__PURE__*/ _interop_require_default(require("./processTailwindFeatures"));
const _sharedState = require("./lib/sharedState");
const _findAtConfigPath = require("./lib/findAtConfigPath");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
module.exports = function tailwindcss(configOrPath) {
return {
postcssPlugin: "tailwindcss",
plugins: [
_sharedState.env.DEBUG && function(root) {
console.log("\n");
console.time("JIT TOTAL");
return root;
},
async function(root, result) {
var _findAtConfigPath1;
// Use the path for the `@config` directive if it exists, otherwise use the
// path for the file being processed
configOrPath = (_findAtConfigPath1 = (0, _findAtConfigPath.findAtConfigPath)(root, result)) !== null && _findAtConfigPath1 !== void 0 ? _findAtConfigPath1 : configOrPath;
let context = (0, _setupTrackingContext.default)(configOrPath);
if (root.type === "document") {
let roots = root.nodes.filter((node)=>node.type === "root");
for (const root of roots){
if (root.type === "root") {
await (0, _processTailwindFeatures.default)(context)(root, result);
}
}
return;
}
await (0, _processTailwindFeatures.default)(context)(root, result);
},
_sharedState.env.DEBUG && function(root) {
console.timeEnd("JIT TOTAL");
console.log("\n");
return root;
}
].filter(Boolean)
};
};
module.exports.postcss = true;
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return processTailwindFeatures;
}
});
const _normalizeTailwindDirectives = /*#__PURE__*/ _interop_require_default(require("./lib/normalizeTailwindDirectives"));
const _expandTailwindAtRules = /*#__PURE__*/ _interop_require_default(require("./lib/expandTailwindAtRules"));
const _expandApplyAtRules = /*#__PURE__*/ _interop_require_default(require("./lib/expandApplyAtRules"));
const _evaluateTailwindFunctions = /*#__PURE__*/ _interop_require_default(require("./lib/evaluateTailwindFunctions"));
const _substituteScreenAtRules = /*#__PURE__*/ _interop_require_default(require("./lib/substituteScreenAtRules"));
const _resolveDefaultsAtRules = /*#__PURE__*/ _interop_require_default(require("./lib/resolveDefaultsAtRules"));
const _collapseAdjacentRules = /*#__PURE__*/ _interop_require_default(require("./lib/collapseAdjacentRules"));
const _collapseDuplicateDeclarations = /*#__PURE__*/ _interop_require_default(require("./lib/collapseDuplicateDeclarations"));
const _partitionApplyAtRules = /*#__PURE__*/ _interop_require_default(require("./lib/partitionApplyAtRules"));
const _setupContextUtils = require("./lib/setupContextUtils");
const _featureFlags = require("./featureFlags");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function processTailwindFeatures(setupContext) {
return async function(root, result) {
let { tailwindDirectives , applyDirectives } = (0, _normalizeTailwindDirectives.default)(root);
// Partition apply rules that are found in the css
// itself.
(0, _partitionApplyAtRules.default)()(root, result);
let context = setupContext({
tailwindDirectives,
applyDirectives,
registerDependency (dependency) {
result.messages.push({
plugin: "tailwindcss",
parent: result.opts.from,
...dependency
});
},
createContext (tailwindConfig, changedContent) {
return (0, _setupContextUtils.createContext)(tailwindConfig, changedContent, root);
}
})(root, result);
if (context.tailwindConfig.separator === "-") {
throw new Error("The '-' character cannot be used as a custom separator in JIT mode due to parsing ambiguity. Please use another character like '_' instead.");
}
(0, _featureFlags.issueFlagNotices)(context.tailwindConfig);
await (0, _expandTailwindAtRules.default)(context)(root, result);
// Partition apply rules that are generated by
// addComponents, addUtilities and so on.
(0, _partitionApplyAtRules.default)()(root, result);
(0, _expandApplyAtRules.default)(context)(root, result);
(0, _evaluateTailwindFunctions.default)(context)(root, result);
(0, _substituteScreenAtRules.default)(context)(root, result);
(0, _resolveDefaultsAtRules.default)(context)(root, result);
(0, _collapseAdjacentRules.default)(context)(root, result);
(0, _collapseDuplicateDeclarations.default)(context)(root, result);
};
}
Loading

0 comments on commit a767989

Please sign in to comment.