Skip to content

Commit a0eaf6b

Browse files
committed
Remove superfluous dev-dependencies
1 parent 53361dd commit a0eaf6b

File tree

3 files changed

+19
-42
lines changed

3 files changed

+19
-42
lines changed

package.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,12 @@
6161
"space-separated-tokens": "^2.0.0"
6262
},
6363
"devDependencies": {
64-
"@babel/core": "^7.0.0",
65-
"@babel/plugin-syntax-jsx": "^7.0.0",
66-
"@babel/plugin-transform-react-jsx": "^7.0.0",
67-
"@types/babel__core": "^7.0.0",
6864
"@types/tape": "^4.0.0",
69-
"acorn": "^8.0.0",
7065
"acorn-jsx": "^5.0.0",
71-
"astring": "^1.0.0",
7266
"c8": "^7.0.0",
67+
"esast-util-from-js": "^1.0.0",
7368
"estree-util-build-jsx": "^2.0.0",
69+
"estree-util-to-js": "^1.0.0",
7470
"prettier": "^2.0.0",
7571
"remark-cli": "^11.0.0",
7672
"remark-preset-wooorm": "^9.0.0",

script/generate-jsx.js

Lines changed: 17 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,34 @@
1-
import fs from 'node:fs'
1+
import fs from 'node:fs/promises'
22
import path from 'node:path'
3-
import babel from '@babel/core'
4-
import {Parser} from 'acorn'
53
import acornJsx from 'acorn-jsx'
6-
import {generate} from 'astring'
4+
import {fromJs} from 'esast-util-from-js'
5+
import {toJs} from 'estree-util-to-js'
76
import {buildJsx} from 'estree-util-build-jsx'
87

9-
const doc = String(fs.readFileSync(path.join('test', 'jsx.jsx')))
8+
const doc = String(await fs.readFile(path.join('test', 'jsx.jsx')))
109

11-
fs.writeFileSync(
10+
await fs.writeFile(
1211
path.join('test', 'jsx-build-jsx-classic.js'),
13-
generate(
12+
toJs(
1413
buildJsx(
15-
// @ts-expect-error Acorn nodes are assignable to ESTree nodes.
16-
Parser.extend(acornJsx()).parse(
17-
doc.replace(/'name'/, "'jsx (estree-util-build-jsx, classic)'"),
18-
{sourceType: 'module', ecmaVersion: 2021}
19-
),
14+
fromJs(doc.replace(/'name'/, "'jsx (estree-util-build-jsx, classic)'"), {
15+
plugins: [acornJsx()],
16+
module: true
17+
}),
2018
{pragma: 'h', pragmaFrag: 'null'}
2119
)
22-
)
20+
).value
2321
)
2422

25-
fs.writeFileSync(
23+
await fs.writeFile(
2624
path.join('test', 'jsx-build-jsx-automatic.js'),
27-
generate(
25+
toJs(
2826
buildJsx(
29-
// @ts-expect-error Acorn nodes are assignable to ESTree nodes.
30-
Parser.extend(acornJsx()).parse(
27+
fromJs(
3128
doc.replace(/'name'/, "'jsx (estree-util-build-jsx, automatic)'"),
32-
{sourceType: 'module', ecmaVersion: 2021}
29+
{plugins: [acornJsx()], module: true}
3330
),
34-
{runtime: 'automatic', importSource: '.'}
31+
{runtime: 'automatic', importSource: 'hastscript'}
3532
)
36-
).replace(/\/jsx-runtime(?=["'])/g, './lib/runtime-html.js')
37-
)
38-
39-
fs.writeFileSync(
40-
path.join('test', 'jsx-babel-automatic.js'),
41-
// @ts-expect-error Result always given.
42-
babel
43-
.transformSync(doc.replace(/'name'/, "'jsx (babel, automatic)'"), {
44-
plugins: [
45-
[
46-
'@babel/plugin-transform-react-jsx',
47-
{runtime: 'automatic', importSource: '.'}
48-
]
49-
]
50-
})
51-
.code.replace(/\/jsx-runtime(?=["'])/g, './lib/runtime-html.js')
33+
).value
5234
)

test/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* eslint-disable import/no-unassigned-import */
22
import './core.js'
3-
import './jsx-babel-automatic.js'
43
import './jsx-build-jsx-classic.js'
54
import './jsx-build-jsx-automatic.js'
65
/* eslint-enable import/no-unassigned-import */

0 commit comments

Comments
 (0)