diff --git a/code/.eslintrc.js b/code/.eslintrc.js index 6b27a23c57c6..504719ecb210 100644 --- a/code/.eslintrc.js +++ b/code/.eslintrc.js @@ -21,6 +21,11 @@ module.exports = { 'react-hooks/rules-of-hooks': 'off', 'import/extensions': 'off', // for mjs, we sometimes need extensions 'jsx-a11y/control-has-associated-label': 'off', + 'import/no-extraneous-dependencies': [ + 'error', + { devDependencies: true, peerDependencies: true }, + ], + '@typescript-eslint/dot-notation': [ 'error', { diff --git a/code/__mocks__/fs-extra.ts b/code/__mocks__/fs-extra.ts index 3f996b7c9cda..f30a66290543 100644 --- a/code/__mocks__/fs-extra.ts +++ b/code/__mocks__/fs-extra.ts @@ -15,17 +15,26 @@ export function __setMockFiles(newMockFiles: Record) { export const writeFile = vi.fn(async (filePath: string, content: string) => { mockFiles[filePath] = content; }); +export const readlinkSync = vi.fn(async (filePath: string) => []); +export const readdirSync = vi.fn(async (filePath: string) => []); +export const readdir = vi.fn(async (filePath: string) => []); export const readFile = vi.fn(async (filePath: string) => mockFiles[filePath]); export const readFileSync = vi.fn((filePath = '') => mockFiles[filePath]); +export const realpathSync = vi.fn((filePath = '') => filePath); export const existsSync = vi.fn((filePath: string) => !!mockFiles[filePath]); export const readJson = vi.fn((filePath = '') => JSON.parse(mockFiles[filePath])); export const readJsonSync = vi.fn((filePath = '') => JSON.parse(mockFiles[filePath])); export const lstatSync = vi.fn((filePath: string) => ({ isFile: () => !!mockFiles[filePath], })); +export const lstat = vi.fn((filePath: string) => ({ + isFile: () => !!mockFiles[filePath], +})); export const writeJson = vi.fn((filePath, json, { spaces } = {}) => { mockFiles[filePath] = JSON.stringify(json, null, spaces); }); +export const readlink = vi.fn(async (filePath: string) => []); +export const realpath = vi.fn(async (filePath: string) => filePath); export default { __setMockFiles, @@ -37,4 +46,10 @@ export default { readJsonSync, lstatSync, writeJson, + readdirSync, + readdir, + readlinkSync, + lstat, + readlink, + realpath, }; diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json index 2c22340ce411..d8d1af7b32ad 100644 --- a/code/addons/docs/package.json +++ b/code/addons/docs/package.json @@ -103,7 +103,6 @@ "@storybook/global": "^5.0.0", "@storybook/react-dom-shim": "workspace:*", "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "fs-extra": "^11.1.0", "react": "^16.8.0 || ^17.0.0 || ^18.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", "rehype-external-links": "^3.0.0", diff --git a/code/addons/essentials/src/actions/manager.ts b/code/addons/essentials/src/actions/manager.ts index 9f43dc8f053c..5d7ce129ebe1 100644 --- a/code/addons/essentials/src/actions/manager.ts +++ b/code/addons/essentials/src/actions/manager.ts @@ -1 +1,2 @@ +// @ts-expect-error (no types) export * from '@storybook/addon-actions/manager'; diff --git a/code/addons/essentials/src/backgrounds/preview.ts b/code/addons/essentials/src/backgrounds/preview.ts index cf24112788f3..2d01bf61bb6a 100644 --- a/code/addons/essentials/src/backgrounds/preview.ts +++ b/code/addons/essentials/src/backgrounds/preview.ts @@ -1,2 +1 @@ -// @ts-expect-error (no types needed for this) export * from '@storybook/addon-backgrounds/preview'; diff --git a/code/addons/essentials/src/highlight/preview.ts b/code/addons/essentials/src/highlight/preview.ts index e124e7a1374a..c57b34aafd63 100644 --- a/code/addons/essentials/src/highlight/preview.ts +++ b/code/addons/essentials/src/highlight/preview.ts @@ -1,2 +1 @@ -// @ts-expect-error (no types needed for this) export * from '@storybook/addon-highlight/preview'; diff --git a/code/addons/essentials/src/outline/preview.ts b/code/addons/essentials/src/outline/preview.ts index 3fe09381fe8f..16cc2faa0397 100644 --- a/code/addons/essentials/src/outline/preview.ts +++ b/code/addons/essentials/src/outline/preview.ts @@ -1,2 +1 @@ -// @ts-expect-error (no types needed for this) export * from '@storybook/addon-outline/preview'; diff --git a/code/addons/essentials/src/viewport/preview.ts b/code/addons/essentials/src/viewport/preview.ts index 34ee7de45614..b039b3bfa870 100644 --- a/code/addons/essentials/src/viewport/preview.ts +++ b/code/addons/essentials/src/viewport/preview.ts @@ -1,2 +1 @@ -// @ts-expect-error (no types needed for this) export * from '@storybook/addon-viewport/preview'; diff --git a/code/addons/links/package.json b/code/addons/links/package.json index d3a651a79eba..83ff54ce48ee 100644 --- a/code/addons/links/package.json +++ b/code/addons/links/package.json @@ -71,7 +71,6 @@ "ts-dedent": "^2.0.0" }, "devDependencies": { - "fs-extra": "^11.1.0", "typescript": "^5.3.2" }, "peerDependencies": { diff --git a/code/addons/links/scripts/fix-preview-api-reference.ts b/code/addons/links/scripts/fix-preview-api-reference.ts index 71ca667999e2..90d54704768d 100644 --- a/code/addons/links/scripts/fix-preview-api-reference.ts +++ b/code/addons/links/scripts/fix-preview-api-reference.ts @@ -1,4 +1,4 @@ -import { readFile, writeFile } from 'fs-extra'; +import { readFile, writeFile } from 'node:fs/promises'; /* I wish this wasn't needed.. * There seems to be some bug in tsup / the unlaying lib that does DTS bundling diff --git a/code/builders/builder-vite/package.json b/code/builders/builder-vite/package.json index 596fc2e8c07c..cda94faffed7 100644 --- a/code/builders/builder-vite/package.json +++ b/code/builders/builder-vite/package.json @@ -17,18 +17,17 @@ }, "license": "MIT", "author": "Eirik Sletteberg", + "type": "module", "exports": { ".": { "types": "./dist/index.d.ts", - "node": "./dist/index.js", - "import": "./dist/index.mjs", - "require": "./dist/index.js" + "import": "./dist/index.js" }, "./input/iframe.html": "./input/iframe.html", "./package.json": "./package.json" }, "main": "dist/index.js", - "module": "dist/index.mjs", + "module": "dist/index.js", "types": "dist/index.d.ts", "files": [ "dist/**/*", @@ -49,13 +48,15 @@ "es-module-lexer": "^1.5.0", "express": "^4.19.2", "find-cache-dir": "^3.0.0", - "fs-extra": "^11.1.0", "magic-string": "^0.30.0", "ts-dedent": "^2.0.0" }, "devDependencies": { + "@ndelangen/fs-extra-unified": "^1.0.4", "@types/express": "^4.17.21", + "@types/fs-extra": "^11.0.4", "@types/node": "^22.0.0", + "fs-extra": "^11.1.0", "glob": "^10.0.0", "slash": "^5.0.0", "typescript": "^5.3.2", @@ -86,6 +87,9 @@ "entries": [ "./src/index.ts" ], + "formats": [ + "esm" + ], "platform": "node" }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" diff --git a/code/builders/builder-vite/src/index.ts b/code/builders/builder-vite/src/index.ts index a8a775a13344..a0724df3a8f1 100644 --- a/code/builders/builder-vite/src/index.ts +++ b/code/builders/builder-vite/src/index.ts @@ -1,13 +1,13 @@ // noinspection JSUnusedGlobalSymbols +import { readFile } from 'node:fs/promises'; import { join, parse } from 'node:path'; import { NoStatsForViteDevError } from 'storybook/internal/server-errors'; import type { Options } from 'storybook/internal/types'; +import { copy } from '@ndelangen/fs-extra-unified'; import type { RequestHandler } from 'express'; import express from 'express'; -import * as fs from 'fs-extra'; -import { corePath } from 'storybook/core-path'; import type { ViteDevServer } from 'vite'; import { build as viteBuild } from './build'; @@ -34,7 +34,7 @@ function iframeMiddleware(options: Options, server: ViteDevServer): RequestHandl return; } - const indexHtml = await fs.readFile( + const indexHtml = await readFile( require.resolve('@storybook/builder-vite/input/iframe.html'), 'utf-8' ); @@ -59,7 +59,7 @@ export const start: ViteBuilder['start'] = async ({ }) => { server = await createViteServer(options as Options, devServer); - const previewResolvedDir = join(corePath, 'dist/preview'); + const previewResolvedDir = join((await import('storybook/core-path')).corePath, 'dist/preview'); const previewDirOrigin = previewResolvedDir; router.use(`/sb-preview`, express.static(previewDirOrigin, { immutable: true, maxAge: '5m' })); @@ -81,11 +81,11 @@ export const start: ViteBuilder['start'] = async ({ export const build: ViteBuilder['build'] = async ({ options }) => { const viteCompilation = viteBuild(options as Options); - const previewResolvedDir = join(corePath, 'dist/preview'); + const previewResolvedDir = join((await import('storybook/core-path')).corePath, 'dist/preview'); const previewDirOrigin = previewResolvedDir; const previewDirTarget = join(options.outputDir || '', `sb-preview`); - const previewFiles = fs.copy(previewDirOrigin, previewDirTarget, { + const previewFiles = copy(previewDirOrigin, previewDirTarget, { filter: (src) => { const { ext } = parse(src); if (ext) { diff --git a/code/builders/builder-vite/src/plugins/external-globals-plugin.ts b/code/builders/builder-vite/src/plugins/external-globals-plugin.ts index 1c7ada46b7be..abbbda12b211 100644 --- a/code/builders/builder-vite/src/plugins/external-globals-plugin.ts +++ b/code/builders/builder-vite/src/plugins/external-globals-plugin.ts @@ -1,8 +1,9 @@ +import { writeFile } from 'node:fs/promises'; import { join } from 'node:path'; +import { ensureFile } from '@ndelangen/fs-extra-unified'; import { init, parse } from 'es-module-lexer'; import findCacheDirectory from 'find-cache-dir'; -import { ensureFile, writeFile } from 'fs-extra'; import MagicString from 'magic-string'; import type { Alias, Plugin } from 'vite'; diff --git a/code/builders/builder-vite/src/vite-server.ts b/code/builders/builder-vite/src/vite-server.ts index ff235aa93833..479258b3dc9a 100644 --- a/code/builders/builder-vite/src/vite-server.ts +++ b/code/builders/builder-vite/src/vite-server.ts @@ -1,6 +1,6 @@ -import type { Options } from 'storybook/internal/types'; +import type { Server } from 'node:http'; -import type { Server } from 'http'; +import type { Options } from 'storybook/internal/types'; import { getAssetsInclude } from './assetsInclude'; import { sanitizeEnvVars } from './envs'; diff --git a/code/builders/builder-webpack5/package.json b/code/builders/builder-webpack5/package.json index 9fd27dd4d784..7ea9aaa6248b 100644 --- a/code/builders/builder-webpack5/package.json +++ b/code/builders/builder-webpack5/package.json @@ -74,7 +74,6 @@ "es-module-lexer": "^1.5.0", "express": "^4.19.2", "fork-ts-checker-webpack-plugin": "^8.0.0", - "fs-extra": "^11.1.0", "html-webpack-plugin": "^5.5.0", "magic-string": "^0.30.5", "path-browserify": "^1.0.1", @@ -92,9 +91,12 @@ "webpack-virtual-modules": "^0.6.0" }, "devDependencies": { + "@ndelangen/fs-extra-unified": "^1.0.4", + "@types/fs-extra": "^11.0.4", "@types/pretty-hrtime": "^1.0.0", "@types/terser-webpack-plugin": "^5.2.0", "@types/webpack-hot-middleware": "^2.25.6", + "fs-extra": "^11.1.0", "pretty-hrtime": "^1.0.3", "slash": "^5.0.0", "typescript": "^5.3.2" diff --git a/code/builders/builder-webpack5/src/index.ts b/code/builders/builder-webpack5/src/index.ts index f9a83f8efaf2..945414d6099f 100644 --- a/code/builders/builder-webpack5/src/index.ts +++ b/code/builders/builder-webpack5/src/index.ts @@ -11,10 +11,9 @@ import type { Builder, Options } from 'storybook/internal/types'; import { checkWebpackVersion } from '@storybook/core-webpack'; +import { copy } from '@ndelangen/fs-extra-unified'; import express from 'express'; -import fs from 'fs-extra'; import prettyTime from 'pretty-hrtime'; -import { corePath } from 'storybook/core-path'; import type { Configuration, Stats, StatsOptions } from 'webpack'; import webpack, { ProgressPlugin } from 'webpack'; import webpackDevMiddleware from 'webpack-dev-middleware'; @@ -179,7 +178,7 @@ const starter: StarterFunction = async function* starterGeneratorFn({ compilation = webpackDevMiddleware(compiler, middlewareOptions); - const previewResolvedDir = join(corePath, 'dist/preview'); + const previewResolvedDir = join((await import('storybook/core-path')).corePath, 'dist/preview'); const previewDirOrigin = previewResolvedDir; router.use(`/sb-preview`, express.static(previewDirOrigin, { immutable: true, maxAge: '5m' })); @@ -288,11 +287,11 @@ const builder: BuilderFunction = async function* builderGeneratorFn({ startTime, }); }); - const previewResolvedDir = join(corePath, 'dist/preview'); + const previewResolvedDir = join((await import('storybook/core-path')).corePath, 'dist/preview'); const previewDirOrigin = previewResolvedDir; const previewDirTarget = join(options.outputDir || '', `sb-preview`); - const previewFiles = fs.copy(previewDirOrigin, previewDirTarget, { + const previewFiles = copy(previewDirOrigin, previewDirTarget, { filter: (src) => { const { ext } = parse(src); if (ext) { diff --git a/code/core/package.json b/code/core/package.json index bff10efa0dc9..c8e4cb6afe27 100644 --- a/code/core/package.json +++ b/code/core/package.json @@ -303,6 +303,7 @@ "@emotion/styled": "^11.11.0", "@emotion/use-insertion-effect-with-fallbacks": "^1.0.1", "@fal-works/esbuild-plugin-global-externals": "^2.1.2", + "@ndelangen/fs-extra-unified": "^1.0.4", "@ndelangen/get-tarball": "^3.0.7", "@popperjs/core": "^2.6.0", "@radix-ui/react-dialog": "^1.0.5", @@ -405,6 +406,7 @@ "react-transition-group": "^4.4.5", "require-from-string": "^2.0.2", "resolve-from": "^5.0.0", + "resolve.exports": "^2.0.2", "slash": "^5.0.0", "source-map": "^0.7.4", "store2": "^2.14.2", diff --git a/code/core/scripts/entries.ts b/code/core/scripts/entries.ts index afe8acddd84d..e50627d6812b 100644 --- a/code/core/scripts/entries.ts +++ b/code/core/scripts/entries.ts @@ -3,7 +3,7 @@ import { defineEntry } from '../../../scripts/prepare/tools'; export const getEntries = (cwd: string) => { const define = defineEntry(cwd); return [ - // empty, right now, TDB what to do with this + // empty, right now, TBD what to do with this define('src/index.ts', ['node', 'browser'], true), define('src/node-logger/index.ts', ['node'], true), diff --git a/code/core/scripts/helpers/dependencies.ts b/code/core/scripts/helpers/dependencies.ts index 82b22a022ad4..03fcb0088582 100644 --- a/code/core/scripts/helpers/dependencies.ts +++ b/code/core/scripts/helpers/dependencies.ts @@ -1,6 +1,6 @@ import { join } from 'node:path'; -import { readJson } from 'fs-extra'; +import { readJson } from '@ndelangen/fs-extra-unified'; export async function flattenDependencies( list: string[], diff --git a/code/core/scripts/helpers/generatePackageJsonFile.ts b/code/core/scripts/helpers/generatePackageJsonFile.ts index 9ecf2f7679e5..0ea2929f45de 100644 --- a/code/core/scripts/helpers/generatePackageJsonFile.ts +++ b/code/core/scripts/helpers/generatePackageJsonFile.ts @@ -1,7 +1,7 @@ import { writeFile } from 'node:fs/promises'; import { join, relative } from 'node:path'; -import { readJSON } from 'fs-extra'; +import { readJSON } from '@ndelangen/fs-extra-unified'; import slash from 'slash'; import { sortPackageJson } from '../../../../scripts/prepare/tools'; diff --git a/code/core/scripts/helpers/generateTypesMapperFiles.ts b/code/core/scripts/helpers/generateTypesMapperFiles.ts index 2f79f80643d8..2e55aa02816f 100644 --- a/code/core/scripts/helpers/generateTypesMapperFiles.ts +++ b/code/core/scripts/helpers/generateTypesMapperFiles.ts @@ -1,7 +1,7 @@ import { writeFile } from 'node:fs/promises'; import { join, relative } from 'node:path'; -import { ensureFile } from 'fs-extra'; +import { ensureFile } from '@ndelangen/fs-extra-unified'; import { dedent } from '../../../../scripts/prepare/tools'; import type { getEntries } from '../entries'; diff --git a/code/core/scripts/prep.ts b/code/core/scripts/prep.ts index 49c2bd00cfa0..0ce19ae05976 100644 --- a/code/core/scripts/prep.ts +++ b/code/core/scripts/prep.ts @@ -3,7 +3,7 @@ import { watch } from 'node:fs'; import { mkdir, rm, writeFile } from 'node:fs/promises'; import { dirname, join } from 'node:path'; -import { ensureDir } from 'fs-extra'; +import { ensureDir } from '@ndelangen/fs-extra-unified'; import { chalk, diff --git a/code/core/src/builder-manager/index.ts b/code/core/src/builder-manager/index.ts index 1e246b5d1cb1..330fc6892e0c 100644 --- a/code/core/src/builder-manager/index.ts +++ b/code/core/src/builder-manager/index.ts @@ -1,3 +1,4 @@ +import { writeFile } from 'node:fs/promises'; import { dirname, join, parse } from 'node:path'; import { stringifyProcessEnvs } from '@storybook/core/common'; @@ -6,10 +7,10 @@ import { globalsModuleInfoMap } from '@storybook/core/manager/globals-module-inf import { logger } from '@storybook/core/node-logger'; import { globalExternals } from '@fal-works/esbuild-plugin-global-externals'; +import { copy, remove } from '@ndelangen/fs-extra-unified'; import { pnpPlugin } from '@yarnpkg/esbuild-plugin-pnp'; import aliasPlugin from 'esbuild-plugin-alias'; import express from 'express'; -import fs from 'fs-extra'; import type { BuilderBuildResult, @@ -149,7 +150,7 @@ const starter: StarterFunction = async function* starterGeneratorFn({ // make sure we clear output directory of addons dir before starting // this could cause caching issues where addons are loaded when they shouldn't const addonsDir = config.outdir; - await fs.remove(addonsDir); + await remove(addonsDir); yield; @@ -256,7 +257,7 @@ const builder: BuilderFunction = async function* builderGeneratorFn({ startTime, yield; - const managerFiles = fs.copy(coreDirOrigin, coreDirTarget, { + const managerFiles = copy(coreDirOrigin, coreDirTarget, { filter: (src) => { const { ext } = parse(src); if (ext) { @@ -290,7 +291,7 @@ const builder: BuilderFunction = async function* builderGeneratorFn({ startTime, await Promise.all([ // - fs.writeFile(join(options.outputDir, 'index.html'), html), + writeFile(join(options.outputDir, 'index.html'), html), managerFiles, ]); diff --git a/code/core/src/builder-manager/utils/files.ts b/code/core/src/builder-manager/utils/files.ts index 94ec31677c4a..93c707e2dc60 100644 --- a/code/core/src/builder-manager/utils/files.ts +++ b/code/core/src/builder-manager/utils/files.ts @@ -1,7 +1,8 @@ +import { writeFile } from 'node:fs/promises'; import { join, normalize } from 'node:path'; +import { ensureFile } from '@ndelangen/fs-extra-unified'; import type { OutputFile } from 'esbuild'; -import fs from 'fs-extra'; import slash from 'slash'; import type { Compilation } from '../types'; @@ -15,8 +16,8 @@ export async function readOrderedFiles( // convert deeply nested paths to a single level, also remove special characters const { location, url } = sanitizePath(file, addonsDir); - await fs.ensureFile(location); - await fs.writeFile(location, file.contents); + await ensureFile(location); + await writeFile(location, file.contents); return url; }) || [] ); diff --git a/code/core/src/builder-manager/utils/managerEntries.ts b/code/core/src/builder-manager/utils/managerEntries.ts index d808596f52e4..2cb2a9708b67 100644 --- a/code/core/src/builder-manager/utils/managerEntries.ts +++ b/code/core/src/builder-manager/utils/managerEntries.ts @@ -1,8 +1,9 @@ +import { writeFile } from 'node:fs/promises'; import { join, parse, relative, sep } from 'node:path'; import { resolvePathInStorybookCache } from '@storybook/core/common'; -import fs from 'fs-extra'; +import { ensureFile } from '@ndelangen/fs-extra-unified'; import slash from 'slash'; const sanitizeBase = (path: string) => { @@ -55,8 +56,8 @@ export async function wrapManagerEntries(entrypoints: string[], uniqueId?: strin sanitizeFinal(join(`${sanitizeBase(base)}-${i}`, `${sanitizeBase(name)}-bundle.js`)) ); - await fs.ensureFile(location); - await fs.writeFile(location, `import '${slash(entry)}';`); + await ensureFile(location); + await writeFile(location, `import '${slash(entry)}';`); return location; }) diff --git a/code/core/src/builder-manager/utils/template.ts b/code/core/src/builder-manager/utils/template.ts index b264a3d5e02e..d95cf4bac0c6 100644 --- a/code/core/src/builder-manager/utils/template.ts +++ b/code/core/src/builder-manager/utils/template.ts @@ -1,9 +1,9 @@ +import { readFile } from 'node:fs/promises'; import { dirname, join } from 'node:path'; import type { DocsOptions, Options, Ref, TagsOptions } from '@storybook/core/types'; import { render } from 'ejs'; -import fs from 'fs-extra'; export const getTemplatePath = async (template: string) => { return join(dirname(require.resolve('@storybook/core/package.json')), 'assets/server', template); @@ -12,7 +12,7 @@ export const getTemplatePath = async (template: string) => { export const readTemplate = async (template: string) => { const path = await getTemplatePath(template); - return fs.readFile(path, 'utf8'); + return readFile(path, 'utf8'); }; export async function getManagerMainTemplate() { diff --git a/code/core/src/cli/detect.test.ts b/code/core/src/cli/detect.test.ts index f12ece4314fa..ebae3d7d7513 100644 --- a/code/core/src/cli/detect.test.ts +++ b/code/core/src/cli/detect.test.ts @@ -26,7 +26,7 @@ vi.mock('fs', () => ({ default: vi.fn(), })); -vi.mock('fs-extra', () => ({ +vi.mock('@ndelangen/fs-extra-unified', () => ({ pathExistsSync: vi.fn(() => true), })); diff --git a/code/core/src/cli/eslintPlugin.ts b/code/core/src/cli/eslintPlugin.ts index 4b8d47b293a2..e6bb7dce0011 100644 --- a/code/core/src/cli/eslintPlugin.ts +++ b/code/core/src/cli/eslintPlugin.ts @@ -1,16 +1,17 @@ import { existsSync } from 'node:fs'; +import { readFile } from 'node:fs/promises'; import type { JsPackageManager } from '@storybook/core/common'; import { paddedLog } from '@storybook/core/common'; -import { readConfig, writeConfig } from '@storybook/core/csf-tools'; - +import { readJson, writeJson } from '@ndelangen/fs-extra-unified'; import chalk from 'chalk'; import detectIndent from 'detect-indent'; -import { readFile, readJson, writeJson } from 'fs-extra'; import prompts from 'prompts'; import { dedent } from 'ts-dedent'; +import { readConfig, writeConfig } from '../csf-tools/ConfigFile'; + export const SUPPORTED_ESLINT_EXTENSIONS = ['js', 'cjs', 'json']; const UNSUPPORTED_ESLINT_EXTENSIONS = ['yaml', 'yml']; diff --git a/code/core/src/cli/helpers.test.ts b/code/core/src/cli/helpers.test.ts index cff797a8f505..2c90aab9c717 100644 --- a/code/core/src/cli/helpers.test.ts +++ b/code/core/src/cli/helpers.test.ts @@ -1,12 +1,19 @@ +import { sep } from 'node:path'; + import { beforeEach, describe, expect, it, vi } from 'vitest'; import type { JsPackageManager } from '@storybook/core/common'; -import fse from 'fs-extra'; -import { sep } from 'path'; +import { copy, copySync, pathExists } from '@ndelangen/fs-extra-unified'; import { IS_WINDOWS } from '../../../vitest.helpers'; -import * as helpers from './helpers'; +import { + coerceSemver, + copyTemplate, + copyTemplateFiles, + getStorybookVersionSpecifier, + hasStorybookDependencies, +} from './helpers'; import type { SupportedRenderers } from './project_types'; import { SupportedLanguage } from './project_types'; @@ -42,8 +49,19 @@ vi.mock('./dirs', () => ({ normalizePath(`@storybook/${renderer}`), })); -vi.mock('fs-extra', async (importOriginal) => { - const actual = await importOriginal(); +vi.mock('@ndelangen/fs-extra-unified', async (importOriginal) => { + const actual = await importOriginal(); + return { + ...actual, + ...fseMocks, + default: { + ...actual, + ...fseMocks, + }, + }; +}); +vi.mock('node:fs/promises', async (importOriginal) => { + const actual = await importOriginal(); return { ...actual, ...fseMocks, @@ -81,9 +99,9 @@ describe('Helpers', () => { const csfDirectory = /template-csf\/$/; fsMocks.existsSync.mockReturnValue(true); - helpers.copyTemplate(''); + copyTemplate(''); - expect(fse.copySync).toHaveBeenCalledWith( + expect(copySync).toHaveBeenCalledWith( expect.stringMatching(csfDirectory), expect.anything(), expect.anything() @@ -94,7 +112,7 @@ describe('Helpers', () => { fsMocks.existsSync.mockReturnValue(false); expect(() => { - helpers.copyTemplate(''); + copyTemplate(''); }).toThrowError("Couldn't find template dir"); }); }); @@ -120,14 +138,14 @@ describe('Helpers', () => { componentsDirectory.includes(filePath) || filePath === normalizePath('@storybook/react/template/cli') ); - await helpers.copyTemplateFiles({ + await copyTemplateFiles({ renderer: 'react', language, packageManager: packageManagerMock, commonAssetsDir: normalizePath('create-storybook/rendererAssets/common'), }); - expect(fse.copy).toHaveBeenNthCalledWith( + expect(copy).toHaveBeenNthCalledWith( 1, normalizePath('create-storybook/rendererAssets/common'), './stories', @@ -135,44 +153,39 @@ describe('Helpers', () => { ); const expectedDirectory = normalizePath(`@storybook/react/template/cli${expected}`); - expect(fse.copy).toHaveBeenNthCalledWith( - 2, - expectedDirectory, - './stories', - expect.anything() - ); + expect(copy).toHaveBeenNthCalledWith(2, expectedDirectory, './stories', expect.anything()); } ); it(`should copy to src folder when exists`, async () => { - vi.mocked(fse.pathExists).mockImplementation((filePath) => { + vi.mocked(pathExists).mockImplementation((filePath) => { return filePath === normalizePath('@storybook/react/template/cli') || filePath === './src'; }); - await helpers.copyTemplateFiles({ + await copyTemplateFiles({ renderer: 'react', language: SupportedLanguage.JAVASCRIPT, packageManager: packageManagerMock, }); - expect(fse.copy).toHaveBeenCalledWith(expect.anything(), './src/stories', expect.anything()); + expect(copy).toHaveBeenCalledWith(expect.anything(), './src/stories', expect.anything()); }); it(`should copy to root folder when src doesn't exist`, async () => { - vi.mocked(fse.pathExists).mockImplementation((filePath) => { + vi.mocked(pathExists).mockImplementation((filePath) => { return filePath === normalizePath('@storybook/react/template/cli'); }); - await helpers.copyTemplateFiles({ + await copyTemplateFiles({ renderer: 'react', language: SupportedLanguage.JAVASCRIPT, packageManager: packageManagerMock, }); - expect(fse.copy).toHaveBeenCalledWith(expect.anything(), './stories', expect.anything()); + expect(copy).toHaveBeenCalledWith(expect.anything(), './stories', expect.anything()); }); it(`should throw an error for unsupported renderer`, async () => { const renderer = 'unknown renderer' as SupportedRenderers; const expectedMessage = `Unsupported renderer: ${renderer}`; await expect( - helpers.copyTemplateFiles({ + copyTemplateFiles({ renderer, language: SupportedLanguage.JAVASCRIPT, packageManager: packageManagerMock, @@ -183,7 +196,7 @@ describe('Helpers', () => { describe('getStorybookVersionSpecifier', () => { it(`should return the specifier if storybook lib exists in package.json`, () => { expect( - helpers.getStorybookVersionSpecifier({ + getStorybookVersionSpecifier({ dependencies: {}, devDependencies: { '@storybook/react': '^x.x.x', @@ -194,7 +207,7 @@ describe('Helpers', () => { it(`should throw an error if no package is found`, () => { expect(() => { - helpers.getStorybookVersionSpecifier({ + getStorybookVersionSpecifier({ dependencies: {}, devDependencies: { 'something-else': '^x.x.x', @@ -208,21 +221,21 @@ describe('Helpers', () => { it(`should throw if the version argument is invalid semver string`, () => { const invalidSemverString = 'hello, world'; expect(() => { - helpers.coerceSemver(invalidSemverString); + coerceSemver(invalidSemverString); }).toThrowError(`Could not coerce ${invalidSemverString} into a semver.`); }); }); describe('hasStorybookDependencies', () => { it(`should return true when any storybook dependency exists`, async () => { - const result = await helpers.hasStorybookDependencies({ + const result = await hasStorybookDependencies({ getAllDependencies: async () => ({ storybook: 'x.y.z' }), } as unknown as JsPackageManager); expect(result).toEqual(true); }); it(`should return false when no storybook dependency exists`, async () => { - const result = await helpers.hasStorybookDependencies({ + const result = await hasStorybookDependencies({ getAllDependencies: async () => ({ axios: 'x.y.z' }), } as unknown as JsPackageManager); expect(result).toEqual(false); diff --git a/code/core/src/cli/helpers.ts b/code/core/src/cli/helpers.ts index 355e142cece1..743423a07749 100644 --- a/code/core/src/cli/helpers.ts +++ b/code/core/src/cli/helpers.ts @@ -1,4 +1,5 @@ import { existsSync, readFileSync, writeFileSync } from 'node:fs'; +import { readFile, writeFile } from 'node:fs/promises'; import { join, resolve } from 'node:path'; import { @@ -10,9 +11,9 @@ import { import { versions as storybookMonorepoPackages } from '@storybook/core/common'; import type { SupportedFrameworks, SupportedRenderers } from '@storybook/core/types'; +import { copy, copySync, pathExists } from '@ndelangen/fs-extra-unified'; import chalk from 'chalk'; import { findUpSync } from 'find-up'; -import { copy, copySync, pathExists, readFile, writeFile } from 'fs-extra'; import { coerce, satisfies } from 'semver'; import stripJsonComments from 'strip-json-comments'; import invariant from 'tiny-invariant'; diff --git a/code/core/src/common/js-package-manager/JsPackageManager.ts b/code/core/src/common/js-package-manager/JsPackageManager.ts index 4b3e00c2f5e7..359c45351a01 100644 --- a/code/core/src/common/js-package-manager/JsPackageManager.ts +++ b/code/core/src/common/js-package-manager/JsPackageManager.ts @@ -60,7 +60,7 @@ export abstract class JsPackageManager { /** Get the INSTALLED version of a package from the package.json file */ async getPackageVersion(packageName: string, basePath = this.cwd): Promise { const packageJSON = await this.getPackageJSON(packageName, basePath); - return packageJSON ? packageJSON.version ?? null : null; + return packageJSON ? (packageJSON.version ?? null) : null; } constructor(options?: JsPackageManagerOptions) { diff --git a/code/core/src/common/js-package-manager/PNPMProxy.ts b/code/core/src/common/js-package-manager/PNPMProxy.ts index f8df230d0fe6..d43c749ff2b9 100644 --- a/code/core/src/common/js-package-manager/PNPMProxy.ts +++ b/code/core/src/common/js-package-manager/PNPMProxy.ts @@ -3,8 +3,8 @@ import { join } from 'node:path'; import { FindPackageVersionsError } from '@storybook/core/server-errors'; +import { pathExistsSync } from '@ndelangen/fs-extra-unified'; import { findUpSync } from 'find-up'; -import { pathExistsSync } from 'fs-extra'; import { dedent } from 'ts-dedent'; import { createLogStream } from '../utils/cli'; diff --git a/code/core/src/common/utils/cli.ts b/code/core/src/common/utils/cli.ts index 00b831133d2a..c04f9382349b 100644 --- a/code/core/src/common/utils/cli.ts +++ b/code/core/src/common/utils/cli.ts @@ -1,9 +1,9 @@ -import { realpath } from 'node:fs/promises'; +import { type WriteStream, createWriteStream, mkdirSync } from 'node:fs'; +import { readFile, realpath, writeFile } from 'node:fs/promises'; import os from 'node:os'; import { join } from 'node:path'; -import type { WriteStream } from 'fs-extra'; -import { createWriteStream, mkdirSync, move, readFile, remove, writeFile } from 'fs-extra'; +import { move, remove } from '@ndelangen/fs-extra-unified'; import { type MergeExclusive } from 'type-fest'; import uniqueString from 'unique-string'; diff --git a/code/core/src/common/utils/get-storybook-info.ts b/code/core/src/common/utils/get-storybook-info.ts index af65546949eb..4b85e5e3c4c8 100644 --- a/code/core/src/common/utils/get-storybook-info.ts +++ b/code/core/src/common/utils/get-storybook-info.ts @@ -3,7 +3,7 @@ import { join } from 'node:path'; import type { SupportedFrameworks } from '@storybook/core/types'; import type { CoreCommon_StorybookInfo, PackageJson } from '@storybook/core/types'; -import { pathExistsSync } from 'fs-extra'; +import { pathExistsSync } from '@ndelangen/fs-extra-unified'; import { getStorybookConfiguration } from './get-storybook-configuration'; diff --git a/code/core/src/common/utils/get-storybook-refs.ts b/code/core/src/common/utils/get-storybook-refs.ts index 053ae17abc93..52d77a0b91a2 100644 --- a/code/core/src/common/utils/get-storybook-refs.ts +++ b/code/core/src/common/utils/get-storybook-refs.ts @@ -4,8 +4,8 @@ import type { Options, Ref } from '@storybook/core/types'; import { logger } from '@storybook/core/node-logger'; +import { readJSON } from '@ndelangen/fs-extra-unified'; import { findUp } from 'find-up'; -import { readJSON } from 'fs-extra'; import resolveFrom from 'resolve-from'; export const getAutoRefs = async (options: Options): Promise> => { diff --git a/code/core/src/core-server/build-dev.ts b/code/core/src/core-server/build-dev.ts index 5c87a7d9ccd8..c4ef91395095 100644 --- a/code/core/src/core-server/build-dev.ts +++ b/code/core/src/core-server/build-dev.ts @@ -1,3 +1,4 @@ +import { readFile } from 'node:fs/promises'; import { join, relative, resolve } from 'node:path'; import { @@ -16,9 +17,8 @@ import type { BuilderOptions, CLIOptions, LoadOptions, Options } from '@storyboo import { global } from '@storybook/global'; import { deprecate } from '@storybook/core/node-logger'; -import { MissingBuilderError, NoStatsForViteDevError } from '@storybook/core/server-errors'; +import { MissingBuilderError } from '@storybook/core/server-errors'; -import { readFile } from 'fs-extra'; import prompts from 'prompts'; import invariant from 'tiny-invariant'; import { dedent } from 'ts-dedent'; @@ -214,7 +214,7 @@ export async function buildDevStandalone( try { warnings.push(...(previewStats?.toJson()?.warnings || [])); } catch (err) { - if (err instanceof NoStatsForViteDevError) { + if ((err as Error).toString().includes('SB_BUILDER-VITE_0001')) { // pass, the Vite builder has no warnings in the stats object anyway, // but no stats at all in dev mode } else { diff --git a/code/core/src/core-server/build-static.ts b/code/core/src/core-server/build-static.ts index 248b2746ea8c..50ba89f4e9d1 100644 --- a/code/core/src/core-server/build-static.ts +++ b/code/core/src/core-server/build-static.ts @@ -13,8 +13,8 @@ import { global } from '@storybook/global'; import { logger } from '@storybook/core/node-logger'; +import { copy, emptyDir, ensureDir } from '@ndelangen/fs-extra-unified'; import chalk from 'chalk'; -import { copy, emptyDir, ensureDir } from 'fs-extra'; import { StoryIndexGenerator } from './utils/StoryIndexGenerator'; import { buildOrThrow } from './utils/build-or-throw'; diff --git a/code/core/src/core-server/presets/common-preset.ts b/code/core/src/core-server/presets/common-preset.ts index bca9a1c9cfe6..0093b5fca411 100644 --- a/code/core/src/core-server/presets/common-preset.ts +++ b/code/core/src/core-server/presets/common-preset.ts @@ -1,3 +1,4 @@ +import { readFile } from 'node:fs/promises'; import { dirname, isAbsolute, join } from 'node:path'; import type { Channel } from '@storybook/core/channels'; @@ -21,7 +22,7 @@ import type { import { readCsf } from '@storybook/core/csf-tools'; import { logger } from '@storybook/core/node-logger'; -import { pathExists, readFile } from 'fs-extra'; +import { pathExists } from '@ndelangen/fs-extra-unified'; import { dedent } from 'ts-dedent'; import { initCreateNewStoryChannel } from '../server-channel/create-new-story-channel'; diff --git a/code/core/src/core-server/presets/favicon.test.ts b/code/core/src/core-server/presets/favicon.test.ts index 7af2bfbfb34d..fb351f7eea61 100644 --- a/code/core/src/core-server/presets/favicon.test.ts +++ b/code/core/src/core-server/presets/favicon.test.ts @@ -4,7 +4,7 @@ import { expect, it, vi } from 'vitest'; import { logger } from '@storybook/core/node-logger'; -import * as fs from 'fs-extra'; +import * as fs from '@ndelangen/fs-extra-unified'; import * as m from './common-preset'; @@ -30,7 +30,7 @@ const createOptions = (locations: string[]): Parameters[1] => }, }); -vi.mock('fs-extra', () => { +vi.mock('@ndelangen/fs-extra-unified', () => { return { pathExists: vi.fn((p: string) => { return false; diff --git a/code/core/src/core-server/utils/StoryIndexGenerator.ts b/code/core/src/core-server/utils/StoryIndexGenerator.ts index 0c5338debf88..86c2968e6885 100644 --- a/code/core/src/core-server/utils/StoryIndexGenerator.ts +++ b/code/core/src/core-server/utils/StoryIndexGenerator.ts @@ -1,4 +1,6 @@ /* eslint-disable no-underscore-dangle */ +import { existsSync } from 'node:fs'; +import { readFile } from 'node:fs/promises'; import { dirname, extname, join, normalize, relative, resolve, sep } from 'node:path'; import { commonGlobOptions, normalizeStoryPath } from '@storybook/core/common'; @@ -23,7 +25,6 @@ import { sortStoriesV7, userOrAutoTitleFromSpecifier } from '@storybook/core/pre import chalk from 'chalk'; import { findUp } from 'find-up'; -import fs from 'fs-extra'; import slash from 'slash'; import invariant from 'tiny-invariant'; import { dedent } from 'ts-dedent'; @@ -324,7 +325,7 @@ export class StoryIndexGenerator { const absoluteComponentPath = resolve(dirname(absolutePath), rawPath); const existing = ['', '.js', '.ts', '.jsx', '.tsx', '.mjs', '.mts'] .map((ext) => `${absoluteComponentPath}${ext}`) - .find((candidate) => fs.existsSync(candidate)); + .find((candidate) => existsSync(candidate)); if (existing) { const relativePath = relative(this.options.workingDir, existing); return slash(normalizeStoryPath(relativePath)); @@ -432,7 +433,7 @@ export class StoryIndexGenerator { const normalizedPath = normalizeStoryPath(relativePath); const importPath = slash(normalizedPath); - const content = await fs.readFile(absolutePath, 'utf8'); + const content = await readFile(absolutePath, 'utf8'); const { analyze } = await import('@storybook/docs-mdx'); const result = await analyze(content); @@ -753,9 +754,9 @@ export class StoryIndexGenerator { async getPreviewCode() { const previewFile = ['js', 'jsx', 'ts', 'tsx', 'mjs', 'cjs', 'mts'] .map((ext) => join(this.options.configDir, `preview.${ext}`)) - .find((fname) => fs.existsSync(fname)); + .find((fname) => existsSync(fname)); - return previewFile && (await fs.readFile(previewFile, 'utf-8')).toString(); + return previewFile && (await readFile(previewFile, 'utf-8')).toString(); } getProjectTags(previewCode?: string) { diff --git a/code/core/src/core-server/utils/__tests__/server-channel.test.ts b/code/core/src/core-server/utils/__tests__/server-channel.test.ts index c43955bd5886..3121b86d368d 100644 --- a/code/core/src/core-server/utils/__tests__/server-channel.test.ts +++ b/code/core/src/core-server/utils/__tests__/server-channel.test.ts @@ -1,9 +1,10 @@ +import { EventEmitter } from 'node:events'; +import type { Server } from 'node:http'; + import { describe, expect, it, vi } from 'vitest'; import { Channel } from '@storybook/core/channels'; -import { EventEmitter } from 'events'; -import type { Server } from 'http'; import { stringify } from 'telejson'; import { ServerChannelTransport, getServerChannel } from '../get-server-channel'; diff --git a/code/core/src/core-server/utils/__tests__/server-statics.test.ts b/code/core/src/core-server/utils/__tests__/server-statics.test.ts index ca532a8b04f9..83debd7412dd 100644 --- a/code/core/src/core-server/utils/__tests__/server-statics.test.ts +++ b/code/core/src/core-server/utils/__tests__/server-statics.test.ts @@ -2,13 +2,13 @@ import { resolve } from 'node:path'; import { beforeEach, describe, expect, it, vi } from 'vitest'; -import fs from 'fs-extra'; +import { pathExists } from '@ndelangen/fs-extra-unified'; import { onlyWindows, skipWindows } from '../../../../../vitest.helpers'; import { parseStaticDir } from '../server-statics'; -vi.mock('fs-extra'); -const pathExistsMock = vi.mocked(fs.pathExists); +vi.mock('@ndelangen/fs-extra-unified'); +const pathExistsMock = vi.mocked(pathExists); describe('parseStaticDir', () => { beforeEach(() => { diff --git a/code/core/src/core-server/utils/copy-all-static-files.ts b/code/core/src/core-server/utils/copy-all-static-files.ts index bc9a515731ef..ca72a92116b0 100644 --- a/code/core/src/core-server/utils/copy-all-static-files.ts +++ b/code/core/src/core-server/utils/copy-all-static-files.ts @@ -4,8 +4,8 @@ import { getDirectoryFromWorkingDir } from '@storybook/core/common'; import { logger } from '@storybook/core/node-logger'; +import { copy } from '@ndelangen/fs-extra-unified'; import chalk from 'chalk'; -import fs from 'fs-extra'; import { parseStaticDir } from './server-statics'; @@ -26,7 +26,7 @@ export async function copyAllStaticFiles(staticDirs: any[] | undefined, outputDi // Storybook's own files should not be overwritten, so we skip such files if we find them const skipPaths = ['index.html', 'iframe.html'].map((f) => join(targetPath, f)); - await fs.copy(staticPath, targetPath, { + await copy(staticPath, targetPath, { dereference: true, preserveTimestamps: true, filter: (_, dest) => !skipPaths.includes(dest), @@ -68,7 +68,7 @@ export async function copyAllStaticFilesRelativeToMain( `=> Copying static files: ${chalk.cyan(print(from))} at ${chalk.cyan(print(targetPath))}` ); } - await fs.copy(from, targetPath, { + await copy(from, targetPath, { dereference: true, preserveTimestamps: true, filter: (_, dest) => !skipPaths.includes(dest), diff --git a/code/core/src/core-server/utils/get-builders.ts b/code/core/src/core-server/utils/get-builders.ts index 5b654a14c955..36720f08950d 100644 --- a/code/core/src/core-server/utils/get-builders.ts +++ b/code/core/src/core-server/utils/get-builders.ts @@ -1,9 +1,12 @@ +import { isAbsolute, join } from 'node:path'; import { pathToFileURL } from 'node:url'; import type { Builder, Options } from '@storybook/core/types'; import { MissingBuilderError } from '@storybook/core/server-errors'; +import * as resolve from 'resolve.exports'; + export async function getManagerBuilder(): Promise> { return import('@storybook/core/builder-manager'); } @@ -12,11 +15,30 @@ export async function getPreviewBuilder( builderName: string, configDir: string ): Promise> { - const builderPackage = require.resolve( - ['webpack5'].includes(builderName) ? `@storybook/builder-${builderName}` : builderName, - { paths: [configDir] } - ); - const previewBuilder = await import(pathToFileURL(builderPackage).href); + let builderPackage = builderName; + + if (builderName === 'webpack5') { + builderPackage = '@storybook/builder-webpack5'; + } + + try { + const pkg = require(join(builderPackage, 'package.json')); + const subpath = resolve.exports(pkg, '.'); + + if (subpath) { + builderPackage = join(builderPackage, ...subpath); + } + } catch (err) { + // failed = true; + } + + builderPackage = require.resolve(builderName); + + if (isAbsolute(builderName)) { + builderPackage = pathToFileURL(builderPackage).href; + } + + const previewBuilder = await import(builderPackage); return previewBuilder; } diff --git a/code/core/src/core-server/utils/metadata.ts b/code/core/src/core-server/utils/metadata.ts index cc047d841768..2cc7865d9d0b 100644 --- a/code/core/src/core-server/utils/metadata.ts +++ b/code/core/src/core-server/utils/metadata.ts @@ -1,7 +1,7 @@ import { getStorybookMetadata } from '@storybook/core/telemetry'; +import { writeJSON } from '@ndelangen/fs-extra-unified'; import type { Request, Response, Router } from 'express'; -import { writeJSON } from 'fs-extra'; export async function extractStorybookMetadata(outputFile: string, configDir: string) { const storybookMetadata = await getStorybookMetadata(configDir); diff --git a/code/core/src/core-server/utils/output-stats.ts b/code/core/src/core-server/utils/output-stats.ts index c3a5b9f8aad9..1d5047862247 100644 --- a/code/core/src/core-server/utils/output-stats.ts +++ b/code/core/src/core-server/utils/output-stats.ts @@ -1,3 +1,4 @@ +import { createWriteStream } from 'node:fs'; import { join } from 'node:path'; import type { Stats } from '@storybook/core/types'; @@ -6,7 +7,6 @@ import { logger } from '@storybook/core/node-logger'; import { stringifyStream } from '@discoveryjs/json-ext'; import chalk from 'chalk'; -import fs from 'fs-extra'; export async function outputStats(directory: string, previewStats?: any, managerStats?: any) { if (previewStats) { @@ -25,7 +25,7 @@ export const writeStats = async (directory: string, name: string, stats: Stats) await new Promise((resolve, reject) => { stringifyStream(data, null, 2) .on('error', reject) - .pipe(fs.createWriteStream(filePath)) + .pipe(createWriteStream(filePath)) .on('error', reject) .on('finish', resolve); }); diff --git a/code/core/src/core-server/utils/server-init.ts b/code/core/src/core-server/utils/server-init.ts index b63d663e6857..0d3b39b5c2a6 100644 --- a/code/core/src/core-server/utils/server-init.ts +++ b/code/core/src/core-server/utils/server-init.ts @@ -1,9 +1,10 @@ +import { readFile } from 'node:fs/promises'; +import http from 'node:http'; +import https from 'node:https'; + import { logger } from '@storybook/core/node-logger'; import type { Express } from 'express'; -import { readFile } from 'fs-extra'; -import http from 'http'; -import https from 'https'; export async function getServer( app: Express, diff --git a/code/core/src/core-server/utils/server-statics.ts b/code/core/src/core-server/utils/server-statics.ts index b10a573e7d90..bc872b6f1be0 100644 --- a/code/core/src/core-server/utils/server-statics.ts +++ b/code/core/src/core-server/utils/server-statics.ts @@ -5,10 +5,10 @@ import type { Options } from '@storybook/core/types'; import { logger } from '@storybook/core/node-logger'; +import { pathExists } from '@ndelangen/fs-extra-unified'; import chalk from 'chalk'; import type { Router } from 'express'; import express from 'express'; -import { pathExists } from 'fs-extra'; import { dedent } from 'ts-dedent'; export async function useStatics(router: Router, options: Options) { diff --git a/code/core/src/core-server/utils/stories-json.ts b/code/core/src/core-server/utils/stories-json.ts index 8956a4ed7ab1..c14f3e4be932 100644 --- a/code/core/src/core-server/utils/stories-json.ts +++ b/code/core/src/core-server/utils/stories-json.ts @@ -4,8 +4,8 @@ import type { NormalizedStoriesSpecifier, StoryIndex } from '@storybook/core/typ import { STORY_INDEX_INVALIDATED } from '@storybook/core/core-events'; +import { writeJSON } from '@ndelangen/fs-extra-unified'; import type { Request, Response, Router } from 'express'; -import { writeJSON } from 'fs-extra'; import debounce from 'lodash/debounce.js'; import type { StoryIndexGenerator } from './StoryIndexGenerator'; diff --git a/code/core/src/core-server/utils/warnWhenUsingArgTypesRegex.ts b/code/core/src/core-server/utils/warnWhenUsingArgTypesRegex.ts index dd543bff54bc..864f9c10a268 100644 --- a/code/core/src/core-server/utils/warnWhenUsingArgTypesRegex.ts +++ b/code/core/src/core-server/utils/warnWhenUsingArgTypesRegex.ts @@ -1,10 +1,11 @@ +import { readFile } from 'node:fs/promises'; + import { type BabelFile, core } from '@storybook/core/babel'; import type { StorybookConfig } from '@storybook/core/types'; import { babelParse } from '@storybook/core/csf-tools'; import chalk from 'chalk'; -import { readFile } from 'fs-extra'; import { dedent } from 'ts-dedent'; export async function warnWhenUsingArgTypesRegex( diff --git a/code/core/src/core-server/utils/whats-new.ts b/code/core/src/core-server/utils/whats-new.ts index 1091d77ab74f..cb523f78318e 100644 --- a/code/core/src/core-server/utils/whats-new.ts +++ b/code/core/src/core-server/utils/whats-new.ts @@ -1,3 +1,5 @@ +import { writeFile } from 'node:fs/promises'; + import type { Channel } from '@storybook/core/channels'; import { findConfigFile } from '@storybook/core/common'; import { telemetry } from '@storybook/core/telemetry'; @@ -14,7 +16,6 @@ import { import { printConfig, readConfig } from '@storybook/core/csf-tools'; import { logger } from '@storybook/core/node-logger'; -import fs from 'fs-extra'; import invariant from 'tiny-invariant'; import { sendTelemetryError } from '../withTelemetry'; @@ -93,7 +94,7 @@ export function initializeWhatsNew( invariant(mainPath, `unable to find storybook main file in ${options.configDir}`); const main = await readConfig(mainPath); main.setFieldValue(['core', 'disableWhatsNewNotifications'], disableWhatsNewNotifications); - await fs.writeFile(mainPath, printConfig(main).code); + await writeFile(mainPath, printConfig(main).code); if (isTelemetryEnabled) { await telemetry('core-config', { disableWhatsNewNotifications }); } diff --git a/code/core/src/preview-api/modules/store/csf/portable-stories.ts b/code/core/src/preview-api/modules/store/csf/portable-stories.ts index 1525b6e3e6d8..7f6dd737cadc 100644 --- a/code/core/src/preview-api/modules/store/csf/portable-stories.ts +++ b/code/core/src/preview-api/modules/store/csf/portable-stories.ts @@ -116,7 +116,7 @@ export function composeStory 0 ? defaultConfig - : globalThis.defaultProjectAnnotations ?? {}, + : (globalThis.defaultProjectAnnotations ?? {}), globalThis.globalProjectAnnotations ?? {}, projectAnnotations ?? {}, ]) diff --git a/code/core/src/telemetry/get-monorepo-type.test.ts b/code/core/src/telemetry/get-monorepo-type.test.ts index 530da9f4abc9..b6f4e6a9512c 100644 --- a/code/core/src/telemetry/get-monorepo-type.test.ts +++ b/code/core/src/telemetry/get-monorepo-type.test.ts @@ -3,11 +3,25 @@ import { join } from 'node:path'; import { describe, expect, it, vi } from 'vitest'; -import * as fsExtra from 'fs-extra'; - import { getMonorepoType, monorepoConfigs } from './get-monorepo-type'; -vi.mock('fs-extra', async () => import('../../../__mocks__/fs-extra')); +const fse = vi.hoisted(async () => import('../../../__mocks__/fs-extra')); + +vi.mock('@ndelangen/fs-extra-unified', async () => import('../../../__mocks__/fs-extra')); +vi.mock('node:fs/promises', async (importActual) => { + const actual = await importActual(); + return { + ...actual, + ...(await import('../../../__mocks__/fs-extra')), + }; +}); +vi.mock('node:fs', async (importActual) => { + const actual = await importActual(); + return { + ...actual, + ...(await import('../../../__mocks__/fs-extra')), + }; +}); vi.mock('@storybook/core/common', async (importOriginal) => { return { @@ -16,7 +30,7 @@ vi.mock('@storybook/core/common', async (importOriginal) => { }; }); -const checkMonorepoType = ({ monorepoConfigFile, isYarnWorkspace = false }: any) => { +const checkMonorepoType = async ({ monorepoConfigFile, isYarnWorkspace = false }: any) => { const mockFiles = { [join('root', 'package.json')]: isYarnWorkspace ? '{ "workspaces": [] }' : '{}', }; @@ -25,7 +39,7 @@ const checkMonorepoType = ({ monorepoConfigFile, isYarnWorkspace = false }: any) mockFiles[join('root', monorepoConfigFile)] = '{}'; } - vi.mocked(fsExtra as any).__setMockFiles(mockFiles); + (await fse).__setMockFiles(mockFiles); return getMonorepoType(); }; @@ -34,25 +48,25 @@ describe('getMonorepoType', () => { describe('Monorepos from json files', () => { it.each(Object.entries(monorepoConfigs))( 'should detect %p from %s file', - (monorepoName, monorepoConfigFile) => { - expect(checkMonorepoType({ monorepoConfigFile })).toEqual(monorepoName); + async (monorepoName, monorepoConfigFile) => { + expect(await checkMonorepoType({ monorepoConfigFile })).toEqual(monorepoName); } ); }); describe('Yarn|NPM workspaces', () => { - it('should detect Workspaces from package.json', () => { - expect(checkMonorepoType({ monorepoConfigFile: undefined, isYarnWorkspace: true })).toEqual( - 'Workspaces' - ); + it('should detect Workspaces from package.json', async () => { + expect( + await checkMonorepoType({ monorepoConfigFile: undefined, isYarnWorkspace: true }) + ).toEqual('Workspaces'); }); }); describe('Non-monorepos', () => { - it('should return undefined', () => { - expect(checkMonorepoType({ monorepoConfigFile: undefined, isYarnWorkspace: false })).toEqual( - undefined - ); + it('should return undefined', async () => { + expect( + await checkMonorepoType({ monorepoConfigFile: undefined, isYarnWorkspace: false }) + ).toEqual(undefined); }); }); }); diff --git a/code/core/src/telemetry/get-monorepo-type.ts b/code/core/src/telemetry/get-monorepo-type.ts index 41dcc0087044..0aa2d4e19467 100644 --- a/code/core/src/telemetry/get-monorepo-type.ts +++ b/code/core/src/telemetry/get-monorepo-type.ts @@ -1,9 +1,9 @@ +import { existsSync } from 'node:fs'; import { join } from 'node:path'; -import { getProjectRoot } from '@storybook/core/common'; -import type { PackageJson } from '@storybook/core/types'; +import { type PackageJson, getProjectRoot } from '@storybook/core/common'; -import { existsSync, readJsonSync } from 'fs-extra'; +import { readJsonSync } from '@ndelangen/fs-extra-unified'; export const monorepoConfigs = { Nx: 'nx.json', diff --git a/code/core/src/telemetry/package-json.ts b/code/core/src/telemetry/package-json.ts index b88ebc237ddc..84c8877c56db 100644 --- a/code/core/src/telemetry/package-json.ts +++ b/code/core/src/telemetry/package-json.ts @@ -1,6 +1,6 @@ import { join } from 'node:path'; -import { readJson } from 'fs-extra'; +import { readJson } from '@ndelangen/fs-extra-unified'; import type { Dependency } from './types'; diff --git a/code/core/src/types/modules/core-common.ts b/code/core/src/types/modules/core-common.ts index 8e71a4cadb2a..f4664268de08 100644 --- a/code/core/src/types/modules/core-common.ts +++ b/code/core/src/types/modules/core-common.ts @@ -1,8 +1,9 @@ /* eslint-disable @typescript-eslint/naming-convention */ +// should be node:http, but that caused the ui/manager to fail to build, might be able to switch this back once ui/manager is in the core +import type { Server } from 'node:http'; + import type { Router } from 'express'; import type { FileSystemCache } from 'file-system-cache'; -// should be node:http, but that caused the ui/manager to fail to build, might be able to switch this back once ui/manager is in the core -import type { Server } from 'http'; import type * as telejson from 'telejson'; import type { PackageJson as PackageJsonFromTypeFest } from 'type-fest'; diff --git a/code/e2e-tests/util.ts b/code/e2e-tests/util.ts index da0ff313431b..cd2936e4a99d 100644 --- a/code/e2e-tests/util.ts +++ b/code/e2e-tests/util.ts @@ -49,7 +49,7 @@ export class SbPage { await this.page.waitForURL((url) => url.search.includes( - `path=/${viewMode ?? name === 'docs' ? 'docs' : 'story'}/${titleId}--${storyId}` + `path=/${(viewMode ?? name === 'docs') ? 'docs' : 'story'}/${titleId}--${storyId}` ) ); diff --git a/code/frameworks/angular/src/builders/utils/run-compodoc.spec.ts b/code/frameworks/angular/src/builders/utils/run-compodoc.spec.ts index 4391c939fc40..627bc9dc131e 100644 --- a/code/frameworks/angular/src/builders/utils/run-compodoc.spec.ts +++ b/code/frameworks/angular/src/builders/utils/run-compodoc.spec.ts @@ -1,9 +1,9 @@ -import { BuilderContext } from '@angular-devkit/architect'; -import { LoggerApi } from '@angular-devkit/core/src/logger'; +import { vi, describe, afterEach, it, expect } from 'vitest'; +import { LoggerApi } from '@angular-devkit/core/src/logger/index'; import { take } from 'rxjs/operators'; -import { afterEach, describe, expect, it, vi } from 'vitest'; import { runCompodoc } from './run-compodoc'; +import { BuilderContext } from '@angular-devkit/architect'; const mockRunScript = vi.fn(); diff --git a/code/frameworks/angular/src/preset.ts b/code/frameworks/angular/src/preset.ts index 4eb938b1f3d3..feee14d96f04 100644 --- a/code/frameworks/angular/src/preset.ts +++ b/code/frameworks/angular/src/preset.ts @@ -3,7 +3,6 @@ import { PresetProperty } from 'storybook/internal/types'; import { dirname, join } from 'node:path'; import { StandaloneOptions } from './builders/utils/standalone-options'; -import { StorybookConfig } from './types'; const getAbsolutePath = (input: I): I => dirname(require.resolve(join(input, 'package.json'))) as any; diff --git a/code/frameworks/angular/src/server/angular-cli-webpack.js b/code/frameworks/angular/src/server/angular-cli-webpack.js index 92ed6225d19f..6be86712e5bc 100644 --- a/code/frameworks/angular/src/server/angular-cli-webpack.js +++ b/code/frameworks/angular/src/server/angular-cli-webpack.js @@ -68,7 +68,7 @@ exports.getWebpackConfig = async (baseConfig, { builderOptions, builderContext } outputPath: typeof builderOptions.outputPath === 'string' ? builderOptions.outputPath - : builderOptions.outputPath?.base ?? 'noop-out', + : (builderOptions.outputPath?.base ?? 'noop-out'), // Fixed options optimization: false, diff --git a/code/frameworks/angular/tsconfig.build.json b/code/frameworks/angular/tsconfig.build.json index e543e05b4803..005a476c92cb 100644 --- a/code/frameworks/angular/tsconfig.build.json +++ b/code/frameworks/angular/tsconfig.build.json @@ -3,7 +3,7 @@ "compileOnSave": false, "compilerOptions": { "target": "ES2020", - "module": "CommonJS", + "module": "Preserve", "noEmit": false, "lib": ["es2020", "dom", "dom.iterable"], "experimentalDecorators": true, diff --git a/code/frameworks/experimental-nextjs-vite/package.json b/code/frameworks/experimental-nextjs-vite/package.json index 02c5cf4fa714..be21926f403a 100644 --- a/code/frameworks/experimental-nextjs-vite/package.json +++ b/code/frameworks/experimental-nextjs-vite/package.json @@ -126,7 +126,6 @@ "bundler": { "entries": [ "./src/index.ts", - "./src/preset.ts", "./src/preview.tsx", "./src/export-mocks/cache/index.ts", "./src/export-mocks/headers/index.ts", @@ -137,7 +136,9 @@ "externals": [ "sb-original/image-context" ], - "platform": "node" + "nodeEntries": [ + "./src/preset.ts" + ] }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" } diff --git a/code/frameworks/experimental-nextjs-vite/src/preset.ts b/code/frameworks/experimental-nextjs-vite/src/preset.ts index af5deabf2b87..8389b4c35f9f 100644 --- a/code/frameworks/experimental-nextjs-vite/src/preset.ts +++ b/code/frameworks/experimental-nextjs-vite/src/preset.ts @@ -4,7 +4,6 @@ import type { PresetProperty } from 'storybook/internal/types'; import type { StorybookConfigVite } from '@storybook/builder-vite'; import { dirname, join } from 'path'; -// @ts-expect-error - tsconfig settings have to be moduleResolution=Bundler and module=Preserve import vitePluginStorybookNextjs from 'vite-plugin-storybook-nextjs'; import type { StorybookConfig } from './types'; diff --git a/code/frameworks/nextjs/package.json b/code/frameworks/nextjs/package.json index a7ebb0eed408..b10dd127a5da 100644 --- a/code/frameworks/nextjs/package.json +++ b/code/frameworks/nextjs/package.json @@ -148,7 +148,6 @@ "babel-loader": "^9.1.3", "css-loader": "^6.7.3", "find-up": "^5.0.0", - "fs-extra": "^11.1.0", "image-size": "^1.0.0", "loader-utils": "^3.2.1", "node-polyfill-webpack-plugin": "^2.0.1", @@ -167,11 +166,14 @@ }, "devDependencies": { "@babel/types": "^7.24.0", + "@ndelangen/fs-extra-unified": "^1.0.4", "@types/babel__core": "^7", "@types/babel__plugin-transform-runtime": "^7", "@types/babel__preset-env": "^7", + "@types/fs-extra": "^11.0.4", "@types/loader-utils": "^2.0.5", "@types/react-refresh": "^0", + "fs-extra": "^11.1.0", "next": "^14.1.0", "typescript": "^5.3.2", "webpack": "^5.65.0" @@ -204,29 +206,30 @@ "entries": [ "./src/image-context.ts", "./src/index.ts", - "./src/preset.ts", "./src/preview.tsx", - "./src/export-mocks/index.ts", "./src/export-mocks/cache/index.ts", "./src/export-mocks/headers/index.ts", "./src/export-mocks/router/index.ts", "./src/export-mocks/navigation/index.ts", "./src/compatibility/segment.compat.ts", "./src/compatibility/redirect-status-code.compat.ts", - "./src/next-image-loader-stub.ts", "./src/images/decorator.tsx", "./src/images/next-legacy-image.tsx", "./src/images/next-image.tsx", + "./src/rsc/server-only.ts" + ], + "nodeEntries": [ + "./src/export-mocks/index.ts", + "./src/swc/next-swc-loader-patch.ts", + "./src/next-image-loader-stub.ts", "./src/font/webpack/loader/storybook-nextjs-font-loader.ts", - "./src/rsc/server-only.ts", - "./src/swc/next-swc-loader-patch.ts" + "./src/preset.ts" ], "externals": [ "sb-original/next/image", "sb-original/next/future/image", "sb-original/next/legacy/image" - ], - "platform": "node" + ] }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" } diff --git a/code/frameworks/nextjs/src/nodePolyfills/webpack.ts b/code/frameworks/nextjs/src/nodePolyfills/webpack.ts index 40f8e4203d3a..3c3782258ada 100644 --- a/code/frameworks/nextjs/src/nodePolyfills/webpack.ts +++ b/code/frameworks/nextjs/src/nodePolyfills/webpack.ts @@ -1,5 +1,5 @@ import NodePolyfillPlugin from 'node-polyfill-webpack-plugin'; -import type { Configuration } from 'webpack'; +import { type Configuration } from 'webpack'; export const configureNodePolyfills = (baseConfig: Configuration) => { // This is added as a way to avoid issues caused by Next.js 13.4.3 diff --git a/code/frameworks/nextjs/tsconfig.json b/code/frameworks/nextjs/tsconfig.json index 3b01f80f2c32..b9a0712661b0 100644 --- a/code/frameworks/nextjs/tsconfig.json +++ b/code/frameworks/nextjs/tsconfig.json @@ -1,5 +1,8 @@ { "extends": "../../tsconfig.json", - "compilerOptions": {}, + "compilerOptions": { + "module": "CommonJS", + "moduleResolution": "Node" + }, "include": ["src/**/*", "template/**/*"] } diff --git a/code/frameworks/svelte-vite/src/utils.ts b/code/frameworks/svelte-vite/src/utils.ts index d258d1e7dd91..913ada3bc18a 100644 --- a/code/frameworks/svelte-vite/src/utils.ts +++ b/code/frameworks/svelte-vite/src/utils.ts @@ -1,7 +1,5 @@ import type { Options } from 'storybook/internal/types'; -import { hasVitePlugins } from '@storybook/builder-vite'; - import { dedent } from 'ts-dedent'; import type { PluginOption } from 'vite'; @@ -19,6 +17,7 @@ export async function handleSvelteKit(plugins: PluginOption[], options: Options) const frameworkPreset = await options.presets.apply('framework', {}, options); const framework = typeof frameworkPreset === 'string' ? frameworkPreset : frameworkPreset.name; + const { hasVitePlugins } = await import('@storybook/builder-vite'); const hasSvelteKitPlugins = await hasVitePlugins(plugins, [ 'vite-plugin-svelte-kit', 'vite-plugin-sveltekit-setup', diff --git a/code/frameworks/sveltekit/package.json b/code/frameworks/sveltekit/package.json index fd3188892a44..6f31ef447a03 100644 --- a/code/frameworks/sveltekit/package.json +++ b/code/frameworks/sveltekit/package.json @@ -82,11 +82,12 @@ "bundler": { "entries": [ "./src/index.ts", - "./src/preview.ts", - "./src/preset.ts", - "./src/vite.ts" + "./src/preview.ts" ], - "platform": "node" + "nodeEntries": [ + "./src/vite.ts", + "./src/preset.ts" + ] }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" } diff --git a/code/frameworks/sveltekit/src/preset.ts b/code/frameworks/sveltekit/src/preset.ts index 263a6b35429d..fad31bb63d82 100644 --- a/code/frameworks/sveltekit/src/preset.ts +++ b/code/frameworks/sveltekit/src/preset.ts @@ -2,8 +2,6 @@ import { dirname, join } from 'node:path'; import type { PresetProperty } from 'storybook/internal/types'; -import { withoutVitePlugins } from '@storybook/builder-vite'; -// @ts-expect-error -- TS picks up the type from preset.js instead of dist/preset.d.ts import { viteFinal as svelteViteFinal } from '@storybook/svelte-vite/preset'; import { configOverrides } from './plugins/config-overrides'; @@ -27,6 +25,8 @@ export const viteFinal: NonNullable = async (confi let { plugins = [] } = baseConfig; + const { withoutVitePlugins } = await import('@storybook/builder-vite'); + // disable specific plugins that are not compatible with Storybook plugins = ( await withoutVitePlugins(plugins, [ diff --git a/code/frameworks/vue3-vite/src/preset.ts b/code/frameworks/vue3-vite/src/preset.ts index 057b9a3d92a1..ea80b09bf3d7 100644 --- a/code/frameworks/vue3-vite/src/preset.ts +++ b/code/frameworks/vue3-vite/src/preset.ts @@ -21,7 +21,7 @@ export const viteFinal: StorybookConfig['viteFinal'] = async (config, options) = const framework = await options.presets.apply('framework'); const frameworkOptions: FrameworkOptions = - typeof framework === 'string' ? {} : framework.options ?? {}; + typeof framework === 'string' ? {} : (framework.options ?? {}); const docgen = resolveDocgenOptions(frameworkOptions.docgen); diff --git a/code/lib/cli-storybook/bin/index.cjs b/code/lib/cli-storybook/bin/index.cjs index ce13973e4eb9..31d3e3b32f58 100755 --- a/code/lib/cli-storybook/bin/index.cjs +++ b/code/lib/cli-storybook/bin/index.cjs @@ -23,4 +23,11 @@ process.once('uncaughtException', (error) => { throw error; }); -require('../dist/bin/index.cjs'); +const run = async () => { + await import('../dist/bin/index.js'); +}; + +run().catch((e) => { + console.error(e); + process.exit(1); +}); diff --git a/code/lib/cli-storybook/package.json b/code/lib/cli-storybook/package.json index dd7664b7bcdb..7ccb8aebc011 100644 --- a/code/lib/cli-storybook/package.json +++ b/code/lib/cli-storybook/package.json @@ -51,7 +51,6 @@ "envinfo": "^7.7.3", "fd-package-json": "^1.2.0", "find-up": "^5.0.0", - "fs-extra": "^11.1.0", "giget": "^1.0.0", "glob": "^10.0.0", "globby": "^14.0.1", @@ -64,9 +63,12 @@ "ts-dedent": "^2.0.0" }, "devDependencies": { + "@ndelangen/fs-extra-unified": "^1.0.4", "@types/cross-spawn": "^6.0.2", + "@types/fs-extra": "^11.0.4", "@types/prompts": "^2.0.9", "boxen": "^7.1.1", + "fs-extra": "^11.1.0", "slash": "^5.0.0", "strip-ansi": "^7.1.0", "typescript": "^5.3.2" @@ -75,11 +77,13 @@ "access": "public" }, "bundler": { - "entries": [ + "nodeEntries": [ "./src/index.ts", "./src/bin/index.ts" ], - "platform": "node" + "formats": [ + "esm" + ] }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" } diff --git a/code/lib/cli-storybook/src/automigrate/fixes/eslint-plugin.test.ts b/code/lib/cli-storybook/src/automigrate/fixes/eslint-plugin.test.ts index 2120abd7098f..808d774eb255 100644 --- a/code/lib/cli-storybook/src/automigrate/fixes/eslint-plugin.test.ts +++ b/code/lib/cli-storybook/src/automigrate/fixes/eslint-plugin.test.ts @@ -5,13 +5,13 @@ import { describe, expect, it, vi } from 'vitest'; import type { PackageJson } from 'storybook/internal/common'; -import * as fsExtra from 'fs-extra'; +import * as fsExtra from '@ndelangen/fs-extra-unified'; import { dedent } from 'ts-dedent'; import { makePackageManager } from '../helpers/testing-helpers'; import { eslintPlugin } from './eslint-plugin'; -vi.mock('fs-extra', async () => import('../../../../../__mocks__/fs-extra')); +vi.mock('@ndelangen/fs-extra-unified', async () => import('../../../../../__mocks__/fs-extra')); vi.mock('fs'); const checkEslint = async ({ diff --git a/code/lib/cli-storybook/src/automigrate/fixes/initial-globals.test.ts b/code/lib/cli-storybook/src/automigrate/fixes/initial-globals.test.ts index e74d5ce810da..d2a3ca367c0f 100644 --- a/code/lib/cli-storybook/src/automigrate/fixes/initial-globals.test.ts +++ b/code/lib/cli-storybook/src/automigrate/fixes/initial-globals.test.ts @@ -3,11 +3,13 @@ import { join } from 'node:path'; import { expect, it, vi } from 'vitest'; -import * as fsExtra from 'fs-extra'; +import * as fsExtra from '@ndelangen/fs-extra-unified'; import { initialGlobals } from './initial-globals'; -vi.mock('fs-extra', async () => import('../../../../../__mocks__/fs-extra')); +vi.mock('@ndelangen/fs-extra-unified', async () => import('../../../../../__mocks__/fs-extra')); +vi.mock('node:fs/promises', async () => import('../../../../../__mocks__/fs-extra')); +vi.mock('node:fs', async () => import('../../../../../__mocks__/fs-extra')); const previewConfigPath = join('.storybook', 'preview.js'); const check = async (previewContents: string) => { diff --git a/code/lib/cli-storybook/src/automigrate/fixes/initial-globals.ts b/code/lib/cli-storybook/src/automigrate/fixes/initial-globals.ts index d4a96033a8c5..fe40749ffa16 100644 --- a/code/lib/cli-storybook/src/automigrate/fixes/initial-globals.ts +++ b/code/lib/cli-storybook/src/automigrate/fixes/initial-globals.ts @@ -1,9 +1,10 @@ +import { readFile, writeFile } from 'node:fs/promises'; + import type { ConfigFile } from 'storybook/internal/csf-tools'; import { formatConfig, loadConfig } from 'storybook/internal/csf-tools'; import type { Expression } from '@babel/types'; import chalk from 'chalk'; -import { readFile, writeFile } from 'fs-extra'; import { dedent } from 'ts-dedent'; import type { Fix } from '../types'; diff --git a/code/lib/cli-storybook/src/automigrate/fixes/mdx-1-to-3.ts b/code/lib/cli-storybook/src/automigrate/fixes/mdx-1-to-3.ts index 221edd9298e0..3a5ae9e09dc4 100644 --- a/code/lib/cli-storybook/src/automigrate/fixes/mdx-1-to-3.ts +++ b/code/lib/cli-storybook/src/automigrate/fixes/mdx-1-to-3.ts @@ -1,7 +1,7 @@ +import { readFile, writeFile } from 'node:fs/promises'; import { basename } from 'node:path'; import chalk from 'chalk'; -import fse from 'fs-extra'; import { dedent } from 'ts-dedent'; import type { Fix } from '../types'; @@ -74,14 +74,14 @@ export const mdx1to3: Fix = { async run({ result: { storiesMdxFiles }, dryRun }) { await Promise.all([ ...storiesMdxFiles.map(async (fname) => { - const contents = await fse.readFile(fname, 'utf-8'); + const contents = await readFile(fname, 'utf-8'); const updated = fixMdxComments(fixMdxStyleTags(contents)); if (updated === contents) { logger.info(`🆗 Unmodified ${basename(fname)}`); } else { logger.info(`✅ Modified ${basename(fname)}`); if (!dryRun) { - await fse.writeFile(fname, updated); + await writeFile(fname, updated); } } }), diff --git a/code/lib/cli-storybook/src/automigrate/fixes/mdx-to-csf.ts b/code/lib/cli-storybook/src/automigrate/fixes/mdx-to-csf.ts index 373ec72f8c35..8a8ff9992b86 100644 --- a/code/lib/cli-storybook/src/automigrate/fixes/mdx-to-csf.ts +++ b/code/lib/cli-storybook/src/automigrate/fixes/mdx-to-csf.ts @@ -4,7 +4,7 @@ import { runCodemod } from '@storybook/codemod'; import chalk from 'chalk'; import { glob } from 'glob'; -import { prompt } from 'prompts'; +import prompts from 'prompts'; import { dedent } from 'ts-dedent'; import { updateMainConfig } from '../helpers/mainConfigFile'; @@ -120,7 +120,7 @@ export const mdxToCSF: Fix = { ${JSON.stringify(nextStoriesEntries, null, 2)}`); if (!dryRun) { - const { glob: globString } = await prompt({ + const { glob: globString } = await prompts({ type: 'text', name: 'glob', message: 'Please enter the glob for your MDX stories', diff --git a/code/lib/cli-storybook/src/automigrate/fixes/missing-storybook-dependencies.test.ts b/code/lib/cli-storybook/src/automigrate/fixes/missing-storybook-dependencies.test.ts index 2729cfb1da16..6f11fe8a5638 100644 --- a/code/lib/cli-storybook/src/automigrate/fixes/missing-storybook-dependencies.test.ts +++ b/code/lib/cli-storybook/src/automigrate/fixes/missing-storybook-dependencies.test.ts @@ -1,6 +1,6 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; -import type { JsPackageManager } from '@storybook/core/common'; +import type { JsPackageManager } from 'storybook/internal/common'; import stripAnsi from 'strip-ansi'; diff --git a/code/lib/cli-storybook/src/automigrate/fixes/missing-storybook-dependencies.ts b/code/lib/cli-storybook/src/automigrate/fixes/missing-storybook-dependencies.ts index ad912867f6f2..a81221364de8 100644 --- a/code/lib/cli-storybook/src/automigrate/fixes/missing-storybook-dependencies.ts +++ b/code/lib/cli-storybook/src/automigrate/fixes/missing-storybook-dependencies.ts @@ -1,8 +1,7 @@ import { readFile } from 'node:fs/promises'; import { getStorybookVersionSpecifier } from 'storybook/internal/cli'; - -import type { InstallationMetadata, JsPackageManager } from '@storybook/core/common'; +import type { InstallationMetadata, JsPackageManager } from 'storybook/internal/common'; import chalk from 'chalk'; import { dedent } from 'ts-dedent'; diff --git a/code/lib/cli-storybook/src/automigrate/fixes/remove-global-client-apis.test.ts b/code/lib/cli-storybook/src/automigrate/fixes/remove-global-client-apis.test.ts index 6ae48ad95018..455ceafeeace 100644 --- a/code/lib/cli-storybook/src/automigrate/fixes/remove-global-client-apis.test.ts +++ b/code/lib/cli-storybook/src/automigrate/fixes/remove-global-client-apis.test.ts @@ -5,11 +5,13 @@ import { describe, expect, it, vi } from 'vitest'; import type { JsPackageManager } from 'storybook/internal/common'; -import * as fsExtra from 'fs-extra'; +import * as fsExtra from '@ndelangen/fs-extra-unified'; import { RemovedAPIs, removedGlobalClientAPIs as migration } from './remove-global-client-apis'; -vi.mock('fs-extra', async () => import('../../../../../__mocks__/fs-extra')); +vi.mock('@ndelangen/fs-extra-unified', async () => import('../../../../../__mocks__/fs-extra')); +vi.mock('node:fs/promises', async () => import('../../../../../__mocks__/fs-extra')); +vi.mock('node:fs', async () => import('../../../../../__mocks__/fs-extra')); const check = async ({ contents, previewConfigPath }: any) => { if (contents) { diff --git a/code/lib/cli-storybook/src/automigrate/fixes/remove-global-client-apis.ts b/code/lib/cli-storybook/src/automigrate/fixes/remove-global-client-apis.ts index 232ac4fea188..3d6acc22e67e 100644 --- a/code/lib/cli-storybook/src/automigrate/fixes/remove-global-client-apis.ts +++ b/code/lib/cli-storybook/src/automigrate/fixes/remove-global-client-apis.ts @@ -1,5 +1,6 @@ +import { readFile } from 'node:fs/promises'; + import chalk from 'chalk'; -import { readFile } from 'fs-extra'; import { dedent } from 'ts-dedent'; import type { Fix } from '../types'; diff --git a/code/lib/cli-storybook/src/automigrate/fixes/upgrade-storybook-related-dependencies.ts b/code/lib/cli-storybook/src/automigrate/fixes/upgrade-storybook-related-dependencies.ts index 0df85cb43635..ff04b4fe18c2 100644 --- a/code/lib/cli-storybook/src/automigrate/fixes/upgrade-storybook-related-dependencies.ts +++ b/code/lib/cli-storybook/src/automigrate/fixes/upgrade-storybook-related-dependencies.ts @@ -1,7 +1,7 @@ import type { JsPackageManager } from 'storybook/internal/common'; import { isCorePackage } from 'storybook/internal/common'; -import { cyan, yellow } from 'chalk'; +import chalk from 'chalk'; import { gt } from 'semver'; import { dedent } from 'ts-dedent'; @@ -83,7 +83,7 @@ export const upgradeStorybookRelatedDependencies = { You're upgrading to the latest version of Storybook. We recommend upgrading the following packages: ${upgradable .map(({ packageName, afterVersion, beforeVersion }) => { - return `- ${cyan(packageName)}: ${cyan(beforeVersion)} => ${cyan(afterVersion)}`; + return `- ${chalk.cyan(packageName)}: ${chalk.cyan(beforeVersion)} => ${chalk.cyan(afterVersion)}`; }) .join('\n')} @@ -139,10 +139,10 @@ export const upgradeStorybookRelatedDependencies = { console.log(); console.log(dedent` - We upgraded ${yellow(upgradable.length)} packages: + We upgraded ${chalk.yellow(upgradable.length)} packages: ${upgradable .map(({ packageName, afterVersion, beforeVersion }) => { - return `- ${cyan(packageName)}: ${cyan(beforeVersion)} => ${cyan(afterVersion)}`; + return `- ${chalk.cyan(packageName)}: ${chalk.cyan(beforeVersion)} => ${chalk.cyan(afterVersion)}`; }) .join('\n')} `); diff --git a/code/lib/cli-storybook/src/automigrate/helpers/mainConfigFile.ts b/code/lib/cli-storybook/src/automigrate/helpers/mainConfigFile.ts index bf9daf36c7ae..c306d2578a13 100644 --- a/code/lib/cli-storybook/src/automigrate/helpers/mainConfigFile.ts +++ b/code/lib/cli-storybook/src/automigrate/helpers/mainConfigFile.ts @@ -94,7 +94,9 @@ export const getBuilderPackageName = (mainConfig?: StorybookConfigRaw) => { export const getFrameworkOptions = ( mainConfig?: StorybookConfigRaw ): Record | null => { - return typeof mainConfig?.framework === 'string' ? null : mainConfig?.framework?.options ?? null; + return typeof mainConfig?.framework === 'string' + ? null + : (mainConfig?.framework?.options ?? null); }; /** diff --git a/code/lib/cli-storybook/src/automigrate/helpers/new-frameworks-utils.ts b/code/lib/cli-storybook/src/automigrate/helpers/new-frameworks-utils.ts index a4ab6ee34a4f..280bb2cf5034 100644 --- a/code/lib/cli-storybook/src/automigrate/helpers/new-frameworks-utils.ts +++ b/code/lib/cli-storybook/src/automigrate/helpers/new-frameworks-utils.ts @@ -77,14 +77,14 @@ export const detectBuilderInfo = async ({ const builderPackageName = getBuilderPackageName(mainConfig); const frameworkPackageName = getFrameworkPackageName(mainConfig) as string; - let builderOptions = typeof builder !== 'string' ? builder?.options ?? {} : {}; + let builderOptions = typeof builder !== 'string' ? (builder?.options ?? {}) : {}; if (builderPackageName) { builderOrFrameworkName = builderPackageName; } else if (framework) { if (Object.keys(frameworkPackages).includes(frameworkPackageName)) { builderOrFrameworkName = frameworkPackageName; - builderOptions = typeof framework === 'object' ? framework.options?.builder ?? {} : {}; + builderOptions = typeof framework === 'object' ? (framework.options?.builder ?? {}) : {}; } } diff --git a/code/lib/cli-storybook/src/automigrate/index.test.ts b/code/lib/cli-storybook/src/automigrate/index.test.ts index 9bc05affbacc..d86e239f6ad3 100644 --- a/code/lib/cli-storybook/src/automigrate/index.test.ts +++ b/code/lib/cli-storybook/src/automigrate/index.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; -import type { JsPackageManager, PackageJsonWithDepsAndDevDeps } from '@storybook/core/common'; +import type { JsPackageManager, PackageJsonWithDepsAndDevDeps } from 'storybook/internal/common'; import { runFixes } from './index'; import type { Fix } from './types'; diff --git a/code/lib/cli-storybook/src/automigrate/index.ts b/code/lib/cli-storybook/src/automigrate/index.ts index 690c3d1b15f7..8ddb65670ceb 100644 --- a/code/lib/cli-storybook/src/automigrate/index.ts +++ b/code/lib/cli-storybook/src/automigrate/index.ts @@ -1,3 +1,4 @@ +import { createWriteStream } from 'node:fs'; import { join } from 'node:path'; import { @@ -8,9 +9,9 @@ import { temporaryFile, } from 'storybook/internal/common'; +import { move, remove } from '@ndelangen/fs-extra-unified'; import boxen from 'boxen'; import chalk from 'chalk'; -import { createWriteStream, move, remove } from 'fs-extra'; import prompts from 'prompts'; import semver from 'semver'; import invariant from 'tiny-invariant'; @@ -274,7 +275,7 @@ export async function runFixes({ if (result) { const promptType: Prompt = - typeof f.promptType === 'function' ? await f.promptType(result) : f.promptType ?? 'auto'; + typeof f.promptType === 'function' ? await f.promptType(result) : (f.promptType ?? 'auto'); logger.info(`\n🔎 found a '${chalk.cyan(f.id)}' migration:`); const message = f.prompt(result); diff --git a/code/lib/cli-storybook/src/doctor/index.ts b/code/lib/cli-storybook/src/doctor/index.ts index 08e798288753..84e89cc4eb86 100644 --- a/code/lib/cli-storybook/src/doctor/index.ts +++ b/code/lib/cli-storybook/src/doctor/index.ts @@ -1,11 +1,12 @@ +import { createWriteStream } from 'node:fs'; import { join } from 'node:path'; import { JsPackageManagerFactory, temporaryFile } from 'storybook/internal/common'; import type { PackageManagerName } from 'storybook/internal/common'; +import { move, remove } from '@ndelangen/fs-extra-unified'; import boxen from 'boxen'; import chalk from 'chalk'; -import { createWriteStream, move, remove } from 'fs-extra'; import { dedent } from 'ts-dedent'; import { cleanLog } from '../automigrate/helpers/cleanLog'; diff --git a/code/lib/cli-storybook/src/link.ts b/code/lib/cli-storybook/src/link.ts index 369d668d2c2a..d231eda0aed7 100644 --- a/code/lib/cli-storybook/src/link.ts +++ b/code/lib/cli-storybook/src/link.ts @@ -2,9 +2,9 @@ import { basename, extname, join } from 'node:path'; import { logger } from 'storybook/internal/node-logger'; +import { ensureDir, readJSON } from '@ndelangen/fs-extra-unified'; import chalk from 'chalk'; import { spawn as spawnAsync, sync as spawnSync } from 'cross-spawn'; -import fse from 'fs-extra'; type ExecOptions = Parameters[2]; @@ -61,7 +61,7 @@ export const exec = async ( export const link = async ({ target, local, start }: LinkOptions) => { const storybookDir = process.cwd(); try { - const packageJson = await fse.readJSON('package.json'); + const packageJson = await readJSON('package.json'); if (packageJson.name !== '@storybook/root') { throw new Error(); } @@ -75,7 +75,7 @@ export const link = async ({ target, local, start }: LinkOptions) => { if (!local) { const reprosDir = join(storybookDir, '../storybook-repros'); logger.info(`Ensuring directory ${reprosDir}`); - await fse.ensureDir(reprosDir); + await ensureDir(reprosDir); logger.info(`Cloning ${target}`); await exec(`git clone ${target}`, { cwd: reprosDir }); @@ -84,7 +84,7 @@ export const link = async ({ target, local, start }: LinkOptions) => { reproDir = join(reprosDir, reproName); } - const reproPackageJson = await fse.readJSON(join(reproDir, 'package.json')); + const reproPackageJson = await readJSON(join(reproDir, 'package.json')); const version = spawnSync('yarn', ['--version'], { cwd: reproDir, diff --git a/code/lib/cli-storybook/src/sandbox.ts b/code/lib/cli-storybook/src/sandbox.ts index a6b4fe40f043..4bbe097d7d16 100644 --- a/code/lib/cli-storybook/src/sandbox.ts +++ b/code/lib/cli-storybook/src/sandbox.ts @@ -1,3 +1,5 @@ +import { existsSync } from 'node:fs'; +import { readdir } from 'node:fs/promises'; import { isAbsolute, join } from 'node:path'; import type { PackageManagerName } from 'storybook/internal/common'; @@ -7,7 +9,6 @@ import { versions } from 'storybook/internal/common'; import boxen from 'boxen'; import chalk from 'chalk'; import { initiate } from 'create-storybook'; -import { existsSync, readdir } from 'fs-extra'; import { downloadTemplate } from 'giget'; import prompts from 'prompts'; import { lt, prerelease } from 'semver'; diff --git a/code/lib/cli-storybook/test/helpers.cjs b/code/lib/cli-storybook/test/helpers.cjs index 6b68939a4659..5b63069cf9f6 100644 --- a/code/lib/cli-storybook/test/helpers.cjs +++ b/code/lib/cli-storybook/test/helpers.cjs @@ -1,7 +1,7 @@ const { sync: spawnSync } = require('cross-spawn'); const path = require('path'); -const CLI_PATH = path.join(__dirname, '..', 'bin', 'index.cjs'); +const CLI_PATH = path.join(__dirname, '..', 'dist', 'bin', 'index.js'); /** * Execute command diff --git a/code/lib/cli/bin/index.cjs b/code/lib/cli/bin/index.cjs index 0aecdd1e9b9b..1c6439d87766 100755 --- a/code/lib/cli/bin/index.cjs +++ b/code/lib/cli/bin/index.cjs @@ -23,4 +23,11 @@ process.once('uncaughtException', (error) => { throw error; }); -require('../dist/proxy.cjs'); +const run = async () => { + await import('../dist/proxy.js'); +}; + +run().catch((e) => { + console.error(e); + process.exit(1); +}); diff --git a/code/lib/cli/package.json b/code/lib/cli/package.json index 4822099fdcb2..faa3c55d41a9 100644 --- a/code/lib/cli/package.json +++ b/code/lib/cli/package.json @@ -28,9 +28,7 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "node": "./dist/index.cjs", - "import": "./dist/index.js", - "require": "./dist/index.cjs" + "import": "./dist/index.js" }, "./bin/index.cjs": { "node": "./bin/index.cjs", @@ -38,9 +36,7 @@ }, "./core-path": { "types": "./dist/core-path.d.ts", - "node": "./dist/core-path.cjs", - "import": "./dist/core-path.js", - "require": "./dist/core-path.cjs" + "import": "./dist/core-path.js" }, "./package.json": "./package.json", "./core": { @@ -332,6 +328,9 @@ "./src/core-path.ts", "./src/index.ts" ], + "formats": [ + "esm" + ], "platform": "node" }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" diff --git a/code/lib/cli/scripts/update-core-portal.ts b/code/lib/cli/scripts/update-core-portal.ts index b5896549366d..9708ffc12aec 100644 --- a/code/lib/cli/scripts/update-core-portal.ts +++ b/code/lib/cli/scripts/update-core-portal.ts @@ -1,8 +1,8 @@ import { join } from 'node:path'; -import { readJSON } from 'fs-extra'; +import { readJSON } from '@ndelangen/fs-extra-unified'; -import { sortPackageJson } from '../../../../scripts/node_modules/sort-package-json'; +import { sortPackageJson } from '../../../../scripts/prepare/tools'; import { generateMapperContent, mapCoreExportToSelf, write } from './utils'; /** diff --git a/code/lib/cli/scripts/utils.ts b/code/lib/cli/scripts/utils.ts index e453988fad64..275909b68fe8 100644 --- a/code/lib/cli/scripts/utils.ts +++ b/code/lib/cli/scripts/utils.ts @@ -1,4 +1,6 @@ -import { ensureFile, writeFile } from 'fs-extra'; +import { writeFile } from 'node:fs/promises'; + +import { ensureFile } from '@ndelangen/fs-extra-unified'; import { dedent } from 'ts-dedent'; export const write = async (location: string, data: string) => { diff --git a/code/lib/cli/src/proxy.ts b/code/lib/cli/src/proxy.ts index 12cac7558ae5..b87b61b493a6 100644 --- a/code/lib/cli/src/proxy.ts +++ b/code/lib/cli/src/proxy.ts @@ -4,8 +4,15 @@ import { spawn } from 'child_process'; const args = process.argv.slice(2); +const run = async () => { + await import('@storybook/core/cli/bin'); +}; + if (['dev', 'build'].includes(args[0])) { - require('@storybook/core/cli/bin'); + run().catch((e) => { + console.error(e); + process.exit(1); + }); } else { const proxiedArgs = args[0] === 'init' diff --git a/code/lib/codemod/src/transforms/__tests__/mdx-to-csf.test.ts b/code/lib/codemod/src/transforms/__tests__/mdx-to-csf.test.ts index 304fb0c40b05..6d41995d3e82 100644 --- a/code/lib/codemod/src/transforms/__tests__/mdx-to-csf.test.ts +++ b/code/lib/codemod/src/transforms/__tests__/mdx-to-csf.test.ts @@ -7,7 +7,7 @@ import { dedent } from 'ts-dedent'; import jscodeshift, { nameToValidExport } from '../mdx-to-csf'; expect.addSnapshotSerializer({ - print: (val: any) => (typeof val === 'string' ? val : JSON.stringify(val, null, 2) ?? ''), + print: (val: any) => (typeof val === 'string' ? val : (JSON.stringify(val, null, 2) ?? '')), test: () => true, }); diff --git a/code/lib/create-storybook/bin/index.cjs b/code/lib/create-storybook/bin/index.cjs index ce13973e4eb9..31d3e3b32f58 100755 --- a/code/lib/create-storybook/bin/index.cjs +++ b/code/lib/create-storybook/bin/index.cjs @@ -23,4 +23,11 @@ process.once('uncaughtException', (error) => { throw error; }); -require('../dist/bin/index.cjs'); +const run = async () => { + await import('../dist/bin/index.js'); +}; + +run().catch((e) => { + console.error(e); + process.exit(1); +}); diff --git a/code/lib/create-storybook/package.json b/code/lib/create-storybook/package.json index 3f0e57fa6a0c..c58ee8742fee 100644 --- a/code/lib/create-storybook/package.json +++ b/code/lib/create-storybook/package.json @@ -21,17 +21,13 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "node": "./dist/index.cjs", - "import": "./dist/index.js", - "require": "./dist/index.cjs" + "import": "./dist/index.js" }, "./bin/index.cjs": { - "node": "./bin/index.cjs", "require": "./bin/index.cjs" }, "./package.json": "./package.json" }, - "main": "dist/index.cjs", "module": "dist/index.js", "types": "dist/index.d.ts", "typesVersions": { @@ -61,7 +57,6 @@ "execa": "^5.0.0", "fd-package-json": "^1.2.0", "find-up": "^5.0.0", - "fs-extra": "^11.1.0", "ora": "^5.4.1", "prettier": "^3.1.1", "prompts": "^2.4.0", @@ -71,9 +66,12 @@ "ts-dedent": "^2.0.0" }, "devDependencies": { + "@ndelangen/fs-extra-unified": "^1.0.4", + "@types/fs-extra": "^11.0.4", "@types/prompts": "^2.0.9", "@types/util-deprecate": "^1.0.0", "boxen": "^7.1.1", + "fs-extra": "^11.1.0", "typescript": "^5.3.2" }, "publishConfig": { @@ -84,6 +82,9 @@ "./src/index.ts", "./src/bin/index.ts" ], + "formats": [ + "esm" + ], "platform": "node" }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" diff --git a/code/lib/create-storybook/src/generators/baseGenerator.ts b/code/lib/create-storybook/src/generators/baseGenerator.ts index 20318b78a68e..c3715d8f9975 100644 --- a/code/lib/create-storybook/src/generators/baseGenerator.ts +++ b/code/lib/create-storybook/src/generators/baseGenerator.ts @@ -1,16 +1,21 @@ import { dirname, join } from 'node:path'; -import type { NpmOptions } from 'storybook/internal/cli'; -import type { Builder, SupportedRenderers } from 'storybook/internal/cli'; -import { SupportedLanguage, externalFrameworks } from 'storybook/internal/cli'; -import { copyTemplateFiles } from 'storybook/internal/cli'; -import { configureEslintPlugin, extractEslintInfo } from 'storybook/internal/cli'; +import { + type Builder, + type NpmOptions, + SupportedLanguage, + type SupportedRenderers, + configureEslintPlugin, + copyTemplateFiles, + externalFrameworks, + extractEslintInfo, +} from 'storybook/internal/cli'; import { detectBuilder } from 'storybook/internal/cli'; import type { JsPackageManager } from 'storybook/internal/common'; import { getPackageDetails, versions as packageVersions } from 'storybook/internal/common'; import type { SupportedFrameworks } from 'storybook/internal/types'; -import fse from 'fs-extra'; +import { ensureDir } from '@ndelangen/fs-extra-unified'; import ora from 'ora'; import invariant from 'tiny-invariant'; import { dedent } from 'ts-dedent'; @@ -328,7 +333,7 @@ export async function baseGenerator( addDependenciesSpinner.succeed(); } - await fse.ensureDir(`./${storybookConfigFolder}`); + await ensureDir(`./${storybookConfigFolder}`); if (addMainFile) { const prefixes = shouldApplyRequireWrapperOnPackageNames diff --git a/code/lib/create-storybook/src/generators/configure.test.ts b/code/lib/create-storybook/src/generators/configure.test.ts index b1ce1005d230..8cab671d666e 100644 --- a/code/lib/create-storybook/src/generators/configure.test.ts +++ b/code/lib/create-storybook/src/generators/configure.test.ts @@ -1,13 +1,17 @@ +import { writeFile } from 'node:fs/promises'; + import { beforeAll, describe, expect, it, vi } from 'vitest'; import { SupportedLanguage } from 'storybook/internal/cli'; -import fse from 'fs-extra'; +import { pathExists } from '@ndelangen/fs-extra-unified'; import { dedent } from 'ts-dedent'; import { configureMain, configurePreview } from './configure'; -vi.mock('fs-extra'); +vi.mock('@ndelangen/fs-extra-unified'); +vi.mock('node:fs/promises'); +vi.mock('node:fs'); describe('configureMain', () => { beforeAll(() => { @@ -25,7 +29,7 @@ describe('configureMain', () => { }, }); - const { calls } = vi.mocked(fse.writeFile).mock; + const { calls } = vi.mocked(writeFile).mock; const [mainConfigPath, mainConfigContent] = calls[0]; expect(mainConfigPath).toEqual('./.storybook/main.js'); @@ -54,7 +58,7 @@ describe('configureMain', () => { }, }); - const { calls } = vi.mocked(fse.writeFile).mock; + const { calls } = vi.mocked(writeFile).mock; const [mainConfigPath, mainConfigContent] = calls[0]; expect(mainConfigPath).toEqual('./.storybook/main.ts'); @@ -89,7 +93,7 @@ describe('configureMain', () => { }, }); - const { calls } = vi.mocked(fse.writeFile).mock; + const { calls } = vi.mocked(writeFile).mock; const [mainConfigPath, mainConfigContent] = calls[0]; expect(mainConfigPath).toEqual('./.storybook/main.js'); @@ -123,7 +127,7 @@ describe('configurePreview', () => { rendererId: 'react', }); - const { calls } = vi.mocked(fse.writeFile).mock; + const { calls } = vi.mocked(writeFile).mock; const [previewConfigPath, previewConfigContent] = calls[0]; expect(previewConfigPath).toEqual('./.storybook/preview.js'); @@ -152,7 +156,7 @@ describe('configurePreview', () => { rendererId: 'react', }); - const { calls } = vi.mocked(fse.writeFile).mock; + const { calls } = vi.mocked(writeFile).mock; const [previewConfigPath, previewConfigContent] = calls[0]; expect(previewConfigPath).toEqual('./.storybook/preview.ts'); @@ -176,13 +180,13 @@ describe('configurePreview', () => { }); it('should not do anything if the framework template already included a preview', async () => { - vi.mocked(fse.pathExists).mockImplementationOnce(() => Promise.resolve(true)); + vi.mocked(pathExists).mockImplementationOnce(() => Promise.resolve(true)); await configurePreview({ language: SupportedLanguage.TYPESCRIPT_4_9, storybookConfigFolder: '.storybook', rendererId: 'react', }); - expect(fse.writeFile).not.toHaveBeenCalled(); + expect(writeFile).not.toHaveBeenCalled(); }); it('should add prefix if frameworkParts are passed', async () => { @@ -199,7 +203,7 @@ describe('configurePreview', () => { }, }); - const { calls } = vi.mocked(fse.writeFile).mock; + const { calls } = vi.mocked(writeFile).mock; const [previewConfigPath, previewConfigContent] = calls[0]; expect(previewConfigPath).toEqual('./.storybook/preview.ts'); diff --git a/code/lib/create-storybook/src/generators/configure.ts b/code/lib/create-storybook/src/generators/configure.ts index 94304f4c2d06..224f1dd9c39f 100644 --- a/code/lib/create-storybook/src/generators/configure.ts +++ b/code/lib/create-storybook/src/generators/configure.ts @@ -1,9 +1,10 @@ +import { writeFile } from 'node:fs/promises'; import { resolve } from 'node:path'; import { SupportedLanguage, externalFrameworks } from 'storybook/internal/cli'; import { logger } from 'storybook/internal/node-logger'; -import fse from 'fs-extra'; +import { pathExists } from '@ndelangen/fs-extra-unified'; import { dedent } from 'ts-dedent'; interface ConfigureMainOptions { @@ -59,7 +60,7 @@ export async function configureMain({ ...custom }: ConfigureMainOptions) { const srcPath = resolve(storybookConfigFolder, '../src'); - const prefix = (await fse.pathExists(srcPath)) ? '../src' : '../stories'; + const prefix = (await pathExists(srcPath)) ? '../src' : '../stories'; const config = { stories: [`${prefix}/**/*.mdx`, `${prefix}/**/*.stories.@(${extensions.join('|')})`], addons, @@ -114,7 +115,7 @@ export async function configureMain({ logger.verbose(`Failed to prettify ${mainPath}`); } - await fse.writeFile(mainPath, mainJsContents, { encoding: 'utf8' }); + await writeFile(mainPath, mainJsContents, { encoding: 'utf8' }); } export async function configurePreview(options: ConfigurePreviewOptions) { @@ -134,7 +135,7 @@ export async function configurePreview(options: ConfigurePreviewOptions) { const previewPath = `./${options.storybookConfigFolder}/preview.${isTypescript ? 'ts' : 'js'}`; // If the framework template included a preview then we have nothing to do - if (await fse.pathExists(previewPath)) { + if (await pathExists(previewPath)) { return; } @@ -177,5 +178,5 @@ export async function configurePreview(options: ConfigurePreviewOptions) { logger.verbose(`Failed to prettify ${previewPath}`); } - await fse.writeFile(previewPath, preview, { encoding: 'utf8' }); + await writeFile(previewPath, preview, { encoding: 'utf8' }); } diff --git a/code/lib/create-storybook/src/scaffold-new-project.ts b/code/lib/create-storybook/src/scaffold-new-project.ts index f80ff2281f23..8e00dee4e4c1 100644 --- a/code/lib/create-storybook/src/scaffold-new-project.ts +++ b/code/lib/create-storybook/src/scaffold-new-project.ts @@ -1,12 +1,14 @@ +import { readdirSync } from 'node:fs'; + import type { PackageManagerName } from 'storybook/internal/common'; import { logger } from 'storybook/internal/node-logger'; import { GenerateNewProjectOnInitError } from 'storybook/internal/server-errors'; import { telemetry } from 'storybook/internal/telemetry'; +import { remove } from '@ndelangen/fs-extra-unified'; import boxen from 'boxen'; import chalk from 'chalk'; import execa from 'execa'; -import { readdirSync, remove } from 'fs-extra'; import prompts from 'prompts'; import { dedent } from 'ts-dedent'; diff --git a/code/package.json b/code/package.json index 119cadfb7f2a..6abc4e8daba8 100644 --- a/code/package.json +++ b/code/package.json @@ -91,6 +91,7 @@ "dependencies": { "@chromatic-com/storybook": "^1.6.1", "@happy-dom/global-registrator": "^14.12.0", + "@ndelangen/fs-extra-unified": "^1.0.4", "@nx/eslint": "18.0.6", "@nx/vite": "18.0.6", "@nx/workspace": "18.0.6", diff --git a/code/presets/react-webpack/package.json b/code/presets/react-webpack/package.json index 420082f1b75d..d56b559a3c70 100644 --- a/code/presets/react-webpack/package.json +++ b/code/presets/react-webpack/package.json @@ -70,7 +70,6 @@ "@types/node": "^22.0.0", "@types/semver": "^7.3.4", "find-up": "^5.0.0", - "fs-extra": "^11.1.0", "magic-string": "^0.30.5", "react-docgen": "^7.0.0", "resolve": "^1.22.8", @@ -79,6 +78,9 @@ "webpack": "5" }, "devDependencies": { + "@ndelangen/fs-extra-unified": "^1.0.4", + "@types/fs-extra": "^11.0.4", + "fs-extra": "^11.1.0", "typescript": "^5.3.2" }, "peerDependencies": { diff --git a/code/presets/server-webpack/package.json b/code/presets/server-webpack/package.json index c88d84b39127..dba01cd6a5c9 100644 --- a/code/presets/server-webpack/package.json +++ b/code/presets/server-webpack/package.json @@ -63,6 +63,8 @@ "yaml-loader": "^0.8.0" }, "devDependencies": { + "@ndelangen/fs-extra-unified": "^1.0.4", + "@types/fs-extra": "^11.0.4", "fs-extra": "^11.1.0", "typescript": "^5.3.2", "yaml": "^2.3.1" diff --git a/code/presets/server-webpack/src/lib/compiler/json-to-csf-compiler.test.ts b/code/presets/server-webpack/src/lib/compiler/json-to-csf-compiler.test.ts index 0c44665bdc25..ac1b524dee3a 100644 --- a/code/presets/server-webpack/src/lib/compiler/json-to-csf-compiler.test.ts +++ b/code/presets/server-webpack/src/lib/compiler/json-to-csf-compiler.test.ts @@ -1,14 +1,15 @@ +import { readdirSync } from 'node:fs'; +import { readFile } from 'node:fs/promises'; import { join } from 'node:path'; import { describe, expect, it } from 'vitest'; -import fs from 'fs-extra'; import YAML from 'yaml'; import { compileCsfModule } from '.'; async function generate(filePath: string) { - const content = await fs.readFile(filePath, 'utf8'); + const content = await readFile(filePath, 'utf8'); const parsed = filePath.endsWith('.json') ? JSON.parse(content) : YAML.parse(content); return compileCsfModule(parsed); } @@ -18,7 +19,7 @@ async function generate(filePath: string) { describe(`${fileType}-to-csf-compiler`, () => { const transformFixturesDir = join(__dirname, '__testfixtures__'); - fs.readdirSync(transformFixturesDir) + readdirSync(transformFixturesDir) .filter((fileName: string) => inputRegExp.test(fileName)) .forEach((fixtureFile: string) => { it(`${fixtureFile}`, async () => { diff --git a/code/renderers/server/package.json b/code/renderers/server/package.json index 09a468b8ceb0..f392d13d7ad3 100644 --- a/code/renderers/server/package.json +++ b/code/renderers/server/package.json @@ -51,12 +51,13 @@ "@storybook/manager-api": "workspace:^", "@storybook/preview-api": "workspace:^", "@storybook/theming": "workspace:^", - "@types/fs-extra": "^11.0.1", - "fs-extra": "^11.1.0", "ts-dedent": "^2.0.0", "yaml": "^2.3.1" }, "devDependencies": { + "@ndelangen/fs-extra-unified": "^1.0.4", + "@types/fs-extra": "^11.0.1", + "fs-extra": "^11.1.0", "typescript": "^5.3.2" }, "peerDependencies": { diff --git a/code/renderers/server/src/preset.ts b/code/renderers/server/src/preset.ts index 018f50623eee..2bf9b3b324d5 100644 --- a/code/renderers/server/src/preset.ts +++ b/code/renderers/server/src/preset.ts @@ -1,8 +1,9 @@ +import { readFile } from 'node:fs/promises'; import { join } from 'node:path'; import type { ComponentTitle, PresetProperty, StoryName, Tag } from 'storybook/internal/types'; -import fs from 'fs-extra'; +import { readJson } from '@ndelangen/fs-extra-unified'; import yaml from 'yaml'; type FileContent = { @@ -19,8 +20,8 @@ export const experimental_indexers: PresetProperty<'experimental_indexers'> = ( test: /(stories|story)\.(json|ya?ml)$/, createIndex: async (fileName) => { const content: FileContent = fileName.endsWith('.json') - ? await fs.readJson(fileName, 'utf-8') - : yaml.parse((await fs.readFile(fileName, 'utf-8')).toString()); + ? await readJson(fileName, 'utf-8') + : yaml.parse((await readFile(fileName, 'utf-8')).toString()); return content.stories.map((story) => { const tags = Array.from(new Set([...(content.tags ?? []), ...(story.tags ?? [])])); diff --git a/code/renderers/svelte/package.json b/code/renderers/svelte/package.json index 3939a1699c66..4b7430723425 100644 --- a/code/renderers/svelte/package.json +++ b/code/renderers/svelte/package.json @@ -65,8 +65,10 @@ "type-fest": "~2.19" }, "devDependencies": { + "@ndelangen/fs-extra-unified": "^1.0.4", "@sveltejs/vite-plugin-svelte": "^3.0.2", "@testing-library/svelte": "patch:@testing-library/svelte@npm%3A4.1.0#~/.yarn/patches/@testing-library-svelte-npm-4.1.0-34b7037bc0.patch", + "@types/fs-extra": "^11.0.4", "expect-type": "^0.15.0", "fs-extra": "^11.1.0", "svelte": "^5.0.0-next.65", diff --git a/code/renderers/svelte/scripts/copy-unbundled-to-dist.ts b/code/renderers/svelte/scripts/copy-unbundled-to-dist.ts index a82964679960..d907833017bf 100644 --- a/code/renderers/svelte/scripts/copy-unbundled-to-dist.ts +++ b/code/renderers/svelte/scripts/copy-unbundled-to-dist.ts @@ -1,5 +1,6 @@ -import { copy } from 'fs-extra'; -import { join } from 'path'; +import { join } from 'node:path'; + +import { copy } from '@ndelangen/fs-extra-unified'; const src = join(__dirname, '..', 'src'); const dist = join(__dirname, '..', 'dist'); diff --git a/code/renderers/vue3/src/docs/extractArgTypes.ts b/code/renderers/vue3/src/docs/extractArgTypes.ts index 7e76c731177f..f52f21c15255 100644 --- a/code/renderers/vue3/src/docs/extractArgTypes.ts +++ b/code/renderers/vue3/src/docs/extractArgTypes.ts @@ -129,7 +129,7 @@ export const extractFromVueDocgenApi = ( } } - const required = 'required' in docgenInfo ? docgenInfo.required ?? false : false; + const required = 'required' in docgenInfo ? (docgenInfo.required ?? false) : false; return { name: docgenInfo.name, diff --git a/code/tsconfig.json b/code/tsconfig.json index 0ee2306040e0..e2205182a446 100644 --- a/code/tsconfig.json +++ b/code/tsconfig.json @@ -10,13 +10,13 @@ "isolatedModules": true, "jsx": "react", "lib": ["dom", "dom.iterable", "esnext"], - "module": "CommonJS", - "moduleResolution": "Node", + "module": "Preserve", + "moduleResolution": "Bundler", "noImplicitAny": true, "noUnusedLocals": false, "skipLibCheck": true, - "strict": true, "noEmit": true, + "strict": true, "strictBindCallApply": true, "target": "ES2020" }, diff --git a/code/yarn.lock b/code/yarn.lock index c66db4d13c36..55c4b63464ca 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -377,7 +377,7 @@ __metadata: languageName: node linkType: hard -"@babel/compat-data@npm:^7.22.6, @babel/compat-data@npm:^7.23.5, @babel/compat-data@npm:^7.24.4, @babel/compat-data@npm:^7.25.2": +"@babel/compat-data@npm:^7.22.6, @babel/compat-data@npm:^7.23.5, @babel/compat-data@npm:^7.24.7, @babel/compat-data@npm:^7.25.2": version: 7.25.2 resolution: "@babel/compat-data@npm:7.25.2" checksum: 10c0/5bf1f14d6e5f0d37c19543e99209ff4a94bb97915e1ce01e5334a144aa08cd56b6e62ece8135dac77e126723d63d4d4b96fc603a12c43b88c28f4b5e070270c5 @@ -497,7 +497,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-annotate-as-pure@npm:^7.18.6, @babel/helper-annotate-as-pure@npm:^7.22.5, @babel/helper-annotate-as-pure@npm:^7.24.7": +"@babel/helper-annotate-as-pure@npm:^7.18.6, @babel/helper-annotate-as-pure@npm:^7.24.7": version: 7.24.7 resolution: "@babel/helper-annotate-as-pure@npm:7.24.7" dependencies: @@ -629,7 +629,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-module-imports@npm:^7.16.7, @babel/helper-module-imports@npm:^7.22.15, @babel/helper-module-imports@npm:^7.24.3, @babel/helper-module-imports@npm:^7.24.7, @babel/helper-module-imports@npm:^7.8.3": +"@babel/helper-module-imports@npm:^7.16.7, @babel/helper-module-imports@npm:^7.22.15, @babel/helper-module-imports@npm:^7.24.7, @babel/helper-module-imports@npm:^7.8.3": version: 7.24.7 resolution: "@babel/helper-module-imports@npm:7.24.7" dependencies: @@ -747,7 +747,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-validator-option@npm:^7.22.15, @babel/helper-validator-option@npm:^7.23.5, @babel/helper-validator-option@npm:^7.24.8": +"@babel/helper-validator-option@npm:^7.23.5, @babel/helper-validator-option@npm:^7.24.7, @babel/helper-validator-option@npm:^7.24.8": version: 7.24.8 resolution: "@babel/helper-validator-option@npm:7.24.8" checksum: 10c0/73db93a34ae89201351288bee7623eed81a54000779462a986105b54ffe82069e764afd15171a428b82e7c7a9b5fec10b5d5603b216317a414062edf5c67a21f @@ -799,19 +799,19 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:^7.24.4": - version: 7.24.4 - resolution: "@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:7.24.4" +"@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:^7.24.7": + version: 7.24.7 + resolution: "@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:7.24.7" dependencies: - "@babel/helper-environment-visitor": "npm:^7.22.20" - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-environment-visitor": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0 - checksum: 10c0/9aed453a1a21e4fd29add0b4a2d82a2c6f43a47c80d28411f8327f2a714064bc93a6f622c701d263970e0d72d7901d28f7f51e91ba91a31306efe8f17c411182 + checksum: 10c0/394c30e2b708ad385fa1219528e039066a1f1cb40f47986f283878848fd354c745e6397f588b4e5a046ee8d64bfdf4c208e4c3dfbdcfb2fd34315ec67c64e7af languageName: node linkType: hard -"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.23.3, @babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.24.1": +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.23.3, @babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:7.24.7" dependencies: @@ -822,7 +822,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:^7.23.3, @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:^7.24.1": +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:^7.23.3, @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:7.24.7" dependencies: @@ -835,7 +835,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@npm:^7.23.7, @babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@npm:^7.24.1": +"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@npm:^7.23.7, @babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@npm:7.24.7" dependencies: @@ -1009,18 +1009,18 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-flow@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-syntax-flow@npm:7.22.5" +"@babel/plugin-syntax-flow@npm:^7.24.7": + version: 7.24.7 + resolution: "@babel/plugin-syntax-flow@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.22.5" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/07afc7df02141597968532bfbfa3f6c0ad21a2bdd885d0e5e035dcf60fdf35f0995631c9750b464e1a6f2feea14160a82787f914e88e8f7115dc99f09853e43e + checksum: 10c0/2f0cb7a78379029707e61f6665634a5b758c8b4ccb602a72d798e41d36b0647c2f2de59f90e0c1d522b026962918e54d82f3aee0c194dc87cd340455aa58562a languageName: node linkType: hard -"@babel/plugin-syntax-import-assertions@npm:^7.23.3, @babel/plugin-syntax-import-assertions@npm:^7.24.1": +"@babel/plugin-syntax-import-assertions@npm:^7.23.3, @babel/plugin-syntax-import-assertions@npm:^7.24.1, @babel/plugin-syntax-import-assertions@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-syntax-import-assertions@npm:7.24.7" dependencies: @@ -1031,7 +1031,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-import-attributes@npm:^7.23.3, @babel/plugin-syntax-import-attributes@npm:^7.24.1": +"@babel/plugin-syntax-import-attributes@npm:^7.23.3, @babel/plugin-syntax-import-attributes@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-syntax-import-attributes@npm:7.24.7" dependencies: @@ -1064,14 +1064,14 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-jsx@npm:^7.23.3, @babel/plugin-syntax-jsx@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-syntax-jsx@npm:7.24.1" +"@babel/plugin-syntax-jsx@npm:^7.24.7": + version: 7.24.7 + resolution: "@babel/plugin-syntax-jsx@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/6cec76fbfe6ca81c9345c2904d8d9a8a0df222f9269f0962ed6eb2eb8f3f10c2f15e993d1ef09dbaf97726bf1792b5851cf5bd9a769f966a19448df6be95d19a + checksum: 10c0/f44d927a9ae8d5ef016ff5b450e1671e56629ddc12e56b938e41fd46e141170d9dfc9a53d6cb2b9a20a7dd266a938885e6a3981c60c052a2e1daed602ac80e51 languageName: node linkType: hard @@ -1186,7 +1186,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-arrow-functions@npm:^7.23.3, @babel/plugin-transform-arrow-functions@npm:^7.24.1": +"@babel/plugin-transform-arrow-functions@npm:^7.23.3, @babel/plugin-transform-arrow-functions@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-arrow-functions@npm:7.24.7" dependencies: @@ -1211,7 +1211,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-async-generator-functions@npm:^7.23.9, @babel/plugin-transform-async-generator-functions@npm:^7.24.3": +"@babel/plugin-transform-async-generator-functions@npm:^7.23.9, @babel/plugin-transform-async-generator-functions@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-async-generator-functions@npm:7.24.7" dependencies: @@ -1238,7 +1238,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-async-to-generator@npm:^7.23.3, @babel/plugin-transform-async-to-generator@npm:^7.24.1": +"@babel/plugin-transform-async-to-generator@npm:^7.23.3, @babel/plugin-transform-async-to-generator@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-async-to-generator@npm:7.24.7" dependencies: @@ -1251,7 +1251,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-block-scoped-functions@npm:^7.23.3, @babel/plugin-transform-block-scoped-functions@npm:^7.24.1": +"@babel/plugin-transform-block-scoped-functions@npm:^7.23.3, @babel/plugin-transform-block-scoped-functions@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-block-scoped-functions@npm:7.24.7" dependencies: @@ -1262,7 +1262,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-block-scoping@npm:^7.23.4, @babel/plugin-transform-block-scoping@npm:^7.24.4, @babel/plugin-transform-block-scoping@npm:^7.8.3": +"@babel/plugin-transform-block-scoping@npm:^7.23.4, @babel/plugin-transform-block-scoping@npm:^7.24.7, @babel/plugin-transform-block-scoping@npm:^7.8.3": version: 7.24.7 resolution: "@babel/plugin-transform-block-scoping@npm:7.24.7" dependencies: @@ -1273,7 +1273,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-class-properties@npm:^7.22.5, @babel/plugin-transform-class-properties@npm:^7.23.3, @babel/plugin-transform-class-properties@npm:^7.24.1": +"@babel/plugin-transform-class-properties@npm:^7.22.5, @babel/plugin-transform-class-properties@npm:^7.23.3, @babel/plugin-transform-class-properties@npm:^7.24.1, @babel/plugin-transform-class-properties@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-class-properties@npm:7.24.7" dependencies: @@ -1285,7 +1285,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-class-static-block@npm:^7.23.4, @babel/plugin-transform-class-static-block@npm:^7.24.4": +"@babel/plugin-transform-class-static-block@npm:^7.23.4, @babel/plugin-transform-class-static-block@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-class-static-block@npm:7.24.7" dependencies: @@ -1298,7 +1298,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-classes@npm:^7.23.8, @babel/plugin-transform-classes@npm:^7.24.1": +"@babel/plugin-transform-classes@npm:^7.23.8, @babel/plugin-transform-classes@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-classes@npm:7.24.7" dependencies: @@ -1316,7 +1316,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-computed-properties@npm:^7.23.3, @babel/plugin-transform-computed-properties@npm:^7.24.1": +"@babel/plugin-transform-computed-properties@npm:^7.23.3, @babel/plugin-transform-computed-properties@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-computed-properties@npm:7.24.7" dependencies: @@ -1328,7 +1328,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-destructuring@npm:^7.23.3, @babel/plugin-transform-destructuring@npm:^7.24.1": +"@babel/plugin-transform-destructuring@npm:^7.23.3, @babel/plugin-transform-destructuring@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-destructuring@npm:7.24.7" dependencies: @@ -1339,7 +1339,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-dotall-regex@npm:^7.23.3, @babel/plugin-transform-dotall-regex@npm:^7.24.1": +"@babel/plugin-transform-dotall-regex@npm:^7.23.3, @babel/plugin-transform-dotall-regex@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-dotall-regex@npm:7.24.7" dependencies: @@ -1351,7 +1351,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-duplicate-keys@npm:^7.23.3, @babel/plugin-transform-duplicate-keys@npm:^7.24.1": +"@babel/plugin-transform-duplicate-keys@npm:^7.23.3, @babel/plugin-transform-duplicate-keys@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-duplicate-keys@npm:7.24.7" dependencies: @@ -1362,7 +1362,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-dynamic-import@npm:^7.23.4, @babel/plugin-transform-dynamic-import@npm:^7.24.1": +"@babel/plugin-transform-dynamic-import@npm:^7.23.4, @babel/plugin-transform-dynamic-import@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-dynamic-import@npm:7.24.7" dependencies: @@ -1374,7 +1374,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-exponentiation-operator@npm:^7.23.3, @babel/plugin-transform-exponentiation-operator@npm:^7.24.1": +"@babel/plugin-transform-exponentiation-operator@npm:^7.23.3, @babel/plugin-transform-exponentiation-operator@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-exponentiation-operator@npm:7.24.7" dependencies: @@ -1386,7 +1386,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-export-namespace-from@npm:^7.23.4, @babel/plugin-transform-export-namespace-from@npm:^7.24.1": +"@babel/plugin-transform-export-namespace-from@npm:^7.23.4, @babel/plugin-transform-export-namespace-from@npm:^7.24.1, @babel/plugin-transform-export-namespace-from@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-export-namespace-from@npm:7.24.7" dependencies: @@ -1398,19 +1398,19 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-flow-strip-types@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-flow-strip-types@npm:7.22.5" +"@babel/plugin-transform-flow-strip-types@npm:^7.24.7": + version: 7.24.7 + resolution: "@babel/plugin-transform-flow-strip-types@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.22.5" - "@babel/plugin-syntax-flow": "npm:^7.22.5" + "@babel/helper-plugin-utils": "npm:^7.24.7" + "@babel/plugin-syntax-flow": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/5949a8e5214e3fc65d31dab0551423cea9d9eef35faa5d0004707ba7347baf96166aa400907ce7498f754db4e1e9d039ca434a508546b0dc9fdae9a42e814c1a + checksum: 10c0/9995d52af58ceaa223c6553873bd5a16a94b2abdebb39993d59d9eb0c0c9666636ceb7a80f63ac86fe7ab3cb217f1dac9fb2f448ad5a54f8fb8e41e12716ef9a languageName: node linkType: hard -"@babel/plugin-transform-for-of@npm:^7.23.6, @babel/plugin-transform-for-of@npm:^7.24.1": +"@babel/plugin-transform-for-of@npm:^7.23.6, @babel/plugin-transform-for-of@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-for-of@npm:7.24.7" dependencies: @@ -1422,7 +1422,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-function-name@npm:^7.23.3, @babel/plugin-transform-function-name@npm:^7.24.1": +"@babel/plugin-transform-function-name@npm:^7.23.3, @babel/plugin-transform-function-name@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-function-name@npm:7.24.7" dependencies: @@ -1435,7 +1435,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-json-strings@npm:^7.23.4, @babel/plugin-transform-json-strings@npm:^7.24.1": +"@babel/plugin-transform-json-strings@npm:^7.23.4, @babel/plugin-transform-json-strings@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-json-strings@npm:7.24.7" dependencies: @@ -1447,7 +1447,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-literals@npm:^7.23.3, @babel/plugin-transform-literals@npm:^7.24.1": +"@babel/plugin-transform-literals@npm:^7.23.3, @babel/plugin-transform-literals@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-literals@npm:7.24.7" dependencies: @@ -1458,7 +1458,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-logical-assignment-operators@npm:^7.23.4, @babel/plugin-transform-logical-assignment-operators@npm:^7.24.1": +"@babel/plugin-transform-logical-assignment-operators@npm:^7.23.4, @babel/plugin-transform-logical-assignment-operators@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-logical-assignment-operators@npm:7.24.7" dependencies: @@ -1470,7 +1470,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-member-expression-literals@npm:^7.23.3, @babel/plugin-transform-member-expression-literals@npm:^7.24.1": +"@babel/plugin-transform-member-expression-literals@npm:^7.23.3, @babel/plugin-transform-member-expression-literals@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-member-expression-literals@npm:7.24.7" dependencies: @@ -1481,7 +1481,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-modules-amd@npm:^7.13.0, @babel/plugin-transform-modules-amd@npm:^7.23.3, @babel/plugin-transform-modules-amd@npm:^7.24.1": +"@babel/plugin-transform-modules-amd@npm:^7.13.0, @babel/plugin-transform-modules-amd@npm:^7.23.3, @babel/plugin-transform-modules-amd@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-modules-amd@npm:7.24.7" dependencies: @@ -1493,7 +1493,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-modules-commonjs@npm:^7.13.8, @babel/plugin-transform-modules-commonjs@npm:^7.23.0, @babel/plugin-transform-modules-commonjs@npm:^7.23.3, @babel/plugin-transform-modules-commonjs@npm:^7.24.1": +"@babel/plugin-transform-modules-commonjs@npm:^7.13.8, @babel/plugin-transform-modules-commonjs@npm:^7.23.0, @babel/plugin-transform-modules-commonjs@npm:^7.23.3, @babel/plugin-transform-modules-commonjs@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-modules-commonjs@npm:7.24.7" dependencies: @@ -1506,7 +1506,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-modules-systemjs@npm:^7.23.9, @babel/plugin-transform-modules-systemjs@npm:^7.24.1": +"@babel/plugin-transform-modules-systemjs@npm:^7.23.9, @babel/plugin-transform-modules-systemjs@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-modules-systemjs@npm:7.24.7" dependencies: @@ -1520,7 +1520,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-modules-umd@npm:^7.23.3, @babel/plugin-transform-modules-umd@npm:^7.24.1": +"@babel/plugin-transform-modules-umd@npm:^7.23.3, @babel/plugin-transform-modules-umd@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-modules-umd@npm:7.24.7" dependencies: @@ -1532,7 +1532,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-named-capturing-groups-regex@npm:^7.22.5": +"@babel/plugin-transform-named-capturing-groups-regex@npm:^7.22.5, @babel/plugin-transform-named-capturing-groups-regex@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-named-capturing-groups-regex@npm:7.24.7" dependencies: @@ -1544,7 +1544,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-new-target@npm:^7.23.3, @babel/plugin-transform-new-target@npm:^7.24.1": +"@babel/plugin-transform-new-target@npm:^7.23.3, @babel/plugin-transform-new-target@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-new-target@npm:7.24.7" dependencies: @@ -1555,7 +1555,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-nullish-coalescing-operator@npm:^7.22.11, @babel/plugin-transform-nullish-coalescing-operator@npm:^7.23.4, @babel/plugin-transform-nullish-coalescing-operator@npm:^7.24.1": +"@babel/plugin-transform-nullish-coalescing-operator@npm:^7.22.11, @babel/plugin-transform-nullish-coalescing-operator@npm:^7.23.4, @babel/plugin-transform-nullish-coalescing-operator@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-nullish-coalescing-operator@npm:7.24.7" dependencies: @@ -1567,7 +1567,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-numeric-separator@npm:^7.23.4, @babel/plugin-transform-numeric-separator@npm:^7.24.1": +"@babel/plugin-transform-numeric-separator@npm:^7.23.4, @babel/plugin-transform-numeric-separator@npm:^7.24.1, @babel/plugin-transform-numeric-separator@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-numeric-separator@npm:7.24.7" dependencies: @@ -1590,7 +1590,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-object-rest-spread@npm:^7.24.0, @babel/plugin-transform-object-rest-spread@npm:^7.24.1": +"@babel/plugin-transform-object-rest-spread@npm:^7.24.0, @babel/plugin-transform-object-rest-spread@npm:^7.24.1, @babel/plugin-transform-object-rest-spread@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-object-rest-spread@npm:7.24.7" dependencies: @@ -1604,7 +1604,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-object-super@npm:^7.23.3, @babel/plugin-transform-object-super@npm:^7.24.1": +"@babel/plugin-transform-object-super@npm:^7.23.3, @babel/plugin-transform-object-super@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-object-super@npm:7.24.7" dependencies: @@ -1616,7 +1616,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-optional-catch-binding@npm:^7.23.4, @babel/plugin-transform-optional-catch-binding@npm:^7.24.1": +"@babel/plugin-transform-optional-catch-binding@npm:^7.23.4, @babel/plugin-transform-optional-catch-binding@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-optional-catch-binding@npm:7.24.7" dependencies: @@ -1628,7 +1628,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-optional-chaining@npm:^7.23.0, @babel/plugin-transform-optional-chaining@npm:^7.23.4, @babel/plugin-transform-optional-chaining@npm:^7.24.1, @babel/plugin-transform-optional-chaining@npm:^7.24.7": +"@babel/plugin-transform-optional-chaining@npm:^7.23.0, @babel/plugin-transform-optional-chaining@npm:^7.23.4, @babel/plugin-transform-optional-chaining@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-optional-chaining@npm:7.24.7" dependencies: @@ -1641,7 +1641,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-parameters@npm:^7.23.3, @babel/plugin-transform-parameters@npm:^7.24.1, @babel/plugin-transform-parameters@npm:^7.24.7": +"@babel/plugin-transform-parameters@npm:^7.23.3, @babel/plugin-transform-parameters@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-parameters@npm:7.24.7" dependencies: @@ -1652,7 +1652,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-private-methods@npm:^7.22.5, @babel/plugin-transform-private-methods@npm:^7.23.3, @babel/plugin-transform-private-methods@npm:^7.24.1": +"@babel/plugin-transform-private-methods@npm:^7.22.5, @babel/plugin-transform-private-methods@npm:^7.23.3, @babel/plugin-transform-private-methods@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-private-methods@npm:7.24.7" dependencies: @@ -1664,7 +1664,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-private-property-in-object@npm:^7.23.4, @babel/plugin-transform-private-property-in-object@npm:^7.24.1": +"@babel/plugin-transform-private-property-in-object@npm:^7.23.4, @babel/plugin-transform-private-property-in-object@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-private-property-in-object@npm:7.24.7" dependencies: @@ -1678,7 +1678,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-property-literals@npm:^7.23.3, @babel/plugin-transform-property-literals@npm:^7.24.1": +"@babel/plugin-transform-property-literals@npm:^7.23.3, @babel/plugin-transform-property-literals@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-property-literals@npm:7.24.7" dependencies: @@ -1689,78 +1689,78 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-react-display-name@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-react-display-name@npm:7.24.1" +"@babel/plugin-transform-react-display-name@npm:^7.24.7": + version: 7.24.7 + resolution: "@babel/plugin-transform-react-display-name@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/adf1a3cb0df8134533a558a9072a67e34127fd489dfe431c3348a86dd41f3e74861d5d5134bbb68f61a9cdb3f7e79b2acea1346be94ce4d3328a64e5a9e09be1 + checksum: 10c0/c14a07a9e75723c96f1a0a306b8a8e899ff1c6a0cc3d62bcda79bb1b54e4319127b258651c513a1a47da152cdc22e16525525a30ae5933a2980c7036fd0b4d24 languageName: node linkType: hard -"@babel/plugin-transform-react-jsx-development@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-react-jsx-development@npm:7.22.5" +"@babel/plugin-transform-react-jsx-development@npm:^7.24.7": + version: 7.24.7 + resolution: "@babel/plugin-transform-react-jsx-development@npm:7.24.7" dependencies: - "@babel/plugin-transform-react-jsx": "npm:^7.22.5" + "@babel/plugin-transform-react-jsx": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/4d2e9e68383238feb873f6111df972df4a2ebf6256d6f787a8772241867efa975b3980f7d75ab7d750e7eaad4bd454e8cc6e106301fd7572dd389e553f5f69d2 + checksum: 10c0/fce647db50f90a5291681f0f97865d9dc76981262dff71d6d0332e724b85343de5860c26f9e9a79e448d61e1d70916b07ce91e8c7f2b80dceb4b16aee41794d8 languageName: node linkType: hard "@babel/plugin-transform-react-jsx-self@npm:^7.18.6": - version: 7.22.5 - resolution: "@babel/plugin-transform-react-jsx-self@npm:7.22.5" + version: 7.24.7 + resolution: "@babel/plugin-transform-react-jsx-self@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.22.5" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/263091bdede1f448cb2c59b84eb69972c15d3f022c929a75337bd20d8b65551ac38cd26dad1946eaa93289643506b10ddaea3445a28cb8fca5a773a22a0df90b + checksum: 10c0/dcf3b732401f47f06bb29d6016e48066f66de00029a0ded98ddd9983c770a00a109d91cd04d2700d15ee0bcec3ae3027a5f12d69e15ec56efc0bcbfac65e92cb languageName: node linkType: hard "@babel/plugin-transform-react-jsx-source@npm:^7.19.6": - version: 7.22.5 - resolution: "@babel/plugin-transform-react-jsx-source@npm:7.22.5" + version: 7.24.7 + resolution: "@babel/plugin-transform-react-jsx-source@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.22.5" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/defc9debb76b4295e3617ef7795a0533dbbecef6f51bf5ba4bfc162df892a84fd39e14d5f1b9a5aad7b09b97074fef4c6756f9d2036eef5a9874acabe198f75a + checksum: 10c0/970ef1264c7c6c416ab11610665d5309aec2bd2b9086ae394e1132e65138d97b060a7dc9d31054e050d6dc475b5a213938c9707c0202a5022d55dcb4c5abe28f languageName: node linkType: hard -"@babel/plugin-transform-react-jsx@npm:^7.22.5, @babel/plugin-transform-react-jsx@npm:^7.23.4": - version: 7.23.4 - resolution: "@babel/plugin-transform-react-jsx@npm:7.23.4" +"@babel/plugin-transform-react-jsx@npm:^7.24.7": + version: 7.24.7 + resolution: "@babel/plugin-transform-react-jsx@npm:7.24.7" dependencies: - "@babel/helper-annotate-as-pure": "npm:^7.22.5" - "@babel/helper-module-imports": "npm:^7.22.15" - "@babel/helper-plugin-utils": "npm:^7.22.5" - "@babel/plugin-syntax-jsx": "npm:^7.23.3" - "@babel/types": "npm:^7.23.4" + "@babel/helper-annotate-as-pure": "npm:^7.24.7" + "@babel/helper-module-imports": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" + "@babel/plugin-syntax-jsx": "npm:^7.24.7" + "@babel/types": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/8851b3adc515cd91bdb06ff3a23a0f81f0069cfef79dfb3fa744da4b7a82e3555ccb6324c4fa71ecf22508db13b9ff6a0ed96675f95fc87903b9fc6afb699580 + checksum: 10c0/5c46d2c1c06a30e6bde084839df9cc689bf9c9cb0292105d61c225ca731f64247990724caee7dfc7f817dc964c062e8319e7f05394209590c476b65d75373435 languageName: node linkType: hard -"@babel/plugin-transform-react-pure-annotations@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/plugin-transform-react-pure-annotations@npm:7.24.1" +"@babel/plugin-transform-react-pure-annotations@npm:^7.24.7": + version: 7.24.7 + resolution: "@babel/plugin-transform-react-pure-annotations@npm:7.24.7" dependencies: - "@babel/helper-annotate-as-pure": "npm:^7.22.5" - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-annotate-as-pure": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/9eb3056fcaadd63d404fd5652b2a3f693bc4758ba753fee5b5c580c7a64346eeeb94e5a4f77a99c76f3cf06d1f1ad6c227647cd0b1219efe3d00cafa5a6e7b2a + checksum: 10c0/fae517d293d9c93b7b920458c3e4b91cb0400513889af41ba184a5f3acc8bfef27242cc262741bb8f87870df376f1733a0d0f52b966d342e2aaaf5607af8f73d languageName: node linkType: hard -"@babel/plugin-transform-regenerator@npm:^7.23.3, @babel/plugin-transform-regenerator@npm:^7.24.1": +"@babel/plugin-transform-regenerator@npm:^7.23.3, @babel/plugin-transform-regenerator@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-regenerator@npm:7.24.7" dependencies: @@ -1772,7 +1772,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-reserved-words@npm:^7.23.3, @babel/plugin-transform-reserved-words@npm:^7.24.1": +"@babel/plugin-transform-reserved-words@npm:^7.23.3, @babel/plugin-transform-reserved-words@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-reserved-words@npm:7.24.7" dependencies: @@ -1800,22 +1800,22 @@ __metadata: linkType: hard "@babel/plugin-transform-runtime@npm:^7.13.9, @babel/plugin-transform-runtime@npm:^7.23.2, @babel/plugin-transform-runtime@npm:^7.24.3": - version: 7.24.3 - resolution: "@babel/plugin-transform-runtime@npm:7.24.3" + version: 7.24.7 + resolution: "@babel/plugin-transform-runtime@npm:7.24.7" dependencies: - "@babel/helper-module-imports": "npm:^7.24.3" - "@babel/helper-plugin-utils": "npm:^7.24.0" + "@babel/helper-module-imports": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" babel-plugin-polyfill-corejs2: "npm:^0.4.10" babel-plugin-polyfill-corejs3: "npm:^0.10.1" babel-plugin-polyfill-regenerator: "npm:^0.6.1" semver: "npm:^6.3.1" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/ee01967bf405d84bd95ca4089166a18fb23fe9851a6da53dcf712a7f8ba003319996f21f320d568ec76126e18adfaee978206ccda86eef7652d47cc9a052e75e + checksum: 10c0/a33f5095872bbba00b8ee553dfe6941477e69a017a2e65e9dd86e80dab5c627635093b796eb1eb22aaaf2f874704f63ad1d99b952b83b59ef6b368ae04e5bb41 languageName: node linkType: hard -"@babel/plugin-transform-shorthand-properties@npm:^7.23.3, @babel/plugin-transform-shorthand-properties@npm:^7.24.1": +"@babel/plugin-transform-shorthand-properties@npm:^7.23.3, @babel/plugin-transform-shorthand-properties@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-shorthand-properties@npm:7.24.7" dependencies: @@ -1826,7 +1826,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-spread@npm:^7.23.3, @babel/plugin-transform-spread@npm:^7.24.1": +"@babel/plugin-transform-spread@npm:^7.23.3, @babel/plugin-transform-spread@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-spread@npm:7.24.7" dependencies: @@ -1838,7 +1838,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-sticky-regex@npm:^7.23.3, @babel/plugin-transform-sticky-regex@npm:^7.24.1": +"@babel/plugin-transform-sticky-regex@npm:^7.23.3, @babel/plugin-transform-sticky-regex@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-sticky-regex@npm:7.24.7" dependencies: @@ -1849,7 +1849,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-template-literals@npm:^7.23.3, @babel/plugin-transform-template-literals@npm:^7.24.1": +"@babel/plugin-transform-template-literals@npm:^7.23.3, @babel/plugin-transform-template-literals@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-template-literals@npm:7.24.7" dependencies: @@ -1860,7 +1860,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-typeof-symbol@npm:^7.23.3, @babel/plugin-transform-typeof-symbol@npm:^7.24.1": +"@babel/plugin-transform-typeof-symbol@npm:^7.23.3, @babel/plugin-transform-typeof-symbol@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-typeof-symbol@npm:7.24.7" dependencies: @@ -1871,7 +1871,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-typescript@npm:^7.13.0, @babel/plugin-transform-typescript@npm:^7.24.1": +"@babel/plugin-transform-typescript@npm:^7.13.0, @babel/plugin-transform-typescript@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-typescript@npm:7.24.7" dependencies: @@ -1885,7 +1885,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-unicode-escapes@npm:^7.23.3, @babel/plugin-transform-unicode-escapes@npm:^7.24.1": +"@babel/plugin-transform-unicode-escapes@npm:^7.23.3, @babel/plugin-transform-unicode-escapes@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-unicode-escapes@npm:7.24.7" dependencies: @@ -1896,7 +1896,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-unicode-property-regex@npm:^7.23.3, @babel/plugin-transform-unicode-property-regex@npm:^7.24.1": +"@babel/plugin-transform-unicode-property-regex@npm:^7.23.3, @babel/plugin-transform-unicode-property-regex@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-unicode-property-regex@npm:7.24.7" dependencies: @@ -1908,7 +1908,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-unicode-regex@npm:^7.23.3, @babel/plugin-transform-unicode-regex@npm:^7.24.1": +"@babel/plugin-transform-unicode-regex@npm:^7.23.3, @babel/plugin-transform-unicode-regex@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-unicode-regex@npm:7.24.7" dependencies: @@ -1920,7 +1920,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-unicode-sets-regex@npm:^7.23.3, @babel/plugin-transform-unicode-sets-regex@npm:^7.24.1": +"@babel/plugin-transform-unicode-sets-regex@npm:^7.23.3, @babel/plugin-transform-unicode-sets-regex@npm:^7.24.7": version: 7.24.7 resolution: "@babel/plugin-transform-unicode-sets-regex@npm:7.24.7" dependencies: @@ -2033,25 +2033,25 @@ __metadata: linkType: hard "@babel/preset-env@npm:^7.16.5, @babel/preset-env@npm:^7.23.2, @babel/preset-env@npm:^7.24.4": - version: 7.24.4 - resolution: "@babel/preset-env@npm:7.24.4" + version: 7.24.7 + resolution: "@babel/preset-env@npm:7.24.7" dependencies: - "@babel/compat-data": "npm:^7.24.4" - "@babel/helper-compilation-targets": "npm:^7.23.6" - "@babel/helper-plugin-utils": "npm:^7.24.0" - "@babel/helper-validator-option": "npm:^7.23.5" - "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "npm:^7.24.4" - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "npm:^7.24.1" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "npm:^7.24.1" - "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "npm:^7.24.1" + "@babel/compat-data": "npm:^7.24.7" + "@babel/helper-compilation-targets": "npm:^7.24.7" + "@babel/helper-plugin-utils": "npm:^7.24.7" + "@babel/helper-validator-option": "npm:^7.24.7" + "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "npm:^7.24.7" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "npm:^7.24.7" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "npm:^7.24.7" + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "npm:^7.24.7" "@babel/plugin-proposal-private-property-in-object": "npm:7.21.0-placeholder-for-preset-env.2" "@babel/plugin-syntax-async-generators": "npm:^7.8.4" "@babel/plugin-syntax-class-properties": "npm:^7.12.13" "@babel/plugin-syntax-class-static-block": "npm:^7.14.5" "@babel/plugin-syntax-dynamic-import": "npm:^7.8.3" "@babel/plugin-syntax-export-namespace-from": "npm:^7.8.3" - "@babel/plugin-syntax-import-assertions": "npm:^7.24.1" - "@babel/plugin-syntax-import-attributes": "npm:^7.24.1" + "@babel/plugin-syntax-import-assertions": "npm:^7.24.7" + "@babel/plugin-syntax-import-attributes": "npm:^7.24.7" "@babel/plugin-syntax-import-meta": "npm:^7.10.4" "@babel/plugin-syntax-json-strings": "npm:^7.8.3" "@babel/plugin-syntax-logical-assignment-operators": "npm:^7.10.4" @@ -2063,54 +2063,54 @@ __metadata: "@babel/plugin-syntax-private-property-in-object": "npm:^7.14.5" "@babel/plugin-syntax-top-level-await": "npm:^7.14.5" "@babel/plugin-syntax-unicode-sets-regex": "npm:^7.18.6" - "@babel/plugin-transform-arrow-functions": "npm:^7.24.1" - "@babel/plugin-transform-async-generator-functions": "npm:^7.24.3" - "@babel/plugin-transform-async-to-generator": "npm:^7.24.1" - "@babel/plugin-transform-block-scoped-functions": "npm:^7.24.1" - "@babel/plugin-transform-block-scoping": "npm:^7.24.4" - "@babel/plugin-transform-class-properties": "npm:^7.24.1" - "@babel/plugin-transform-class-static-block": "npm:^7.24.4" - "@babel/plugin-transform-classes": "npm:^7.24.1" - "@babel/plugin-transform-computed-properties": "npm:^7.24.1" - "@babel/plugin-transform-destructuring": "npm:^7.24.1" - "@babel/plugin-transform-dotall-regex": "npm:^7.24.1" - "@babel/plugin-transform-duplicate-keys": "npm:^7.24.1" - "@babel/plugin-transform-dynamic-import": "npm:^7.24.1" - "@babel/plugin-transform-exponentiation-operator": "npm:^7.24.1" - "@babel/plugin-transform-export-namespace-from": "npm:^7.24.1" - "@babel/plugin-transform-for-of": "npm:^7.24.1" - "@babel/plugin-transform-function-name": "npm:^7.24.1" - "@babel/plugin-transform-json-strings": "npm:^7.24.1" - "@babel/plugin-transform-literals": "npm:^7.24.1" - "@babel/plugin-transform-logical-assignment-operators": "npm:^7.24.1" - "@babel/plugin-transform-member-expression-literals": "npm:^7.24.1" - "@babel/plugin-transform-modules-amd": "npm:^7.24.1" - "@babel/plugin-transform-modules-commonjs": "npm:^7.24.1" - "@babel/plugin-transform-modules-systemjs": "npm:^7.24.1" - "@babel/plugin-transform-modules-umd": "npm:^7.24.1" - "@babel/plugin-transform-named-capturing-groups-regex": "npm:^7.22.5" - "@babel/plugin-transform-new-target": "npm:^7.24.1" - "@babel/plugin-transform-nullish-coalescing-operator": "npm:^7.24.1" - "@babel/plugin-transform-numeric-separator": "npm:^7.24.1" - "@babel/plugin-transform-object-rest-spread": "npm:^7.24.1" - "@babel/plugin-transform-object-super": "npm:^7.24.1" - "@babel/plugin-transform-optional-catch-binding": "npm:^7.24.1" - "@babel/plugin-transform-optional-chaining": "npm:^7.24.1" - "@babel/plugin-transform-parameters": "npm:^7.24.1" - "@babel/plugin-transform-private-methods": "npm:^7.24.1" - "@babel/plugin-transform-private-property-in-object": "npm:^7.24.1" - "@babel/plugin-transform-property-literals": "npm:^7.24.1" - "@babel/plugin-transform-regenerator": "npm:^7.24.1" - "@babel/plugin-transform-reserved-words": "npm:^7.24.1" - "@babel/plugin-transform-shorthand-properties": "npm:^7.24.1" - "@babel/plugin-transform-spread": "npm:^7.24.1" - "@babel/plugin-transform-sticky-regex": "npm:^7.24.1" - "@babel/plugin-transform-template-literals": "npm:^7.24.1" - "@babel/plugin-transform-typeof-symbol": "npm:^7.24.1" - "@babel/plugin-transform-unicode-escapes": "npm:^7.24.1" - "@babel/plugin-transform-unicode-property-regex": "npm:^7.24.1" - "@babel/plugin-transform-unicode-regex": "npm:^7.24.1" - "@babel/plugin-transform-unicode-sets-regex": "npm:^7.24.1" + "@babel/plugin-transform-arrow-functions": "npm:^7.24.7" + "@babel/plugin-transform-async-generator-functions": "npm:^7.24.7" + "@babel/plugin-transform-async-to-generator": "npm:^7.24.7" + "@babel/plugin-transform-block-scoped-functions": "npm:^7.24.7" + "@babel/plugin-transform-block-scoping": "npm:^7.24.7" + "@babel/plugin-transform-class-properties": "npm:^7.24.7" + "@babel/plugin-transform-class-static-block": "npm:^7.24.7" + "@babel/plugin-transform-classes": "npm:^7.24.7" + "@babel/plugin-transform-computed-properties": "npm:^7.24.7" + "@babel/plugin-transform-destructuring": "npm:^7.24.7" + "@babel/plugin-transform-dotall-regex": "npm:^7.24.7" + "@babel/plugin-transform-duplicate-keys": "npm:^7.24.7" + "@babel/plugin-transform-dynamic-import": "npm:^7.24.7" + "@babel/plugin-transform-exponentiation-operator": "npm:^7.24.7" + "@babel/plugin-transform-export-namespace-from": "npm:^7.24.7" + "@babel/plugin-transform-for-of": "npm:^7.24.7" + "@babel/plugin-transform-function-name": "npm:^7.24.7" + "@babel/plugin-transform-json-strings": "npm:^7.24.7" + "@babel/plugin-transform-literals": "npm:^7.24.7" + "@babel/plugin-transform-logical-assignment-operators": "npm:^7.24.7" + "@babel/plugin-transform-member-expression-literals": "npm:^7.24.7" + "@babel/plugin-transform-modules-amd": "npm:^7.24.7" + "@babel/plugin-transform-modules-commonjs": "npm:^7.24.7" + "@babel/plugin-transform-modules-systemjs": "npm:^7.24.7" + "@babel/plugin-transform-modules-umd": "npm:^7.24.7" + "@babel/plugin-transform-named-capturing-groups-regex": "npm:^7.24.7" + "@babel/plugin-transform-new-target": "npm:^7.24.7" + "@babel/plugin-transform-nullish-coalescing-operator": "npm:^7.24.7" + "@babel/plugin-transform-numeric-separator": "npm:^7.24.7" + "@babel/plugin-transform-object-rest-spread": "npm:^7.24.7" + "@babel/plugin-transform-object-super": "npm:^7.24.7" + "@babel/plugin-transform-optional-catch-binding": "npm:^7.24.7" + "@babel/plugin-transform-optional-chaining": "npm:^7.24.7" + "@babel/plugin-transform-parameters": "npm:^7.24.7" + "@babel/plugin-transform-private-methods": "npm:^7.24.7" + "@babel/plugin-transform-private-property-in-object": "npm:^7.24.7" + "@babel/plugin-transform-property-literals": "npm:^7.24.7" + "@babel/plugin-transform-regenerator": "npm:^7.24.7" + "@babel/plugin-transform-reserved-words": "npm:^7.24.7" + "@babel/plugin-transform-shorthand-properties": "npm:^7.24.7" + "@babel/plugin-transform-spread": "npm:^7.24.7" + "@babel/plugin-transform-sticky-regex": "npm:^7.24.7" + "@babel/plugin-transform-template-literals": "npm:^7.24.7" + "@babel/plugin-transform-typeof-symbol": "npm:^7.24.7" + "@babel/plugin-transform-unicode-escapes": "npm:^7.24.7" + "@babel/plugin-transform-unicode-property-regex": "npm:^7.24.7" + "@babel/plugin-transform-unicode-regex": "npm:^7.24.7" + "@babel/plugin-transform-unicode-sets-regex": "npm:^7.24.7" "@babel/preset-modules": "npm:0.1.6-no-external-plugins" babel-plugin-polyfill-corejs2: "npm:^0.4.10" babel-plugin-polyfill-corejs3: "npm:^0.10.4" @@ -2119,20 +2119,20 @@ __metadata: semver: "npm:^6.3.1" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/72a79d0cd38cb26f143509dd0c58db34b5b1ae90116863f55a404f0eb06a64a3cdcb1abd0b6435fafe463bbf55b82ffcf56aedee91e8d37797bf53e4ae74c413 + checksum: 10c0/c6714346f3ccc1271eaa90051c75b8bb57b20ef57408ab68740e2f3552693ae0ee5a4bcce3a00211d40e4947af1f7b8ab422066b953f0095461937fb72d11274 languageName: node linkType: hard "@babel/preset-flow@npm:^7.13.13, @babel/preset-flow@npm:^7.22.15": - version: 7.22.15 - resolution: "@babel/preset-flow@npm:7.22.15" + version: 7.24.7 + resolution: "@babel/preset-flow@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.22.5" - "@babel/helper-validator-option": "npm:^7.22.15" - "@babel/plugin-transform-flow-strip-types": "npm:^7.22.5" + "@babel/helper-plugin-utils": "npm:^7.24.7" + "@babel/helper-validator-option": "npm:^7.24.7" + "@babel/plugin-transform-flow-strip-types": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/7eef0c84ec1889d6c4f7a67d7d1a81703420eed123a8c23f25af148eead77907f0bd701f3e729fdb37d3ddb2a373bf43938b36a9ba17f546111ddb9521466b92 + checksum: 10c0/2a99333b9aac17033cefe17fb9d8c41b20c4f2cd3eab34f56c20d7c1c528cc1cca7e6d909de92fc700739a505b43166c9de62423f8a30b484161ebdf9474e217 languageName: node linkType: hard @@ -2150,33 +2150,33 @@ __metadata: linkType: hard "@babel/preset-react@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/preset-react@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/preset-react@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" - "@babel/helper-validator-option": "npm:^7.23.5" - "@babel/plugin-transform-react-display-name": "npm:^7.24.1" - "@babel/plugin-transform-react-jsx": "npm:^7.23.4" - "@babel/plugin-transform-react-jsx-development": "npm:^7.22.5" - "@babel/plugin-transform-react-pure-annotations": "npm:^7.24.1" + "@babel/helper-plugin-utils": "npm:^7.24.7" + "@babel/helper-validator-option": "npm:^7.24.7" + "@babel/plugin-transform-react-display-name": "npm:^7.24.7" + "@babel/plugin-transform-react-jsx": "npm:^7.24.7" + "@babel/plugin-transform-react-jsx-development": "npm:^7.24.7" + "@babel/plugin-transform-react-pure-annotations": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/a842abc5a024ed68a0ce4c1244607d40165cb6f8cf1817ebda282e470f20302d81c6a61cb41c1a31aa6c4e99ce93df4dd9e998a8ded1417c25d7480f0e14103a + checksum: 10c0/9658b685b25cedaadd0b65c4e663fbc7f57394b5036ddb4c99b1a75b0711fb83292c1c625d605c05b73413fc7a6dc20e532627f6a39b6dc8d4e00415479b054c languageName: node linkType: hard "@babel/preset-typescript@npm:^7.13.0, @babel/preset-typescript@npm:^7.22.5, @babel/preset-typescript@npm:^7.23.0, @babel/preset-typescript@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/preset-typescript@npm:7.24.1" + version: 7.24.7 + resolution: "@babel/preset-typescript@npm:7.24.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.24.0" - "@babel/helper-validator-option": "npm:^7.23.5" - "@babel/plugin-syntax-jsx": "npm:^7.24.1" - "@babel/plugin-transform-modules-commonjs": "npm:^7.24.1" - "@babel/plugin-transform-typescript": "npm:^7.24.1" + "@babel/helper-plugin-utils": "npm:^7.24.7" + "@babel/helper-validator-option": "npm:^7.24.7" + "@babel/plugin-syntax-jsx": "npm:^7.24.7" + "@babel/plugin-transform-modules-commonjs": "npm:^7.24.7" + "@babel/plugin-transform-typescript": "npm:^7.24.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/0033dc6fbc898ed0d8017c83a2dd5e095c82909e2f83e48cf9f305e3e9287148758c179ad90f27912cf98ca68bfec3643c57c70c0ca34d3a6c50dc8243aef406 + checksum: 10c0/986bc0978eedb4da33aba8e1e13a3426dd1829515313b7e8f4ba5d8c18aff1663b468939d471814e7acf4045d326ae6cff37239878d169ac3fe53a8fde71f8ee languageName: node linkType: hard @@ -2301,7 +2301,7 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.0.0, @babel/types@npm:^7.11.5, @babel/types@npm:^7.17.0, @babel/types@npm:^7.18.9, @babel/types@npm:^7.2.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.22.5, @babel/types@npm:^7.23.0, @babel/types@npm:^7.23.4, @babel/types@npm:^7.23.6, @babel/types@npm:^7.23.9, @babel/types@npm:^7.24.0, @babel/types@npm:^7.24.7, @babel/types@npm:^7.25.0, @babel/types@npm:^7.25.2, @babel/types@npm:^7.4.4, @babel/types@npm:^7.6.1, @babel/types@npm:^7.7.2, @babel/types@npm:^7.9.6": +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.11.5, @babel/types@npm:^7.17.0, @babel/types@npm:^7.18.9, @babel/types@npm:^7.2.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.22.5, @babel/types@npm:^7.23.0, @babel/types@npm:^7.23.6, @babel/types@npm:^7.23.9, @babel/types@npm:^7.24.0, @babel/types@npm:^7.24.7, @babel/types@npm:^7.25.0, @babel/types@npm:^7.25.2, @babel/types@npm:^7.4.4, @babel/types@npm:^7.6.1, @babel/types@npm:^7.7.2, @babel/types@npm:^7.9.6": version: 7.25.2 resolution: "@babel/types@npm:7.25.2" dependencies: @@ -3892,6 +3892,19 @@ __metadata: languageName: node linkType: hard +"@ndelangen/fs-extra-unified@npm:^1.0.4": + version: 1.0.4 + resolution: "@ndelangen/fs-extra-unified@npm:1.0.4" + peerDependencies: + "@types/fs-extra": ^11.0.0 + fs-extra: ^11.0.0 + peerDependenciesMeta: + "@types/fs-extra": + optional: true + checksum: 10c0/4bdce65882db58ce42bf08efce9993324e2f6a639aecbb82f2cf2a72fdfe6b18b587e4551bac776d3c1787a784d7e295f3fedb9bd24c6f1a970f85d17b8499df + languageName: node + linkType: hard + "@ndelangen/get-tarball@npm:^3.0.7": version: 3.0.9 resolution: "@ndelangen/get-tarball@npm:3.0.9" @@ -4618,17 +4631,15 @@ __metadata: linkType: hard "@pmmmwh/react-refresh-webpack-plugin@npm:^0.5.1, @pmmmwh/react-refresh-webpack-plugin@npm:^0.5.11": - version: 0.5.11 - resolution: "@pmmmwh/react-refresh-webpack-plugin@npm:0.5.11" + version: 0.5.15 + resolution: "@pmmmwh/react-refresh-webpack-plugin@npm:0.5.15" dependencies: - ansi-html-community: "npm:^0.0.8" - common-path-prefix: "npm:^3.0.0" + ansi-html: "npm:^0.0.9" core-js-pure: "npm:^3.23.3" error-stack-parser: "npm:^2.0.6" - find-up: "npm:^5.0.0" html-entities: "npm:^2.1.0" loader-utils: "npm:^2.0.4" - schema-utils: "npm:^3.0.0" + schema-utils: "npm:^4.2.0" source-map: "npm:^0.7.3" peerDependencies: "@types/webpack": 4.x || 5.x @@ -4636,7 +4647,7 @@ __metadata: sockjs-client: ^1.4.0 type-fest: ">=0.17.0 <5.0.0" webpack: ">=4.43.0 <6.0.0" - webpack-dev-server: 3.x || 4.x + webpack-dev-server: 3.x || 4.x || 5.x webpack-hot-middleware: 2.x webpack-plugin-serve: 0.x || 1.x peerDependenciesMeta: @@ -4652,7 +4663,7 @@ __metadata: optional: true webpack-plugin-serve: optional: true - checksum: 10c0/a9c8468417a14a23339e313cff6ddb8029e0637748973070e61d83a2534620b3492b9a42ecf9eb9d63cb709f53c17fe814bc7dd68d64c300db338e9fd7287bc4 + checksum: 10c0/ba310aa4d53070f59c8a374d1d256c5965c044c0c3fb1ff6b55353fb5e86de08a490a7bd59a31f0d4951f8f29f81864c7df224fe1342543a95d048b7413ff171 languageName: node linkType: hard @@ -5329,7 +5340,6 @@ __metadata: "@storybook/global": "npm:^5.0.0" "@storybook/react-dom-shim": "workspace:*" "@types/react": "npm:^16.8.0 || ^17.0.0 || ^18.0.0" - fs-extra: "npm:^11.1.0" react: "npm:^18.2.0" react-dom: "npm:^18.2.0" rehype-external-links: "npm:^3.0.0" @@ -5419,7 +5429,6 @@ __metadata: dependencies: "@storybook/csf": "npm:^0.1.11" "@storybook/global": "npm:^5.0.0" - fs-extra: "npm:^11.1.0" ts-dedent: "npm:^2.0.0" typescript: "npm:^5.3.2" peerDependencies: @@ -5686,9 +5695,11 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/builder-vite@workspace:builders/builder-vite" dependencies: + "@ndelangen/fs-extra-unified": "npm:^1.0.4" "@storybook/csf-plugin": "workspace:*" "@types/express": "npm:^4.17.21" "@types/find-cache-dir": "npm:^3.2.1" + "@types/fs-extra": "npm:^11.0.4" "@types/node": "npm:^22.0.0" browser-assert: "npm:^1.2.1" es-module-lexer: "npm:^1.5.0" @@ -5721,7 +5732,9 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/builder-webpack5@workspace:builders/builder-webpack5" dependencies: + "@ndelangen/fs-extra-unified": "npm:^1.0.4" "@storybook/core-webpack": "workspace:*" + "@types/fs-extra": "npm:^11.0.4" "@types/node": "npm:^22.0.0" "@types/pretty-hrtime": "npm:^1.0.0" "@types/semver": "npm:^7.3.4" @@ -5776,8 +5789,10 @@ __metadata: dependencies: "@babel/core": "npm:^7.24.4" "@babel/types": "npm:^7.24.0" + "@ndelangen/fs-extra-unified": "npm:^1.0.4" "@storybook/codemod": "workspace:*" "@types/cross-spawn": "npm:^6.0.2" + "@types/fs-extra": "npm:^11.0.4" "@types/prompts": "npm:^2.0.9" "@types/semver": "npm:^7.3.4" boxen: "npm:^7.1.1" @@ -5912,6 +5927,7 @@ __metadata: "@emotion/styled": "npm:^11.11.0" "@emotion/use-insertion-effect-with-fallbacks": "npm:^1.0.1" "@fal-works/esbuild-plugin-global-externals": "npm:^2.1.2" + "@ndelangen/fs-extra-unified": "npm:^1.0.4" "@ndelangen/get-tarball": "npm:^3.0.7" "@popperjs/core": "npm:^2.6.0" "@radix-ui/react-dialog": "npm:^1.0.5" @@ -6020,6 +6036,7 @@ __metadata: recast: "npm:^0.23.5" require-from-string: "npm:^2.0.2" resolve-from: "npm:^5.0.0" + resolve.exports: "npm:^2.0.2" semver: "npm:^7.6.2" slash: "npm:^5.0.0" source-map: "npm:^0.7.4" @@ -6308,6 +6325,7 @@ __metadata: "@babel/preset-typescript": "npm:^7.24.1" "@babel/runtime": "npm:^7.24.4" "@babel/types": "npm:^7.24.0" + "@ndelangen/fs-extra-unified": "npm:^1.0.4" "@pmmmwh/react-refresh-webpack-plugin": "npm:^0.5.11" "@storybook/builder-webpack5": "workspace:*" "@storybook/preset-react-webpack": "workspace:*" @@ -6316,6 +6334,7 @@ __metadata: "@types/babel__core": "npm:^7" "@types/babel__plugin-transform-runtime": "npm:^7" "@types/babel__preset-env": "npm:^7" + "@types/fs-extra": "npm:^11.0.4" "@types/loader-utils": "npm:^2.0.5" "@types/node": "npm:^22.0.0" "@types/react-refresh": "npm:^0" @@ -6466,9 +6485,11 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/preset-react-webpack@workspace:presets/react-webpack" dependencies: + "@ndelangen/fs-extra-unified": "npm:^1.0.4" "@storybook/core-webpack": "workspace:*" "@storybook/react": "workspace:*" "@storybook/react-docgen-typescript-plugin": "npm:1.0.6--canary.9.0c3f3b7.0" + "@types/fs-extra": "npm:^11.0.4" "@types/node": "npm:^22.0.0" "@types/semver": "npm:^7.3.4" find-up: "npm:^5.0.0" @@ -6494,9 +6515,11 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/preset-server-webpack@workspace:presets/server-webpack" dependencies: + "@ndelangen/fs-extra-unified": "npm:^1.0.4" "@storybook/core-webpack": "workspace:*" "@storybook/global": "npm:^5.0.0" "@storybook/server": "workspace:*" + "@types/fs-extra": "npm:^11.0.4" "@types/node": "npm:^22.0.0" fs-extra: "npm:^11.1.0" safe-identifier: "npm:^0.4.1" @@ -6685,6 +6708,7 @@ __metadata: dependencies: "@chromatic-com/storybook": "npm:^1.6.1" "@happy-dom/global-registrator": "npm:^14.12.0" + "@ndelangen/fs-extra-unified": "npm:^1.0.4" "@nx/eslint": "npm:18.0.6" "@nx/vite": "npm:18.0.6" "@nx/workspace": "npm:18.0.6" @@ -6863,6 +6887,7 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/server@workspace:renderers/server" dependencies: + "@ndelangen/fs-extra-unified": "npm:^1.0.4" "@storybook/components": "workspace:^" "@storybook/csf": "npm:^0.1.11" "@storybook/global": "npm:^5.0.0" @@ -6937,6 +6962,7 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/svelte@workspace:renderers/svelte" dependencies: + "@ndelangen/fs-extra-unified": "npm:^1.0.4" "@storybook/components": "workspace:^" "@storybook/global": "npm:^5.0.0" "@storybook/manager-api": "workspace:^" @@ -6944,6 +6970,7 @@ __metadata: "@storybook/theming": "workspace:^" "@sveltejs/vite-plugin-svelte": "npm:^3.0.2" "@testing-library/svelte": "patch:@testing-library/svelte@npm%3A4.1.0#~/.yarn/patches/@testing-library-svelte-npm-4.1.0-34b7037bc0.patch" + "@types/fs-extra": "npm:^11.0.4" expect-type: "npm:^0.15.0" fs-extra: "npm:^11.1.0" svelte: "npm:^5.0.0-next.65" @@ -7478,9 +7505,9 @@ __metadata: linkType: hard "@types/babel__preset-env@npm:^7": - version: 7.9.6 - resolution: "@types/babel__preset-env@npm:7.9.6" - checksum: 10c0/639bcf58094530eb8509b302de9c42fc1a9e44e236bcbfd218e987aba7a2c15052c3a1cac7ca7f260255e74beb3b489ff877b9870f8587394457cd3aa9f64934 + version: 7.9.7 + resolution: "@types/babel__preset-env@npm:7.9.7" + checksum: 10c0/e1da078fee75841af512c7084e66f8a2b9136d72185d72c85c6fb41697358d330d195896d7d22834fca92fad1f16a8c0fb6269e890f9e6842c9a9972313b7baa languageName: node linkType: hard @@ -7753,7 +7780,7 @@ __metadata: languageName: node linkType: hard -"@types/fs-extra@npm:^11.0.1": +"@types/fs-extra@npm:^11.0.1, @types/fs-extra@npm:^11.0.4": version: 11.0.4 resolution: "@types/fs-extra@npm:11.0.4" dependencies: @@ -8074,9 +8101,9 @@ __metadata: linkType: hard "@types/qs@npm:*, @types/qs@npm:^6": - version: 6.9.10 - resolution: "@types/qs@npm:6.9.10" - checksum: 10c0/6be12e5f062d1b41eb037d59bf9cb65bc9410cedd5e6da832dfd7c8e2b3f4c91e81c9b90b51811140770e5052c6c4e8361181bd9437ddcd4515dc128b7c00353 + version: 6.9.15 + resolution: "@types/qs@npm:6.9.15" + checksum: 10c0/49c5ff75ca3adb18a1939310042d273c9fc55920861bd8e5100c8a923b3cda90d759e1a95e18334092da1c8f7b820084687770c83a1ccef04fb2c6908117c823 languageName: node linkType: hard @@ -8250,9 +8277,9 @@ __metadata: linkType: hard "@types/tapable@npm:^1": - version: 1.0.9 - resolution: "@types/tapable@npm:1.0.9" - checksum: 10c0/51e7a55432c3abf71ae5e13907eb01a576efdf66ddfcd4f2a765436e684e182df527885980d4f710250cd61304a61f7fe9d447b33fef8db1fa434a395c85933d + version: 1.0.12 + resolution: "@types/tapable@npm:1.0.12" + checksum: 10c0/d6a080f5839b323eb96dd5b65a6c3161c1297d8c2433eb52437912d1c3df54e38fce12ce7a57650f6453d96942298bd0935436e2501d09e407b7f41634483131 languageName: node linkType: hard @@ -8310,9 +8337,9 @@ __metadata: linkType: hard "@types/unist@npm:^2, @types/unist@npm:^2.0.0": - version: 2.0.8 - resolution: "@types/unist@npm:2.0.8" - checksum: 10c0/2c4685d5258b4f543677d20dce0d72b8235e70b6c859af24fcf445f92dac98ec8a1faa0cfb43307466561fcd9dbd2534a4860000944401ac3314a685b5efe3d7 + version: 2.0.10 + resolution: "@types/unist@npm:2.0.10" + checksum: 10c0/5f247dc2229944355209ad5c8e83cfe29419fa7f0a6d557421b1985a1500444719cc9efcc42c652b55aab63c931813c88033e0202c1ac684bcd4829d66e44731 languageName: node linkType: hard @@ -8331,9 +8358,9 @@ __metadata: linkType: hard "@types/webpack-env@npm:^1.16.0, @types/webpack-env@npm:^1.18.0": - version: 1.18.4 - resolution: "@types/webpack-env@npm:1.18.4" - checksum: 10c0/3fa77dbff0ed71685404576b0a1cf74587567fe2ee1cfd11d56d6eefcab7a61e4c9ead0eced264e289d2cf0fc74296dbd55ed6c95774fe0fd6264d156c5a59f0 + version: 1.18.5 + resolution: "@types/webpack-env@npm:1.18.5" + checksum: 10c0/b9e4876e8c7cae419896249f9ed795db283c008fe1d38efa679cbbf05194fc2eea2a5bfb4ff4393d109e3a9895416dadf5f3ddd5c22931b678062230f860454e languageName: node linkType: hard @@ -8360,8 +8387,8 @@ __metadata: linkType: hard "@types/webpack@npm:^4": - version: 4.41.34 - resolution: "@types/webpack@npm:4.41.34" + version: 4.41.38 + resolution: "@types/webpack@npm:4.41.38" dependencies: "@types/node": "npm:*" "@types/tapable": "npm:^1" @@ -8369,7 +8396,7 @@ __metadata: "@types/webpack-sources": "npm:*" anymatch: "npm:^3.0.0" source-map: "npm:^0.6.0" - checksum: 10c0/630ebd822e7ee85b7118d1c095370709ce493831365f7fd750bea88ac4726ef52df33cc25261922526e45b354c9fdb3edfabc7738d5b9ec18416fd502cda3838 + checksum: 10c0/5a0a7465d45a0e7701a8c863e88c6cba7660b37e4aeab851c71baf505dbab2e178be1cac82488c2e7d0ea11fb703ceddb53476daec3ec9a004e2fc1554233483 languageName: node linkType: hard @@ -8664,12 +8691,12 @@ __metadata: linkType: hard "@vitejs/plugin-vue@npm:^4.4.0": - version: 4.5.2 - resolution: "@vitejs/plugin-vue@npm:4.5.2" + version: 4.6.2 + resolution: "@vitejs/plugin-vue@npm:4.6.2" peerDependencies: vite: ^4.0.0 || ^5.0.0 vue: ^3.2.25 - checksum: 10c0/dd024b9ee2eda3174e197bda2b42df30b594d1a7f50d20b4b0de01c5a130bd99b84452e8a8d597ade50f89106025346a56f7abbf63c560e82fe97223589d2514 + checksum: 10c0/8a8eb974936e4f0c7a66924240d122cd3a61af34498d7260f5920cf7a44ef4ef60e025a3f5d29df88e671ba32d5999c0fe1bc11d46bd838f51aa3a37a8f272c5 languageName: node linkType: hard @@ -9721,6 +9748,15 @@ __metadata: languageName: node linkType: hard +"ansi-html@npm:^0.0.9": + version: 0.0.9 + resolution: "ansi-html@npm:0.0.9" + bin: + ansi-html: bin/ansi-html + checksum: 10c0/4a5de9802fb50193e32b51a9ea48dc0d7e4436b860cb819d7110c62f2bfb1410288e1a2f9a848269f5eab8f903797a7f0309fe4c552f92a92b61a5b759ed52bd + languageName: node + linkType: hard + "ansi-regex@npm:^5.0.1": version: 5.0.1 resolution: "ansi-regex@npm:5.0.1" @@ -9922,15 +9958,16 @@ __metadata: linkType: hard "array-includes@npm:^3.1.6, array-includes@npm:^3.1.7": - version: 3.1.7 - resolution: "array-includes@npm:3.1.7" + version: 3.1.8 + resolution: "array-includes@npm:3.1.8" dependencies: - call-bind: "npm:^1.0.2" - define-properties: "npm:^1.2.0" - es-abstract: "npm:^1.22.1" - get-intrinsic: "npm:^1.2.1" + call-bind: "npm:^1.0.7" + define-properties: "npm:^1.2.1" + es-abstract: "npm:^1.23.2" + es-object-atoms: "npm:^1.0.0" + get-intrinsic: "npm:^1.2.4" is-string: "npm:^1.0.7" - checksum: 10c0/692907bd7f19d06dc58ccb761f34b58f5dc0b437d2b47a8fe42a1501849a5cf5c27aed3d521a9702667827c2c85a7e75df00a402c438094d87fc43f39ebf9b2b + checksum: 10c0/5b1004d203e85873b96ddc493f090c9672fd6c80d7a60b798da8a14bff8a670ff95db5aafc9abc14a211943f05220dacf8ea17638ae0af1a6a47b8c0b48ce370 languageName: node linkType: hard @@ -12236,9 +12273,9 @@ __metadata: linkType: hard "core-js-pure@npm:^3.23.3": - version: 3.33.0 - resolution: "core-js-pure@npm:3.33.0" - checksum: 10c0/dbb683bf6c5d3671129e5029e0f8047a388818bb9720352c839f46ac5627b5fed763135b9a1df89452f2afee78e49639def6063e82fc6995c4e98c31f2892db5 + version: 3.37.1 + resolution: "core-js-pure@npm:3.37.1" + checksum: 10c0/38200d08862b4ef2207af72a7525f7b9ac750f5e1d84ef27a3e314aefa69518179a9b732f51ebe35c3b38606d9fa4f686fcf6eff067615cc293a3b1c84041e74 languageName: node linkType: hard @@ -12250,9 +12287,9 @@ __metadata: linkType: hard "core-js@npm:^3.8.2": - version: 3.33.0 - resolution: "core-js@npm:3.33.0" - checksum: 10c0/f51192f311c2d75b94ebe4eb7210f91df2cb6de101b96da1a65f43cf52b9c5cfe1ce5ebebb86281e452d2ee949730afb72fb7ac826c655c9de3a92f793cf3b80 + version: 3.37.1 + resolution: "core-js@npm:3.37.1" + checksum: 10c0/440eb51a7a39128a320225fe349f870a3641b96c9ecd26470227db730ef8c161ea298eaea621db66ec0ff622a85299efb4e23afebf889c0a1748616102307675 languageName: node linkType: hard @@ -12361,6 +12398,8 @@ __metadata: version: 0.0.0-use.local resolution: "create-storybook@workspace:lib/create-storybook" dependencies: + "@ndelangen/fs-extra-unified": "npm:^1.0.4" + "@types/fs-extra": "npm:^11.0.4" "@types/prompts": "npm:^2.0.9" "@types/semver": "npm:^7.3.4" "@types/util-deprecate": "npm:^1.0.0" @@ -13072,15 +13111,15 @@ __metadata: linkType: hard "detect-port@npm:^1.3.0, detect-port@npm:^1.5.1": - version: 1.5.1 - resolution: "detect-port@npm:1.5.1" + version: 1.6.1 + resolution: "detect-port@npm:1.6.1" dependencies: address: "npm:^1.0.1" debug: "npm:4" bin: detect: bin/detect-port.js detect-port: bin/detect-port.js - checksum: 10c0/f2b204ad3a9f8e8b53fea35fcc97469f31a8e3e786a2f59fbc886397e33b5f130c5f964bf001b9a64d990047c3824f6a439308461ff19801df04ab48a754639e + checksum: 10c0/4ea9eb46a637cb21220dd0a62b6074792894fc77b2cacbc9de533d1908b2eedafa7bfd7547baaa2ac1e9c7ba7c289b34b17db896dca6da142f4fc6e2060eee17 languageName: node linkType: hard @@ -13801,7 +13840,7 @@ __metadata: languageName: node linkType: hard -"es-abstract@npm:^1.22.1, es-abstract@npm:^1.22.3, es-abstract@npm:^1.22.4, es-abstract@npm:^1.23.0": +"es-abstract@npm:^1.22.1, es-abstract@npm:^1.22.3, es-abstract@npm:^1.22.4, es-abstract@npm:^1.23.0, es-abstract@npm:^1.23.2": version: 1.23.3 resolution: "es-abstract@npm:1.23.3" dependencies: @@ -15403,9 +15442,9 @@ __metadata: linkType: hard "flow-parser@npm:0.*": - version: 0.217.2 - resolution: "flow-parser@npm:0.217.2" - checksum: 10c0/d61127283db052fddf8275b070eea76dda5d2926aea3d8659250e168d69478f4ebdbc2bede83aa05c29f464c420ce1d701691278d3041af0492bfc16193277b5 + version: 0.239.1 + resolution: "flow-parser@npm:0.239.1" + checksum: 10c0/a95186e47cce6e0f401845eae8ec863480817b879f18b34564af51efd545b04193e2c4a0d429a5961d34e4c5f02c213adda008a15ac034bbe4ca0a4e2a5773c0 languageName: node linkType: hard @@ -16168,11 +16207,12 @@ __metadata: linkType: hard "globalthis@npm:^1.0.3": - version: 1.0.3 - resolution: "globalthis@npm:1.0.3" + version: 1.0.4 + resolution: "globalthis@npm:1.0.4" dependencies: - define-properties: "npm:^1.1.3" - checksum: 10c0/0db6e9af102a5254630351557ac15e6909bc7459d3e3f6b001e59fe784c96d31108818f032d9095739355a88467459e6488ff16584ee6250cd8c27dec05af4b0 + define-properties: "npm:^1.2.1" + gopd: "npm:^1.0.1" + checksum: 10c0/9d156f313af79d80b1566b93e19285f481c591ad6d0d319b4be5e03750d004dde40a39a0f26f7e635f9007a3600802f53ecd85a759b86f109e80a5f705e01846 languageName: node linkType: hard @@ -17284,7 +17324,7 @@ __metadata: languageName: node linkType: hard -"internal-slot@npm:^1.0.4, internal-slot@npm:^1.0.5, internal-slot@npm:^1.0.7": +"internal-slot@npm:^1.0.4, internal-slot@npm:^1.0.7": version: 1.0.7 resolution: "internal-slot@npm:1.0.7" dependencies: @@ -18428,11 +18468,14 @@ __metadata: linkType: hard "json-stable-stringify@npm:^1.0.1": - version: 1.0.2 - resolution: "json-stable-stringify@npm:1.0.2" + version: 1.1.1 + resolution: "json-stable-stringify@npm:1.1.1" dependencies: + call-bind: "npm:^1.0.5" + isarray: "npm:^2.0.5" jsonify: "npm:^0.0.1" - checksum: 10c0/502d021c3c59c09587faa40d7693d77c00460fd6c68bae95d6e35804909ec8c4aec71b136d3a09df61a7ebf803eb6e820f23ede76b77e74b8b02c76afb2ada8c + object-keys: "npm:^1.1.1" + checksum: 10c0/3801e3eeccbd030afb970f54bea690a079cfea7d9ed206a1b17ca9367f4b7772c764bf77a48f03e56b50e5f7ee7d11c52339fe20d8d7ccead003e4ca69e4cfde languageName: node linkType: hard @@ -21686,24 +21729,25 @@ __metadata: linkType: hard "object.entries@npm:^1.1.5, object.entries@npm:^1.1.6, object.entries@npm:^1.1.7": - version: 1.1.7 - resolution: "object.entries@npm:1.1.7" + version: 1.1.8 + resolution: "object.entries@npm:1.1.8" dependencies: - call-bind: "npm:^1.0.2" - define-properties: "npm:^1.2.0" - es-abstract: "npm:^1.22.1" - checksum: 10c0/3ad1899cc7bf14546bf28f4a9b363ae8690b90948fcfbcac4c808395435d760f26193d9cae95337ce0e3c1e5c1f4fa45f7b46b31b68d389e9e117fce38775d86 + call-bind: "npm:^1.0.7" + define-properties: "npm:^1.2.1" + es-object-atoms: "npm:^1.0.0" + checksum: 10c0/db9ea979d2956a3bc26c262da4a4d212d36f374652cc4c13efdd069c1a519c16571c137e2893d1c46e1cb0e15c88fd6419eaf410c945f329f09835487d7e65d3 languageName: node linkType: hard "object.fromentries@npm:^2.0.6, object.fromentries@npm:^2.0.7": - version: 2.0.7 - resolution: "object.fromentries@npm:2.0.7" + version: 2.0.8 + resolution: "object.fromentries@npm:2.0.8" dependencies: - call-bind: "npm:^1.0.2" - define-properties: "npm:^1.2.0" - es-abstract: "npm:^1.22.1" - checksum: 10c0/071745c21f6fc9e6c914691f2532c1fb60ad967e5ddc52801d09958b5de926566299d07ae14466452a7efd29015f9145d6c09c573d93a0dc6f1683ee0ec2b93b + call-bind: "npm:^1.0.7" + define-properties: "npm:^1.2.1" + es-abstract: "npm:^1.23.2" + es-object-atoms: "npm:^1.0.0" + checksum: 10c0/cd4327e6c3369cfa805deb4cbbe919bfb7d3aeebf0bcaba291bb568ea7169f8f8cdbcabe2f00b40db0c20cd20f08e11b5f3a5a36fb7dd3fe04850c50db3bf83b languageName: node linkType: hard @@ -21740,13 +21784,13 @@ __metadata: linkType: hard "object.values@npm:^1.1.6, object.values@npm:^1.1.7": - version: 1.1.7 - resolution: "object.values@npm:1.1.7" + version: 1.2.0 + resolution: "object.values@npm:1.2.0" dependencies: - call-bind: "npm:^1.0.2" - define-properties: "npm:^1.2.0" - es-abstract: "npm:^1.22.1" - checksum: 10c0/e869d6a37fb7afdd0054dea49036d6ccebb84854a8848a093bbd1bc516f53e690bba88f0bc3e83fdfa74c601469ee6989c9b13359cda9604144c6e732fad3b6b + call-bind: "npm:^1.0.7" + define-properties: "npm:^1.2.1" + es-object-atoms: "npm:^1.0.0" + checksum: 10c0/15809dc40fd6c5529501324fec5ff08570b7d70fb5ebbe8e2b3901afec35cf2b3dc484d1210c6c642cd3e7e0a5e18dd1d6850115337fef46bdae14ab0cb18ac3 languageName: node linkType: hard @@ -22907,13 +22951,13 @@ __metadata: linkType: hard "postcss@npm:^8.2.14, postcss@npm:^8.4.23, postcss@npm:^8.4.27, postcss@npm:^8.4.32, postcss@npm:^8.4.33, postcss@npm:^8.4.35, postcss@npm:^8.4.38": - version: 8.4.38 - resolution: "postcss@npm:8.4.38" + version: 8.4.39 + resolution: "postcss@npm:8.4.39" dependencies: nanoid: "npm:^3.3.7" - picocolors: "npm:^1.0.0" + picocolors: "npm:^1.0.1" source-map-js: "npm:^1.2.0" - checksum: 10c0/955407b8f70cf0c14acf35dab3615899a2a60a26718a63c848cf3c29f2467b0533991b985a2b994430d890bd7ec2b1963e36352b0774a19143b5f591540f7c06 + checksum: 10c0/16f5ac3c4e32ee76d1582b3c0dcf1a1fdb91334a45ad755eeb881ccc50318fb8d64047de4f1601ac96e30061df203f0f2e2edbdc0bfc49b9c57bc9fb9bedaea3 languageName: node linkType: hard @@ -23003,16 +23047,7 @@ __metadata: languageName: node linkType: hard -"prettier@npm:*, prettier@npm:^3.1.1": - version: 3.2.5 - resolution: "prettier@npm:3.2.5" - bin: - prettier: bin/prettier.cjs - checksum: 10c0/ea327f37a7d46f2324a34ad35292af2ad4c4c3c3355da07313339d7e554320f66f65f91e856add8530157a733c6c4a897dc41b577056be5c24c40f739f5ee8c6 - languageName: node - linkType: hard - -"prettier@npm:^3.2.5": +"prettier@npm:*, prettier@npm:^3.1.1, prettier@npm:^3.2.5": version: 3.3.3 resolution: "prettier@npm:3.3.3" bin: @@ -24757,6 +24792,13 @@ __metadata: languageName: node linkType: hard +"resolve.exports@npm:^2.0.2": + version: 2.0.2 + resolution: "resolve.exports@npm:2.0.2" + checksum: 10c0/cc4cffdc25447cf34730f388dca5021156ba9302a3bad3d7f168e790dc74b2827dff603f1bc6ad3d299bac269828dca96dd77e036dc9fba6a2a1807c47ab5c98 + languageName: node + linkType: hard + "resolve@npm:1.22.8, resolve@npm:^1.10.0, resolve@npm:^1.12.0, resolve@npm:^1.13.1, resolve@npm:^1.14.2, resolve@npm:^1.15.1, resolve@npm:^1.17.0, resolve@npm:^1.19.0, resolve@npm:^1.22.1, resolve@npm:^1.22.4, resolve@npm:^1.22.8, resolve@npm:^1.4.0": version: 1.22.8 resolution: "resolve@npm:1.22.8" @@ -24868,9 +24910,9 @@ __metadata: linkType: hard "rfdc@npm:^1.3.0": - version: 1.3.0 - resolution: "rfdc@npm:1.3.0" - checksum: 10c0/a17fd7b81f42c7ae4cb932abd7b2f677b04cc462a03619fb46945ae1ccae17c3bc87c020ffdde1751cbfa8549860a2883486fdcabc9b9de3f3108af32b69a667 + version: 1.4.1 + resolution: "rfdc@npm:1.4.1" + checksum: 10c0/4614e4292356cafade0b6031527eea9bc90f2372a22c012313be1dcc69a3b90c7338158b414539be863fa95bfcb2ddcd0587be696841af4e6679d85e62c060c7 languageName: node linkType: hard @@ -25208,7 +25250,7 @@ __metadata: languageName: node linkType: hard -"schema-utils@npm:^3.0.0, schema-utils@npm:^3.1.1, schema-utils@npm:^3.2.0": +"schema-utils@npm:^3.1.1, schema-utils@npm:^3.2.0": version: 3.3.0 resolution: "schema-utils@npm:3.3.0" dependencies: @@ -25219,7 +25261,7 @@ __metadata: languageName: node linkType: hard -"schema-utils@npm:^4.0.0": +"schema-utils@npm:^4.0.0, schema-utils@npm:^4.2.0": version: 4.2.0 resolution: "schema-utils@npm:4.2.0" dependencies: @@ -25398,7 +25440,7 @@ __metadata: languageName: node linkType: hard -"set-function-name@npm:^2.0.0, set-function-name@npm:^2.0.1": +"set-function-name@npm:^2.0.1, set-function-name@npm:^2.0.2": version: 2.0.2 resolution: "set-function-name@npm:2.0.2" dependencies: @@ -26098,9 +26140,9 @@ __metadata: linkType: hard "store2@npm:^2.14.2": - version: 2.14.2 - resolution: "store2@npm:2.14.2" - checksum: 10c0/2f27c3eaa7207b81410e170e7c41379816d22c1566308a9d97fbf853c4facff531fcb2a85f085c7503c578736570972f747c26018ebeaba7d1341fb82a7b6d52 + version: 2.14.3 + resolution: "store2@npm:2.14.3" + checksum: 10c0/22e1096e6d69590672ca0b7f891d82b060837ef4c3e5df0d4563e6cbed14c52ddf2589fa94b79f4311b6ec41d95d6142e5d01d194539e0175c3fb4090cca8244 languageName: node linkType: hard @@ -26217,19 +26259,22 @@ __metadata: linkType: hard "string.prototype.matchall@npm:^4.0.8": - version: 4.0.10 - resolution: "string.prototype.matchall@npm:4.0.10" + version: 4.0.11 + resolution: "string.prototype.matchall@npm:4.0.11" dependencies: - call-bind: "npm:^1.0.2" - define-properties: "npm:^1.2.0" - es-abstract: "npm:^1.22.1" - get-intrinsic: "npm:^1.2.1" + call-bind: "npm:^1.0.7" + define-properties: "npm:^1.2.1" + es-abstract: "npm:^1.23.2" + es-errors: "npm:^1.3.0" + es-object-atoms: "npm:^1.0.0" + get-intrinsic: "npm:^1.2.4" + gopd: "npm:^1.0.1" has-symbols: "npm:^1.0.3" - internal-slot: "npm:^1.0.5" - regexp.prototype.flags: "npm:^1.5.0" - set-function-name: "npm:^2.0.0" - side-channel: "npm:^1.0.4" - checksum: 10c0/cd7495fb0de16d43efeee3887b98701941f3817bd5f09351ad1825b023d307720c86394d56d56380563d97767ab25bf5448db239fcecbb85c28e2180f23e324a + internal-slot: "npm:^1.0.7" + regexp.prototype.flags: "npm:^1.5.2" + set-function-name: "npm:^2.0.2" + side-channel: "npm:^1.0.6" + checksum: 10c0/915a2562ac9ab5e01b7be6fd8baa0b2b233a0a9aa975fcb2ec13cc26f08fb9a3e85d5abdaa533c99c6fc4c5b65b914eba3d80c4aff9792a4c9fed403f28f7d9d languageName: node linkType: hard @@ -28040,8 +28085,8 @@ __metadata: linkType: hard "use-callback-ref@npm:^1.3.0": - version: 1.3.1 - resolution: "use-callback-ref@npm:1.3.1" + version: 1.3.2 + resolution: "use-callback-ref@npm:1.3.2" dependencies: tslib: "npm:^2.0.0" peerDependencies: @@ -28050,7 +28095,7 @@ __metadata: peerDependenciesMeta: "@types/react": optional: true - checksum: 10c0/6666cd62e13053d03e453b5199037cb8f6475a8f55afd664ff488bd8f2ee2ede4da3b220dd7e60f5ecd4926133364fbf4b1aed463eeb8203e7c5be3b1533b59b + checksum: 10c0/d232c37160fe3970c99255da19b5fb5299fb5926a5d6141d928a87feb47732c323d29be2f8137d3b1e5499c70d284cd1d9cfad703cc58179db8be24d7dd8f1f2 languageName: node linkType: hard @@ -28437,8 +28482,8 @@ __metadata: linkType: hard "vite@npm:^4.0.0, vite@npm:^4.0.4": - version: 4.5.1 - resolution: "vite@npm:4.5.1" + version: 4.5.3 + resolution: "vite@npm:4.5.3" dependencies: esbuild: "npm:^0.18.10" fsevents: "npm:~2.3.2" @@ -28472,7 +28517,7 @@ __metadata: optional: true bin: vite: bin/vite.js - checksum: 10c0/352a94b13f793e4bcbc424d680a32507343223eeda8917fde0f23c1fa1ba3db7c806dade8461ca5cfb270154ddb8895a219fdd4384519fe9b8e46d1cf491a890 + checksum: 10c0/caeb1eecc0a8e0865782899e2f83d2993a9816562badc1c8291316d80d49b82f12038abd8cb8b8c627b6f369f58dfb25972ef4517d5e6e1b6e1bf7ee5b63a8a6 languageName: node linkType: hard @@ -28963,13 +29008,13 @@ __metadata: linkType: hard "webpack-hot-middleware@npm:^2.25.1": - version: 2.25.4 - resolution: "webpack-hot-middleware@npm:2.25.4" + version: 2.26.1 + resolution: "webpack-hot-middleware@npm:2.26.1" dependencies: ansi-html-community: "npm:0.0.8" html-entities: "npm:^2.1.0" strip-ansi: "npm:^6.0.0" - checksum: 10c0/c0702d308a39bdbc9277d66df50272e8c358c2238cecb0881df57136f54cb7a3d8291320b13075325b58f7a3cbf7a1ef10829554a5bc2ddfa3effbf416dc8e8c + checksum: 10c0/13a3e78009e373b4ee990ffe1d4d49046e9893148a7106f063e11f962d02b744ea58b1dec25f5e76723c9dce678b9e68c883e7f2af2940aaf4de7aab31264c83 languageName: node linkType: hard @@ -29419,9 +29464,11 @@ __metadata: linkType: hard "yaml@npm:^2.0.0, yaml@npm:^2.3.1": - version: 2.3.4 - resolution: "yaml@npm:2.3.4" - checksum: 10c0/cf03b68f8fef5e8516b0f0b54edaf2459f1648317fc6210391cf606d247e678b449382f4bd01f77392538429e306c7cba8ff46ff6b37cac4de9a76aff33bd9e1 + version: 2.4.5 + resolution: "yaml@npm:2.4.5" + bin: + yaml: bin.mjs + checksum: 10c0/e1ee78b381e5c710f715cc4082fd10fc82f7f5c92bd6f075771d20559e175616f56abf1c411f545ea0e9e16e4f84a83a50b42764af5f16ec006328ba9476bb31 languageName: node linkType: hard diff --git a/scripts/.eslintrc.cjs b/scripts/.eslintrc.cjs index 2af8b19b61c1..1ff3e0625e4a 100644 --- a/scripts/.eslintrc.cjs +++ b/scripts/.eslintrc.cjs @@ -6,6 +6,11 @@ module.exports = { project: ['./tsconfig.json'], }, rules: { + 'import/no-extraneous-dependencies': [ + 'error', + { devDependencies: true, peerDependencies: true }, + ], + // remove as shared eslint has jest rules removed '@typescript-eslint/ban-ts-comment': 'error', '@typescript-eslint/consistent-type-imports': ['error', { disallowTypeAnnotations: false }], diff --git a/scripts/bench/utils.ts b/scripts/bench/utils.ts index 1bd3a3f849ae..97dde07caa75 100644 --- a/scripts/bench/utils.ts +++ b/scripts/bench/utils.ts @@ -1,5 +1,7 @@ -import { ensureDir, readJSON, readdir, writeJSON } from 'fs-extra'; -import { join } from 'path'; +import { readdir } from 'node:fs/promises'; +import { join } from 'node:path'; + +import { ensureDir, readJSON, writeJSON } from '@ndelangen/fs-extra-unified'; import type { Page } from 'playwright-core'; import type { BenchResults } from './types'; diff --git a/scripts/build-package.ts b/scripts/build-package.ts index 60ac5b012e13..48bc744fd6e5 100644 --- a/scripts/build-package.ts +++ b/scripts/build-package.ts @@ -1,8 +1,9 @@ +import { posix, resolve, sep } from 'node:path'; + +import { readJSON } from '@ndelangen/fs-extra-unified'; import chalk from 'chalk'; import { program } from 'commander'; import { execaCommand } from 'execa'; -import { readJSON } from 'fs-extra'; -import { posix, resolve, sep } from 'path'; import prompts from 'prompts'; import windowSize from 'window-size'; diff --git a/scripts/check-dependencies.js b/scripts/check-dependencies.js index 4e830d7c6bcf..fce334985490 100644 --- a/scripts/check-dependencies.js +++ b/scripts/check-dependencies.js @@ -2,10 +2,10 @@ * This file needs to be run before any other script to ensure dependencies are installed Therefore, * we cannot transform this file to Typescript, because it would require esbuild to be installed */ -import { spawn } from 'child_process'; -import { existsSync } from 'fs'; -import { join } from 'path'; -import * as url from 'url'; +import { spawn } from 'node:child_process'; +import { existsSync } from 'node:fs'; +import { join } from 'node:path'; +import * as url from 'node:url'; const logger = console; diff --git a/scripts/check-package.ts b/scripts/check-package.ts index c8873e6cf846..17cf3bb3581b 100644 --- a/scripts/check-package.ts +++ b/scripts/check-package.ts @@ -1,11 +1,12 @@ // This script makes sure that we can support type checking, // without having to build dts files for all packages in the monorepo. // It is not implemented yet for angular, svelte and vue. +import { resolve } from 'node:path'; + +import { readJSON } from '@ndelangen/fs-extra-unified'; import chalk from 'chalk'; import { program } from 'commander'; import { execaCommand } from 'execa'; -import { readJSON } from 'fs-extra'; -import { resolve } from 'path'; import prompts from 'prompts'; import windowSize from 'window-size'; diff --git a/scripts/combine-compodoc.ts b/scripts/combine-compodoc.ts index eefc905fc132..dcbed177e260 100755 --- a/scripts/combine-compodoc.ts +++ b/scripts/combine-compodoc.ts @@ -1,10 +1,11 @@ // Compodoc does not follow symlinks (it ignores them and their contents entirely) // So, we need to run a separate compodoc process on every symlink inside the project, // then combine the results into one large documentation.json +import { lstat, readFile, realpath, writeFile } from 'node:fs/promises'; +import { join, resolve } from 'node:path'; + import { execaCommand } from 'execa'; -import { lstat, readFile, realpath, writeFile } from 'fs-extra'; import { globSync } from 'glob'; -import { join, resolve } from 'path'; import { temporaryDirectory } from '../code/core/src/common/utils/cli'; import { esMain } from './utils/esmain'; diff --git a/scripts/get-report-message.ts b/scripts/get-report-message.ts index 4774bc0f8ca2..d6a46c4a01e2 100644 --- a/scripts/get-report-message.ts +++ b/scripts/get-report-message.ts @@ -1,6 +1,7 @@ +import { join } from 'node:path'; + +import { readJson } from '@ndelangen/fs-extra-unified'; import { execaCommand } from 'execa'; -import { readJson } from 'fs-extra'; -import { join } from 'path'; import { CODE_DIRECTORY } from './utils/constants'; import { esMain } from './utils/esmain'; diff --git a/scripts/get-template.ts b/scripts/get-template.ts index 28b390c665bd..a8e58b6f7c1f 100644 --- a/scripts/get-template.ts +++ b/scripts/get-template.ts @@ -1,7 +1,8 @@ +import { readFile, readdir } from 'node:fs/promises'; + +import { pathExists } from '@ndelangen/fs-extra-unified'; import chalk from 'chalk'; import { program } from 'commander'; -import { pathExists, readFile } from 'fs-extra'; -import { readdir } from 'fs/promises'; import { dedent } from 'ts-dedent'; import yaml from 'yaml'; diff --git a/scripts/package.json b/scripts/package.json index 2cd8402ddcd8..1538a2795adf 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -61,6 +61,7 @@ "@actions/core": "^1.10.1", "@fal-works/esbuild-plugin-global-externals": "^2.1.2", "@google-cloud/bigquery": "^6.2.0", + "@ndelangen/fs-extra-unified": "^1.0.4", "@nx/workspace": "18.0.6", "@octokit/graphql": "^5.0.5", "@octokit/request": "^8.1.2", diff --git a/scripts/prepare/addon-bundle.ts b/scripts/prepare/addon-bundle.ts index 14c62791514e..b3103a9a9189 100755 --- a/scripts/prepare/addon-bundle.ts +++ b/scripts/prepare/addon-bundle.ts @@ -1,9 +1,10 @@ +import { readFile, writeFile } from 'node:fs/promises'; import { builtinModules } from 'node:module'; +import { dirname, join, parse, posix, relative, sep } from 'node:path'; +import { emptyDir, ensureFile, pathExists, readJson } from '@ndelangen/fs-extra-unified'; import aliasPlugin from 'esbuild-plugin-alias'; -import * as fs from 'fs-extra'; import { glob } from 'glob'; -import { dirname, join, parse, posix, relative, sep } from 'path'; import slash from 'slash'; import { dedent } from 'ts-dedent'; import type { Options } from 'tsup'; @@ -55,7 +56,7 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => { post, formats = ['esm', 'cjs'], }, - } = (await fs.readJson(join(cwd, 'package.json'))) as PackageJsonWithBundlerConfig; + } = (await readJson(join(cwd, 'package.json'))) as PackageJsonWithBundlerConfig; if (pre) { await exec(`jiti ${pre}`, { cwd }); @@ -66,7 +67,7 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => { const optimized = hasFlag(flags, 'optimized'); if (reset) { - await fs.emptyDir(join(process.cwd(), 'dist')); + await emptyDir(join(process.cwd(), 'dist')); } const tasks: Promise[] = []; @@ -239,8 +240,8 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => { const dtsFiles = await glob(outDir + '/**/*.d.ts'); await Promise.all( dtsFiles.map(async (file) => { - const content = await fs.readFile(file, 'utf-8'); - await fs.writeFile( + const content = await readFile(file, 'utf-8'); + await writeFile( file, content.replace(/from \'core\/dist\/(.*)\'/g, `from 'storybook/internal/$1'`) ); @@ -268,7 +269,7 @@ async function getDTSConfigs({ optimized: boolean; }) { const tsConfigPath = join(cwd, 'tsconfig.json'); - const tsConfigExists = await fs.pathExists(tsConfigPath); + const tsConfigExists = await pathExists(tsConfigPath); const dtsBuild = optimized && formats[0] && tsConfigExists ? formats[0] : undefined; @@ -300,8 +301,8 @@ async function generateDTSMapperFile(file: string) { const srcName = join(process.cwd(), file); const rel = relative(dirname(pathName), dirname(srcName)).split(sep).join(posix.sep); - await fs.ensureFile(pathName); - await fs.writeFile( + await ensureFile(pathName); + await writeFile( pathName, dedent` // dev-mode diff --git a/scripts/prepare/bundle.ts b/scripts/prepare/bundle.ts index 81a7b301fe41..fc4d1f52e87c 100755 --- a/scripts/prepare/bundle.ts +++ b/scripts/prepare/bundle.ts @@ -1,7 +1,8 @@ +import { readFile, writeFile } from 'node:fs/promises'; import { dirname, join, parse, posix, relative, resolve, sep } from 'node:path'; +import { emptyDir, ensureFile, pathExists, readJson } from '@ndelangen/fs-extra-unified'; import aliasPlugin from 'esbuild-plugin-alias'; -import * as fs from 'fs-extra'; import { glob } from 'glob'; import slash from 'slash'; import { dedent } from 'ts-dedent'; @@ -10,12 +11,14 @@ import { build } from 'tsup'; import type { PackageJson } from 'type-fest'; import { exec } from '../utils/exec'; +import { nodeInternals } from './tools'; /* TYPES */ type Formats = 'esm' | 'cjs'; type BundlerConfig = { entries: string[]; + nodeEntries: string[]; externals: string[]; noExternal: string[]; platform: Options['platform']; @@ -37,6 +40,7 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => { peerDependencies, bundler: { entries = [], + nodeEntries = [], externals: extraExternals = [], noExternal: extraNoExternal = [], platform, @@ -44,7 +48,7 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => { post, formats = ['esm', 'cjs'], }, - } = (await fs.readJson(join(cwd, 'package.json'))) as PackageJsonWithBundlerConfig; + } = (await readJson(join(cwd, 'package.json'))) as PackageJsonWithBundlerConfig; if (pre) { await exec(`jiti ${pre}`, { cwd }); @@ -55,7 +59,7 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => { const optimized = hasFlag(flags, 'optimized'); if (reset) { - await fs.emptyDir(join(process.cwd(), 'dist')); + await emptyDir(join(process.cwd(), 'dist')); } const tasks: Promise[] = []; @@ -84,7 +88,7 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => { const noExternal = [...extraNoExternal]; - if (formats.includes('esm')) { + if (formats.includes('esm') && nonPresetEntries.length > 0) { tasks.push( build({ noExternal, @@ -100,6 +104,20 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => { clean: false, ...(dtsBuild === 'esm' ? dtsConfig : {}), platform: platform || 'browser', + banner: + platform === 'node' + ? { + js: dedent` + import ESM_COMPAT_Module from "node:module"; + import { fileURLToPath as ESM_COMPAT_fileURLToPath } from 'node:url'; + import { dirname as ESM_COMPAT_dirname } from 'node:path'; + const __filename = ESM_COMPAT_fileURLToPath(import.meta.url); + const __dirname = ESM_COMPAT_dirname(__filename); + const require = ESM_COMPAT_Module.createRequire(import.meta.url); + `, + } + : {}, + esbuildPlugins: platform === 'node' ? [] @@ -120,7 +138,7 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => { ); } - if (formats.includes('cjs')) { + if (formats.includes('cjs') && allEntries.length > 0) { tasks.push( build({ noExternal, @@ -144,6 +162,75 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => { ); } + if (nodeEntries.length > 0) { + const dts = await getDTSConfigs({ + formats, + entries: nodeEntries, + optimized, + }); + + if (formats.includes('esm')) { + tasks.push( + build({ + noExternal, + silent: true, + treeshake: true, + entry: nodeEntries, + shims: false, + watch, + outDir, + sourcemap: false, + format: ['esm'], + target: ['node18'], + clean: false, + ...(dts.dtsBuild === 'esm' ? dts.dtsConfig : {}), + platform: 'neutral', + banner: { + js: dedent` + import ESM_COMPAT_Module from "node:module"; + import { fileURLToPath as ESM_COMPAT_fileURLToPath } from 'node:url'; + import { dirname as ESM_COMPAT_dirname } from 'node:path'; + const __filename = ESM_COMPAT_fileURLToPath(import.meta.url); + const __dirname = ESM_COMPAT_dirname(__filename); + const require = ESM_COMPAT_Module.createRequire(import.meta.url); + `, + }, + + external: [...externals, ...nodeInternals], + + esbuildOptions: (c) => { + c.conditions = ['module']; + Object.assign(c, getESBuildOptions(optimized)); + }, + }) + ); + } + + if (formats.includes('cjs')) { + tasks.push( + build({ + noExternal, + silent: true, + entry: nodeEntries, + watch, + outDir, + sourcemap: false, + format: ['cjs'], + target: 'node18', + ...(dts.dtsBuild === 'cjs' ? dts.dtsConfig : {}), + platform: 'node', + clean: false, + external: [...externals, ...nodeInternals], + + esbuildOptions: (c) => { + c.platform = 'node'; + Object.assign(c, getESBuildOptions(optimized)); + }, + }) + ); + } + } + if (tsConfigExists && !optimized) { tasks.push(...entries.map(generateDTSMapperFile)); } @@ -153,8 +240,8 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => { const dtsFiles = await glob(outDir + '/**/*.d.ts'); await Promise.all( dtsFiles.map(async (file) => { - const content = await fs.readFile(file, 'utf-8'); - await fs.writeFile( + const content = await readFile(file, 'utf-8'); + await writeFile( file, content.replace(/from \'core\/dist\/(.*)\'/g, `from 'storybook/internal/$1'`) ); @@ -182,7 +269,7 @@ async function getDTSConfigs({ optimized: boolean; }) { const tsConfigPath = join(cwd, 'tsconfig.json'); - const tsConfigExists = await fs.pathExists(tsConfigPath); + const tsConfigExists = await pathExists(tsConfigPath); const dtsBuild = optimized && formats[0] && tsConfigExists ? formats[0] : undefined; @@ -214,8 +301,8 @@ async function generateDTSMapperFile(file: string) { const srcName = join(process.cwd(), file); const rel = relative(dirname(pathName), dirname(srcName)).split(sep).join(posix.sep); - await fs.ensureFile(pathName); - await fs.writeFile( + await ensureFile(pathName); + await writeFile( pathName, dedent` // dev-mode diff --git a/scripts/prepare/check-scripts.ts b/scripts/prepare/check-scripts.ts index e097e689d953..3e6484545324 100755 --- a/scripts/prepare/check-scripts.ts +++ b/scripts/prepare/check-scripts.ts @@ -1,4 +1,5 @@ -import { join } from 'path'; +import { join } from 'node:path'; + import ts from 'typescript'; const run = async ({ cwd }: { cwd: string }) => { diff --git a/scripts/prepare/check.ts b/scripts/prepare/check.ts index dbf09429492b..15b925ba8250 100755 --- a/scripts/prepare/check.ts +++ b/scripts/prepare/check.ts @@ -1,11 +1,12 @@ -import fs from 'fs-extra'; -import { join } from 'path'; +import { join } from 'node:path'; + +import { readJson } from '@ndelangen/fs-extra-unified'; import ts from 'typescript'; const run = async ({ cwd }: { cwd: string }) => { const { bundler: { tsConfig: tsconfigPath = 'tsconfig.json' }, - } = await fs.readJson(join(cwd, 'package.json')); + } = await readJson(join(cwd, 'package.json')); const { options, fileNames } = getTSFilesAndConfig(tsconfigPath); const { program, host } = getTSProgramAndHost(fileNames, options); @@ -39,7 +40,7 @@ run({ cwd: process.cwd() }).catch((err: unknown) => { function getTSDiagnostics(program: ts.Program, cwd: string, host: ts.CompilerHost): any { return ts.formatDiagnosticsWithColorAndContext( - ts.getPreEmitDiagnostics(program).filter((d) => d.file.fileName.startsWith(cwd)), + ts.getPreEmitDiagnostics(program).filter((d) => d.file?.fileName.startsWith(cwd)), host ); } diff --git a/scripts/prepare/tools.ts b/scripts/prepare/tools.ts index 5b81ed2b3f62..120efbe72142 100644 --- a/scripts/prepare/tools.ts +++ b/scripts/prepare/tools.ts @@ -3,10 +3,10 @@ import { dirname, join } from 'node:path'; import * as process from 'node:process'; import { globalExternals } from '@fal-works/esbuild-plugin-global-externals'; +import { readJson } from '@ndelangen/fs-extra-unified'; import chalk from 'chalk'; import { spawn } from 'cross-spawn'; import * as esbuild from 'esbuild'; -import { readJson } from 'fs-extra'; import { glob } from 'glob'; import limit from 'p-limit'; import * as prettier from 'prettier'; diff --git a/scripts/prepare/tsc.ts b/scripts/prepare/tsc.ts index 6a6aba2643bd..a20fa55657f3 100755 --- a/scripts/prepare/tsc.ts +++ b/scripts/prepare/tsc.ts @@ -1,6 +1,7 @@ -import { emptyDir, move, readJson } from 'fs-extra'; +import { join } from 'node:path'; + +import { emptyDir, move, readJson } from '@ndelangen/fs-extra-unified'; import { globSync } from 'glob'; -import { join } from 'path'; import * as ts from 'typescript'; import { exec } from '../utils/exec'; diff --git a/scripts/release/__tests__/is-pr-frozen.test.ts b/scripts/release/__tests__/is-pr-frozen.test.ts index 681069af7256..81892c1b9ec0 100644 --- a/scripts/release/__tests__/is-pr-frozen.test.ts +++ b/scripts/release/__tests__/is-pr-frozen.test.ts @@ -3,7 +3,7 @@ import { join } from 'node:path'; import { describe, expect, it, vi } from 'vitest'; -import * as fsExtraImp from 'fs-extra'; +import * as fsExtraImp from '@ndelangen/fs-extra-unified'; import * as simpleGitImp from 'simple-git'; import type * as MockedFSExtra from '../../../code/__mocks__/fs-extra'; @@ -15,7 +15,7 @@ import { getPullInfoFromCommit } from '../utils/get-github-info'; vi.mock('../utils/get-github-info'); vi.mock('simple-git'); -vi.mock('fs-extra', async () => import('../../../code/__mocks__/fs-extra')); +vi.mock('@ndelangen/fs-extra-unified', async () => import('../../../code/__mocks__/fs-extra')); const fsExtra = fsExtraImp as unknown as typeof MockedFSExtra; const simpleGit = simpleGitImp as unknown as typeof MockedSimpleGit; diff --git a/scripts/release/__tests__/version.test.ts b/scripts/release/__tests__/version.test.ts index 3572e4cb76ee..809a28120cca 100644 --- a/scripts/release/__tests__/version.test.ts +++ b/scripts/release/__tests__/version.test.ts @@ -3,13 +3,14 @@ import { join } from 'node:path'; import { describe, expect, it, vi } from 'vitest'; +import * as fsExtraImp from '@ndelangen/fs-extra-unified'; import { execaCommand } from 'execa'; -import * as fsExtraImp from 'fs-extra'; import type * as MockedFSToExtra from '../../../code/__mocks__/fs-extra'; import { run as version } from '../version'; -vi.mock('fs-extra', async () => import('../../../code/__mocks__/fs-extra')); +vi.mock('@ndelangen/fs-extra-unified', async () => import('../../../code/__mocks__/fs-extra')); +vi.mock('node:fs/promises', async () => import('../../../code/__mocks__/fs-extra')); const fsExtra = fsExtraImp as unknown as typeof MockedFSToExtra; vi.mock('../../../code/core/src/common/src/versions', () => ({ diff --git a/scripts/release/__tests__/write-changelog.test.ts b/scripts/release/__tests__/write-changelog.test.ts index f0346066b26c..7005b4f3e51e 100644 --- a/scripts/release/__tests__/write-changelog.test.ts +++ b/scripts/release/__tests__/write-changelog.test.ts @@ -3,14 +3,15 @@ import { join } from 'node:path'; import { beforeEach, describe, expect, it, vi } from 'vitest'; -import * as fsExtraImp from 'fs-extra'; +import * as fsExtraImp from '@ndelangen/fs-extra-unified'; import { dedent } from 'ts-dedent'; import type * as MockedFSToExtra from '../../../code/__mocks__/fs-extra'; import * as changesUtils_ from '../utils/get-changes'; import { run as writeChangelog } from '../write-changelog'; -vi.mock('fs-extra', async () => import('../../../code/__mocks__/fs-extra')); +vi.mock('@ndelangen/fs-extra-unified', async () => import('../../../code/__mocks__/fs-extra')); +vi.mock('node:fs/promises', async () => import('../../../code/__mocks__/fs-extra')); vi.mock('../utils/get-changes'); const changesUtils = vi.mocked(changesUtils_); diff --git a/scripts/release/get-changelog-from-file.ts b/scripts/release/get-changelog-from-file.ts index f428310cc656..e23e69fca5fc 100644 --- a/scripts/release/get-changelog-from-file.ts +++ b/scripts/release/get-changelog-from-file.ts @@ -1,9 +1,9 @@ +import { readFile } from 'node:fs/promises'; import { join } from 'node:path'; import { setOutput } from '@actions/core'; import chalk from 'chalk'; import { program } from 'commander'; -import { readFile } from 'fs-extra'; import semver from 'semver'; import { dedent } from 'ts-dedent'; diff --git a/scripts/release/get-current-version.ts b/scripts/release/get-current-version.ts index f640ccb5907e..2600c0ccfef9 100644 --- a/scripts/release/get-current-version.ts +++ b/scripts/release/get-current-version.ts @@ -1,8 +1,8 @@ import { join } from 'node:path'; import { setOutput } from '@actions/core'; +import { readJson } from '@ndelangen/fs-extra-unified'; import chalk from 'chalk'; -import { readJson } from 'fs-extra'; import { esMain } from '../utils/esmain'; diff --git a/scripts/release/is-pr-frozen.ts b/scripts/release/is-pr-frozen.ts index af5a957af8ae..b15eb4b721cf 100644 --- a/scripts/release/is-pr-frozen.ts +++ b/scripts/release/is-pr-frozen.ts @@ -1,9 +1,9 @@ import { join } from 'node:path'; import { setOutput } from '@actions/core'; +import { readJson } from '@ndelangen/fs-extra-unified'; import chalk from 'chalk'; import { program } from 'commander'; -import { readJson } from 'fs-extra'; import { esMain } from '../utils/esmain'; import { getPullInfoFromCommit } from './utils/get-github-info'; diff --git a/scripts/release/publish.ts b/scripts/release/publish.ts index 65347010181d..84f557393ad5 100644 --- a/scripts/release/publish.ts +++ b/scripts/release/publish.ts @@ -1,9 +1,9 @@ import { join } from 'node:path'; +import { readJson } from '@ndelangen/fs-extra-unified'; import chalk from 'chalk'; import { program } from 'commander'; import { execaCommand } from 'execa'; -import { readJson } from 'fs-extra'; import pRetry from 'p-retry'; import semver from 'semver'; import dedent from 'ts-dedent'; diff --git a/scripts/release/version.ts b/scripts/release/version.ts index 422de3501bc0..5fdd7732cbda 100644 --- a/scripts/release/version.ts +++ b/scripts/release/version.ts @@ -1,10 +1,11 @@ +import { readFile, writeFile } from 'node:fs/promises'; import { join } from 'node:path'; import { setOutput } from '@actions/core'; +import { readJson, writeJson } from '@ndelangen/fs-extra-unified'; import chalk from 'chalk'; import { program } from 'commander'; import { execaCommand } from 'execa'; -import { readFile, readJson, writeFile, writeJson } from 'fs-extra'; import semver from 'semver'; import { z } from 'zod'; diff --git a/scripts/release/write-changelog.ts b/scripts/release/write-changelog.ts index 8f927b3c6434..adc568352aa9 100644 --- a/scripts/release/write-changelog.ts +++ b/scripts/release/write-changelog.ts @@ -1,8 +1,9 @@ +import { readFile, writeFile } from 'node:fs/promises'; import { join } from 'node:path'; +import { writeJson } from '@ndelangen/fs-extra-unified'; import chalk from 'chalk'; import { program } from 'commander'; -import { readFile, writeFile, writeJson } from 'fs-extra'; import semver from 'semver'; import { z } from 'zod'; diff --git a/scripts/reset.js b/scripts/reset.js index ed93cbce800b..ee117c145310 100644 --- a/scripts/reset.js +++ b/scripts/reset.js @@ -1,7 +1,7 @@ import { spawn } from 'node:child_process'; import { appendFile, writeFileSync } from 'node:fs'; -import { remove } from 'fs-extra'; +import { remove } from '@ndelangen/fs-extra-unified'; import trash from 'trash'; const logger = console; diff --git a/scripts/run-registry.ts b/scripts/run-registry.ts index 4f837b952794..2eb1b28853d8 100755 --- a/scripts/run-registry.ts +++ b/scripts/run-registry.ts @@ -4,10 +4,10 @@ import http from 'node:http'; import type { Server } from 'node:http'; import { join, resolve as resolvePath } from 'node:path'; +import { pathExists, readJSON, remove } from '@ndelangen/fs-extra-unified'; import chalk from 'chalk'; import { program } from 'commander'; import { execa, execaSync } from 'execa'; -import { pathExists, readJSON, remove } from 'fs-extra'; import pLimit from 'p-limit'; import { parseConfigFile, runServer } from 'verdaccio'; @@ -33,7 +33,7 @@ const startVerdaccio = async () => { verdaccio: false, }; return Promise.race([ - new Promise((resolve) => { + new Promise((resolvePromise) => { /** * The proxy server will sit in front of verdaccio and tunnel traffic to either verdaccio or * the actual npm global registry We do this because tunneling all traffic through verdaccio @@ -65,7 +65,7 @@ const startVerdaccio = async () => { proxy.listen(6001, () => { ready.proxy = true; if (ready.verdaccio) { - resolve(verdaccioApp); + resolvePromise(verdaccioApp); } }); const cache = join(__dirname, '..', '.verdaccio-cache'); @@ -81,7 +81,7 @@ const startVerdaccio = async () => { app.listen(6002, () => { ready.verdaccio = true; if (ready.proxy) { - resolve(verdaccioApp); + resolvePromise(verdaccioApp); } }); }); diff --git a/scripts/sandbox/generate.ts b/scripts/sandbox/generate.ts index d92696383699..8de2dc90452d 100755 --- a/scripts/sandbox/generate.ts +++ b/scripts/sandbox/generate.ts @@ -1,10 +1,12 @@ +import { rename, writeFile } from 'node:fs/promises'; +import { join, relative } from 'node:path'; + import * as ghActions from '@actions/core'; +import { copy, emptyDir, ensureDir, move, remove } from '@ndelangen/fs-extra-unified'; import { program } from 'commander'; import type { Options as ExecaOptions } from 'execa'; import { execaCommand } from 'execa'; -import { copy, emptyDir, ensureDir, move, remove, rename, writeFile } from 'fs-extra'; import pLimit from 'p-limit'; -import { join, relative } from 'path'; import prettyTime from 'pretty-hrtime'; import { dedent } from 'ts-dedent'; diff --git a/scripts/sandbox/publish.ts b/scripts/sandbox/publish.ts index 7ddb549c3900..ef8f140a5cfc 100755 --- a/scripts/sandbox/publish.ts +++ b/scripts/sandbox/publish.ts @@ -1,9 +1,11 @@ +import { existsSync } from 'node:fs'; +import { writeFile } from 'node:fs/promises'; +import { dirname, join, relative } from 'node:path'; + +import { copy, emptyDir, remove } from '@ndelangen/fs-extra-unified'; import { program } from 'commander'; import { execaCommand } from 'execa'; -import { existsSync } from 'fs'; -import { copy, emptyDir, remove, writeFile } from 'fs-extra'; import { glob } from 'glob'; -import { dirname, join, relative } from 'path'; import { temporaryDirectory } from '../../code/core/src/common/utils/cli'; import { REPROS_DIRECTORY } from '../utils/constants'; diff --git a/scripts/sandbox/utils/template.ts b/scripts/sandbox/utils/template.ts index 11b6c1e86d5a..4bda17d4f5c2 100644 --- a/scripts/sandbox/utils/template.ts +++ b/scripts/sandbox/utils/template.ts @@ -1,5 +1,6 @@ +import { readFile } from 'node:fs/promises'; + import { render } from 'ejs'; -import { readFile } from 'fs-extra'; import prettier from 'prettier'; import { allTemplates as sandboxTemplates } from '../../../code/lib/cli-storybook/src/sandbox-templates'; diff --git a/scripts/sandbox/utils/yarn.ts b/scripts/sandbox/utils/yarn.ts index a2d579b2cde0..b8d25930e87f 100644 --- a/scripts/sandbox/utils/yarn.ts +++ b/scripts/sandbox/utils/yarn.ts @@ -1,5 +1,6 @@ -import { move, remove } from 'fs-extra'; -import { join } from 'path'; +import { join } from 'node:path'; + +import { move, remove } from '@ndelangen/fs-extra-unified'; import { runCommand } from '../generate'; diff --git a/scripts/task.ts b/scripts/task.ts index 905b53b82cae..2a7619ee587f 100644 --- a/scripts/task.ts +++ b/scripts/task.ts @@ -1,8 +1,10 @@ -import { outputFile, pathExists, readFile } from 'fs-extra'; +import { readFile } from 'node:fs/promises'; +import { join, resolve } from 'node:path'; + +import { outputFile, pathExists } from '@ndelangen/fs-extra-unified'; import type { TestCase } from 'junit-xml'; import { getJunitXml } from 'junit-xml'; -import { join, resolve } from 'path'; -import { prompt } from 'prompts'; +import prompts from 'prompts'; import invariant from 'tiny-invariant'; import { dedent } from 'ts-dedent'; @@ -427,7 +429,7 @@ async function run() { setUnready(sortedTasks[0]); } else { // We don't know what to do! Let's ask - const { startFromTask } = await prompt( + const { startFromTask } = await prompts( { type: 'select', message: firstUnready diff --git a/scripts/tasks/build.ts b/scripts/tasks/build.ts index 4a74dcba1f55..ee930f1b8615 100644 --- a/scripts/tasks/build.ts +++ b/scripts/tasks/build.ts @@ -1,6 +1,7 @@ +import { join } from 'node:path'; + +import { pathExists } from '@ndelangen/fs-extra-unified'; import dirSize from 'fast-folder-size'; -import { pathExists } from 'fs-extra'; -import { join } from 'path'; import { promisify } from 'util'; import { now, saveBench } from '../bench/utils'; diff --git a/scripts/tasks/compile.ts b/scripts/tasks/compile.ts index 2fe631c5f615..7315c1cd3806 100644 --- a/scripts/tasks/compile.ts +++ b/scripts/tasks/compile.ts @@ -1,5 +1,5 @@ -import { readFile } from 'fs-extra'; -import { resolve } from 'path'; +import { readFile } from 'node:fs/promises'; +import { resolve } from 'node:path'; import type { Task } from '../task'; import { exec } from '../utils/exec'; diff --git a/scripts/tasks/generate.ts b/scripts/tasks/generate.ts index 3e1b0ddc5bc3..204463bd0f67 100644 --- a/scripts/tasks/generate.ts +++ b/scripts/tasks/generate.ts @@ -1,5 +1,6 @@ -import { pathExists, remove } from 'fs-extra'; -import { join } from 'path'; +import { join } from 'node:path'; + +import { pathExists, remove } from '@ndelangen/fs-extra-unified'; import type { Task } from '../task'; import { REPROS_DIRECTORY } from '../utils/constants'; diff --git a/scripts/tasks/install.ts b/scripts/tasks/install.ts index 90342845687e..bc8c6b12ca81 100644 --- a/scripts/tasks/install.ts +++ b/scripts/tasks/install.ts @@ -1,5 +1,6 @@ -import { pathExists, remove } from 'fs-extra'; -import { join } from 'path'; +import { join } from 'node:path'; + +import { pathExists, remove } from '@ndelangen/fs-extra-unified'; import type { Task } from '../task'; import { checkDependencies } from '../utils/cli-utils'; diff --git a/scripts/tasks/publish.ts b/scripts/tasks/publish.ts index d83ffb9272b2..3109745c2fa3 100644 --- a/scripts/tasks/publish.ts +++ b/scripts/tasks/publish.ts @@ -1,5 +1,6 @@ -import { pathExists } from 'fs-extra'; -import { resolve } from 'path'; +import { resolve } from 'node:path'; + +import { pathExists } from '@ndelangen/fs-extra-unified'; import type { Task } from '../task'; import { exec } from '../utils/exec'; diff --git a/scripts/tasks/sandbox-parts.ts b/scripts/tasks/sandbox-parts.ts index 6432bf2d2f2d..de107c38780c 100644 --- a/scripts/tasks/sandbox-parts.ts +++ b/scripts/tasks/sandbox-parts.ts @@ -1,20 +1,20 @@ // This file requires many imports from `../code`, which requires both an install and bootstrap of // the repo to work properly. So we load it async in the task runner *after* those steps. +import { existsSync, readFileSync } from 'node:fs'; +import { writeFile } from 'node:fs/promises'; +import { createRequire } from 'node:module'; +import { join, relative, resolve, sep } from 'node:path'; + import { copy, ensureDir, ensureSymlink, - existsSync, pathExists, - readFileSync, readJson, - writeFile, writeJson, -} from 'fs-extra'; +} from '@ndelangen/fs-extra-unified'; import JSON5 from 'json5'; import { isFunction } from 'lodash'; -import { createRequire } from 'module'; -import { join, relative, resolve, sep } from 'path'; import slash from 'slash'; import dedent from 'ts-dedent'; diff --git a/scripts/tasks/sandbox.ts b/scripts/tasks/sandbox.ts index b650c80df276..8a261696b9f6 100644 --- a/scripts/tasks/sandbox.ts +++ b/scripts/tasks/sandbox.ts @@ -1,12 +1,14 @@ +import { join } from 'node:path'; +import { promisify } from 'node:util'; + +import { pathExists, remove } from '@ndelangen/fs-extra-unified'; import dirSize from 'fast-folder-size'; -import { pathExists, remove } from 'fs-extra'; -import { join } from 'path'; -import { promisify } from 'util'; import { now, saveBench } from '../bench/utils'; import type { Task } from '../task'; const logger = console; +const dirSizeAsync = promisify(dirSize); export const sandbox: Task = { description: 'Create the sandbox from a template', @@ -56,12 +58,13 @@ export const sandbox: Task = { startTime = now(); await install(details, options); const generateTime = now() - startTime; - const generateSize = await promisify(dirSize)(join(details.sandboxDir, 'node_modules')); + + const generateSize = await dirSizeAsync(join(details.sandboxDir, 'node_modules')); startTime = now(); await init(details, options); const initTime = now() - startTime; - const initSize = await promisify(dirSize)(join(details.sandboxDir, 'node_modules')); + const initSize = await dirSizeAsync(join(details.sandboxDir, 'node_modules')); await saveBench( 'sandbox', diff --git a/scripts/tsconfig.json b/scripts/tsconfig.json index 77c8d8e2da1b..e82c6b6e154d 100644 --- a/scripts/tsconfig.json +++ b/scripts/tsconfig.json @@ -5,7 +5,7 @@ "incremental": false, "noImplicitAny": true, "jsx": "react", - "moduleResolution": "bundler", + "moduleResolution": "Bundler", "target": "es2022", "module": "ES2022", "skipLibCheck": true, diff --git a/scripts/upload-bench.ts b/scripts/upload-bench.ts index 9766079b9dc8..d85c4d62c789 100644 --- a/scripts/upload-bench.ts +++ b/scripts/upload-bench.ts @@ -1,6 +1,7 @@ +import { join } from 'node:path'; + import { BigQuery } from '@google-cloud/bigquery'; import { execaCommand } from 'execa'; -import { join } from 'path'; import type { BenchResults } from './bench/types'; import { loadBench } from './bench/utils'; diff --git a/scripts/utils/cli-utils.ts b/scripts/utils/cli-utils.ts index 509c1936e01e..919e1de067ae 100644 --- a/scripts/utils/cli-utils.ts +++ b/scripts/utils/cli-utils.ts @@ -1,6 +1,6 @@ -import { spawn } from 'child_process'; -import { existsSync } from 'fs'; -import { join } from 'path'; +import { spawn } from 'node:child_process'; +import { existsSync } from 'node:fs'; +import { join } from 'node:path'; const logger = console; diff --git a/scripts/utils/constants.ts b/scripts/utils/constants.ts index d783410d3825..86f738b25250 100644 --- a/scripts/utils/constants.ts +++ b/scripts/utils/constants.ts @@ -1,4 +1,4 @@ -import { join } from 'path'; +import { join } from 'node:path'; export const AFTER_DIR_NAME = 'after-storybook'; export const BEFORE_DIR_NAME = 'before-storybook'; diff --git a/scripts/utils/filterExistsInCodeDir.ts b/scripts/utils/filterExistsInCodeDir.ts index 7a22fdf8d2f2..41c035aa8142 100644 --- a/scripts/utils/filterExistsInCodeDir.ts +++ b/scripts/utils/filterExistsInCodeDir.ts @@ -1,6 +1,6 @@ import { join, resolve } from 'node:path'; -import { pathExists } from 'fs-extra'; +import { pathExists } from '@ndelangen/fs-extra-unified'; import { CODE_DIRECTORY } from './constants'; diff --git a/scripts/utils/main-js.ts b/scripts/utils/main-js.ts index fa117008afc5..9df511a6110d 100644 --- a/scripts/utils/main-js.ts +++ b/scripts/utils/main-js.ts @@ -1,5 +1,6 @@ -import { existsSync } from 'fs'; -import { join, resolve } from 'path'; +import { existsSync } from 'node:fs'; +import { join, resolve } from 'node:path'; + import slash from 'slash'; import { getInterpretedFile } from '../../code/core/src/common'; diff --git a/scripts/utils/package-json.ts b/scripts/utils/package-json.ts index cc88350ddfaa..1732e4bd13bd 100644 --- a/scripts/utils/package-json.ts +++ b/scripts/utils/package-json.ts @@ -1,5 +1,6 @@ -import { readJSON, writeJSON } from 'fs-extra'; -import { join } from 'path'; +import { join } from 'node:path'; + +import { readJSON, writeJSON } from '@ndelangen/fs-extra-unified'; export async function updatePackageScripts({ cwd, prefix }: { cwd: string; prefix: string }) { const packageJsonPath = join(cwd, 'package.json'); diff --git a/scripts/utils/paths.ts b/scripts/utils/paths.ts index 36db99f4e093..8109c32e99ae 100644 --- a/scripts/utils/paths.ts +++ b/scripts/utils/paths.ts @@ -1,5 +1,6 @@ -import { pathExists } from 'fs-extra'; -import { join } from 'path'; +import { join } from 'node:path'; + +import { pathExists } from '@ndelangen/fs-extra-unified'; export async function findFirstPath(paths: string[], { cwd }: { cwd: string }) { for (const filePath of paths) { diff --git a/scripts/utils/serve.ts b/scripts/utils/serve.ts index 98ba1da21c63..e930aa326c27 100644 --- a/scripts/utils/serve.ts +++ b/scripts/utils/serve.ts @@ -1,5 +1,6 @@ +import type { Server } from 'node:http'; + import express from 'express'; -import type { Server } from 'http'; import serveStatic from 'serve-static'; export const serve = async (location: string, port: string): Promise => { diff --git a/scripts/utils/yarn.ts b/scripts/utils/yarn.ts index 0b8147dfa983..e02a30732960 100644 --- a/scripts/utils/yarn.ts +++ b/scripts/utils/yarn.ts @@ -1,6 +1,6 @@ import { join } from 'node:path'; -import { pathExists, readJSON, writeJSON } from 'fs-extra'; +import { pathExists, readJSON, writeJSON } from '@ndelangen/fs-extra-unified'; // TODO -- should we generate this file a second time outside of CLI? import storybookVersions from '../../code/core/src/common/versions'; diff --git a/scripts/yarn.lock b/scripts/yarn.lock index 204801ac47ac..da5d1a908884 100644 --- a/scripts/yarn.lock +++ b/scripts/yarn.lock @@ -751,6 +751,19 @@ __metadata: languageName: node linkType: hard +"@ndelangen/fs-extra-unified@npm:^1.0.4": + version: 1.0.4 + resolution: "@ndelangen/fs-extra-unified@npm:1.0.4" + peerDependencies: + "@types/fs-extra": ^11.0.0 + fs-extra: ^11.0.0 + peerDependenciesMeta: + "@types/fs-extra": + optional: true + checksum: 10c0/4bdce65882db58ce42bf08efce9993324e2f6a639aecbb82f2cf2a72fdfe6b18b587e4551bac776d3c1787a784d7e295f3fedb9bd24c6f1a970f85d17b8499df + languageName: node + linkType: hard + "@nodelib/fs.scandir@npm:2.1.5": version: 2.1.5 resolution: "@nodelib/fs.scandir@npm:2.1.5" @@ -1511,6 +1524,7 @@ __metadata: "@actions/core": "npm:^1.10.1" "@fal-works/esbuild-plugin-global-externals": "npm:^2.1.2" "@google-cloud/bigquery": "npm:^6.2.0" + "@ndelangen/fs-extra-unified": "npm:^1.0.4" "@nx/workspace": "npm:18.0.6" "@octokit/graphql": "npm:^5.0.5" "@octokit/request": "npm:^8.1.2"