Skip to content

Commit

Permalink
[create-sitecore-jss] Incompatibility message when installing sxa and…
Browse files Browse the repository at this point in the history
… styleguide (#1315)

* Incompatibility message when installing sxa and styleguide

* add prompt warning
  • Loading branch information
art-alexeyenko authored Jan 31, 2023
1 parent c2cf761 commit 3b505d7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
transform,
DEFAULT_APPNAME,
ClientAppArgs,
incompatibleAddonsMsg,
} from '../../common';

export default class NextjsSxaInitializer implements Initializer {
Expand All @@ -28,6 +29,13 @@ export default class NextjsSxaInitializer implements Initializer {

await transform(templatePath, mergedArgs);

if (
args.templates.includes('nextjs-styleguide') ||
pkg.config?.templates?.includes('nextjs-styleguide')
) {
console.log(incompatibleAddonsMsg('nextjs-sxa', 'nextjs-styleguide'));
}

const response = {
// TODO: next steps
nextSteps: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,14 @@ export class NextjsCheckbox extends CheckboxPrompt {
isValid: incompatibleAddonsMsg('nextjs-styleguide-tracking', 'nextjs-personalize'),
});
}

const isSxaSelected = isSelected('nextjs-sxa');
const isStyleguideSelected = isSelected('nextjs-styleguide');

if (isSxaSelected && isStyleguideSelected) {
this.onError({
isValid: incompatibleAddonsMsg('nextjs-sxa', 'nextjs-styleguide'),
});
}
}
}

0 comments on commit 3b505d7

Please sign in to comment.