Skip to content

Commit

Permalink
Merge branch 'next' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
jonniebigodes authored Jul 7, 2023
2 parents c41bab2 + 40cb40e commit f3e6dd2
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 65 deletions.
14 changes: 3 additions & 11 deletions code/addons/docs/template/stories/toc/basic.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ export default {
},
};

export const One = {
args: { label: 'One' },
};

export const Two = {
args: { label: 'Two' },
};

export const Three = {
args: { label: 'Two' },
};
export const One = { args: { label: 'One' } };
export const Two = { args: { label: 'Two' } };
export const Three = { args: { label: 'Three' } };
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { global as globalThis } from '@storybook/global';
import { One, Two, Three } from './basic.stories';

export default {
component: globalThis.Components.Button,
Expand All @@ -11,4 +10,6 @@ export default {
},
};

export { One, Two, Three };
export const One = { args: { label: 'One' } };
export const Two = { args: { label: 'Two' } };
export const Three = { args: { label: 'Three' } };
5 changes: 3 additions & 2 deletions code/addons/docs/template/stories/toc/custom-title.stories.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { global as globalThis } from '@storybook/global';
import { One, Two, Three } from './basic.stories';

export default {
component: globalThis.Components.Button,
Expand All @@ -11,4 +10,6 @@ export default {
},
};

export { One, Two, Three };
export const One = { args: { label: 'One' } };
export const Two = { args: { label: 'Two' } };
export const Three = { args: { label: 'Three' } };
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { global as globalThis } from '@storybook/global';
import { One, Two, Three } from './basic.stories';

export default {
component: globalThis.Components.Button,
Expand All @@ -11,4 +10,6 @@ export default {
},
};

export { One, Two, Three };
export const One = { args: { label: 'One' } };
export const Two = { args: { label: 'Two' } };
export const Three = { args: { label: 'Three' } };
4 changes: 2 additions & 2 deletions code/lib/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
"@storybook/telemetry": "7.1.0-beta.1",
"@storybook/types": "7.1.0-beta.1",
"@types/semver": "^7.3.4",
"@yarnpkg/fslib": "3.0.0-rc.46",
"@yarnpkg/libzip": "3.0.0-rc.46",
"@yarnpkg/fslib": "2.10.3",
"@yarnpkg/libzip": "2.3.0",
"chalk": "^4.1.0",
"commander": "^6.2.1",
"cross-spawn": "^7.0.3",
Expand Down
16 changes: 6 additions & 10 deletions code/lib/cli/src/js-package-manager/Yarn2Proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import dedent from 'ts-dedent';
import { sync as findUpSync, sync as syncFindUp } from 'find-up';
import { existsSync, readFileSync } from 'fs';
import path from 'path';
import { PosixFS } from '@yarnpkg/fslib';
import { getLibzipSync, ZipOpenFS } from '@yarnpkg/libzip';
import { PosixFS, VirtualFS, ZipOpenFS } from '@yarnpkg/fslib';
import { getLibzipSync } from '@yarnpkg/libzip';
import semver from 'semver';
import { createLogStream } from '../utils';
import { JsPackageManager } from './JsPackageManager';
Expand Down Expand Up @@ -142,16 +142,12 @@ export class Yarn2Proxy extends JsPackageManager {
libzip: getLibzipSync(),
});

const crossFs = new PosixFS(zipOpenFs);
const virtualFs = new VirtualFS({ baseFs: zipOpenFs });
const crossFs = new PosixFS(virtualFs);

// On Windows "crossFs.readJsonSync" does not resolve virtual paths. Unknown bug
if (process.platform === 'win32' && !!pnpApi.VERSIONS.resolveVirtual) {
const virtualPath = path.join(pkg.packageLocation, 'package.json');
const physicalPath = pnpApi.resolveVirtual(virtualPath);
return crossFs.readJsonSync(physicalPath);
}
const virtualPath = path.join(pkg.packageLocation, 'package.json');

return crossFs.readJsonSync(path.join(pkg.packageLocation, 'package.json') as any);
return crossFs.readJsonSync(virtualPath);
} catch (error) {
if (error.code !== 'MODULE_NOT_FOUND') {
console.error('Error while fetching package version in Yarn PnP mode:', error);
Expand Down
39 changes: 14 additions & 25 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6001,8 +6001,8 @@ __metadata:
"@types/puppeteer-core": ^2.1.0
"@types/semver": ^7.3.4
"@types/util-deprecate": ^1.0.0
"@yarnpkg/fslib": 3.0.0-rc.46
"@yarnpkg/libzip": 3.0.0-rc.46
"@yarnpkg/fslib": 2.10.3
"@yarnpkg/libzip": 2.3.0
boxen: ^5.1.2
chalk: ^4.1.0
commander: ^6.2.1
Expand Down Expand Up @@ -9717,34 +9717,23 @@ __metadata:
languageName: node
linkType: hard

"@yarnpkg/fslib@npm:3.0.0-rc.46":
version: 3.0.0-rc.46
resolution: "@yarnpkg/fslib@npm:3.0.0-rc.46"
"@yarnpkg/fslib@npm:2.10.3":
version: 2.10.3
resolution: "@yarnpkg/fslib@npm:2.10.3"
dependencies:
tslib: ^2.4.0
checksum: 6b768a511ef65fe2d503580bc5e1b8810c61b0e37b05672f4dcfcdca4c9f515bd08cb26f269f65a56efe6f3ebdba26489f8ac09e4882aa58d3eede50ee472fdc
"@yarnpkg/libzip": ^2.3.0
tslib: ^1.13.0
checksum: c4fbbed99e801f17c381204e9699d9ea4fb51b14e99968985f477bdbc7b02b61e026860173f3f46bd60d9f46ae6a06f420a3edb3c02c3a45ae83779095928094
languageName: node
linkType: hard

"@yarnpkg/fslib@npm:^3.0.0-rc.46":
version: 3.0.0-rc.48
resolution: "@yarnpkg/fslib@npm:3.0.0-rc.48"
dependencies:
tslib: ^2.4.0
checksum: e4c8f640f002047efe915e656537f7057f39de9276ccef602289c9968a5b257ba3f78e8face02f17a28e9e28f055c8c8b64f4f29558c9c6bc0318029cb8c027b
languageName: node
linkType: hard

"@yarnpkg/libzip@npm:3.0.0-rc.46":
version: 3.0.0-rc.46
resolution: "@yarnpkg/libzip@npm:3.0.0-rc.46"
"@yarnpkg/libzip@npm:2.3.0, @yarnpkg/libzip@npm:^2.3.0":
version: 2.3.0
resolution: "@yarnpkg/libzip@npm:2.3.0"
dependencies:
"@types/emscripten": ^1.39.6
"@yarnpkg/fslib": ^3.0.0-rc.46
tslib: ^2.4.0
peerDependencies:
"@yarnpkg/fslib": ^3.0.0-rc.46
checksum: 6217994646e25d64a04e8ad34693fdadeee57979bb61f44031537758950206219c3e201f9c7d6fa724296dcfa2e26072289cb00e5d8bb7232176eea8e2b87841
tslib: ^1.13.0
checksum: 0c2361ccb002e28463ed98541f3bdaab54f52aad6a2080666c2a9ea605ebd9cdfb7b0340b1db6f105820d05bcb803cdfb3ce755a8f6034657298c291bf884f81
languageName: node
linkType: hard

Expand Down Expand Up @@ -29518,7 +29507,7 @@ __metadata:
languageName: node
linkType: hard

"tslib@npm:^1.10.0, tslib@npm:^1.8.1, tslib@npm:^1.9.0, tslib@npm:^1.9.3":
"tslib@npm:^1.10.0, tslib@npm:^1.13.0, tslib@npm:^1.8.1, tslib@npm:^1.9.0, tslib@npm:^1.9.3":
version: 1.14.1
resolution: "tslib@npm:1.14.1"
checksum: 69ae09c49eea644bc5ebe1bca4fa4cc2c82b7b3e02f43b84bd891504edf66dbc6b2ec0eef31a957042de2269139e4acff911e6d186a258fb14069cd7f6febce2
Expand Down
7 changes: 1 addition & 6 deletions docs/sharing/design-integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,14 @@ Run the following command to install the addon.

<!-- prettier-ignore-end -->

<div class="aside">

ℹ️ This addon is still being converted to fully support Storybook 7.0. If you're adding this addon to a Storybook 7.0 instance or migrating from a previous version, you must install the `beta` version.

</div>

Update your Storybook configuration (in `.storybook/main.js|ts`) to include the addon.

<!-- prettier-ignore-start -->

<CodeSnippets
paths={[
'common/storybook-main-figma-addon-register.js.mdx',
'common/storybook-main-figma-addon-register.ts.mdx',
]}
/>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
```shell
npm install --save-dev storybook-addon-designs@beta
npm install --save-dev @storybook/addon-designs
```
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
```shell
pnpm add --save-dev storybook-addon-designs@beta
pnpm add --save-dev @storybook/addon-designs
```
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
```shell
yarn add --dev storybook-addon-designs@beta
yarn add --dev @storybook/addon-designs
```
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
```js
// .storybook/main.js|ts
// .storybook/main.js

export default {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
// Other Storybook addons
'storybook-addon-designs', // 👈 Addon is registered here
'@storybook/addon-designs', // 👈 Addon is registered here
],
};
```
17 changes: 17 additions & 0 deletions docs/snippets/common/storybook-main-figma-addon-register.ts.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```ts
// .storybook/main.ts

// Replace your-framework with the framework you are using (e.g., react-webpack5, vue3-vite)
import type { StorybookConfig } from '@storybook/your-framework';

const config: StorybookConfig = {
framework: '@storybook/your-framework',
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
// Other Storybook addons
'@storybook/addon-designs', // 👈 Addon is registered here
],
};

export default config;
```

0 comments on commit f3e6dd2

Please sign in to comment.