[Pkg-javascript-commits] [libjs-handlebars] 02/03: combine babel 6 and webpack 3 patches

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Mon Jan 1 11:30:16 UTC 2018


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

praveen pushed a commit to branch master
in repository libjs-handlebars.

commit 2783396fb9ccaa24ac575697612c25fc4370e004
Author: Pirate Praveen <praveen at debian.org>
Date:   Mon Jan 1 16:23:25 2018 +0530

    combine babel 6 and webpack 3 patches
---
 debian/patches/port-to-babel6-webpack3.patch | 93 ++++++++++++++++++++++++++++
 debian/patches/port-to-babel6.patch          | 81 ------------------------
 debian/patches/series                        |  3 +-
 debian/patches/use-babelrc-for-webpack.patch | 39 ------------
 4 files changed, 94 insertions(+), 122 deletions(-)

diff --git a/debian/patches/port-to-babel6-webpack3.patch b/debian/patches/port-to-babel6-webpack3.patch
new file mode 100644
index 0000000..744c7b0
--- /dev/null
+++ b/debian/patches/port-to-babel6-webpack3.patch
@@ -0,0 +1,93 @@
+From 277e79df1689bf541d3e6b3fe2cb06c2b375a03d Mon Sep 17 00:00:00 2001
+From: Jishnu Mohan <jishnu7 at gmail.com>
+Date: Sun, 31 Dec 2017 20:28:32 +0530
+Subject: [PATCH 1/2] upgrade webpack
+
+---
+ Gruntfile.js | 12 ++++++++++--
+ package.json | 14 ++++++++------
+ 2 files changed, 18 insertions(+), 8 deletions(-)
+
+--- a/Gruntfile.js
++++ b/Gruntfile.js
+@@ -1,3 +1,5 @@
++const path = require('path');
++
+ /* eslint-disable no-process-env */
+ module.exports = function(grunt) {
+ 
+@@ -46,7 +48,12 @@
+     babel: {
+       options: {
+         sourceMaps: 'inline',
+-        loose: ['es6.modules'],
++        presets: [
++          ['env', { loose: true }]
++        ],
++        plugins: [
++          'add-module-exports'
++        ],
+         auxiliaryCommentBefore: 'istanbul ignore next'
+       },
+       amd: {
+@@ -83,7 +90,7 @@
+           ]
+         },
+         output: {
+-          path: 'dist/',
++          path: path.join(__dirname, 'dist'),
+           library: 'Handlebars',
+           libraryTarget: 'umd'
+         }
+@@ -92,6 +99,9 @@
+         entry: './lib/handlebars.js',
+         output: {
+           filename: 'handlebars.js'
++        },
++        module: {
++          noParse: [ /parser\.js$/ ]
+         }
+       },
+       runtime: {
+--- a/package.json
++++ b/package.json
+@@ -30,13 +30,16 @@
+   },
+   "devDependencies": {
+     "aws-sdk": "^2.1.49",
+-    "babel-loader": "^5.0.0",
++    "babel-core": "^6.26.0",
++    "babel-loader": "^7.1.2",
++    "babel-plugin-add-module-exports": "^0.2.1",
++    "babel-preset-env": "^1.6.1",
+     "babel-runtime": "^5.1.10",
+     "benchmark": "~1.0",
+     "dustjs-linkedin": "^2.0.2",
+     "eco": "~1.1.0-rc-3",
+     "grunt": "~0.4.1",
+-    "grunt-babel": "^5.0.0",
++    "grunt-babel": "^7.0.0",
+     "grunt-cli": "~0.1.10",
+     "grunt-contrib-clean": "0.x",
+     "grunt-contrib-concat": "0.x",
+@@ -47,16 +50,16 @@
+     "grunt-contrib-watch": "0.x",
+     "grunt-eslint": "^17.1.0",
+     "grunt-saucelabs": "8.x",
+-    "grunt-webpack": "^1.0.8",
++    "grunt-webpack": "^3.0.2",
+     "istanbul": "^0.3.0",
+-    "jison": "~0.3.0",
++    "jison": "^0.4.18",
+     "mocha": "~1.20.0",
+     "mock-stdin": "^0.3.0",
+     "mustache": "^2.1.3",
+     "semver": "^5.0.1",
+     "underscore": "^1.5.1",
+-    "webpack": "^1.12.6",
+-    "webpack-dev-server": "^1.12.1"
++    "webpack": "^3.10.0",
++    "webpack-dev-server": "^2.9.7"
+   },
+   "main": "lib/index.js",
+   "bin": {
diff --git a/debian/patches/port-to-babel6.patch b/debian/patches/port-to-babel6.patch
deleted file mode 100644
index bead319..0000000
--- a/debian/patches/port-to-babel6.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-From 282236d8298b27f75c49e968fa8e4fa4f2f0a742 Mon Sep 17 00:00:00 2001
-From: Nils Knappmeier <github at knappi.org>
-Date: Sat, 21 Oct 2017 23:56:45 +0200
-Subject: [PATCH] Attempt to upgrade to babel 6
-
-- Extracted babelPreset as a function, because merging of options
-  in Grunt is shallow by default.
-- Some changes in the webpack-configuration are still required
----
- Gruntfile.js | 16 +++++++++++++---
- package.json |  8 +++++---
- 2 files changed, 18 insertions(+), 6 deletions(-)
-
-diff --git a/Gruntfile.js b/Gruntfile.js
-index ce85e9a4..a51b6a54 100644
---- a/Gruntfile.js
-+++ b/Gruntfile.js
-@@ -1,6 +1,17 @@
- /* eslint-disable no-process-env */
- module.exports = function(grunt) {
- 
-+  function babelPreset(modules) {
-+    return [[
-+      'env',
-+      {
-+        loose: true,
-+        modules: modules
-+      }
-+    ]];
-+  }
-+
-+
-   grunt.initConfig({
-     pkg: grunt.file.readJSON('package.json'),
- 
-@@ -46,12 +57,11 @@ module.exports = function(grunt) {
-     babel: {
-       options: {
-         sourceMaps: 'inline',
--        loose: ['es6.modules'],
-         auxiliaryCommentBefore: 'istanbul ignore next'
-       },
-       amd: {
-         options: {
--          modules: 'amd'
-+          presets: babelPreset('amd')
-         },
-         files: [{
-           expand: true,
-@@ -63,7 +73,7 @@ module.exports = function(grunt) {
- 
-       cjs: {
-         options: {
--          modules: 'common'
-+          presets: babelPreset('commonjs')
-         },
-         files: [{
-           cwd: 'lib/',
-diff --git a/package.json b/package.json
-index b583ee34..2e26ca96 100644
---- a/package.json
-+++ b/package.json
-@@ -30,13 +30,15 @@
-   },
-   "devDependencies": {
-     "aws-sdk": "^2.1.49",
--    "babel-loader": "^5.0.0",
--    "babel-runtime": "^5.1.10",
-+    "babel-core": "^6.26.0",
-+    "babel-loader": "^6.4.1",
-+    "babel-preset-env": "^1.6.1",
-+    "babel-runtime": "^6.26.0",
-     "benchmark": "~1.0",
-     "dustjs-linkedin": "^2.0.2",
-     "eco": "~1.1.0-rc-3",
-     "grunt": "~0.4.1",
--    "grunt-babel": "^5.0.0",
-+    "grunt-babel": "^7.0.0",
-     "grunt-cli": "~0.1.10",
-     "grunt-contrib-clean": "0.x",
-     "grunt-contrib-concat": "0.x",
diff --git a/debian/patches/series b/debian/patches/series
index d0e9c98..61ef92c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,3 @@
 skip-some-modules.patch
 use-system-jison.patch
-port-to-babel6.patch
-use-babelrc-for-webpack.patch
+port-to-babel6-webpack3.patch
diff --git a/debian/patches/use-babelrc-for-webpack.patch b/debian/patches/use-babelrc-for-webpack.patch
deleted file mode 100644
index 7fc622d..0000000
--- a/debian/patches/use-babelrc-for-webpack.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- a/Gruntfile.js
-+++ b/Gruntfile.js
-@@ -1,4 +1,7 @@
- /* eslint-disable no-process-env */
-+
-+var path = require('path');
-+
- module.exports = function(grunt) {
- 
-   function babelPreset(modules) {
-@@ -89,11 +92,26 @@
-         module: {
-           loaders: [
-             // the optional 'runtime' transformer tells babel to require the runtime instead of inlining it.
--            { test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel-loader?optional=runtime&loose=es6.modules&auxiliaryCommentBefore=istanbul%20ignore%20next' }
-+            {
-+              test: /\.jsx?$/,
-+              exclude: /node_modules/,
-+              use: {
-+                loader: 'babel-loader',
-+                options: {
-+                  presets: babelPreset()
-+                }
-+              }
-+            }
-           ]
-         },
-+        resolve: {
-+          modules: ['/usr/lib/nodejs','.'],
-+        },
-+        resolveLoader: {
-+          modules: ['/usr/lib/nodejs'],
-+        },
-         output: {
--          path: 'dist/',
-+          path: path.resolve(__dirname, 'dist/'),
-           library: 'Handlebars',
-           libraryTarget: 'umd'
-         }

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



More information about the Pkg-javascript-commits mailing list