@vscode/vsce 3.2.1 → 3.2.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/out/package.js +11 -9
- package/package.json +1 -1
package/out/package.js
CHANGED
|
@@ -627,6 +627,7 @@ class MarkdownProcessor extends BaseProcessor {
|
|
|
627
627
|
return {
|
|
628
628
|
path: file.path,
|
|
629
629
|
contents: Buffer.from(contents, 'utf8'),
|
|
630
|
+
originalPath: file.originalPath
|
|
630
631
|
};
|
|
631
632
|
}
|
|
632
633
|
// GitHub heuristics
|
|
@@ -672,7 +673,7 @@ class ReadmeProcessor extends MarkdownProcessor {
|
|
|
672
673
|
super(manifest, 'README.md', options.readmePath ?? 'readme.md', 'Microsoft.VisualStudio.Services.Content.Details', options);
|
|
673
674
|
}
|
|
674
675
|
async processFile(file) {
|
|
675
|
-
file.path
|
|
676
|
+
file = { ...file, originalPath: !isInMemoryFile(file) ? file.localPath : undefined, path: 'extension/readme.md' };
|
|
676
677
|
return await super.processFile(file, file.path);
|
|
677
678
|
}
|
|
678
679
|
async onEnd() {
|
|
@@ -688,7 +689,7 @@ class ChangelogProcessor extends MarkdownProcessor {
|
|
|
688
689
|
super(manifest, 'CHANGELOG.md', options.changelogPath ?? 'changelog.md', 'Microsoft.VisualStudio.Services.Content.Changelog', options);
|
|
689
690
|
}
|
|
690
691
|
async processFile(file) {
|
|
691
|
-
file.path
|
|
692
|
+
file = { ...file, originalPath: !isInMemoryFile(file) ? file.localPath : undefined, path: 'extension/changelog.md' };
|
|
692
693
|
return await super.processFile(file, file.path);
|
|
693
694
|
}
|
|
694
695
|
async onEnd() {
|
|
@@ -1504,17 +1505,18 @@ async function printAndValidatePackagedFiles(files, cwd, manifest, options) {
|
|
|
1504
1505
|
// Throw an error if the extension uses the files property in package.json and
|
|
1505
1506
|
// the package does not include at least one file for each include pattern
|
|
1506
1507
|
else if (manifest.files !== undefined && manifest.files.length > 0 && !options.allowUnusedFilesPattern) {
|
|
1507
|
-
const localPaths = files.
|
|
1508
|
-
const filesIncludePatterns = manifest.files.map(includePattern => util.normalize(path.join(cwd, includePattern)));
|
|
1508
|
+
const localPaths = files.map(f => util.normalize(f.originalPath ?? (!isInMemoryFile(f) ? f.localPath : path.join(cwd, f.path))));
|
|
1509
|
+
const filesIncludePatterns = manifest.files.map(includePattern => ({ absolute: util.normalize(path.join(cwd, includePattern)), relative: includePattern }));
|
|
1509
1510
|
const unusedIncludePatterns = filesIncludePatterns.filter(includePattern => {
|
|
1511
|
+
let absoluteIncludePattern = includePattern.absolute;
|
|
1510
1512
|
// Check if the pattern provided by the user matches any file in the package
|
|
1511
|
-
if (localPaths.some(localFilePath => (0, minimatch_1.default)(localFilePath,
|
|
1513
|
+
if (localPaths.some(localFilePath => (0, minimatch_1.default)(localFilePath, absoluteIncludePattern, MinimatchOptions))) {
|
|
1512
1514
|
return false;
|
|
1513
1515
|
}
|
|
1514
1516
|
// Check if the pattern provided by the user matches any folder in the package
|
|
1515
|
-
if (!/(^|\/)[^/]*\*[^/]*$/.test(
|
|
1516
|
-
|
|
1517
|
-
return !localPaths.some(localFilePath => (0, minimatch_1.default)(localFilePath,
|
|
1517
|
+
if (!/(^|\/)[^/]*\*[^/]*$/.test(absoluteIncludePattern)) {
|
|
1518
|
+
absoluteIncludePattern = (/\/$/.test(absoluteIncludePattern) ? `${absoluteIncludePattern}**` : `${absoluteIncludePattern}/**`);
|
|
1519
|
+
return !localPaths.some(localFilePath => (0, minimatch_1.default)(localFilePath, absoluteIncludePattern, MinimatchOptions));
|
|
1518
1520
|
}
|
|
1519
1521
|
// Pattern does not match any file or folder
|
|
1520
1522
|
return true;
|
|
@@ -1522,7 +1524,7 @@ async function printAndValidatePackagedFiles(files, cwd, manifest, options) {
|
|
|
1522
1524
|
if (unusedIncludePatterns.length > 0) {
|
|
1523
1525
|
let message = '';
|
|
1524
1526
|
message += `The following include patterns in the ${chalk_1.default.bold('"files"')} property in package.json do not match any files packaged in the extension:\n`;
|
|
1525
|
-
message += unusedIncludePatterns.map(p => ` - ${p}`).join('\n');
|
|
1527
|
+
message += unusedIncludePatterns.map(p => ` - ${p.relative}`).join('\n');
|
|
1526
1528
|
message += '\nRemove any include pattern which is not needed.\n';
|
|
1527
1529
|
message += `\n=> Run ${chalk_1.default.bold('vsce ls --tree')} to see all included files.\n`;
|
|
1528
1530
|
message += `=> Use ${chalk_1.default.bold('--allow-unused-files-pattern')} to skip this check`;
|