I have looked at the the ASP.Net 5 teams wiki entry for project.json, to identify which Script Commands are available, and currently the following are listed:
{
"scripts": {
"prebuild": "echo before building",
"postbuild": "echo after building",
"prepack": "echo before packing",
"postpack": "echo after packing",
"prerestore": "echo before restoring packages",
"postrestore": "echo after restoring packages"
}
}
These are straightforward, and easy to understand; however in Visual Studio, only prerestore and postrestore events seem to actually fire. Prebuild and postbuild do not.
The default (beta 6) Visual Studio 2015 template adds the following Script Command, which is not on the official list:
"scripts": {
"prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ]
}
Additionally, there seem to be other, undocumented commands, I inherited these from a sample project created by a colleague:
"scripts": {
"first-run": "npm install -g gulp bower && npm run update",
"prepare": [ "npm install && npm prune && bower install && bower prune && gulp default" ],
"prepublish": [ "npm install", "bower install", "gulp default" ],
"update": "npm install && npm prune && bower install && bower prune"
}
These seem to work (they execute), but my colleague and I am unable to find documentation to explain:
- If they are valid, or deprecated.
- If they are specific to Visual Studio (I believe prepublish is only for Visual Studio)
- Exactly when they are executed, and how they are recognised by Visual Studio (the names seem obvious, but I prefer to be certain).
To confuse matters further, Visual Studio 2015 intellisense shows other commands which are not in the official list:
Is there a list of valid project.json Script Commands, their usage, etc., especially for Visual Studio 2015?