less 4.1.2 → 4.2.0
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/.eslintrc.js +63 -0
- package/Gruntfile.js +2 -1
- package/LICENSE +177 -0
- package/bin/lessc +19 -1
- package/dist/less.js +7129 -6951
- package/dist/less.min.js +3 -3
- package/dist/less.min.js.map +1 -1
- package/lib/less/contexts.js +1 -1
- package/lib/less/contexts.js.map +1 -1
- package/lib/less/default-options.js +0 -1
- package/lib/less/default-options.js.map +1 -1
- package/lib/less/environment/abstract-file-manager.js +9 -3
- package/lib/less/environment/abstract-file-manager.js.map +1 -1
- package/lib/less/environment/environment-api.js +0 -25
- package/lib/less/environment/environment-api.js.map +1 -1
- package/lib/less/environment/environment.js +1 -1
- package/lib/less/environment/environment.js.map +1 -1
- package/lib/less/environment/file-manager-api.js +0 -103
- package/lib/less/environment/file-manager-api.js.map +1 -1
- package/lib/less/functions/color-blending.js +1 -0
- package/lib/less/functions/color-blending.js.map +1 -1
- package/lib/less/functions/color.js +19 -19
- package/lib/less/functions/color.js.map +1 -1
- package/lib/less/functions/default.js +2 -1
- package/lib/less/functions/default.js.map +1 -1
- package/lib/less/functions/function-registry.js +1 -0
- package/lib/less/functions/function-registry.js.map +1 -1
- package/lib/less/functions/list.js +2 -2
- package/lib/less/functions/list.js.map +1 -1
- package/lib/less/functions/math-helper.js +1 -1
- package/lib/less/functions/math-helper.js.map +1 -1
- package/lib/less/functions/math.js +1 -0
- package/lib/less/functions/math.js.map +1 -1
- package/lib/less/functions/number.js +4 -3
- package/lib/less/functions/number.js.map +1 -1
- package/lib/less/functions/svg.js +1 -1
- package/lib/less/functions/svg.js.map +1 -1
- package/lib/less/import-manager.js +0 -1
- package/lib/less/import-manager.js.map +1 -1
- package/lib/less/index.js +0 -1
- package/lib/less/index.js.map +1 -1
- package/lib/less/less-error.js +1 -2
- package/lib/less/less-error.js.map +1 -1
- package/lib/less/parse-tree.js +1 -2
- package/lib/less/parse-tree.js.map +1 -1
- package/lib/less/parse.js +1 -2
- package/lib/less/parse.js.map +1 -1
- package/lib/less/parser/chunker.js +0 -1
- package/lib/less/parser/chunker.js.map +1 -1
- package/lib/less/parser/parser-input.js +10 -4
- package/lib/less/parser/parser-input.js.map +1 -1
- package/lib/less/parser/parser.js +128 -94
- package/lib/less/parser/parser.js.map +1 -1
- package/lib/less/render.js +1 -2
- package/lib/less/render.js.map +1 -1
- package/lib/less/source-map-builder.js +0 -1
- package/lib/less/source-map-builder.js.map +1 -1
- package/lib/less/source-map-output.js +1 -1
- package/lib/less/source-map-output.js.map +1 -1
- package/lib/less/transform-tree.js +0 -1
- package/lib/less/transform-tree.js.map +1 -1
- package/lib/less/tree/atrule-syntax.js +10 -0
- package/lib/less/tree/atrule-syntax.js.map +1 -0
- package/lib/less/tree/attribute.js +6 -2
- package/lib/less/tree/attribute.js.map +1 -1
- package/lib/less/tree/call.js +1 -0
- package/lib/less/tree/call.js.map +1 -1
- package/lib/less/tree/color.js +2 -0
- package/lib/less/tree/color.js.map +1 -1
- package/lib/less/tree/container.js +48 -0
- package/lib/less/tree/container.js.map +1 -0
- package/lib/less/tree/debug-info.js +30 -33
- package/lib/less/tree/debug-info.js.map +1 -1
- package/lib/less/tree/dimension.js +4 -2
- package/lib/less/tree/dimension.js.map +1 -1
- package/lib/less/tree/expression.js +0 -2
- package/lib/less/tree/expression.js.map +1 -1
- package/lib/less/tree/extend.js +2 -0
- package/lib/less/tree/extend.js.map +1 -1
- package/lib/less/tree/import.js +1 -1
- package/lib/less/tree/import.js.map +1 -1
- package/lib/less/tree/index.js +4 -0
- package/lib/less/tree/index.js.map +1 -1
- package/lib/less/tree/js-eval-node.js +1 -1
- package/lib/less/tree/js-eval-node.js.map +1 -1
- package/lib/less/tree/media.js +4 -88
- package/lib/less/tree/media.js.map +1 -1
- package/lib/less/tree/namespace-value.js +1 -1
- package/lib/less/tree/namespace-value.js.map +1 -1
- package/lib/less/tree/nested-at-rule.js +91 -0
- package/lib/less/tree/nested-at-rule.js.map +1 -0
- package/lib/less/tree/node.js +6 -4
- package/lib/less/tree/node.js.map +1 -1
- package/lib/less/tree/query-in-parens.js +41 -0
- package/lib/less/tree/query-in-parens.js.map +1 -0
- package/lib/less/tree/quoted.js +1 -1
- package/lib/less/tree/quoted.js.map +1 -1
- package/lib/less/tree/ruleset.js +7 -4
- package/lib/less/tree/ruleset.js.map +1 -1
- package/lib/less/tree/selector.js +5 -3
- package/lib/less/tree/selector.js.map +1 -1
- package/lib/less/tree/unit.js +3 -1
- package/lib/less/tree/unit.js.map +1 -1
- package/lib/less/tree/url.js +1 -1
- package/lib/less/tree/url.js.map +1 -1
- package/lib/less/utils.js +7 -3
- package/lib/less/utils.js.map +1 -1
- package/lib/less/visitors/extend-visitor.js +4 -0
- package/lib/less/visitors/extend-visitor.js.map +1 -1
- package/lib/less/visitors/import-visitor.js +4 -0
- package/lib/less/visitors/import-visitor.js.map +1 -1
- package/lib/less/visitors/join-selector-visitor.js +4 -0
- package/lib/less/visitors/join-selector-visitor.js.map +1 -1
- package/lib/less/visitors/to-css-visitor.js +6 -2
- package/lib/less/visitors/to-css-visitor.js.map +1 -1
- package/lib/less-browser/bootstrap.js +3 -4
- package/lib/less-browser/bootstrap.js.map +1 -1
- package/lib/less-browser/cache.js +1 -1
- package/lib/less-browser/cache.js.map +1 -1
- package/lib/less-browser/error-reporting.js +2 -2
- package/lib/less-browser/error-reporting.js.map +1 -1
- package/lib/less-browser/file-manager.js +1 -2
- package/lib/less-browser/file-manager.js.map +1 -1
- package/lib/less-browser/index.js +6 -2
- package/lib/less-browser/index.js.map +1 -1
- package/lib/less-browser/plugin-loader.js +3 -2
- package/lib/less-browser/plugin-loader.js.map +1 -1
- package/lib/less-browser/utils.js +7 -4
- package/lib/less-browser/utils.js.map +1 -1
- package/lib/less-node/file-manager.js +16 -16
- package/lib/less-node/file-manager.js.map +1 -1
- package/lib/less-node/image-size.js +0 -2
- package/lib/less-node/image-size.js.map +1 -1
- package/lib/less-node/index.js.map +1 -1
- package/lib/less-node/lessc-helper.js +2 -0
- package/lib/less-node/lessc-helper.js.map +1 -1
- package/lib/less-node/url-file-manager.js +5 -0
- package/lib/less-node/url-file-manager.js.map +1 -1
- package/package.json +10 -7
- package/test/browser/generator/benchmark.config.js +19 -19
- package/test/browser/generator/runner.config.js +69 -69
- package/test/browser/runner-rewrite-urls-spec.js +1 -1
- package/test/index.js +5 -1
- package/test/less-test.js +76 -8
- package/test/plugins/filemanager/index.js +1 -1
- package/test/sourcemaps-variable-selector/basic.json +1 -0
- package/test/test-es6.ts +5 -5
- package/tsconfig.build.json +7 -0
- package/tsconfig.json +4 -3
- package/.eslintrc.json +0 -71
|
@@ -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,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,OAAO,YAAQ,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAI,GAAG,eAAQ,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAG,CAAC;IACtE,CAAC;IA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AChB,OAAO,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;QACtE,OAAO,CAAC,GAAG,CAAC,gEAAgE,CAAC,CAAC;QAC9E,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;QAC3C,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,+DAA+D,CAAC,CAAC;QAC7E,OAAO,CAAC,GAAG,CAAC,+EAA+E,CAAC,CAAC;QAC7F,OAAO,CAAC,GAAG,CAAC,2EAA2E,CAAC,CAAC;QACzF,OAAO,CAAC,GAAG,CAAC,2EAA2E,CAAC,CAAC;QACzF,OAAO,CAAC,GAAG,CAAC,0EAA0E,CAAC,CAAC;QACxF,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAClF,OAAO,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,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(' --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('');\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\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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G,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(' --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,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
|
+
/* eslint-disable no-unused-vars */
|
|
5
|
+
/**
|
|
6
|
+
* @todo - remove top eslint rule when FileManagers have JSDoc type
|
|
7
|
+
* and are TS-type-checked
|
|
8
|
+
*/
|
|
4
9
|
var isUrlRe = /^(?:https?:)?\/\//i;
|
|
5
10
|
var url_1 = tslib_1.__importDefault(require("url"));
|
|
6
11
|
var request;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url-file-manager.js","sourceRoot":"","sources":["../../src/less-node/url-file-manager.js"],"names":[],"mappings":";;;AAAA,IAAM,OAAO,GAAG,oBAAoB,CAAC;AACrC,oDAAsB;AACtB,IAAI,OAAO,CAAC;AACZ,kHAA+E;AAC/E,kEAAoC;AAEpC,IAAM,cAAc,GAAG,cAAY,CAAC,CAAA;AACpC,cAAc,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,kCAAmB,EAAE,EAAE;IAChE,QAAQ,YAAC,QAAQ,EAAE,gBAAgB,EAAE,OAAO,EAAE,W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,IAAI,IAAI,CAAC,UAAU,QAAI,CAAC;oBACnG,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,SAAA,EAAE,CAAC,CAAC;oBAClC,OAAO;iBACV;gBACD,IAAI,IAAI,CAAC,UAAU,IAAI,GAAG,EAAE;oBACxB,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAa,MAAM,gCAA6B,EAAE,CAAC,CAAC;oBACpF,OAAO;iBACV;gBACD,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;gBAC7B,IAAI,CAAC,IAAI,EAAE;oBACP,gBAAM,CAAC,IAAI,CAAC,+BAA6B,IAAI,CAAC,UAAU,wBAAkB,MAAM,OAAG,CAAC,CAAC;iBACxF;gBACD,OAAO,CAAC,EAAE,QAAQ,EAAE,IAAI,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;YACxD,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;CACJ,CAAC,CAAC;AAEH,kBAAe,cAAc,CAAC","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"url-file-manager.js","sourceRoot":"","sources":["../../src/less-node/url-file-manager.js"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC;;;GAGG;AACH,IAAM,OAAO,GAAG,oBAAoB,CAAC;AACrC,oDAAsB;AACtB,IAAI,OAAO,CAAC;AACZ,kHAA+E;AAC/E,kEAAoC;AAEpC,IAAM,cAAc,GAAG,cAAY,CAAC,CAAA;AACpC,cAAc,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,kCAAmB,EAAE,EAAE;IAChE,QAAQ,YAAC,QAAQ,EAAE,gBAAgB,EAAE,OAAO,EAAE,WAAW;QACrD,OAAO,OAAO,CAAC,IAAI,CAAE,QAAQ,CAAE,IAAI,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACtE,CAAC;IAED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ClC,OAAO;iBACV;gBACD,IAAI,IAAI,CAAC,UAAU,IAAI,GAAG,EAAE;oBACxB,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAa,MAAM,gCAA6B,EAAE,CAAC,CAAC;oBACpF,OAAO;iBACV;gBACD,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;gBAC7B,IAAI,CAAC,IAAI,EAAE;oBACP,gBAAM,CAAC,IAAI,CAAC,+BAA6B,IAAI,CAAC,UAAU,wBAAkB,MAAM,OAAG,CAAC,CAAC;iBACxF;gBACD,OAAO,CAAC,EAAE,QAAQ,EAAE,IAAI,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;YACxD,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;CACJ,CAAC,CAAC;AAEH,kBAAe,cAAc,CAAC","sourcesContent":["/* eslint-disable no-unused-vars */\n/**\n * @todo - remove top eslint rule when FileManagers have JSDoc type\n * and are TS-type-checked\n */\nconst isUrlRe = /^(?:https?:)?\\/\\//i;\nimport url from 'url';\nlet request;\nimport AbstractFileManager from '../less/environment/abstract-file-manager.js';\nimport logger from '../less/logger';\n\nconst UrlFileManager = function() {}\nUrlFileManager.prototype = Object.assign(new AbstractFileManager(), {\n supports(filename, currentDirectory, options, environment) {\n return isUrlRe.test( filename ) || isUrlRe.test(currentDirectory);\n },\n\n loadFile(filename, currentDirectory, options, environment) {\n return new Promise((fulfill, reject) => {\n if (request === undefined) {\n try { request = require('needle'); }\n catch (e) { request = null; }\n }\n if (!request) {\n reject({ type: 'File', message: 'optional dependency \\'needle\\' required to import over http(s)\\n' });\n return;\n }\n\n let urlStr = isUrlRe.test( filename ) ? filename : url.resolve(currentDirectory, filename);\n\n /** native-request currently has a bug */\n const hackUrlStr = urlStr.indexOf('?') === -1 ? urlStr + '?' : urlStr\n\n request.get(hackUrlStr, { follow_max: 5 }, (err, resp, body) => {\n if (err || resp && resp.statusCode >= 400) {\n const message = resp && resp.statusCode === 404\n ? `resource '${urlStr}' was not found\\n`\n : `resource '${urlStr}' gave this Error:\\n ${err || resp.statusMessage || resp.statusCode}\\n`;\n reject({ type: 'File', message });\n return;\n }\n if (resp.statusCode >= 300) {\n reject({ type: 'File', message: `resource '${urlStr}' caused too many redirects` });\n return;\n }\n body = body.toString('utf8');\n if (!body) {\n logger.warn(`Warning: Empty body (HTTP ${resp.statusCode}) returned by \"${urlStr}\"`);\n }\n fulfill({ contents: body || '', filename: urlStr });\n });\n });\n }\n});\n\nexport default UrlFileManager;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "less",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "Leaner CSS",
|
|
5
5
|
"homepage": "http://lesscss.org",
|
|
6
6
|
"author": {
|
|
@@ -37,11 +37,13 @@
|
|
|
37
37
|
"scripts": {
|
|
38
38
|
"test": "grunt test",
|
|
39
39
|
"grunt": "grunt",
|
|
40
|
+
"lint": "eslint '**/*.{ts,js}'",
|
|
41
|
+
"lint:fix": "eslint '**/*.{ts,js}' --fix",
|
|
40
42
|
"build": "npm-run-all clean compile",
|
|
41
43
|
"clean": "shx rm -rf ./lib tsconfig.tsbuildinfo",
|
|
42
|
-
"compile": "tsc -p tsconfig.json",
|
|
44
|
+
"compile": "tsc -p tsconfig.build.json",
|
|
43
45
|
"copy:root": "shx cp -rf ./dist ../../",
|
|
44
|
-
"dev": "tsc -p tsconfig.json -w",
|
|
46
|
+
"dev": "tsc -p tsconfig.build.json -w",
|
|
45
47
|
"prepublishOnly": "grunt dist"
|
|
46
48
|
},
|
|
47
49
|
"optionalDependencies": {
|
|
@@ -50,11 +52,11 @@
|
|
|
50
52
|
"image-size": "~0.5.0",
|
|
51
53
|
"make-dir": "^2.1.0",
|
|
52
54
|
"mime": "^1.4.1",
|
|
53
|
-
"needle": "^
|
|
55
|
+
"needle": "^3.1.0",
|
|
54
56
|
"source-map": "~0.6.0"
|
|
55
57
|
},
|
|
56
58
|
"devDependencies": {
|
|
57
|
-
"@less/test-data": "^4.
|
|
59
|
+
"@less/test-data": "^4.2.0",
|
|
58
60
|
"@less/test-import-module": "^4.0.0",
|
|
59
61
|
"@rollup/plugin-commonjs": "^17.0.0",
|
|
60
62
|
"@rollup/plugin-json": "^4.1.0",
|
|
@@ -83,7 +85,7 @@
|
|
|
83
85
|
"less-plugin-clean-css": "^1.5.1",
|
|
84
86
|
"minimist": "^1.2.0",
|
|
85
87
|
"mocha": "^6.2.1",
|
|
86
|
-
"mocha-headless-chrome": "^
|
|
88
|
+
"mocha-headless-chrome": "^4.0.0",
|
|
87
89
|
"mocha-teamcity-reporter": "^3.0.0",
|
|
88
90
|
"nock": "^11.8.2",
|
|
89
91
|
"npm-run-all": "^4.1.5",
|
|
@@ -133,5 +135,6 @@
|
|
|
133
135
|
"copy-anything": "^2.0.1",
|
|
134
136
|
"parse-node-version": "^1.0.1",
|
|
135
137
|
"tslib": "^2.3.0"
|
|
136
|
-
}
|
|
138
|
+
},
|
|
139
|
+
"gitHead": "1df9072ee9ebdadc791bf35dfb1dbc3ef9f1948f"
|
|
137
140
|
}
|
|
@@ -3,48 +3,48 @@ module.exports = {
|
|
|
3
3
|
current: {
|
|
4
4
|
// src is used to build list of less files to compile
|
|
5
5
|
src: [
|
|
6
|
-
|
|
6
|
+
'benchmark/benchmark.less'
|
|
7
7
|
],
|
|
8
8
|
options: {
|
|
9
|
-
helpers:
|
|
10
|
-
specs:
|
|
11
|
-
outfile:
|
|
9
|
+
helpers: 'benchmark/browseroptions.js',
|
|
10
|
+
specs: 'benchmark/browserspec.js',
|
|
11
|
+
outfile: 'tmp/browser/test-runner-benchmark-current.html'
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
v3_10_3: {
|
|
15
15
|
// src is used to build list of less files to compile
|
|
16
16
|
src: [
|
|
17
|
-
|
|
17
|
+
'benchmark/benchmark.less'
|
|
18
18
|
],
|
|
19
19
|
options: {
|
|
20
|
-
helpers:
|
|
21
|
-
specs:
|
|
22
|
-
outfile:
|
|
23
|
-
less:
|
|
20
|
+
helpers: 'benchmark/browseroptions.js',
|
|
21
|
+
specs: 'benchmark/browserspec.js',
|
|
22
|
+
outfile: 'tmp/browser/test-runner-benchmark-v3_10_3.html',
|
|
23
|
+
less: 'https://cdnjs.cloudflare.com/ajax/libs/less.js/3.10.3/less.min.js'
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
v3_9_0: {
|
|
27
27
|
// src is used to build list of less files to compile
|
|
28
28
|
src: [
|
|
29
|
-
|
|
29
|
+
'benchmark/benchmark.less'
|
|
30
30
|
],
|
|
31
31
|
options: {
|
|
32
|
-
helpers:
|
|
33
|
-
specs:
|
|
34
|
-
outfile:
|
|
35
|
-
less:
|
|
32
|
+
helpers: 'benchmark/browseroptions.js',
|
|
33
|
+
specs: 'benchmark/browserspec.js',
|
|
34
|
+
outfile: 'tmp/browser/test-runner-benchmark-v3_9_0.html',
|
|
35
|
+
less: 'https://cdnjs.cloudflare.com/ajax/libs/less.js/3.9.0/less.min.js'
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
v2_7_3: {
|
|
39
39
|
// src is used to build list of less files to compile
|
|
40
40
|
src: [
|
|
41
|
-
|
|
41
|
+
'benchmark/benchmark.less'
|
|
42
42
|
],
|
|
43
43
|
options: {
|
|
44
|
-
helpers:
|
|
45
|
-
specs:
|
|
46
|
-
outfile:
|
|
47
|
-
less:
|
|
44
|
+
helpers: 'benchmark/browseroptions.js',
|
|
45
|
+
specs: 'benchmark/browserspec.js',
|
|
46
|
+
outfile: 'tmp/browser/test-runner-benchmark-v2_7_3.html',
|
|
47
|
+
less: 'https://cdnjs.cloudflare.com/ajax/libs/less.js/2.7.3/less.min.js'
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -19,168 +19,168 @@ module.exports = {
|
|
|
19
19
|
`!${lessFolder}/_main/empty.less`
|
|
20
20
|
],
|
|
21
21
|
options: {
|
|
22
|
-
helpers:
|
|
23
|
-
specs:
|
|
24
|
-
outfile:
|
|
22
|
+
helpers: 'test/browser/runner-main-options.js',
|
|
23
|
+
specs: 'test/browser/runner-main-spec.js',
|
|
24
|
+
outfile: 'tmp/browser/test-runner-main.html'
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
legacy: {
|
|
28
28
|
src: [`${lessFolder}/legacy/*.less`],
|
|
29
29
|
options: {
|
|
30
|
-
helpers:
|
|
31
|
-
specs:
|
|
32
|
-
outfile:
|
|
30
|
+
helpers: 'test/browser/runner-legacy-options.js',
|
|
31
|
+
specs: 'test/browser/runner-legacy-spec.js',
|
|
32
|
+
outfile: 'tmp/browser/test-runner-legacy.html'
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
strictUnits: {
|
|
36
36
|
src: [`${lessFolder}/strict-units/*.less`],
|
|
37
37
|
options: {
|
|
38
|
-
helpers:
|
|
39
|
-
specs:
|
|
40
|
-
outfile:
|
|
38
|
+
helpers: 'test/browser/runner-strict-units-options.js',
|
|
39
|
+
specs: 'test/browser/runner-strict-units-spec.js',
|
|
40
|
+
outfile: 'tmp/browser/test-runner-strict-units.html'
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
errors: {
|
|
44
44
|
src: [
|
|
45
45
|
`${lessFolder}/errors/*.less`,
|
|
46
46
|
`${testFolder}/errors/javascript-error.less`,
|
|
47
|
-
|
|
47
|
+
'test/browser/less/errors/*.less'
|
|
48
48
|
],
|
|
49
49
|
options: {
|
|
50
50
|
timeout: 20000,
|
|
51
|
-
helpers:
|
|
52
|
-
specs:
|
|
53
|
-
outfile:
|
|
51
|
+
helpers: 'test/browser/runner-errors-options.js',
|
|
52
|
+
specs: 'test/browser/runner-errors-spec.js',
|
|
53
|
+
outfile: 'tmp/browser/test-runner-errors.html'
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
noJsErrors: {
|
|
57
57
|
src: [`${lessFolder}/no-js-errors/*.less`],
|
|
58
58
|
options: {
|
|
59
|
-
helpers:
|
|
60
|
-
specs:
|
|
61
|
-
outfile:
|
|
59
|
+
helpers: 'test/browser/runner-no-js-errors-options.js',
|
|
60
|
+
specs: 'test/browser/runner-no-js-errors-spec.js',
|
|
61
|
+
outfile: 'tmp/browser/test-runner-no-js-errors.html'
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
browser: {
|
|
65
65
|
src: [
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
'test/browser/less/*.less',
|
|
67
|
+
'test/browser/less/plugin/*.less'
|
|
68
68
|
],
|
|
69
69
|
options: {
|
|
70
|
-
helpers:
|
|
71
|
-
specs:
|
|
72
|
-
outfile:
|
|
70
|
+
helpers: 'test/browser/runner-browser-options.js',
|
|
71
|
+
specs: 'test/browser/runner-browser-spec.js',
|
|
72
|
+
outfile: 'tmp/browser/test-runner-browser.html'
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
relativeUrls: {
|
|
76
|
-
src: [
|
|
76
|
+
src: ['test/browser/less/relative-urls/*.less'],
|
|
77
77
|
options: {
|
|
78
|
-
helpers:
|
|
79
|
-
specs:
|
|
80
|
-
outfile:
|
|
78
|
+
helpers: 'test/browser/runner-relative-urls-options.js',
|
|
79
|
+
specs: 'test/browser/runner-relative-urls-spec.js',
|
|
80
|
+
outfile: 'tmp/browser/test-runner-relative-urls.html'
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
rewriteUrls: {
|
|
84
|
-
src: [
|
|
84
|
+
src: ['test/browser/less/rewrite-urls/*.less'],
|
|
85
85
|
options: {
|
|
86
|
-
helpers:
|
|
87
|
-
specs:
|
|
88
|
-
outfile:
|
|
86
|
+
helpers: 'test/browser/runner-rewrite-urls-options.js',
|
|
87
|
+
specs: 'test/browser/runner-rewrite-urls-spec.js',
|
|
88
|
+
outfile: 'tmp/browser/test-runner-rewrite-urls.html'
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
91
|
rootpath: {
|
|
92
|
-
src: [
|
|
92
|
+
src: ['test/browser/less/rootpath/*.less'],
|
|
93
93
|
options: {
|
|
94
|
-
helpers:
|
|
95
|
-
specs:
|
|
96
|
-
outfile:
|
|
94
|
+
helpers: 'test/browser/runner-rootpath-options.js',
|
|
95
|
+
specs: 'test/browser/runner-rootpath-spec.js',
|
|
96
|
+
outfile: 'tmp/browser/test-runner-rootpath.html'
|
|
97
97
|
}
|
|
98
98
|
},
|
|
99
99
|
rootpathRelative: {
|
|
100
|
-
src: [
|
|
100
|
+
src: ['test/browser/less/rootpath-relative/*.less'],
|
|
101
101
|
options: {
|
|
102
|
-
helpers:
|
|
103
|
-
specs:
|
|
104
|
-
outfile:
|
|
102
|
+
helpers: 'test/browser/runner-rootpath-relative-options.js',
|
|
103
|
+
specs: 'test/browser/runner-rootpath-relative-spec.js',
|
|
104
|
+
outfile: 'tmp/browser/test-runner-rootpath-relative.html'
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
107
|
rootpathRewriteUrls: {
|
|
108
|
-
src: [
|
|
108
|
+
src: ['test/browser/less/rootpath-rewrite-urls/*.less'],
|
|
109
109
|
options: {
|
|
110
110
|
helpers:
|
|
111
|
-
|
|
112
|
-
specs:
|
|
111
|
+
'test/browser/runner-rootpath-rewrite-urls-options.js',
|
|
112
|
+
specs: 'test/browser/runner-rootpath-rewrite-urls-spec.js',
|
|
113
113
|
outfile:
|
|
114
|
-
|
|
114
|
+
'tmp/browser/test-runner-rootpath-rewrite-urls.html'
|
|
115
115
|
}
|
|
116
116
|
},
|
|
117
117
|
production: {
|
|
118
|
-
src: [
|
|
118
|
+
src: ['test/browser/less/production/*.less'],
|
|
119
119
|
options: {
|
|
120
|
-
helpers:
|
|
121
|
-
specs:
|
|
122
|
-
outfile:
|
|
120
|
+
helpers: 'test/browser/runner-production-options.js',
|
|
121
|
+
specs: 'test/browser/runner-production-spec.js',
|
|
122
|
+
outfile: 'tmp/browser/test-runner-production.html'
|
|
123
123
|
}
|
|
124
124
|
},
|
|
125
125
|
modifyVars: {
|
|
126
|
-
src: [
|
|
126
|
+
src: ['test/browser/less/modify-vars/*.less'],
|
|
127
127
|
options: {
|
|
128
|
-
helpers:
|
|
129
|
-
specs:
|
|
130
|
-
outfile:
|
|
128
|
+
helpers: 'test/browser/runner-modify-vars-options.js',
|
|
129
|
+
specs: 'test/browser/runner-modify-vars-spec.js',
|
|
130
|
+
outfile: 'tmp/browser/test-runner-modify-vars.html'
|
|
131
131
|
}
|
|
132
132
|
},
|
|
133
133
|
globalVars: {
|
|
134
|
-
src: [
|
|
134
|
+
src: ['test/browser/less/global-vars/*.less'],
|
|
135
135
|
options: {
|
|
136
|
-
helpers:
|
|
137
|
-
specs:
|
|
138
|
-
outfile:
|
|
136
|
+
helpers: 'test/browser/runner-global-vars-options.js',
|
|
137
|
+
specs: 'test/browser/runner-global-vars-spec.js',
|
|
138
|
+
outfile: 'tmp/browser/test-runner-global-vars.html'
|
|
139
139
|
}
|
|
140
140
|
},
|
|
141
141
|
postProcessorPlugin: {
|
|
142
142
|
src: [`${lessFolder}/postProcessorPlugin/*.less`],
|
|
143
143
|
options: {
|
|
144
144
|
helpers: [
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
'test/plugins/postprocess/index.js',
|
|
146
|
+
'test/browser/runner-postProcessorPlugin-options.js'
|
|
147
147
|
],
|
|
148
|
-
specs:
|
|
148
|
+
specs: 'test/browser/runner-postProcessorPlugin.js',
|
|
149
149
|
outfile:
|
|
150
|
-
|
|
150
|
+
'tmp/browser/test-runner-post-processor-plugin.html'
|
|
151
151
|
}
|
|
152
152
|
},
|
|
153
153
|
preProcessorPlugin: {
|
|
154
154
|
src: [`${lessFolder}/preProcessorPlugin/*.less`],
|
|
155
155
|
options: {
|
|
156
156
|
helpers: [
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
'test/plugins/preprocess/index.js',
|
|
158
|
+
'test/browser/runner-preProcessorPlugin-options.js'
|
|
159
159
|
],
|
|
160
|
-
specs:
|
|
161
|
-
outfile:
|
|
160
|
+
specs: 'test/browser/runner-preProcessorPlugin.js',
|
|
161
|
+
outfile: 'tmp/browser/test-runner-pre-processor-plugin.html'
|
|
162
162
|
}
|
|
163
163
|
},
|
|
164
164
|
visitorPlugin: {
|
|
165
165
|
src: [`${lessFolder}/visitorPlugin/*.less`],
|
|
166
166
|
options: {
|
|
167
167
|
helpers: [
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
'test/plugins/visitor/index.js',
|
|
169
|
+
'test/browser/runner-VisitorPlugin-options.js'
|
|
170
170
|
],
|
|
171
|
-
specs:
|
|
172
|
-
outfile:
|
|
171
|
+
specs: 'test/browser/runner-VisitorPlugin.js',
|
|
172
|
+
outfile: 'tmp/browser/test-runner-visitor-plugin.html'
|
|
173
173
|
}
|
|
174
174
|
},
|
|
175
175
|
filemanagerPlugin: {
|
|
176
176
|
src: [`${lessFolder}/filemanagerPlugin/*.less`],
|
|
177
177
|
options: {
|
|
178
178
|
helpers: [
|
|
179
|
-
|
|
180
|
-
|
|
179
|
+
'test/plugins/filemanager/index.js',
|
|
180
|
+
'test/browser/runner-filemanagerPlugin-options.js'
|
|
181
181
|
],
|
|
182
|
-
specs:
|
|
183
|
-
outfile:
|
|
182
|
+
specs: 'test/browser/runner-filemanagerPlugin.js',
|
|
183
|
+
outfile: 'tmp/browser/test-runner-filemanager-plugin.html'
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
}
|
package/test/index.js
CHANGED
|
@@ -28,7 +28,8 @@ var testMap = [
|
|
|
28
28
|
lessTester.testErrors, null],
|
|
29
29
|
[{strictMath: true, strictUnits: true, javascriptEnabled: true}, '../errors/parse/',
|
|
30
30
|
lessTester.testErrors, null],
|
|
31
|
-
|
|
31
|
+
[{math: 'strict', strictUnits: true, javascriptEnabled: true}, 'js-type-errors/',
|
|
32
|
+
lessTester.testTypeErrors, null],
|
|
32
33
|
[{math: 'strict', strictUnits: true, javascriptEnabled: false}, 'no-js-errors/',
|
|
33
34
|
lessTester.testErrors, null],
|
|
34
35
|
[{math: 'strict', dumpLineNumbers: 'comments'}, 'debug/', null,
|
|
@@ -62,6 +63,8 @@ var testMap = [
|
|
|
62
63
|
'sourcemaps-empty/', lessTester.testEmptySourcemap],
|
|
63
64
|
[{math: 'strict', strictUnits: true, sourceMap: {disableSourcemapAnnotation: true}},
|
|
64
65
|
'sourcemaps-disable-annotation/', lessTester.testSourcemapWithoutUrlAnnotation],
|
|
66
|
+
[{math: 'strict', strictUnits: true, sourceMap: true},
|
|
67
|
+
'sourcemaps-variable-selector/', lessTester.testSourcemapWithVariableInSelector],
|
|
65
68
|
[{globalVars: true, banner: '/**\n * Test\n */\n'}, 'globalVars/',
|
|
66
69
|
null, null, null, function(name, type, baseFolder) { return path.join(baseFolder, name) + '.json'; }],
|
|
67
70
|
[{modifyVars: true}, 'modifyVars/',
|
|
@@ -87,6 +90,7 @@ lessTester.testSyncronous({syncImport: true}, '_main/import');
|
|
|
87
90
|
lessTester.testSyncronous({syncImport: true}, '_main/plugin');
|
|
88
91
|
lessTester.testSyncronous({syncImport: true}, 'math/strict/css');
|
|
89
92
|
lessTester.testNoOptions();
|
|
93
|
+
lessTester.testDisablePluginRule();
|
|
90
94
|
lessTester.testJSImport();
|
|
91
95
|
lessTester.finished();
|
|
92
96
|
|
package/test/less-test.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* jshint latedef: nofunc */
|
|
2
|
-
|
|
2
|
+
var semver = require('semver');
|
|
3
3
|
var logger = require('../lib/less/logger').default;
|
|
4
4
|
|
|
5
5
|
var isVerbose = process.env.npm_config_loglevel !== 'concise';
|
|
@@ -169,6 +169,29 @@ module.exports = function() {
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
+
function testSourcemapWithVariableInSelector(name, err, compiledLess, doReplacements, sourcemap, baseFolder) {
|
|
173
|
+
if (err) {
|
|
174
|
+
fail('ERROR: ' + (err && err.message));
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Even if annotation is not necessary, the map file should be there.
|
|
179
|
+
fs.readFile(path.join('test/', name) + '.json', 'utf8', function (e, expectedSourcemap) {
|
|
180
|
+
process.stdout.write('- ' + path.join(baseFolder, name) + ': ');
|
|
181
|
+
if (sourcemap === expectedSourcemap) {
|
|
182
|
+
ok('OK');
|
|
183
|
+
} else if (err) {
|
|
184
|
+
fail('ERROR: ' + (err && err.message));
|
|
185
|
+
if (isVerbose) {
|
|
186
|
+
process.stdout.write('\n');
|
|
187
|
+
process.stdout.write(err.stack + '\n');
|
|
188
|
+
}
|
|
189
|
+
} else {
|
|
190
|
+
difference('FAIL', expectedSourcemap, sourcemap);
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
|
|
172
195
|
function testImports(name, err, compiledLess, doReplacements, sourcemap, baseFolder, imports) {
|
|
173
196
|
if (err) {
|
|
174
197
|
fail('ERROR: ' + (err && err.message));
|
|
@@ -226,10 +249,35 @@ module.exports = function() {
|
|
|
226
249
|
});
|
|
227
250
|
}
|
|
228
251
|
|
|
252
|
+
// To fix ci fail about error format change in upstream v8 project
|
|
253
|
+
// https://github.com/v8/v8/commit/c0fd89c3c089e888c4f4e8582e56db7066fa779b
|
|
254
|
+
// Node 16.9.0+ include this change via https://github.com/nodejs/node/pull/39947
|
|
255
|
+
function testTypeErrors(name, err, compiledLess, doReplacements, sourcemap, baseFolder) {
|
|
256
|
+
const fileSuffix = semver.gte(process.version, 'v16.9.0') ? '-2.txt' : '.txt';
|
|
257
|
+
fs.readFile(path.join(baseFolder, name) + fileSuffix, 'utf8', function (e, expectedErr) {
|
|
258
|
+
process.stdout.write('- ' + path.join(baseFolder, name) + ': ');
|
|
259
|
+
expectedErr = doReplacements(expectedErr, baseFolder, err && err.filename);
|
|
260
|
+
if (!err) {
|
|
261
|
+
if (compiledLess) {
|
|
262
|
+
fail('No Error', 'red');
|
|
263
|
+
} else {
|
|
264
|
+
fail('No Error, No Output');
|
|
265
|
+
}
|
|
266
|
+
} else {
|
|
267
|
+
var errMessage = err.toString();
|
|
268
|
+
if (errMessage === expectedErr) {
|
|
269
|
+
ok('OK');
|
|
270
|
+
} else {
|
|
271
|
+
difference('FAIL', expectedErr, errMessage);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
|
|
229
277
|
// https://github.com/less/less.js/issues/3112
|
|
230
278
|
function testJSImport() {
|
|
231
279
|
process.stdout.write('- Testing root function registry');
|
|
232
|
-
less.functions.functionRegistry.add('ext', function() {
|
|
280
|
+
less.functions.functionRegistry.add('ext', function() {
|
|
233
281
|
return new less.tree.Anonymous('file');
|
|
234
282
|
});
|
|
235
283
|
var expected = '@charset "utf-8";\n';
|
|
@@ -257,7 +305,7 @@ module.exports = function() {
|
|
|
257
305
|
.replace(/\{pathhref\}/g, '')
|
|
258
306
|
.replace(/\{404status\}/g, '')
|
|
259
307
|
.replace(/\{nodepath\}/g, path.join(process.cwd(), 'node_modules', '/'))
|
|
260
|
-
.replace(/\{pathrel\}/g, path.join(path.relative(lessFolder, p), '/'))
|
|
308
|
+
.replace(/\{pathrel\}/g, path.join(path.relative(lessFolder, p), '/'))
|
|
261
309
|
.replace(/\{pathesc\}/g, pathesc)
|
|
262
310
|
.replace(/\{pathimport\}/g, pathimport)
|
|
263
311
|
.replace(/\{pathimportesc\}/g, pathimportesc)
|
|
@@ -302,7 +350,7 @@ module.exports = function() {
|
|
|
302
350
|
|
|
303
351
|
function runTestSetInternal(baseFolder, opts, foldername, verifyFunction, nameModifier, doReplacements, getFilename) {
|
|
304
352
|
foldername = foldername || '';
|
|
305
|
-
|
|
353
|
+
|
|
306
354
|
var originalOptions = opts || {};
|
|
307
355
|
|
|
308
356
|
if (!doReplacements) {
|
|
@@ -472,10 +520,10 @@ module.exports = function() {
|
|
|
472
520
|
}
|
|
473
521
|
|
|
474
522
|
/**
|
|
475
|
-
*
|
|
476
|
-
* @param {Object} options
|
|
477
|
-
* @param {string} filePath
|
|
478
|
-
* @param {Function} callback
|
|
523
|
+
*
|
|
524
|
+
* @param {Object} options
|
|
525
|
+
* @param {string} filePath
|
|
526
|
+
* @param {Function} callback
|
|
479
527
|
*/
|
|
480
528
|
function toCSS(options, filePath, callback) {
|
|
481
529
|
options = options || {};
|
|
@@ -538,17 +586,37 @@ module.exports = function() {
|
|
|
538
586
|
};
|
|
539
587
|
}
|
|
540
588
|
|
|
589
|
+
function testDisablePluginRule() {
|
|
590
|
+
less.render(
|
|
591
|
+
'@plugin "../../plugin/some_plugin";',
|
|
592
|
+
{disablePluginRule: true},
|
|
593
|
+
function(err) {
|
|
594
|
+
// TODO: Need a better way of identifing exactly which error is thrown. Checking
|
|
595
|
+
// text like this tends to be rather brittle.
|
|
596
|
+
const EXPECTED = '@plugin statements are not allowed when disablePluginRule is set to true';
|
|
597
|
+
if (!err || String(err).indexOf(EXPECTED) < 0) {
|
|
598
|
+
fail('ERROR: Expected "' + EXPECTED + '" error');
|
|
599
|
+
return;
|
|
600
|
+
}
|
|
601
|
+
ok(stylize('OK\n', 'green'));
|
|
602
|
+
}
|
|
603
|
+
);
|
|
604
|
+
}
|
|
605
|
+
|
|
541
606
|
return {
|
|
542
607
|
runTestSet: runTestSet,
|
|
543
608
|
runTestSetNormalOnly: runTestSetNormalOnly,
|
|
544
609
|
testSyncronous: testSyncronous,
|
|
545
610
|
testErrors: testErrors,
|
|
611
|
+
testTypeErrors: testTypeErrors,
|
|
546
612
|
testSourcemap: testSourcemap,
|
|
547
613
|
testSourcemapWithoutUrlAnnotation: testSourcemapWithoutUrlAnnotation,
|
|
614
|
+
testSourcemapWithVariableInSelector: testSourcemapWithVariableInSelector,
|
|
548
615
|
testImports: testImports,
|
|
549
616
|
testImportRedirect: testImportRedirect,
|
|
550
617
|
testEmptySourcemap: testEmptySourcemap,
|
|
551
618
|
testNoOptions: testNoOptions,
|
|
619
|
+
testDisablePluginRule: testDisablePluginRule,
|
|
552
620
|
testJSImport: testJSImport,
|
|
553
621
|
finished: finished
|
|
554
622
|
};
|