less 3.11.2 → 3.11.3
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.
- package/CHANGELOG.md +1 -1
- package/README.md +1 -3
- package/bin/lessc +12 -8
- package/dist/less.cjs.js +12 -8
- package/dist/less.js +13 -9
- package/dist/less.min.js +2 -2
- package/dist/less.min.js.map +1 -1
- package/lib/less/import-manager.js +5 -0
- package/lib/less/index.js +1 -1
- package/lib/less/parse-tree.js +2 -6
- package/package.json +1 -1
- package/test/index.js +6 -0
- package/test/less/import/json/index.json +11 -0
- package/test/less/import/json/index.less +1 -0
- package/test/less-test.js +44 -2
- package/test/browser/less.js +0 -13008
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
## Change Log
|
|
2
2
|
|
|
3
|
-
###
|
|
3
|
+
### v3.11.2 (2020-06-01)
|
|
4
4
|
- [#3498](https://github.com/less/less.js/pull/3498) Remove tree caching in import manager (#3498) (@matthew-dean)
|
|
5
5
|
- [#3482](https://github.com/less/less.js/pull/3482) issue#3481 ignore missing debugInfo (#3482) (@5UtJAjiRWj1q)
|
|
6
6
|
- [#3494](https://github.com/less/less.js/pull/3494) Additional check to avoid evaluating an expression if it is a comment (#3494) (@rgroothuijsen)
|
package/README.md
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
<p align="center"><img src="http://lesscss.org/public/img/less_logo.png" width="264" height="117">
|
|
2
2
|
|
|
3
|
-
<p align="center"><a href="http://badge.fury.io/js/less"><a href="https://opencollective.com/less" alt="Financial Contributors on Open Collective"><img src="https://opencollective.com/less/all/badge.svg?label=financial+contributors" /></a> <img src="https://badge.fury.io/js/less.svg"></a> <a href="https://travis-ci.org/less/less.js"><img src="https://travis-ci.org/less/less.js.svg?branch=master" style="max-width:100%;"></a> <a href="https://ci.appveyor.com/project/lukeapage/less-js/branch/master"><img src="https://ci.appveyor.com/api/projects/status/bx2qspy3qbuxpl9q/branch/master?svg=true" style="max-width:100%;"></a> <a href="https://david-dm.org/less/less.js"><img src="https://david-dm.org/less/less.js.svg" style="max-width:100%;"></a> <a href="https://david-dm.org/less/less.js#info=devDependencies"><img src="https://david-dm.org/less/less.js/dev-status.svg" style="max-width:100%;"></a> <a href="https://
|
|
3
|
+
<p align="center"><a href="http://badge.fury.io/js/less"><a href="https://opencollective.com/less" alt="Financial Contributors on Open Collective"><img src="https://opencollective.com/less/all/badge.svg?label=financial+contributors" /></a> <img src="https://badge.fury.io/js/less.svg"></a> <a href="https://travis-ci.org/less/less.js"><img src="https://travis-ci.org/less/less.js.svg?branch=master" style="max-width:100%;"></a> <a href="https://ci.appveyor.com/project/lukeapage/less-js/branch/master"><img src="https://ci.appveyor.com/api/projects/status/bx2qspy3qbuxpl9q/branch/master?svg=true" style="max-width:100%;"></a> <a href="https://david-dm.org/less/less.js"><img src="https://david-dm.org/less/less.js.svg" style="max-width:100%;"></a> <a href="https://david-dm.org/less/less.js#info=devDependencies"><img src="https://david-dm.org/less/less.js/dev-status.svg" style="max-width:100%;"></a> <a href="https://twitter.com/lesstocss"><img alt="Twitter Follow" src="https://img.shields.io/twitter/follow/lesstocss.svg?style=flat-square" style="max-width:100%;"></a></p>
|
|
4
4
|
|
|
5
5
|
<p align="center"><a href="https://gitter.im/less/less.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"><img src="https://badges.gitter.im/Join%20Chat.svg" style="max-width:100%;"></a> <br><sup class="rich-diff-level-one">Chat with Less.js users and contributors</sup></p>
|
|
6
6
|
|
|
7
|
-
<p align="center"><a href="https://saucelabs.com/u/less" rel="nofollow"><img src="https://saucelabs.com/browser-matrix/less.svg" alt="Sauce Test Status" style="max-width:100%;"></a></p>
|
|
8
|
-
|
|
9
7
|
# [Less.js](http://lesscss.org)
|
|
10
8
|
|
|
11
9
|
> The **dynamic** stylesheet language. [http://lesscss.org](http://lesscss.org).
|
package/bin/lessc
CHANGED
|
@@ -1646,8 +1646,11 @@ var debugInfo = function (context, ctx, lineSeparator) {
|
|
|
1646
1646
|
}
|
|
1647
1647
|
return result;
|
|
1648
1648
|
};
|
|
1649
|
-
debugInfo.asComment = function (ctx) { return "/* line " + ctx.debugInfo.lineNumber + ", " + ctx.debugInfo.fileName + " */\n"; };
|
|
1649
|
+
debugInfo.asComment = function (ctx) { return ctx.debugInfo ? "/* line " + ctx.debugInfo.lineNumber + ", " + ctx.debugInfo.fileName + " */\n" : ''; };
|
|
1650
1650
|
debugInfo.asMediaQuery = function (ctx) {
|
|
1651
|
+
if (!ctx.debugInfo) {
|
|
1652
|
+
return '';
|
|
1653
|
+
}
|
|
1651
1654
|
var filenameWithProtocol = ctx.debugInfo.fileName;
|
|
1652
1655
|
if (!/^[a-z]+:\/\//i.test(filenameWithProtocol)) {
|
|
1653
1656
|
filenameWithProtocol = "file://" + filenameWithProtocol;
|
|
@@ -10110,12 +10113,8 @@ var parseTree = (function (SourceMapBuilder) {
|
|
|
10110
10113
|
if (options.sourceMap) {
|
|
10111
10114
|
result.map = sourceMapBuilder.getExternalSourceMap();
|
|
10112
10115
|
}
|
|
10113
|
-
|
|
10114
|
-
|
|
10115
|
-
if (this.imports.files.hasOwnProperty(file_1) && file_1 !== this.imports.rootFilename) {
|
|
10116
|
-
result.imports.push(file_1);
|
|
10117
|
-
}
|
|
10118
|
-
}
|
|
10116
|
+
var rootFilename = this.imports.rootFilename;
|
|
10117
|
+
result.imports = this.imports.files.filter(function (file) { return file !== rootFilename; });
|
|
10119
10118
|
return result;
|
|
10120
10119
|
};
|
|
10121
10120
|
return ParseTree;
|
|
@@ -10144,6 +10143,7 @@ var importManager = (function (environment) {
|
|
|
10144
10143
|
this.context = context;
|
|
10145
10144
|
// Deprecated? Unused outside of here, could be useful.
|
|
10146
10145
|
this.queue = []; // Files which haven't been imported yet
|
|
10146
|
+
this.files = []; // List of files imported
|
|
10147
10147
|
}
|
|
10148
10148
|
/**
|
|
10149
10149
|
* Add an import to be imported
|
|
@@ -10165,6 +10165,10 @@ var importManager = (function (environment) {
|
|
|
10165
10165
|
logger.info("The file " + fullPath + " was skipped because it was not found and the import was marked optional.");
|
|
10166
10166
|
}
|
|
10167
10167
|
else {
|
|
10168
|
+
var files = importManager.files;
|
|
10169
|
+
if (files.indexOf(fullPath) === -1) {
|
|
10170
|
+
files.push(fullPath);
|
|
10171
|
+
}
|
|
10168
10172
|
if (e && !importManager.error) {
|
|
10169
10173
|
importManager.error = e;
|
|
10170
10174
|
}
|
|
@@ -10549,7 +10553,7 @@ var createFromEnvironment = (function (environment, fileManagers) {
|
|
|
10549
10553
|
* It's not clear what should / must be public and why.
|
|
10550
10554
|
*/
|
|
10551
10555
|
var initial = {
|
|
10552
|
-
version: [3, 11,
|
|
10556
|
+
version: [3, 11, 3],
|
|
10553
10557
|
data: data,
|
|
10554
10558
|
tree: tree,
|
|
10555
10559
|
Environment: environment$1,
|
package/dist/less.cjs.js
CHANGED
|
@@ -1642,8 +1642,11 @@ var debugInfo = function (context, ctx, lineSeparator) {
|
|
|
1642
1642
|
}
|
|
1643
1643
|
return result;
|
|
1644
1644
|
};
|
|
1645
|
-
debugInfo.asComment = function (ctx) { return "/* line " + ctx.debugInfo.lineNumber + ", " + ctx.debugInfo.fileName + " */\n"; };
|
|
1645
|
+
debugInfo.asComment = function (ctx) { return ctx.debugInfo ? "/* line " + ctx.debugInfo.lineNumber + ", " + ctx.debugInfo.fileName + " */\n" : ''; };
|
|
1646
1646
|
debugInfo.asMediaQuery = function (ctx) {
|
|
1647
|
+
if (!ctx.debugInfo) {
|
|
1648
|
+
return '';
|
|
1649
|
+
}
|
|
1647
1650
|
var filenameWithProtocol = ctx.debugInfo.fileName;
|
|
1648
1651
|
if (!/^[a-z]+:\/\//i.test(filenameWithProtocol)) {
|
|
1649
1652
|
filenameWithProtocol = "file://" + filenameWithProtocol;
|
|
@@ -10106,12 +10109,8 @@ var parseTree = (function (SourceMapBuilder) {
|
|
|
10106
10109
|
if (options.sourceMap) {
|
|
10107
10110
|
result.map = sourceMapBuilder.getExternalSourceMap();
|
|
10108
10111
|
}
|
|
10109
|
-
|
|
10110
|
-
|
|
10111
|
-
if (this.imports.files.hasOwnProperty(file_1) && file_1 !== this.imports.rootFilename) {
|
|
10112
|
-
result.imports.push(file_1);
|
|
10113
|
-
}
|
|
10114
|
-
}
|
|
10112
|
+
var rootFilename = this.imports.rootFilename;
|
|
10113
|
+
result.imports = this.imports.files.filter(function (file) { return file !== rootFilename; });
|
|
10115
10114
|
return result;
|
|
10116
10115
|
};
|
|
10117
10116
|
return ParseTree;
|
|
@@ -10140,6 +10139,7 @@ var importManager = (function (environment) {
|
|
|
10140
10139
|
this.context = context;
|
|
10141
10140
|
// Deprecated? Unused outside of here, could be useful.
|
|
10142
10141
|
this.queue = []; // Files which haven't been imported yet
|
|
10142
|
+
this.files = []; // List of files imported
|
|
10143
10143
|
}
|
|
10144
10144
|
/**
|
|
10145
10145
|
* Add an import to be imported
|
|
@@ -10161,6 +10161,10 @@ var importManager = (function (environment) {
|
|
|
10161
10161
|
logger.info("The file " + fullPath + " was skipped because it was not found and the import was marked optional.");
|
|
10162
10162
|
}
|
|
10163
10163
|
else {
|
|
10164
|
+
var files = importManager.files;
|
|
10165
|
+
if (files.indexOf(fullPath) === -1) {
|
|
10166
|
+
files.push(fullPath);
|
|
10167
|
+
}
|
|
10164
10168
|
if (e && !importManager.error) {
|
|
10165
10169
|
importManager.error = e;
|
|
10166
10170
|
}
|
|
@@ -10545,7 +10549,7 @@ var createFromEnvironment = (function (environment, fileManagers) {
|
|
|
10545
10549
|
* It's not clear what should / must be public and why.
|
|
10546
10550
|
*/
|
|
10547
10551
|
var initial = {
|
|
10548
|
-
version: [3, 11,
|
|
10552
|
+
version: [3, 11, 3],
|
|
10549
10553
|
data: data,
|
|
10550
10554
|
tree: tree,
|
|
10551
10555
|
Environment: environment$1,
|
package/dist/less.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Less - Leaner CSS v3.11.
|
|
2
|
+
* Less - Leaner CSS v3.11.3
|
|
3
3
|
* http://lesscss.org
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2009-2020, Alexis Sellier <self@cloudhead.net>
|
|
@@ -1750,8 +1750,11 @@
|
|
|
1750
1750
|
}
|
|
1751
1751
|
return result;
|
|
1752
1752
|
};
|
|
1753
|
-
debugInfo.asComment = function (ctx) { return "/* line " + ctx.debugInfo.lineNumber + ", " + ctx.debugInfo.fileName + " */\n"; };
|
|
1753
|
+
debugInfo.asComment = function (ctx) { return ctx.debugInfo ? "/* line " + ctx.debugInfo.lineNumber + ", " + ctx.debugInfo.fileName + " */\n" : ''; };
|
|
1754
1754
|
debugInfo.asMediaQuery = function (ctx) {
|
|
1755
|
+
if (!ctx.debugInfo) {
|
|
1756
|
+
return '';
|
|
1757
|
+
}
|
|
1755
1758
|
var filenameWithProtocol = ctx.debugInfo.fileName;
|
|
1756
1759
|
if (!/^[a-z]+:\/\//i.test(filenameWithProtocol)) {
|
|
1757
1760
|
filenameWithProtocol = "file://" + filenameWithProtocol;
|
|
@@ -10364,12 +10367,8 @@
|
|
|
10364
10367
|
if (options.sourceMap) {
|
|
10365
10368
|
result.map = sourceMapBuilder.getExternalSourceMap();
|
|
10366
10369
|
}
|
|
10367
|
-
|
|
10368
|
-
|
|
10369
|
-
if (this.imports.files.hasOwnProperty(file_1) && file_1 !== this.imports.rootFilename) {
|
|
10370
|
-
result.imports.push(file_1);
|
|
10371
|
-
}
|
|
10372
|
-
}
|
|
10370
|
+
var rootFilename = this.imports.rootFilename;
|
|
10371
|
+
result.imports = this.imports.files.filter(function (file) { return file !== rootFilename; });
|
|
10373
10372
|
return result;
|
|
10374
10373
|
};
|
|
10375
10374
|
return ParseTree;
|
|
@@ -10398,6 +10397,7 @@
|
|
|
10398
10397
|
this.context = context;
|
|
10399
10398
|
// Deprecated? Unused outside of here, could be useful.
|
|
10400
10399
|
this.queue = []; // Files which haven't been imported yet
|
|
10400
|
+
this.files = []; // List of files imported
|
|
10401
10401
|
}
|
|
10402
10402
|
/**
|
|
10403
10403
|
* Add an import to be imported
|
|
@@ -10419,6 +10419,10 @@
|
|
|
10419
10419
|
logger.info("The file " + fullPath + " was skipped because it was not found and the import was marked optional.");
|
|
10420
10420
|
}
|
|
10421
10421
|
else {
|
|
10422
|
+
var files = importManager.files;
|
|
10423
|
+
if (files.indexOf(fullPath) === -1) {
|
|
10424
|
+
files.push(fullPath);
|
|
10425
|
+
}
|
|
10422
10426
|
if (e && !importManager.error) {
|
|
10423
10427
|
importManager.error = e;
|
|
10424
10428
|
}
|
|
@@ -10803,7 +10807,7 @@
|
|
|
10803
10807
|
* It's not clear what should / must be public and why.
|
|
10804
10808
|
*/
|
|
10805
10809
|
var initial = {
|
|
10806
|
-
version: [3, 11,
|
|
10810
|
+
version: [3, 11, 3],
|
|
10807
10811
|
data: data,
|
|
10808
10812
|
tree: tree,
|
|
10809
10813
|
Environment: environment,
|