Skip to content

Commit a6ec4a7

Browse files
committed
fix: Upgrade dependencies, support Rollup 3
Require Node.js 14.18 instead of 8 because of Rollup 3. Replace ava with tehanu. Replace eslint with denolint. Add tests for TypeScript types and CJS output. BREAKING CHANGE: The minimum version of Node.js is 14.8 now.
1 parent f8f777c commit a6ec4a7

28 files changed

+718
-2376
lines changed

.denolint.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"files": {
3+
"exclude": [
4+
"test/fixtures",
5+
"test/snapshots"
6+
]
7+
},
8+
"rules": {
9+
"tags": ["recommended"]
10+
}
11+
}

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ jobs:
2020
with:
2121
version: '>=6'
2222
run_install: |
23-
- args: [--frozen-lockfile, --no-verify-store-integrity, --no-optional]
23+
- args: [--frozen-lockfile, --no-verify-store-integrity]
2424
- name: Test
2525
run: npm test
2626
- name: Coverage
27-
run: pnpx codecov --disable=gcov
27+
uses: codecov/codecov-action@v2
2828
- name: Publish
2929
uses: cycjimmy/semantic-release-action@v2
3030
with:

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.DS_Store
2-
.eslintcache
2+
*.log
3+
*.map
34
coverage
4-
dist
5+
/lib/index.cjs
56
node_modules

.tslintrc.yml

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

.vscode/launch.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@
88
"type": "node",
99
"request": "launch",
1010
"name": "tests",
11-
"program": "${workspaceFolder}/node_modules/ava/profile.js",
12-
"args": [
13-
"${file}",
14-
"--serial"
15-
],
11+
"program": "${workspaceFolder}/test/index.js",
1612
"skipFiles": [
1713
"<node_internals>/**"
1814
]

.vscode/settings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"files.exclude": {
33
"**/.git": true,
4-
"**/.DS_Store": true,
5-
"**/dist": true
4+
"**/.DS_Store": true
65
},
76
"search.exclude": {
87
"**/node_modules": true,
9-
"**/coverage": true
8+
"**/coverage": true,
9+
"pnpm-lock.yaml": true
1010
}
1111
}

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77

88
A [Rollup] plugin which converts `.json` files to ES6 modules. Recognizes standard [JSON], CJSON (JSON with comments) and [JSON5] (further more flexible JSON).
99

10-
This plugin is based on [`@rollup/plugin-json`]. It supports all original options. It leverages the parser from [`@prantlf/jsonlint`] to provide better error information in case or invalid input and to parse JSON extensions like CJSON and JSON5. If no extension is enabled, the standard `JSON.parse` will be used for the best performance.
10+
This plugin started as an overwrite of [`@rollup/plugin-json`]. It supports all the original options. It leverages the parser from [`@prantlf/jsonlint`] to provide better error information in case or invalid input and to parse JSON extensions like CJSON and JSON5. If no extension is enabled, the standard `JSON.parse` will be used for the best performance.
1111

1212
## Requirements
1313

14-
This plugin requires [Node.js] [LTS] (currently 12, at least 8) and Rollup 1.20 or newer.
14+
This plugin requires [Node.js] [LTS] (currently 18, at least 14.8) and Rollup 1.20 or newer.
1515

1616
## Installation
1717

@@ -60,6 +60,13 @@ A shortcut for setting the three boolean flags below.
6060
* `cjson` - expects CJSON (sets `ignoreComments` to `true`)
6161
* `json5` - expects JSON5 (sets `ignoreComments`, `ignoreTrailingCommas` and `allowSingleQuotedStrings` to `true`)
6262

63+
### `ignoreBOM`
64+
65+
Type: `Boolean`<br>
66+
Default: `false`
67+
68+
If `true`, the leading UTF-8 byte-order mark will be ignored.
69+
6370
### `ignoreComments`
6471

6572
Type: `Boolean`<br>

index.d.ts

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

0 commit comments

Comments
 (0)