mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Build: Drop support for building on Node.js 0.12
Node.js 0.12 is no longer supported by upstream. So far we had to keep
a workaround that would skip running ESLint there (or even load its task)
as it no longer supports Node.js <4; the same applied to Node smoke tests
as jsdom has also dropped support for those old Node versions. Those
workarounds have been removed now.
Ref 030191ae32
Closes gh-3478
This commit is contained in:
parent
bd9145fa15
commit
d10ac0e532
@ -1,7 +1,6 @@
|
|||||||
language: node_js
|
language: node_js
|
||||||
sudo: false
|
sudo: false
|
||||||
node_js:
|
node_js:
|
||||||
- "0.12"
|
|
||||||
- "4"
|
- "4"
|
||||||
- "6"
|
- "6"
|
||||||
- "7"
|
- "7"
|
||||||
|
39
Gruntfile.js
39
Gruntfile.js
@ -13,15 +13,7 @@ module.exports = function( grunt ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var fs = require( "fs" ),
|
var fs = require( "fs" ),
|
||||||
gzip = require( "gzip-js" ),
|
gzip = require( "gzip-js" );
|
||||||
oldNode = /^v0\./.test( process.version );
|
|
||||||
|
|
||||||
// Support: Node.js <4
|
|
||||||
// Skip running tasks that dropped support for Node.js 0.12
|
|
||||||
// in this Node version.
|
|
||||||
function runIfNewNode( task ) {
|
|
||||||
return oldNode ? "print_old_node_message:" + task : task;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !grunt.option( "filename" ) ) {
|
if ( !grunt.option( "filename" ) ) {
|
||||||
grunt.option( "filename", "jquery.js" );
|
grunt.option( "filename", "jquery.js" );
|
||||||
@ -187,20 +179,11 @@ module.exports = function( grunt ) {
|
|||||||
} );
|
} );
|
||||||
|
|
||||||
// Load grunt tasks from NPM packages
|
// Load grunt tasks from NPM packages
|
||||||
// Support: Node.js <4
|
require( "load-grunt-tasks" )( grunt );
|
||||||
// Don't load the eslint task in old Node.js, it won't parse.
|
|
||||||
require( "load-grunt-tasks" )( grunt, {
|
|
||||||
pattern: oldNode ? [ "grunt-*", "!grunt-eslint" ] : [ "grunt-*" ]
|
|
||||||
} );
|
|
||||||
|
|
||||||
// Integrate jQuery specific tasks
|
// Integrate jQuery specific tasks
|
||||||
grunt.loadTasks( "build/tasks" );
|
grunt.loadTasks( "build/tasks" );
|
||||||
|
|
||||||
grunt.registerTask( "print_old_node_message", function() {
|
|
||||||
var task = [].slice.call( arguments ).join( ":" );
|
|
||||||
grunt.log.writeln( "Old Node.js detected, running the task \"" + task + "\" skipped..." );
|
|
||||||
} );
|
|
||||||
|
|
||||||
grunt.registerTask( "lint", [
|
grunt.registerTask( "lint", [
|
||||||
"jsonlint",
|
"jsonlint",
|
||||||
|
|
||||||
@ -208,20 +191,20 @@ module.exports = function( grunt ) {
|
|||||||
// would run the dist target first which would point to errors in the built
|
// would run the dist target first which would point to errors in the built
|
||||||
// file, making it harder to fix them. We want to check the built file only
|
// file, making it harder to fix them. We want to check the built file only
|
||||||
// if we already know the source files pass the linter.
|
// if we already know the source files pass the linter.
|
||||||
runIfNewNode( "eslint:dev" ),
|
"eslint:dev",
|
||||||
runIfNewNode( "eslint:dist" )
|
"eslint:dist"
|
||||||
] );
|
] );
|
||||||
|
|
||||||
grunt.registerTask( "lint:newer", [
|
grunt.registerTask( "lint:newer", [
|
||||||
"newer:jsonlint",
|
"newer:jsonlint",
|
||||||
|
|
||||||
// Don't replace it with just the task; see the above comment.
|
// Don't replace it with just the task; see the above comment.
|
||||||
runIfNewNode( "newer:eslint:dev" ),
|
"newer:eslint:dev",
|
||||||
runIfNewNode( "newer:eslint:dist" )
|
"newer:eslint:dist"
|
||||||
] );
|
] );
|
||||||
|
|
||||||
grunt.registerTask( "test:fast", runIfNewNode( "node_smoke_tests" ) );
|
grunt.registerTask( "test:fast", "node_smoke_tests" );
|
||||||
grunt.registerTask( "test:slow", runIfNewNode( "promises_aplus_tests" ) );
|
grunt.registerTask( "test:slow", "promises_aplus_tests" );
|
||||||
|
|
||||||
grunt.registerTask( "test", [
|
grunt.registerTask( "test", [
|
||||||
"test:fast",
|
"test:fast",
|
||||||
@ -230,7 +213,7 @@ module.exports = function( grunt ) {
|
|||||||
|
|
||||||
grunt.registerTask( "dev", [
|
grunt.registerTask( "dev", [
|
||||||
"build:*:*",
|
"build:*:*",
|
||||||
runIfNewNode( "newer:eslint:dev" ),
|
"newer:eslint:dev",
|
||||||
"newer:uglify",
|
"newer:uglify",
|
||||||
"remove_map_comment",
|
"remove_map_comment",
|
||||||
"dist:*",
|
"dist:*",
|
||||||
@ -238,12 +221,12 @@ module.exports = function( grunt ) {
|
|||||||
] );
|
] );
|
||||||
|
|
||||||
grunt.registerTask( "default", [
|
grunt.registerTask( "default", [
|
||||||
runIfNewNode( "eslint:dev" ),
|
"eslint:dev",
|
||||||
"build:*:*",
|
"build:*:*",
|
||||||
"uglify",
|
"uglify",
|
||||||
"remove_map_comment",
|
"remove_map_comment",
|
||||||
"dist:*",
|
"dist:*",
|
||||||
runIfNewNode( "eslint:dist" ),
|
"eslint:dist",
|
||||||
"test:fast",
|
"test:fast",
|
||||||
"compare_size"
|
"compare_size"
|
||||||
] );
|
] );
|
||||||
|
Loading…
Reference in New Issue
Block a user