@vscode/vsce 2.20.1 → 2.21.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/dist/vsce.d.ts CHANGED
@@ -106,6 +106,7 @@ export declare interface IPackageOptions {
106
106
  readonly preRelease?: boolean;
107
107
  readonly allowStarActivation?: boolean;
108
108
  readonly allowMissingRepository?: boolean;
109
+ readonly skipLicense?: boolean;
109
110
  }
110
111
 
111
112
  /**
@@ -153,6 +154,7 @@ export declare interface IPublishOptions {
153
154
  readonly allowStarActivation?: boolean;
154
155
  readonly allowMissingRepository?: boolean;
155
156
  readonly skipDuplicate?: boolean;
157
+ readonly skipLicense?: boolean;
156
158
  }
157
159
 
158
160
  /**
package/out/main.js CHANGED
@@ -87,6 +87,7 @@ module.exports = function (argv) {
87
87
  .action(({ yarn, packagedDependencies, ignoreFile, dependencies }) => main((0, package_1.ls)({ useYarn: yarn, packagedDependencies, ignoreFile, dependencies })));
88
88
  commander_1.default
89
89
  .command('package [version]')
90
+ .alias('pack')
90
91
  .description('Packages an extension')
91
92
  .option('-o, --out <path>', 'Output .vsix extension file to <path> location (defaults to <name>-<version>.vsix)')
92
93
  .option('-t, --target <target>', `Target architecture. Valid targets: ${ValidTargets}`)
@@ -109,7 +110,8 @@ module.exports = function (argv) {
109
110
  .option('--pre-release', 'Mark this package as a pre-release')
110
111
  .option('--allow-star-activation', 'Allow using * in activation events')
111
112
  .option('--allow-missing-repository', 'Allow missing a repository URL in package.json')
112
- .action((version, { out, target, message, gitTagVersion, updatePackageJson, githubBranch, gitlabBranch, rewriteRelativeLinks, baseContentUrl, baseImagesUrl, yarn, ignoreFile, gitHubIssueLinking, gitLabIssueLinking, dependencies, preRelease, allowStarActivation, allowMissingRepository, }) => main((0, package_1.packageCommand)({
113
+ .option('--skip-license', 'Allow packaging without license file')
114
+ .action((version, { out, target, message, gitTagVersion, updatePackageJson, githubBranch, gitlabBranch, rewriteRelativeLinks, baseContentUrl, baseImagesUrl, yarn, ignoreFile, gitHubIssueLinking, gitLabIssueLinking, dependencies, preRelease, allowStarActivation, allowMissingRepository, skipLicense, }) => main((0, package_1.packageCommand)({
113
115
  packagePath: out,
114
116
  version,
115
117
  target,
@@ -129,6 +131,7 @@ module.exports = function (argv) {
129
131
  preRelease,
130
132
  allowStarActivation,
131
133
  allowMissingRepository,
134
+ skipLicense,
132
135
  })));
133
136
  commander_1.default
134
137
  .command('publish [version]')
@@ -154,7 +157,8 @@ module.exports = function (argv) {
154
157
  .option('--allow-star-activation', 'Allow using * in activation events')
155
158
  .option('--allow-missing-repository', 'Allow missing a repository URL in package.json')
156
159
  .option('--skip-duplicate', 'Fail silently if version already exists on the marketplace')
157
- .action((version, { pat, target, message, gitTagVersion, updatePackageJson, packagePath, githubBranch, gitlabBranch, baseContentUrl, baseImagesUrl, yarn, noVerify, ignoreFile, dependencies, preRelease, allowStarActivation, allowMissingRepository, skipDuplicate, }) => main((0, publish_1.publish)({
160
+ .option('--skip-license', 'Allow publishing without license file')
161
+ .action((version, { pat, target, message, gitTagVersion, updatePackageJson, packagePath, githubBranch, gitlabBranch, baseContentUrl, baseImagesUrl, yarn, noVerify, ignoreFile, dependencies, preRelease, allowStarActivation, allowMissingRepository, skipDuplicate, skipLicense, }) => main((0, publish_1.publish)({
158
162
  pat,
159
163
  version,
160
164
  targets: target,
@@ -174,6 +178,7 @@ module.exports = function (argv) {
174
178
  allowStarActivation,
175
179
  allowMissingRepository,
176
180
  skipDuplicate,
181
+ skipLicense,
177
182
  })));
178
183
  commander_1.default
179
184
  .command('unpublish [extensionid]')
@@ -228,6 +233,9 @@ Unknown command '${cmd}'`;
228
233
  });
229
234
  process.exit(1);
230
235
  });
236
+ commander_1.default.description(`${pkg.description}
237
+ To learn more about the VS Code extension API: https://aka.ms/vscode-extension-api
238
+ To connect with the VS Code extension developer community: https://aka.ms/vscode-discussions`);
231
239
  commander_1.default.parse(argv);
232
240
  };
233
241
  //# sourceMappingURL=main.js.map
package/out/package.js CHANGED
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.ls = exports.listFiles = exports.packageCommand = exports.pack = exports.prepublish = exports.collect = exports.createDefaultProcessors = exports.processFiles = exports.toContentTypes = exports.toVsixManifest = exports.readManifest = exports.validateManifest = exports.ValidationProcessor = exports.NLSProcessor = exports.isWebKind = exports.ChangelogProcessor = exports.ReadmeProcessor = exports.MarkdownProcessor = exports.TagsProcessor = exports.ManifestProcessor = exports.Targets = exports.versionBump = exports.BaseProcessor = exports.read = void 0;
29
+ exports.ls = exports.listFiles = exports.packageCommand = exports.pack = exports.prepublish = exports.collect = exports.createDefaultProcessors = exports.processFiles = exports.toContentTypes = exports.toVsixManifest = exports.readManifest = exports.validateManifest = exports.ValidationProcessor = exports.NLSProcessor = exports.isWebKind = exports.LicenseProcessor = exports.ChangelogProcessor = exports.ReadmeProcessor = exports.MarkdownProcessor = exports.TagsProcessor = exports.ManifestProcessor = exports.Targets = exports.versionBump = exports.BaseProcessor = exports.read = void 0;
30
30
  const fs = __importStar(require("fs"));
31
31
  const path = __importStar(require("path"));
32
32
  const util_1 = require("util");
@@ -229,7 +229,7 @@ async function versionBump(options) {
229
229
  return Promise.reject(`Invalid version ${options.version}`);
230
230
  }
231
231
  }
232
- let command = `npm version ${options.version}`;
232
+ let command = `npm version ${options.version}`; // CodeQL [SM03609] options.version is checked above.
233
233
  if (options.commitMessage) {
234
234
  command = `${command} -m "${options.commitMessage}"`;
235
235
  }
@@ -643,8 +643,9 @@ class ChangelogProcessor extends MarkdownProcessor {
643
643
  }
644
644
  exports.ChangelogProcessor = ChangelogProcessor;
645
645
  class LicenseProcessor extends BaseProcessor {
646
- constructor(manifest) {
646
+ constructor(manifest, options = {}) {
647
647
  super(manifest);
648
+ this.options = options;
648
649
  this.didFindLicense = false;
649
650
  const match = /^SEE LICENSE IN (.*)$/.exec(manifest.license || '');
650
651
  if (!match || !match[1]) {
@@ -674,7 +675,7 @@ class LicenseProcessor extends BaseProcessor {
674
675
  return Promise.resolve(file);
675
676
  }
676
677
  async onEnd() {
677
- if (!this.didFindLicense) {
678
+ if (!this.didFindLicense && !this.options.skipLicense) {
678
679
  util.log.warn(`${this.expectedLicenseName} not found`);
679
680
  if (!/^y$/i.test(await util.read('Do you want to continue? [y/N] '))) {
680
681
  throw new Error('Aborted');
@@ -682,6 +683,7 @@ class LicenseProcessor extends BaseProcessor {
682
683
  }
683
684
  }
684
685
  }
686
+ exports.LicenseProcessor = LicenseProcessor;
685
687
  class LaunchEntryPointProcessor extends BaseProcessor {
686
688
  constructor(manifest) {
687
689
  super(manifest);
@@ -868,7 +870,7 @@ function validateManifest(manifest) {
868
870
  throw new Error('Manifest missing field: version');
869
871
  }
870
872
  if (manifest.pricing && !['Free', 'Trial'].includes(manifest.pricing)) {
871
- throw new Error('Pricing should be Free or Trial');
873
+ throw new Error('Pricing can only be "Free" or "Trial"');
872
874
  }
873
875
  (0, validation_1.validateVersion)(manifest.version);
874
876
  if (!manifest.engines) {
@@ -1195,7 +1197,7 @@ function createDefaultProcessors(manifest, options = {}) {
1195
1197
  new ReadmeProcessor(manifest, options),
1196
1198
  new ChangelogProcessor(manifest, options),
1197
1199
  new LaunchEntryPointProcessor(manifest),
1198
- new LicenseProcessor(manifest),
1200
+ new LicenseProcessor(manifest, options),
1199
1201
  new IconProcessor(manifest),
1200
1202
  new NLSProcessor(manifest),
1201
1203
  new ValidationProcessor(manifest),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vscode/vsce",
3
- "version": "2.20.1",
4
- "description": "VSCode Extension Manager",
3
+ "version": "2.21.0",
4
+ "description": "VS Code Extensions Manager",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/Microsoft/vsce"
@@ -41,7 +41,7 @@
41
41
  "azure-devops-node-api": "^11.0.1",
42
42
  "chalk": "^2.4.2",
43
43
  "cheerio": "^1.0.0-rc.9",
44
- "commander": "^6.1.0",
44
+ "commander": "^6.2.1",
45
45
  "glob": "^7.0.6",
46
46
  "hosted-git-info": "^4.0.2",
47
47
  "jsonc-parser": "^3.2.0",