Skip to content

Commit 17380aa

Browse files
authored
chore: replace fs-extra with builtin node:fs (#682)
* chore: replace fs-extra with builtin `node:fs` * chore: remove unused rimrf * chore: replace fast-glob with tinyglobby * chore: remove unused @types/prompt
1 parent 3bd4d8a commit 17380aa

File tree

4 files changed

+13
-132
lines changed

4 files changed

+13
-132
lines changed

package.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,7 @@
136136
"@eslint/config-inspector": "^1.0.2",
137137
"@prettier/plugin-xml": "^3.4.1",
138138
"@stylistic/eslint-plugin-migrate": "^4.2.0",
139-
"@types/fs-extra": "^11.0.4",
140139
"@types/node": "^22.13.9",
141-
"@types/prompts": "^2.4.9",
142140
"@unocss/eslint-plugin": "^66.0.0",
143141
"astro-eslint-parser": "^1.2.1",
144142
"bumpp": "^10.0.3",
@@ -151,16 +149,14 @@
151149
"eslint-plugin-svelte": "^3.0.3",
152150
"eslint-typegen": "^2.0.0",
153151
"execa": "^9.5.2",
154-
"fast-glob": "^3.3.3",
155-
"fs-extra": "^11.3.0",
156152
"jiti": "^2.4.2",
157153
"lint-staged": "^15.4.3",
158154
"prettier-plugin-astro": "^0.14.1",
159155
"prettier-plugin-slidev": "^1.0.5",
160-
"rimraf": "^6.0.1",
161156
"simple-git-hooks": "^2.11.1",
162157
"svelte": "^5.22.2",
163158
"svelte-eslint-parser": "^1.0.1",
159+
"tinyglobby": "^0.2.12",
164160
"tsup": "^8.4.0",
165161
"tsx": "^4.19.3",
166162
"typescript": "^5.8.2",

pnpm-lock.yaml

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

test/cli.spec.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import fs from 'node:fs/promises'
12
import { join } from 'node:path'
23
import process from 'node:process'
34

45
import { execa } from 'execa'
5-
import fs from 'fs-extra'
66
import { afterAll, beforeEach, expect, it } from 'vitest'
77

88
const CLI_PATH = join(__dirname, '../bin/index.js')
@@ -27,7 +27,7 @@ async function run(params: string[] = [], env = {
2727

2828
async function createMockDir() {
2929
await fs.rm(genPath, { recursive: true, force: true })
30-
await fs.ensureDir(genPath)
30+
await fs.mkdir(genPath, { recursive: true })
3131

3232
await Promise.all([
3333
fs.writeFile(join(genPath, 'package.json'), JSON.stringify({}, null, 2)),
@@ -44,7 +44,7 @@ afterAll(async () => await fs.rm(genPath, { recursive: true, force: true }))
4444
it('package.json updated', async () => {
4545
const { stdout } = await run()
4646

47-
const pkgContent: Record<string, any> = await fs.readJSON(join(genPath, 'package.json'))
47+
const pkgContent: Record<string, any> = JSON.parse(await fs.readFile(join(genPath, 'package.json'), 'utf-8'))
4848

4949
expect(JSON.stringify(pkgContent.devDependencies)).toContain('@antfu/eslint-config')
5050
expect(stdout).toContain('Changes wrote to package.json')

0 commit comments

Comments
 (0)