@vscode/vsce 2.15.0 → 2.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,9 +2,8 @@
2
2
 
3
3
  > _The Visual Studio Code Extension Manager_
4
4
 
5
- [![ci](https://github.com/microsoft/vsce/workflows/ci/badge.svg)](https://github.com/microsoft/vsce/actions?query=workflow%3Aci)
6
- [![Version](https://img.shields.io/npm/v/vsce.svg)](https://npmjs.org/package/vsce)
7
- [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
5
+ [![Build Status](https://dev.azure.com/monacotools/Monaco/_apis/build/status/npm/microsoft.vscode-vsce?repoName=microsoft%2Fvscode-vsce&branchName=main)](https://dev.azure.com/monacotools/Monaco/_build/latest?definitionId=446&repoName=microsoft%2Fvscode-vsce&branchName=main)
6
+ [![Version](https://img.shields.io/npm/v/@vscode/vsce.svg)](https://npmjs.org/package/@vscode/vsce)
8
7
 
9
8
  ## Requirements
10
9
 
@@ -96,8 +95,6 @@ Once the watcher is up and running, you can run out of sources with:
96
95
  node vsce
97
96
  ```
98
97
 
99
- This project uses [semantic-release](https://semantic-release.gitbook.io/semantic-release/) and commit messages must follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec. This allows us to effortlessly automate releases.
100
-
101
98
  ## About
102
99
 
103
100
  This tool assists in packaging and publishing Visual Studio Code extensions.
package/dist/vsce.d.ts ADDED
@@ -0,0 +1,192 @@
1
+ /// <reference types="node" />
2
+
3
+ /**
4
+ * Creates a VSIX from the extension in the current working directory.
5
+ * @public
6
+ */
7
+ export declare function createVSIX(options?: IPackageOptions): Promise<any>;
8
+
9
+ /**
10
+ * @deprecated prefer IPackageOptions instead
11
+ * @public
12
+ */
13
+ export declare type IBaseVSIXOptions = Pick<IPackageOptions, 'baseContentUrl' | 'baseImagesUrl' | 'githubBranch' | 'gitlabBranch' | 'useYarn' | 'target' | 'preRelease'>;
14
+
15
+ /**
16
+ * @deprecated prefer IPackageOptions instead
17
+ * @public
18
+ */
19
+ export declare type ICreateVSIXOptions = Pick<IPackageOptions, 'cwd' | 'packagePath'> & IBaseVSIXOptions;
20
+
21
+ /**
22
+ * Options for the `listFiles` function.
23
+ * @public
24
+ */
25
+ export declare interface IListFilesOptions {
26
+ /**
27
+ * The working directory of the extension. Defaults to `process.cwd()`.
28
+ */
29
+ cwd?: string;
30
+ /**
31
+ * The package manager to use. Defaults to `PackageManager.Npm`.
32
+ */
33
+ packageManager?: PackageManager;
34
+ /**
35
+ * A subset of the top level dependencies which should be included. The
36
+ * default is `undefined` which include all dependencies, an empty array means
37
+ * no dependencies will be included.
38
+ */
39
+ packagedDependencies?: string[];
40
+ /**
41
+ * The location of an alternative .vscodeignore file to be used.
42
+ * The `.vscodeignore` file located at the root of the project will be taken
43
+ * instead, if none is specified.
44
+ */
45
+ ignoreFile?: string;
46
+ }
47
+
48
+ /**
49
+ * Options for the `createVSIX` function.
50
+ * @public
51
+ */
52
+ export declare interface IPackageOptions {
53
+ /**
54
+ * The destination of the packaged the VSIX.
55
+ *
56
+ * Defaults to `NAME-VERSION.vsix`.
57
+ */
58
+ readonly packagePath?: string;
59
+ readonly version?: string;
60
+ /**
61
+ * Optional target the extension should run on.
62
+ *
63
+ * https://code.visualstudio.com/api/working-with-extensions/publishing-extension#platformspecific-extensions
64
+ */
65
+ readonly target?: string;
66
+ readonly commitMessage?: string;
67
+ readonly gitTagVersion?: boolean;
68
+ readonly updatePackageJson?: boolean;
69
+ /**
70
+ * The location of the extension in the file system.
71
+ *
72
+ * Defaults to `process.cwd()`.
73
+ */
74
+ readonly cwd?: string;
75
+ /**
76
+ * GitHub branch used to publish the package. Used to automatically infer
77
+ * the base content and images URI.
78
+ */
79
+ readonly githubBranch?: string;
80
+ /**
81
+ * GitLab branch used to publish the package. Used to automatically infer
82
+ * the base content and images URI.
83
+ */
84
+ readonly gitlabBranch?: string;
85
+ readonly rewriteRelativeLinks?: boolean;
86
+ /**
87
+ * The base URL for links detected in Markdown files.
88
+ */
89
+ readonly baseContentUrl?: string;
90
+ /**
91
+ * The base URL for images detected in Markdown files.
92
+ */
93
+ readonly baseImagesUrl?: string;
94
+ /**
95
+ * Should use Yarn instead of NPM.
96
+ */
97
+ readonly useYarn?: boolean;
98
+ readonly dependencyEntryPoints?: string[];
99
+ readonly ignoreFile?: string;
100
+ readonly gitHubIssueLinking?: boolean;
101
+ readonly gitLabIssueLinking?: boolean;
102
+ readonly dependencies?: boolean;
103
+ /**
104
+ * Mark this package as a pre-release
105
+ */
106
+ readonly preRelease?: boolean;
107
+ readonly allowStarActivation?: boolean;
108
+ readonly allowMissingRepository?: boolean;
109
+ }
110
+
111
+ /**
112
+ * Options for the `publish` function.
113
+ * @public
114
+ */
115
+ export declare interface IPublishOptions {
116
+ readonly packagePath?: string[];
117
+ readonly version?: string;
118
+ readonly targets?: string[];
119
+ readonly commitMessage?: string;
120
+ readonly gitTagVersion?: boolean;
121
+ readonly updatePackageJson?: boolean;
122
+ /**
123
+ * The location of the extension in the file system.
124
+ *
125
+ * Defaults to `process.cwd()`.
126
+ */
127
+ readonly cwd?: string;
128
+ readonly githubBranch?: string;
129
+ readonly gitlabBranch?: string;
130
+ /**
131
+ * The base URL for links detected in Markdown files.
132
+ */
133
+ readonly baseContentUrl?: string;
134
+ /**
135
+ * The base URL for images detected in Markdown files.
136
+ */
137
+ readonly baseImagesUrl?: string;
138
+ /**
139
+ * Should use Yarn instead of NPM.
140
+ */
141
+ readonly useYarn?: boolean;
142
+ readonly dependencyEntryPoints?: string[];
143
+ readonly ignoreFile?: string;
144
+ /**
145
+ * The Personal Access Token to use.
146
+ *
147
+ * Defaults to the stored one.
148
+ */
149
+ readonly pat?: string;
150
+ readonly noVerify?: boolean;
151
+ readonly dependencies?: boolean;
152
+ readonly preRelease?: boolean;
153
+ readonly allowStarActivation?: boolean;
154
+ readonly allowMissingRepository?: boolean;
155
+ readonly skipDuplicate?: boolean;
156
+ }
157
+
158
+ /**
159
+ * Options for the `publishVSIX` function.
160
+ * @public
161
+ */
162
+ export declare type IPublishVSIXOptions = IPublishOptions & Pick<IPackageOptions, 'target'>;
163
+
164
+ /**
165
+ * Lists the files included in the extension's package.
166
+ * @public
167
+ */
168
+ export declare function listFiles(options?: IListFilesOptions): Promise<string[]>;
169
+
170
+ /**
171
+ * The supported list of package managers.
172
+ * @public
173
+ */
174
+ export declare enum PackageManager {
175
+ Npm = 0,
176
+ Yarn = 1,
177
+ None = 2
178
+ }
179
+
180
+ /**
181
+ * Publishes the extension in the current working directory.
182
+ * @public
183
+ */
184
+ export declare function publish(options?: IPublishOptions): Promise<any>;
185
+
186
+ /**
187
+ * Publishes a pre-build VSIX.
188
+ * @public
189
+ */
190
+ export declare function publishVSIX(packagePath: string | string[], options?: IPublishVSIXOptions): Promise<any>;
191
+
192
+ export { }
package/out/api.js CHANGED
@@ -5,6 +5,7 @@ const publish_1 = require("./publish");
5
5
  const package_1 = require("./package");
6
6
  /**
7
7
  * The supported list of package managers.
8
+ * @public
8
9
  */
9
10
  var PackageManager;
10
11
  (function (PackageManager) {
@@ -14,6 +15,7 @@ var PackageManager;
14
15
  })(PackageManager = exports.PackageManager || (exports.PackageManager = {}));
15
16
  /**
16
17
  * Creates a VSIX from the extension in the current working directory.
18
+ * @public
17
19
  */
18
20
  function createVSIX(options = {}) {
19
21
  return (0, package_1.packageCommand)(options);
@@ -21,6 +23,7 @@ function createVSIX(options = {}) {
21
23
  exports.createVSIX = createVSIX;
22
24
  /**
23
25
  * Publishes the extension in the current working directory.
26
+ * @public
24
27
  */
25
28
  function publish(options = {}) {
26
29
  return (0, publish_1.publish)(options);
@@ -28,13 +31,19 @@ function publish(options = {}) {
28
31
  exports.publish = publish;
29
32
  /**
30
33
  * Lists the files included in the extension's package.
34
+ * @public
31
35
  */
32
36
  function listFiles(options = {}) {
33
- return (0, package_1.listFiles)(options);
37
+ return (0, package_1.listFiles)({
38
+ ...options,
39
+ useYarn: options.packageManager === PackageManager.Yarn,
40
+ dependencies: options.packageManager !== PackageManager.None,
41
+ });
34
42
  }
35
43
  exports.listFiles = listFiles;
36
44
  /**
37
45
  * Publishes a pre-build VSIX.
46
+ * @public
38
47
  */
39
48
  function publishVSIX(packagePath, options = {}) {
40
49
  return (0, publish_1.publish)({
package/out/main.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
package/out/npm.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
package/out/package.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -180,7 +184,7 @@ const TrustedSVGSources = [
180
184
  'travis-ci.com',
181
185
  'travis-ci.org',
182
186
  'visualstudio.com',
183
- 'vsmarketplacebadge.apphb.com',
187
+ 'vsmarketplacebadges.dev',
184
188
  'www.bithound.io',
185
189
  'www.versioneye.com',
186
190
  ];
@@ -872,11 +876,27 @@ function validateManifest(manifest) {
872
876
  if (!manifest.engines['vscode']) {
873
877
  throw new Error('Manifest missing field: engines.vscode');
874
878
  }
875
- (0, validation_1.validateEngineCompatibility)(manifest.engines['vscode']);
879
+ const engineVersion = manifest.engines['vscode'];
880
+ (0, validation_1.validateEngineCompatibility)(engineVersion);
876
881
  const hasActivationEvents = !!manifest.activationEvents;
882
+ const hasImplicitActivationEvents = manifest.contributes?.commands ||
883
+ manifest.contributes?.authentication ||
884
+ manifest.contributes?.languages ||
885
+ manifest.contributes?.customEditors ||
886
+ manifest.contributes?.views;
877
887
  const hasMain = !!manifest.main;
878
888
  const hasBrowser = !!manifest.browser;
879
- if (hasActivationEvents) {
889
+ let parsedEngineVersion;
890
+ try {
891
+ const engineSemver = (0, parse_semver_1.default)(`vscode@${engineVersion}`);
892
+ parsedEngineVersion = engineSemver.version;
893
+ }
894
+ catch (err) {
895
+ throw new Error('Failed to parse semver of engines.vscode');
896
+ }
897
+ if (hasActivationEvents ||
898
+ ((engineVersion === '*' || semver.satisfies(parsedEngineVersion, '>=1.74', { includePrerelease: true })) &&
899
+ hasImplicitActivationEvents)) {
880
900
  if (!hasMain && !hasBrowser) {
881
901
  throw new Error("Manifest needs either a 'main' or 'browser' property, given it has a 'activationEvents' property.");
882
902
  }
package/out/publish.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
package/out/store.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
package/out/validation.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vscode/vsce",
3
- "version": "2.15.0",
3
+ "version": "2.17.0",
4
4
  "description": "VSCode Extension Manager",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,13 +22,14 @@
22
22
  "author": "Microsoft Corporation",
23
23
  "license": "MIT",
24
24
  "main": "out/api.js",
25
- "typings": "out/api.d.ts",
25
+ "typings": "dist/vsce.d.ts",
26
26
  "bin": {
27
27
  "vsce": "vsce"
28
28
  },
29
29
  "scripts": {
30
30
  "compile": "tsc",
31
- "build": "tsc",
31
+ "api": "api-extractor run --local --verbose",
32
+ "build": "npm run compile && npm run api",
32
33
  "watch:build": "npm run compile -- --watch",
33
34
  "test": "mocha",
34
35
  "watch:test": "npm run test -- --watch",
@@ -44,7 +45,6 @@
44
45
  "commander": "^6.1.0",
45
46
  "glob": "^7.0.6",
46
47
  "hosted-git-info": "^4.0.2",
47
- "keytar": "^7.7.0",
48
48
  "leven": "^3.1.0",
49
49
  "markdown-it": "^12.3.2",
50
50
  "mime": "^1.3.4",
@@ -60,6 +60,7 @@
60
60
  "yazl": "^2.2.2"
61
61
  },
62
62
  "devDependencies": {
63
+ "@microsoft/api-extractor": "^7.33.7",
63
64
  "@types/cheerio": "^0.22.29",
64
65
  "@types/glob": "^7.1.1",
65
66
  "@types/hosted-git-info": "^3.0.2",
@@ -80,9 +81,12 @@
80
81
  "prettier": "2.1.2",
81
82
  "pretty-quick": "^3.0.2",
82
83
  "source-map-support": "^0.4.2",
83
- "ts-node": "^10.0.0",
84
+ "ts-node": "^10.9.1",
84
85
  "typescript": "^4.3.2"
85
86
  },
87
+ "optionalDependencies": {
88
+ "keytar": "^7.7.0"
89
+ },
86
90
  "mocha": {
87
91
  "require": [
88
92
  "ts-node/register"
package/out/api.d.ts DELETED
@@ -1,59 +0,0 @@
1
- import { IPublishOptions as _IPublishOptions } from './publish';
2
- import { IPackageOptions } from './package';
3
- export type { IPackageOptions } from './package';
4
- /**
5
- * @deprecated prefer IPackageOptions instead
6
- */
7
- export declare type IBaseVSIXOptions = Pick<IPackageOptions, 'baseContentUrl' | 'baseImagesUrl' | 'githubBranch' | 'gitlabBranch' | 'useYarn' | 'target' | 'preRelease'>;
8
- /**
9
- * @deprecated prefer IPackageOptions instead
10
- */
11
- export declare type ICreateVSIXOptions = Pick<IPackageOptions, 'cwd' | 'packagePath'> & IBaseVSIXOptions;
12
- /**
13
- * The supported list of package managers.
14
- */
15
- export declare enum PackageManager {
16
- Npm = 0,
17
- Yarn = 1,
18
- None = 2
19
- }
20
- export interface IListFilesOptions {
21
- /**
22
- * The working directory of the extension. Defaults to `process.cwd()`.
23
- */
24
- cwd?: string;
25
- /**
26
- * The package manager to use. Defaults to `PackageManager.Npm`.
27
- */
28
- packageManager?: PackageManager;
29
- /**
30
- * A subset of the top level dependencies which should be included. The
31
- * default is `undefined` which include all dependencies, an empty array means
32
- * no dependencies will be included.
33
- */
34
- packagedDependencies?: string[];
35
- /**
36
- * The location of an alternative .vscodeignore file to be used.
37
- * The `.vscodeignore` file located at the root of the project will be taken
38
- * instead, if none is specified.
39
- */
40
- ignoreFile?: string;
41
- }
42
- export declare type IPublishVSIXOptions = IPublishOptions & Pick<IPackageOptions, 'target'>;
43
- export declare type IPublishOptions = _IPublishOptions;
44
- /**
45
- * Creates a VSIX from the extension in the current working directory.
46
- */
47
- export declare function createVSIX(options?: IPackageOptions): Promise<any>;
48
- /**
49
- * Publishes the extension in the current working directory.
50
- */
51
- export declare function publish(options?: IPublishOptions): Promise<any>;
52
- /**
53
- * Lists the files included in the extension's package.
54
- */
55
- export declare function listFiles(options?: IListFilesOptions): Promise<string[]>;
56
- /**
57
- * Publishes a pre-build VSIX.
58
- */
59
- export declare function publishVSIX(packagePath: string | string[], options?: IPublishVSIXOptions): Promise<any>;