mirror of
https://github.com/jquery/sizzle.git
synced 2025-12-28 04:43:44 +00:00
Release: Make Sizzle work with jquery-release, remove generated files
Running `grunt` will now just build Sizzle, do a size comparison & run ESLint, similarly to what we do in jQuery. `grunt test` is used to run unit tests and it requires running `grunt` or `grunt build` before to generate the built Sizzle version. Fixes gh-239 Closes gh-467
This commit is contained in:
parent
6812dd07a7
commit
096f6836d4
4
.gitignore
vendored
4
.gitignore
vendored
@ -8,3 +8,7 @@
|
|||||||
node_modules
|
node_modules
|
||||||
bower_components
|
bower_components
|
||||||
.idea/
|
.idea/
|
||||||
|
|
||||||
|
# Ignore everything in dist folder except for eslint config
|
||||||
|
/dist/*
|
||||||
|
!/dist/.eslintrc.json
|
||||||
|
|||||||
@ -277,7 +277,6 @@ module.exports = function( grunt ) {
|
|||||||
] );
|
] );
|
||||||
grunt.registerTask( "default", [
|
grunt.registerTask( "default", [
|
||||||
"build",
|
"build",
|
||||||
"tests",
|
|
||||||
"compare_size",
|
"compare_size",
|
||||||
"eslint:dist"
|
"eslint:dist"
|
||||||
] );
|
] );
|
||||||
|
|||||||
@ -8,20 +8,13 @@ module.exports = function( Release ) {
|
|||||||
];
|
];
|
||||||
|
|
||||||
Release.define( {
|
Release.define( {
|
||||||
|
cdnPublish: false,
|
||||||
npmPublish: true,
|
npmPublish: true,
|
||||||
issueTracker: "github",
|
issueTracker: "github",
|
||||||
|
|
||||||
generateArtifacts: function( done ) {
|
generateArtifacts: function( done ) {
|
||||||
Release.exec( "grunt", "Grunt command failed" );
|
Release.exec( "grunt", "Grunt command failed" );
|
||||||
done( files );
|
done( files );
|
||||||
},
|
|
||||||
|
|
||||||
// TODO Add Sizzle to the CDN, or add public opt-out interfaces to jquery-release
|
|
||||||
_copyCdnArtifacts: function() {
|
|
||||||
console.warn( "Skipping CDN artifact copy." );
|
|
||||||
},
|
|
||||||
_pushToCdn: function() {
|
|
||||||
console.warn( "Skipping CDN push." );
|
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
|||||||
2478
dist/sizzle.js
vendored
2478
dist/sizzle.js
vendored
File diff suppressed because it is too large
Load Diff
3
dist/sizzle.min.js
vendored
3
dist/sizzle.min.js
vendored
File diff suppressed because one or more lines are too long
1
dist/sizzle.min.map
vendored
1
dist/sizzle.min.map
vendored
File diff suppressed because one or more lines are too long
@ -66,7 +66,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npm install && grunt",
|
"build": "npm install && grunt",
|
||||||
"start": "grunt start",
|
"start": "grunt start",
|
||||||
"test": "grunt test"
|
"test": "grunt && grunt test"
|
||||||
},
|
},
|
||||||
"commitplease": {
|
"commitplease": {
|
||||||
"components": [
|
"components": [
|
||||||
|
|||||||
@ -1,49 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
|
|
||||||
var exec = require( "child_process" ).exec;
|
|
||||||
|
|
||||||
module.exports = function( grunt ) {
|
|
||||||
var rpreversion = /(\d\.\d+\.\d+)-pre/;
|
|
||||||
|
|
||||||
grunt.registerTask( "release",
|
|
||||||
"Release a version of sizzle, updates a pre version to released, " +
|
|
||||||
"inserts `next` as the new pre version", function( next ) {
|
|
||||||
|
|
||||||
if ( !rpreversion.test( next ) ) {
|
|
||||||
grunt.fatal( "Next version should be a -pre version (x.x.x-pre): " + next );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var done,
|
|
||||||
version = grunt.config( "pkg.version" );
|
|
||||||
if ( !rpreversion.test( version ) ) {
|
|
||||||
grunt.fatal( "Existing version is not a pre version: " + version );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
version = version.replace( rpreversion, "$1" );
|
|
||||||
|
|
||||||
done = this.async();
|
|
||||||
exec( "git diff --quiet HEAD", function( err ) {
|
|
||||||
if ( err ) {
|
|
||||||
grunt.fatal(
|
|
||||||
"The working directory should be clean when releasing. Commit or stash changes."
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Build to dist directories along with a map and tag the release
|
|
||||||
grunt.task.run( [
|
|
||||||
|
|
||||||
// Commit new version
|
|
||||||
"version:" + version,
|
|
||||||
|
|
||||||
// Tag new version
|
|
||||||
"tag:" + version,
|
|
||||||
|
|
||||||
// Commit next version
|
|
||||||
"version:" + next
|
|
||||||
] );
|
|
||||||
done();
|
|
||||||
} );
|
|
||||||
} );
|
|
||||||
};
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
|
|
||||||
var exec = require( "child_process" ).exec;
|
|
||||||
|
|
||||||
module.exports = function( grunt ) {
|
|
||||||
grunt.registerTask( "tag", "Tag the specified version", function( version ) {
|
|
||||||
exec( "git tag " + version, this.async() );
|
|
||||||
} );
|
|
||||||
};
|
|
||||||
@ -1,40 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
|
|
||||||
var exec = require( "child_process" ).exec;
|
|
||||||
|
|
||||||
module.exports = function( grunt ) {
|
|
||||||
grunt.registerTask( "version", "Commit a new version", function( version ) {
|
|
||||||
if ( !/\d\.\d+\.\d+(?:-pre)?/.test( version ) ) {
|
|
||||||
grunt.fatal( "Version must follow semver release format: " + version );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var done = this.async(),
|
|
||||||
files = grunt.config( "version.files" ),
|
|
||||||
rversion = /("version":\s*")[^"]+/;
|
|
||||||
|
|
||||||
// Update version in specified files
|
|
||||||
files.forEach( function( filename ) {
|
|
||||||
var text = grunt.file.read( filename );
|
|
||||||
text = text.replace( rversion, "$1" + version );
|
|
||||||
grunt.file.write( filename, text );
|
|
||||||
} );
|
|
||||||
|
|
||||||
// Add files to git index
|
|
||||||
exec( "git add -A", function( err ) {
|
|
||||||
if ( err ) {
|
|
||||||
grunt.fatal( err );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Commit next pre version
|
|
||||||
grunt.config( "pkg.version", version );
|
|
||||||
grunt.task.run( [
|
|
||||||
"build",
|
|
||||||
"tests",
|
|
||||||
"commit:'Release\\: Update version to " + version + "'"
|
|
||||||
] );
|
|
||||||
done();
|
|
||||||
} );
|
|
||||||
} );
|
|
||||||
};
|
|
||||||
Loading…
Reference in New Issue
Block a user