less 4.4.2 → 4.5.1

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 (43) hide show
  1. package/Gruntfile.js +16 -17
  2. package/bin/lessc +35 -40
  3. package/dist/less.js +118 -185
  4. package/dist/less.min.js +2 -2
  5. package/dist/less.min.js.map +1 -1
  6. package/lib/less/contexts.js +0 -1
  7. package/lib/less/contexts.js.map +1 -1
  8. package/lib/less/default-options.js +22 -3
  9. package/lib/less/default-options.js.map +1 -1
  10. package/lib/less/less-error.js +2 -1
  11. package/lib/less/less-error.js.map +1 -1
  12. package/lib/less/parse-tree.js +58 -1
  13. package/lib/less/parse-tree.js.map +1 -1
  14. package/lib/less/parser/parser-input.js +2 -19
  15. package/lib/less/parser/parser-input.js.map +1 -1
  16. package/lib/less/parser/parser.js +2 -14
  17. package/lib/less/parser/parser.js.map +1 -1
  18. package/lib/less/source-map-output.js +1 -1
  19. package/lib/less/source-map-output.js.map +1 -1
  20. package/lib/less/tree/debug-info.js +29 -0
  21. package/lib/less/tree/debug-info.js.map +1 -1
  22. package/lib/less-node/lessc-helper.js +8 -7
  23. package/lib/less-node/lessc-helper.js.map +1 -1
  24. package/package.json +10 -5
  25. package/scripts/coverage-lines.js +207 -0
  26. package/scripts/coverage-report.js +158 -0
  27. package/scripts/postinstall.js +61 -0
  28. package/test/browser/common.js +22 -1
  29. package/test/browser/generator/runner.config.js +20 -24
  30. package/test/browser/generator/template.js +14 -3
  31. package/test/browser/runner-browser-options.js +5 -5
  32. package/test/index.js +293 -98
  33. package/test/less-test.js +453 -94
  34. package/test/sourcemaps/comprehensive.json +1 -0
  35. package/test/sourcemaps/sourcemaps-basepath.json +1 -0
  36. package/test/sourcemaps/sourcemaps-include-source.json +1 -0
  37. package/test/sourcemaps/sourcemaps-rootpath.json +1 -0
  38. package/test/sourcemaps/sourcemaps-url.json +1 -0
  39. package/test.less +1 -0
  40. package/lib/less/parser/chunker.js +0 -148
  41. package/lib/less/parser/chunker.js.map +0 -1
  42. package/test/browser/runner-legacy-options.js +0 -6
  43. package/test/browser/runner-legacy-spec.js +0 -3
@@ -10,7 +10,7 @@ function default_1(environment) {
10
10
  if (options.sourceMapFilename) {
11
11
  this._sourceMapFilename = options.sourceMapFilename.replace(/\\/g, '/');
12
12
  }
13
- this._outputFilename = options.outputFilename;
13
+ this._outputFilename = options.outputFilename ? options.outputFilename.replace(/\\/g, '/') : options.outputFilename;
14
14
  this.sourceMapURL = options.sourceMapURL;
15
15
  if (options.sourceMapBasepath) {
16
16
  this._sourceMapBasepath = options.sourceMapBasepath.replace(/\\/g, '/');
@@ -1 +1 @@
1
- {"version":3,"file":"source-map-output.js","sourceRoot":"","sources":["../../src/less/source-map-output.js"],"names":[],"mappings":";;AAAA,mBAAyB,WAAW;IAChC;QACI,yBAAY,OAAO;YACf,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;YACf,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC;YAClC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;YACxC,IAAI,CAAC,wBAAwB,GAAG,OAAO,CAAC,uBAAuB,CAAC;YAChE,IAAI,OAAO,CAAC,iBAAiB,EAAE;gBAC3B,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;aAC3E;YACD,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC;YAC9C,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;YACzC,IAAI,OAAO,CAAC,iBAAiB,EAAE;gBAC3B,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;aAC3E;YACD,IAAI,OAAO,CAAC,iBAAiB,EAAE;gBAC3B,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,iBAAi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C,YAAY,CAAC;iBACpC;qBAAM,IAAI,IAAI,CAAC,kBAAkB,EAAE;oBAChC,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC;iBAC1C;gBACD,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;gBAEjC,IAAI,CAAC,SAAS,GAAG,gBAAgB,CAAC;aACrC;YAED,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC9B,CAAC;QACL,sBAAC;IAAD,CAAC,AAlJD,IAkJC;IAED,OAAO,eAAe,CAAC;AAC3B,CAAC;AAtJD,4BAsJC","sourcesContent":["export default function (environment) {\n class SourceMapOutput {\n constructor(options) {\n this._css = [];\n this._rootNode = options.rootNode;\n this._contentsMap = options.contentsMap;\n this._contentsIgnoredCharsMap = options.contentsIgnoredCharsMap;\n if (options.sourceMapFilename) {\n this._sourceMapFilename = options.sourceMapFilename.replace(/\\\\/g, '/');\n }\n this._outputFilename = options.outputFilename;\n this.sourceMapURL = options.sourceMapURL;\n if (options.sourceMapBasepath) {\n this._sourceMapBasepath = options.sourceMapBasepath.replace(/\\\\/g, '/');\n }\n if (options.sourceMapRootpath) {\n this._sourceMapRootpath = options.sourceMapRootpath.replace(/\\\\/g, '/');\n if (this._sourceMapRootpath.charAt(this._sourceMapRootpath.length - 1) !== '/') {\n this._sourceMapRootpath += '/';\n }\n } else {\n this._sourceMapRootpath = '';\n }\n this._outputSourceFiles = options.outputSourceFiles;\n this._sourceMapGeneratorConstructor = environment.getSourceMapGenerator();\n\n this._lineNumber = 0;\n this._column = 0;\n }\n\n removeBasepath(path) {\n if (this._sourceMapBasepath && path.indexOf(this._sourceMapBasepath) === 0) {\n path = path.substring(this._sourceMapBasepath.length);\n if (path.charAt(0) === '\\\\' || path.charAt(0) === '/') {\n path = path.substring(1);\n }\n }\n\n return path;\n }\n\n normalizeFilename(filename) {\n filename = filename.replace(/\\\\/g, '/');\n filename = this.removeBasepath(filename);\n return (this._sourceMapRootpath || '') + filename;\n }\n\n add(chunk, fileInfo, index, mapLines) {\n\n // ignore adding empty strings\n if (!chunk) {\n return;\n }\n\n let lines, sourceLines, columns, sourceColumns, i;\n\n if (fileInfo && fileInfo.filename) {\n let inputSource = this._contentsMap[fileInfo.filename];\n\n // remove vars/banner added to the top of the file\n if (this._contentsIgnoredCharsMap[fileInfo.filename]) {\n // adjust the index\n index -= this._contentsIgnoredCharsMap[fileInfo.filename];\n if (index < 0) { index = 0; }\n // adjust the source\n inputSource = inputSource.slice(this._contentsIgnoredCharsMap[fileInfo.filename]);\n }\n\n /** \n * ignore empty content, or failsafe\n * if contents map is incorrect\n */\n if (inputSource === undefined) {\n this._css.push(chunk);\n return;\n }\n\n inputSource = inputSource.substring(0, index);\n sourceLines = inputSource.split('\\n');\n sourceColumns = sourceLines[sourceLines.length - 1];\n }\n\n lines = chunk.split('\\n');\n columns = lines[lines.length - 1];\n\n if (fileInfo && fileInfo.filename) {\n if (!mapLines) {\n this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + 1, column: this._column},\n original: { line: sourceLines.length, column: sourceColumns.length},\n source: this.normalizeFilename(fileInfo.filename)});\n } else {\n for (i = 0; i < lines.length; i++) {\n this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + i + 1, column: i === 0 ? this._column : 0},\n original: { line: sourceLines.length + i, column: i === 0 ? sourceColumns.length : 0},\n source: this.normalizeFilename(fileInfo.filename)});\n }\n }\n }\n\n if (lines.length === 1) {\n this._column += columns.length;\n } else {\n this._lineNumber += lines.length - 1;\n this._column = columns.length;\n }\n\n this._css.push(chunk);\n }\n\n isEmpty() {\n return this._css.length === 0;\n }\n\n toCSS(context) {\n this._sourceMapGenerator = new this._sourceMapGeneratorConstructor({ file: this._outputFilename, sourceRoot: null });\n\n if (this._outputSourceFiles) {\n for (const filename in this._contentsMap) {\n // eslint-disable-next-line no-prototype-builtins\n if (this._contentsMap.hasOwnProperty(filename)) {\n let source = this._contentsMap[filename];\n if (this._contentsIgnoredCharsMap[filename]) {\n source = source.slice(this._contentsIgnoredCharsMap[filename]);\n }\n this._sourceMapGenerator.setSourceContent(this.normalizeFilename(filename), source);\n }\n }\n }\n\n this._rootNode.genCSS(context, this);\n\n if (this._css.length > 0) {\n let sourceMapURL;\n const sourceMapContent = JSON.stringify(this._sourceMapGenerator.toJSON());\n\n if (this.sourceMapURL) {\n sourceMapURL = this.sourceMapURL;\n } else if (this._sourceMapFilename) {\n sourceMapURL = this._sourceMapFilename;\n }\n this.sourceMapURL = sourceMapURL;\n\n this.sourceMap = sourceMapContent;\n }\n\n return this._css.join('');\n }\n }\n\n return SourceMapOutput;\n}\n"]}
1
+ {"version":3,"file":"source-map-output.js","sourceRoot":"","sources":["../../src/less/source-map-output.js"],"names":[],"mappings":";;AAAA,mBAAyB,WAAW;IAChC;QACI,yBAAY,OAAO;YACf,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;YACf,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC;YAClC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;YACxC,IAAI,CAAC,wBAAwB,GAAG,OAAO,CAAC,uBAAuB,CAAC;YAChE,IAAI,OAAO,CAAC,iBAAiB,EAAE;gBAC3B,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;aAC3E;YACD,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC;YACpH,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;YACzC,IAAI,OAAO,CAAC,iBAAiB,EAAE;gBAC3B,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,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AAmB,CAAC,MAAM,EAAE,CAAC,CAAC;gBAE3E,IAAI,IAAI,CAAC,YAAY,EAAE;oBACnB,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;iBACpC;qBAAM,IAAI,IAAI,CAAC,kBAAkB,EAAE;oBAChC,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC;iBAC1C;gBACD,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;gBAEjC,IAAI,CAAC,SAAS,GAAG,gBAAgB,CAAC;aACrC;YAED,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC9B,CAAC;QACL,sBAAC;IAAD,CAAC,AAlJD,IAkJC;IAED,OAAO,eAAe,CAAC;AAC3B,CAAC;AAtJD,4BAsJC","sourcesContent":["export default function (environment) {\n class SourceMapOutput {\n constructor(options) {\n this._css = [];\n this._rootNode = options.rootNode;\n this._contentsMap = options.contentsMap;\n this._contentsIgnoredCharsMap = options.contentsIgnoredCharsMap;\n if (options.sourceMapFilename) {\n this._sourceMapFilename = options.sourceMapFilename.replace(/\\\\/g, '/');\n }\n this._outputFilename = options.outputFilename ? options.outputFilename.replace(/\\\\/g, '/') : options.outputFilename;\n this.sourceMapURL = options.sourceMapURL;\n if (options.sourceMapBasepath) {\n this._sourceMapBasepath = options.sourceMapBasepath.replace(/\\\\/g, '/');\n }\n if (options.sourceMapRootpath) {\n this._sourceMapRootpath = options.sourceMapRootpath.replace(/\\\\/g, '/');\n if (this._sourceMapRootpath.charAt(this._sourceMapRootpath.length - 1) !== '/') {\n this._sourceMapRootpath += '/';\n }\n } else {\n this._sourceMapRootpath = '';\n }\n this._outputSourceFiles = options.outputSourceFiles;\n this._sourceMapGeneratorConstructor = environment.getSourceMapGenerator();\n\n this._lineNumber = 0;\n this._column = 0;\n }\n\n removeBasepath(path) {\n if (this._sourceMapBasepath && path.indexOf(this._sourceMapBasepath) === 0) {\n path = path.substring(this._sourceMapBasepath.length);\n if (path.charAt(0) === '\\\\' || path.charAt(0) === '/') {\n path = path.substring(1);\n }\n }\n\n return path;\n }\n\n normalizeFilename(filename) {\n filename = filename.replace(/\\\\/g, '/');\n filename = this.removeBasepath(filename);\n return (this._sourceMapRootpath || '') + filename;\n }\n\n add(chunk, fileInfo, index, mapLines) {\n\n // ignore adding empty strings\n if (!chunk) {\n return;\n }\n\n let lines, sourceLines, columns, sourceColumns, i;\n\n if (fileInfo && fileInfo.filename) {\n let inputSource = this._contentsMap[fileInfo.filename];\n\n // remove vars/banner added to the top of the file\n if (this._contentsIgnoredCharsMap[fileInfo.filename]) {\n // adjust the index\n index -= this._contentsIgnoredCharsMap[fileInfo.filename];\n if (index < 0) { index = 0; }\n // adjust the source\n inputSource = inputSource.slice(this._contentsIgnoredCharsMap[fileInfo.filename]);\n }\n\n /** \n * ignore empty content, or failsafe\n * if contents map is incorrect\n */\n if (inputSource === undefined) {\n this._css.push(chunk);\n return;\n }\n\n inputSource = inputSource.substring(0, index);\n sourceLines = inputSource.split('\\n');\n sourceColumns = sourceLines[sourceLines.length - 1];\n }\n\n lines = chunk.split('\\n');\n columns = lines[lines.length - 1];\n\n if (fileInfo && fileInfo.filename) {\n if (!mapLines) {\n this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + 1, column: this._column},\n original: { line: sourceLines.length, column: sourceColumns.length},\n source: this.normalizeFilename(fileInfo.filename)});\n } else {\n for (i = 0; i < lines.length; i++) {\n this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + i + 1, column: i === 0 ? this._column : 0},\n original: { line: sourceLines.length + i, column: i === 0 ? sourceColumns.length : 0},\n source: this.normalizeFilename(fileInfo.filename)});\n }\n }\n }\n\n if (lines.length === 1) {\n this._column += columns.length;\n } else {\n this._lineNumber += lines.length - 1;\n this._column = columns.length;\n }\n\n this._css.push(chunk);\n }\n\n isEmpty() {\n return this._css.length === 0;\n }\n\n toCSS(context) {\n this._sourceMapGenerator = new this._sourceMapGeneratorConstructor({ file: this._outputFilename, sourceRoot: null });\n\n if (this._outputSourceFiles) {\n for (const filename in this._contentsMap) {\n // eslint-disable-next-line no-prototype-builtins\n if (this._contentsMap.hasOwnProperty(filename)) {\n let source = this._contentsMap[filename];\n if (this._contentsIgnoredCharsMap[filename]) {\n source = source.slice(this._contentsIgnoredCharsMap[filename]);\n }\n this._sourceMapGenerator.setSourceContent(this.normalizeFilename(filename), source);\n }\n }\n }\n\n this._rootNode.genCSS(context, this);\n\n if (this._css.length > 0) {\n let sourceMapURL;\n const sourceMapContent = JSON.stringify(this._sourceMapGenerator.toJSON());\n\n if (this.sourceMapURL) {\n sourceMapURL = this.sourceMapURL;\n } else if (this._sourceMapFilename) {\n sourceMapURL = this._sourceMapFilename;\n }\n this.sourceMapURL = sourceMapURL;\n\n this.sourceMap = sourceMapContent;\n }\n\n return this._css.join('');\n }\n }\n\n return SourceMapOutput;\n}\n"]}
@@ -1,8 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * @deprecated The dumpLineNumbers option is deprecated. Use sourcemaps instead.
5
+ * This will be removed in a future version.
6
+ *
7
+ * @param {Object} ctx - Context object with debugInfo
8
+ * @returns {string} Debug info as CSS comment
9
+ */
3
10
  function asComment(ctx) {
4
11
  return "/* line ".concat(ctx.debugInfo.lineNumber, ", ").concat(ctx.debugInfo.fileName, " */\n");
5
12
  }
13
+ /**
14
+ * @deprecated The dumpLineNumbers option is deprecated. Use sourcemaps instead.
15
+ * This function generates Sass-compatible debug info using @media -sass-debug-info syntax.
16
+ * This format had short-lived usage and is no longer recommended.
17
+ * This will be removed in a future version.
18
+ *
19
+ * @param {Object} ctx - Context object with debugInfo
20
+ * @returns {string} Sass-compatible debug info as @media query
21
+ */
6
22
  function asMediaQuery(ctx) {
7
23
  var filenameWithProtocol = ctx.debugInfo.fileName;
8
24
  if (!/^[a-z]+:\/\//i.test(filenameWithProtocol)) {
@@ -15,6 +31,19 @@ function asMediaQuery(ctx) {
15
31
  return "\\".concat(a);
16
32
  }), "}line{font-family:\\00003").concat(ctx.debugInfo.lineNumber, "}}\n");
17
33
  }
34
+ /**
35
+ * Generates debug information (line numbers) for CSS output.
36
+ *
37
+ * @param {Object} context - Context object with dumpLineNumbers option
38
+ * @param {Object} ctx - Context object with debugInfo
39
+ * @param {string} [lineSeparator] - Separator between comment and media query (for 'all' mode)
40
+ * @returns {string} Debug info string
41
+ *
42
+ * @deprecated The dumpLineNumbers option is deprecated. Use sourcemaps instead.
43
+ * All modes ('comments', 'mediaquery', 'all') are deprecated and will be removed in a future version.
44
+ * The 'mediaquery' and 'all' modes generate Sass-compatible @media -sass-debug-info output
45
+ * which had short-lived usage and is no longer recommended.
46
+ */
18
47
  function debugInfo(context, ctx, lineSeparator) {
19
48
  var result = '';
20
49
  if (context.dumpLineNumbers && !context.compress) {
@@ -1 +1 @@
1
- {"version":3,"file":"debug-info.js","sourceRoot":"","sources":["../../../src/less/tree/debug-info.js"],"names":[],"mappings":";;AAAA,SAAS,SAAS,CAAC,GAAG;IAClB,OAAO,kBAAW,GAAG,CAAC,SAAS,CAAC,UAAU,eAAK,GAAG,CAAC,SAAS,CAAC,QAAQ,UAAO,CAAC;AACjF,CAAC;AAED,SAAS,YAAY,CAAC,GAAG;IACrB,IAAI,oBAAoB,GAAG,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC;IAClD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE;QAC7C,oBAAoB,GAAG,iBAAU,oBAAoB,CAAE,CAAC;KAC3D;IACD,OAAO,uDAAgD,oBAAoB,CAAC,OAAO,CAAC,YAAY,EAAE,UAAU,CAAC;QACzG,IAAI,CAAC,IAAI,IAAI,EAAE;YACX,CAAC,GAAG,GAAG,CAAC;SACX;QACD,OAAO,YAAK,CAAC,CAAE,CAAC;IACpB,CAAC,CAAC,sCAA4B,GAAG,CAAC,SAAS,CAAC,UAAU,SAAM,CAAC;AACjE,CAAC;AAED,SAAS,SAAS,CAAC,OAAO,EAAE,GAAG,EAAE,aAAa;IAC1C,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,OAAO,CAAC,eAAe,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;QAC9C,QAAQ,OAAO,CAAC,eAAe,EAAE;YAC7B,KAAK,UAAU;gBACX,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;gBACxB,MAAM;YACV,KAAK,YAAY;gBACb,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;gBAC3B,MAAM;YACV,KAAK,KAAK;gBACN,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,aAAa,IAAI,EAAE,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;gBACpE,MAAM;SACb;KACJ;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,kBAAe,SAAS,CAAC","sourcesContent":["function asComment(ctx) {\n return `/* line ${ctx.debugInfo.lineNumber}, ${ctx.debugInfo.fileName} */\\n`;\n}\n\nfunction asMediaQuery(ctx) {\n let filenameWithProtocol = ctx.debugInfo.fileName;\n if (!/^[a-z]+:\\/\\//i.test(filenameWithProtocol)) {\n filenameWithProtocol = `file://${filenameWithProtocol}`;\n }\n return `@media -sass-debug-info{filename{font-family:${filenameWithProtocol.replace(/([.:/\\\\])/g, function (a) {\n if (a == '\\\\') {\n a = '/';\n }\n return `\\\\${a}`;\n })}}line{font-family:\\\\00003${ctx.debugInfo.lineNumber}}}\\n`;\n}\n\nfunction debugInfo(context, ctx, lineSeparator) {\n let result = '';\n if (context.dumpLineNumbers && !context.compress) {\n switch (context.dumpLineNumbers) {\n case 'comments':\n result = asComment(ctx);\n break;\n case 'mediaquery':\n result = asMediaQuery(ctx);\n break;\n case 'all':\n result = asComment(ctx) + (lineSeparator || '') + asMediaQuery(ctx);\n break;\n }\n }\n return result;\n}\n\nexport default debugInfo;\n\n"]}
1
+ {"version":3,"file":"debug-info.js","sourceRoot":"","sources":["../../../src/less/t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B,CAAC;AAED,kBAAe,SAAS,CAAC","sourcesContent":["/**\n * @deprecated The dumpLineNumbers option is deprecated. Use sourcemaps instead.\n * This will be removed in a future version.\n * \n * @param {Object} ctx - Context object with debugInfo\n * @returns {string} Debug info as CSS comment\n */\nfunction asComment(ctx) {\n return `/* line ${ctx.debugInfo.lineNumber}, ${ctx.debugInfo.fileName} */\\n`;\n}\n\n/**\n * @deprecated The dumpLineNumbers option is deprecated. Use sourcemaps instead.\n * This function generates Sass-compatible debug info using @media -sass-debug-info syntax.\n * This format had short-lived usage and is no longer recommended.\n * This will be removed in a future version.\n * \n * @param {Object} ctx - Context object with debugInfo\n * @returns {string} Sass-compatible debug info as @media query\n */\nfunction asMediaQuery(ctx) {\n let filenameWithProtocol = ctx.debugInfo.fileName;\n if (!/^[a-z]+:\\/\\//i.test(filenameWithProtocol)) {\n filenameWithProtocol = `file://${filenameWithProtocol}`;\n }\n return `@media -sass-debug-info{filename{font-family:${filenameWithProtocol.replace(/([.:/\\\\])/g, function (a) {\n if (a == '\\\\') {\n a = '/';\n }\n return `\\\\${a}`;\n })}}line{font-family:\\\\00003${ctx.debugInfo.lineNumber}}}\\n`;\n}\n\n/**\n * Generates debug information (line numbers) for CSS output.\n * \n * @param {Object} context - Context object with dumpLineNumbers option\n * @param {Object} ctx - Context object with debugInfo\n * @param {string} [lineSeparator] - Separator between comment and media query (for 'all' mode)\n * @returns {string} Debug info string\n * \n * @deprecated The dumpLineNumbers option is deprecated. Use sourcemaps instead.\n * All modes ('comments', 'mediaquery', 'all') are deprecated and will be removed in a future version.\n * The 'mediaquery' and 'all' modes generate Sass-compatible @media -sass-debug-info output\n * which had short-lived usage and is no longer recommended.\n */\nfunction debugInfo(context, ctx, lineSeparator) {\n let result = '';\n if (context.dumpLineNumbers && !context.compress) {\n switch (context.dumpLineNumbers) {\n case 'comments':\n result = asComment(ctx);\n break;\n case 'mediaquery':\n result = asMediaQuery(ctx);\n break;\n case 'all':\n result = asComment(ctx) + (lineSeparator || '') + asMediaQuery(ctx);\n break;\n }\n }\n return result;\n}\n\nexport default debugInfo;\n\n"]}
@@ -32,7 +32,7 @@ var lessc_helper = {
32
32
  console.log(' -l, --lint Syntax check only (lint).');
33
33
  console.log(' -s, --silent Suppresses output of error messages.');
34
34
  console.log(' --quiet Suppresses output of warnings.');
35
- console.log(' --strict-imports Forces evaluation of imports.');
35
+ console.log(' --strict-imports (DEPRECATED) Ignores .less imports inside selector blocks. Has confusing behavior.');
36
36
  console.log(' --insecure Allows imports from insecure https hosts.');
37
37
  console.log(' -v, --version Prints version number and exit.');
38
38
  console.log(' --verbose Be verbose.');
@@ -72,12 +72,13 @@ var lessc_helper = {
72
72
  console.log(' -sm=on|off Legacy parens-only math. Use --math');
73
73
  console.log(' --strict-math=on|off ');
74
74
  console.log('');
75
- console.log(' --line-numbers=TYPE Outputs filename and line numbers.');
76
- console.log(' TYPE can be either \'comments\', which will output');
77
- console.log(' the debug info within comments, \'mediaquery\'');
78
- console.log(' that will output the information within a fake');
79
- console.log(' media query which is compatible with the SASS');
80
- console.log(' format, and \'all\' which will do both.');
75
+ console.log(' --line-numbers=TYPE (DEPRECATED) Outputs filename and line numbers.');
76
+ console.log(' TYPE can be either \'comments\', \'mediaquery\', or \'all\'.');
77
+ console.log(' The entire dumpLineNumbers option is deprecated.');
78
+ console.log(' Use sourcemaps (--source-map) instead.');
79
+ console.log(' All modes will be removed in a future version.');
80
+ console.log(' Note: \'mediaquery\' and \'all\' modes generate @media -sass-debug-info');
81
+ console.log(' which had short-lived usage and is no longer recommended.');
81
82
  console.log(' -x, --compress Compresses output by removing some whitespaces.');
82
83
  console.log(' We recommend you use a dedicated minifer like less-plugin-clean-css');
83
84
  console.log('');
@@ -1 +1 @@
1
- {"version":3,"file":"lessc-helper.js","sourceRoot":"","sources":["../../src/less-node/lessc-helper.js"],"names":[],"mappings":"AAAA,kBAAkB;AAClB,EAAE;AACF,kCAAkC;AAClC,IAAM,YAAY,GAAG;IAEjB,mBAAmB;IACnB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,CAAC,GAAG,CAAC,4EAA4E,CAAC,CAAC;QAC1F,OAAO,CAAC,GAAG,CAAC,gGAAgG,CAAC,CAAC;QAC9G,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,uDAAuD,CAAC,CAAC;QACrE,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;IACpD,CAAC;CACJ,CAAC;AAEF,2BAA2B;AAC3B,iDAAiD;AACjD,KAAK,IAAM,CAAC,IAAI,YAAY,EAAE;IAAE,IAAI,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE;QAAE,OAAO,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;KAAE;CAAC","sourcesContent":["// lessc_helper.js\n//\n// helper functions for lessc\nconst lessc_helper = {\n\n // Stylize a string\n stylize : function(str, style) {\n const styles = {\n 'reset' : [0, 0],\n 'bold' : [1, 22],\n 'inverse' : [7, 27],\n 'underline' : [4, 24],\n 'yellow' : [33, 39],\n 'green' : [32, 39],\n 'red' : [31, 39],\n 'grey' : [90, 39]\n };\n return `\\x1b[${styles[style][0]}m${str}\\x1b[${styles[style][1]}m`;\n },\n\n // Print command line options\n printUsage: function() {\n console.log('usage: lessc [option option=parameter ...] <source> [destination]');\n console.log('');\n console.log('If source is set to `-\\' (dash or hyphen-minus), input is read from stdin.');\n console.log('');\n console.log('options:');\n console.log(' -h, --help Prints help (this message) and exit.');\n console.log(' --include-path=PATHS Sets include paths. Separated by `:\\'. `;\\' also supported on windows.');\n console.log(' -M, --depends Outputs a makefile import dependency list to stdout.');\n console.log(' --no-color Disables colorized output.');\n console.log(' --ie-compat Enables IE8 compatibility checks.');\n console.log(' --js Enables inline JavaScript in less files');\n console.log(' -l, --lint Syntax check only (lint).');\n console.log(' -s, --silent Suppresses output of error messages.');\n console.log(' --quiet Suppresses output of warnings.');\n console.log(' --strict-imports Forces evaluation of imports.');\n console.log(' --insecure Allows imports from insecure https hosts.');\n console.log(' -v, --version Prints version number and exit.');\n console.log(' --verbose Be verbose.');\n console.log(' --source-map[=FILENAME] Outputs a v3 sourcemap to the filename (or output filename.map).');\n console.log(' --source-map-rootpath=X Adds this path onto the sourcemap filename and less file paths.');\n console.log(' --source-map-basepath=X Sets sourcemap base path, defaults to current working directory.');\n console.log(' --source-map-include-source Puts the less files into the map instead of referencing them.');\n console.log(' --source-map-inline Puts the map (and any less files) as a base64 data uri into the output css file.');\n console.log(' --source-map-url=URL Sets a custom URL to map file, for sourceMappingURL comment');\n console.log(' in generated CSS file.');\n console.log(' --source-map-no-annotation Excludes the sourceMappingURL comment from the output css file.');\n console.log(' -rp, --rootpath=URL Sets rootpath for url rewriting in relative imports and urls');\n console.log(' Works with or without the relative-urls option.');\n console.log(' -ru=, --rewrite-urls= Rewrites URLs to make them relative to the base less file.');\n console.log(' all|local|off \\'all\\' rewrites all URLs, \\'local\\' just those starting with a \\'.\\'');\n console.log('');\n console.log(' -m=, --math=');\n console.log(' always Less will eagerly perform math operations always.');\n console.log(' parens-division Math performed except for division (/) operator');\n console.log(' parens | strict Math only performed inside parentheses');\n console.log(' strict-legacy Parens required in very strict terms (legacy --strict-math)');\n console.log('');\n console.log(' -su=on|off Allows mixed units, e.g. 1px+1em or 1px*1px which have units');\n console.log(' --strict-units=on|off that cannot be represented.');\n console.log(' --global-var=\\'VAR=VALUE\\' Defines a variable that can be referenced by the file.');\n console.log(' --modify-var=\\'VAR=VALUE\\' Modifies a variable already declared in the file.');\n console.log(' --url-args=\\'QUERYSTRING\\' Adds params into url tokens (e.g. 42, cb=42 or \\'a=1&b=2\\')');\n console.log(' --plugin=PLUGIN=OPTIONS Loads a plugin. You can also omit the --plugin= if the plugin begins');\n console.log(' less-plugin. E.g. the clean css plugin is called less-plugin-clean-css');\n console.log(' once installed (npm install less-plugin-clean-css), use either with');\n console.log(' --plugin=less-plugin-clean-css or just --clean-css');\n console.log(' specify options afterwards e.g. --plugin=less-plugin-clean-css=\"advanced\"');\n console.log(' or --clean-css=\"advanced\"');\n console.log(' --disable-plugin-rule Disallow @plugin statements');\n console.log('');\n console.log('-------------------------- Deprecated ----------------');\n console.log(' -sm=on|off Legacy parens-only math. Use --math');\n console.log(' --strict-math=on|off ');\n console.log('');\n console.log(' --line-numbers=TYPE Outputs filename and line numbers.');\n console.log(' TYPE can be either \\'comments\\', which will output');\n console.log(' the debug info within comments, \\'mediaquery\\'');\n console.log(' that will output the information within a fake');\n console.log(' media query which is compatible with the SASS');\n console.log(' format, and \\'all\\' which will do both.');\n console.log(' -x, --compress Compresses output by removing some whitespaces.');\n console.log(' We recommend you use a dedicated minifer like less-plugin-clean-css');\n console.log('');\n console.log('Report bugs to: http://github.com/less/less.js/issues');\n console.log('Home page: <http://lesscss.org/>');\n }\n};\n\n// Exports helper functions\n// eslint-disable-next-line no-prototype-builtins\nfor (const h in lessc_helper) { if (lessc_helper.hasOwnProperty(h)) { exports[h] = lessc_helper[h]; }}\n"]}
1
+ {"version":3,"file":"lessc-helper.js","sourceRoot":"","sources":["../../src/less-node/lessc-helper.js"],"names":[],"mappings":"AAAA,kBAAkB;AAClB,EAAE;AACF,kCAAkC;AAClC,IAAM,YAAY,GAAG;IAEjB,mBAAmB;IACnB,OAAO,EAAG,UAAS,GAAG,EAAE,KAAK;QACzB,IAAM,MAAM,GAAG;YACX,OAAO,EAAO,CAAC,CAAC,EAAI,CAAC,CAAC;YACtB,MAAM,EAAQ,CAAC,CAAC,EAAG,EAAE,CAAC;YACtB,SAAS,EAAK,CAAC,CAAC,EAAG,EAAE,CAAC;YACtB,WAAW,EAAG,CAAC,CAAC,EAAG,EAAE,CAAC;YACtB,QAAQ,EAAM,CAAC,EAAE,EAAE,EAAE,CAAC;YACtB,OAAO,EAAO,CAAC,EAAE,EAAE,EAAE,CAAC;YACtB,KAAK,EAAS,CAAC,EAAE,EAAE,EAAE,CAAC;YACtB,MAAM,EAAQ,CAAC,EAAE,EAAE,EAAE,CAAC;SACzB,CAAC;QACF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,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;KAAE;CAAC","sourcesContent":["// lessc_helper.js\n//\n// helper functions for lessc\nconst lessc_helper = {\n\n // Stylize a string\n stylize : function(str, style) {\n const styles = {\n 'reset' : [0, 0],\n 'bold' : [1, 22],\n 'inverse' : [7, 27],\n 'underline' : [4, 24],\n 'yellow' : [33, 39],\n 'green' : [32, 39],\n 'red' : [31, 39],\n 'grey' : [90, 39]\n };\n return `\\x1b[${styles[style][0]}m${str}\\x1b[${styles[style][1]}m`;\n },\n\n // Print command line options\n printUsage: function() {\n console.log('usage: lessc [option option=parameter ...] <source> [destination]');\n console.log('');\n console.log('If source is set to `-\\' (dash or hyphen-minus), input is read from stdin.');\n console.log('');\n console.log('options:');\n console.log(' -h, --help Prints help (this message) and exit.');\n console.log(' --include-path=PATHS Sets include paths. Separated by `:\\'. `;\\' also supported on windows.');\n console.log(' -M, --depends Outputs a makefile import dependency list to stdout.');\n console.log(' --no-color Disables colorized output.');\n console.log(' --ie-compat Enables IE8 compatibility checks.');\n console.log(' --js Enables inline JavaScript in less files');\n console.log(' -l, --lint Syntax check only (lint).');\n console.log(' -s, --silent Suppresses output of error messages.');\n console.log(' --quiet Suppresses output of warnings.');\n console.log(' --strict-imports (DEPRECATED) Ignores .less imports inside selector blocks. Has confusing behavior.');\n console.log(' --insecure Allows imports from insecure https hosts.');\n console.log(' -v, --version Prints version number and exit.');\n console.log(' --verbose Be verbose.');\n console.log(' --source-map[=FILENAME] Outputs a v3 sourcemap to the filename (or output filename.map).');\n console.log(' --source-map-rootpath=X Adds this path onto the sourcemap filename and less file paths.');\n console.log(' --source-map-basepath=X Sets sourcemap base path, defaults to current working directory.');\n console.log(' --source-map-include-source Puts the less files into the map instead of referencing them.');\n console.log(' --source-map-inline Puts the map (and any less files) as a base64 data uri into the output css file.');\n console.log(' --source-map-url=URL Sets a custom URL to map file, for sourceMappingURL comment');\n console.log(' in generated CSS file.');\n console.log(' --source-map-no-annotation Excludes the sourceMappingURL comment from the output css file.');\n console.log(' -rp, --rootpath=URL Sets rootpath for url rewriting in relative imports and urls');\n console.log(' Works with or without the relative-urls option.');\n console.log(' -ru=, --rewrite-urls= Rewrites URLs to make them relative to the base less file.');\n console.log(' all|local|off \\'all\\' rewrites all URLs, \\'local\\' just those starting with a \\'.\\'');\n console.log('');\n console.log(' -m=, --math=');\n console.log(' always Less will eagerly perform math operations always.');\n console.log(' parens-division Math performed except for division (/) operator');\n console.log(' parens | strict Math only performed inside parentheses');\n console.log(' strict-legacy Parens required in very strict terms (legacy --strict-math)');\n console.log('');\n console.log(' -su=on|off Allows mixed units, e.g. 1px+1em or 1px*1px which have units');\n console.log(' --strict-units=on|off that cannot be represented.');\n console.log(' --global-var=\\'VAR=VALUE\\' Defines a variable that can be referenced by the file.');\n console.log(' --modify-var=\\'VAR=VALUE\\' Modifies a variable already declared in the file.');\n console.log(' --url-args=\\'QUERYSTRING\\' Adds params into url tokens (e.g. 42, cb=42 or \\'a=1&b=2\\')');\n console.log(' --plugin=PLUGIN=OPTIONS Loads a plugin. You can also omit the --plugin= if the plugin begins');\n console.log(' less-plugin. E.g. the clean css plugin is called less-plugin-clean-css');\n console.log(' once installed (npm install less-plugin-clean-css), use either with');\n console.log(' --plugin=less-plugin-clean-css or just --clean-css');\n console.log(' specify options afterwards e.g. --plugin=less-plugin-clean-css=\"advanced\"');\n console.log(' or --clean-css=\"advanced\"');\n console.log(' --disable-plugin-rule Disallow @plugin statements');\n console.log('');\n console.log('-------------------------- Deprecated ----------------');\n console.log(' -sm=on|off Legacy parens-only math. Use --math');\n console.log(' --strict-math=on|off ');\n console.log('');\n console.log(' --line-numbers=TYPE (DEPRECATED) Outputs filename and line numbers.');\n console.log(' TYPE can be either \\'comments\\', \\'mediaquery\\', or \\'all\\'.');\n console.log(' The entire dumpLineNumbers option is deprecated.');\n console.log(' Use sourcemaps (--source-map) instead.');\n console.log(' All modes will be removed in a future version.');\n console.log(' Note: \\'mediaquery\\' and \\'all\\' modes generate @media -sass-debug-info');\n console.log(' which had short-lived usage and is no longer recommended.');\n console.log(' -x, --compress Compresses output by removing some whitespaces.');\n console.log(' We recommend you use a dedicated minifer like less-plugin-clean-css');\n console.log('');\n console.log('Report bugs to: http://github.com/less/less.js/issues');\n console.log('Home page: <http://lesscss.org/>');\n }\n};\n\n// Exports helper functions\n// eslint-disable-next-line no-prototype-builtins\nfor (const h in lessc_helper) { if (lessc_helper.hasOwnProperty(h)) { exports[h] = lessc_helper[h]; }}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "less",
3
- "version": "4.4.2",
3
+ "version": "4.5.1",
4
4
  "description": "Leaner CSS",
5
5
  "homepage": "http://lesscss.org",
6
6
  "author": {
@@ -37,6 +37,7 @@
37
37
  "scripts": {
38
38
  "quicktest": "grunt quicktest",
39
39
  "test": "grunt test",
40
+ "test:coverage": "c8 -r lcov -r json-summary -r text-summary -r html --include=\"lib/**/*.js\" --include=\"bin/**/*.js\" --exclude=\"dist/**\" --exclude=\"**/*.test.js\" --exclude=\"**/*.spec.js\" --exclude=\"test/**\" --exclude=\"tmp/**\" --exclude=\"**/abstract-file-manager.js\" --exclude=\"**/abstract-plugin-loader.js\" grunt shell:test && node scripts/coverage-report.js && node scripts/coverage-lines.js",
40
41
  "grunt": "grunt",
41
42
  "lint": "eslint '**/*.{ts,js}'",
42
43
  "lint:fix": "eslint '**/*.{ts,js}' --fix",
@@ -44,7 +45,8 @@
44
45
  "clean": "shx rm -rf ./lib tsconfig.tsbuildinfo",
45
46
  "compile": "tsc -p tsconfig.build.json",
46
47
  "dev": "tsc -p tsconfig.build.json -w",
47
- "prepublishOnly": "grunt dist"
48
+ "prepublishOnly": "grunt dist",
49
+ "postinstall": "node scripts/postinstall.js"
48
50
  },
49
51
  "optionalDependencies": {
50
52
  "errno": "^0.1.1",
@@ -66,11 +68,14 @@
66
68
  "benny": "^3.6.12",
67
69
  "bootstrap-less-port": "0.3.0",
68
70
  "chai": "^4.2.0",
71
+ "c8": "^10.1.3",
72
+ "chalk": "^4.1.2",
73
+ "cosmiconfig": "~9.0.0",
69
74
  "cross-env": "^7.0.3",
70
- "diff": "^3.2.0",
71
75
  "eslint": "^7.29.0",
72
76
  "fs-extra": "^8.1.0",
73
77
  "git-rev": "^0.2.1",
78
+ "glob": "~11.0.3",
74
79
  "globby": "^10.0.1",
75
80
  "grunt": "^1.0.4",
76
81
  "grunt-cli": "^1.3.2",
@@ -80,17 +85,17 @@
80
85
  "grunt-saucelabs": "^9.0.1",
81
86
  "grunt-shell": "^1.3.0",
82
87
  "html-template-tag": "^3.2.0",
88
+ "jest-diff": "~30.1.2",
83
89
  "jit-grunt": "^0.10.0",
84
90
  "less-plugin-autoprefix": "^1.5.1",
85
91
  "less-plugin-clean-css": "^1.6.0",
86
92
  "minimist": "^1.2.0",
87
93
  "mocha": "^6.2.1",
88
- "playwright": "1.50.1",
89
94
  "mocha-teamcity-reporter": "^3.0.0",
90
- "nock": "^11.8.2",
91
95
  "npm-run-all": "^4.1.5",
92
96
  "performance-now": "^0.2.0",
93
97
  "phin": "^2.2.3",
98
+ "playwright": "1.50.1",
94
99
  "promise": "^7.1.1",
95
100
  "read-glob": "^3.0.0",
96
101
  "resolve": "^1.17.0",
@@ -0,0 +1,207 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Generates a line-by-line coverage report showing uncovered lines
5
+ * Reads from LCOV format and displays in terminal
6
+ * Also outputs JSON file with uncovered lines for programmatic access
7
+ */
8
+
9
+ const fs = require('fs');
10
+ const path = require('path');
11
+
12
+ const lcovPath = path.join(__dirname, '..', 'coverage', 'lcov.info');
13
+ const jsonOutputPath = path.join(__dirname, '..', 'coverage', 'uncovered-lines.json');
14
+
15
+ if (!fs.existsSync(lcovPath)) {
16
+ console.error('LCOV coverage file not found. Run pnpm test:coverage first.');
17
+ process.exit(1);
18
+ }
19
+
20
+ const lcovContent = fs.readFileSync(lcovPath, 'utf8');
21
+
22
+ // Parse LCOV format
23
+ const files = [];
24
+ let currentFile = null;
25
+
26
+ const lines = lcovContent.split('\n');
27
+ for (let i = 0; i < lines.length; i++) {
28
+ const line = lines[i];
29
+
30
+ // SF: source file
31
+ if (line.startsWith('SF:')) {
32
+ if (currentFile) {
33
+ files.push(currentFile);
34
+ }
35
+ const filePath = line.substring(3);
36
+ // Only include src/ files (not less-browser) and bin/
37
+ // Exclude abstract base classes (they're meant to be overridden)
38
+ const normalized = filePath.replace(/\\/g, '/');
39
+ const abstractClasses = ['abstract-file-manager', 'abstract-plugin-loader'];
40
+ const isAbstract = abstractClasses.some(abstract => normalized.includes(abstract));
41
+
42
+ if (!isAbstract &&
43
+ ((normalized.includes('src/less/') && !normalized.includes('src/less-browser/')) ||
44
+ normalized.includes('src/less-node/') ||
45
+ normalized.includes('bin/'))) {
46
+ // Extract relative path - match src/less/... or src/less-node/... or bin/...
47
+ // Path format: src/less/tree/debug-info.js or src/less-node/file-manager.js
48
+ // Match from src/ or bin/ to end of path
49
+ const match = normalized.match(/(src\/[^/]+\/.+|bin\/.+)$/);
50
+ const relativePath = match ? match[1] : (normalized.includes('/src/') || normalized.includes('/bin/') ? normalized.split('/').slice(-3).join('/') : path.basename(filePath));
51
+ currentFile = {
52
+ path: relativePath,
53
+ fullPath: filePath,
54
+ uncoveredLines: [],
55
+ uncoveredLineCode: {}, // line number -> source code
56
+ totalLines: 0,
57
+ coveredLines: 0
58
+ };
59
+ } else {
60
+ currentFile = null;
61
+ }
62
+ }
63
+
64
+ // DA: line data (line number, execution count)
65
+ if (currentFile && line.startsWith('DA:')) {
66
+ const match = line.match(/^DA:(\d+),(\d+)$/);
67
+ if (match) {
68
+ const lineNum = parseInt(match[1], 10);
69
+ const count = parseInt(match[2], 10);
70
+ currentFile.totalLines++;
71
+ if (count > 0) {
72
+ currentFile.coveredLines++;
73
+ } else {
74
+ currentFile.uncoveredLines.push(lineNum);
75
+ }
76
+ }
77
+ }
78
+ }
79
+
80
+ if (currentFile) {
81
+ files.push(currentFile);
82
+ }
83
+
84
+ // Read source code for uncovered lines
85
+ files.forEach(file => {
86
+ if (file.uncoveredLines.length > 0 && fs.existsSync(file.fullPath)) {
87
+ try {
88
+ const sourceCode = fs.readFileSync(file.fullPath, 'utf8');
89
+ const sourceLines = sourceCode.split('\n');
90
+ file.uncoveredLines.forEach(lineNum => {
91
+ // LCOV uses 1-based line numbers
92
+ if (lineNum > 0 && lineNum <= sourceLines.length) {
93
+ file.uncoveredLineCode[lineNum] = sourceLines[lineNum - 1].trim();
94
+ }
95
+ });
96
+ } catch (err) {
97
+ // If we can't read the source (e.g., it's in lib/ but we want src/), that's ok
98
+ // We'll just skip the source code
99
+ }
100
+ }
101
+ });
102
+
103
+ // Filter to only files with uncovered lines and sort by coverage
104
+ const filesWithGaps = files
105
+ .filter(f => f.uncoveredLines.length > 0)
106
+ .sort((a, b) => {
107
+ const aPct = a.totalLines > 0 ? a.coveredLines / a.totalLines : 1;
108
+ const bPct = b.totalLines > 0 ? b.coveredLines / b.totalLines : 1;
109
+ return aPct - bPct;
110
+ });
111
+
112
+ if (filesWithGaps.length === 0) {
113
+ if (files.length === 0) {
114
+ console.log('\n⚠️ No source files found in coverage data. This may indicate an issue with the coverage report.\n');
115
+ } else {
116
+ console.log('\n✅ All analyzed files have 100% line coverage!\n');
117
+ console.log(`(Analyzed ${files.length} files from src/less/, src/less-node/, and bin/)\n`);
118
+ }
119
+ process.exit(0);
120
+ }
121
+
122
+ console.log('\n' + '='.repeat(100));
123
+ console.log('Uncovered Lines Report');
124
+ console.log('='.repeat(100) + '\n');
125
+
126
+ filesWithGaps.forEach(file => {
127
+ const coveragePct = file.totalLines > 0
128
+ ? ((file.coveredLines / file.totalLines) * 100).toFixed(1)
129
+ : '0.0';
130
+
131
+ console.log(`\n${file.path} (${coveragePct}% coverage)`);
132
+ console.log('-'.repeat(100));
133
+
134
+ // Group consecutive lines into ranges
135
+ const ranges = [];
136
+ let start = file.uncoveredLines[0];
137
+ let end = file.uncoveredLines[0];
138
+
139
+ for (let i = 1; i < file.uncoveredLines.length; i++) {
140
+ if (file.uncoveredLines[i] === end + 1) {
141
+ end = file.uncoveredLines[i];
142
+ } else {
143
+ ranges.push(start === end ? `${start}` : `${start}..${end}`);
144
+ start = file.uncoveredLines[i];
145
+ end = file.uncoveredLines[i];
146
+ }
147
+ }
148
+ ranges.push(start === end ? `${start}` : `${start}..${end}`);
149
+
150
+ // Display ranges (max 5 per line for readability)
151
+ const linesPerRow = 5;
152
+ for (let i = 0; i < ranges.length; i += linesPerRow) {
153
+ const row = ranges.slice(i, i + linesPerRow);
154
+ console.log(` Lines: ${row.join(', ')}`);
155
+ }
156
+
157
+ console.log(` Total uncovered: ${file.uncoveredLines.length} of ${file.totalLines} lines`);
158
+ });
159
+
160
+ console.log('\n' + '='.repeat(100) + '\n');
161
+
162
+ // Write JSON output for programmatic access
163
+ const jsonOutput = {
164
+ generated: new Date().toISOString(),
165
+ files: filesWithGaps.map(file => ({
166
+ path: file.path,
167
+ fullPath: file.fullPath,
168
+ sourcePath: (() => {
169
+ // Try to map lib/ path to src/ path
170
+ const normalized = file.fullPath.replace(/\\/g, '/');
171
+ if (normalized.includes('/lib/')) {
172
+ return normalized.replace('/lib/', '/src/').replace(/\.js$/, '.ts');
173
+ }
174
+ return file.fullPath;
175
+ })(),
176
+ coveragePercent: file.totalLines > 0
177
+ ? parseFloat(((file.coveredLines / file.totalLines) * 100).toFixed(1))
178
+ : 0,
179
+ totalLines: file.totalLines,
180
+ coveredLines: file.coveredLines,
181
+ uncoveredLines: file.uncoveredLines,
182
+ uncoveredLineCode: file.uncoveredLineCode || {},
183
+ uncoveredRanges: (() => {
184
+ const ranges = [];
185
+ if (file.uncoveredLines.length === 0) return ranges;
186
+
187
+ let start = file.uncoveredLines[0];
188
+ let end = file.uncoveredLines[0];
189
+
190
+ for (let i = 1; i < file.uncoveredLines.length; i++) {
191
+ if (file.uncoveredLines[i] === end + 1) {
192
+ end = file.uncoveredLines[i];
193
+ } else {
194
+ ranges.push({ start, end });
195
+ start = file.uncoveredLines[i];
196
+ end = file.uncoveredLines[i];
197
+ }
198
+ }
199
+ ranges.push({ start, end });
200
+ return ranges;
201
+ })()
202
+ }))
203
+ };
204
+
205
+ fs.writeFileSync(jsonOutputPath, JSON.stringify(jsonOutput, null, 2), 'utf8');
206
+ console.log('\n📄 Uncovered lines data written to: coverage/uncovered-lines.json\n');
207
+
@@ -0,0 +1,158 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Generates a per-file coverage report table for src/ directories
5
+ */
6
+
7
+ const fs = require('fs');
8
+ const path = require('path');
9
+
10
+ const coverageSummaryPath = path.join(__dirname, '..', 'coverage', 'coverage-summary.json');
11
+
12
+ if (!fs.existsSync(coverageSummaryPath)) {
13
+ console.error('Coverage summary not found. Run pnpm test:coverage first.');
14
+ process.exit(1);
15
+ }
16
+
17
+ const coverage = JSON.parse(fs.readFileSync(coverageSummaryPath, 'utf8'));
18
+
19
+ // Filter to only src/ files (less, less-node) and bin/ files
20
+ // Note: src/less-browser/ is excluded because browser tests aren't included in coverage
21
+ // Abstract base classes are excluded as they're meant to be overridden by implementations
22
+ const abstractClasses = [
23
+ 'abstract-file-manager',
24
+ 'abstract-plugin-loader'
25
+ ];
26
+
27
+ const srcFiles = Object.entries(coverage)
28
+ .filter(([filePath]) => {
29
+ const normalized = filePath.replace(/\\/g, '/');
30
+ // Exclude abstract classes
31
+ if (abstractClasses.some(abstract => normalized.includes(abstract))) {
32
+ return false;
33
+ }
34
+ return (normalized.includes('/src/less/') && !normalized.includes('/src/less-browser/')) ||
35
+ normalized.includes('/src/less-node/') ||
36
+ normalized.includes('/bin/');
37
+ })
38
+ .map(([filePath, data]) => {
39
+ // Extract relative path from absolute path
40
+ const normalized = filePath.replace(/\\/g, '/');
41
+ // Match src/ paths or bin/ paths
42
+ const match = normalized.match(/((?:src\/[^/]+\/[^/]+\/|bin\/).+)$/);
43
+ const relativePath = match ? match[1] : path.basename(filePath);
44
+
45
+ return {
46
+ path: relativePath,
47
+ statements: data.statements,
48
+ branches: data.branches,
49
+ functions: data.functions,
50
+ lines: data.lines
51
+ };
52
+ })
53
+ .sort((a, b) => {
54
+ // Sort by directory first, then by coverage percentage
55
+ const pathCompare = a.path.localeCompare(b.path);
56
+ if (pathCompare !== 0) return pathCompare;
57
+ return a.statements.pct - b.statements.pct;
58
+ });
59
+
60
+ if (srcFiles.length === 0) {
61
+ console.log('No src/ files found in coverage report.');
62
+ process.exit(0);
63
+ }
64
+
65
+ // Group by directory
66
+ const grouped = {
67
+ 'src/less/': [],
68
+ 'src/less-node/': [],
69
+ 'bin/': []
70
+ };
71
+
72
+ srcFiles.forEach(file => {
73
+ if (file.path.startsWith('src/less/')) {
74
+ grouped['src/less/'].push(file);
75
+ } else if (file.path.startsWith('src/less-node/')) {
76
+ grouped['src/less-node/'].push(file);
77
+ } else if (file.path.startsWith('bin/')) {
78
+ grouped['bin/'].push(file);
79
+ }
80
+ });
81
+
82
+ // Print table
83
+ console.log('\n' + '='.repeat(100));
84
+ console.log('Per-File Coverage Report (src/less/, src/less-node/, and bin/)');
85
+ console.log('='.repeat(100));
86
+ console.log('For line-by-line coverage details, open coverage/index.html in your browser.');
87
+ console.log('='.repeat(100) + '\n');
88
+
89
+ Object.entries(grouped).forEach(([dir, files]) => {
90
+ if (files.length === 0) return;
91
+
92
+ console.log(`\n${dir.toUpperCase()}`);
93
+ console.log('-'.repeat(100));
94
+ console.log(
95
+ 'File'.padEnd(50) +
96
+ 'Statements'.padStart(12) +
97
+ 'Branches'.padStart(12) +
98
+ 'Functions'.padStart(12) +
99
+ 'Lines'.padStart(12)
100
+ );
101
+ console.log('-'.repeat(100));
102
+
103
+ files.forEach(file => {
104
+ const filename = file.path.replace(dir, '');
105
+ const truncated = filename.length > 48 ? '...' + filename.slice(-45) : filename;
106
+
107
+ console.log(
108
+ truncated.padEnd(50) +
109
+ `${file.statements.pct.toFixed(1)}%`.padStart(12) +
110
+ `${file.branches.pct.toFixed(1)}%`.padStart(12) +
111
+ `${file.functions.pct.toFixed(1)}%`.padStart(12) +
112
+ `${file.lines.pct.toFixed(1)}%`.padStart(12)
113
+ );
114
+ });
115
+
116
+ // Summary for this directory
117
+ const totals = files.reduce((acc, file) => {
118
+ acc.statements.total += file.statements.total;
119
+ acc.statements.covered += file.statements.covered;
120
+ acc.branches.total += file.branches.total;
121
+ acc.branches.covered += file.branches.covered;
122
+ acc.functions.total += file.functions.total;
123
+ acc.functions.covered += file.functions.covered;
124
+ acc.lines.total += file.lines.total;
125
+ acc.lines.covered += file.lines.covered;
126
+ return acc;
127
+ }, {
128
+ statements: { total: 0, covered: 0 },
129
+ branches: { total: 0, covered: 0 },
130
+ functions: { total: 0, covered: 0 },
131
+ lines: { total: 0, covered: 0 }
132
+ });
133
+
134
+ const stmtPct = totals.statements.total > 0
135
+ ? (totals.statements.covered / totals.statements.total * 100).toFixed(1)
136
+ : '0.0';
137
+ const branchPct = totals.branches.total > 0
138
+ ? (totals.branches.covered / totals.branches.total * 100).toFixed(1)
139
+ : '0.0';
140
+ const funcPct = totals.functions.total > 0
141
+ ? (totals.functions.covered / totals.functions.total * 100).toFixed(1)
142
+ : '0.0';
143
+ const linePct = totals.lines.total > 0
144
+ ? (totals.lines.covered / totals.lines.total * 100).toFixed(1)
145
+ : '0.0';
146
+
147
+ console.log('-'.repeat(100));
148
+ console.log(
149
+ 'TOTAL'.padEnd(50) +
150
+ `${stmtPct}%`.padStart(12) +
151
+ `${branchPct}%`.padStart(12) +
152
+ `${funcPct}%`.padStart(12) +
153
+ `${linePct}%`.padStart(12)
154
+ );
155
+ });
156
+
157
+ console.log('\n' + '='.repeat(100) + '\n');
158
+