Skip to content

Commit a2636ba

Browse files
committed
chore(project): expose ES modules
* drop distro for now * expose ES modules
1 parent b7ec283 commit a2636ba

File tree

5 files changed

+22
-174
lines changed

5 files changed

+22
-174
lines changed

package.json

Lines changed: 8 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77
"Benjamin Eidelman <beneidel@gmail.com>",
88
"bpmn.io Contributors <https://bpmn.io>"
99
],
10-
"browser": "dist/jsondiffpatch.umd.js",
11-
"main": "dist/jsondiffpatch.cjs.js",
12-
"module": "dist/jsondiffpatch.esm.js",
13-
"types": "./dist/index",
10+
"main": "src/index.js",
11+
"types": "src/index.d.ts",
1412
"files": [
1513
"dist",
1614
"bin"
@@ -19,20 +17,15 @@
1917
"jsondiffpatch": "./bin/jsondiffpatch"
2018
},
2119
"scripts": {
22-
"all": "run-s build test",
23-
"build": "rollup -c",
24-
"test-browser": "gulp test-browser",
20+
"all": "run-s lint test",
2521
"lint": "eslint .",
26-
"bump": "gulp bump",
27-
"test": "nyc mocha",
28-
"watch": "nodemon --exec \"mocha\"",
29-
"prepublishOnly": "npm run all",
30-
"cover-report": "open coverage/lcov-report/index.html",
31-
"cover-publish": "nyc mocha && codeclimate < coverage/lcov.info"
22+
"test": "mocha",
23+
"watch": "npm test -- --watch",
24+
"prepublishOnly": "npm run all"
3225
},
3326
"repository": {
3427
"type": "git",
35-
"url": "https://github.com/benjamine/jsondiffpatch.git"
28+
"url": "https://github.com/bpmn-io/jsondiffpatch.git"
3629
},
3730
"keywords": [
3831
"json",
@@ -44,40 +37,17 @@
4437
"diff-match-patch": "^1.0.0"
4538
},
4639
"devDependencies": {
47-
"@istanbuljs/nyc-config-babel": "^1.2.2",
48-
"babel-core": "^6.26.0",
49-
"babel-eslint": "^8.2.1",
50-
"babel-plugin-external-helpers": "^6.22.0",
51-
"babel-plugin-istanbul": "^4.1.5",
52-
"babel-plugin-transform-object-rest-spread": "^6.26.0",
53-
"babel-polyfill": "^6.26.0",
54-
"babel-preset-env": "^1.6.1",
55-
"babel-preset-stage-0": "^6.24.1",
56-
"babel-preset-stage-1": "^6.24.1",
57-
"babel-preset-stage-2": "^6.24.1",
5840
"chai": "^4.1.2",
59-
"codeclimate-test-reporter": "0.0.3",
6041
"eslint": "^4.16.0",
6142
"eslint-config-standard": "^11.0.0-beta.0",
6243
"eslint-plugin-import": "^2.8.0",
6344
"eslint-plugin-node": "^5.2.1",
6445
"eslint-plugin-promise": "^3.6.0",
6546
"eslint-plugin-standard": "^3.0.1",
6647
"esm": "^3.0.25",
67-
"istanbul": "^0.4.5",
6848
"mkdirp": "^0.5.1",
6949
"mocha": "^5.0.0",
70-
"nodemon": "^1.17.1",
71-
"npm-run-all": "^4.1.2",
72-
"nyc": "^11.4.1",
73-
"prettier": "^1.10.2",
74-
"rollup": "^0.54.1",
75-
"rollup-plugin-babel": "^3.0.3",
76-
"rollup-plugin-commonjs": "^8.2.6",
77-
"rollup-plugin-istanbul": "^2.0.0",
78-
"rollup-plugin-node-resolve": "^3.0.2",
79-
"rollup-plugin-replace": "^2.0.0",
80-
"rollup-plugin-visualizer": "^0.3.1"
50+
"npm-run-all": "^4.1.2"
8151
},
8252
"license": "MIT",
8353
"engines": {

rollup.config.js

Lines changed: 0 additions & 122 deletions
This file was deleted.

src/formatters/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export { default as BaseFormatter } from './base';
22
export { default as HtmlFormatter } from './html';
33
export { default as AnnotatedFormatter } from './annotated';
4-
export { default as JsonPatchFormatter } from './jsonpatch';
4+
export { default as JSONPatchFormatter } from './jsonpatch';
55
export { default as ConsoleFormatter } from './console';

src/index.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import DiffPatcher from './diffpatcher';
2-
export DiffPatcher from './diffpatcher';
2+
3+
export {
4+
default as DiffPatcher,
5+
} from './diffpatcher';
36

47
export function create(options) {
58
return new DiffPatcher(options);
69
}
710

8-
export dateReviver from './date-reviver';
11+
export {
12+
default as dateReviver,
13+
} from './date-reviver';
914

1015
export function diff() {
1116
return staticCall('diff', arguments);
@@ -32,11 +37,3 @@ function staticCall(method, args) {
3237

3338
return instance[method](...args);
3439
}
35-
36-
export {
37-
AnnotatedFormatter,
38-
BaseFormatter,
39-
ConsoleFormatter,
40-
HtmlFormatter,
41-
JsonPatchFormatter,
42-
} from './formatters';

test/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@
44
*/
55
import {
66
DiffPatcher,
7-
JsonPatchFormatter,
8-
HtmlFormatter,
97
clone,
108
diff,
119
patch,
1210
reverse,
1311
unpatch,
1412
} from '../';
1513

14+
import {
15+
JSONPatchFormatter,
16+
HtmlFormatter,
17+
} from '../src/formatters';
18+
1619
import examples from './examples/diffpatch';
1720

1821
import {
@@ -388,7 +391,7 @@ describe('DiffPatcher', () => {
388391

389392
before(() => {
390393
instance = new DiffPatcher();
391-
formatter = new JsonPatchFormatter();
394+
formatter = new JSONPatchFormatter();
392395
});
393396

394397
const expectFormat = (before, after, expected) => {

0 commit comments

Comments
 (0)