less 3.9.0 → 3.10.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.
- package/.DS_Store +0 -0
- package/.eslintignore +4 -1
- package/.eslintrc.json +69 -87
- package/CHANGELOG.md +7 -0
- package/Gruntfile.js +336 -330
- package/bin/lessc +13110 -481
- package/dist/less.cjs.js +12571 -0
- package/dist/less.js +12878 -11507
- package/dist/less.min.js +7 -14
- package/dist/less.min.js.map +1 -0
- package/index.js +1 -1
- package/lib/less/constants.js +12 -12
- package/lib/less/contexts.js +93 -95
- package/lib/less/data/colors.js +1 -1
- package/lib/less/data/index.js +4 -4
- package/lib/less/data/unit-conversions.js +1 -1
- package/lib/less/default-options.js +53 -58
- package/lib/less/environment/abstract-file-manager.js +114 -110
- package/lib/less/environment/abstract-plugin-loader.js +139 -141
- package/lib/less/environment/environment-api.js +1 -1
- package/lib/less/environment/environment.js +44 -41
- package/lib/less/environment/file-manager-api.js +1 -1
- package/lib/less/functions/boolean.js +10 -12
- package/lib/less/functions/color-blending.js +20 -10
- package/lib/less/functions/color.js +63 -49
- package/lib/less/functions/data-uri.js +25 -39
- package/lib/less/functions/default.js +5 -7
- package/lib/less/functions/function-caller.js +42 -39
- package/lib/less/functions/function-registry.js +3 -3
- package/lib/less/functions/index.js +28 -16
- package/lib/less/functions/list.js +34 -28
- package/lib/less/functions/math-helper.js +4 -5
- package/lib/less/functions/math.js +8 -9
- package/lib/less/functions/number.js +26 -18
- package/lib/less/functions/string.js +13 -13
- package/lib/less/functions/svg.js +25 -25
- package/lib/less/functions/types.js +23 -27
- package/lib/less/import-manager.js +140 -138
- package/lib/less/index.js +72 -35
- package/lib/less/less-error.js +29 -30
- package/lib/less/logger.js +4 -4
- package/lib/less/parse-tree.js +53 -47
- package/lib/less/parse.js +23 -25
- package/lib/less/parser/chunker.js +17 -7
- package/lib/less/parser/parser-input.js +100 -93
- package/lib/less/parser/parser.js +310 -170
- package/lib/less/plugin-manager.js +146 -133
- package/lib/less/render.js +10 -13
- package/lib/less/source-map-builder.js +62 -57
- package/lib/less/source-map-output.js +118 -112
- package/lib/less/transform-tree.js +21 -18
- package/lib/less/tree/anonymous.js +35 -27
- package/lib/less/tree/assignment.js +29 -23
- package/lib/less/tree/atrule.js +150 -121
- package/lib/less/tree/attribute.js +32 -25
- package/lib/less/tree/call.js +87 -79
- package/lib/less/tree/color.js +202 -185
- package/lib/less/tree/combinator.js +25 -19
- package/lib/less/tree/comment.js +27 -21
- package/lib/less/tree/condition.js +41 -35
- package/lib/less/tree/debug-info.js +13 -17
- package/lib/less/tree/declaration.js +101 -88
- package/lib/less/tree/detached-ruleset.js +27 -20
- package/lib/less/tree/dimension.js +142 -124
- package/lib/less/tree/element.js +67 -58
- package/lib/less/tree/expression.js +66 -57
- package/lib/less/tree/extend.js +61 -53
- package/lib/less/tree/import.js +144 -141
- package/lib/less/tree/index.js +52 -40
- package/lib/less/tree/javascript.js +29 -25
- package/lib/less/tree/js-eval-node.js +50 -53
- package/lib/less/tree/keyword.js +15 -8
- package/lib/less/tree/media.js +137 -124
- package/lib/less/tree/mixin-call.js +178 -149
- package/lib/less/tree/mixin-definition.js +198 -178
- package/lib/less/tree/namespace-value.js +75 -67
- package/lib/less/tree/negative.js +24 -18
- package/lib/less/tree/node.js +138 -117
- package/lib/less/tree/operation.js +57 -49
- package/lib/less/tree/paren.js +20 -14
- package/lib/less/tree/property.js +65 -58
- package/lib/less/tree/quoted.js +62 -53
- package/lib/less/tree/ruleset.js +739 -680
- package/lib/less/tree/selector.js +129 -114
- package/lib/less/tree/unicode-descriptor.js +10 -6
- package/lib/less/tree/unit.js +117 -97
- package/lib/less/tree/url.js +54 -47
- package/lib/less/tree/value.js +38 -33
- package/lib/less/tree/variable-call.js +41 -34
- package/lib/less/tree/variable.js +58 -51
- package/lib/less/utils.js +110 -108
- package/lib/less/visitors/extend-visitor.js +157 -114
- package/lib/less/visitors/import-sequencer.js +47 -43
- package/lib/less/visitors/import-visitor.js +22 -23
- package/lib/less/visitors/index.js +14 -9
- package/lib/less/visitors/join-selector-visitor.js +32 -26
- package/lib/less/visitors/set-tree-visibility-visitor.js +37 -30
- package/lib/less/visitors/to-css-visitor.js +60 -57
- package/lib/less/visitors/visitor.js +44 -35
- package/lib/less-browser/add-default-options.js +4 -4
- package/lib/less-browser/bootstrap.js +11 -9
- package/lib/less-browser/browser.js +13 -12
- package/lib/less-browser/cache.js +9 -9
- package/lib/less-browser/error-reporting.js +27 -27
- package/lib/less-browser/file-manager.js +37 -35
- package/lib/less-browser/image-size.js +3 -3
- package/lib/less-browser/index.js +78 -73
- package/lib/less-browser/log-listener.js +6 -7
- package/lib/less-browser/plugin-loader.js +15 -13
- package/lib/less-browser/utils.js +20 -20
- package/lib/less-node/environment.js +4 -2
- package/lib/less-node/file-manager.js +128 -127
- package/lib/less-node/fs.js +2 -2
- package/lib/less-node/image-size.js +19 -18
- package/lib/less-node/index.js +16 -12
- package/lib/less-node/lessc-helper.js +4 -5
- package/lib/less-node/plugin-loader.js +41 -40
- package/lib/less-node/url-file-manager.js +41 -48
- package/lib/lessc.js +557 -0
- package/package.json +21 -11
- package/test/.DS_Store +0 -0
- package/test/browser/common.js +34 -30
- package/test/browser/css/urls.css +0 -3
- package/test/browser/less/plugin/plugin.js +4 -7
- package/test/browser/less/urls.less +0 -3
- package/test/browser/less.min.js +11 -0
- package/test/browser/less.min.js.map +1 -0
- package/test/browser/onload.js +13 -0
- package/test/browser/runner-browser-options.js +0 -5
- package/test/browser/test-runner-template.tmpl +39 -52
- package/test/browser/vendor/boot.js +148 -0
- package/test/browser/{jasmine-jsreporter.js → vendor/jasmine-jsreporter.js} +0 -0
- package/test/copy-bom.js +2 -1
- package/test/css/.DS_Store +0 -0
- package/test/css/functions-each.css +10 -0
- package/test/css/math/.DS_Store +0 -0
- package/test/css/namespacing/namespacing-1.css +4 -0
- package/test/css/urls.css +0 -1
- package/test/index.js +2 -5
- package/test/less/.DS_Store +0 -0
- package/test/less/colors.less +1 -1
- package/test/less/errors/color-func-invalid-color-2.less +2 -0
- package/test/less/errors/color-func-invalid-color-2.txt +3 -0
- package/test/less/functions-each.less +32 -0
- package/test/less/math/.DS_Store +0 -0
- package/test/less/namespacing/namespacing-1.less +10 -0
- package/test/less/urls.less +0 -1
- package/test/less-test.js +20 -11
- package/test/modify-vars.js +11 -2
- package/.travis.yml +0 -33
- package/appveyor.yml +0 -32
- package/browser.js +0 -1
- package/test/browser/less.js +0 -12956
- package/test/less-bom/3rd-party/bootstrap4.less +0 -1
- package/test/less-bom/3rd-party/uikit.less +0 -1
- package/test/less-bom/calc.less +0 -30
- package/test/less-bom/charsets.less +0 -3
- package/test/less-bom/colors.less +0 -116
- package/test/less-bom/comments.less +0 -102
- package/test/less-bom/comments2.less +0 -31
- package/test/less-bom/compression/compression.less +0 -36
- package/test/less-bom/css-3.less +0 -153
- package/test/less-bom/css-escapes.less +0 -42
- package/test/less-bom/css-grid.less +0 -30
- package/test/less-bom/css-guards.less +0 -103
- package/test/less-bom/debug/import/test.less +0 -25
- package/test/less-bom/debug/linenumbers.less +0 -33
- package/test/less-bom/detached-rulesets.less +0 -112
- package/test/less-bom/directives-bubling.less +0 -142
- package/test/less-bom/empty.less +0 -1
- package/test/less-bom/errors/add-mixed-units.less +0 -3
- package/test/less-bom/errors/add-mixed-units.txt +0 -4
- package/test/less-bom/errors/add-mixed-units2.less +0 -3
- package/test/less-bom/errors/add-mixed-units2.txt +0 -4
- package/test/less-bom/errors/at-rules-undefined-var.less +0 -4
- package/test/less-bom/errors/at-rules-undefined-var.txt +0 -4
- package/test/less-bom/errors/at-rules-unmatching-block.less +0 -4
- package/test/less-bom/errors/at-rules-unmatching-block.txt +0 -3
- package/test/less-bom/errors/bad-variable-declaration1.less +0 -1
- package/test/less-bom/errors/bad-variable-declaration1.txt +0 -2
- package/test/less-bom/errors/color-func-invalid-color.less +0 -3
- package/test/less-bom/errors/color-func-invalid-color.txt +0 -4
- package/test/less-bom/errors/css-guard-default-func.less +0 -4
- package/test/less-bom/errors/css-guard-default-func.txt +0 -4
- package/test/less-bom/errors/custom-property-unmatched-block-1.less +0 -6
- package/test/less-bom/errors/custom-property-unmatched-block-1.txt +0 -4
- package/test/less-bom/errors/custom-property-unmatched-block-2.less +0 -6
- package/test/less-bom/errors/custom-property-unmatched-block-2.txt +0 -4
- package/test/less-bom/errors/custom-property-unmatched-block-3.less +0 -6
- package/test/less-bom/errors/custom-property-unmatched-block-3.txt +0 -4
- package/test/less-bom/errors/detached-ruleset-1.less +0 -6
- package/test/less-bom/errors/detached-ruleset-1.txt +0 -4
- package/test/less-bom/errors/detached-ruleset-2.less +0 -6
- package/test/less-bom/errors/detached-ruleset-2.txt +0 -4
- package/test/less-bom/errors/detached-ruleset-3.less +0 -4
- package/test/less-bom/errors/detached-ruleset-3.txt +0 -4
- package/test/less-bom/errors/detached-ruleset-5.less +0 -4
- package/test/less-bom/errors/detached-ruleset-5.txt +0 -3
- package/test/less-bom/errors/detached-ruleset-6.less +0 -5
- package/test/less-bom/errors/detached-ruleset-6.txt +0 -4
- package/test/less-bom/errors/divide-mixed-units.less +0 -3
- package/test/less-bom/errors/divide-mixed-units.txt +0 -4
- package/test/less-bom/errors/extend-no-selector.less +0 -3
- package/test/less-bom/errors/extend-no-selector.txt +0 -3
- package/test/less-bom/errors/extend-not-at-end.less +0 -3
- package/test/less-bom/errors/extend-not-at-end.txt +0 -3
- package/test/less-bom/errors/functions-1.less +0 -2
- package/test/less-bom/errors/functions-1.txt +0 -3
- package/test/less-bom/errors/functions-10-keyword.less +0 -2
- package/test/less-bom/errors/functions-10-keyword.txt +0 -3
- package/test/less-bom/errors/functions-11-operation.less +0 -2
- package/test/less-bom/errors/functions-11-operation.txt +0 -3
- package/test/less-bom/errors/functions-12-quoted.less +0 -2
- package/test/less-bom/errors/functions-12-quoted.txt +0 -3
- package/test/less-bom/errors/functions-13-selector.less +0 -2
- package/test/less-bom/errors/functions-13-selector.txt +0 -3
- package/test/less-bom/errors/functions-14-url.less +0 -2
- package/test/less-bom/errors/functions-14-url.txt +0 -3
- package/test/less-bom/errors/functions-15-value.less +0 -2
- package/test/less-bom/errors/functions-15-value.txt +0 -3
- package/test/less-bom/errors/functions-3-assignment.less +0 -2
- package/test/less-bom/errors/functions-3-assignment.txt +0 -3
- package/test/less-bom/errors/functions-4-call.less +0 -2
- package/test/less-bom/errors/functions-4-call.txt +0 -3
- package/test/less-bom/errors/functions-5-color-2.less +0 -1
- package/test/less-bom/errors/functions-5-color-2.txt +0 -2
- package/test/less-bom/errors/functions-5-color.less +0 -2
- package/test/less-bom/errors/functions-5-color.txt +0 -3
- package/test/less-bom/errors/functions-6-condition.less +0 -2
- package/test/less-bom/errors/functions-6-condition.txt +0 -3
- package/test/less-bom/errors/functions-7-dimension.less +0 -2
- package/test/less-bom/errors/functions-7-dimension.txt +0 -3
- package/test/less-bom/errors/functions-8-element.less +0 -2
- package/test/less-bom/errors/functions-8-element.txt +0 -3
- package/test/less-bom/errors/functions-9-expression.less +0 -2
- package/test/less-bom/errors/functions-9-expression.txt +0 -3
- package/test/less-bom/errors/import-malformed.less +0 -1
- package/test/less-bom/errors/import-malformed.txt +0 -3
- package/test/less-bom/errors/import-missing.less +0 -6
- package/test/less-bom/errors/import-missing.txt +0 -3
- package/test/less-bom/errors/import-no-semi.less +0 -1
- package/test/less-bom/errors/import-no-semi.txt +0 -2
- package/test/less-bom/errors/import-subfolder1.less +0 -1
- package/test/less-bom/errors/import-subfolder1.txt +0 -3
- package/test/less-bom/errors/import-subfolder2.less +0 -1
- package/test/less-bom/errors/import-subfolder2.txt +0 -4
- package/test/less-bom/errors/imports/import-subfolder1.less +0 -1
- package/test/less-bom/errors/imports/import-subfolder2.less +0 -1
- package/test/less-bom/errors/imports/import-test.less +0 -4
- package/test/less-bom/errors/imports/subfolder/mixin-not-defined.less +0 -1
- package/test/less-bom/errors/imports/subfolder/parse-error-curly-bracket.less +0 -1
- package/test/less-bom/errors/javascript-error.less +0 -3
- package/test/less-bom/errors/javascript-error.txt +0 -4
- package/test/less-bom/errors/javascript-undefined-var.less +0 -3
- package/test/less-bom/errors/javascript-undefined-var.txt +0 -4
- package/test/less-bom/errors/mixed-mixin-definition-args-1.less +0 -6
- package/test/less-bom/errors/mixed-mixin-definition-args-1.txt +0 -4
- package/test/less-bom/errors/mixed-mixin-definition-args-2.less +0 -6
- package/test/less-bom/errors/mixed-mixin-definition-args-2.txt +0 -4
- package/test/less-bom/errors/mixin-not-defined-2.less +0 -7
- package/test/less-bom/errors/mixin-not-defined-2.txt +0 -4
- package/test/less-bom/errors/mixin-not-defined.less +0 -11
- package/test/less-bom/errors/mixin-not-defined.txt +0 -3
- package/test/less-bom/errors/mixin-not-matched.less +0 -6
- package/test/less-bom/errors/mixin-not-matched.txt +0 -3
- package/test/less-bom/errors/mixin-not-matched2.less +0 -6
- package/test/less-bom/errors/mixin-not-matched2.txt +0 -3
- package/test/less-bom/errors/mixin-not-visible-in-scope-1.less +0 -9
- package/test/less-bom/errors/mixin-not-visible-in-scope-1.txt +0 -4
- package/test/less-bom/errors/mixins-guards-cond-expected.less +0 -5
- package/test/less-bom/errors/mixins-guards-cond-expected.txt +0 -3
- package/test/less-bom/errors/mixins-guards-default-func-1.less +0 -9
- package/test/less-bom/errors/mixins-guards-default-func-1.txt +0 -4
- package/test/less-bom/errors/mixins-guards-default-func-2.less +0 -9
- package/test/less-bom/errors/mixins-guards-default-func-2.txt +0 -4
- package/test/less-bom/errors/mixins-guards-default-func-3.less +0 -9
- package/test/less-bom/errors/mixins-guards-default-func-3.txt +0 -4
- package/test/less-bom/errors/multiple-guards-on-css-selectors.less +0 -4
- package/test/less-bom/errors/multiple-guards-on-css-selectors.txt +0 -4
- package/test/less-bom/errors/multiple-guards-on-css-selectors2.less +0 -4
- package/test/less-bom/errors/multiple-guards-on-css-selectors2.txt +0 -4
- package/test/less-bom/errors/multiply-mixed-units.less +0 -7
- package/test/less-bom/errors/multiply-mixed-units.txt +0 -4
- package/test/less-bom/errors/namespacing-2.less +0 -7
- package/test/less-bom/errors/namespacing-2.txt +0 -4
- package/test/less-bom/errors/namespacing-3.less +0 -8
- package/test/less-bom/errors/namespacing-3.txt +0 -4
- package/test/less-bom/errors/namespacing-4.less +0 -7
- package/test/less-bom/errors/namespacing-4.txt +0 -4
- package/test/less-bom/errors/parens-error-1.less +0 -3
- package/test/less-bom/errors/parens-error-1.txt +0 -4
- package/test/less-bom/errors/parens-error-2.less +0 -3
- package/test/less-bom/errors/parens-error-2.txt +0 -4
- package/test/less-bom/errors/parens-error-3.less +0 -3
- package/test/less-bom/errors/parens-error-3.txt +0 -4
- package/test/less-bom/errors/parse-error-curly-bracket.less +0 -4
- package/test/less-bom/errors/parse-error-curly-bracket.txt +0 -4
- package/test/less-bom/errors/parse-error-media-no-block-1.less +0 -5
- package/test/less-bom/errors/parse-error-media-no-block-1.txt +0 -3
- package/test/less-bom/errors/parse-error-media-no-block-2.less +0 -1
- package/test/less-bom/errors/parse-error-media-no-block-2.txt +0 -2
- package/test/less-bom/errors/parse-error-media-no-block-3.less +0 -4
- package/test/less-bom/errors/parse-error-media-no-block-3.txt +0 -3
- package/test/less-bom/errors/parse-error-missing-bracket.less +0 -2
- package/test/less-bom/errors/parse-error-missing-bracket.txt +0 -3
- package/test/less-bom/errors/parse-error-missing-parens.less +0 -5
- package/test/less-bom/errors/parse-error-missing-parens.txt +0 -3
- package/test/less-bom/errors/parse-error-with-import.less +0 -13
- package/test/less-bom/errors/parse-error-with-import.txt +0 -4
- package/test/less-bom/errors/percentage-missing-space.less +0 -3
- package/test/less-bom/errors/percentage-missing-space.txt +0 -4
- package/test/less-bom/errors/percentage-non-number-argument.less +0 -3
- package/test/less-bom/errors/percentage-non-number-argument.txt +0 -4
- package/test/less-bom/errors/plugin/plugin-error-2.js +0 -5
- package/test/less-bom/errors/plugin/plugin-error-3.js +0 -5
- package/test/less-bom/errors/plugin/plugin-error.js +0 -1
- package/test/less-bom/errors/plugin-1.less +0 -1
- package/test/less-bom/errors/plugin-1.txt +0 -2
- package/test/less-bom/errors/plugin-2.less +0 -1
- package/test/less-bom/errors/plugin-2.txt +0 -5
- package/test/less-bom/errors/plugin-3.less +0 -1
- package/test/less-bom/errors/plugin-3.txt +0 -5
- package/test/less-bom/errors/property-asterisk-only-name.less +0 -3
- package/test/less-bom/errors/property-asterisk-only-name.txt +0 -4
- package/test/less-bom/errors/property-ie5-hack.less +0 -3
- package/test/less-bom/errors/property-ie5-hack.txt +0 -3
- package/test/less-bom/errors/property-in-root.less +0 -4
- package/test/less-bom/errors/property-in-root.txt +0 -4
- package/test/less-bom/errors/property-in-root2.less +0 -1
- package/test/less-bom/errors/property-in-root2.txt +0 -4
- package/test/less-bom/errors/property-in-root3.less +0 -4
- package/test/less-bom/errors/property-in-root3.txt +0 -3
- package/test/less-bom/errors/property-interp-not-defined.less +0 -1
- package/test/less-bom/errors/property-interp-not-defined.txt +0 -2
- package/test/less-bom/errors/recursive-variable.less +0 -1
- package/test/less-bom/errors/recursive-variable.txt +0 -2
- package/test/less-bom/errors/root-func-undefined-1.less +0 -1
- package/test/less-bom/errors/root-func-undefined-1.txt +0 -2
- package/test/less-bom/errors/root-func-undefined-2.less +0 -2
- package/test/less-bom/errors/root-func-undefined-2.txt +0 -3
- package/test/less-bom/errors/single-character.less +0 -1
- package/test/less-bom/errors/single-character.txt +0 -2
- package/test/less-bom/errors/svg-gradient1.less +0 -3
- package/test/less-bom/errors/svg-gradient1.txt +0 -4
- package/test/less-bom/errors/svg-gradient2.less +0 -3
- package/test/less-bom/errors/svg-gradient2.txt +0 -4
- package/test/less-bom/errors/svg-gradient3.less +0 -3
- package/test/less-bom/errors/svg-gradient3.txt +0 -4
- package/test/less-bom/errors/svg-gradient4.less +0 -4
- package/test/less-bom/errors/svg-gradient4.txt +0 -4
- package/test/less-bom/errors/svg-gradient5.less +0 -4
- package/test/less-bom/errors/svg-gradient5.txt +0 -4
- package/test/less-bom/errors/svg-gradient6.less +0 -4
- package/test/less-bom/errors/svg-gradient6.txt +0 -4
- package/test/less-bom/errors/unit-function.less +0 -3
- package/test/less-bom/errors/unit-function.txt +0 -4
- package/test/less-bom/extend-chaining.less +0 -91
- package/test/less-bom/extend-clearfix.less +0 -19
- package/test/less-bom/extend-exact.less +0 -46
- package/test/less-bom/extend-media.less +0 -24
- package/test/less-bom/extend-nest.less +0 -65
- package/test/less-bom/extend-selector.less +0 -110
- package/test/less-bom/extend.less +0 -81
- package/test/less-bom/extract-and-length.less +0 -146
- package/test/less-bom/filemanagerPlugin/colors.test +0 -1
- package/test/less-bom/filemanagerPlugin/filemanager.less +0 -4
- package/test/less-bom/functions-each.less +0 -131
- package/test/less-bom/functions.less +0 -279
- package/test/less-bom/globalVars/extended.json +0 -5
- package/test/less-bom/globalVars/extended.less +0 -10
- package/test/less-bom/globalVars/simple.json +0 -3
- package/test/less-bom/globalVars/simple.less +0 -3
- package/test/less-bom/ie-filters.less +0 -15
- package/test/less-bom/import/css-import.less +0 -1
- package/test/less-bom/import/deeper/deeper-2/url-import-2.less +0 -3
- package/test/less-bom/import/deeper/deeper-2/url-import.less +0 -1
- package/test/less-bom/import/deeper/import-once-test-a.less +0 -1
- package/test/less-bom/import/deeper/url-import.less +0 -1
- package/test/less-bom/import/import-and-relative-paths-test.less +0 -17
- package/test/less-bom/import/import-charset-test.less +0 -1
- package/test/less-bom/import/import-inline-invalid-css.less +0 -1
- package/test/less-bom/import/import-interpolation.less +0 -2
- package/test/less-bom/import/import-interpolation2.less +0 -5
- package/test/less-bom/import/import-once-test-c.less +0 -6
- package/test/less-bom/import/import-reference.less +0 -98
- package/test/less-bom/import/import-test-a.less +0 -5
- package/test/less-bom/import/import-test-b.less +0 -8
- package/test/less-bom/import/import-test-c.less +0 -6
- package/test/less-bom/import/import-test-d.css +0 -1
- package/test/less-bom/import/import-test-e.less +0 -2
- package/test/less-bom/import/import-test-f.less +0 -5
- package/test/less-bom/import/imports/font.less +0 -8
- package/test/less-bom/import/imports/logo.less +0 -6
- package/test/less-bom/import/interpolation-vars.less +0 -6
- package/test/less-bom/import/invalid-css.less +0 -1
- package/test/less-bom/import/urls.less +0 -1
- package/test/less-bom/import-inline.less +0 -3
- package/test/less-bom/import-interpolation.less +0 -8
- package/test/less-bom/import-module.less +0 -3
- package/test/less-bom/import-once.less +0 -6
- package/test/less-bom/import-reference-issues/appender-reference-1968.less +0 -6
- package/test/less-bom/import-reference-issues/global-scope-import.less +0 -13
- package/test/less-bom/import-reference-issues/global-scope-nested.less +0 -3
- package/test/less-bom/import-reference-issues/mixin-1968.less +0 -8
- package/test/less-bom/import-reference-issues/multiple-import-nested.less +0 -12
- package/test/less-bom/import-reference-issues/multiple-import.less +0 -10
- package/test/less-bom/import-reference-issues/simple-mixin.css +0 -3
- package/test/less-bom/import-reference-issues/simple-ruleset-2162.less +0 -3
- package/test/less-bom/import-reference-issues.less +0 -50
- package/test/less-bom/import-reference.less +0 -26
- package/test/less-bom/import.less +0 -29
- package/test/less-bom/include-path/include-path.less +0 -8
- package/test/less-bom/include-path-string/include-path-string.less +0 -3
- package/test/less-bom/javascript.less +0 -39
- package/test/less-bom/lazy-eval.less +0 -6
- package/test/less-bom/legacy/legacy.less +0 -21
- package/test/less-bom/math/parens-division/media-math.less +0 -9
- package/test/less-bom/math/parens-division/mixins-args.less +0 -264
- package/test/less-bom/math/parens-division/new-division.less +0 -17
- package/test/less-bom/math/parens-division/parens.less +0 -46
- package/test/less-bom/math/strict/css.less +0 -108
- package/test/less-bom/math/strict/media-math.less +0 -9
- package/test/less-bom/math/strict/mixins-args.less +0 -264
- package/test/less-bom/math/strict/parens.less +0 -46
- package/test/less-bom/math/strict-legacy/css.less +0 -108
- package/test/less-bom/math/strict-legacy/media-math.less +0 -9
- package/test/less-bom/math/strict-legacy/mixins-args.less +0 -263
- package/test/less-bom/math/strict-legacy/parens.less +0 -50
- package/test/less-bom/media.less +0 -241
- package/test/less-bom/merge.less +0 -81
- package/test/less-bom/mixins-closure.less +0 -26
- package/test/less-bom/mixins-guards-default-func.less +0 -195
- package/test/less-bom/mixins-guards.less +0 -358
- package/test/less-bom/mixins-important.less +0 -53
- package/test/less-bom/mixins-interpolated.less +0 -75
- package/test/less-bom/mixins-named-args.less +0 -36
- package/test/less-bom/mixins-nested.less +0 -22
- package/test/less-bom/mixins-pattern.less +0 -102
- package/test/less-bom/mixins.less +0 -145
- package/test/less-bom/modifyVars/extended.json +0 -5
- package/test/less-bom/modifyVars/extended.less +0 -11
- package/test/less-bom/namespacing/imports/a-better-bootstrap.less +0 -13
- package/test/less-bom/namespacing/imports/library.less +0 -14
- package/test/less-bom/namespacing/namespacing-1.less +0 -42
- package/test/less-bom/namespacing/namespacing-2.less +0 -27
- package/test/less-bom/namespacing/namespacing-3.less +0 -28
- package/test/less-bom/namespacing/namespacing-4.less +0 -33
- package/test/less-bom/namespacing/namespacing-5.less +0 -32
- package/test/less-bom/namespacing/namespacing-6.less +0 -26
- package/test/less-bom/namespacing/namespacing-7.less +0 -48
- package/test/less-bom/namespacing/namespacing-functions.less +0 -11
- package/test/less-bom/namespacing/namespacing-media.less +0 -26
- package/test/less-bom/namespacing/namespacing-operations.less +0 -15
- package/test/less-bom/nested-gradient-with-svg-gradient/mixin-consumer.less +0 -5
- package/test/less-bom/nested-gradient-with-svg-gradient/svg-gradient-mixin.less +0 -15
- package/test/less-bom/no-js-errors/no-js-errors.less +0 -3
- package/test/less-bom/no-js-errors/no-js-errors.txt +0 -4
- package/test/less-bom/no-output.less +0 -2
- package/test/less-bom/no-strict-math/mixins-guards.less +0 -25
- package/test/less-bom/no-strict-math/no-sm-operations.less +0 -16
- package/test/less-bom/operations.less +0 -63
- package/test/less-bom/parse-interpolation.less +0 -53
- package/test/less-bom/permissive-parse.less +0 -50
- package/test/less-bom/plugin/plugin-collection.js +0 -9
- package/test/less-bom/plugin/plugin-global.js +0 -9
- package/test/less-bom/plugin/plugin-local.js +0 -14
- package/test/less-bom/plugin/plugin-preeval.js +0 -27
- package/test/less-bom/plugin/plugin-scope1.js +0 -3
- package/test/less-bom/plugin/plugin-scope2.js +0 -3
- package/test/less-bom/plugin/plugin-set-options-v2.js +0 -33
- package/test/less-bom/plugin/plugin-set-options-v3.js +0 -31
- package/test/less-bom/plugin/plugin-set-options.js +0 -32
- package/test/less-bom/plugin/plugin-simple.js +0 -7
- package/test/less-bom/plugin/plugin-transitive.js +0 -6
- package/test/less-bom/plugin/plugin-transitive.less +0 -5
- package/test/less-bom/plugin/plugin-tree-nodes.js +0 -82
- package/test/less-bom/plugin-module.less +0 -7
- package/test/less-bom/plugin-preeval.less +0 -15
- package/test/less-bom/plugin.less +0 -142
- package/test/less-bom/postProcessorPlugin/postProcessor.less +0 -4
- package/test/less-bom/preProcessorPlugin/preProcessor.less +0 -3
- package/test/less-bom/property-accessors.less +0 -67
- package/test/less-bom/property-name-interp.less +0 -56
- package/test/less-bom/rewrite-urls-all/folder/file.less +0 -8
- package/test/less-bom/rewrite-urls-all/rewrite-urls-all.less +0 -11
- package/test/less-bom/rewrite-urls-local/folder/file.less +0 -8
- package/test/less-bom/rewrite-urls-local/rewrite-urls-local.less +0 -11
- package/test/less-bom/root-registry/file.less +0 -1
- package/test/less-bom/root-registry/root.less +0 -3
- package/test/less-bom/rootpath-rewrite-urls-all/folder/file.less +0 -8
- package/test/less-bom/rootpath-rewrite-urls-all/rootpath-rewrite-urls-all.less +0 -11
- package/test/less-bom/rootpath-rewrite-urls-local/folder/file.less +0 -8
- package/test/less-bom/rootpath-rewrite-urls-local/rootpath-rewrite-urls-local.less +0 -11
- package/test/less-bom/rulesets.less +0 -30
- package/test/less-bom/scope.less +0 -104
- package/test/less-bom/selectors.less +0 -184
- package/test/less-bom/sourcemaps/basic.json +0 -3
- package/test/less-bom/sourcemaps/basic.less +0 -27
- package/test/less-bom/sourcemaps/custom-props.less +0 -8
- package/test/less-bom/sourcemaps/imported.css +0 -7
- package/test/less-bom/sourcemaps-empty/empty.less +0 -1
- package/test/less-bom/sourcemaps-empty/var-defs.less +0 -1
- package/test/less-bom/static-urls/urls.less +0 -33
- package/test/less-bom/strict-units/strict-units.less +0 -4
- package/test/less-bom/strings.less +0 -73
- package/test/less-bom/url-args/urls.less +0 -63
- package/test/less-bom/urls.less +0 -94
- package/test/less-bom/variables-in-at-rules.less +0 -20
- package/test/less-bom/variables.less +0 -127
- package/test/less-bom/visitorPlugin/visitor.less +0 -4
- package/test/less-bom/whitespace.less +0 -44
package/Gruntfile.js
CHANGED
|
@@ -1,111 +1,125 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
module.exports = function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
grunt.option('stack', true)
|
|
3
|
+
module.exports = function(grunt) {
|
|
4
|
+
grunt.option("stack", true);
|
|
7
5
|
|
|
8
6
|
// Report the elapsed execution time of tasks.
|
|
9
|
-
require(
|
|
7
|
+
require("time-grunt")(grunt);
|
|
10
8
|
|
|
11
9
|
var COMPRESS_FOR_TESTS = false;
|
|
12
|
-
var git = require(
|
|
10
|
+
var git = require("git-rev");
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
// Sauce Labs browser
|
|
15
13
|
var browsers = [
|
|
16
14
|
// Desktop browsers
|
|
17
15
|
{
|
|
18
|
-
browserName:
|
|
19
|
-
version:
|
|
20
|
-
platform:
|
|
16
|
+
browserName: "chrome",
|
|
17
|
+
version: "latest",
|
|
18
|
+
platform: "Windows 7"
|
|
21
19
|
},
|
|
22
20
|
{
|
|
23
|
-
browserName:
|
|
24
|
-
version:
|
|
25
|
-
platform:
|
|
21
|
+
browserName: "firefox",
|
|
22
|
+
version: "latest",
|
|
23
|
+
platform: "Linux"
|
|
26
24
|
},
|
|
27
25
|
{
|
|
28
|
-
browserName:
|
|
29
|
-
version:
|
|
30
|
-
platform:
|
|
26
|
+
browserName: "safari",
|
|
27
|
+
version: "9",
|
|
28
|
+
platform: "OS X 10.11"
|
|
31
29
|
},
|
|
32
30
|
{
|
|
33
|
-
browserName:
|
|
34
|
-
version:
|
|
35
|
-
platform:
|
|
31
|
+
browserName: "internet explorer",
|
|
32
|
+
version: "8",
|
|
33
|
+
platform: "Windows XP"
|
|
36
34
|
},
|
|
37
35
|
{
|
|
38
|
-
browserName:
|
|
39
|
-
version:
|
|
40
|
-
platform:
|
|
36
|
+
browserName: "internet explorer",
|
|
37
|
+
version: "11",
|
|
38
|
+
platform: "Windows 8.1"
|
|
41
39
|
},
|
|
42
40
|
{
|
|
43
|
-
browserName:
|
|
44
|
-
version:
|
|
45
|
-
platform:
|
|
41
|
+
browserName: "edge",
|
|
42
|
+
version: "13",
|
|
43
|
+
platform: "Windows 10"
|
|
46
44
|
},
|
|
47
45
|
// Mobile browsers
|
|
48
46
|
{
|
|
49
|
-
browserName:
|
|
50
|
-
deviceName:
|
|
51
|
-
deviceOrientation:
|
|
52
|
-
version:
|
|
53
|
-
platform:
|
|
47
|
+
browserName: "ipad",
|
|
48
|
+
deviceName: "iPad Air Simulator",
|
|
49
|
+
deviceOrientation: "portrait",
|
|
50
|
+
version: "8.4",
|
|
51
|
+
platform: "OS X 10.9"
|
|
54
52
|
},
|
|
55
53
|
{
|
|
56
|
-
browserName:
|
|
57
|
-
deviceName:
|
|
58
|
-
deviceOrientation:
|
|
59
|
-
version:
|
|
60
|
-
platform:
|
|
54
|
+
browserName: "iphone",
|
|
55
|
+
deviceName: "iPhone 5 Simulator",
|
|
56
|
+
deviceOrientation: "portrait",
|
|
57
|
+
version: "9.3",
|
|
58
|
+
platform: "OS X 10.11"
|
|
61
59
|
},
|
|
62
60
|
{
|
|
63
|
-
browserName:
|
|
64
|
-
deviceName:
|
|
65
|
-
deviceOrientation:
|
|
66
|
-
version:
|
|
67
|
-
platform:
|
|
61
|
+
browserName: "android",
|
|
62
|
+
deviceName: "Google Nexus 7 HD Emulator",
|
|
63
|
+
deviceOrientation: "portrait",
|
|
64
|
+
version: "4.4",
|
|
65
|
+
platform: "Linux"
|
|
68
66
|
}
|
|
69
67
|
];
|
|
70
68
|
|
|
71
69
|
var sauceJobs = {};
|
|
72
70
|
|
|
73
|
-
|
|
74
71
|
var browserTests = [
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
72
|
+
"filemanager-plugin",
|
|
73
|
+
"visitor-plugin",
|
|
74
|
+
"global-vars",
|
|
75
|
+
"modify-vars",
|
|
76
|
+
"production",
|
|
77
|
+
"rootpath-relative",
|
|
78
|
+
"rootpath-rewrite-urls",
|
|
79
|
+
"rootpath",
|
|
80
|
+
"relative-urls",
|
|
81
|
+
"rewrite-urls",
|
|
82
|
+
"browser",
|
|
83
|
+
"no-js-errors",
|
|
84
|
+
"legacy"
|
|
88
85
|
];
|
|
89
86
|
|
|
90
87
|
function makeJob(testName) {
|
|
91
88
|
sauceJobs[testName] = {
|
|
92
89
|
options: {
|
|
93
|
-
urls:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
90
|
+
urls:
|
|
91
|
+
testName === "all"
|
|
92
|
+
? browserTests.map(function(name) {
|
|
93
|
+
return (
|
|
94
|
+
"http://localhost:8081/tmp/browser/test-runner-" +
|
|
95
|
+
name +
|
|
96
|
+
".html"
|
|
97
|
+
);
|
|
98
|
+
})
|
|
99
|
+
: [
|
|
100
|
+
"http://localhost:8081/tmp/browser/test-runner-" +
|
|
101
|
+
testName +
|
|
102
|
+
".html"
|
|
103
|
+
],
|
|
104
|
+
testname:
|
|
105
|
+
testName === "all" ? "Unit Tests for Less.js" : testName,
|
|
99
106
|
browsers: browsers,
|
|
100
|
-
public:
|
|
107
|
+
public: "public",
|
|
101
108
|
recordVideo: false,
|
|
102
109
|
videoUploadOnPass: false,
|
|
103
|
-
recordScreenshots: process.env.TRAVIS_BRANCH !==
|
|
104
|
-
build:
|
|
105
|
-
|
|
110
|
+
recordScreenshots: process.env.TRAVIS_BRANCH !== "master",
|
|
111
|
+
build:
|
|
112
|
+
process.env.TRAVIS_BRANCH === "master"
|
|
113
|
+
? process.env.TRAVIS_JOB_ID
|
|
114
|
+
: undefined,
|
|
115
|
+
tags: [
|
|
116
|
+
process.env.TRAVIS_BUILD_NUMBER,
|
|
117
|
+
process.env.TRAVIS_PULL_REQUEST,
|
|
118
|
+
process.env.TRAVIS_BRANCH
|
|
119
|
+
],
|
|
106
120
|
statusCheckAttempts: -1,
|
|
107
121
|
sauceConfig: {
|
|
108
|
-
|
|
122
|
+
"idle-timeout": 100
|
|
109
123
|
},
|
|
110
124
|
throttled: 5,
|
|
111
125
|
onTestComplete: function(result, callback) {
|
|
@@ -126,54 +140,57 @@ module.exports = function (grunt) {
|
|
|
126
140
|
var pass = process.env.SAUCE_ACCESS_KEY;
|
|
127
141
|
|
|
128
142
|
git.short(function(hash) {
|
|
129
|
-
require(
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
143
|
+
require("phin")(
|
|
144
|
+
{
|
|
145
|
+
method: "PUT",
|
|
146
|
+
url: [
|
|
147
|
+
"https://saucelabs.com/rest/v1",
|
|
148
|
+
user,
|
|
149
|
+
"jobs",
|
|
150
|
+
result.job_id
|
|
151
|
+
].join("/"),
|
|
152
|
+
auth: { user: user, pass: pass },
|
|
153
|
+
data: {
|
|
154
|
+
passed: result.passed,
|
|
155
|
+
build: "build-" + hash
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
function(error, response) {
|
|
159
|
+
if (error) {
|
|
160
|
+
console.log(error);
|
|
161
|
+
callback(error);
|
|
162
|
+
} else if (response.statusCode !== 200) {
|
|
163
|
+
console.log(response);
|
|
164
|
+
callback(
|
|
165
|
+
new Error("Unexpected response status")
|
|
166
|
+
);
|
|
167
|
+
} else {
|
|
168
|
+
callback(null, result.passed);
|
|
169
|
+
}
|
|
136
170
|
}
|
|
137
|
-
|
|
138
|
-
if (error) {
|
|
139
|
-
console.log(error);
|
|
140
|
-
callback(error);
|
|
141
|
-
} else if (response.statusCode !== 200) {
|
|
142
|
-
console.log(response);
|
|
143
|
-
callback(new Error('Unexpected response status'));
|
|
144
|
-
} else {
|
|
145
|
-
callback(null, result.passed);
|
|
146
|
-
}
|
|
147
|
-
});
|
|
171
|
+
);
|
|
148
172
|
});
|
|
149
|
-
|
|
150
173
|
}
|
|
151
174
|
}
|
|
152
175
|
};
|
|
153
176
|
}
|
|
154
177
|
|
|
155
178
|
// Make the SauceLabs jobs
|
|
156
|
-
|
|
179
|
+
["all"].concat(browserTests).map(makeJob);
|
|
157
180
|
|
|
158
|
-
|
|
159
|
-
|
|
181
|
+
var semver = require('semver');
|
|
182
|
+
var path = require('path');
|
|
160
183
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
' * <%= meta.copyright %>, <%= pkg.author.name %> <<%= pkg.author.email %>>\n' +
|
|
169
|
-
' * Licensed under the <%= pkg.license %> License.\n' +
|
|
170
|
-
' *\n' +
|
|
171
|
-
' */\n\n' +
|
|
172
|
-
' /**' +
|
|
173
|
-
' * @license <%= pkg.license %>\n' +
|
|
174
|
-
' */\n\n'
|
|
175
|
-
},
|
|
184
|
+
// Handle async / await in Rollup build for tests
|
|
185
|
+
// Remove this when Node 6 is no longer supported for the build/test process
|
|
186
|
+
const nodeVersion = semver.major(process.versions.node);
|
|
187
|
+
let scriptRuntime = 'node';
|
|
188
|
+
if (nodeVersion < 8) {
|
|
189
|
+
scriptRuntime = path.resolve(path.join('node_modules', '.bin', 'babel-node')) + ' --presets=@babel/env';
|
|
190
|
+
}
|
|
176
191
|
|
|
192
|
+
// Project configuration.
|
|
193
|
+
grunt.initConfig({
|
|
177
194
|
shell: {
|
|
178
195
|
options: {
|
|
179
196
|
stdout: true,
|
|
@@ -182,101 +199,69 @@ module.exports = function (grunt) {
|
|
|
182
199
|
maxBuffer: Infinity
|
|
183
200
|
}
|
|
184
201
|
},
|
|
202
|
+
build: {
|
|
203
|
+
command: [
|
|
204
|
+
scriptRuntime + " build/rollup.js --dist"
|
|
205
|
+
].join(" && ")
|
|
206
|
+
},
|
|
207
|
+
testbuild: {
|
|
208
|
+
command: [
|
|
209
|
+
scriptRuntime + " build/rollup.js --lessc --out=./tmp/lessc",
|
|
210
|
+
scriptRuntime + " build/rollup.js --node --out=./tmp/less.cjs.js",
|
|
211
|
+
scriptRuntime + " build/rollup.js --browser --out=./test/browser/less.min.js"
|
|
212
|
+
].join(" && ")
|
|
213
|
+
},
|
|
185
214
|
test: {
|
|
186
|
-
command:
|
|
215
|
+
command: "node test/index.js"
|
|
187
216
|
},
|
|
188
217
|
benchmark: {
|
|
189
|
-
command:
|
|
218
|
+
command: "node benchmark/index.js"
|
|
190
219
|
},
|
|
191
|
-
opts: {
|
|
192
|
-
|
|
220
|
+
opts: {
|
|
221
|
+
// test running with all current options (using `opts` since `options` means something already)
|
|
222
|
+
command: [
|
|
223
|
+
// @TODO: make this more thorough
|
|
193
224
|
// CURRENT OPTIONS
|
|
194
225
|
// --math
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
226
|
+
"node tmp/lessc --math=always test/less/lazy-eval.less tmp/lazy-eval.css",
|
|
227
|
+
"node tmp/lessc --math=parens-division test/less/lazy-eval.less tmp/lazy-eval.css",
|
|
228
|
+
"node tmp/lessc --math=parens test/less/lazy-eval.less tmp/lazy-eval.css",
|
|
229
|
+
"node tmp/lessc --math=strict test/less/lazy-eval.less tmp/lazy-eval.css",
|
|
230
|
+
"node tmp/lessc --math=strict-legacy test/less/lazy-eval.less tmp/lazy-eval.css",
|
|
200
231
|
|
|
201
232
|
// DEPRECATED OPTIONS
|
|
202
233
|
// --strict-math
|
|
203
|
-
|
|
204
|
-
].join(
|
|
234
|
+
"node tmp/lessc --strict-math=on test/less/lazy-eval.less tmp/lazy-eval.css"
|
|
235
|
+
].join(" && ")
|
|
205
236
|
},
|
|
206
237
|
plugin: {
|
|
207
238
|
command: [
|
|
208
|
-
'node
|
|
209
|
-
|
|
210
|
-
'node ../
|
|
211
|
-
|
|
239
|
+
'node tmp/lessc --clean-css="--s1 --advanced" test/less/lazy-eval.less tmp/lazy-eval.css',
|
|
240
|
+
"cd lib",
|
|
241
|
+
'node ../tmp/lessc --clean-css="--s1 --advanced" ../test/less/lazy-eval.less ../tmp/lazy-eval.css',
|
|
242
|
+
"cd ..",
|
|
212
243
|
// Test multiple plugins
|
|
213
|
-
'node
|
|
214
|
-
].join(
|
|
244
|
+
'node tmp/lessc --plugin=clean-css="--s1 --advanced" --plugin=autoprefix="ie 11,Edge >= 13,Chrome >= 47,Firefox >= 45,iOS >= 9.2,Safari >= 9" test/less/lazy-eval.less tmp/lazy-eval.css'
|
|
245
|
+
].join(" && ")
|
|
215
246
|
},
|
|
216
|
-
|
|
247
|
+
"sourcemap-test": {
|
|
248
|
+
// quoted value doesn't seem to get picked up by time-grunt, or isn't output, at least; maybe just "sourcemap" is fine?
|
|
217
249
|
command: [
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
].join(
|
|
221
|
-
},
|
|
222
|
-
},
|
|
223
|
-
|
|
224
|
-
browserify: {
|
|
225
|
-
browser: {
|
|
226
|
-
src: ['./lib/less-browser/bootstrap.js'],
|
|
227
|
-
options: {
|
|
228
|
-
exclude: ['promise'],
|
|
229
|
-
browserifyOptions: {
|
|
230
|
-
standalone: 'less',
|
|
231
|
-
noParse: ['clone']
|
|
232
|
-
}
|
|
233
|
-
},
|
|
234
|
-
dest: 'tmp/less.js'
|
|
235
|
-
}
|
|
236
|
-
},
|
|
237
|
-
concat: {
|
|
238
|
-
options: {
|
|
239
|
-
stripBanners: 'all',
|
|
240
|
-
banner: '<%= meta.banner %>'
|
|
241
|
-
},
|
|
242
|
-
browsertest: {
|
|
243
|
-
src: COMPRESS_FOR_TESTS ? '<%= uglify.test.dest %>' : '<%= browserify.browser.dest %>',
|
|
244
|
-
dest: 'test/browser/less.js'
|
|
245
|
-
},
|
|
246
|
-
dist: {
|
|
247
|
-
src: '<%= browserify.browser.dest %>',
|
|
248
|
-
dest: 'dist/less.js'
|
|
249
|
-
}
|
|
250
|
-
},
|
|
251
|
-
|
|
252
|
-
uglify: {
|
|
253
|
-
options: {
|
|
254
|
-
banner: '<%= meta.banner %>',
|
|
255
|
-
mangle: true,
|
|
256
|
-
compress: {
|
|
257
|
-
pure_getters: true
|
|
258
|
-
}
|
|
259
|
-
},
|
|
260
|
-
dist: {
|
|
261
|
-
src: ['<%= concat.dist.dest %>'],
|
|
262
|
-
dest: 'dist/less.min.js'
|
|
263
|
-
},
|
|
264
|
-
test: {
|
|
265
|
-
src: '<%= browserify.browser.dest %>',
|
|
266
|
-
dest: 'tmp/less.min.js'
|
|
250
|
+
"node tmp/lessc --source-map=test/sourcemaps/maps/import-map.map test/less/import.less test/sourcemaps/import.css",
|
|
251
|
+
"node tmp/lessc --source-map test/less/sourcemaps/basic.less test/sourcemaps/basic.css"
|
|
252
|
+
].join(" && ")
|
|
267
253
|
}
|
|
268
254
|
},
|
|
269
255
|
|
|
270
256
|
eslint: {
|
|
271
|
-
target: [
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
'!test/browser/jasmine-jsreporter.js',
|
|
276
|
-
'!test/less/errors/plugin/plugin-error.js'
|
|
257
|
+
target: [
|
|
258
|
+
"test/**/*.js",
|
|
259
|
+
"lib/less*/**/*.js",
|
|
260
|
+
"!test/less/errors/plugin/plugin-error.js"
|
|
277
261
|
],
|
|
278
262
|
options: {
|
|
279
|
-
configFile:
|
|
263
|
+
configFile: ".eslintrc.json",
|
|
264
|
+
fix: true
|
|
280
265
|
}
|
|
281
266
|
},
|
|
282
267
|
|
|
@@ -291,287 +276,308 @@ module.exports = function (grunt) {
|
|
|
291
276
|
jasmine: {
|
|
292
277
|
options: {
|
|
293
278
|
keepRunner: true,
|
|
294
|
-
host:
|
|
279
|
+
host: "http://localhost:8081/",
|
|
280
|
+
polyfills: [
|
|
281
|
+
"./node_modules/phantomjs-polyfill-object-assign/object-assign-polyfill.js",
|
|
282
|
+
"test/browser/vendor/promise.js"
|
|
283
|
+
],
|
|
295
284
|
vendor: [
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
'test/browser/common.js',
|
|
300
|
-
'test/browser/less.js'
|
|
285
|
+
"test/browser/vendor/jasmine-jsreporter.js",
|
|
286
|
+
"test/browser/common.js",
|
|
287
|
+
"test/browser/less.min.js"
|
|
301
288
|
],
|
|
302
|
-
template:
|
|
289
|
+
template: "test/browser/test-runner-template.tmpl"
|
|
303
290
|
},
|
|
304
291
|
main: {
|
|
305
292
|
// src is used to build list of less files to compile
|
|
306
293
|
src: [
|
|
307
|
-
|
|
308
|
-
|
|
294
|
+
"test/less/*.less",
|
|
295
|
+
"!test/less/plugin-preeval.less", // uses ES6 syntax
|
|
309
296
|
// Don't test NPM import, obviously
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
297
|
+
"!test/less/plugin-module.less",
|
|
298
|
+
"!test/less/import-module.less",
|
|
299
|
+
"!test/less/javascript.less",
|
|
300
|
+
"!test/less/urls.less",
|
|
301
|
+
"!test/less/empty.less"
|
|
315
302
|
],
|
|
316
303
|
options: {
|
|
317
|
-
helpers:
|
|
318
|
-
specs:
|
|
319
|
-
outfile:
|
|
304
|
+
helpers: "test/browser/runner-main-options.js",
|
|
305
|
+
specs: "test/browser/runner-main-spec.js",
|
|
306
|
+
outfile: "tmp/browser/test-runner-main.html"
|
|
320
307
|
}
|
|
321
308
|
},
|
|
322
309
|
legacy: {
|
|
323
|
-
src: [
|
|
310
|
+
src: ["test/less/legacy/*.less"],
|
|
324
311
|
options: {
|
|
325
|
-
helpers:
|
|
326
|
-
specs:
|
|
327
|
-
outfile:
|
|
312
|
+
helpers: "test/browser/runner-legacy-options.js",
|
|
313
|
+
specs: "test/browser/runner-legacy-spec.js",
|
|
314
|
+
outfile: "tmp/browser/test-runner-legacy.html"
|
|
328
315
|
}
|
|
329
316
|
},
|
|
330
317
|
strictUnits: {
|
|
331
|
-
src: [
|
|
318
|
+
src: ["test/less/strict-units/*.less"],
|
|
332
319
|
options: {
|
|
333
|
-
helpers:
|
|
334
|
-
specs:
|
|
335
|
-
outfile:
|
|
320
|
+
helpers: "test/browser/runner-strict-units-options.js",
|
|
321
|
+
specs: "test/browser/runner-strict-units-spec.js",
|
|
322
|
+
outfile: "tmp/browser/test-runner-strict-units.html"
|
|
336
323
|
}
|
|
337
324
|
},
|
|
338
325
|
errors: {
|
|
339
|
-
src: [
|
|
326
|
+
src: [
|
|
327
|
+
"test/less/errors/*.less",
|
|
328
|
+
"!test/less/errors/javascript-error.less",
|
|
329
|
+
"test/browser/less/errors/*.less"
|
|
330
|
+
],
|
|
340
331
|
options: {
|
|
341
332
|
timeout: 20000,
|
|
342
|
-
helpers:
|
|
343
|
-
specs:
|
|
344
|
-
outfile:
|
|
333
|
+
helpers: "test/browser/runner-errors-options.js",
|
|
334
|
+
specs: "test/browser/runner-errors-spec.js",
|
|
335
|
+
outfile: "tmp/browser/test-runner-errors.html"
|
|
345
336
|
}
|
|
346
337
|
},
|
|
347
338
|
noJsErrors: {
|
|
348
|
-
src: [
|
|
339
|
+
src: ["test/less/no-js-errors/*.less"],
|
|
349
340
|
options: {
|
|
350
|
-
helpers:
|
|
351
|
-
specs:
|
|
352
|
-
outfile:
|
|
341
|
+
helpers: "test/browser/runner-no-js-errors-options.js",
|
|
342
|
+
specs: "test/browser/runner-no-js-errors-spec.js",
|
|
343
|
+
outfile: "tmp/browser/test-runner-no-js-errors.html"
|
|
353
344
|
}
|
|
354
345
|
},
|
|
355
346
|
browser: {
|
|
356
|
-
src: [
|
|
347
|
+
src: [
|
|
348
|
+
"test/browser/less/*.less",
|
|
349
|
+
"test/browser/less/plugin/*.less"
|
|
350
|
+
],
|
|
357
351
|
options: {
|
|
358
|
-
helpers:
|
|
359
|
-
specs:
|
|
360
|
-
outfile:
|
|
352
|
+
helpers: "test/browser/runner-browser-options.js",
|
|
353
|
+
specs: "test/browser/runner-browser-spec.js",
|
|
354
|
+
outfile: "tmp/browser/test-runner-browser.html"
|
|
361
355
|
}
|
|
362
356
|
},
|
|
363
357
|
relativeUrls: {
|
|
364
|
-
src: [
|
|
358
|
+
src: ["test/browser/less/relative-urls/*.less"],
|
|
365
359
|
options: {
|
|
366
|
-
helpers:
|
|
367
|
-
specs:
|
|
368
|
-
outfile:
|
|
360
|
+
helpers: "test/browser/runner-relative-urls-options.js",
|
|
361
|
+
specs: "test/browser/runner-relative-urls-spec.js",
|
|
362
|
+
outfile: "tmp/browser/test-runner-relative-urls.html"
|
|
369
363
|
}
|
|
370
364
|
},
|
|
371
365
|
rewriteUrls: {
|
|
372
|
-
src: [
|
|
366
|
+
src: ["test/browser/less/rewrite-urls/*.less"],
|
|
373
367
|
options: {
|
|
374
|
-
helpers:
|
|
375
|
-
specs:
|
|
376
|
-
outfile:
|
|
368
|
+
helpers: "test/browser/runner-rewrite-urls-options.js",
|
|
369
|
+
specs: "test/browser/runner-rewrite-urls-spec.js",
|
|
370
|
+
outfile: "tmp/browser/test-runner-rewrite-urls.html"
|
|
377
371
|
}
|
|
378
372
|
},
|
|
379
373
|
rootpath: {
|
|
380
|
-
src: [
|
|
374
|
+
src: ["test/browser/less/rootpath/*.less"],
|
|
381
375
|
options: {
|
|
382
|
-
helpers:
|
|
383
|
-
specs:
|
|
384
|
-
outfile:
|
|
376
|
+
helpers: "test/browser/runner-rootpath-options.js",
|
|
377
|
+
specs: "test/browser/runner-rootpath-spec.js",
|
|
378
|
+
outfile: "tmp/browser/test-runner-rootpath.html"
|
|
385
379
|
}
|
|
386
380
|
},
|
|
387
381
|
rootpathRelative: {
|
|
388
|
-
src: [
|
|
382
|
+
src: ["test/browser/less/rootpath-relative/*.less"],
|
|
389
383
|
options: {
|
|
390
|
-
helpers:
|
|
391
|
-
specs:
|
|
392
|
-
outfile:
|
|
384
|
+
helpers: "test/browser/runner-rootpath-relative-options.js",
|
|
385
|
+
specs: "test/browser/runner-rootpath-relative-spec.js",
|
|
386
|
+
outfile: "tmp/browser/test-runner-rootpath-relative.html"
|
|
393
387
|
}
|
|
394
388
|
},
|
|
395
389
|
rootpathRewriteUrls: {
|
|
396
|
-
src: [
|
|
390
|
+
src: ["test/browser/less/rootpath-rewrite-urls/*.less"],
|
|
397
391
|
options: {
|
|
398
|
-
helpers:
|
|
399
|
-
|
|
400
|
-
|
|
392
|
+
helpers:
|
|
393
|
+
"test/browser/runner-rootpath-rewrite-urls-options.js",
|
|
394
|
+
specs: "test/browser/runner-rootpath-rewrite-urls-spec.js",
|
|
395
|
+
outfile:
|
|
396
|
+
"tmp/browser/test-runner-rootpath-rewrite-urls.html"
|
|
401
397
|
}
|
|
402
398
|
},
|
|
403
399
|
production: {
|
|
404
|
-
src: [
|
|
400
|
+
src: ["test/browser/less/production/*.less"],
|
|
405
401
|
options: {
|
|
406
|
-
helpers:
|
|
407
|
-
specs:
|
|
408
|
-
outfile:
|
|
402
|
+
helpers: "test/browser/runner-production-options.js",
|
|
403
|
+
specs: "test/browser/runner-production-spec.js",
|
|
404
|
+
outfile: "tmp/browser/test-runner-production.html"
|
|
409
405
|
}
|
|
410
406
|
},
|
|
411
407
|
modifyVars: {
|
|
412
|
-
src: [
|
|
408
|
+
src: ["test/browser/less/modify-vars/*.less"],
|
|
413
409
|
options: {
|
|
414
|
-
helpers:
|
|
415
|
-
specs:
|
|
416
|
-
outfile:
|
|
410
|
+
helpers: "test/browser/runner-modify-vars-options.js",
|
|
411
|
+
specs: "test/browser/runner-modify-vars-spec.js",
|
|
412
|
+
outfile: "tmp/browser/test-runner-modify-vars.html"
|
|
417
413
|
}
|
|
418
414
|
},
|
|
419
415
|
globalVars: {
|
|
420
|
-
src: [
|
|
416
|
+
src: ["test/browser/less/global-vars/*.less"],
|
|
421
417
|
options: {
|
|
422
|
-
helpers:
|
|
423
|
-
specs:
|
|
424
|
-
outfile:
|
|
418
|
+
helpers: "test/browser/runner-global-vars-options.js",
|
|
419
|
+
specs: "test/browser/runner-global-vars-spec.js",
|
|
420
|
+
outfile: "tmp/browser/test-runner-global-vars.html"
|
|
425
421
|
}
|
|
426
422
|
},
|
|
427
423
|
postProcessorPlugin: {
|
|
428
|
-
src: [
|
|
424
|
+
src: ["test/less/postProcessorPlugin/*.less"],
|
|
429
425
|
options: {
|
|
430
|
-
helpers: [
|
|
431
|
-
|
|
432
|
-
|
|
426
|
+
helpers: [
|
|
427
|
+
"test/plugins/postprocess/index.js",
|
|
428
|
+
"test/browser/runner-postProcessorPlugin-options.js"
|
|
429
|
+
],
|
|
430
|
+
specs: "test/browser/runner-postProcessorPlugin.js",
|
|
431
|
+
outfile:
|
|
432
|
+
"tmp/browser/test-runner-post-processor-plugin.html"
|
|
433
433
|
}
|
|
434
434
|
},
|
|
435
435
|
preProcessorPlugin: {
|
|
436
|
-
src: [
|
|
436
|
+
src: ["test/less/preProcessorPlugin/*.less"],
|
|
437
437
|
options: {
|
|
438
|
-
helpers: [
|
|
439
|
-
|
|
440
|
-
|
|
438
|
+
helpers: [
|
|
439
|
+
"test/plugins/preprocess/index.js",
|
|
440
|
+
"test/browser/runner-preProcessorPlugin-options.js"
|
|
441
|
+
],
|
|
442
|
+
specs: "test/browser/runner-preProcessorPlugin.js",
|
|
443
|
+
outfile: "tmp/browser/test-runner-pre-processor-plugin.html"
|
|
441
444
|
}
|
|
442
445
|
},
|
|
443
446
|
visitorPlugin: {
|
|
444
|
-
src: [
|
|
447
|
+
src: ["test/less/visitorPlugin/*.less"],
|
|
445
448
|
options: {
|
|
446
|
-
helpers: [
|
|
447
|
-
|
|
448
|
-
|
|
449
|
+
helpers: [
|
|
450
|
+
"test/plugins/visitor/index.js",
|
|
451
|
+
"test/browser/runner-VisitorPlugin-options.js"
|
|
452
|
+
],
|
|
453
|
+
specs: "test/browser/runner-VisitorPlugin.js",
|
|
454
|
+
outfile: "tmp/browser/test-runner-visitor-plugin.html"
|
|
449
455
|
}
|
|
450
456
|
},
|
|
451
457
|
filemanagerPlugin: {
|
|
452
|
-
src: [
|
|
458
|
+
src: ["test/less/filemanagerPlugin/*.less"],
|
|
453
459
|
options: {
|
|
454
|
-
helpers: [
|
|
455
|
-
|
|
456
|
-
|
|
460
|
+
helpers: [
|
|
461
|
+
"test/plugins/filemanager/index.js",
|
|
462
|
+
"test/browser/runner-filemanagerPlugin-options.js"
|
|
463
|
+
],
|
|
464
|
+
specs: "test/browser/runner-filemanagerPlugin.js",
|
|
465
|
+
outfile: "tmp/browser/test-runner-filemanager-plugin.html"
|
|
457
466
|
}
|
|
458
467
|
}
|
|
459
468
|
},
|
|
460
469
|
|
|
461
|
-
|
|
462
|
-
|
|
470
|
+
"saucelabs-jasmine": sauceJobs,
|
|
463
471
|
|
|
464
472
|
// Clean the version of less built for the tests
|
|
465
473
|
clean: {
|
|
466
|
-
test: [
|
|
467
|
-
|
|
468
|
-
|
|
474
|
+
test: ["test/browser/less.js", "tmp", "test/less-bom"],
|
|
475
|
+
"sourcemap-test": [
|
|
476
|
+
"test/sourcemaps/*.css",
|
|
477
|
+
"test/sourcemaps/*.map"
|
|
478
|
+
],
|
|
479
|
+
sauce_log: ["sc_*.log"]
|
|
469
480
|
}
|
|
470
481
|
});
|
|
471
482
|
|
|
472
483
|
// Load these plugins to provide the necessary tasks
|
|
473
|
-
grunt.loadNpmTasks(
|
|
484
|
+
grunt.loadNpmTasks("grunt-saucelabs");
|
|
474
485
|
|
|
475
|
-
require(
|
|
486
|
+
require("jit-grunt")(grunt);
|
|
476
487
|
|
|
477
488
|
// by default, run tests
|
|
478
|
-
grunt.registerTask(
|
|
479
|
-
'test'
|
|
480
|
-
]);
|
|
489
|
+
grunt.registerTask("default", ["test"]);
|
|
481
490
|
|
|
482
491
|
// Release
|
|
483
|
-
grunt.registerTask(
|
|
484
|
-
|
|
485
|
-
'concat:dist',
|
|
486
|
-
'uglify:dist'
|
|
492
|
+
grunt.registerTask("dist", [
|
|
493
|
+
"shell:build"
|
|
487
494
|
]);
|
|
488
495
|
|
|
489
496
|
// Create the browser version of less.js
|
|
490
|
-
grunt.registerTask(
|
|
491
|
-
|
|
492
|
-
'uglify:test',
|
|
493
|
-
'concat:browsertest'
|
|
497
|
+
grunt.registerTask("browsertest-lessjs", [
|
|
498
|
+
"shell:testbuild"
|
|
494
499
|
]);
|
|
495
500
|
|
|
496
501
|
// Run all browser tests
|
|
497
|
-
grunt.registerTask(
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
502
|
+
grunt.registerTask("browsertest", [
|
|
503
|
+
"browsertest-lessjs",
|
|
504
|
+
"connect",
|
|
505
|
+
"jasmine"
|
|
501
506
|
]);
|
|
502
507
|
|
|
503
508
|
// setup a web server to run the browser tests in a browser rather than phantom
|
|
504
|
-
grunt.registerTask(
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
509
|
+
grunt.registerTask("browsertest-server", [
|
|
510
|
+
"browsertest-lessjs",
|
|
511
|
+
"jasmine::build",
|
|
512
|
+
"connect::keepalive"
|
|
508
513
|
]);
|
|
509
514
|
|
|
510
|
-
var previous_force_state = grunt.option(
|
|
515
|
+
var previous_force_state = grunt.option("force");
|
|
511
516
|
|
|
512
|
-
grunt.registerTask(
|
|
513
|
-
if (set ===
|
|
514
|
-
grunt.option(
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
else if (set === 'restore') {
|
|
520
|
-
grunt.option('force',previous_force_state);
|
|
517
|
+
grunt.registerTask("force", function(set) {
|
|
518
|
+
if (set === "on") {
|
|
519
|
+
grunt.option("force", true);
|
|
520
|
+
} else if (set === "off") {
|
|
521
|
+
grunt.option("force", false);
|
|
522
|
+
} else if (set === "restore") {
|
|
523
|
+
grunt.option("force", previous_force_state);
|
|
521
524
|
}
|
|
522
525
|
});
|
|
523
526
|
|
|
524
|
-
grunt.registerTask(
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
527
|
+
grunt.registerTask("sauce", [
|
|
528
|
+
"browsertest-lessjs",
|
|
529
|
+
"jasmine::build",
|
|
530
|
+
"connect",
|
|
531
|
+
"sauce-after-setup"
|
|
529
532
|
]);
|
|
530
533
|
|
|
531
|
-
grunt.registerTask(
|
|
532
|
-
|
|
533
|
-
|
|
534
|
+
grunt.registerTask("sauce-after-setup", [
|
|
535
|
+
"saucelabs-jasmine:all",
|
|
536
|
+
"clean:sauce_log"
|
|
534
537
|
]);
|
|
535
538
|
|
|
536
539
|
var testTasks = [
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
540
|
+
"clean",
|
|
541
|
+
"eslint",
|
|
542
|
+
"shell:testbuild",
|
|
543
|
+
"shell:test",
|
|
544
|
+
"shell:opts",
|
|
545
|
+
"shell:plugin",
|
|
546
|
+
"connect",
|
|
547
|
+
"jasmine"
|
|
543
548
|
];
|
|
544
549
|
|
|
545
|
-
if (
|
|
550
|
+
if (
|
|
551
|
+
isNaN(Number(process.env.TRAVIS_PULL_REQUEST, 10)) &&
|
|
546
552
|
Number(process.env.TRAVIS_NODE_VERSION) === 4 &&
|
|
547
|
-
(process.env.TRAVIS_BRANCH ===
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
testTasks.push(
|
|
553
|
+
(process.env.TRAVIS_BRANCH === "master" ||
|
|
554
|
+
process.env.TRAVIS_BRANCH === "3.x")
|
|
555
|
+
) {
|
|
556
|
+
testTasks.push("force:on");
|
|
557
|
+
testTasks.push("sauce-after-setup");
|
|
558
|
+
testTasks.push("force:off");
|
|
551
559
|
}
|
|
552
560
|
|
|
553
561
|
// Run all tests
|
|
554
|
-
grunt.registerTask(
|
|
562
|
+
grunt.registerTask("test", testTasks);
|
|
555
563
|
|
|
556
564
|
// Run shell option tests (includes deprecated options)
|
|
557
|
-
grunt.registerTask(
|
|
565
|
+
grunt.registerTask("shell-options", ["shell:opts"]);
|
|
558
566
|
|
|
559
567
|
// Run shell plugin test
|
|
560
|
-
grunt.registerTask(
|
|
568
|
+
grunt.registerTask("shell-plugin", ["shell:plugin"]);
|
|
561
569
|
|
|
562
|
-
// Run all tests
|
|
563
|
-
grunt.registerTask(
|
|
570
|
+
// Run all tests except browsertest
|
|
571
|
+
grunt.registerTask("quicktest", testTasks.slice(0, -1));
|
|
564
572
|
|
|
565
573
|
// generate a good test environment for testing sourcemaps
|
|
566
|
-
grunt.registerTask(
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
574
|
+
grunt.registerTask("sourcemap-test", [
|
|
575
|
+
"clean:sourcemap-test",
|
|
576
|
+
"shell:build:lessc",
|
|
577
|
+
"shell:sourcemap-test",
|
|
578
|
+
"connect::keepalive"
|
|
570
579
|
]);
|
|
571
580
|
|
|
572
581
|
// Run benchmark
|
|
573
|
-
grunt.registerTask(
|
|
574
|
-
'shell:benchmark'
|
|
575
|
-
]);
|
|
576
|
-
|
|
582
|
+
grunt.registerTask("benchmark", ["shell:benchmark"]);
|
|
577
583
|
};
|