Skip to content

Commit 7c764f5

Browse files
committed
- Enhancement: Create as true ESM module
1 parent aa2c0c3 commit 7c764f5

11 files changed

+92
-470
lines changed
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
2+
23
module.exports = {
3-
delay: true,
44
reporter: 'mocha-multi-reporters'
55
};

dist/index-browser-esm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ JSONPath.prototype._trace = function (expr, val, path, parent, parentPropName, c
747747

748748
break;
749749

750-
/* istanbul ignore next */
750+
/* c8 ignore next 2 */
751751

752752
default:
753753
throw new TypeError('Unknown value type ' + valueType);

dist/index-browser-esm.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index-browser-umd.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@
753753

754754
break;
755755

756-
/* istanbul ignore next */
756+
/* c8 ignore next 2 */
757757

758758
default:
759759
throw new TypeError('Unknown value type ' + valueType);

dist/index-browser-umd.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index-node-cjs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ JSONPath.prototype._trace = function (expr, val, path, parent, parentPropName, c
502502

503503
break;
504504

505-
/* istanbul ignore next */
505+
/* c8 ignore next 2 */
506506

507507
default:
508508
throw new TypeError('Unknown value type ' + valueType);

dist/index-node-esm.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ JSONPath.prototype._trace = function (expr, val, path, parent, parentPropName, c
494494

495495
break;
496496

497-
/* istanbul ignore next */
497+
/* c8 ignore next 2 */
498498

499499
default:
500500
throw new TypeError('Unknown value type ' + valueType);

package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"author": "Stefan Goessner",
33
"name": "jsonpath-plus",
44
"version": "5.1.0",
5+
"type": "module",
56
"main": "dist/index-node-cjs.js",
67
"exports": {
78
"./package.json": "./package.json",
@@ -61,6 +62,7 @@
6162
"@babel/preset-env": "^7.14.7",
6263
"@brettz9/eslint-plugin": "^1.0.3",
6364
"@rollup/plugin-babel": "^5.3.0",
65+
"c8": "^7.7.3",
6466
"chai": "^4.3.4",
6567
"core-js-bundle": "^3.15.1",
6668
"coveradge": "^0.7.0",
@@ -83,13 +85,11 @@
8385
"eslint-plugin-radar": "^0.2.1",
8486
"eslint-plugin-standard": "^4.1.0",
8587
"eslint-plugin-unicorn": "^33.0.1",
86-
"esm": "^3.2.25",
8788
"http-server": "^0.12.3",
8889
"license-badger": "^0.19.0",
89-
"mocha": "^8.4.0",
90+
"mocha": "^9.0.1",
9091
"mocha-badge-generator": "^0.9.0",
9192
"mocha-multi-reporters": "^1.5.1",
92-
"nyc": "^15.1.0",
9393
"open-cli": "^7.0.0",
9494
"remark-cli": "^9.0.0",
9595
"remark-lint-code-block-style": "^2.0.1",
@@ -106,15 +106,16 @@
106106
"browserslist": [
107107
"cover 100%"
108108
],
109-
"nyc": {
109+
"c8": {
110110
"reporter": [
111111
"text",
112112
"html",
113113
"json-summary"
114114
],
115115
"exclude": [
116-
".mocharc.js",
117-
".eslintrc.js",
116+
".mocharc.cjs",
117+
".eslintrc.cjs",
118+
"src/jsonpath.d.ts",
118119
"rollup.config.js",
119120
".idea",
120121
"coverage",
@@ -140,11 +141,11 @@
140141
"open": "open-cli http://localhost:8084/demo/ && npm start",
141142
"start": "http-server -p 8084",
142143
"typescript": "tsc -p src",
143-
"mocha": "mocha --require esm --require test-helpers/node-env.js --reporter-options configFile=mocha-multi-reporters.json test",
144-
"nyc": "rm -Rf ./coverage && rm -Rf ./node_modules/.cache && nyc --all npm run mocha && npm run coverage-badge",
144+
"mocha": "mocha --require test-helpers/node-env.js --reporter-options configFile=mocha-multi-reporters.json test",
145+
"c8": "rm -Rf ./coverage && rm -Rf ./node_modules/.cache && c8 --all npm run mocha && npm run coverage-badge",
145146
"rollup": "rollup -c",
146147
"eslint": "eslint --ext js,md,html .",
147-
"test": "npm run eslint && npm run rollup && npm run nyc && npm run typescript",
148+
"test": "npm run eslint && npm run rollup && npm run c8 && npm run typescript",
148149
"browser-test": "npm run eslint && npm run rollup && open-cli http://localhost:8084/test/ && npm start"
149150
}
150151
}

0 commit comments

Comments
 (0)