Skip to content

Commit da7ef34

Browse files
authored
fix(create-rslib): compatible with Storybook 10 (#1310)
1 parent 8bb2dcd commit da7ef34

File tree

16 files changed

+52
-0
lines changed
  • packages/create-rslib
    • fragments/tools
      • storybook-react-js/.storybook
      • storybook-react-ts/.storybook
      • storybook-vue-js/.storybook
      • storybook-vue-ts/.storybook
    • template-[react]-[rstest,storybook]-js/.storybook
    • template-[react]-[rstest,storybook]-ts/.storybook
    • template-[react]-[storybook,vitest]-js/.storybook
    • template-[react]-[storybook,vitest]-ts/.storybook
    • template-[react]-[storybook]-js/.storybook
    • template-[react]-[storybook]-ts/.storybook
    • template-[vue]-[rstest,storybook]-js/.storybook
    • template-[vue]-[rstest,storybook]-ts/.storybook
    • template-[vue]-[storybook,vitest]-js/.storybook
    • template-[vue]-[storybook,vitest]-ts/.storybook
    • template-[vue]-[storybook]-js/.storybook
    • template-[vue]-[storybook]-ts/.storybook

16 files changed

+52
-0
lines changed

packages/create-rslib/fragments/tools/storybook-react-js/.storybook/main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
import { createRequire } from 'node:module';
12
import { dirname, join } from 'node:path';
23

4+
const require = createRequire(import.meta.url);
5+
36
/**
47
* This function is used to resolve the absolute path of a package.
58
* It is needed in projects that use Yarn PnP or are set up within a monorepo.

packages/create-rslib/fragments/tools/storybook-react-ts/.storybook/main.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
import { createRequire } from 'node:module';
12
import { dirname, join } from 'node:path';
3+
4+
const require = createRequire(import.meta.url);
5+
26
import type { StorybookConfig } from 'storybook-react-rsbuild';
37

48
/**

packages/create-rslib/fragments/tools/storybook-vue-js/.storybook/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import { createRequire } from 'node:module';
12
import { dirname, join } from 'node:path';
23

4+
const require = createRequire(import.meta.url);
35
/**
46
* This function is used to resolve the absolute path of a package.
57
* It is needed in projects that use Yarn PnP or are set up within a monorepo.

packages/create-rslib/fragments/tools/storybook-vue-ts/.storybook/main.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
import { createRequire } from 'node:module';
12
import { dirname, join } from 'node:path';
3+
4+
const require = createRequire(import.meta.url);
5+
26
import type { StorybookConfig } from 'storybook-vue3-rsbuild';
37

48
/**

packages/create-rslib/template-[react]-[rstest,storybook]-js/.storybook/main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
import { createRequire } from 'node:module';
12
import { dirname, join } from 'node:path';
23

4+
const require = createRequire(import.meta.url);
5+
36
/**
47
* This function is used to resolve the absolute path of a package.
58
* It is needed in projects that use Yarn PnP or are set up within a monorepo.

packages/create-rslib/template-[react]-[rstest,storybook]-ts/.storybook/main.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
import { createRequire } from 'node:module';
12
import { dirname, join } from 'node:path';
3+
4+
const require = createRequire(import.meta.url);
5+
26
import type { StorybookConfig } from 'storybook-react-rsbuild';
37

48
/**

packages/create-rslib/template-[react]-[storybook,vitest]-js/.storybook/main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
import { createRequire } from 'node:module';
12
import { dirname, join } from 'node:path';
23

4+
const require = createRequire(import.meta.url);
5+
36
/**
47
* This function is used to resolve the absolute path of a package.
58
* It is needed in projects that use Yarn PnP or are set up within a monorepo.

packages/create-rslib/template-[react]-[storybook,vitest]-ts/.storybook/main.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
import { createRequire } from 'node:module';
12
import { dirname, join } from 'node:path';
3+
4+
const require = createRequire(import.meta.url);
5+
26
import type { StorybookConfig } from 'storybook-react-rsbuild';
37

48
/**

packages/create-rslib/template-[react]-[storybook]-js/.storybook/main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
import { createRequire } from 'node:module';
12
import { dirname, join } from 'node:path';
23

4+
const require = createRequire(import.meta.url);
5+
36
/**
47
* This function is used to resolve the absolute path of a package.
58
* It is needed in projects that use Yarn PnP or are set up within a monorepo.

packages/create-rslib/template-[react]-[storybook]-ts/.storybook/main.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
import { createRequire } from 'node:module';
12
import { dirname, join } from 'node:path';
3+
4+
const require = createRequire(import.meta.url);
5+
26
import type { StorybookConfig } from 'storybook-react-rsbuild';
37

48
/**

0 commit comments

Comments
 (0)