From 65979c05d8279c6624d56c5b67330c4fa0893358 Mon Sep 17 00:00:00 2001 From: v1rtl Date: Thu, 28 Nov 2024 19:27:26 +0200 Subject: [PATCH] remove fs-extra --- package.json | 2 -- pnpm-lock.yaml | 22 ---------------------- scripts/generateComponent.mjs | 7 ++++--- 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index ee6cac7c..81cdf4d2 100644 --- a/package.json +++ b/package.json @@ -39,12 +39,10 @@ "@stylistic/eslint-plugin": "^2.10.1", "@stylistic/stylelint-config": "^2.0.0", "@types/dedent": "^0.7.2", - "@types/fs-extra": "^9.0.13", "@vitest/coverage-v8": "^2.1.4", "change-case": "^4.1.2", "dedent": "^0.7.0", "eslint": "^9.14.0", - "fs-extra": "^10.1.0", "globals": "^15.12.0", "husky": "^7.0.4", "lint-staged": "^11.2.6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c6760a94..3d28536a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -45,9 +45,6 @@ importers: '@types/dedent': specifier: ^0.7.2 version: 0.7.2 - '@types/fs-extra': - specifier: ^9.0.13 - version: 9.0.13 '@vitest/coverage-v8': specifier: ^2.1.4 version: 2.1.4(vitest@2.1.4(@types/node@22.9.0)(jsdom@25.0.1)(terser@5.36.0)) @@ -60,9 +57,6 @@ importers: eslint: specifier: ^9.14.0 version: 9.14.0 - fs-extra: - specifier: ^10.1.0 - version: 10.1.0 globals: specifier: ^15.12.0 version: 15.12.0 @@ -4504,10 +4498,6 @@ packages: resolution: {integrity: sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==} engines: {node: '>=12'} - fs-extra@10.1.0: - resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} - engines: {node: '>=12'} - fs-extra@7.0.1: resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} engines: {node: '>=6 <7 || >=8'} @@ -7381,10 +7371,6 @@ packages: resolution: {integrity: sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==} engines: {node: '>= 10.0.0'} - universalify@2.0.1: - resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} - engines: {node: '>= 10.0.0'} - unpipe@1.0.0: resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} engines: {node: '>= 0.8'} @@ -12999,12 +12985,6 @@ snapshots: jsonfile: 6.1.0 universalify: 2.0.0 - fs-extra@10.1.0: - dependencies: - graceful-fs: 4.2.11 - jsonfile: 6.1.0 - universalify: 2.0.1 - fs-extra@7.0.1: dependencies: graceful-fs: 4.2.11 @@ -16198,8 +16178,6 @@ snapshots: universalify@2.0.0: {} - universalify@2.0.1: {} - unpipe@1.0.0: {} update-browserslist-db@1.0.16(browserslist@4.23.0): diff --git a/scripts/generateComponent.mjs b/scripts/generateComponent.mjs index 06deffd2..4c2b1b02 100644 --- a/scripts/generateComponent.mjs +++ b/scripts/generateComponent.mjs @@ -1,4 +1,5 @@ -import fs from 'fs-extra' +import fs from 'node:fs/promises' +import { existsSync } from 'node:fs' import dedent from 'dedent' import prompt from 'prompt' import path from 'node:path' @@ -46,7 +47,7 @@ const COMPONENT_GROUPS = { const componentDir = path.join(componentsDir, componentGroup, componentName) - const exists = fs.existsSync(componentDir) + const exists = existsSync(componentDir) if (exists) { console.log('Component already exists.') return @@ -56,7 +57,7 @@ const COMPONENT_GROUPS = { // Create directory console.log(`Create directory at ${componentDir}`) - await fs.mkdirp(componentDir) + await fs.mkdir(componentDir, { recursive: true }) /** * Write component file