Skip to content

Commit bd22323

Browse files
chore: fix update-specs script, use builtin fetch (#3528)
1 parent f66914e commit bd22323

File tree

5 files changed

+4
-97
lines changed

5 files changed

+4
-97
lines changed

package-lock.json

-91
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
"markdown-it": "14.1.0",
7373
"marked-highlight": "^2.2.0",
7474
"marked-man": "^2.1.0",
75-
"node-fetch": "^3.3.2",
7675
"recheck": "^4.4.5",
7776
"rollup": "^4.24.4",
7877
"semantic-release": "^24.2.0",
File renamed without changes.

test/update-specs.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import fetch from 'node-fetch';
2-
import { load } from 'cheerio';
3-
import { Marked } from '../lib/marked.esm.js';
4-
import { htmlIsEqual } from '@markedjs/testutils';
51
import { readdirSync, unlinkSync, writeFileSync } from 'node:fs';
62
import { join, resolve, dirname } from 'node:path';
73
import { fileURLToPath } from 'node:url';
4+
import { load } from 'cheerio';
5+
import { htmlIsEqual } from '@markedjs/testutils';
6+
import { Marked } from '../lib/marked.esm.js';
87

98
const __dirname = dirname(fileURLToPath(import.meta.url));
109

@@ -18,7 +17,7 @@ async function updateCommonmark(dir, options) {
1817
try {
1918
const res = await fetch('https://raw.githubusercontent.com/commonmark/commonmark.js/master/package.json');
2019
const pkg = await res.json();
21-
const version = pkg.version.replace(/^(\d+\.\d+).*$/, '$1');
20+
const { version } = pkg;
2221
const res2 = await fetch(`https://spec.commonmark.org/${version}/spec.json`);
2322
const json = await res2.json();
2423
const specs = await Promise.all(json.map(async(spec) => {

0 commit comments

Comments
 (0)