Skip to content

Commit

Permalink
Merge pull request #29558 from storybookjs/yann/fix-typescript-issues
Browse files Browse the repository at this point in the history
Build: Fix type issues
  • Loading branch information
yannbf authored Nov 7, 2024
2 parents 07ef408 + 9ed9d72 commit 341695c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion code/addons/backgrounds/src/components/Tool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const Pure = memo(function PureTool(props: PureProps) {
onHide();
},
})),
]}
].flat()}
/>
);
}}
Expand Down
2 changes: 1 addition & 1 deletion code/addons/viewport/src/components/Tool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const Pure = React.memo(function PureTool(props: PureProps) {
onHide();
},
})),
]}
].flat()}
/>
)}
closeOnOutsideClick
Expand Down
8 changes: 5 additions & 3 deletions scripts/prepare/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ export const nodeInternals = [
...require('module').builtinModules.flatMap((m: string) => [m, `node:${m}`]),
];

export const getWorkspace = async () => {
type PackageJson = typefest.PackageJson &
Required<Pick<typefest.PackageJson, 'name' | 'version'>> & { path: string };

export const getWorkspace = async (): Promise<PackageJson[]> => {
const codePackage = await readJson(join(CODE_DIRECTORY, 'package.json'));
const {
workspaces: { packages: patterns },
Expand All @@ -142,8 +145,7 @@ export const getWorkspace = async () => {
return null;
}
const pkg = await readJson(packageJsonPath);
return { ...pkg, path: packagePath } as typefest.PackageJson &
Required<Pick<typefest.PackageJson, 'name' | 'version'>> & { path: string };
return { ...pkg, path: packagePath } as PackageJson;
})
).then((packages) => packages.filter((p) => p !== null));
};

0 comments on commit 341695c

Please sign in to comment.