Skip to content

Commit

Permalink
record addons and/or builder as unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanKolnik committed Jun 2, 2023
1 parent b70d258 commit 82c84d8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bin-src/lib/getStorybookMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ const findViewlayer = async ({ env, log, options, packageJson }) => {
};

const findAddons = async (ctx, mainConfig, v7) => {
if (!mainConfig) {
return { addons: [{ name: 'unknown', packageName: 'unknown', packageVersion: '0' }] };
}

const addons = v7
? await Promise.all(
mainConfig.getSafeFieldValue(['addons']).map((addon) => resolvePackageJson(addon))
Expand Down Expand Up @@ -159,6 +163,10 @@ const findConfigFlags = async ({ options, packageJson }) => {
};

export const findBuilder = async (mainConfig, v7) => {
if (!mainConfig) {
return { builder: [{ name: 'unknown', packageVersion: '0' }] };
}

const framework = v7 ? mainConfig.getSafeFieldValue(['framework']) : mainConfig?.framework;
const core = v7 ? mainConfig.getSafeFieldValue(['core']) : mainConfig?.core;

Expand Down Expand Up @@ -203,7 +211,7 @@ export const getStorybookMetadata = async (ctx: Context) => {
mainConfig = await readConfig(mainConfigFilePath);
v7 = true;
} catch (storybookV7error) {
mainConfig = {};
mainConfig = null;
}
}

Expand Down

0 comments on commit 82c84d8

Please sign in to comment.