[Pkg-javascript-commits] [node-es6-module-transpiler] 03/05: Add a patch to accept standard modules

Julien Puydt julien.puydt at laposte.net
Fri Jul 7 04:37:18 UTC 2017


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

jpuydt-guest pushed a commit to branch master
in repository node-es6-module-transpiler.

commit 5211b50b8dfcce3d76c39b2f7c5afd187702fa40
Author: Julien Puydt <julien.puydt at laposte.net>
Date:   Wed Jul 5 18:07:33 2017 +0200

    Add a patch to accept standard modules
---
 debian/changelog                             |  1 +
 debian/patches/accept_standard_modules.patch | 17 +++++++++++++++++
 debian/patches/series                        |  1 +
 lib/file_resolver.js                         |  4 ++++
 4 files changed, 23 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index ffe681b..10aab7c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ node-es6-module-transpiler (0.10.0-2) UNRELEASED; urgency=medium
 
   * Add a patch for better module detection.
   * Push standards-version to 4.0.0.
+  * Add a patch to detect standard modules.
 
  -- Julien Puydt <julien.puydt at laposte.net>  Wed, 05 Jul 2017 17:45:09 +0200
 
diff --git a/debian/patches/accept_standard_modules.patch b/debian/patches/accept_standard_modules.patch
new file mode 100644
index 0000000..5986935
--- /dev/null
+++ b/debian/patches/accept_standard_modules.patch
@@ -0,0 +1,17 @@
+Description: accept standard module without checking anything
+Author: Julien Puydt
+Forwarded: no
+
+--- a/lib/file_resolver.js
++++ b/lib/file_resolver.js
+@@ -60,6 +60,10 @@
+ FileResolver.prototype.resolvePath = function(importedPath, fromModule) {
+   var paths = this.paths;
+ 
++  if (importedPath === 'path') {
++    return importedPath;
++  }
++
+   if (importedPath[0] === '.' && fromModule) {
+     paths = [Path.dirname(fromModule.path)];
+   }
diff --git a/debian/patches/series b/debian/patches/series
index 043097d..b3abf23 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
+accept_standard_modules.patch
 detect_module_index.patch
 0001-On-Debian-systems-use-nodejs.patch
 0002-Workaround-for-upstream-issue-199.patch
diff --git a/lib/file_resolver.js b/lib/file_resolver.js
index 7a83989..bae8f72 100644
--- a/lib/file_resolver.js
+++ b/lib/file_resolver.js
@@ -60,6 +60,10 @@ FileResolver.prototype.resolveModule = function(importedPath, fromModule, contai
 FileResolver.prototype.resolvePath = function(importedPath, fromModule) {
   var paths = this.paths;
 
+  if (importedPath === 'path') {
+    return importedPath;
+  }
+
   if (importedPath[0] === '.' && fromModule) {
     paths = [Path.dirname(fromModule.path)];
   }

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



More information about the Pkg-javascript-commits mailing list