Skip to content

Commit

Permalink
Merge pull request #30462 from storybookjs/valentin/fix-local-angular…
Browse files Browse the repository at this point in the history
…-sandbox-generation

Build: Fix Angular sandbox generation in no-link mode
  • Loading branch information
valentinpalkovic authored Feb 5, 2025
2 parents 81268fe + b7c4b0b commit 05b3fac
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion code/core/src/manager-api/modules/stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ export const init: ModuleFn<SubAPI, SubState> = ({
return undefined;
}
if (refId) {
return refs[refId].index ? refs[refId].index[storyId] : undefined;
return refs?.[refId]?.index?.[storyId] ?? undefined;
}
return index ? index[storyId] : undefined;
},
Expand Down
2 changes: 1 addition & 1 deletion scripts/combine-compodoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async function run(cwd: string) {
const outputDir = await temporaryDirectory();
const resolvedDir = await realpath(dir);
await execaCommand(
`yarn compodoc ${resolvedDir} -p ./tsconfig.json -e json -d ${outputDir}`,
`yarn --cwd ${cwd} compodoc ${resolvedDir} -p ./tsconfig.json -e json -d ${outputDir}`,
{ cwd }
);
const contents = await readFile(join(outputDir, 'documentation.json'), 'utf8');
Expand Down
2 changes: 1 addition & 1 deletion scripts/tasks/sandbox-parts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ async function prepareAngularSandbox(cwd: string, templateName: string) {

packageJson.scripts = {
...packageJson.scripts,
'docs:json': 'DIR=$PWD; cd ../../scripts; jiti combine-compodoc $DIR',
'docs:json': 'DIR=$PWD; yarn --cwd ../../scripts jiti combine-compodoc $DIR',
storybook: `yarn docs:json && ${packageJson.scripts.storybook}`,
'build-storybook': `yarn docs:json && ${packageJson.scripts['build-storybook']}`,
};
Expand Down

0 comments on commit 05b3fac

Please sign in to comment.