package add

This commit is contained in:
duyyb 2019-12-16 09:59:25 +08:00
parent be53e4750d
commit 289d128384
4 changed files with 129 additions and 0 deletions

View File

@ -0,0 +1,60 @@
diff --git a/build/tasks/build.js b/build/tasks/build.js
index 69916bf..58e65ad 100644
--- a/build/tasks/build.js
+++ b/build/tasks/build.js
@@ -10,7 +10,6 @@ module.exports = function( grunt ) {
var fs = require( "fs" ),
requirejs = require( "requirejs" ),
- Insight = require( "insight" ),
pkg = require( "../../package.json" ),
srcFolder = __dirname + "/../../src/",
rdefineEnd = /\}\s*?\);[^}\w]*$/,
@@ -337,46 +336,16 @@ module.exports = function( grunt ) {
grunt.registerTask( "custom", function() {
var args = this.args,
modules = args.length ? args[ 0 ].replace( /,/g, ":" ) : "",
- done = this.async(),
- insight = new Insight( {
- trackingCode: "UA-1076265-4",
- pkg: pkg
- } );
+ done = this.async();
function exec( trackingAllowed ) {
- var tracks = args.length ? args[ 0 ].split( "," ) : [];
var defaultPath = [ "build", "custom" ];
- tracks = tracks.map( function( track ) {
- return track.replace( /\//g, "+" );
- } );
-
- if ( trackingAllowed ) {
-
- // Track individuals
- tracks.forEach( function( module ) {
- var path = defaultPath.concat( [ "individual" ], module );
-
- insight.track.apply( insight, path );
- } );
-
- // Track full command
- insight.track.apply( insight, defaultPath.concat( [ "full" ], tracks ) );
- }
-
grunt.task.run( [ "build:*:*" + ( modules ? ":" + modules : "" ), "uglify", "dist" ] );
done();
}
grunt.log.writeln( "Creating custom build...\n" );
- // Ask for permission the first time
- if ( insight.optOut === undefined ) {
- insight.askPermission( null, function( error, result ) {
- exec( result );
- } );
- } else {
- exec( !insight.optOut );
- }
} );
};

BIN
jquery-3.2.1.tar.gz Normal file

Binary file not shown.

View File

@ -0,0 +1,14 @@
diff --git a/Gruntfile.js b/Gruntfile.js
index 12ae008..5d541f2 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -12,8 +12,7 @@ module.exports = function( grunt ) {
return data;
}
- var fs = require( "fs" ),
- gzip = require( "gzip-js" );
+ var fs = require( "fs" );
if ( !grunt.option( "filename" ) ) {
grunt.option( "filename", "jquery.js" );

55
js-jquery.spec Normal file
View File

@ -0,0 +1,55 @@
Name: js-jquery
Version: 3.2.1
Release: 5
Summary: jQuery is a fast, small, and feature-rich JavaScript library
License: MIT
URL: https://jquery.com/
Source0: https://github.com/jquery/jquery/archive/%{version}/jquery-%{version}.tar.gz
Patch0001: %{name}-disable-gzip-js.patch
Patch0002: disable-insight-tracking.patch
BuildArch: noarch
BuildRequires: web-assets-devel nodejs-packaging js-sizzle-static npm(grunt-cli)
BuildRequires: npm(grunt-contrib-uglify) nodejs-grunt >= 0.4.4-3 npm(shelljs)
BuildRequires: npm(load-grunt-tasks) npm(requirejs) nodejs-strip-json-comments
Requires: web-assets-filesystem
Provides: jquery = %{version}-%{release} %{name}-static = %{version}-%{release}
Provides: js-jquery3 = %{version}-%{release} js-jquery2-static = %{version}-%{release}
%description
jQuery is a fast, small, and feature-rich JavaScript library. With easy-to-use APIs
(available in multiple browsers), iterating and manipulating HTML documents, event handling,
animation, and Ajax is much easier. With both versatility and extensibility, jQuery has changed
the way millions of people write JavaScript.
%prep
%autosetup -n jquery-%{version} -p1
rm -rf dist/* src/sizzle
install -Dp %{_jsdir}/sizzle/latest/sizzle.js src/sizzle/dist/sizzle.js
%build
%nodejs_symlink_deps --build
grunt -v 'build:*:*' uglify
%install
install -d %{buildroot}%{_jsdir}/jquery/%{version}
cp -p dist/* %{buildroot}%{_jsdir}/jquery/%{version}
install -d %{buildroot}%{_webassetdir}
ln -s ../javascript/jquery %{buildroot}%{_webassetdir}/jquery
ln -s %{version} %{buildroot}%{_jsdir}/jquery/latest
ln -s %{version} %{buildroot}%{_jsdir}/jquery/3
ln -s %{version} %{buildroot}%{_jsdir}/jquery/3.2
%files
%doc AUTHORS.txt CONTRIBUTING.md LICENSE.txt README.md
%{_jsdir}/jquery
%{_webassetdir}/jquery
%changelog
* Thu Dec 12 2019 duyeyu <duyeyu@huawei.com> - 3.2.1-5
- init package