[Pkg-javascript-commits] [jquery] 01/07: build with requirejs
Antonio Terceiro
terceiro at moszumanska.debian.org
Sat Aug 29 01:46:47 UTC 2015
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to branch master
in repository jquery.
commit 0b77493710dfd586056070a0f7fa81a9d10f9771
Author: Antonio Terceiro <terceiro at debian.org>
Date: Fri Aug 28 22:06:09 2015 -0300
build with requirejs
---
debian/build-1.11.3.txt | 78 -------------------------------
debian/build.js | 119 +++++++++++++++++++++++++++---------------------
debian/build.mk | 15 +++---
debian/changelog | 8 ++++
debian/control | 1 +
5 files changed, 84 insertions(+), 137 deletions(-)
diff --git a/debian/build-1.11.3.txt b/debian/build-1.11.3.txt
deleted file mode 100644
index f49e8f8..0000000
--- a/debian/build-1.11.3.txt
+++ /dev/null
@@ -1,78 +0,0 @@
-src/var/deletedIds.js
-src/var/slice.js
-src/var/concat.js
-src/var/push.js
-src/var/indexOf.js
-src/var/class2type.js
-src/var/toString.js
-src/var/hasOwn.js
-src/var/support.js
-src/core.js
-src/sizzle/dist/sizzle.js
-src/selector-sizzle.js
-src/selector.js
-src/traversing/var/rneedsContext.js
-src/core/var/rsingleTag.js
-src/traversing/findFilter.js
-src/core/init.js
-src/traversing.js
-src/var/rnotwhite.js
-src/callbacks.js
-src/deferred.js
-src/core/ready.js
-src/var/strundefined.js
-src/support.js
-src/data/support.js
-src/data/accepts.js
-src/data.js
-src/queue.js
-src/var/pnum.js
-src/css/var/cssExpand.js
-src/css/var/isHidden.js
-src/core/access.js
-src/manipulation/var/rcheckableType.js
-src/manipulation/support.js
-src/event/support.js
-src/event.js
-src/manipulation.js
-src/css/defaultDisplay.js
-src/effects/support.js
-src/css/var/rmargin.js
-src/css/var/rnumnonpx.js
-src/css/curCSS.js
-src/css/addGetHookIf.js
-src/css/support.js
-src/css/swap.js
-src/css.js
-src/effects/Tween.js
-src/effects.js
-src/queue/delay.js
-src/attributes/support.js
-src/attributes/val.js
-src/attributes/attr.js
-src/attributes/prop.js
-src/attributes/classes.js
-src/attributes.js
-src/event/alias.js
-src/ajax/var/nonce.js
-src/ajax/var/rquery.js
-src/ajax/parseJSON.js
-src/ajax/parseXML.js
-src/ajax.js
-src/manipulation/_evalUrl.js
-src/wrap.js
-src/css/hiddenVisibleSelectors.js
-src/serialize.js
-src/ajax/xhr.js
-src/ajax/script.js
-src/ajax/jsonp.js
-src/core/parseHTML.js
-src/ajax/load.js
-src/event/ajax.js
-src/effects/animatedSelector.js
-src/offset.js
-src/dimensions.js
-src/deprecated.js
-src/exports/amd.js
-src/exports/global.js
-src/jquery.js
diff --git a/debian/build.js b/debian/build.js
index 83e6a41..601c924 100644
--- a/debian/build.js
+++ b/debian/build.js
@@ -1,60 +1,73 @@
-var fs = require("fs");
-var path = require('path');
+/* This file is based on build/tasks/build.js
+ */
+({
+ baseUrl: "src",
+ name: "jquery",
+ out: "dist/jquery.js",
+ // We have multiple minify steps
+ optimize: "none",
+ // Include dependencies loaded with require
+ findNestedDependencies: true,
+ // Avoid breaking semicolons inserted by r.js
+ skipSemiColonInsertion: true,
+ wrap: {
+ startFile: "src/intro.js",
+ endFile: "src/outro.js"
+ },
+ paths: {
+ sizzle: "sizzle/dist/sizzle"
+ },
+ rawText: {},
+ /**
+ * Strip all definitions generated by requirejs
+ * Convert "var" modules to var declarations
+ * "var module" means the module only contains a return statement that should be converted to a var declaration
+ * This is indicated by including the file in any "var" folder
+ * @param {String} name
+ * @param {String} path
+ * @param {String} contents The contents to be written (including their AMD wrappers)
+ */
+ onBuildWrite: function( name, path, contents ) {
+ var rdefineEnd = /\}\);[^}\w]*$/;
+ var amdName;
+ // Convert var modules
+ if ( /.\/var\//.test( path ) ) {
+ contents = contents
+ .replace( /define\([\w\W]*?return/, "var " + (/var\/([\w-]+)/.exec(name)[1]) + " =" )
+ .replace( rdefineEnd, "" );
+ // Sizzle treatment
+ } else if ( /^sizzle$/.test( name ) ) {
+ contents = "var Sizzle =\n" + contents
+ // Remove EXPOSE lines from Sizzle
+ .replace( /\/\/\s*EXPOSE[\w\W]*\/\/\s*EXPOSE/, "return Sizzle;" );
-var rdefineEnd = /\}\);[^}\w]*$/;
+ } else {
-/* this function was copied from build/tasks/build.js */
-function convert(name, path, contents) {
- if ( /.\/var\//.test( path ) ) {
- contents = contents
- .replace( /define\([\w\W]*?return/, "var " + (/var\/([\w-]+)/.exec(name)[1]) + " =" )
- .replace( rdefineEnd, "" );
+ // Ignore jQuery's exports (the only necessary one)
+ if ( name !== "jquery" ) {
+ contents = contents
+ .replace( /\s*return\s+[^\}]+(\}\);[^\w\}]*)$/, "$1" )
+ // Multiple exports
+ .replace( /\s*exports\.\w+\s*=\s*\w+;/g, "" );
+ }
- // Sizzle treatment
- } else if ( /^sizzle$/.test( name ) ) {
- contents = "var Sizzle =\n" + contents
- // Remove EXPOSE lines from Sizzle
- .replace( /\/\/\s*EXPOSE[\w\W]*\/\/\s*EXPOSE/, "return Sizzle;" );
+ // Remove define wrappers, closure ends, and empty declarations
+ contents = contents
+ .replace( /define\([^{]*?{/, "" )
+ .replace( rdefineEnd, "" );
- } else {
-
- // Ignore jQuery's exports (the only necessary one)
- if ( name !== "jquery" ) {
- contents = contents
- .replace( /\s*return\s+[^\}]+(\}\);[^\w\}]*)$/, "$1" )
- // Multiple exports
- .replace( /\s*exports\.\w+\s*=\s*\w+;/g, "" );
- }
-
- // Remove define wrappers, closure ends, and empty declarations
- contents = contents
- .replace( /define\([^{]*?{/, "" )
- .replace( rdefineEnd, "" );
-
- // Remove anything wrapped with
- // /* ExcludeStart */ /* ExcludeEnd */
- // or a single line directly after a // BuildExclude comment
- contents = contents
- .replace( /\/\*\s*ExcludeStart\s*\*\/[\w\W]*?\/\*\s*ExcludeEnd\s*\*\//ig, "" )
- .replace( /\/\/\s*BuildExclude\n\r?[\w\W]*?\n\r?/ig, "" );
-
- // Remove empty definitions
- contents = contents
- .replace( /define\(\[[^\]]+\]\)[\W\n]+$/, "" );
- }
+ // Remove anything wrapped with
+ // /* ExcludeStart */ /* ExcludeEnd */
+ // or a single line directly after a // BuildExclude comment
+ contents = contents
+ .replace( /\/\*\s*ExcludeStart\s*\*\/[\w\W]*?\/\*\s*ExcludeEnd\s*\*\//ig, "" )
+ .replace( /\/\/\s*BuildExclude\n\r?[\w\W]*?\n\r?/ig, "" );
+ // Remove empty definitions
+ contents = contents
+ .replace( /define\(\[[^\]]+\]\)[\W\n]+$/, "" );
+ }
return contents;
-}
-
-process.argv.forEach(function (val, index, array) {
- if (index <= 1) { return; }
- var name = val
- .replace(/^src\/sizzle\/dist\//, '')
- .replace(/^src\//, '')
- .replace(/\.js$/, '');
- var contents = fs.readFileSync(val, { encoding: 'utf8' });
- var contents = convert(name, val, contents);
- console.log(contents);
-});
-
+ }
+})
diff --git a/debian/build.mk b/debian/build.mk
index 507df03..c794d77 100644
--- a/debian/build.mk
+++ b/debian/build.mk
@@ -1,13 +1,15 @@
-source = $(shell grep -v '^\s*\#' debian/build-$(version).txt)
+source = $(shell find src/ -name '*.js')
timestamp = $(shell date --iso-8601=minutes --utc --date="$(shell dpkg-parsechangelog -S Date)")
version = $(shell dpkg-parsechangelog -SVersion | cut -d + -f 1)
-install: dist/jquery.js dist/jquery.min.js dist/jquery.min.map
+build: dist/jquery.js dist/jquery.min.js dist/jquery.min.map
-dist/jquery.js: src/intro.js $(source) src/outro.js
- mkdir -p $(shell dirname $@)
- nodejs debian/build.js $^ > $@.in
- sed -e 's/@DATE/$(timestamp)/; s/@VERSION/$(version)/' $@.in > $@ || ($(RM) $@; false)
+build.js: debian/build.js
+ cp $< $@
+
+dist/jquery.js: build.js $(source)
+ nodejs /usr/lib/nodejs/r.js -o build.js
+ sed -i -e 's/@DATE/$(timestamp)/; s/@VERSION/$(version)/' $@
dist/jquery.min.js dist/jquery.min.map: dist/jquery.js
uglifyjs \
@@ -18,3 +20,4 @@ dist/jquery.min.js dist/jquery.min.map: dist/jquery.js
clean:
$(RM) -rf dist/
+ $(RM) build.js
diff --git a/debian/changelog b/debian/changelog
index 76c7085..ce6c565 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+jquery (1.11.3+dfsg-3) UNRELEASED; urgency=medium
+
+ * debian/build.mk: use node-requirejs to build, as intended by upstream
+ * debian/build.js: turned into a node-requirejs build file
+ * debian/control: Build-Depends: node-requirejs
+
+ -- Antonio Terceiro <terceiro at debian.org> Fri, 28 Aug 2015 22:04:51 -0300
+
jquery (1.11.3+dfsg-2) unstable; urgency=medium
* debian/build.mk: read date from changelog (Closes: #782899)
diff --git a/debian/control b/debian/control
index ee3d2d9..5ab5255 100644
--- a/debian/control
+++ b/debian/control
@@ -6,6 +6,7 @@ Uploaders: Marcelo Jorge Vieira (metal) <metal at debian.org>,
Steve Kemp <skx at debian.org>,
Antonio Terceiro <terceiro at debian.org>
Build-Depends: debhelper (>= 9~),
+ node-requirejs,
node-source-map,
node-uglify,
nodejs,
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/jquery.git
More information about the Pkg-javascript-commits
mailing list