[Pkg-javascript-commits] [node-buble] 01/01: use babel to build
Praveen Arimbrathodiyil
praveen at moszumanska.debian.org
Fri Sep 29 13:10:39 UTC 2017
This is an automated email from the git hooks/post-receive script.
praveen pushed a commit to branch babel
in repository node-buble.
commit abe8a3c7aa873fe652145653944a65773b64b4d1
Author: Pirate Praveen <praveen at debian.org>
Date: Fri Sep 29 18:39:59 2017 +0530
use babel to build
---
debian/control | 7 ++++---
debian/install | 2 +-
debian/patches/series | 2 ++
debian/patches/use-babel.patch | 34 ++++++++++++++++++++++++++++++++++
debian/patches/use-os-homedir.patch | 11 +++++++++++
debian/rules | 36 +++---------------------------------
6 files changed, 55 insertions(+), 37 deletions(-)
diff --git a/debian/control b/debian/control
index 832718d..0388721 100644
--- a/debian/control
+++ b/debian/control
@@ -6,14 +6,15 @@ Uploaders: Julien Puydt <julien.puydt at laposte.net>
Build-Depends: debhelper (>= 10),
node-acorn (>= 3.3.0),
node-acorn-jsx (>= 3.0.1),
- node-acorn-object-spread,
- node-acorn-object-spread (>= 1.0.0),
+#node-acorn-object-spread (>= 1.0.0),
node-chalk (>= 1.1.3),
node-es6-module-transpiler,
node-magic-string (>= 0.14.0),
node-minimist (>= 1.2.0),
node-regexpu-core,
- nodejs (>= 6)
+ nodejs (>= 6),
+ node-babel-cli,
+ node-babel-preset-es2015
Standards-Version: 4.1.0
Homepage: https://gitlab.com/Rich-Harris/buble#README
Vcs-Git: https://anonscm.debian.org/git/pkg-javascript/node-buble.git
diff --git a/debian/install b/debian/install
index 89171b7..e67a1ff 100644
--- a/debian/install
+++ b/debian/install
@@ -1,4 +1,4 @@
bin usr/lib/nodejs/buble/
-dist usr/lib/nodejs/buble/
+lib usr/lib/nodejs/buble/
package.json usr/lib/nodejs/buble/
register.js usr/lib/nodejs/buble/
diff --git a/debian/patches/series b/debian/patches/series
index 54cc8b9..fce3e4b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,3 @@
find_acorn
+use-babel.patch
+use-os-homedir.patch
diff --git a/debian/patches/use-babel.patch b/debian/patches/use-babel.patch
new file mode 100644
index 0000000..a4a3dc3
--- /dev/null
+++ b/debian/patches/use-babel.patch
@@ -0,0 +1,34 @@
+--- a/package.json
++++ b/package.json
+@@ -2,7 +2,7 @@
+ "name": "buble",
+ "version": "0.15.2",
+ "description": "The blazing fast, batteries-included ES2015 compiler",
+- "main": "dist/buble.umd.js",
++ "main": "lib/index.js",
+ "jsnext:main": "dist/buble.es.js",
+ "files": [
+ "bin",
+--- /dev/null
++++ b/.babelrc
+@@ -0,0 +1,20 @@
++{
++ "presets": [
++ ["es2015", {
++ "loose": false,
++ }],
++ ],
++ "env": {
++ "watch": {
++ "presets": [
++ ["es2015", {
++ "loose": true
++ }],
++ "stage-0"
++ ]
++ },
++ "test": {
++ "plugins": ["istanbul"]
++ }
++ }
++}
diff --git a/debian/patches/use-os-homedir.patch b/debian/patches/use-os-homedir.patch
new file mode 100644
index 0000000..7fa80f0
--- /dev/null
+++ b/debian/patches/use-os-homedir.patch
@@ -0,0 +1,11 @@
+--- a/register.js
++++ b/register.js
+@@ -1,7 +1,7 @@
+ var fs = require( 'fs' );
+ var path = require( 'path' );
+ var crypto = require( 'crypto' );
+-var homedir = require( 'os-homedir' );
++var homedir = require( 'os' ).homedir();
+ var buble = require( './' );
+
+ var original = require.extensions[ '.js' ];
diff --git a/debian/rules b/debian/rules
index f2cfc5b..e4a9414 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,40 +1,10 @@
#!/usr/bin/make -f
-SOURCES = $(shell find src/ -name "*.js")
-
-TARGETS = $(subst src, dist, $(SOURCES))
-
-COMPILE_MODULES = compile-modules convert -f commonjs
-
-ESCAPER = s/`\([^`]*\)`\([^`]*\)`\([^`]*\)`/`\1\\`\2\\`\3`/g
-
-.PHONY: dist
-
-%.js:
- $(COMPILE_MODULES) $(subst dist, src, $@) > $@
- sed -i $@ -e "s/exports\[\"default\"\]/module.exports/g"
- sed -i $@ -e "s/\[\"default\"\]//g"
- sed -i $@ -e "s/string\")/string\").default/g"
- sed -i $@ -e "s/\\$$//g"
-
%:
dh $@
-override_dh_auto_build: dist $(TARGETS)
- sed -i dist/program/types/index.js -e "s/\\$$//g"
- sed -i dist/index.js -e "s/acorn\([^ ]*\)\[\"default\"\]/acorn\1/g"
- sed -i dist/index.js -e "s|json\\$$\\$$.VERSION|json\\$$\\$$.version|g"
- # the next one moves the requires after the exports to break a loop
- sed -i dist/program/wrap.js -e '2{h;d};$${p;g}'
- sed -i bin/runBuble.js -e "s|../dist/buble.deps.js|../dist/index.js|"
- # the next ones fix issues with unescaped characters
- sed -i dist/program/types/ClassBody.js -e '123$(ESCAPER)'
- sed -i dist/program/types/ClassBody.js -e '157$(ESCAPER)'
- sed -i dist/program/types/ClassBody.js -e '162$(ESCAPER)'
- sed -i dist/program/types/ForStatement.js -e '31$(ESCAPER)'
-
-dist:
- mkdir -p dist/program/types/shared dist/utils
+override_dh_auto_build:
+ babeljs src -d lib
override_dh_auto_clean:
- rm -rf dist
+ rm -rf lib
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-buble.git
More information about the Pkg-javascript-commits
mailing list