less 3.0.0-pre.2 → 3.0.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/.eslintrc.json +88 -0
- package/.github/stale.yml +17 -0
- package/.project +17 -0
- package/.settings/org.eclipse.buildship.core.prefs +2 -0
- package/.travis.yml +22 -3
- package/.vscode/launch.json +14 -0
- package/CHANGELOG.md +27 -0
- package/Gruntfile.js +191 -86
- package/README.md +5 -7
- package/appveyor.yml +9 -10
- package/bin/lessc +37 -50
- package/dist/less.js +1357 -1269
- package/dist/less.min.js +7 -7
- package/lib/less/contexts.js +20 -16
- package/lib/less/default-options.js +65 -0
- package/lib/less/environment/abstract-file-manager.js +13 -14
- package/lib/less/environment/abstract-plugin-loader.js +45 -36
- package/lib/less/environment/environment.js +5 -0
- package/lib/less/functions/boolean.js +15 -0
- package/lib/less/functions/color.js +54 -24
- package/lib/less/functions/data-uri.js +5 -2
- package/lib/less/functions/function-registry.js +1 -1
- package/lib/less/functions/index.js +2 -1
- package/lib/less/functions/number.js +2 -2
- package/lib/less/functions/string.js +2 -2
- package/lib/less/functions/svg.js +4 -4
- package/lib/less/import-manager.js +41 -29
- package/lib/less/index.js +28 -3
- package/lib/less/less-error.js +112 -13
- package/lib/less/parse.js +18 -15
- package/lib/less/parser/parser-input.js +4 -4
- package/lib/less/parser/parser.js +208 -114
- package/lib/less/plugin-manager.js +8 -33
- package/lib/less/render.js +6 -2
- package/lib/less/source-map-builder.js +3 -0
- package/lib/less/source-map-output.js +13 -8
- package/lib/less/transform-tree.js +2 -2
- package/lib/less/tree/anonymous.js +4 -1
- package/lib/less/tree/atrule.js +7 -6
- package/lib/less/tree/call.js +25 -3
- package/lib/less/tree/color.js +2 -2
- package/lib/less/tree/debug-info.js +1 -1
- package/lib/less/tree/declaration.js +6 -5
- package/lib/less/tree/dimension.js +4 -1
- package/lib/less/tree/extend.js +2 -2
- package/lib/less/tree/import.js +17 -9
- package/lib/less/tree/index.js +3 -7
- package/lib/less/tree/js-eval-node.js +1 -1
- package/lib/less/tree/media.js +3 -14
- package/lib/less/tree/mixin-definition.js +3 -3
- package/lib/less/tree/node.js +9 -6
- package/lib/less/tree/operation.js +1 -1
- package/lib/less/tree/property.js +70 -0
- package/lib/less/tree/quoted.js +11 -10
- package/lib/less/tree/ruleset.js +115 -71
- package/lib/less/tree/selector.js +38 -23
- package/lib/less/tree/unit.js +1 -1
- package/lib/less/tree/value.js +6 -1
- package/lib/less/tree/{ruleset-call.js → variable-call.js} +5 -5
- package/lib/less/tree/variable.js +6 -6
- package/lib/less/utils.js +40 -0
- package/lib/less/visitors/extend-visitor.js +14 -14
- package/lib/less/visitors/import-visitor.js +2 -2
- package/lib/less/visitors/join-selector-visitor.js +1 -1
- package/lib/less/visitors/to-css-visitor.js +51 -84
- package/lib/less/visitors/visitor.js +15 -15
- package/lib/less-browser/bootstrap.js +21 -5
- package/lib/less-browser/cache.js +2 -2
- package/lib/less-browser/error-reporting.js +5 -5
- package/lib/less-browser/file-manager.js +27 -35
- package/lib/less-browser/index.js +12 -17
- package/lib/less-browser/plugin-loader.js +8 -45
- package/lib/less-browser/utils.js +1 -1
- package/lib/less-node/file-manager.js +99 -69
- package/lib/less-node/fs.js +1 -1
- package/lib/less-node/image-size.js +2 -2
- package/lib/less-node/index.js +7 -57
- package/lib/less-node/lessc-helper.js +38 -38
- package/lib/less-node/plugin-loader.js +18 -79
- package/lib/less-node/url-file-manager.js +1 -1
- package/lib/less-rhino/index.js +29 -44
- package/package.json +16 -9
- package/test/browser/common.js +54 -18
- package/test/browser/css/plugin/plugin.css +3 -0
- package/test/browser/jasmine-jsreporter.js +4 -4
- package/test/browser/less/plugin/plugin.js +7 -0
- package/test/browser/less/plugin/plugin.less +4 -0
- package/test/browser/less.js +11685 -13
- package/test/browser/runner-browser-options.js +6 -1
- package/test/browser/runner-filemanagerPlugin-options.js +3 -2
- package/test/browser/runner-legacy-options.js +2 -1
- package/test/browser/runner-main-options.js +0 -1
- package/test/browser/runner-modify-vars-spec.js +2 -2
- package/test/browser/test-runner-template.tmpl +38 -14
- package/test/copy-bom.js +1 -1
- package/test/css/calc.css +5 -0
- package/test/css/comments2.css +1 -1
- package/test/css/compression/compression.css +1 -1
- package/test/css/css-grid.css +11 -0
- package/test/css/debug/linenumbers-all.css +0 -1
- package/test/css/debug/linenumbers-comments.css +0 -1
- package/test/css/debug/linenumbers-mediaquery.css +0 -1
- package/test/css/functions.css +16 -3
- package/test/css/import-module.css +9 -0
- package/test/css/import.css +0 -1
- package/test/css/legacy/legacy.css +1 -1
- package/test/css/merge.css +5 -4
- package/test/css/plugin-module.css +1 -0
- package/test/css/plugin.css +20 -0
- package/test/css/property-accessors.css +49 -0
- package/test/css/{css.css → strict-math/css.css} +0 -0
- package/test/css/{mixins-args.css → strict-math/mixins-args.css} +0 -0
- package/test/css/{parens.css → strict-math/parens.css} +0 -0
- package/test/import-module/one/1.less +3 -0
- package/test/import-module/one/two/2.less +3 -0
- package/test/import-module/one/two/three/3.less +3 -0
- package/test/import-module/package.json +11 -0
- package/test/index.js +55 -49
- package/test/less/calc.less +7 -0
- package/test/less/css-grid.less +15 -0
- package/test/less/detached-rulesets.less +2 -2
- package/test/less/errors/color-invalid-hex-code.less +1 -0
- package/test/less/errors/color-invalid-hex-code.txt +1 -1
- package/test/less/errors/color-invalid-hex-code2.less +1 -0
- package/test/less/errors/color-invalid-hex-code2.txt +1 -1
- package/test/less/errors/import-missing.txt +1 -1
- package/test/less/errors/plugin/plugin-error-2.js +5 -0
- package/test/less/errors/plugin/plugin-error-3.js +5 -0
- package/test/less/errors/plugin/plugin-error.js +1 -0
- package/test/less/errors/plugin-1.less +1 -0
- package/test/less/errors/plugin-1.txt +2 -0
- package/test/less/errors/plugin-2.less +1 -0
- package/test/less/errors/plugin-2.txt +5 -0
- package/test/less/errors/plugin-3.less +1 -0
- package/test/less/errors/plugin-3.txt +5 -0
- package/test/less/functions.less +18 -0
- package/test/less/import-module.less +3 -0
- package/test/less/import.less +0 -2
- package/test/less/legacy/legacy.less +1 -1
- package/test/less/media.less +2 -2
- package/test/less/merge.less +6 -3
- package/test/less/plugin/plugin-collection.js +9 -0
- package/test/less/plugin/plugin-local.js +2 -2
- package/test/less/plugin/plugin-scope1.js +3 -0
- package/test/less/plugin/plugin-scope2.js +3 -0
- package/test/less/plugin/plugin-simple.js +7 -0
- package/test/less/plugin/plugin-tree-nodes.js +33 -31
- package/test/less/plugin-module.less +7 -0
- package/test/less/plugin.less +33 -3
- package/test/less/property-accessors.less +67 -0
- package/test/less/root-registry/file.less +1 -0
- package/test/less/root-registry/root.less +3 -0
- package/test/less/{css.less → strict-math/css.less} +0 -0
- package/test/less/{mixins-args.less → strict-math/mixins-args.less} +0 -0
- package/test/less/{parens.less → strict-math/parens.less} +0 -0
- package/test/less-bom/calc.less +7 -0
- package/test/less-bom/css-grid.less +15 -0
- package/test/less-bom/detached-rulesets.less +2 -2
- package/test/less-bom/errors/color-invalid-hex-code.less +1 -0
- package/test/less-bom/errors/color-invalid-hex-code.txt +1 -1
- package/test/less-bom/errors/color-invalid-hex-code2.less +1 -0
- package/test/less-bom/errors/color-invalid-hex-code2.txt +1 -1
- package/test/less-bom/errors/import-missing.txt +1 -1
- package/test/less-bom/errors/plugin/plugin-error-2.js +5 -0
- package/test/less-bom/errors/plugin/plugin-error-3.js +5 -0
- package/test/less-bom/errors/plugin/plugin-error.js +1 -0
- package/test/less-bom/errors/plugin-1.less +1 -0
- package/test/less-bom/errors/plugin-1.txt +2 -0
- package/test/less-bom/errors/plugin-2.less +1 -0
- package/test/less-bom/errors/plugin-2.txt +5 -0
- package/test/less-bom/errors/plugin-3.less +1 -0
- package/test/less-bom/errors/plugin-3.txt +5 -0
- package/test/less-bom/functions.less +18 -0
- package/test/less-bom/import-module.less +3 -0
- package/test/less-bom/import.less +0 -2
- package/test/less-bom/legacy/legacy.less +1 -1
- package/test/less-bom/media.less +2 -2
- package/test/less-bom/merge.less +6 -3
- package/test/less-bom/plugin/plugin-collection.js +9 -0
- package/test/less-bom/plugin/plugin-local.js +2 -2
- package/test/less-bom/plugin/plugin-scope1.js +3 -0
- package/test/less-bom/plugin/plugin-scope2.js +3 -0
- package/test/less-bom/plugin/plugin-simple.js +7 -0
- package/test/less-bom/plugin/plugin-tree-nodes.js +33 -31
- package/test/less-bom/plugin-module.less +7 -0
- package/test/less-bom/plugin.less +33 -3
- package/test/less-bom/property-accessors.less +67 -0
- package/test/less-bom/root-registry/file.less +1 -0
- package/test/less-bom/root-registry/root.less +3 -0
- package/test/less-bom/{css.less → strict-math/css.less} +0 -0
- package/test/less-bom/{mixins-args.less → strict-math/mixins-args.less} +0 -0
- package/test/less-bom/{parens.less → strict-math/parens.less} +0 -0
- package/test/less-test.js +75 -17
- package/test/modify-vars.js +1 -1
- package/test/plugins/visitor/index.js +1 -1
- package/.jscsrc +0 -73
- package/.jshintrc +0 -11
- package/lib/less/tree/alpha.js +0 -28
- package/lib/less/tree/directive.js +0 -12
- package/lib/less/tree/rule.js +0 -12
- package/test/less/errors/functions-2-alpha.less +0 -2
- package/test/less/errors/functions-2-alpha.txt +0 -3
- package/test/less-bom/errors/functions-2-alpha.less +0 -2
- package/test/less-bom/errors/functions-2-alpha.txt +0 -3
- package/test/sourcemaps/maps/import-map.map +0 -1
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"env": {
|
|
3
|
+
"node": true
|
|
4
|
+
},
|
|
5
|
+
"globals": {},
|
|
6
|
+
"rules": {
|
|
7
|
+
"no-eval": 2,
|
|
8
|
+
"no-use-before-define": [
|
|
9
|
+
2,
|
|
10
|
+
{
|
|
11
|
+
"functions": false
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"no-undef": 0,
|
|
15
|
+
"no-unused-vars": 1,
|
|
16
|
+
"no-caller": 2,
|
|
17
|
+
"no-eq-null": 1,
|
|
18
|
+
"guard-for-in": 2,
|
|
19
|
+
"no-implicit-coercion": [
|
|
20
|
+
2,
|
|
21
|
+
{
|
|
22
|
+
"boolean": false,
|
|
23
|
+
"string": true,
|
|
24
|
+
"number": true
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"no-with": 2,
|
|
28
|
+
"no-mixed-spaces-and-tabs": 2,
|
|
29
|
+
"no-multiple-empty-lines": 2,
|
|
30
|
+
"dot-location": [
|
|
31
|
+
2,
|
|
32
|
+
"property"
|
|
33
|
+
],
|
|
34
|
+
"operator-linebreak": [
|
|
35
|
+
0,
|
|
36
|
+
"after"
|
|
37
|
+
],
|
|
38
|
+
"keyword-spacing": [
|
|
39
|
+
2,
|
|
40
|
+
{}
|
|
41
|
+
],
|
|
42
|
+
"space-unary-ops": [
|
|
43
|
+
2,
|
|
44
|
+
{
|
|
45
|
+
"words": false,
|
|
46
|
+
"nonwords": false
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"no-spaced-func": 2,
|
|
50
|
+
"space-before-function-paren": [
|
|
51
|
+
1,
|
|
52
|
+
{
|
|
53
|
+
"anonymous": "ignore",
|
|
54
|
+
"named": "never"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"comma-dangle": [
|
|
58
|
+
2,
|
|
59
|
+
"never"
|
|
60
|
+
],
|
|
61
|
+
"no-trailing-spaces": 0,
|
|
62
|
+
"max-len": [
|
|
63
|
+
2,
|
|
64
|
+
160
|
|
65
|
+
],
|
|
66
|
+
"comma-style": [
|
|
67
|
+
2,
|
|
68
|
+
"last"
|
|
69
|
+
],
|
|
70
|
+
"curly": [
|
|
71
|
+
2,
|
|
72
|
+
"all"
|
|
73
|
+
],
|
|
74
|
+
"space-infix-ops": 2,
|
|
75
|
+
"spaced-comment": 1,
|
|
76
|
+
"space-before-blocks": [
|
|
77
|
+
2,
|
|
78
|
+
"always"
|
|
79
|
+
],
|
|
80
|
+
"indent": [
|
|
81
|
+
2,
|
|
82
|
+
4,
|
|
83
|
+
{
|
|
84
|
+
"SwitchCase": 1
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Number of days of inactivity before an issue becomes stale
|
|
2
|
+
daysUntilStale: 120
|
|
3
|
+
# Number of days of inactivity before a stale issue is closed
|
|
4
|
+
daysUntilClose: 14
|
|
5
|
+
# Issues with these labels will never be considered stale
|
|
6
|
+
exemptLabels:
|
|
7
|
+
- up-for-grabs
|
|
8
|
+
- bug
|
|
9
|
+
# Label to use when marking an issue as stale
|
|
10
|
+
staleLabel: stale
|
|
11
|
+
# Comment to post when marking an issue as stale. Set to `false` to disable
|
|
12
|
+
markComment: >
|
|
13
|
+
This issue has been automatically marked as stale because it has not had
|
|
14
|
+
recent activity. It will be closed if no further activity occurs. Thank you
|
|
15
|
+
for your contributions.
|
|
16
|
+
# Comment to post when closing a stale issue. Set to `false` to disable
|
|
17
|
+
closeComment: false
|
package/.project
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<projectDescription>
|
|
3
|
+
<name>less.js</name>
|
|
4
|
+
<comment>Project less.js created by Buildship.</comment>
|
|
5
|
+
<projects>
|
|
6
|
+
</projects>
|
|
7
|
+
<buildSpec>
|
|
8
|
+
<buildCommand>
|
|
9
|
+
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
|
|
10
|
+
<arguments>
|
|
11
|
+
</arguments>
|
|
12
|
+
</buildCommand>
|
|
13
|
+
</buildSpec>
|
|
14
|
+
<natures>
|
|
15
|
+
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
|
|
16
|
+
</natures>
|
|
17
|
+
</projectDescription>
|
package/.travis.yml
CHANGED
|
@@ -1,12 +1,31 @@
|
|
|
1
1
|
language: node_js
|
|
2
|
+
cache:
|
|
3
|
+
directories:
|
|
4
|
+
- travis-phantomjs
|
|
2
5
|
node_js:
|
|
6
|
+
- "9"
|
|
7
|
+
- "8"
|
|
3
8
|
- "6"
|
|
4
9
|
- "4"
|
|
5
|
-
|
|
6
|
-
|
|
10
|
+
before_install:
|
|
11
|
+
# from https://github.com/travis-ci/travis-ci/issues/3225#issuecomment-177592725
|
|
12
|
+
# and also from https://github.com/travis-ci/travis-ci/issues/3225#issuecomment-200965782
|
|
13
|
+
- phantomjs --version
|
|
14
|
+
- export PATH=$PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH
|
|
15
|
+
- phantomjs --version
|
|
16
|
+
# Clear cache and download new copy of PhantomJS if the current version doesn't match 2.1.1.
|
|
17
|
+
- "if [ $(phantomjs --version) != '2.1.1' ]; then rm -rf $PWD/travis-phantomjs; mkdir -p $PWD/travis-phantomjs; fi"
|
|
18
|
+
- "if [ $(phantomjs --version) != '2.1.1' ]; then wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2; fi"
|
|
19
|
+
- "if [ $(phantomjs --version) != '2.1.1' ]; then tar -xvf $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis-phantomjs; fi"
|
|
20
|
+
- phantomjs --version
|
|
7
21
|
install:
|
|
8
22
|
- npm install -g grunt-cli
|
|
9
|
-
|
|
23
|
+
# node 0.10 & 0.12 have race condition issues when running custom install scripts
|
|
24
|
+
# this can cause phantomjs-prebuilt install script to fail with the error:
|
|
25
|
+
# <Cannot find module 'boom'>
|
|
26
|
+
# Seems related to: https://github.com/npm/npm/issues/8152
|
|
27
|
+
# using <travis_retry> solves this.
|
|
28
|
+
- travis_retry npm install
|
|
10
29
|
env:
|
|
11
30
|
global:
|
|
12
31
|
- PHANTOMJS_CDNURL=http://cnpmjs.org/downloads
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Use IntelliSense to learn about possible attributes.
|
|
3
|
+
// Hover to view descriptions of existing attributes.
|
|
4
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"configurations": [
|
|
7
|
+
{
|
|
8
|
+
"type": "node",
|
|
9
|
+
"request": "launch",
|
|
10
|
+
"name": "Launch Program",
|
|
11
|
+
"program": "${workspaceFolder}/index"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
# 3.0.0
|
|
2
|
+
2018-02-10
|
|
3
|
+
- Fix `calc()` function to not do math operations on compile
|
|
4
|
+
- Rename Directive -> AtRule & Rule -> Declaration
|
|
5
|
+
- Cross-platform `@plugin` loading! (Node & Browser)
|
|
6
|
+
- Numerous changes / improvements to plugin architecture
|
|
7
|
+
- Simplified API calls in plugins (`less.atrule()` vs `new less.tree.AtRule()`)
|
|
8
|
+
- Property accessors (`$width` to refer to `width: 300px` value)
|
|
9
|
+
- Inline JavaScript disabled by default for security reasons (use `@plugin`)
|
|
10
|
+
- Improvements in Less error reporting
|
|
11
|
+
- Added feature: returning `null` / `false` from Less functions will remove that line
|
|
12
|
+
- Simple `boolean()` and `if()` functions added
|
|
13
|
+
- Bug fixes
|
|
14
|
+
- Removal of unnecessary nodes from API (like IE's `alpha()`)
|
|
15
|
+
|
|
16
|
+
# 2.7.3
|
|
17
|
+
2017-10-23
|
|
18
|
+
|
|
19
|
+
- Bump `request` dependency
|
|
20
|
+
|
|
21
|
+
# 2.7.2
|
|
22
|
+
2017-01-04
|
|
23
|
+
|
|
24
|
+
- Revert breaking changes to contrast() function
|
|
25
|
+
- Fix error reporting of lessc executable
|
|
26
|
+
- Changed octals to hex for ES6 strict mode
|
|
27
|
+
|
|
1
28
|
# 2.7.1 HOTFIX
|
|
2
29
|
|
|
3
30
|
2016-05-09
|
package/Gruntfile.js
CHANGED
|
@@ -2,10 +2,154 @@
|
|
|
2
2
|
|
|
3
3
|
module.exports = function (grunt) {
|
|
4
4
|
|
|
5
|
+
|
|
6
|
+
grunt.option('stack', true)
|
|
7
|
+
|
|
5
8
|
// Report the elapsed execution time of tasks.
|
|
6
9
|
require('time-grunt')(grunt);
|
|
7
10
|
|
|
8
|
-
var COMPRESS_FOR_TESTS =
|
|
11
|
+
var COMPRESS_FOR_TESTS = false;
|
|
12
|
+
var git = require('git-rev');
|
|
13
|
+
|
|
14
|
+
// Sauce Labs browser
|
|
15
|
+
var browsers = [
|
|
16
|
+
// Desktop browsers
|
|
17
|
+
{
|
|
18
|
+
browserName: "chrome",
|
|
19
|
+
version: 'latest',
|
|
20
|
+
platform: 'Windows 7'
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
browserName: "firefox",
|
|
24
|
+
version: 'latest',
|
|
25
|
+
platform: 'Linux'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
browserName: 'safari',
|
|
29
|
+
version: '9',
|
|
30
|
+
platform: 'OS X 10.11'
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
browserName: "internet explorer",
|
|
34
|
+
version: '8',
|
|
35
|
+
platform: 'Windows XP'
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
browserName: "internet explorer",
|
|
39
|
+
version: '11',
|
|
40
|
+
platform: 'Windows 8.1'
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
browserName: "edge",
|
|
44
|
+
version: '13',
|
|
45
|
+
platform: 'Windows 10'
|
|
46
|
+
},
|
|
47
|
+
// Mobile browsers
|
|
48
|
+
{
|
|
49
|
+
browserName: 'ipad',
|
|
50
|
+
deviceName: 'iPad Air Simulator',
|
|
51
|
+
deviceOrientation: 'portrait',
|
|
52
|
+
version: '8.4',
|
|
53
|
+
platform: 'OS X 10.9'
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
browserName: 'iphone',
|
|
57
|
+
deviceName: 'iPhone 5 Simulator',
|
|
58
|
+
deviceOrientation: 'portrait',
|
|
59
|
+
version: '9.3',
|
|
60
|
+
platform: 'OS X 10.11'
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
browserName: 'android',
|
|
64
|
+
deviceName: 'Google Nexus 7 HD Emulator',
|
|
65
|
+
deviceOrientation: 'portrait',
|
|
66
|
+
version: '4.4',
|
|
67
|
+
platform: 'Linux'
|
|
68
|
+
}
|
|
69
|
+
];
|
|
70
|
+
|
|
71
|
+
var sauceJobs = {};
|
|
72
|
+
|
|
73
|
+
var browserTests = [ "filemanager-plugin",
|
|
74
|
+
"visitor-plugin",
|
|
75
|
+
"global-vars",
|
|
76
|
+
"modify-vars",
|
|
77
|
+
"production",
|
|
78
|
+
"rootpath-relative",
|
|
79
|
+
"rootpath",
|
|
80
|
+
"relative-urls",
|
|
81
|
+
"browser",
|
|
82
|
+
"no-js-errors",
|
|
83
|
+
"legacy"
|
|
84
|
+
];
|
|
85
|
+
|
|
86
|
+
function makeJob(testName) {
|
|
87
|
+
sauceJobs[testName] = {
|
|
88
|
+
options: {
|
|
89
|
+
urls: testName === 'all' ?
|
|
90
|
+
browserTests.map(function(name) {
|
|
91
|
+
return "http://localhost:8081/tmp/browser/test-runner-" + name + ".html";
|
|
92
|
+
}) :
|
|
93
|
+
["http://localhost:8081/tmp/browser/test-runner-" + testName + ".html"],
|
|
94
|
+
testname: testName === 'all' ? 'Unit Tests for Less.js' : testName,
|
|
95
|
+
browsers: browsers,
|
|
96
|
+
public: 'public',
|
|
97
|
+
recordVideo: false,
|
|
98
|
+
videoUploadOnPass: false,
|
|
99
|
+
recordScreenshots: process.env.TRAVIS_BRANCH !== "master",
|
|
100
|
+
build: process.env.TRAVIS_BRANCH === "master" ? process.env.TRAVIS_JOB_ID : undefined,
|
|
101
|
+
tags: [process.env.TRAVIS_BUILD_NUMBER, process.env.TRAVIS_PULL_REQUEST, process.env.TRAVIS_BRANCH],
|
|
102
|
+
statusCheckAttempts: -1,
|
|
103
|
+
sauceConfig: {
|
|
104
|
+
'idle-timeout': 100
|
|
105
|
+
},
|
|
106
|
+
throttled: 5,
|
|
107
|
+
onTestComplete: function(result, callback) {
|
|
108
|
+
// Called after a unit test is done, per page, per browser
|
|
109
|
+
// 'result' param is the object returned by the test framework's reporter
|
|
110
|
+
// 'callback' is a Node.js style callback function. You must invoke it after you
|
|
111
|
+
// finish your work.
|
|
112
|
+
// Pass a non-null value as the callback's first parameter if you want to throw an
|
|
113
|
+
// exception. If your function is synchronous you can also throw exceptions
|
|
114
|
+
// directly.
|
|
115
|
+
// Passing true or false as the callback's second parameter passes or fails the
|
|
116
|
+
// test. Passing undefined does not alter the test result. Please note that this
|
|
117
|
+
// only affects the grunt task's result. You have to explicitly update the Sauce
|
|
118
|
+
// Labs job's status via its REST API, if you want so.
|
|
119
|
+
|
|
120
|
+
// This should be the encrypted value in Travis
|
|
121
|
+
var user = process.env.SAUCE_USERNAME;
|
|
122
|
+
var pass = process.env.SAUCE_ACCESS_KEY;
|
|
123
|
+
|
|
124
|
+
git.short(function(hash) {
|
|
125
|
+
require('phin')({
|
|
126
|
+
method: 'PUT',
|
|
127
|
+
url: ['https://saucelabs.com/rest/v1', user, 'jobs', result.job_id].join('/'),
|
|
128
|
+
auth: { user: user, pass: pass },
|
|
129
|
+
data: {
|
|
130
|
+
passed: result.passed,
|
|
131
|
+
build: 'build-' + hash
|
|
132
|
+
}
|
|
133
|
+
}, function (error, response) {
|
|
134
|
+
if (error) {
|
|
135
|
+
console.log(error);
|
|
136
|
+
callback(error);
|
|
137
|
+
} else if (response.statusCode !== 200) {
|
|
138
|
+
console.log(response);
|
|
139
|
+
callback(new Error('Unexpected response status'));
|
|
140
|
+
} else {
|
|
141
|
+
callback(null, result.passed);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Make the SauceLabs jobs
|
|
152
|
+
(['all'].concat(browserTests)).map(makeJob);
|
|
9
153
|
|
|
10
154
|
// Project configuration.
|
|
11
155
|
grunt.initConfig({
|
|
@@ -29,13 +173,22 @@ module.exports = function (grunt) {
|
|
|
29
173
|
},
|
|
30
174
|
|
|
31
175
|
shell: {
|
|
32
|
-
options: {
|
|
176
|
+
options: {
|
|
177
|
+
stdout: true,
|
|
178
|
+
failOnError: true,
|
|
179
|
+
execOptions: {
|
|
180
|
+
maxBuffer: Infinity
|
|
181
|
+
}
|
|
182
|
+
},
|
|
33
183
|
test: {
|
|
34
184
|
command: 'node test/index.js'
|
|
35
185
|
},
|
|
36
186
|
benchmark: {
|
|
37
187
|
command: 'node benchmark/index.js'
|
|
38
188
|
},
|
|
189
|
+
plugin: {
|
|
190
|
+
command: 'node bin/lessc --clean-css="--s1 --advanced" test/less/lazy-eval.less tmp/lazy-eval.css'
|
|
191
|
+
},
|
|
39
192
|
"sourcemap-test": {
|
|
40
193
|
command: [
|
|
41
194
|
'node bin/lessc --source-map=test/sourcemaps/maps/import-map.map test/less/import.less test/sourcemaps/import.css',
|
|
@@ -107,24 +260,16 @@ module.exports = function (grunt) {
|
|
|
107
260
|
}
|
|
108
261
|
},
|
|
109
262
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
'lib/less-rhino/**/*.js',
|
|
119
|
-
'bin/lessc'
|
|
120
|
-
]
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
|
|
124
|
-
jscs: {
|
|
125
|
-
src: ["test/**/*.js", "lib/less*/**/*.js", "bin/lessc"],
|
|
263
|
+
eslint: {
|
|
264
|
+
target: ["Gruntfile.js",
|
|
265
|
+
"test/**/*.js",
|
|
266
|
+
"lib/less*/**/*.js",
|
|
267
|
+
"bin/lessc",
|
|
268
|
+
"!test/browser/jasmine-jsreporter.js",
|
|
269
|
+
"!test/less/errors/plugin/plugin-error.js"
|
|
270
|
+
],
|
|
126
271
|
options: {
|
|
127
|
-
|
|
272
|
+
configFile: ".eslintrc.json"
|
|
128
273
|
}
|
|
129
274
|
},
|
|
130
275
|
|
|
@@ -145,7 +290,15 @@ module.exports = function (grunt) {
|
|
|
145
290
|
},
|
|
146
291
|
main: {
|
|
147
292
|
// src is used to build list of less files to compile
|
|
148
|
-
src: [
|
|
293
|
+
src: [
|
|
294
|
+
'test/less/*.less',
|
|
295
|
+
// Don't test NPM import, obviously
|
|
296
|
+
'!test/less/plugin-module.less',
|
|
297
|
+
'!test/less/import-module.less',
|
|
298
|
+
'!test/less/javascript.less',
|
|
299
|
+
'!test/less/urls.less',
|
|
300
|
+
'!test/less/empty.less'
|
|
301
|
+
],
|
|
149
302
|
options: {
|
|
150
303
|
helpers: 'test/browser/runner-main-options.js',
|
|
151
304
|
specs: 'test/browser/runner-main-spec.js',
|
|
@@ -186,7 +339,7 @@ module.exports = function (grunt) {
|
|
|
186
339
|
}
|
|
187
340
|
},
|
|
188
341
|
browser: {
|
|
189
|
-
src: ['test/browser/less/*.less'],
|
|
342
|
+
src: ['test/browser/less/*.less', 'test/browser/less/plugin/*.less'],
|
|
190
343
|
options: {
|
|
191
344
|
helpers: 'test/browser/runner-browser-options.js',
|
|
192
345
|
specs: 'test/browser/runner-browser-spec.js',
|
|
@@ -272,66 +425,12 @@ module.exports = function (grunt) {
|
|
|
272
425
|
specs: 'test/browser/runner-filemanagerPlugin.js',
|
|
273
426
|
outfile: 'tmp/browser/test-runner-filemanager-plugin.html'
|
|
274
427
|
}
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
|
-
|
|
278
|
-
'saucelabs-jasmine': {
|
|
279
|
-
all: {
|
|
280
|
-
options: {
|
|
281
|
-
urls: ["filemanager-plugin","visitor-plugin","pre-processor-plugin","post-processor-plugin","post-processor", "global-vars", "modify-vars", "production", "rootpath-relative",
|
|
282
|
-
"rootpath", "relative-urls", "browser", "no-js-errors", "legacy", "strict-units"
|
|
283
|
-
].map(function(testName) {
|
|
284
|
-
return "http://localhost:8081/tmp/browser/test-runner-" + testName + ".html";
|
|
285
|
-
}),
|
|
286
|
-
testname: 'Sauce Unit Test for less.js',
|
|
287
|
-
browsers: [{
|
|
288
|
-
browserName: "chrome",
|
|
289
|
-
version: '',
|
|
290
|
-
platform: 'Windows 8'
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
browserName: "firefox",
|
|
294
|
-
version: '33',
|
|
295
|
-
platform: 'Linux'
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
browserName: "iPad",
|
|
299
|
-
version: '8.0',
|
|
300
|
-
platform: 'OS X 10.9',
|
|
301
|
-
'device-orientation': 'portrait'
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
browserName: "internet explorer",
|
|
305
|
-
version: '8',
|
|
306
|
-
platform: 'Windows XP'
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
browserName: "internet explorer",
|
|
310
|
-
version: '9',
|
|
311
|
-
platform: 'Windows 7'
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
browserName: "internet explorer",
|
|
315
|
-
version: '10',
|
|
316
|
-
platform: 'Windows 7'
|
|
317
|
-
},
|
|
318
|
-
{
|
|
319
|
-
browserName: "internet explorer",
|
|
320
|
-
version: '11',
|
|
321
|
-
platform: 'Windows 8.1'
|
|
322
|
-
}],
|
|
323
|
-
sauceConfig: {
|
|
324
|
-
'record-video': process.env.TRAVIS_BRANCH !== "master",
|
|
325
|
-
'record-screenshots': process.env.TRAVIS_BRANCH !== "master",
|
|
326
|
-
'idle-timeout': 100, 'max-duration': 120,
|
|
327
|
-
build: process.env.TRAVIS_BRANCH === "master" ? process.env.TRAVIS_JOB_ID : undefined,
|
|
328
|
-
tags: [process.env.TRAVIS_BUILD_NUMBER, process.env.TRAVIS_PULL_REQUEST, process.env.TRAVIS_BRANCH]
|
|
329
|
-
},
|
|
330
|
-
throttled: 3
|
|
331
|
-
}
|
|
332
428
|
}
|
|
333
429
|
},
|
|
334
430
|
|
|
431
|
+
'saucelabs-jasmine': sauceJobs,
|
|
432
|
+
|
|
433
|
+
|
|
335
434
|
// Clean the version of less built for the tests
|
|
336
435
|
clean: {
|
|
337
436
|
test: ['test/browser/less.js', 'tmp', 'test/less-bom'],
|
|
@@ -341,6 +440,8 @@ module.exports = function (grunt) {
|
|
|
341
440
|
});
|
|
342
441
|
|
|
343
442
|
// Load these plugins to provide the necessary tasks
|
|
443
|
+
grunt.loadNpmTasks('grunt-saucelabs');
|
|
444
|
+
|
|
344
445
|
require('jit-grunt')(grunt);
|
|
345
446
|
|
|
346
447
|
// Actually load this plugin's task(s).
|
|
@@ -358,7 +459,7 @@ module.exports = function (grunt) {
|
|
|
358
459
|
'uglify:dist'
|
|
359
460
|
]);
|
|
360
461
|
|
|
361
|
-
// Release Rhino Version
|
|
462
|
+
// Release Rhino Version (UNSUPPORTED)
|
|
362
463
|
grunt.registerTask('rhino', [
|
|
363
464
|
'browserify:rhino',
|
|
364
465
|
'concat:rhino',
|
|
@@ -407,23 +508,27 @@ module.exports = function (grunt) {
|
|
|
407
508
|
'sauce-after-setup'
|
|
408
509
|
]);
|
|
409
510
|
|
|
410
|
-
//
|
|
511
|
+
// var sauceTests = [];
|
|
512
|
+
// browserTests.map(function(testName) {
|
|
513
|
+
// sauceTests.push('saucelabs-jasmine:' + testName);
|
|
514
|
+
// });
|
|
515
|
+
|
|
411
516
|
grunt.registerTask('sauce-after-setup', [
|
|
412
|
-
'saucelabs-jasmine',
|
|
517
|
+
'saucelabs-jasmine:all',
|
|
413
518
|
'clean:sauce_log'
|
|
414
519
|
]);
|
|
415
520
|
|
|
416
521
|
var testTasks = [
|
|
417
522
|
'clean',
|
|
418
|
-
'
|
|
419
|
-
'jscs',
|
|
523
|
+
'eslint',
|
|
420
524
|
'shell:test',
|
|
525
|
+
'shell:plugin',
|
|
421
526
|
'browsertest'
|
|
422
527
|
];
|
|
423
528
|
|
|
424
529
|
if (isNaN(Number(process.env.TRAVIS_PULL_REQUEST, 10)) &&
|
|
425
|
-
Number(process.env.TRAVIS_NODE_VERSION) ===
|
|
426
|
-
(process.env.TRAVIS_BRANCH === "master" || process.env.TRAVIS_BRANCH === "
|
|
530
|
+
Number(process.env.TRAVIS_NODE_VERSION) === 4 &&
|
|
531
|
+
(process.env.TRAVIS_BRANCH === "master" || process.env.TRAVIS_BRANCH === "3.x")) {
|
|
427
532
|
testTasks.push("force:on");
|
|
428
533
|
testTasks.push("sauce-after-setup");
|
|
429
534
|
testTasks.push("force:off");
|
|
@@ -433,7 +538,7 @@ module.exports = function (grunt) {
|
|
|
433
538
|
grunt.registerTask('test', testTasks);
|
|
434
539
|
|
|
435
540
|
// Run all tests
|
|
436
|
-
grunt.registerTask('quicktest', testTasks.slice(0,
|
|
541
|
+
grunt.registerTask('quicktest', testTasks.slice(0, -1));
|
|
437
542
|
|
|
438
543
|
// generate a good test environment for testing sourcemaps
|
|
439
544
|
grunt.registerTask('sourcemap-test', [
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
[](http://badge.fury.io/js/less) [](https://travis-ci.org/less/less.js)
|
|
2
|
-
|
|
3
|
-
[](https://saucelabs.com/u/less)
|
|
1
|
+
[](http://badge.fury.io/js/less) [](https://travis-ci.org/less/less.js) [](https://ci.appveyor.com/project/lukeapage/less-js/branch/master) [](https://david-dm.org/less/less.js) [](https://david-dm.org/less/less.js#info=devDependencies) [](https://david-dm.org/less/less.js#info=optionalDependencies) [](https://twitter.com/lesstocss) [](https://gitter.im/less/less.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) <sup>Chat with Less.js users</sup>
|
|
2
|
+
|
|
3
|
+
[](https://saucelabs.com/u/less)
|
|
4
4
|
|
|
5
5
|
# [Less.js](http://lesscss.org)
|
|
6
6
|
|
|
@@ -8,8 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
This is the JavaScript, official, stable version of Less.
|
|
10
10
|
|
|
11
|
-
###### :point_right: [](https://gitter.im/less/less.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) <sup>Chat with Less.js users</sup>
|
|
12
|
-
|
|
13
11
|
|
|
14
12
|
## Getting Started
|
|
15
13
|
|
|
@@ -47,10 +45,10 @@ See the [changelog](CHANGELOG.md)
|
|
|
47
45
|
|
|
48
46
|
## [License](LICENSE)
|
|
49
47
|
|
|
50
|
-
Copyright (c) 2009-
|
|
48
|
+
Copyright (c) 2009-2017 [Alexis Sellier](http://cloudhead.io) & The Core Less Team
|
|
51
49
|
Licensed under the [Apache License](LICENSE).
|
|
52
50
|
|
|
53
51
|
|
|
54
|
-
[so]: http://stackoverflow.com/questions/tagged/
|
|
52
|
+
[so]: http://stackoverflow.com/questions/tagged/less "StackOverflow.com"
|
|
55
53
|
[issues]: https://github.com/less/less.js/issues "GitHub Issues for Less.js"
|
|
56
54
|
[download]: https://github.com/less/less.js/zipball/master "Download Less.js"
|
package/appveyor.yml
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
# Test against these versions of Node.js.
|
|
2
2
|
environment:
|
|
3
3
|
matrix:
|
|
4
|
-
- nodejs_version: "0.10"
|
|
5
|
-
- nodejs_version: "0.12"
|
|
6
4
|
- nodejs_version: "4"
|
|
7
5
|
- nodejs_version: "6"
|
|
6
|
+
- nodejs_version: "8"
|
|
7
|
+
- nodejs_version: "9"
|
|
8
8
|
|
|
9
9
|
# Install scripts. (runs after repo cloning)
|
|
10
10
|
install:
|
|
11
|
-
#
|
|
12
|
-
|
|
13
|
-
#
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
- npm
|
|
17
|
-
|
|
18
|
-
- npm install
|
|
11
|
+
# node 0.10 & 0.12 have race condition issues when running custom install scripts
|
|
12
|
+
# this can cause phantomjs-prebuilt install script to fail with the error:
|
|
13
|
+
# <Cannot find module 'boom'>
|
|
14
|
+
# Seems related to: https://github.com/npm/npm/issues/8152
|
|
15
|
+
# using <appveyor_retry> solves this.
|
|
16
|
+
- appveyor-retry call npm install
|
|
17
|
+
|
|
19
18
|
# Grunt-specific stuff.
|
|
20
19
|
- npm install -g grunt-cli
|
|
21
20
|
|