Skip to content

Commit 0799283

Browse files
feat!: bump engines requirement to Node 22
BREAKING CHANGE: bumps required Node.js version to >=22.12.0. ESM-only.
1 parent d7720dd commit 0799283

File tree

10 files changed

+36
-39
lines changed

10 files changed

+36
-39
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ jobs:
1717
strategy:
1818
matrix:
1919
node-version:
20-
- '22.9'
21-
- '20.11'
20+
- '22.12.x'
2221
os:
2322
- macos-latest
2423
- ubuntu-latest

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.12

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
"name": "@electron/docs-parser",
33
"version": "0.0.0-development",
44
"description": "Parse Electron documentation into a machine readable JSON file",
5-
"main": "dist/index.js",
5+
"exports": "./dist/index.js",
6+
"typings": "dist/index.d.ts",
67
"type": "module",
78
"author": "Samuel Attard",
89
"license": "MIT",
910
"engines": {
10-
"node": "^20.11.0 || >= 21.2.0"
11+
"node": ">=22.12.0"
1112
},
1213
"publishConfig": {
1314
"provenance": true
@@ -28,14 +29,15 @@
2829
"dist"
2930
],
3031
"devDependencies": {
32+
"@tsconfig/node22": "^22.0.2",
3133
"@types/chai": "^4.3.19",
3234
"@types/lodash.camelcase": "^4.3.9",
33-
"@types/node": "^22.5.5",
35+
"@types/node": "^22.10.7",
3436
"@types/pretty-ms": "^5.0.1",
3537
"husky": "^9.1.6",
3638
"lint-staged": "^15.2.10",
3739
"prettier": "^3.3.3",
38-
"typescript": "^5.6.2",
40+
"typescript": "^5.8.3",
3941
"vitest": "^3.0.4"
4042
},
4143
"dependencies": {
@@ -67,4 +69,4 @@
6769
"url": "https://github.com/electron/docs-parser/issues"
6870
},
6971
"homepage": "https://github.com/electron/docs-parser#readme"
70-
}
72+
}

src/DocsParser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { expect } from 'chai';
22
import fs from 'node:fs';
33
import MarkdownIt from 'markdown-it';
4-
import { Token } from 'markdown-it';
5-
import * as path from 'path';
4+
import type Token from 'markdown-it/lib/token.mjs';
5+
import * as path from 'node:path';
66
import toCamelCase from 'lodash.camelcase';
77

88
import {

src/bin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import chalk from 'chalk';
44
import fs from 'node:fs';
55
import { parseArgs } from 'node:util';
66
import ora from 'ora';
7-
import * as path from 'path';
7+
import * as path from 'node:path';
88
import pretty from 'pretty-ms';
99

1010
import { parseDocs } from './index.js';

src/block-parsers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect } from 'chai';
2-
import { Token } from 'markdown-it';
2+
import type Token from 'markdown-it/lib/token.mjs';
33

44
import {
55
parseHeadingTags,

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import fs from 'node:fs';
2-
import * as path from 'path';
2+
import * as path from 'node:path';
33
import { DocsParser } from './DocsParser.js';
44

55
type ParseOptions = {

src/markdown-helpers.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect } from 'chai';
2-
import { Token } from 'markdown-it';
2+
import type Token from 'markdown-it/lib/token.mjs';
33
import {
44
TypeInformation,
55
PropertyDocumentationBlock,
@@ -875,10 +875,10 @@ const unconsumedTypedKeyList = <T extends TypedKey[] | null>(
875875
keys: T,
876876
): T extends null ? null : TypedKeyList => {
877877
return keys
878-
? {
878+
? ({
879879
consumed: false,
880880
keys,
881-
}
881+
} as any)
882882
: (null as any);
883883
};
884884

tsconfig.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
11
{
2+
"extends": "@tsconfig/node22/tsconfig.json",
23
"compilerOptions": {
3-
"module": "es2022",
4-
"target": "es2022",
5-
"moduleResolution": "Node",
64
"outDir": "dist",
7-
"lib": [
8-
"es6",
9-
"es7"
10-
],
11-
"types": [
12-
"node"
13-
],
145
"declaration": true,
156
"sourceMap": true,
167
"rootDir": "src",
17-
"experimentalDecorators": true,
188
"strict": true,
199
"esModuleInterop": true,
2010
"incremental": true

yarn.lock

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@
232232
resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.40.1.tgz#8078b71fe0d5825dcbf83d52a7dc858b39da165c"
233233
integrity sha512-ECyOuDeH3C1I8jH2MK1RtBJW+YPMvSfT0a5NN0nHfQYnDSJ6tUiZH3gzwVP5/Kfh/+Tt7tpWVF9LXNTnhTJ3kA==
234234

235+
"@tsconfig/node22@^22.0.2":
236+
version "22.0.2"
237+
resolved "https://registry.yarnpkg.com/@tsconfig/node22/-/node22-22.0.2.tgz#1e04e2c5cc946dac787d69bb502462a851ae51b6"
238+
integrity sha512-Kmwj4u8sDRDrMYRoN9FDEcXD8UpBSaPQQ24Gz+Gamqfm7xxn+GBR7ge/Z7pK8OXNGyUzbSwJj+TH6B+DS/epyA==
239+
235240
"@types/chai@^4.3.19":
236241
version "4.3.19"
237242
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.19.tgz#14519f437361d41e84102ed3fbc922ddace3e228"
@@ -277,12 +282,12 @@
277282
resolved "https://registry.yarnpkg.com/@types/mdurl/-/mdurl-2.0.0.tgz#d43878b5b20222682163ae6f897b20447233bdfd"
278283
integrity sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==
279284

280-
"@types/node@^22.5.5":
281-
version "22.5.5"
282-
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.5.5.tgz#52f939dd0f65fc552a4ad0b392f3c466cc5d7a44"
283-
integrity sha512-Xjs4y5UPO/CLdzpgR6GirZJx36yScjh73+2NlLlkFRSoQN8B0DpfXPdZGnvVmLRLOsqDpOfTNv7D9trgGhmOIA==
285+
"@types/node@^22.10.7":
286+
version "22.15.34"
287+
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.15.34.tgz#3995a6461d2cfc51c81907da0065fc328f6a459e"
288+
integrity sha512-8Y6E5WUupYy1Dd0II32BsWAx5MWdcnRd8L84Oys3veg1YrYtNtzgO4CFhiBg6MDSjk7Ay36HYOnU7/tuOzIzcw==
284289
dependencies:
285-
undici-types "~6.19.2"
290+
undici-types "~6.21.0"
286291

287292
"@types/pretty-ms@^5.0.1":
288293
version "5.0.1"
@@ -1053,20 +1058,20 @@ to-regex-range@^5.0.1:
10531058
dependencies:
10541059
is-number "^7.0.0"
10551060

1056-
typescript@^5.6.2:
1057-
version "5.6.2"
1058-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.2.tgz#d1de67b6bef77c41823f822df8f0b3bcff60a5a0"
1059-
integrity sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==
1061+
typescript@^5.8.3:
1062+
version "5.8.3"
1063+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.8.3.tgz#92f8a3e5e3cf497356f4178c34cd65a7f5e8440e"
1064+
integrity sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==
10601065

10611066
uc.micro@^2.0.0, uc.micro@^2.1.0:
10621067
version "2.1.0"
10631068
resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-2.1.0.tgz#f8d3f7d0ec4c3dea35a7e3c8efa4cb8b45c9e7ee"
10641069
integrity sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==
10651070

1066-
undici-types@~6.19.2:
1067-
version "6.19.8"
1068-
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02"
1069-
integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==
1071+
undici-types@~6.21.0:
1072+
version "6.21.0"
1073+
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.21.0.tgz#691d00af3909be93a7faa13be61b3a5b50ef12cb"
1074+
integrity sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==
10701075

10711076
vite-node@3.0.5:
10721077
version "3.0.5"

0 commit comments

Comments
 (0)