-
Notifications
You must be signed in to change notification settings - Fork 76
Description
Affected design types
- figma
- figspec
- link
- image
- iframe
Describe the bug
As of the latest version (10.0.1 ATTOW), type definitions provided for the config specify accessToken as a required property when using the figspec parameter type:
interface FigspecConfig extends ConfigBase {
type: "figspec" | "experimental-figspec";
url: string;
accessToken: string;
}While the token is needed, it's possible to provide the token via the STORYBOOK_FIGMA_ACCESS_TOKEN environment variable as per the addon's docs (confirmed working as expected), which makes explictly providing accessToken via the config unnecessary:
Given the above, the interface should mark the accessToken property as optional and provide a JSDoc note that if not provided, the STORYBOOK_FIGMA_ACCESS_TOKEN must be set:
interface FigspecConfig extends ConfigBase {
type: "figspec" | "experimental-figspec";
url: string;
/**
* Figma Personal Access Token required for Figma's REST API.
* If not provided, `STORYBOOK_FIGMA_ACCESS_TOKEN` environment variable must be set
*/
accessToken?: string;
}How to reproduce the bug?
Reproducible by any project attempting to use a config satisfying the FigspecConfig interface's shape.
Example TypeScript playground: https://tsplay.dev/NrkJ0m
Can set up a reproduction repository if need be, but it seems like an overkill for the issue at hand
Expected behaviour
accessToken to be an optional property of the FigspecConfig interface
Environment
- Chrome / Chromium / Chromium based browsers
- Firefox
- macOS Safari
- iOS Safari
- Samsung Internet
- Other
Affected versions
10.0.1
Storybook versions
9.0.16