vsts-extension-samples

Visual Studio Team Services的示例扩展。(Sample extensions for Visual Studio Team Services.)

Github stars Tracking Chart

Visual Studio Team Services(VSTS)示例扩展

Visual Studio Team Services(现在称为 Azure DevOps Services)更智能地计划、更好地协作和更快地交付。

样例可帮助您快速开始 Visual Studio Team Services(VSTS)扩展 的开发。

使用入门

如果您计划打包任何示例扩展程序,请获取:

  1. Node.js
  2. Team Foundation命令行界面( npm install -g tfx-cli )< LI>
  3. 如果扩展程序使用了bower(查找bower.json),请 Bower ( npm install -g bower 代码>)

如果您打算编译任何样本扩展,请获取:

  1. TypeScript( npm install -g typescript )

获取网络扩展SDK

每个Web扩展示例都有一个 bower.json 或 package.json 文件,它引用样本使用的第三方库,包括 Visual Studio Services Web Extension SDK 。所有网络扩展程序都需要此SDK JavaScript文件。

从示例的目录中运行:

如果存在一个bower.json文件

bower install

或者只有一个package.json文件存在

npm install

编译TypeScript样本

安装软件包后,只需运行 tsc 即可。您也可以运行 npm run build ,这可确保使用正确版本的TypeScript编译器。这也会生成扩展包。

在Visual Studio Team Services中尝试扩展

大多数示例都可以在 Visual Studio团队服务 上进行修改。步骤是:

  1. 创建免费的 Visual Studio Team Services帐户
  2. 创建一个 Visual Studio Marketplace发布者 (所有扩展程序都在发布者下上传)
  3. 验证扩展程序的清单文件( vss-extension.json )是否将 public 属性设置为 false 或未指定确保您的分机不会无意中提供给所有VSTS用户)
  4. 使用发布者的ID打包扩展(运行 tfx extension create --publisher MYPUBLISHERID )
  5. 将生成的.vsix文件上传到 市场
  6. 与您的VSTS帐户分享您的分机(右键单击已发布的分机并选择分享)
  7. 将扩展程序安装到帐户中(单击发布的扩展程序的标题,然后单击安装)

请参阅 完整说明

可用样本

贡献指南

查看您可以使用扩展程序扩展用户的网络体验的地方----正确地从网络体验中获得。

Build Inspector

了解高级扩展概念,如模块加载,使用UI控件,历史记录等。

注意:这个示例是用TypeScript写的。

UI

探索不同的UI控件,包括菜单,工具栏,自定义控件等。

公共活动(适用于团队日历)

团队日历扩展程序的自定义事件源用于公共假期。

构建结果增强器

这个扩展示例展示了如何使选项卡/部分对构建摘要页面做出贡献,并对构建更新做出反应。

这也有一个示例代码,允许用户呈现从构建中的特定任务上传的自定义数据结果。

您可以通过不同的方式为构建结果视图做出贡献:

  • 作为您自己为构建结果视图提供的任何贡献选项卡的一部分
  • 作为构建结果视图中现有“摘要”标签的一部分
  • 作为构建结果视图的选项卡

为我们自己的标签贡献一个标签和一个部分 -

作为“摘要”标签的一部分发布 -

这个样本是用TypeScript编写的。已编译的JS文件包含在/out目录中,但需要重新编译更改。打开readme.txt的说明。

发布管理扩展

部署状态增强器

安装此扩展程序后,它会显示每个环境部署状态的增强视图

行为准则

这个项目采用了 Microsoft开源行为准则。有关更多信息,请参阅 行为准则常见问题解答或联系 opencode@microsoft.com 以及任何其他问题或意见。

Main metrics

Overview
Name With Ownermicrosoft/vsts-extension-samples
Primary LanguageTypeScript
Program languageHTML (Language Count: 6)
PlatformCross-platform, Linux, Mac, Microsoft Azure, Windows
License:MIT License
所有者活动
Created At2015-04-23 14:20:31
Pushed At2024-01-17 22:11:10
Last Commit At2024-01-17 14:11:10
Release Count0
用户参与
Stargazers Count300
Watchers Count96
Fork Count287
Commits Count309
Has Issues Enabled
Issues Count59
Issue Open Count48
Pull Requests Count54
Pull Requests Open Count30
Pull Requests Close Count13
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

Visual Studio Team Services (VSTS) Sample Extensions

Samples to help jump-start your development of extensions for Visual Studio Team Services (VSTS).

Get started

If you plan to package any of the sample extensions, get:

  1. Node.js
  2. Team Foundation command line interface (npm install -g tfx-cli)
  3. If the extension uses bower (look for bower.json), Bower (npm install -g bower)

If you plan to compile any of the sample extensions, get:

  1. TypeScript (npm install -g typescript)

Get the web extension SDK

Each web extension sample has a bower.json or package.json file, which references third-party libraries used by the sample, including the Visual Studio Services Web Extension SDK. This SDK JavaScript file is required by all web extensions.

From the directory of the sample, run:

If there is a bower.json file present

bower install

or if there is only a package.json file present

npm install

Compile TypeScript Samples

Once the package is installed, simply run tsc. You can alternatively run npm run build, which ensures the correct version of the TypeScript compiler is used. This will also generate the extension package.

Try the extension in Visual Studio Team Services

Most samples can be run without any modifications on Visual Studio Team Services. The steps are:

  1. Create a free Visual Studio Team Services account
  2. Create a Visual Studio Marketplace publisher (all extensions are uploaded under a publisher)
  3. Verify the extension's manifest file (vss-extension.json) either has the public attribute set to false or is not specified (this ensures your extension is not inadvertently made available to all VSTS users)
  4. Package the extension with the ID of your publisher (run tfx extension create --publisher MYPUBLISHERID)
  5. Upload the produced .vsix file to the Marketplace
  6. Share your extension with your VSTS account (right-click on the published extension and select Share)
  7. Install the extension into the account (click on the published extension's title and then click Install)

See the full instructions.

Available samples

Contributions Guide

image

See the places where you can extend and enhance the user's web experience with an extension ---- right from within the web experience.

Build Inspector

Learn about advanced extension concepts like module loading, using UI controls, history, and more.

Note: this sample is written in TypeScript.

UI

image

Explore different UI controls, including menus, toolbars, custom controls, and more.

Public Events (for Team Calendar)

Custom event source for the Team Calendar extension for public holidays.

Build Results Enhancer

This sample extension shows how to make a tab/section contribution to build summary page, reacting to build updates.

This also has a sample code that allows user to render custom data results uploaded from a particular task in build.

You could contribute to build results view in different ways:

  • As a section to any of your own contributed tab for build results view
  • As a section to the existing "summary" tab in build results view
  • As a tab to the build results view

Contributing as a tab and a section to our own tab -

image

Contributing as a section to "summary" tab -

image

This sample is written in TypeScript. The compiled JS files are included in the /out directory, but changes will need to be re-compiled. Open readme.txt for instructions.

Release management extensions

Deployment status enhancer

Once this extension is installed, it shows an enhanced view of the deployment status to each environment

This extension showcases

a summary section contribution to Release summary page.

image

a tab contribution to Release summary page.

image

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.