-
Notifications
You must be signed in to change notification settings - Fork 378
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: allow extension to register multiple publish targets #4424
Changes from all commits
f2a748c
25bb0b0
9eb2105
c123982
bc97e16
0c6b998
2be1649
3e74f01
6845241
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,12 +58,17 @@ export class ExtensionRegistration { | |
* Publish related features | ||
*************************************************************************************/ | ||
public async addPublishMethod(plugin: PublishPlugin) { | ||
log('registering publish method', this.name); | ||
this.context.extensions.publish[plugin.customName || this.name] = { | ||
if (this.context.extensions.publish[plugin.name]) { | ||
throw new Error(`Duplicate publish method. Cannot register publish method with name ${plugin.name}.`); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: if this is surfaced to the UI, maybe use formatMessage There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Couple of things:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As far as I've seen, messages that get thrown out to the console (like those inside exceptions) don't need to be localized. Only strings that get displayed to a normal user do. |
||
} | ||
|
||
log('registering publish method', plugin.name); | ||
this.context.extensions.publish[plugin.name] = { | ||
plugin: { | ||
name: plugin.customName || this.name, | ||
description: plugin.customDescription || this.description, | ||
name: plugin.name, | ||
description: plugin.description || this.description, | ||
instructions: plugin.instructions, | ||
extensionId: this.name, | ||
bundleId: plugin.bundleId, | ||
schema: plugin.schema, | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"printWidth": 120, | ||
"parser": "typescript", | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"endOfLine": "auto" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a dev dep right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This actually needs to be in the dependencies because we reference it in an exported type.