Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v22.11.0
v23.8.0
12 changes: 10 additions & 2 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import path from 'path';
import { createRequire } from 'module';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import fg from 'fast-glob';
import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin';
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';

const currentModuleUrl = typeof import.meta !== 'undefined' ? import.meta.url : '';
const __filename = fileURLToPath(currentModuleUrl);
const __dirname = path.dirname(__filename);

const nodeRequire = createRequire(currentModuleUrl);

const { argv } = yargs(hideBin(process.argv));

if (argv instanceof Promise) {
Expand All @@ -15,7 +23,7 @@ const getGlobPaths = (paths: string[]) =>
paths.reduce<string[]>((acc, path) => [...acc, ...fg.sync(path)], []);

function getAbsolutePath(value: string) {
return path.dirname(require.resolve(path.join(value, 'package.json')));
return path.dirname(nodeRequire.resolve(path.join(value, 'package.json')));
}

function getStoryPaths(fileName: string | number = '*') {
Expand Down