[Pkg-javascript-commits] [node-sourcemap-codec] 01/04: New upstream version 1.3.1
Julien Puydt
julien.puydt at laposte.net
Thu Apr 20 16:14:40 UTC 2017
This is an automated email from the git hooks/post-receive script.
jpuydt-guest pushed a commit to annotated tag debian/1.3.1-1
in repository node-sourcemap-codec.
commit e0624c67a54b895c038ac8c4b54c84dd5a9015b4
Author: Julien Puydt <julien.puydt at laposte.net>
Date: Thu Apr 20 17:33:05 2017 +0200
New upstream version 1.3.1
---
.babelrc | 3 ---
.eslintrc | 65 ++++++++++++++++++++++++++++++--------------------
CHANGELOG.md | 4 ++++
package.json | 25 +++++++++----------
rollup.config.js | 16 +++++++++----
src/sourcemap-codec.js | 12 +++++-----
6 files changed, 73 insertions(+), 52 deletions(-)
diff --git a/.babelrc b/.babelrc
deleted file mode 100644
index 48f1c3a..0000000
--- a/.babelrc
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "presets": [ "es2015-rollup" ]
-}
diff --git a/.eslintrc b/.eslintrc
index af8d088..b6e21ea 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -1,28 +1,41 @@
{
- "rules": {
- "indent": [ 2, "tab", { "SwitchCase": 1 }],
- "quotes": [ 2, "single" ],
- "linebreak-style": [ 2, "unix" ],
- "semi": [ 2, "always" ],
- "no-mixed-spaces-and-tabs": [ 2, "smart-tabs" ],
- "object-shorthand": [2, "always" ],
- "no-const-assign": 2,
- "no-class-assign": 2,
- "no-this-before-super": 2,
- "no-var": 2,
- "quote-props": [ 2, "as-needed" ],
- "one-var": [ 2, "never" ],
- "prefer-arrow-callback": 2,
- "arrow-spacing": 2,
-
- "no-cond-assign": 0
- },
- "env": {
- "es6": true,
- "browser": true
- },
- "extends": "eslint:recommended",
- "ecmaFeatures": {
- "modules": true
- }
+ "root": true,
+ "rules": {
+ "indent": [ 2, "tab", { "SwitchCase": 1 } ],
+ "semi": [ 2, "always" ],
+ "keyword-spacing": [ 2, { "before": true, "after": true } ],
+ "space-before-blocks": [ 2, "always" ],
+ "space-before-function-paren": [ 2, "always" ],
+ "no-mixed-spaces-and-tabs": [ 2, "smart-tabs" ],
+ "no-cond-assign": 0,
+ "no-unused-vars": 2,
+ "object-shorthand": [ 2, "always" ],
+ "no-const-assign": 2,
+ "no-class-assign": 2,
+ "no-this-before-super": 2,
+ "no-var": 2,
+ "no-unreachable": 2,
+ "valid-typeof": 2,
+ "quote-props": [ 2, "as-needed" ],
+ "one-var": [ 2, "never" ],
+ "prefer-arrow-callback": 2,
+ "prefer-const": [ 2, { "destructuring": "all" } ],
+ "arrow-spacing": 2,
+ "no-inner-declarations": 0
+ },
+ "env": {
+ "es6": true,
+ "browser": true,
+ "node": true,
+ "mocha": true
+ },
+ "extends": [
+ "eslint:recommended",
+ "plugin:import/errors",
+ "plugin:import/warnings"
+ ],
+ "parserOptions": {
+ "ecmaVersion": 6,
+ "sourceType": "module"
+ }
}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a22967b..90d7048 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# sourcemap-codec changelog
+## 1.3.1
+
+* Update build process, expose `pkg.module`
+
## 1.3.0
* Update build process
diff --git a/package.json b/package.json
index c1c2625..70c312c 100644
--- a/package.json
+++ b/package.json
@@ -1,14 +1,15 @@
{
"name": "sourcemap-codec",
- "version": "1.3.0",
+ "version": "1.3.1",
"description": "Encode/decode sourcemap mappings",
"main": "dist/sourcemap-codec.umd.js",
- "jsnext:main": "dist/sourcemap-codec.es6.js",
+ "module": "dist/sourcemap-codec.es.js",
"scripts": {
"test": "mocha",
- "build": "rm -rf dist && rollup -c -f umd -o dist/sourcemap-codec.umd.js && rollup -c -f es6 -o dist/sourcemap-codec.es6.js",
+ "build": "rm -rf dist && rollup -c",
"pretest": "npm run build",
"prepublish": "npm test",
+ "lint": "eslint src",
"pretest-coverage": "npm run build",
"test-coverage": "rm -rf coverage/* && istanbul cover --report json node_modules/.bin/_mocha -- -u exports -R spec test/test.js",
"posttest-coverage": "remap-istanbul -i coverage/coverage-final.json -o coverage/coverage-remapped.json -b dist && remap-istanbul -i coverage/coverage-final.json -o coverage/coverage-remapped.lcov -t lcovonly -b dist && remap-istanbul -i coverage/coverage-final.json -o coverage/coverage-remapped -t html -b dist",
@@ -32,16 +33,16 @@
"vlq": "^0.2.1"
},
"devDependencies": {
- "babel-preset-es2015-rollup": "^1.0.0",
"codecov.io": "^0.1.6",
- "console-group": "^0.1.2",
- "eslint": "^1.6.0",
- "istanbul": "^0.4.0",
- "mocha": "^2.3.3",
- "remap-istanbul": "^0.5.1",
- "rollup": "^0.21.2",
- "rollup-plugin-babel": "^2.2.0",
- "rollup-plugin-npm": "^1.1.0"
+ "console-group": "^0.3.3",
+ "eslint": "^3.19.0",
+ "eslint-plugin-import": "^2.2.0",
+ "istanbul": "^0.4.5",
+ "mocha": "^3.2.0",
+ "remap-istanbul": "^0.9.5",
+ "rollup": "^0.41.6",
+ "rollup-plugin-buble": "^0.15.0",
+ "rollup-plugin-node-resolve": "^3.0.0"
},
"files": [
"src",
diff --git a/rollup.config.js b/rollup.config.js
index 2ae6879..b3191ee 100644
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -1,12 +1,18 @@
-import babel from 'rollup-plugin-babel';
-import npm from 'rollup-plugin-npm';
+import buble from 'rollup-plugin-buble';
+import resolve from 'rollup-plugin-node-resolve';
+
+const pkg = require( './package.json' );
export default {
entry: 'src/sourcemap-codec.js',
plugins: [
- babel({ exclude: 'node_modules/**' }),
- npm({ jsnext: true })
+ buble({ exclude: 'node_modules/**' }),
+ resolve({ jsnext: true })
],
moduleName: 'sourcemapCodec',
- sourceMap: true
+ sourceMap: true,
+ targets: [
+ { dest: pkg.main, format: 'umd' },
+ { dest: pkg.module, format: 'es' }
+ ]
};
diff --git a/src/sourcemap-codec.js b/src/sourcemap-codec.js
index e47c070..a66429f 100644
--- a/src/sourcemap-codec.js
+++ b/src/sourcemap-codec.js
@@ -2,7 +2,7 @@ import { decode as decodeVlq, encode as encodeVlq } from 'vlq';
function decodeSegments ( encodedSegments ) {
let i = encodedSegments.length;
- let segments = new Array( i );
+ const segments = new Array( i );
while ( i-- ) segments[i] = decodeVlq( encodedSegments[i] );
return segments;
@@ -14,9 +14,9 @@ export function decode ( mappings ) {
let sourceCodeColumn = 0; // fourth field
let nameIndex = 0; // fifth field
- let lines = mappings.split( ';' );
- let numLines = lines.length;
- let decoded = new Array( numLines );
+ const lines = mappings.split( ';' );
+ const numLines = lines.length;
+ const decoded = new Array( numLines );
let i;
let j;
@@ -71,7 +71,7 @@ export function decode ( mappings ) {
}
export function encode ( decoded ) {
- let offsets = {
+ const offsets = {
generatedCodeColumn: 0,
sourceFileIndex: 0, // second field
sourceCodeLine: 0, // third field
@@ -89,7 +89,7 @@ export function encode ( decoded ) {
return segment;
}
- let result = new Array( segment.length );
+ const result = new Array( segment.length );
result[0] = segment[0] - offsets.generatedCodeColumn;
offsets.generatedCodeColumn = segment[0];
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-sourcemap-codec.git
More information about the Pkg-javascript-commits
mailing list