-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6941212
Showing
13 changed files
with
7,443 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright (c) 2022 NETWORG | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Privacy Policy | ||
|
||
We don't collect any personal or organizational data with this extension. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
This extension allows you to open repository (and also a file or branch) from Azure DevOps directly in [VSCode.dev](https://code.visualstudio.com/blogs/2021/10/20/vscode-dev). | ||
|
||
 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "azdo-open-in-vscodedev", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"build": "webpack", | ||
"pack": "tfx extension create --rev-version" | ||
}, | ||
"keywords": [], | ||
"author": "NETWORG", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"tfx-cli": "^0.12.0", | ||
"ts-loader": "^9.4.1", | ||
"typescript": "^4.8.3", | ||
"webpack": "^5.74.0", | ||
"webpack-cli": "^4.10.0" | ||
}, | ||
"dependencies": { | ||
"vss-web-extension-sdk": "^5.141.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { SourceItemContext } from "TFS/VersionControl/UIContracts"; | ||
|
||
class OpenInVsCodeDev { | ||
public static execute(actionContext: SourceItemContext) { | ||
if (actionContext.item.sourceProvider !== "Git") { | ||
alert(`Unsupported sourceProvider: ${actionContext.item.sourceProvider}!`); | ||
} | ||
|
||
const vssContext = VSS.getWebContext(); | ||
const organization = vssContext.collection.name; | ||
const project = vssContext.project.name; | ||
const repo = actionContext.gitRepository.name; | ||
|
||
const path = actionContext.item.isFolder ? null : actionContext.item.path; | ||
|
||
let url = `https://vscode.dev/azurerepos/${organization}/${project}/${repo}`; | ||
const urlParams = new URLSearchParams(); | ||
// @ts-ignore - This bears the version of the specific item (branch, commit) | ||
urlParams.set("version", actionContext.item.item.version); | ||
if (path) { | ||
urlParams.set("path", path); | ||
} | ||
if ([...urlParams.entries()].length > 0) { | ||
url += `?${urlParams.toString()}`; | ||
} | ||
|
||
window.open(url, '_blank'); | ||
} | ||
} | ||
|
||
VSS.init({}); | ||
|
||
var openInVsCodeDevHandler = (function () { | ||
"use strict"; | ||
return { | ||
// This is a callback that gets invoked when a user selects the newly contributed menu item | ||
// The actionContext parameter contains context data surrounding the circumstances of this | ||
// action getting invoked. | ||
execute: function (actionContext: SourceItemContext) { | ||
return OpenInVsCodeDev.execute(actionContext); | ||
} | ||
}; | ||
}()); | ||
|
||
VSS.register("open-in-vscodedev", openInVsCodeDevHandler); | ||
// VSS.notifyLoadSucceeded(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
|
||
<head> | ||
<script src="../lib/VSS.SDK.js"></script> | ||
<script src="../dist/open-in-vscodedev.js"></script> | ||
</head> | ||
|
||
<body> | ||
</body> | ||
|
||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "UMD", | ||
"moduleResolution": "node", | ||
"target": "ES6", | ||
"rootDir": "src/", | ||
"outDir": "dist/", | ||
"sourceMap": true, | ||
"types": [ | ||
"vss-web-extension-sdk" | ||
], | ||
"esModuleInterop": true, | ||
"allowSyntheticDefaultImports": true, | ||
}, | ||
"exclude": [ | ||
"node_modules" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
{ | ||
"manifestVersion": 1, | ||
"id": "open-in-vscodedev", | ||
"publisher": "NETWORG", | ||
"version": "0.0.27", | ||
"name": "Open in VSCode.dev", | ||
"description": "Adds a handy button to open your Azure Repo in VSCode.dev", | ||
"public": true, | ||
"categories": [ | ||
"Azure Repos" | ||
], | ||
"content": { | ||
"details": { | ||
"path": "README.md" | ||
}, | ||
"license": { | ||
"path": "LICENSE.md" | ||
}, | ||
"privacy": { | ||
"path": "PRIVACY.md" | ||
} | ||
}, | ||
"links": { | ||
"support": { | ||
"uri": "https://github.com/NETWORG/azdo-open-in-vscodedev/issues" | ||
} | ||
}, | ||
"tags": [ | ||
"vscode.dev", | ||
"VSCode", | ||
"Visual Studio Code" | ||
], | ||
"icons": { | ||
"default": "static/open-in-vscodedev.png" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"uri": "https://github.com/NETWORG/azdo-open-in-vscodedev" | ||
}, | ||
"targets": [ | ||
{ | ||
"id": "Microsoft.VisualStudio.Services" | ||
} | ||
], | ||
"galleryFlags": [ | ||
"Public", | ||
"Preview" | ||
], | ||
"contributions": [ | ||
{ | ||
"id": "open-in-vscodedev", | ||
"type": "ms.vss-web.action", | ||
"targets": [ | ||
"ms.vss-code-web.source-item-menu" | ||
], | ||
"properties": { | ||
"uri": "static/open-in-vscodedev.html", | ||
"text": "Open in VSCode.dev", | ||
"icon": { | ||
"light": "static/open-in-vscodedev.png", | ||
"dark": "static/open-in-vscodedev.png" | ||
}, | ||
"registeredObjectId": "open-in-vscodedev" | ||
} | ||
} | ||
], | ||
"files": [ | ||
{ | ||
"path": "node_modules/vss-web-extension-sdk/lib", | ||
"addressable": true, | ||
"packagePath": "lib" | ||
}, | ||
{ | ||
"path": "static", | ||
"addressable": true | ||
}, | ||
{ | ||
"path": "dist", | ||
"addressable": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const path = require("path"); | ||
|
||
module.exports = { | ||
entry: [ | ||
"./src/open-in-vscodedev.ts" | ||
], | ||
output: { | ||
filename: "open-in-vscodedev.js" | ||
}, | ||
resolve: { | ||
extensions: [".ts"], | ||
alias: { | ||
"azure-devops-extension-sdk": path.resolve("node_modules/azure-devops-extension-sdk") | ||
}, | ||
}, | ||
stats: { | ||
warnings: false | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.ts?$/, | ||
loader: "ts-loader" | ||
}, | ||
] | ||
}, | ||
plugins: [ | ||
] | ||
}; |