From 515f8df0268f65068c707a91ece7a67e101684ba Mon Sep 17 00:00:00 2001 From: Josh Garverick Date: Mon, 17 Oct 2016 22:06:37 -0400 Subject: [PATCH] Adding gitignore, tfignore files to exclude settings.tfx.json; updated require statement; updated readme --- VSTSBuildTask/.gitignore | 239 ++++++++++++++++++ VSTSBuildTask/.tfignore | 239 ++++++++++++++++++ VSTSBuildTask/ProjectTemplate.csproj | 2 + VSTSBuildTask/VSOBuildTask.vstemplate | 2 + VSTSBuildTask/VSTSBuildTask.csproj | 6 + VSTSBuildTask/readme.md | 1 + VSTSExt/.gitignore | 239 ++++++++++++++++++ VSTSExt/.tfignore | 239 ++++++++++++++++++ VSTSExt/ProjectTemplateTS.vstemplate | 2 + VSTSExt/VSTSExt.csproj | 6 + VSTSExt/VSTSExtension.csproj | 2 + VSTSExt/index.html | 2 +- VSTSExt/readme.md | 1 + VSTSExt/scripts/VSS.SDK.js | 222 ++++++++++++++-- .../Properties/AssemblyInfo.cs | 4 +- VSTSExtensionPackage/ReleaseNotes.txt | 1 + .../source.extension.vsixmanifest | 2 +- 17 files changed, 1181 insertions(+), 28 deletions(-) create mode 100644 VSTSBuildTask/.gitignore create mode 100644 VSTSBuildTask/.tfignore create mode 100644 VSTSExt/.gitignore create mode 100644 VSTSExt/.tfignore diff --git a/VSTSBuildTask/.gitignore b/VSTSBuildTask/.gitignore new file mode 100644 index 0000000..722f564 --- /dev/null +++ b/VSTSBuildTask/.gitignore @@ -0,0 +1,239 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# Ignore the settings file +**/settings.tfx.json + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Microsoft Azure ApplicationInsights config file +ApplicationInsights.config + +# Windows Store app package directory +AppPackages/ +BundleArtifacts/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe + +# FAKE - F# Make +.fake/ \ No newline at end of file diff --git a/VSTSBuildTask/.tfignore b/VSTSBuildTask/.tfignore new file mode 100644 index 0000000..722f564 --- /dev/null +++ b/VSTSBuildTask/.tfignore @@ -0,0 +1,239 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# Ignore the settings file +**/settings.tfx.json + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Microsoft Azure ApplicationInsights config file +ApplicationInsights.config + +# Windows Store app package directory +AppPackages/ +BundleArtifacts/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe + +# FAKE - F# Make +.fake/ \ No newline at end of file diff --git a/VSTSBuildTask/ProjectTemplate.csproj b/VSTSBuildTask/ProjectTemplate.csproj index d8d6d19..dd39654 100644 --- a/VSTSBuildTask/ProjectTemplate.csproj +++ b/VSTSBuildTask/ProjectTemplate.csproj @@ -40,6 +40,8 @@ + + diff --git a/VSTSBuildTask/VSOBuildTask.vstemplate b/VSTSBuildTask/VSOBuildTask.vstemplate index 781755f..c0fa88b 100644 --- a/VSTSBuildTask/VSOBuildTask.vstemplate +++ b/VSTSBuildTask/VSOBuildTask.vstemplate @@ -18,6 +18,8 @@ AssemblyInfo.cs gruntfile.js package.json + .gitignore + .tfignore vss-extension.json settings.tfx.json diff --git a/VSTSBuildTask/VSTSBuildTask.csproj b/VSTSBuildTask/VSTSBuildTask.csproj index 5b7f820..be4c3b3 100644 --- a/VSTSBuildTask/VSTSBuildTask.csproj +++ b/VSTSBuildTask/VSTSBuildTask.csproj @@ -76,6 +76,9 @@ + + true + @@ -94,6 +97,9 @@ + + true + diff --git a/VSTSBuildTask/readme.md b/VSTSBuildTask/readme.md index f56f6ef..8079278 100644 --- a/VSTSBuildTask/readme.md +++ b/VSTSBuildTask/readme.md @@ -9,6 +9,7 @@ - A `gruntfile.js` file to leverage GruntJS for running the `tfx` package and publish commands - A sample logo file (replace this with the logo you wish to use for your extension) - A sample Jasmine spec file (`test/TestSpec.js`) to help get you started with the Jasmine testing framework (special thanks to [Niel Zeeman](http://blogs.msdn.com/b/willy-peter_schaub/archive/2013/11/01/introducing-the-visual-studio-alm-rangers-niel-zeeman.aspx)) +- `tfignore` and `gitignore` files that you can use to exclude the `settings.tfx.json` settings file. This will safeguard you against accidentally checking in your personal access token or other sensitive VS Marketplace credentials. ####If you run into any issues with the version of Node that is installed with the Node.js Tools for Visual Studio, you can change the path to Node by going into Tools -> Options -> Projects and Solutions -> External Web Tools. diff --git a/VSTSExt/.gitignore b/VSTSExt/.gitignore new file mode 100644 index 0000000..722f564 --- /dev/null +++ b/VSTSExt/.gitignore @@ -0,0 +1,239 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# Ignore the settings file +**/settings.tfx.json + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Microsoft Azure ApplicationInsights config file +ApplicationInsights.config + +# Windows Store app package directory +AppPackages/ +BundleArtifacts/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe + +# FAKE - F# Make +.fake/ \ No newline at end of file diff --git a/VSTSExt/.tfignore b/VSTSExt/.tfignore new file mode 100644 index 0000000..722f564 --- /dev/null +++ b/VSTSExt/.tfignore @@ -0,0 +1,239 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# Ignore the settings file +**/settings.tfx.json + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Microsoft Azure ApplicationInsights config file +ApplicationInsights.config + +# Windows Store app package directory +AppPackages/ +BundleArtifacts/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe + +# FAKE - F# Make +.fake/ \ No newline at end of file diff --git a/VSTSExt/ProjectTemplateTS.vstemplate b/VSTSExt/ProjectTemplateTS.vstemplate index 4a246f5..e4e2055 100644 --- a/VSTSExt/ProjectTemplateTS.vstemplate +++ b/VSTSExt/ProjectTemplateTS.vstemplate @@ -19,6 +19,8 @@ index.html package.json settings.tfx.json + .gitignore + .tfignore gruntfile.js tasks.json diff --git a/VSTSExt/VSTSExt.csproj b/VSTSExt/VSTSExt.csproj index cc01b20..d635eee 100644 --- a/VSTSExt/VSTSExt.csproj +++ b/VSTSExt/VSTSExt.csproj @@ -69,6 +69,9 @@ + + true + @@ -97,6 +100,9 @@ + + true + diff --git a/VSTSExt/VSTSExtension.csproj b/VSTSExt/VSTSExtension.csproj index f4b3257..7bfdbd2 100644 --- a/VSTSExt/VSTSExtension.csproj +++ b/VSTSExt/VSTSExtension.csproj @@ -51,6 +51,8 @@ + + diff --git a/VSTSExt/index.html b/VSTSExt/index.html index 7fee67f..f6d9703 100644 --- a/VSTSExt/index.html +++ b/VSTSExt/index.html @@ -39,7 +39,7 @@ // Wait for the SDK to be initialized VSS.ready(function () { - require(["Scripts/app"], function (app) { }); + VSS.require(["Scripts/app"], function (app) { }); }); diff --git a/VSTSExt/readme.md b/VSTSExt/readme.md index 2690903..ce536bd 100644 --- a/VSTSExt/readme.md +++ b/VSTSExt/readme.md @@ -9,6 +9,7 @@ - An app.ts TypeScript file, which gives you a very simple timekeeping module - A sample logo file (replace this with the logo you wish to use for your extension) - A sample Jasmine spec file (`test/TestSpec.js`) to help get you started with the Jasmine testing framework (special thanks to [Niel Zeeman](http://blogs.msdn.com/b/willy-peter_schaub/archive/2013/11/01/introducing-the-visual-studio-alm-rangers-niel-zeeman.aspx)) +- `tfignore` and `gitignore` files that you can use to exclude the `settings.tfx.json` settings file. This will safeguard you against accidentally checking in your personal access token or other sensitive VS Marketplace credentials. This has been updated to be inline with the [M95](https://www.visualstudio.com/en-us/integrate/extensions/support/release-notes) release, which includes support for VSTS hosting of static content (.html,.css,.js) and the use of the tfx utility. diff --git a/VSTSExt/scripts/VSS.SDK.js b/VSTSExt/scripts/VSS.SDK.js index 57c9fa4..f1ddba7 100644 --- a/VSTSExt/scripts/VSS.SDK.js +++ b/VSTSExt/scripts/VSS.SDK.js @@ -1,6 +1,5 @@ -//---------------------------------------------------------- +//dependencies= // Copyright (C) Microsoft Corporation. All rights reserved. -//---------------------------------------------------------- /// /// /// @@ -128,7 +127,7 @@ var XDM; } }; return XdmDeferred; - })(); + }()); var smallestRandom = parseInt("10000000000", 36); var maxSafeInteger = Number.MAX_SAFE_INTEGER || 9007199254740991; /** @@ -175,7 +174,7 @@ var XDM; } }; return XDMObjectRegistry; - })(); + }()); XDM.XDMObjectRegistry = XDMObjectRegistry; ; /** @@ -585,7 +584,7 @@ var XDM; "jQuery" ]; return XDMChannel; - })(); + }()); XDM.XDMChannel = XDMChannel; /** * Registry of XDM channels kept per target frame/window @@ -661,13 +660,14 @@ var XDM; } }; return XDMChannelManager; - })(); + }()); XDM.XDMChannelManager = XDMChannelManager; })(XDM || (XDM = {})); var VSS; (function (VSS) { - VSS.VssSDKVersion = 0.1; - VSS.VssSDKRestVersion = "2.2"; + // W A R N I N G: if VssSDKVersion changes, the VSS WEB SDK demand resolver needs to be updated with the new version + VSS.VssSDKVersion = 2.0; + VSS.VssSDKRestVersion = "2.3"; var bodyElement; var webContext; var hostPageContext; @@ -681,6 +681,131 @@ var VSS; var isReady = false; var readyCallbacks; var parentChannel = XDM.XDMChannelManager.get().addChannel(window.parent); + var shimmedLocalStorage; + var hostReadyForShimUpdates = false; + var Storage = (function () { + var changeCallback; + function invokeChangeCallback() { + if (changeCallback) { + changeCallback.call(this); + } + } + function Storage(changeCallback) { + } + Object.defineProperties(Storage.prototype, { + getItem: { + get: function () { + return function (key) { + var item = this["" + key]; + return typeof item === "undefined" ? null : item; + }; + } + }, + setItem: { + get: function () { + return function (key, value) { + key = "" + key; + var existingValue = this[key]; + var newValue = "" + value; + if (existingValue !== newValue) { + this[key] = newValue; + invokeChangeCallback(); + } + }; + } + }, + removeItem: { + get: function () { + return function (key) { + key = "" + key; + if (typeof this[key] !== "undefined") { + delete this[key]; + invokeChangeCallback(); + } + }; + } + }, + clear: { + get: function () { + return function () { + var keys = Object.keys(this); + if (keys.length > 0) { + for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { + var key = keys_1[_i]; + delete this[key]; + } + invokeChangeCallback(); + } + }; + } + }, + key: { + get: function () { + return function (index) { + return Object.keys(this)[index]; + }; + } + }, + length: { + get: function () { + return Object.keys(this).length; + } + } + }); + return Storage; + }()); + function shimSandboxedProperties() { + var updateSettingsTimeout; + function updateShimmedStorageCallback() { + // Talk to the host frame on a 50 ms delay in order to batch storage/cookie updates + if (!updateSettingsTimeout) { + updateSettingsTimeout = setTimeout(function () { + updateSettingsTimeout = 0; + updateHostSandboxedStorage(); + }, 50); + } + } + // Override document.cookie if it is not available + var hasCookieSupport = false; + try { + hasCookieSupport = typeof document.cookie === "string"; + } + catch (ex) { + } + if (!hasCookieSupport) { + Object.defineProperty(Document.prototype, "cookie", { + get: function () { + return ""; + }, + set: function (value) { + } + }); + } + // Override browser storage + var hasLocalStorage = false; + try { + hasLocalStorage = !!window.localStorage; + } + catch (ex) { + } + if (!hasLocalStorage) { + delete window.localStorage; + shimmedLocalStorage = new Storage(updateShimmedStorageCallback); + Object.defineProperty(window, "localStorage", { value: shimmedLocalStorage }); + delete window.sessionStorage; + Object.defineProperty(window, "sessionStorage", { value: new Storage() }); + } + } + if (!window["__vssNoSandboxShim"]) { + try { + shimSandboxedProperties(); + } + catch (ex) { + if (window.console && window.console.warn) { + window.console.warn("Failed to shim support for sandboxed properties: " + ex.message + ". Set \"window.__vssNoSandboxShim = true\" in order to bypass the shim of sandboxed properties."); + } + } + } /** * Service Ids for core services (to be used in VSS.getService) */ @@ -715,7 +840,8 @@ var VSS; window.setTimeout(function () { var appHandshakeData = { notifyLoadSucceeded: !initOptions.explicitNotifyLoaded, - extensionReusedCallback: initOptions.extensionReusedCallback + extensionReusedCallback: initOptions.extensionReusedCallback, + vssSDKVersion: VSS.VssSDKVersion }; parentChannel.invokeRemoteMethod("initialHandshake", "VSS.HostControl", [appHandshakeData]).then(function (handshakeData) { hostPageContext = handshakeData.pageContext; @@ -723,6 +849,37 @@ var VSS; initialConfiguration = handshakeData.initialConfig || {}; initialContribution = handshakeData.contribution; extensionContext = handshakeData.extensionContext; + if (handshakeData.sandboxedStorage) { + var updateNeeded = false; + if (shimmedLocalStorage) { + if (handshakeData.sandboxedStorage.localStorage) { + // Merge host data in with any values already set. + var newData = handshakeData.sandboxedStorage.localStorage; + // Check for any properties written prior to the initial handshake + for (var _i = 0, _a = Object.keys(shimmedLocalStorage); _i < _a.length; _i++) { + var key = _a[_i]; + var value = shimmedLocalStorage.getItem(key); + if (value !== newData[key]) { + newData[key] = value; + updateNeeded = true; + } + } + // Update the stored values + for (var _b = 0, _c = Object.keys(newData); _b < _c.length; _b++) { + var key = _c[_b]; + shimmedLocalStorage.setItem(key, newData[key]); + } + } + else if (shimmedLocalStorage.length > 0) { + updateNeeded = true; + } + } + hostReadyForShimUpdates = true; + if (updateNeeded) { + // Talk to host frame to issue update + updateHostSandboxedStorage(); + } + } if (usingPlatformScripts || usingPlatformStyles) { setupAmdLoader(); } @@ -733,6 +890,12 @@ var VSS; }, 0); } VSS.init = init; + function updateHostSandboxedStorage() { + var storage = { + localStorage: JSON.stringify(shimmedLocalStorage || {}) + }; + parentChannel.invokeRemoteMethod("updateSandboxedStorage", "VSS.HostControl", [storage]); + } /** * Ensures that the AMD loader from the host is configured and fetches a script (AMD) module * (and its dependencies). If no callback is supplied, this will still perform an asynchronous @@ -783,9 +946,16 @@ var VSS; } VSS.require = require; function issueVssRequire(modules, callback) { - window.require(["VSS/Bundling"], function (VSS_Bundling) { - VSS_Bundling.requireModules(modules, callback); - }); + if (hostPageContext.diagnostics.bundlingEnabled) { + window.require(["VSS/Bundling"], function (VSS_Bundling) { + VSS_Bundling.requireModules(modules).spread(function () { + callback.apply(this, arguments); + }); + }); + } + else { + window.require(modules, callback); + } } /** * Register a callback that gets called once the initial setup/handshake has completed. @@ -852,16 +1022,16 @@ var VSS; * @param context Optional context information to use when obtaining the service instance */ function getService(contributionId, context) { - if (!context) { - context = {}; - } - if (!context["webContext"]) { - context["webContext"] = getWebContext(); - } - if (!context["extensionContext"]) { - context["extensionContext"] = getExtensionContext(); - } return getServiceContribution(contributionId).then(function (serviceContribution) { + if (!context) { + context = {}; + } + if (!context["webContext"]) { + context["webContext"] = getWebContext(); + } + if (!context["extensionContext"]) { + context["extensionContext"] = getExtensionContext(); + } return serviceContribution.getInstance(serviceContribution.id, context); }); } @@ -958,12 +1128,17 @@ var VSS; VSS.getAppToken = getAppToken; /** * Requests the parent window to resize the container for this extension based on the current extension size. + * + * @param width Optional width, defaults to scrollWidth + * @param height Optional height, defaults to scrollHeight */ - function resize() { + function resize(width, height) { if (!bodyElement) { bodyElement = document.getElementsByTagName("body").item(0); } - parentChannel.invokeRemoteMethod("resize", "VSS.HostControl", [bodyElement.scrollWidth, bodyElement.scrollHeight]); + var newWidth = typeof width === "number" ? width : bodyElement.scrollWidth; + var newHeight = typeof height === "number" ? height : bodyElement.scrollHeight; + parentChannel.invokeRemoteMethod("resize", "VSS.HostControl", [newWidth, newHeight]); } VSS.resize = resize; function setupAmdLoader() { @@ -1210,4 +1385,3 @@ var VSS; } } })(VSS || (VSS = {})); -//dependencies= diff --git a/VSTSExtensionPackage/Properties/AssemblyInfo.cs b/VSTSExtensionPackage/Properties/AssemblyInfo.cs index 9dc03ce..2af4c1e 100644 --- a/VSTSExtensionPackage/Properties/AssemblyInfo.cs +++ b/VSTSExtensionPackage/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ // 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("2.0.0.0")] -[assembly: AssemblyFileVersion("2.0.0.0")] +[assembly: AssemblyVersion("2.6.0.0")] +[assembly: AssemblyFileVersion("2.6.0.0")] diff --git a/VSTSExtensionPackage/ReleaseNotes.txt b/VSTSExtensionPackage/ReleaseNotes.txt index 66d9759..ae13b0d 100644 --- a/VSTSExtensionPackage/ReleaseNotes.txt +++ b/VSTSExtensionPackage/ReleaseNotes.txt @@ -1,6 +1,7 @@ Release Notes ============= +* Version 2.6: Added TF and Git ignore files (Jesse Houwing); fixed issue with require (changed to VSS.require, thanks Colin Dembovsky for the catch) * Version 2.5: Changed PowerShell execution to PowerShell3 in task.json; included vsts-task-sdk in Build/Release Task template; added Trace-VstsEnteringInvocation and Trace-VstsExitingInvocation to example task PowerShell scripts; added d.ts for RequireJS; updated versions for Grunt, Jasmine (Thanks to David Corbin for testing and Max Knor for update suggestions) * Version 2.4: Added dashboard widget item template * Version 2.3.1: Fixed typo in parameter in gruntfile diff --git a/VSTSExtensionPackage/source.extension.vsixmanifest b/VSTSExtensionPackage/source.extension.vsixmanifest index 82a94d5..838eeba 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