[Pkg-javascript-commits] [node-umd] 08/18: Build examples

Bastien Roucariès rouca at moszumanska.debian.org
Mon Apr 17 07:38:17 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to tag debian-3.0.1+ds-1
in repository node-umd.

commit 5b36edce0aeac91bd39da2ef302a498d5dfa5ef0
Author: Bastien ROUCARIÈS <roucaries.bastien at gmail.com>
Date:   Fri Apr 14 14:54:50 2017 +0200

    Build examples
---
 debian/clean    |  1 +
 debian/examples |  1 +
 debian/rules    | 17 +++++++++++++++--
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/debian/clean b/debian/clean
index ff2b902..1452a79 100644
--- a/debian/clean
+++ b/debian/clean
@@ -1,2 +1,3 @@
 index.js
 template.min.js
+examples/*/bundle.js
\ No newline at end of file
diff --git a/debian/examples b/debian/examples
new file mode 100644
index 0000000..e39721e
--- /dev/null
+++ b/debian/examples
@@ -0,0 +1 @@
+examples/*
diff --git a/debian/rules b/debian/rules
index 6c14034..715e361 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,6 +4,8 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
+UMD=nodejs bin/cli.js
+
 %:
 	dh $@
 
@@ -22,5 +24,16 @@ else
 	@echo '**********************************************************'
 endif
 
-
-
+override_dh_installexamples:
+	$(UMD) -c common-js-module < examples/cjs/index.js > examples/cjs/bundle.js
+	$(UMD) common-js-module < examples/raw/index.js > examples/raw/bundle.js
+	$(UMD) Common-Js-Module < examples/constructor/index.js > examples/constructor/bundle.js
+	# test examples
+	nodejs -e "console.log(require('./examples/cjs/bundle')); \
+		   console.log(require('./examples/raw/bundle')); \
+		   console.log(require('./examples/constructor/bundle'));"
+	dh_installexamples
+	# remove build.js (non functionnal)
+	rm -f debian/node-umd/usr/share/doc/node-umd/examples/build.js
+	find $(CURDIR)/debian/node-umd/usr/share/doc/node-umd/examples/ -name '*.js' -exec \
+		sed -i "s,require\s*[(]\s*'[.][.][^']*'\s*[)],require('umd'),g" {} \;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-umd.git



More information about the Pkg-javascript-commits mailing list