Skip to content

Commit a46b8ac

Browse files
committed
prepare 4.0.0, esm only
1 parent b0e0a3d commit a46b8ac

19 files changed

+53
-56
lines changed

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ test/
1111
.gitignore
1212
.mocharc.json
1313
.eslintrc.json
14+
eslint.config.cjs

.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
"runtimeArgs": [
1212
"--enable-source-maps",
1313
"--test",
14-
"./lib/umd/test/**/*.test.js"
14+
"./lib/esm/test/**/*.test.js"
1515
],
1616
"env": {},
1717
"sourceMaps": true,
18-
"outFiles": ["${workspaceRoot}/lib/umd/**/*.js"],
18+
"outFiles": ["${workspaceRoot}/lib/esm/**/*.js"],
1919
"preLaunchTask": "npm: watch"
2020
}
2121
]

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
4.0.0-next.1 2026-03-04
2+
=================
3+
- package is now ESM-only.
4+
- remove UMD build and package entrypoints.
5+
6+
17
3.3.0 2022-06-24
28
=================
39
- `JSONVisitor.onObjectBegin` and `JSONVisitor.onArrayBegin` can now return `false` to instruct the visitor that no children should be visited.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ JSONC is JSON with JavaScript style comments. This node module provides a scanne
2222
Installation
2323
------------
2424

25+
`jsonc-parser` is published as an ESM-only package.
26+
2527
```
2628
npm install --save jsonc-parser
2729
```
File renamed without changes.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
{
22
"name": "jsonc-parser",
3-
"version": "3.3.1",
3+
"version": "4.0.0-next.1",
44
"description": "Scanner and parser for JSON with comments.",
5-
"main": "./lib/umd/main.js",
6-
"typings": "./lib/umd/main.d.ts",
7-
"module": "./lib/esm/main.js",
5+
"type": "module",
6+
"exports": {
7+
".": {
8+
"types": "./lib/esm/main.d.ts",
9+
"import": "./lib/esm/main.js"
10+
}
11+
},
12+
"types": "./lib/esm/main.d.ts",
813
"author": "Microsoft Corporation",
914
"repository": {
1015
"type": "git",
@@ -23,13 +28,12 @@
2328
"typescript": "^5.8.3"
2429
},
2530
"scripts": {
26-
"prepack": "npm run clean && npm run compile-esm && npm run test && npm run remove-sourcemap-refs",
31+
"prepack": "npm run clean && npm run compile && npm run test && npm run remove-sourcemap-refs",
2732
"compile": "tsc -p ./src && npm run lint",
28-
"compile-esm": "tsc -p ./src/tsconfig.esm.json",
29-
"remove-sourcemap-refs": "node ./build/remove-sourcemap-refs.js",
33+
"remove-sourcemap-refs": "node ./build/remove-sourcemap-refs.cjs",
3034
"clean": "rimraf lib",
3135
"watch": "tsc -w -p ./src",
32-
"test": "npm run compile && node --enable-source-maps --test ./lib/umd/test/**/*.test.js",
36+
"test": "npm run compile && node --enable-source-maps --test ./lib/esm/test/**/*.test.js",
3337
"lint": "eslint src/**/*.ts"
3438
}
3539
}

src/impl/edit.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
*--------------------------------------------------------------------------------------------*/
55
'use strict';
66

7-
import { Edit, ParseError, Node, JSONPath, Segment, ModificationOptions } from '../main';
8-
import { format, isEOL } from './format';
9-
import { parseTree, findNodeAtLocation } from './parser';
7+
import { Edit, ParseError, Node, JSONPath, Segment, ModificationOptions } from '../main.js';
8+
import { format, isEOL } from './format.js';
9+
import { parseTree, findNodeAtLocation } from './parser.js';
1010

1111
export function removeProperty(text: string, path: JSONPath, options: ModificationOptions): Edit[] {
1212
return setProperty(text, path, void 0, options);

src/impl/format.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
*--------------------------------------------------------------------------------------------*/
55
'use strict';
66

7-
import { Range, FormattingOptions, Edit, SyntaxKind, ScanError } from '../main';
8-
import { createScanner } from './scanner';
9-
import { cachedSpaces, cachedBreakLinesWithSpaces, supportedEols, SupportedEOL } from './string-intern';
7+
import { Range, FormattingOptions, Edit, SyntaxKind, ScanError } from '../main.js';
8+
import { createScanner } from './scanner.js';
9+
import { cachedSpaces, cachedBreakLinesWithSpaces, supportedEols, SupportedEOL } from './string-intern.js';
1010

1111
export function format(documentText: string, range: Range | undefined, options: FormattingOptions): Edit[] {
1212
let initialIndentLevel: number;

0 commit comments

Comments
 (0)