[Pkg-javascript-commits] [acorn] 14/19: Remove libjs-acorn and compile with node-es6-module-transpiler

Julien Puydt julien.puydt at laposte.net
Fri Nov 25 08:13:26 UTC 2016


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

jpuydt-guest pushed a commit to branch master
in repository acorn.

commit 7d14bb30a9b5f912fa1867e376d177aa5d2d37b3
Author: Julien Puydt <julien.puydt at laposte.net>
Date:   Tue Nov 22 18:02:24 2016 +0100

    Remove libjs-acorn and compile with node-es6-module-transpiler
---
 debian/changelog            |  2 ++
 debian/control              | 28 ++++++----------------------
 debian/libjs-acorn.install  |  6 ------
 debian/node-acorn.install   |  5 +----
 debian/node-acorn.links     |  1 -
 debian/patches/nodejs.patch | 24 ------------------------
 debian/patches/series       |  1 -
 debian/rules                | 24 +++++++++++++++++++-----
 8 files changed, 28 insertions(+), 63 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index f2990b9..a4c3385 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,8 @@ acorn (4.0.3-1) UNRELEASED; urgency=medium
   * Use https for Vcs-* fields.
   * Bump standards-version to 3.9.8.
   * Rework d/copyright.
+  * Remove libjs-acorn package (it's unclear what it means now).
+  * Make the new sources compile with node-es6-module-transpiler.
 
  -- Julien Puydt <julien.puydt at laposte.net>  Tue, 15 Nov 2016 18:10:46 +0100
 
diff --git a/debian/control b/debian/control
index 0f693bb..a7569ac 100644
--- a/debian/control
+++ b/debian/control
@@ -4,42 +4,26 @@ Uploaders: Julien Puydt <julien.puydt at laposte.net>
 Section: web
 Priority: extra
 Build-Depends: debhelper (>= 10),
-               nodejs,
-               node-uglify,
                docbook2x,
-               docbook-xsl,
-               docbook-xml,
-               xsltproc
+               node-ast-types,
+               node-es6-module-transpiler,
+               node-graceful-fs,
+               nodejs
 Standards-Version: 3.9.8
 Vcs-Browser: https://anonscm.debian.org/cgit/pkg-javascript/acorn.git
 Vcs-Git: https://anonscm.debian.org/git/pkg-javascript/acorn.git
 Homepage: https://github.com/ternjs/acorn/
 
-Package: libjs-acorn
-Architecture: all
-Depends: ${misc:Depends}
-Recommends: javascript-common
-Description: ECMAScript parser for JavaScript
- Acorn is a tiny, fast JavaScript parser written in JavaScript.
- .
- acorn.js defines the main parser interface. The library also comes with a
- error-tolerant parser and an abstract syntax tree walker, defined in other
- files (acorn_loose.js & util/walk.js).
- .
- This package contains the acorn JavaScript files.
-
 Package: node-acorn
 Architecture: all
-Depends: ${misc:Depends},
-         nodejs
+Depends: nodejs, ${misc:Depends}
 Description: ECMAScript parser for Node.js
  Acorn is a tiny, fast JavaScript parser written in JavaScript.
  .
  acorn.js defines the main parser interface. The library also comes with a
  error-tolerant parser and an abstract syntax tree walker, defined in other
- files (acorn_loose.js & util/walk.js).
+ files.
  .
  This package contains the acorn module for Node.js.
  .
  Node.js is an event-based server-side JavaScript engine.
-
diff --git a/debian/libjs-acorn.install b/debian/libjs-acorn.install
deleted file mode 100644
index 1b131cf..0000000
--- a/debian/libjs-acorn.install
+++ /dev/null
@@ -1,6 +0,0 @@
-acorn.js           usr/share/javascript/acorn/
-acorn_loose.js     usr/share/javascript/acorn/
-acorn.min.js       usr/share/javascript/acorn/
-acorn_loose.min.js usr/share/javascript/acorn/
-util/              usr/share/javascript/acorn/
-walk.min.js        usr/share/javascript/acorn/util/
diff --git a/debian/node-acorn.install b/debian/node-acorn.install
index ea7897b..29b8cc0 100644
--- a/debian/node-acorn.install
+++ b/debian/node-acorn.install
@@ -1,5 +1,2 @@
+dist/* usr/lib/nodejs/acorn/
 package.json   usr/lib/nodejs/acorn/
-acorn.js       usr/lib/nodejs/acorn/
-acorn_loose.js usr/lib/nodejs/acorn/
-util/          usr/lib/nodejs/acorn/
-bin/acorn      usr/lib/nodejs/acorn/bin/
diff --git a/debian/node-acorn.links b/debian/node-acorn.links
deleted file mode 100644
index 090f0cd..0000000
--- a/debian/node-acorn.links
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/nodejs/acorn/bin/acorn usr/bin/acorn
diff --git a/debian/patches/nodejs.patch b/debian/patches/nodejs.patch
deleted file mode 100644
index 0216655..0000000
--- a/debian/patches/nodejs.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-Description: Switch NodeJS command from node (upstream) to nodejs (Debian).
-Author: Bas Couwenberg <sebastic at xs4all.nl>
-
---- a/bin/acorn
-+++ b/bin/acorn
-@@ -1,4 +1,4 @@
--#!/usr/bin/env node
-+#!/usr/bin/env nodejs
- 
- var path = require("path");
- var fs = require("fs");
---- a/package.json
-+++ b/package.json
-@@ -13,8 +13,8 @@
-     "licenses": [{"type": "MIT",
-                   "url": "http://marijnhaverbeke.nl/acorn/LICENSE"}],
-     "scripts": {
--      "test": "node test/run.js",
--      "prepublish": "node bin/without_eval > acorn_csp.js"
-+      "test": "nodejs test/run.js",
-+      "prepublish": "nodejs bin/without_eval > acorn_csp.js"
-     },
-     "bin": {"acorn": "./bin/acorn"},
-     "devDependencies": {"regenerate": "~0.6.2",
diff --git a/debian/patches/series b/debian/patches/series
deleted file mode 100644
index 81a5e8e..0000000
--- a/debian/patches/series
+++ /dev/null
@@ -1 +0,0 @@
-nodejs.patch
diff --git a/debian/rules b/debian/rules
index 243014b..c12369e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,23 +3,37 @@
 BUILD_DATE=$(shell dpkg-parsechangelog | sed -ne 's/^Date: //p' | LC_ALL=C date -u "+%d %B %Y" -f -)
 MANPAGES := $(wildcard debian/man/*.*.xml)
 
+SOURCES = $(shell find src/ -name "*.js")
+TARGETS = $(subst src, dist, $(SOURCES))
+COMPILE_MODULES = compile-modules convert -f commonjs -I/usr/lib/nodejs/graceful-fs -I/usr/lib/nodejs/ast-types/lib -Idist/
+
 %:
 	dh $@
 
 override_dh_clean:
 	dh_clean debian/man/*.1 *.min.js
 
-override_dh_auto_build:
+override_dh_auto_build: dist $(TARGETS)
 	# Create man page from DocBook XML
 	for x in $(MANPAGES) ; do \
 	    docbook2x-man --string-param header-3="$(BUILD_DATE)" $$x ; \
 	    mv `basename $$x | sed 's/.xml$$//'` `dirname $$x` ; \
 	done
 
-	# Minify Javascript
-	uglifyjs -o acorn.min.js acorn.js
-	uglifyjs -o acorn_loose.min.js acorn_loose.js
-	uglifyjs -o walk.min.js util/walk.js
+	# I guess rollup is better than node-es6-module-transpiler...
+	# but we don't have rollup (yet)
+	sed -i dist/index.js -e's/$$.tokTypes/$$.types/g'
+	sed -i dist/index.js -e 's/$$.tokContexts/$$.types/g'
+
+.PHONY: dist
+dist:
+	mkdir -p dist/bin
+	mkdir -p dist/loose
+	mkdir -p dist/walk
+	ln -s dist/index.js acorn.js
+
+%.js:
+	$(COMPILE_MODULES) $(subst dist, src, $@) > $@
 
 override_dh_auto_test:
 	nodejs test/run.js

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



More information about the Pkg-javascript-commits mailing list