Skip to content

Commit

Permalink
Package manager: rename runtime plugins setting to components (micros…
Browse files Browse the repository at this point in the history
…oft#6580)

Co-authored-by: Ben Yackley <[email protected]>
Co-authored-by: Chris Whitten <[email protected]>
  • Loading branch information
3 people authored Mar 31, 2021
1 parent 562d6b7 commit fc23120
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions extensions/packageManager/src/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,19 +316,19 @@ export default async (composer: IExtensionRegistration): Promise<void> => {
runtimeLanguage = 'js';
}

// update the settings.plugins array
// update the settings.components array
const newlyInstalledPlugin = installedComponents.find((c) => hasSchema(c) && c.name == packageName);
if (
newlyInstalledPlugin &&
!currentProject.settings.runtimeSettings?.plugins?.find((p) => p.name === newlyInstalledPlugin.name)
!currentProject.settings.runtimeSettings?.components?.find((p) => p.name === newlyInstalledPlugin.name)
) {
const newSettings = currentProject.settings;
if (!newSettings.runtimeSettings) {
newSettings.runtimeSettings = {
plugins: [],
components: [],
};
}
newSettings.runtimeSettings.plugins.push({
newSettings.runtimeSettings.components.push({
name: newlyInstalledPlugin.name,
settingsPrefix: newlyInstalledPlugin.name,
});
Expand Down Expand Up @@ -409,10 +409,10 @@ export default async (composer: IExtensionRegistration): Promise<void> => {
components: mergeResults.components.filter(isAdaptiveComponent),
});

// update the settings.plugins array
if (currentProject.settings.runtimeSettings?.plugins?.find((p) => p.name === packageName)) {
// update the settings.components array
if (currentProject.settings.runtimeSettings?.components?.find((p) => p.name === packageName)) {
const newSettings = currentProject.settings;
newSettings.runtimeSettings.plugins = newSettings.runtimeSettings.plugins.filter(
newSettings.runtimeSettings.components = newSettings.runtimeSettings.components.filter(
(p) => p.name !== packageName
);
currentProject.updateEnvSettings(newSettings);
Expand Down

0 comments on commit fc23120

Please sign in to comment.