Skip to content

Commit

Permalink
Release v4.2.2 (#4307)
Browse files Browse the repository at this point in the history
* Release v4.2.2

* Update files for Release/v4.2.2.

* chore: update changelog for CI merges

* Update CHANGELOG.md for recent CI update merges.
  • Loading branch information
puckowski authored Jan 19, 2025
1 parent ab5c82f commit 1e7b003
Show file tree
Hide file tree
Showing 13 changed files with 224 additions and 93 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
## Change Log

### v4.2.2 (2025-01-04)

- [#4290](https://github.com/less/less.js/pull/4290) Fix [#4268](https://github.com/less/less.js/issues/4268) nested pseudo-selector parsing (@puckowski)
- [#4291](https://github.com/less/less.js/pull/4291) Enhance Less.js test environment setup (#4291) (@iChenLei)
- [#4295](https://github.com/less/less.js/pull/4295) Fix [#4252](https://github.com/less/less.js/issues/4252) container queries created via mixin evaluating variables incorrectly (@puckowski)
- [#4294](https://github.com/less/less.js/pull/4294) Fix [#3737](https://github.com/less/less.js/issues/3737) allow blank variable declarationd (@puckowski)
- [#4292](https://github.com/less/less.js/pull/4292) Fix [#4258](https://github.com/less/less.js/issues/4258) variable interpolation after math (@puckowski)
- [#4293](https://github.com/less/less.js/pull/4293) Fix [#4264](https://github.com/less/less.js/issues/4264) strip line comment from expression (@puckowski)
- [#4302](https://github.com/less/less.js/pull/4302) Fix [#4301](https://github.com/less/less.js/issues/4301) at-rule declarations missing (@puckowski)
- [#4309](https://github.com/less/less.js/pull/4309) Fix Node 23 CI (#4309) (@iChenLei)

### v4.2.1 (2024-09-26)

- [#4237](https://github.com/less/less.js/pull/4237) Fix [#4235](https://github.com/less/less.js/issues/4235) container style queries extra space resolved (@puckowski)
Expand Down
136 changes: 98 additions & 38 deletions dist/less.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Less - Leaner CSS v4.2.1
* Less - Leaner CSS v4.2.2
* http://lesscss.org
*
* Copyright (c) 2009-2024, Alexis Sellier <[email protected]>
* Copyright (c) 2009-2025, Alexis Sellier <[email protected]>
* Licensed under the Apache-2.0 License.
*
* @license Apache-2.0
Expand Down Expand Up @@ -3238,6 +3238,34 @@
queryInParens: true
};

var Anonymous = function (value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) {
this.value = value;
this._index = index;
this._fileInfo = currentFileInfo;
this.mapLines = mapLines;
this.rulesetLike = (typeof rulesetLike === 'undefined') ? false : rulesetLike;
this.allowRoot = true;
this.copyVisibilityInfo(visibilityInfo);
};
Anonymous.prototype = Object.assign(new Node(), {
type: 'Anonymous',
eval: function () {
return new Anonymous(this.value, this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo());
},
compare: function (other) {
return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined;
},
isRulesetLike: function () {
return this.rulesetLike;
},
genCSS: function (context, output) {
this.nodeVisible = Boolean(this.value);
if (this.nodeVisible) {
output.add(this.value, this._fileInfo, this._index, this.mapLines);
}
}
});

//
// less.js - parser
//
Expand Down Expand Up @@ -4402,9 +4430,26 @@
if (!e) {
parserInput.save();
if (parserInput.$char('(')) {
if ((v = this.selector(false)) && parserInput.$char(')')) {
e = new (tree.Paren)(v);
parserInput.forget();
if ((v = this.selector(false))) {
var selectors = [];
while (parserInput.$char(',')) {
selectors.push(v);
selectors.push(new Anonymous(','));
v = this.selector(false);
}
selectors.push(v);
if (parserInput.$char(')')) {
if (selectors.length > 1) {
e = new (tree.Paren)(new Selector(selectors));
}
else {
e = new (tree.Paren)(v);
}
parserInput.forget();
}
else {
parserInput.restore('Missing closing \')\'');
}
}
else {
parserInput.restore('Missing closing \')\'');
Expand Down Expand Up @@ -4495,6 +4540,9 @@
error('Extend can only be used at the end of selector');
}
c = parserInput.currentChar();
if (Array.isArray(e)) {
e.forEach(function (ele) { return elements.push(ele); });
}
if (elements) {
elements.push(e);
}
Expand Down Expand Up @@ -4669,7 +4717,12 @@
merge = !isVariable && name.length > 1 && name.pop().value;
// Custom property values get permissive parsing
if (name[0].value && name[0].value.slice(0, 2) === '--') {
value = this.permissiveValue(/[;}]/);
if (parserInput.$char(';')) {
value = new Anonymous('');
}
else {
value = this.permissiveValue(/[;}]/);
}
}
// Try to store values as anonymous
// If we need the value later we'll re-parse it in ruleset.parseValue
Expand Down Expand Up @@ -4793,7 +4846,9 @@
}
// Treat like quoted values, but replace vars like unquoted expressions
var quote = new tree.Quoted('\'', item, true, index, fileInfo);
quote.variableRegex = /@([\w-]+)/g;
if (!item.startsWith('@{')) {
quote.variableRegex = /@([\w-]+)/g;
}
quote.propRegex = /\$([\w-]+)/g;
result.push(quote);
}
Expand Down Expand Up @@ -5443,7 +5498,7 @@
var index = parserInput.i;
do {
e = this.comment();
if (e) {
if (e && !e.isLineComment) {
entities.push(e);
continue;
}
Expand Down Expand Up @@ -5704,34 +5759,6 @@
Keyword.True = new Keyword('true');
Keyword.False = new Keyword('false');

var Anonymous = function (value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) {
this.value = value;
this._index = index;
this._fileInfo = currentFileInfo;
this.mapLines = mapLines;
this.rulesetLike = (typeof rulesetLike === 'undefined') ? false : rulesetLike;
this.allowRoot = true;
this.copyVisibilityInfo(visibilityInfo);
};
Anonymous.prototype = Object.assign(new Node(), {
type: 'Anonymous',
eval: function () {
return new Anonymous(this.value, this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo());
},
compare: function (other) {
return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined;
},
isRulesetLike: function () {
return this.rulesetLike;
},
genCSS: function (context, output) {
this.nodeVisible = Boolean(this.value);
if (this.nodeVisible) {
output.add(this.value, this._fileInfo, this._index, this.mapLines);
}
}
});

var MATH$1 = Math$1;
function evalName(context, name) {
var value = '';
Expand Down Expand Up @@ -7583,6 +7610,10 @@
var path = context.mediaPath.concat([this]);
// Extract the media-query conditions separated with `,` (OR).
for (i = 0; i < path.length; i++) {
if (path[i].type !== this.type) {
context.mediaBlocks.splice(i, 1);
return this;
}
value = path[i].features instanceof Value ?
path[i].features.value : path[i].features;
path[i] = Array.isArray(value) ? value : [value];
Expand Down Expand Up @@ -7978,6 +8009,7 @@
this.op2 = op2 ? op2.trim() : null;
this.rvalue = r;
this._index = i;
this.mvalues = [];
};
QueryInParens.prototype = Object.assign(new Node(), {
type: 'QueryInParens',
Expand All @@ -7990,7 +8022,32 @@
},
eval: function (context) {
this.lvalue = this.lvalue.eval(context);
this.mvalue = this.mvalue.eval(context);
var variableDeclaration;
var rule;
for (var i_1 = 0; (rule = context.frames[i_1]); i_1++) {
if (rule.type === 'Ruleset') {
variableDeclaration = rule.rules.find(function (r) {
if ((r instanceof Declaration) && r.variable) {
return true;
}
return false;
});
if (variableDeclaration) {
break;
}
}
}
if (!this.mvalueCopy) {
this.mvalueCopy = copy(this.mvalue);
}
if (variableDeclaration) {
this.mvalue = this.mvalueCopy;
this.mvalue = this.mvalue.eval(context);
this.mvalues.push(this.mvalue);
}
else {
this.mvalue = this.mvalue.eval(context);
}
if (this.rvalue) {
this.rvalue = this.rvalue.eval(context);
}
Expand All @@ -7999,6 +8056,9 @@
genCSS: function (context, output) {
this.lvalue.genCSS(context, output);
output.add(' ' + this.op + ' ');
if (this.mvalues.length > 0) {
this.mvalue = this.mvalues.shift();
}
this.mvalue.genCSS(context, output);
if (this.rvalue) {
output.add(' ' + this.op2 + ' ');
Expand Down Expand Up @@ -10792,7 +10852,7 @@
return render;
}

var version = "4.2.1";
var version = "4.2.2";

function parseNodeVersion(version) {
var match = version.match(/^v(\d{1,2})\.(\d{1,2})\.(\d{1,2})(?:-([0-9A-Za-z-.]+))?(?:\+([0-9A-Za-z-.]+))?$/); // eslint-disable-line max-len
Expand Down
6 changes: 3 additions & 3 deletions dist/less.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/less.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
],
"useNx": false,
"npmClient": "npm",
"version": "4.2.1"
"version": "4.2.2"
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@less/root",
"private": true,
"version": "4.2.1",
"version": "4.2.2",
"description": "Less monorepo",
"homepage": "http://lesscss.org",
"scripts": {
Expand Down
Loading

0 comments on commit 1e7b003

Please sign in to comment.