Release v4.2.2 (#4307)

* 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.
This commit is contained in:
Daniel Puckowski
2025-01-19 13:43:04 -05:00
committed by GitHub
parent ab5c82f86f
commit 1e7b0038d4
13 changed files with 224 additions and 93 deletions

View File

@@ -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)

136
dist/less.js vendored
View File

@@ -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 <self@cloudhead.net>
* Copyright (c) 2009-2025, Alexis Sellier <self@cloudhead.net>
* Licensed under the Apache-2.0 License.
*
* @license Apache-2.0
@@ -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
//
@@ -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 \')\'');
@@ -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);
}
@@ -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
@@ -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);
}
@@ -5443,7 +5498,7 @@
var index = parserInput.i;
do {
e = this.comment();
if (e) {
if (e && !e.isLineComment) {
entities.push(e);
continue;
}
@@ -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 = '';
@@ -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];
@@ -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',
@@ -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);
}
@@ -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 + ' ');
@@ -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

6
dist/less.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -4,5 +4,5 @@
],
"useNx": false,
"npmClient": "npm",
"version": "4.2.1"
"version": "4.2.2"
}

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@less/root",
"version": "4.2.1",
"version": "4.2.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@less/root",
"version": "4.2.1",
"version": "4.2.2",
"hasInstallScript": true,
"license": "Apache-2.0",
"devDependencies": {

View File

@@ -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": {

View File

@@ -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 <self@cloudhead.net>
* Copyright (c) 2009-2025, Alexis Sellier <self@cloudhead.net>
* Licensed under the Apache-2.0 License.
*
* @license Apache-2.0
@@ -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
//
@@ -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 \')\'');
@@ -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);
}
@@ -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
@@ -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);
}
@@ -5443,7 +5498,7 @@
var index = parserInput.i;
do {
e = this.comment();
if (e) {
if (e && !e.isLineComment) {
entities.push(e);
continue;
}
@@ -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 = '';
@@ -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];
@@ -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',
@@ -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);
}
@@ -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 + ' ');
@@ -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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,12 +1,12 @@
{
"name": "less",
"version": "4.2.1",
"version": "4.2.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "less",
"version": "4.2.1",
"version": "4.2.2",
"license": "Apache-2.0",
"dependencies": {
"copy-anything": "^2.0.1",

View File

@@ -1,6 +1,6 @@
{
"name": "less",
"version": "4.2.1",
"version": "4.2.2",
"description": "Leaner CSS",
"homepage": "http://lesscss.org",
"author": {
@@ -56,7 +56,7 @@
"source-map": "~0.6.0"
},
"devDependencies": {
"@less/test-data": "^4.2.1",
"@less/test-data": "^4.2.2",
"@less/test-import-module": "^4.0.0",
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-json": "^4.1.0",

View File

@@ -3,7 +3,7 @@
"publishConfig": {
"access": "public"
},
"version": "4.2.1",
"version": "4.2.2",
"description": "Less files and CSS results",
"author": {
"name": "Alexis Sellier",