@vscode/vsce 3.1.1 → 3.1.2-1

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
@@ -72,6 +72,10 @@ export declare interface IPackageOptions {
72
72
  * @default false
73
73
  */
74
74
  readonly ignoreOtherTargetFolders?: boolean;
75
+ /**
76
+ * Recurse into symlinked directories instead of treating them as files.
77
+ */
78
+ readonly followSymlinks?: boolean;
75
79
  readonly commitMessage?: string;
76
80
  readonly gitTagVersion?: boolean;
77
81
  readonly updatePackageJson?: boolean;
@@ -158,6 +162,10 @@ export declare interface IPublishOptions {
158
162
  readonly useYarn?: boolean;
159
163
  readonly dependencyEntryPoints?: string[];
160
164
  readonly ignoreFile?: string;
165
+ /**
166
+ * Recurse into symlinked directories instead of treating them as files
167
+ */
168
+ readonly followSymlinks?: boolean;
161
169
  /**
162
170
  * The Personal Access Token to use.
163
171
  *
package/out/main.js CHANGED
@@ -86,7 +86,8 @@ module.exports = function (argv) {
86
86
  .option('--dependencies', 'Enable dependency detection via npm or yarn', undefined)
87
87
  .option('--no-dependencies', 'Disable dependency detection via npm or yarn', undefined)
88
88
  .option('--readme-path <path>', 'Path to README file (defaults to README.md)')
89
- .action(({ tree, yarn, packagedDependencies, ignoreFile, dependencies, readmePath }) => main((0, package_1.ls)({ tree, useYarn: yarn, packagedDependencies, ignoreFile, dependencies, readmePath })));
89
+ .option('--follow-symlinks', 'Recurse into symlinked directories instead of treating them as files')
90
+ .action(({ tree, yarn, packagedDependencies, ignoreFile, dependencies, readmePath, followSymlinks }) => main((0, package_1.ls)({ tree, useYarn: yarn, packagedDependencies, ignoreFile, dependencies, readmePath, followSymlinks })));
90
91
  commander_1.default
91
92
  .command('package [version]')
92
93
  .alias('pack')
@@ -118,7 +119,8 @@ module.exports = function (argv) {
118
119
  .option('--allow-unused-files-pattern', 'Allow include patterns for the files field in package.json that does not match any file')
119
120
  .option('--skip-license', 'Allow packaging without license file')
120
121
  .option('--sign-tool <path>', 'Path to the VSIX signing tool. Will be invoked with two arguments: `SIGNTOOL <path/to/extension.signature.manifest> <path/to/extension.signature.p7s>`.')
121
- .action((version, { out, target, ignoreOtherTargetFolders, readmePath, changelogPath, message, gitTagVersion, updatePackageJson, githubBranch, gitlabBranch, rewriteRelativeLinks, baseContentUrl, baseImagesUrl, yarn, ignoreFile, gitHubIssueLinking, gitLabIssueLinking, dependencies, preRelease, allowStarActivation, allowMissingRepository, allowUnusedFilesPattern, skipLicense, signTool, }) => main((0, package_1.packageCommand)({
122
+ .option('--follow-symlinks', 'Recurse into symlinked directories instead of treating them as files')
123
+ .action((version, { out, target, ignoreOtherTargetFolders, readmePath, changelogPath, message, gitTagVersion, updatePackageJson, githubBranch, gitlabBranch, rewriteRelativeLinks, baseContentUrl, baseImagesUrl, yarn, ignoreFile, gitHubIssueLinking, gitLabIssueLinking, dependencies, preRelease, allowStarActivation, allowMissingRepository, allowUnusedFilesPattern, skipLicense, signTool, followSymlinks, }) => main((0, package_1.packageCommand)({
122
124
  packagePath: out,
123
125
  version,
124
126
  target,
@@ -144,6 +146,7 @@ module.exports = function (argv) {
144
146
  allowUnusedFilesPattern,
145
147
  skipLicense,
146
148
  signTool,
149
+ followSymlinks,
147
150
  })));
148
151
  commander_1.default
149
152
  .command('publish [version]')
@@ -181,7 +184,8 @@ module.exports = function (argv) {
181
184
  .option('--allow-unused-files-pattern', 'Allow include patterns for the files field in package.json that does not match any file')
182
185
  .option('--skip-duplicate', 'Fail silently if version already exists on the marketplace')
183
186
  .option('--skip-license', 'Allow publishing without license file')
184
- .action((version, { pat, azureCredential, target, ignoreOtherTargetFolders, readmePath, changelogPath, message, gitTagVersion, updatePackageJson, packagePath, manifestPath, signaturePath, sigzipPath, githubBranch, gitlabBranch, baseContentUrl, baseImagesUrl, yarn, noVerify, allowProposedApis, allowAllProposedApis, ignoreFile, dependencies, preRelease, allowStarActivation, allowMissingRepository, allowUnusedFilesPattern, skipDuplicate, skipLicense, signTool, }) => main((0, publish_1.publish)({
187
+ .option('--follow-symlinks', 'Recurse into symlinked directories instead of treating them as files')
188
+ .action((version, { pat, azureCredential, target, ignoreOtherTargetFolders, readmePath, changelogPath, message, gitTagVersion, updatePackageJson, packagePath, manifestPath, signaturePath, sigzipPath, githubBranch, gitlabBranch, baseContentUrl, baseImagesUrl, yarn, noVerify, allowProposedApis, allowAllProposedApis, ignoreFile, dependencies, preRelease, allowStarActivation, allowMissingRepository, allowUnusedFilesPattern, skipDuplicate, skipLicense, signTool, followSymlinks, }) => main((0, publish_1.publish)({
185
189
  pat,
186
190
  azureCredential,
187
191
  version,
@@ -212,7 +216,8 @@ module.exports = function (argv) {
212
216
  allowUnusedFilesPattern,
213
217
  skipDuplicate,
214
218
  skipLicense,
215
- signTool
219
+ signTool,
220
+ followSymlinks
216
221
  })));
217
222
  commander_1.default
218
223
  .command('unpublish [extensionid]')
package/out/package.js CHANGED
@@ -521,6 +521,9 @@ class MarkdownProcessor extends BaseProcessor {
521
521
  if (!this.regexp.test(filePath)) {
522
522
  return Promise.resolve(file);
523
523
  }
524
+ return await this.processFile(file, filePath);
525
+ }
526
+ async processFile(file, filePath) {
524
527
  this.filesProcessed++;
525
528
  this.assets.push({ type: this.assetType, path: filePath });
526
529
  let contents = await read(file);
@@ -668,6 +671,10 @@ class ReadmeProcessor extends MarkdownProcessor {
668
671
  constructor(manifest, options = {}) {
669
672
  super(manifest, 'README.md', options.readmePath ?? 'readme.md', 'Microsoft.VisualStudio.Services.Content.Details', options);
670
673
  }
674
+ async processFile(file) {
675
+ file.path = 'extension/readme.md';
676
+ return await super.processFile(file, file.path);
677
+ }
671
678
  async onEnd() {
672
679
  if (this.options.readmePath && this.filesProcessed === 0) {
673
680
  util.log.error(`The provided readme file (${this.options.readmePath}) could not be found.`);
@@ -680,6 +687,10 @@ class ChangelogProcessor extends MarkdownProcessor {
680
687
  constructor(manifest, options = {}) {
681
688
  super(manifest, 'CHANGELOG.md', options.changelogPath ?? 'changelog.md', 'Microsoft.VisualStudio.Services.Content.Changelog', options);
682
689
  }
690
+ async processFile(file) {
691
+ file.path = 'extension/changelog.md';
692
+ return await super.processFile(file, file.path);
693
+ }
683
694
  async onEnd() {
684
695
  if (this.options.changelogPath && this.filesProcessed === 0) {
685
696
  util.log.error(`The provided changelog file (${this.options.changelogPath}) could not be found.`);
@@ -1192,9 +1203,9 @@ const defaultIgnore = [
1192
1203
  '**/.vscode-test/**',
1193
1204
  '**/.vscode-test-web/**',
1194
1205
  ];
1195
- async function collectAllFiles(cwd, dependencies, dependencyEntryPoints) {
1206
+ async function collectAllFiles(cwd, dependencies, dependencyEntryPoints, followSymlinks = true) {
1196
1207
  const deps = await (0, npm_1.getDependencies)(cwd, dependencies, dependencyEntryPoints);
1197
- const promises = deps.map(dep => (0, glob_1.glob)('**', { cwd: dep, nodir: true, dot: true, ignore: 'node_modules/**' }).then(files => files.map(f => path.relative(cwd, path.join(dep, f))).map(f => f.replace(/\\/g, '/'))));
1208
+ const promises = deps.map(dep => (0, glob_1.glob)('**', { cwd: dep, nodir: true, follow: followSymlinks, dot: true, ignore: 'node_modules/**' }).then(files => files.map(f => path.relative(cwd, path.join(dep, f))).map(f => f.replace(/\\/g, '/'))));
1198
1209
  return Promise.all(promises).then(util.flatten);
1199
1210
  }
1200
1211
  function getDependenciesOption(options) {
@@ -1210,10 +1221,10 @@ function getDependenciesOption(options) {
1210
1221
  return undefined;
1211
1222
  }
1212
1223
  }
1213
- function collectFiles(cwd, dependencies, dependencyEntryPoints, ignoreFile, manifestFileIncludes, readmePath) {
1224
+ function collectFiles(cwd, dependencies, dependencyEntryPoints, ignoreFile, manifestFileIncludes, readmePath, followSymlinks = false) {
1214
1225
  readmePath = readmePath ?? 'README.md';
1215
1226
  const notIgnored = ['!package.json', `!${readmePath}`];
1216
- return collectAllFiles(cwd, dependencies, dependencyEntryPoints).then(files => {
1227
+ return collectAllFiles(cwd, dependencies, dependencyEntryPoints, followSymlinks).then(files => {
1217
1228
  files = files.filter(f => !/\r$/m.test(f));
1218
1229
  return (fs.promises
1219
1230
  .readFile(ignoreFile ? ignoreFile : path.join(cwd, '.vscodeignore'), 'utf8')
@@ -1225,7 +1236,7 @@ function collectFiles(cwd, dependencies, dependencyEntryPoints, ignoreFile, mani
1225
1236
  manifestFileIncludes ?
1226
1237
  // include all files in manifestFileIncludes and ignore the rest
1227
1238
  Promise.resolve(manifestFileIncludes.map(file => `!${file}`).concat(['**']).join('\n\r')) :
1228
- // "files" property not used in package.json
1239
+ // "files" property not used in package.json
1229
1240
  Promise.resolve(''))
1230
1241
  // Parse raw ignore by splitting output into lines and filtering out empty lines and comments
1231
1242
  .then(rawIgnore => rawIgnore
@@ -1294,7 +1305,7 @@ function collect(manifest, options = {}) {
1294
1305
  const packagedDependencies = options.dependencyEntryPoints || undefined;
1295
1306
  const ignoreFile = options.ignoreFile || undefined;
1296
1307
  const processors = createDefaultProcessors(manifest, options);
1297
- return collectFiles(cwd, getDependenciesOption(options), packagedDependencies, ignoreFile, manifest.files, options.readmePath).then(fileNames => {
1308
+ return collectFiles(cwd, getDependenciesOption(options), packagedDependencies, ignoreFile, manifest.files, options.readmePath, options.followSymlinks).then(fileNames => {
1298
1309
  const files = fileNames.map(f => ({ path: util.filePathToVsixPath(f), localPath: path.join(cwd, f) }));
1299
1310
  return processFiles(processors, files);
1300
1311
  });
@@ -1440,7 +1451,7 @@ async function listFiles(options = {}) {
1440
1451
  if (options.prepublish) {
1441
1452
  await prepublish(cwd, manifest, options.useYarn);
1442
1453
  }
1443
- return await collectFiles(cwd, getDependenciesOption(options), options.packagedDependencies, options.ignoreFile, manifest.files, options.readmePath);
1454
+ return await collectFiles(cwd, getDependenciesOption(options), options.packagedDependencies, options.ignoreFile, manifest.files, options.readmePath, options.followSymlinks);
1444
1455
  }
1445
1456
  exports.listFiles = listFiles;
1446
1457
  /**
@@ -1490,7 +1501,7 @@ async function printAndValidatePackagedFiles(files, cwd, manifest, options) {
1490
1501
  util.log.error(message);
1491
1502
  process.exit(1);
1492
1503
  }
1493
- // Throw an error if the extension uses the files property in package.json and
1504
+ // Throw an error if the extension uses the files property in package.json and
1494
1505
  // the package does not include at least one file for each include pattern
1495
1506
  else if (manifest.files !== undefined && manifest.files.length > 0 && !options.allowUnusedFilesPattern) {
1496
1507
  const localPaths = files.filter(f => !isInMemoryFile(f)).map(f => util.normalize(f.localPath));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vscode/vsce",
3
- "version": "3.1.1",
3
+ "version": "3.1.2-1",
4
4
  "description": "VS Code Extensions Manager",
5
5
  "repository": {
6
6
  "type": "git",