Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix loading of extensions by removing sample-ui-plugin #4251

Merged
merged 2 commits into from
Sep 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Composer/packages/extension/src/manager/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,15 @@ class ExtensionManager {
const extensionInstallPath = path.dirname(fullPath);
const packageJson = (await readJson(fullPath)) as PackageJSON;
const isEnabled = packageJson?.composer && packageJson.composer.enabled !== false;
const metadata = getExtensionMetadata(extensionInstallPath, packageJson);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this moved out of the if statement if the else if does not contain any reference to metadata?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. I had a version where I was just disabling the extension but setting the other metadata fields. I felt like removing the extension is better but forgot to move this back.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can just move it back on some other PR

if (packageJson && (isEnabled || packageJson.extendsComposer === true)) {
const metadata = getExtensionMetadata(extensionInstallPath, packageJson);
this.manifest.updateExtensionConfig(packageJson.name, {
...metadata,
builtIn: true,
});
} else if (this.manifest.getExtensionConfig(packageJson.name)) {
// remove the extension if it exists in the manifest
this.manifest.removeExtension(packageJson.name);
}
}
}
Expand Down