diff --git a/DashboardWidgetItem/DashboardWidgetItem.csproj b/DashboardWidgetItem/DashboardWidgetItem.csproj new file mode 100644 index 0000000..4b1c504 --- /dev/null +++ b/DashboardWidgetItem/DashboardWidgetItem.csproj @@ -0,0 +1,112 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + 14.0 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + + Debug + AnyCPU + {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {DFEF12F9-B214-407B-9C83-1C9E9D274714} + Library + Properties + DashboardWidgetItem + DashboardWidgetItem + v4.5.2 + 512 + false + false + false + false + false + false + false + false + false + false + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + + + + + + + + + + + + Designer + + + + + + + + + + False + Microsoft .NET Framework 4.5.2 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + + + + + + + + \ No newline at end of file diff --git a/DashboardWidgetItem/DashboardWidgetItem.vstemplate b/DashboardWidgetItem/DashboardWidgetItem.vstemplate new file mode 100644 index 0000000..553851b --- /dev/null +++ b/DashboardWidgetItem/DashboardWidgetItem.vstemplate @@ -0,0 +1,21 @@ + + + + VSTS Custom Dashboard Widget + Creates a new dashboard widget for use with Visual Studio Team Services. + VSOE.ico + f0f3c850-3590-4ea7-9d4b-f22ff49fc8ee + CSharp + Web,JavaScript,TypeScript + 2.0 + 1 + DashboardWidgetItem + true + Enabled + true + + + widget.html + icon.png + + \ No newline at end of file diff --git a/DashboardWidgetItem/Properties/AssemblyInfo.cs b/DashboardWidgetItem/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..f16cff6 --- /dev/null +++ b/DashboardWidgetItem/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("DashboardWidgetItem")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Josh Garverick")] +[assembly: AssemblyProduct("DashboardWidgetItem")] +[assembly: AssemblyCopyright("Copyright © Josh Garverick 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("dfef12f9-b214-407b-9c83-1c9e9d274714")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/DashboardWidgetItem/VSOE.ico b/DashboardWidgetItem/VSOE.ico new file mode 100644 index 0000000..a9afee7 Binary files /dev/null and b/DashboardWidgetItem/VSOE.ico differ diff --git a/DashboardWidgetItem/icon.png b/DashboardWidgetItem/icon.png new file mode 100644 index 0000000..381d00d Binary files /dev/null and b/DashboardWidgetItem/icon.png differ diff --git a/DashboardWidgetItem/readme.md b/DashboardWidgetItem/readme.md new file mode 100644 index 0000000..71ed026 --- /dev/null +++ b/DashboardWidgetItem/readme.md @@ -0,0 +1 @@ +# VSTS Dashboard Widget Item Template \ No newline at end of file diff --git a/DashboardWidgetItem/widget.html b/DashboardWidgetItem/widget.html new file mode 100644 index 0000000..983c295 --- /dev/null +++ b/DashboardWidgetItem/widget.html @@ -0,0 +1,36 @@ + + + + + + $fileinputname$ Widget + + + + + + + + \ No newline at end of file diff --git a/VSTSBuildTask/VSTSBuildTask.csproj b/VSTSBuildTask/VSTSBuildTask.csproj index 3983dc5..5b7f820 100644 --- a/VSTSBuildTask/VSTSBuildTask.csproj +++ b/VSTSBuildTask/VSTSBuildTask.csproj @@ -95,7 +95,7 @@ - + diff --git a/VSTSBuildTask/package.json b/VSTSBuildTask/package.json index 61e7f18..de6ab6b 100644 --- a/VSTSBuildTask/package.json +++ b/VSTSBuildTask/package.json @@ -1,12 +1,13 @@ { "devDependencies": { - "grunt": "~0.4.5", - "grunt-contrib-copy": "~0.8.2", + "grunt": "^0.4.5", + "grunt-contrib-copy": "^0.8.2", "grunt-contrib-jasmine": "^0.9.2", - "grunt-exec": "~0.4.6", - "jasmine": "~2.3.2", + "grunt-exec": "^0.4.6", + "jasmine": "^2.4.1", "tfx-cli": "^0.3.15", - "vss-web-extension-sdk": "~1.95.2" + "tsd": "^0.6.5", + "vss-web-extension-sdk": "^1.98.0" }, "name": "", "private": true, diff --git a/VSTSExt/package.json b/VSTSExt/package.json index 2f5a000..de6ab6b 100644 --- a/VSTSExt/package.json +++ b/VSTSExt/package.json @@ -1,13 +1,13 @@ { "devDependencies": { - "grunt": "~0.4.5", - "grunt-contrib-copy": "~0.8.2", + "grunt": "^0.4.5", + "grunt-contrib-copy": "^0.8.2", "grunt-contrib-jasmine": "^0.9.2", - "grunt-exec": "~0.4.6", - "jasmine": "~2.3.2", + "grunt-exec": "^0.4.6", + "jasmine": "^2.4.1", "tfx-cli": "^0.3.15", - "tsd": "~0.6.5", - "vss-web-extension-sdk": "~1.95.2" + "tsd": "^0.6.5", + "vss-web-extension-sdk": "^1.98.0" }, "name": "", "private": true, diff --git a/VSTSExt/scripts/VSS.SDK.js b/VSTSExt/scripts/VSS.SDK.js index 1cfba3b..57c9fa4 100644 --- a/VSTSExt/scripts/VSS.SDK.js +++ b/VSTSExt/scripts/VSS.SDK.js @@ -367,6 +367,10 @@ var XDM; } return false; }; + XDMChannel.prototype.error = function (data, errorObj) { + var rpcMessage = data; + this._error(rpcMessage, errorObj, rpcMessage.handshakeToken); + }; XDMChannel.prototype._error = function (messageObj, errorObj, handshakeToken) { // Post back a response as an error which look like this - // {"id": "5", "error": {"code": -32601, "message": "Method not found."}, "jsonrpc": "2.0", } @@ -613,35 +617,32 @@ var XDM; var i, len, channel; var rpcMessage; if (typeof event.data === "string") { - // event.data may not be a valid JSON string, in which case JSON.parse would throw. try { rpcMessage = JSON.parse(event.data); } catch (error) { - if (window.console) { - console.error("JSON.parse failed for string: " + event.data); - } - } - } - else { - if (window.console) { - console.error("Expected event.data to be a string"); } } if (rpcMessage) { - var handled = false, channelOwnerFound = false; + var handled = false; + var channelOwner; for (i = 0, len = this._channels.length; i < len; i++) { channel = this._channels[i]; if (channel.owns(event.source, event.origin, rpcMessage)) { - // event belongs to this channel. Dispatch the message - channelOwnerFound = true; + // keep a reference to the channel owner found. + channelOwner = channel; handled = channel.onMessage(rpcMessage, event.origin) || handled; } } - if (channelOwnerFound && !handled) { + if (!!channelOwner && !handled) { if (window.console) { console.error("No handler found on any channel for message: " + JSON.stringify(rpcMessage)); } + // for instance based proxies, send an error on the channel owning the message to resolve any control creation promises + // on the host frame. + if (rpcMessage.instanceId) { + channelOwner.error(rpcMessage, "The registered object " + rpcMessage.instanceId + " could not be found."); + } } } }; @@ -739,7 +740,7 @@ var VSS; * * Usage: * - * VSS.require(["VSS/Controls", "VSS/Controls/Grids", function(Controls, Grids) { + * VSS.require(["VSS/Controls", "VSS/Controls/Grids"], function(Controls, Grids) { * ... * }); * @@ -760,7 +761,7 @@ var VSS; } if (loaderConfigured) { // Loader already configured, just issue require - window.require(modulesArray, callback); + issueVssRequire(modulesArray, callback); } else { if (!initOptions) { @@ -776,11 +777,16 @@ var VSS; } } ready(function () { - window.require(modulesArray, callback); + issueVssRequire(modulesArray, callback); }); } } VSS.require = require; + function issueVssRequire(modules, callback) { + window.require(["VSS/Bundling"], function (VSS_Bundling) { + VSS_Bundling.requireModules(modules, callback); + }); + } /** * Register a callback that gets called once the initial setup/handshake has completed. * If the initial setup is already completed, the callback is invoked at the end of the current call stack. @@ -1015,6 +1021,9 @@ var VSS; // we are free to add core bundle. otherwise, load core scripts individually. scripts = [{ source: getAbsoluteUrl(hostPageContext.coreReferences.coreScriptsBundle.url, hostRootUri) }]; } + if (hostPageContext.coreReferences.extensionCoreReferences) { + scripts.push({ source: getAbsoluteUrl(hostPageContext.coreReferences.extensionCoreReferences.url, hostRootUri) }); + } } // Define a new config for extension loader var newConfig = { @@ -1201,3 +1210,4 @@ var VSS; } } })(VSS || (VSS = {})); +//dependencies= diff --git a/VSTSExt/settings.tfx.json b/VSTSExt/settings.tfx.json new file mode 100644 index 0000000..eceb7cf --- /dev/null +++ b/VSTSExt/settings.tfx.json @@ -0,0 +1,11 @@ +{ + "serviceUrl": "https://your.visualstudio.com.account", + "package": { + "manifestGlobs": [ "vss-extension.json" ] + }, + "publish": { + "galleryUrl": "https://marketplace.visualstudio.com/", + "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "shareWith": "youraccount" + } +} diff --git a/VSTSExtensionPackage/ReleaseNotes.txt b/VSTSExtensionPackage/ReleaseNotes.txt index fc98c96..e9a1274 100644 --- a/VSTSExtensionPackage/ReleaseNotes.txt +++ b/VSTSExtensionPackage/ReleaseNotes.txt @@ -2,6 +2,7 @@ ============= * Version 2.4: Added dashboard widget item template +* Version 2.3.1: Fixed typo in parameter in gruntfile * Version 2.3: Added support for parameters with gruntfile * Version 2.2: Updating manifest for build extension to highlight specifics on task contributions; modified gruntfile to allow for task publish, extension package, and extension publish * Version 2.1.1: Fix for invalid syntax diff --git a/VSTSExtensionPackage/VSTSExtensionPackage.csproj b/VSTSExtensionPackage/VSTSExtensionPackage.csproj index 5799a6e..9bca1cd 100644 --- a/VSTSExtensionPackage/VSTSExtensionPackage.csproj +++ b/VSTSExtensionPackage/VSTSExtensionPackage.csproj @@ -74,6 +74,13 @@ false TemplateProjectOutputGroup%3b + + {dfef12f9-b214-407b-9c83-1c9e9d274714} + DashboardWidgetItem + ItemTemplates + false + TemplateProjectOutputGroup%3b + {AF0C49A0-8128-4ECF-8EC1-AB8CC7DAC69F} VSTSExt diff --git a/VSTSExtensionPackage/source.extension.vsixmanifest b/VSTSExtensionPackage/source.extension.vsixmanifest index 842c5bc..5304fd7 100644 --- a/VSTSExtensionPackage/source.extension.vsixmanifest +++ b/VSTSExtensionPackage/source.extension.vsixmanifest @@ -1,7 +1,7 @@ - + VSTS Extension Project Templates This extension contains Visual Studio project templates supplying you with everything you need to create a Visual Studio Team Services extension or a custom VSTS build/release task. https://github.com/jgarverick/vsts-ext-proj-templates @@ -26,5 +26,6 @@ + diff --git a/VstsExtProjTemplates.sln b/VstsExtProjTemplates.sln index 991dcab..f12f882 100644 --- a/VstsExtProjTemplates.sln +++ b/VstsExtProjTemplates.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +VisualStudioVersion = 14.0.25123.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VSTSExtensionPackage", "VSTSExtensionPackage\VSTSExtensionPackage.csproj", "{EC7CC6D8-04F1-4A5E-872D-72DF5967B7ED}" EndProject @@ -17,6 +17,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VSTSBuildTask", "VSTSBuildT EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BuildReleaseTaskItem", "BuildReleaseTaskItem\BuildReleaseTaskItem.csproj", "{2A0C632A-49DF-4C55-B591-094AD237755F}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DashboardWidgetItem", "DashboardWidgetItem\DashboardWidgetItem.csproj", "{DFEF12F9-B214-407B-9C83-1C9E9D274714}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -39,6 +41,10 @@ Global {2A0C632A-49DF-4C55-B591-094AD237755F}.Debug|Any CPU.Build.0 = Debug|Any CPU {2A0C632A-49DF-4C55-B591-094AD237755F}.Release|Any CPU.ActiveCfg = Release|Any CPU {2A0C632A-49DF-4C55-B591-094AD237755F}.Release|Any CPU.Build.0 = Release|Any CPU + {DFEF12F9-B214-407B-9C83-1C9E9D274714}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DFEF12F9-B214-407B-9C83-1C9E9D274714}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DFEF12F9-B214-407B-9C83-1C9E9D274714}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DFEF12F9-B214-407B-9C83-1C9E9D274714}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE