Skip to content

Commit

Permalink
Merge master-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
sebas2day committed Sep 29, 2020
1 parent 8286a91 commit e13aace
Show file tree
Hide file tree
Showing 35 changed files with 2,400 additions and 852 deletions.
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
out
resources
fixtures
6 changes: 2 additions & 4 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// See http://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"hbenl.vscode-mocha-test-adapter",
],
"recommendations": ["hbenl.vscode-mocha-test-adapter"],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
}
}
7 changes: 4 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
"type": "node",
"request": "launch",
"name": "Launch Program",
// "cwd": "<absolute path to your extension>",
"program": "${workspaceFolder}/out/vsce",
"args": [
"--version"
// "ls", "package", "publish"
],
"sourceMaps": true,
"outputCapture": "std",
"preLaunchTask": "compile"
"outputCapture": "std"
}
]
}
}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
},
"typescript.tsdk": "./node_modules/typescript/lib",
"mochaExplorer.files": "out/**/test/*.test.js"
}
}
8 changes: 3 additions & 5 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": [
"$tsc-watch"
],
"problemMatcher": ["$tsc-watch"],
"group": {
"kind": "build",
"isDefault": true
Expand All @@ -20,4 +18,4 @@
"script": "test"
}
]
}
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# vsce

> *The Visual Studio Code Extension Manager*
> _The Visual Studio Code Extension Manager_
[![Build Status](https://dev.azure.com/vscode/VSCE/_apis/build/status/VSCE?branchName=master)](https://dev.azure.com/vscode/VSCE/_build/latest?definitionId=16&branchName=master) [![npm version](https://badge.fury.io/js/vsce.svg)](https://badge.fury.io/js/vsce)

## Requirements

- [Node.js](https://nodejs.org/en/) at least `8.x.x`
- [Node.js](https://nodejs.org/en/) at least `10.x.x`

## Usage

`vsce` is meant to be mainly used as a command line tool. It can also be used a library since it exposes a small [API](https://github.com/microsoft/vscode-vsce/blob/master/src/api.ts).

> **Warning:** When using vsce as a library be sure to sanitize any user input used in API calls, as a security measurement.
> **Warning:** When using vsce as a library be sure to sanitize any user input used in API calls, as a security measure.
## Development

Expand Down
38 changes: 19 additions & 19 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ trigger:
include: ['*']

steps:
- task: NodeTool@0
inputs:
versionSpec: "8.x"
- task: NodeTool@0
inputs:
versionSpec: '10.x'

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
versionSpec: "1.x"
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
versionSpec: '1.x'

- script: yarn
displayName: Install Dependencies
- script: yarn
displayName: Install Dependencies

- script: yarn compile
displayName: Compile
- script: yarn compile
displayName: Compile

- script: yarn test
displayName: Run Tests
- script: yarn test
displayName: Run Tests

- task: Npm@1
displayName: 'Publish to NPM'
inputs:
command: publish
verbose: false
publishEndpoint: 'NPM'
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
- task: Npm@1
displayName: 'Publish to NPM'
inputs:
command: publish
verbose: false
publishEndpoint: 'NPM'
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
181 changes: 98 additions & 83 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,86 +1,101 @@
{
"name": "vsce",
"version": "1.77.0",
"description": "VSCode Extension Manager",
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/vsce"
},
"homepage": "https://code.visualstudio.com",
"bugs": "https://github.com/Microsoft/vsce/issues",
"keywords": [
"vscode",
"vsce",
"extension"
],
"contributors": [
"Microsoft Corporation"
],
"author": "Microsoft Corporation",
"license": "MIT",
"main": "out/api.js",
"typings": "out/api.d.ts",
"bin": {
"vsce": "out/vsce"
},
"scripts": {
"compile": "tsc && cp src/vsce out/vsce",
"watch": "cp src/vsce out/vsce && tsc --watch",
"watch-test": "cp src/vsce out/vsce && concurrently \"tsc --watch\" \"mocha --watch\"",
"test": "mocha",
"prepublishOnly": "tsc && cp src/vsce out/vsce && mocha",
"vsce": "out/vsce"
},
"engines": {
"node": ">= 8"
},
"dependencies": {
"azure-devops-node-api": "^7.2.0",
"chalk": "^2.4.2",
"cheerio": "^1.0.0-rc.1",
"commander": "^2.8.1",
"denodeify": "^1.2.1",
"find-yarn-workspace-root": "^2.0.0",
"name": "vsce",
"version": "1.80.0",
"description": "VSCode Extension Manager",
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/vsce"
},
"homepage": "https://code.visualstudio.com",
"bugs": "https://github.com/Microsoft/vsce/issues",
"keywords": [
"vscode",
"vsce",
"extension"
],
"contributors": [
"Microsoft Corporation"
],
"author": "Microsoft Corporation",
"license": "MIT",
"main": "out/api.js",
"typings": "out/api.d.ts",
"bin": {
"vsce": "out/vsce"
},
"scripts": {
"copy-vsce": "mkdir -p out && cp src/vsce out/vsce",
"compile": "tsc && yarn copy-vsce",
"watch": "yarn copy-vsce && tsc --watch",
"watch-test": "yarn copy-vsce && concurrently \"tsc --watch\" \"mocha --watch\"",
"test": "mocha",
"prepublishOnly": "tsc && yarn copy-vsce && mocha",
"vsce": "out/vsce"
},
"engines": {
"node": ">= 10"
},
"dependencies": {
"azure-devops-node-api": "^7.2.0",
"chalk": "^2.4.2",
"cheerio": "^1.0.0-rc.1",
"commander": "^2.8.1",
"denodeify": "^1.2.1",
"find-yarn-workspace-root": "^2.0.0",
"glob": "^7.0.6",
"leven": "^3.1.0",
"lodash": "^4.17.15",
"markdown-it": "^10.0.0",
"mime": "^1.3.4",
"minimatch": "^3.0.3",
"osenv": "^0.1.3",
"parse-semver": "^1.1.1",
"read": "^1.0.7",
"semver": "^5.1.0",
"tmp": "0.0.29",
"typed-rest-client": "1.2.0",
"url-join": "^1.1.0",
"yauzl": "^2.3.1",
"yazl": "^2.2.2"
},
"devDependencies": {
"@types/cheerio": "^0.22.1",
"@types/denodeify": "^1.2.31",
"@types/glob": "^7.1.1",
"@types/lodash": "^4.14.123",
"@types/markdown-it": "0.0.2",
"@types/mime": "^1",
"@types/minimatch": "^3.0.3",
"@types/mocha": "^7.0.2",
"@types/node": "^8",
"@types/read": "^0.0.28",
"@types/semver": "^6.0.0",
"@types/tmp": "^0.1.0",
"@types/xml2js": "^0.4.4",
"concurrently": "^5.1.0",
"mocha": "^7.1.1",
"source-map-support": "^0.4.2",
"typescript": "^3.4.3",
"xml2js": "^0.4.12"
},
"mocha": {
"require": [
"source-map-support/register"
],
"spec": "out/test"
}
"leven": "^3.1.0",
"lodash": "^4.17.15",
"markdown-it": "^10.0.0",
"mime": "^1.3.4",
"minimatch": "^3.0.3",
"osenv": "^0.1.3",
"parse-semver": "^1.1.1",
"read": "^1.0.7",
"semver": "^5.1.0",
"tmp": "0.0.29",
"typed-rest-client": "1.2.0",
"url-join": "^1.1.0",
"yauzl": "^2.3.1",
"yazl": "^2.2.2"
},
"devDependencies": {
"@types/cheerio": "^0.22.1",
"@types/denodeify": "^1.2.31",
"@types/glob": "^7.1.1",
"@types/lodash": "^4.14.123",
"@types/markdown-it": "0.0.2",
"@types/mime": "^1",
"@types/minimatch": "^3.0.3",
"@types/mocha": "^7.0.2",
"@types/node": "^8",
"@types/read": "^0.0.28",
"@types/semver": "^6.0.0",
"@types/tmp": "^0.1.0",
"@types/xml2js": "^0.4.4",
"concurrently": "^5.1.0",
"husky": "^4.3.0",
"mocha": "^7.1.1",
"prettier": "2.1.2",
"pretty-quick": "^3.0.2",
"source-map-support": "^0.4.2",
"typescript": "^3.4.3",
"xml2js": "^0.4.12"
},
"mocha": {
"require": [
"source-map-support/register"
],
"spec": "out/test"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
}
},
"prettier": {
"useTabs": true,
"printWidth": 120,
"singleQuote": true,
"arrowParens": "avoid"
}
}
2 changes: 2 additions & 0 deletions resources/extension.vsixmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<Property Id="Microsoft.VisualStudio.Code.Engine" Value="<%- engine %>" />
<Property Id="Microsoft.VisualStudio.Code.ExtensionDependencies" Value="<%- extensionDependencies %>" />
<Property Id="Microsoft.VisualStudio.Code.ExtensionPack" Value="<%- extensionPack %>" />
<Property Id="Microsoft.VisualStudio.Code.ExtensionKind" Value="<%- extensionKind %>" />
<Property Id="Microsoft.VisualStudio.Code.LocalizedLanguages" Value="<%- localizedLanguages %>" />
<% if (links.repository) { %>
<Property Id="Microsoft.VisualStudio.Services.Links.Source" Value="<%- links.repository %>" />
Expand All @@ -29,6 +30,7 @@
<Property Id="Microsoft.VisualStudio.Services.GitHubFlavoredMarkdown" Value="<%- githubMarkdown %>" />
<% if (typeof enableMarketplaceQnA === 'boolean') { %><Property Id="Microsoft.VisualStudio.Services.EnableMarketplaceQnA" Value="<%- enableMarketplaceQnA %>" /><% } %>
<% if (customerQnALink) { %><Property Id="Microsoft.VisualStudio.Services.CustomerQnALink" Value="<%- customerQnALink %>" /><% } %>
<% if (typeof webExtension === 'boolean') { %><Property Id="Microsoft.VisualStudio.Code.WebExtension" Value="<%- webExtension %>" /><% } %>
</Properties>
<% if (license) { %><License><%- license %></License><% } %>
<% if (icon) { %><Icon><%- icon %></Icon><% } %>
Expand Down
14 changes: 8 additions & 6 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export interface ICreateVSIXOptions {
}

export interface IPublishOptions {

/**
* The location of the extension in the file system.
*
Expand Down Expand Up @@ -69,11 +68,10 @@ export interface IPublishOptions {
*/
export enum PackageManager {
Npm,
Yarn
Yarn,
}

export interface IListFilesOptions {

/**
* The working directory of the extension. Defaults to `process.cwd()`.
*/
Expand All @@ -85,7 +83,7 @@ export interface IListFilesOptions {
packageManager?: PackageManager;

/**
* A subset of the top level dependencies which should be included. The
* A subset of the top level dependencies which should be included. The
* default is `undefined` which include all dependencies, an empty array means
* no dependencies will be included.
*/
Expand All @@ -100,7 +98,6 @@ export interface IListFilesOptions {
}

export interface IPublishVSIXOptions {

/**
* The Personal Access Token to use.
*
Expand Down Expand Up @@ -142,7 +139,12 @@ export function publish(options: IPublishOptions = {}): Promise<any> {
* Lists the files included in the extension's package.
*/
export function listFiles(options: IListFilesOptions = {}): Promise<string[]> {
return _listFiles(options.cwd, options.packageManager === PackageManager.Yarn, options.packagedDependencies, options.ignoreFile);
return _listFiles(
options.cwd,
options.packageManager === PackageManager.Yarn,
options.packagedDependencies,
options.ignoreFile
);
}

/**
Expand Down
Loading

0 comments on commit e13aace

Please sign in to comment.