Skip to content

Commit

Permalink
3.11.0 (#3468)
Browse files Browse the repository at this point in the history
* Update tests to Mocha / Chai / Headless Chrome
* Remove old Jasmine files
* Fix plugin tests cross-platform
* Fix errors for Node 8
* Remove PhantomJS references and libs
* Remove unnecessary less-node file caching
* Add browser benchmark comparison test
  • Loading branch information
matthew-dean committed May 5, 2020
1 parent 9217936 commit 0c68b2b
Show file tree
Hide file tree
Showing 109 changed files with 6,113 additions and 652 deletions.
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: less
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
21 changes: 0 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,12 @@
language: node_js
cache:
directories:
- travis-phantomjs
node_js:
- "9"
- "8"
- "6"
before_install:
# from https://github.com/travis-ci/travis-ci/issues/3225#issuecomment-177592725
# and also from https://github.com/travis-ci/travis-ci/issues/3225#issuecomment-200965782
- phantomjs --version
- export PATH=$PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH
- phantomjs --version
# Clear cache and download new copy of PhantomJS if the current version doesn't match 2.1.1.
- "if [ $(phantomjs --version) != '2.1.1' ]; then rm -rf $PWD/travis-phantomjs; mkdir -p $PWD/travis-phantomjs; fi"
- "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"
- "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"
- phantomjs --version
install:
- npm install -g grunt-cli
# node 0.10 & 0.12 have race condition issues when running custom install scripts
# this can cause phantomjs-prebuilt install script to fail with the error:
# <Cannot find module 'boom'>
# Seems related to: https://github.com/npm/npm/issues/8152
# using <travis_retry> solves this.
- travis_retry npm install
env:
global:
- PHANTOMJS_CDNURL=http://cnpmjs.org/downloads
- secure: TrNVruWYaUK5ALga1y7wRY+MLjWJECUSCsBmKW5EUmIevOUxqHWu7M89FANKxstEeFRRAGH3QJbloRxnzIgh0U0ah5npE9XA1bYXGO5khoXeIyk7pNRfjIo8aEnJH1Vp8vWA6J6ovxdJ7lCFKEGvGKxGde50knVl7KFVVULlX2U=
- secure: Rzh+CEI7YRvvVkOruPE8Z0dkU0s13V6b6cpqbN72vxbJl/Jm5PUZkjTFJdkWJrW3ErhCKX6EC7XdGvrclqEA9WAqKzrecqCJYqTnw4MwqiAj6F9wqE/BqhoWg4xPxm0MK/7eJMvLCgjNpe+gc1CaeFJZkLSNWn6nOFke+vVlf9Q=
sudo: false
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ _Pull requests are encouraged!_
* Start by adding a feature request to get feedback and see how your idea is received.
* If your pull request solves an existing issue, but it's different in some way, _please create a new issue_ and make sure to discuss it with the core contributors. Otherwise you risk your hard work being rejected.
* Do not change the **./dist/** folder, we do this when releasing
* _Please add tests_ for your work. Tests are invoked using `npm test` command. It will run both node.js tests and browser ([PhantomJS](http://phantomjs.org/)) tests.
* _Please add tests_ for your work. Tests are invoked using `npm test` command. It will run both node.js tests and browser (Headless Chrome) tests.

### Coding Standards

* Always use spaces, never tabs
* End lines in semi-colons.
* Loosely aim towards jsHint standards
* Loosely aim towards eslint standards


## Developing
Expand Down
238 changes: 38 additions & 200 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ module.exports = function (grunt) {
test: {
command: 'node test/index.js'
},
generatebrowser: {
command: 'node test/browser/generator/generate.js'
},
runbrowser: {
command: 'node test/browser/generator/runner.js'
},
benchmark: {
command: 'node benchmark/index.js'
},
Expand Down Expand Up @@ -288,178 +294,7 @@ module.exports = function (grunt) {
}
},

jasmine: {
options: {
keepRunner: true,
host: 'http://localhost:8081/',
vendor: [
'./node_modules/phantomjs-polyfill-object-assign/object-assign-polyfill.js',
'test/browser/vendor/promise.js',
'test/browser/jasmine-jsreporter.js',
'test/browser/common.js',
'test/browser/less.js'
],
template: 'test/browser/test-runner-template.tmpl'
},
main: {
// src is used to build list of less files to compile
src: [
'test/less/*.less',
'!test/less/plugin-preeval.less', // uses ES6 syntax
// Don't test NPM import, obviously
'!test/less/plugin-module.less',
'!test/less/import-module.less',
'!test/less/javascript.less',
'!test/less/urls.less',
'!test/less/empty.less'
],
options: {
helpers: 'test/browser/runner-main-options.js',
specs: 'test/browser/runner-main-spec.js',
outfile: 'tmp/browser/test-runner-main.html'
}
},
legacy: {
src: ['test/less/legacy/*.less'],
options: {
helpers: 'test/browser/runner-legacy-options.js',
specs: 'test/browser/runner-legacy-spec.js',
outfile: 'tmp/browser/test-runner-legacy.html'
}
},
strictUnits: {
src: ['test/less/strict-units/*.less'],
options: {
helpers: 'test/browser/runner-strict-units-options.js',
specs: 'test/browser/runner-strict-units-spec.js',
outfile: 'tmp/browser/test-runner-strict-units.html'
}
},
errors: {
src: ['test/less/errors/*.less', '!test/less/errors/javascript-error.less', 'test/browser/less/errors/*.less'],
options: {
timeout: 20000,
helpers: 'test/browser/runner-errors-options.js',
specs: 'test/browser/runner-errors-spec.js',
outfile: 'tmp/browser/test-runner-errors.html'
}
},
noJsErrors: {
src: ['test/less/no-js-errors/*.less'],
options: {
helpers: 'test/browser/runner-no-js-errors-options.js',
specs: 'test/browser/runner-no-js-errors-spec.js',
outfile: 'tmp/browser/test-runner-no-js-errors.html'
}
},
browser: {
src: ['test/browser/less/*.less', 'test/browser/less/plugin/*.less'],
options: {
helpers: 'test/browser/runner-browser-options.js',
specs: 'test/browser/runner-browser-spec.js',
outfile: 'tmp/browser/test-runner-browser.html'
}
},
relativeUrls: {
src: ['test/browser/less/relative-urls/*.less'],
options: {
helpers: 'test/browser/runner-relative-urls-options.js',
specs: 'test/browser/runner-relative-urls-spec.js',
outfile: 'tmp/browser/test-runner-relative-urls.html'
}
},
rewriteUrls: {
src: ['test/browser/less/rewrite-urls/*.less'],
options: {
helpers: 'test/browser/runner-rewrite-urls-options.js',
specs: 'test/browser/runner-rewrite-urls-spec.js',
outfile: 'tmp/browser/test-runner-rewrite-urls.html'
}
},
rootpath: {
src: ['test/browser/less/rootpath/*.less'],
options: {
helpers: 'test/browser/runner-rootpath-options.js',
specs: 'test/browser/runner-rootpath-spec.js',
outfile: 'tmp/browser/test-runner-rootpath.html'
}
},
rootpathRelative: {
src: ['test/browser/less/rootpath-relative/*.less'],
options: {
helpers: 'test/browser/runner-rootpath-relative-options.js',
specs: 'test/browser/runner-rootpath-relative-spec.js',
outfile: 'tmp/browser/test-runner-rootpath-relative.html'
}
},
rootpathRewriteUrls: {
src: ['test/browser/less/rootpath-rewrite-urls/*.less'],
options: {
helpers: 'test/browser/runner-rootpath-rewrite-urls-options.js',
specs: 'test/browser/runner-rootpath-rewrite-urls-spec.js',
outfile: 'tmp/browser/test-runner-rootpath-rewrite-urls.html'
}
},
production: {
src: ['test/browser/less/production/*.less'],
options: {
helpers: 'test/browser/runner-production-options.js',
specs: 'test/browser/runner-production-spec.js',
outfile: 'tmp/browser/test-runner-production.html'
}
},
modifyVars: {
src: ['test/browser/less/modify-vars/*.less'],
options: {
helpers: 'test/browser/runner-modify-vars-options.js',
specs: 'test/browser/runner-modify-vars-spec.js',
outfile: 'tmp/browser/test-runner-modify-vars.html'
}
},
globalVars: {
src: ['test/browser/less/global-vars/*.less'],
options: {
helpers: 'test/browser/runner-global-vars-options.js',
specs: 'test/browser/runner-global-vars-spec.js',
outfile: 'tmp/browser/test-runner-global-vars.html'
}
},
postProcessorPlugin: {
src: ['test/less/postProcessorPlugin/*.less'],
options: {
helpers: ['test/plugins/postprocess/index.js','test/browser/runner-postProcessorPlugin-options.js'],
specs: 'test/browser/runner-postProcessorPlugin.js',
outfile: 'tmp/browser/test-runner-post-processor-plugin.html'
}
},
preProcessorPlugin: {
src: ['test/less/preProcessorPlugin/*.less'],
options: {
helpers: ['test/plugins/preprocess/index.js','test/browser/runner-preProcessorPlugin-options.js'],
specs: 'test/browser/runner-preProcessorPlugin.js',
outfile: 'tmp/browser/test-runner-pre-processor-plugin.html'
}
},
visitorPlugin: {
src: ['test/less/visitorPlugin/*.less'],
options: {
helpers: ['test/plugins/visitor/index.js','test/browser/runner-VisitorPlugin-options.js'],
specs: 'test/browser/runner-VisitorPlugin.js',
outfile: 'tmp/browser/test-runner-visitor-plugin.html'
}
},
filemanagerPlugin: {
src: ['test/less/filemanagerPlugin/*.less'],
options: {
helpers: ['test/plugins/filemanager/index.js','test/browser/runner-filemanagerPlugin-options.js'],
specs: 'test/browser/runner-filemanagerPlugin.js',
outfile: 'tmp/browser/test-runner-filemanager-plugin.html'
}
}
},

'saucelabs-jasmine': sauceJobs,

"saucelabs-mocha": sauceJobs,

// Clean the version of less built for the tests
clean: {
Expand Down Expand Up @@ -494,17 +329,17 @@ module.exports = function (grunt) {
]);

// Run all browser tests
grunt.registerTask('browsertest', [
'browsertest-lessjs',
'connect',
'jasmine'
grunt.registerTask("browsertest", [
"browsertest-lessjs",
"connect",
"shell:runbrowser"
]);

// setup a web server to run the browser tests in a browser rather than phantom
grunt.registerTask('browsertest-server', [
'browsertest-lessjs',
'jasmine::build',
'connect::keepalive'
grunt.registerTask("browsertest-server", [
"browsertest-lessjs",
"shell:generatebrowser",
"connect::keepalive"
]);

var previous_force_state = grunt.option('force');
Expand All @@ -521,33 +356,36 @@ module.exports = function (grunt) {
}
});

grunt.registerTask('sauce', [
'browsertest-lessjs',
'jasmine::build',
'connect',
'sauce-after-setup'
grunt.registerTask("sauce", [
"browsertest-lessjs",
"shell:generatebrowser",
"connect",
"sauce-after-setup"
]);

grunt.registerTask('sauce-after-setup', [
'saucelabs-jasmine:all',
'clean:sauce_log'
grunt.registerTask("sauce-after-setup", [
"saucelabs-mocha:all",
"clean:sauce_log"
]);

var testTasks = [
'clean',
'eslint',
'shell:test',
'shell:opts',
'shell:plugin',
'browsertest'
"clean",
"eslint",
"shell:testbuild",
"shell:test",
"shell:opts",
"shell:plugin",
"connect",
"shell:runbrowser"
];

if (isNaN(Number(process.env.TRAVIS_PULL_REQUEST, 10)) &&
Number(process.env.TRAVIS_NODE_VERSION) === 4 &&
(process.env.TRAVIS_BRANCH === 'master' || process.env.TRAVIS_BRANCH === '3.x')) {
testTasks.push('force:on');
testTasks.push('sauce-after-setup');
testTasks.push('force:off');
if (
isNaN(Number(process.env.TRAVIS_PULL_REQUEST, 10)) &&
(process.env.TRAVIS_BRANCH === "master")
) {
testTasks.push("force:on");
testTasks.push("sauce-after-setup");
testTasks.push("force:off");
}

// Run all tests
Expand Down
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p align="center"><img src="http://lesscss.org/public/img/less_logo.png" width="264" height="117">

<p align="center"><a href="http://badge.fury.io/js/less"><img src="https://badge.fury.io/js/less.svg"></a> <a href="https://travis-ci.org/less/less.js"><img src="https://travis-ci.org/less/less.js.svg?branch=master" style="max-width:100%;"></a> <a href="https://ci.appveyor.com/project/lukeapage/less-js/branch/master"><img src="https://ci.appveyor.com/api/projects/status/bx2qspy3qbuxpl9q/branch/master?svg=true" style="max-width:100%;"></a> <a href="https://david-dm.org/less/less.js"><img src="https://david-dm.org/less/less.js.svg" style="max-width:100%;"></a> <a href="https://david-dm.org/less/less.js#info=devDependencies"><img src="https://david-dm.org/less/less.js/dev-status.svg" style="max-width:100%;"></a> <a href="https://david-dm.org/less/less.js#info=optionalDependencies"><img alt="optionalDependency Status" src="https://david-dm.org/less/less.js/optional-status.svg" style="max-width:100%;"></a> <a href="https://twitter.com/lesstocss"><img alt="Twitter Follow" src="https://img.shields.io/twitter/follow/lesstocss.svg?style=flat-square" style="max-width:100%;"></a></p>
<p align="center"><a href="http://badge.fury.io/js/less"><a href="https://opencollective.com/less" alt="Financial Contributors on Open Collective"><img src="https://opencollective.com/less/all/badge.svg?label=financial+contributors" /></a> <img src="https://badge.fury.io/js/less.svg"></a> <a href="https://travis-ci.org/less/less.js"><img src="https://travis-ci.org/less/less.js.svg?branch=master" style="max-width:100%;"></a> <a href="https://ci.appveyor.com/project/lukeapage/less-js/branch/master"><img src="https://ci.appveyor.com/api/projects/status/bx2qspy3qbuxpl9q/branch/master?svg=true" style="max-width:100%;"></a> <a href="https://david-dm.org/less/less.js"><img src="https://david-dm.org/less/less.js.svg" style="max-width:100%;"></a> <a href="https://david-dm.org/less/less.js#info=devDependencies"><img src="https://david-dm.org/less/less.js/dev-status.svg" style="max-width:100%;"></a> <a href="https://david-dm.org/less/less.js#info=optionalDependencies"><img alt="optionalDependency Status" src="https://david-dm.org/less/less.js/optional-status.svg" style="max-width:100%;"></a> <a href="https://twitter.com/lesstocss"><img alt="Twitter Follow" src="https://img.shields.io/twitter/follow/lesstocss.svg?style=flat-square" style="max-width:100%;"></a></p>

<p align="center"><a href="https://gitter.im/less/less.js?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge&amp;utm_content=badge"><img src="https://badges.gitter.im/Join%20Chat.svg" style="max-width:100%;"></a> <br><sup class="rich-diff-level-one">Chat with Less.js users and contributors</sup></p>

Expand Down Expand Up @@ -47,6 +47,36 @@ Read [Developing Less](http://lesscss.org/usage/#developing-less).
## Release History
See the [changelog](CHANGELOG.md)

## Contributors

### Code Contributors

This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
<a href="https://github.com/less/less.js/graphs/contributors"><img src="https://opencollective.com/less/contributors.svg?width=890&button=false" /></a>

### Financial Contributors

Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/less/contribute)]

#### Individuals

<a href="https://opencollective.com/less"><img src="https://opencollective.com/less/individuals.svg?width=890"></a>

#### Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/less/contribute)]

<a href="https://opencollective.com/less/organization/0/website"><img src="https://opencollective.com/less/organization/0/avatar.svg"></a>
<a href="https://opencollective.com/less/organization/1/website"><img src="https://opencollective.com/less/organization/1/avatar.svg"></a>
<a href="https://opencollective.com/less/organization/2/website"><img src="https://opencollective.com/less/organization/2/avatar.svg"></a>
<a href="https://opencollective.com/less/organization/3/website"><img src="https://opencollective.com/less/organization/3/avatar.svg"></a>
<a href="https://opencollective.com/less/organization/4/website"><img src="https://opencollective.com/less/organization/4/avatar.svg"></a>
<a href="https://opencollective.com/less/organization/5/website"><img src="https://opencollective.com/less/organization/5/avatar.svg"></a>
<a href="https://opencollective.com/less/organization/6/website"><img src="https://opencollective.com/less/organization/6/avatar.svg"></a>
<a href="https://opencollective.com/less/organization/7/website"><img src="https://opencollective.com/less/organization/7/avatar.svg"></a>
<a href="https://opencollective.com/less/organization/8/website"><img src="https://opencollective.com/less/organization/8/avatar.svg"></a>
<a href="https://opencollective.com/less/organization/9/website"><img src="https://opencollective.com/less/organization/9/avatar.svg"></a>

## [License](LICENSE)

Copyright (c) 2009-2017 [Alexis Sellier](http://cloudhead.io) & The Core Less Team
Expand Down
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ install:
# <Cannot find module 'boom'>
# Seems related to: https://github.com/npm/npm/issues/8152
# using <appveyor_retry> solves this.

# change now that we're not using phantomjs?
- appveyor-retry call npm install

# Grunt-specific stuff.
Expand Down
Loading

0 comments on commit 0c68b2b

Please sign in to comment.