Skip to content

Conversation

@bworline
Copy link
Contributor

@bworline bworline commented Apr 8, 2020

This PR adds support for webpack-like configuration of the manifest file by giving the option to provide a manifest js file instead of a manifest json file.

From the updated documentation:
"Use the --manifest-js option to supply a Node.JS CommonJS module and export a function. The function will be invoked with an environment property bag as a parameter, and must return the manifest JSON object. Environment variables for the property bag are specified with the --env command line parameter. These are space separated key-value pairs, e.g. --env mode=production rootpath="c:\program files" size=large."

This can address scenarios described by the following issues. Fixes #161, Fixes #258.

An example manifest JS file might look like the following. It's inspired by David Hathaway's article on Streamlining Azure DevOps extension development but allows combining the development and release configs.

module.exports = (env) => {
	let [idPostfix, namePostfix] = (env.mode == "development") ? ["-dev", " [DEV]"] : ["", ""];
	let manifest = {
		manifestVersion: 1,
		id: `myextensionidentifier${idPostfix}`,
		name: `My Great Extension${namePostfix}`,
		...
		contributions: [
			{
				id: "mywidgetidentifier",
				properties: {
					name: `Super Widget${namePostfix}`,
					...
				},
				...
			}
		]
	}
	if (env.mode == 'development') {
		manifest.baseUri = "https://localhost:3000";
	}
	return manifest;
}

@bworline
Copy link
Contributor Author

bworline commented Apr 8, 2020

@bworline
Copy link
Contributor Author

bworline commented Sep 2, 2020

@stephenmichaelf are you able to look at this PR? If not, can you point me to someone who can?

@jtpetty
Copy link
Contributor

jtpetty commented Sep 17, 2020

@stephenmichaelf - Can you review this PR?

@bworline
Copy link
Contributor Author

@dwilsonactual can you merge this PR? I don't have write access.

@bworline bworline requested a review from dwilsonactual April 2, 2021 20:21
@dwilsonactual dwilsonactual merged commit 16728c5 into microsoft:master Apr 7, 2021
@jessehouwing
Copy link
Contributor

jessehouwing commented Apr 7, 2021

I don't see how this closes #92. It doesn't seem to process the task.json in each build task extension...

@bworline
Copy link
Contributor Author

bworline commented Apr 7, 2021

I don't see how this closes #92. It doesn't seem to process the task.json in each build task extension...

Ah, you are correct. I'd confused manifest.json with task.json. I've removed the link to #92.

@jessehouwing
Copy link
Contributor

Would love that functionality though :). There are ways the manifests interact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for build number outside of the vss-extension.json Suggestion: When --extension-id is passed, update it everywhere in the manifest

5 participants