@codingame/monaco-vscode-rollup-vsix-plugin 1.85.1 → 1.85.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-rollup-vsix-plugin",
3
- "version": "1.85.1",
3
+ "version": "1.85.3",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -18,9 +18,9 @@
18
18
  "module": "rollup-vsix-plugin.js",
19
19
  "types": "rollup-vsix-plugin.d.ts",
20
20
  "dependencies": {
21
- "vscode": "npm:@codingame/monaco-vscode-api@1.85.1",
21
+ "vscode": "npm:@codingame/monaco-vscode-api@1.85.3",
22
22
  "memfs": "^4.6.0",
23
23
  "mime-types": "^2.1.35",
24
- "yauzl": "^2.9.2"
24
+ "yauzl": "^2.10.0"
25
25
  }
26
26
  }
@@ -1,15 +1,12 @@
1
- /// <reference types="node" />
2
1
  import { FilterPattern } from '@rollup/pluginutils';
3
2
  import { Plugin } from 'rollup';
4
3
  import { IExtensionManifest } from './vscode/src/vs/platform/extensions/common/extensions.js';
5
- import { ExtensionResource } from './extension-tools.js';
6
4
 
7
5
  interface Options {
8
6
  include?: FilterPattern;
9
7
  exclude?: FilterPattern;
10
8
  transformManifest?: (manifest: IExtensionManifest) => IExtensionManifest;
11
- getAdditionalResources?: (manifest: IExtensionManifest, readFile: (path: string) => Promise<Buffer>, readDir: (path: string) => Promise<string[]>, glob: (pattern: string) => Promise<ExtensionResource[]>) => Promise<ExtensionResource[]>;
12
9
  }
13
- declare function plugin({ include, exclude, transformManifest, getAdditionalResources }?: Options): Plugin;
10
+ declare function plugin({ include, exclude, transformManifest }?: Options): Plugin;
14
11
 
15
12
  export { plugin as default };
@@ -1,14 +1,15 @@
1
- import { addExtension, createFilter } from '@rollup/pluginutils';
1
+ import { createFilter } from '@rollup/pluginutils';
2
2
  import * as yauzl from 'yauzl';
3
3
  import { createFsFromVolume, Volume } from 'memfs';
4
- import require$$0 from 'os';
5
- import * as path$a from 'path';
6
- import path__default from 'path';
7
- import require$$0$1 from 'util';
8
- import require$$0$2 from 'stream';
9
- import require$$0$4 from 'events';
10
- import require$$0$3 from 'fs';
4
+ import require$$0$1 from 'os';
5
+ import * as require$$0 from 'path';
6
+ import require$$0__default from 'path';
7
+ import require$$0$2 from 'util';
8
+ import require$$0$3 from 'stream';
9
+ import require$$0$5 from 'events';
10
+ import require$$0$4 from 'fs';
11
11
  import * as mime from 'mime-types';
12
+ import path$a from 'node:path';
12
13
 
13
14
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
14
15
 
@@ -78,8 +79,8 @@ var path$9 = {};
78
79
 
79
80
  Object.defineProperty(path$9, "__esModule", { value: true });
80
81
  path$9.convertPosixPathToPattern = path$9.convertWindowsPathToPattern = path$9.convertPathToPattern = path$9.escapePosixPath = path$9.escapeWindowsPath = path$9.escape = path$9.removeLeadingDotSegment = path$9.makeAbsolute = path$9.unixify = void 0;
81
- const os = require$$0;
82
- const path$8 = path__default;
82
+ const os = require$$0$1;
83
+ const path$8 = require$$0__default;
83
84
  const IS_WINDOWS_PLATFORM = os.platform() === 'win32';
84
85
  const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\
85
86
  /**
@@ -319,8 +320,8 @@ var isGlob$1 = function isGlob(str, options) {
319
320
  };
320
321
 
321
322
  var isGlob = isGlob$1;
322
- var pathPosixDirname = path__default.posix.dirname;
323
- var isWin32 = require$$0.platform() === 'win32';
323
+ var pathPosixDirname = require$$0__default.posix.dirname;
324
+ var isWin32 = require$$0$1.platform() === 'win32';
324
325
 
325
326
  var slash = '/';
326
327
  var backslash = /\\/g;
@@ -816,7 +817,7 @@ var toRegexRange_1 = toRegexRange$1;
816
817
  * Licensed under the MIT License.
817
818
  */
818
819
 
819
- const util$1 = require$$0$1;
820
+ const util$1 = require$$0$2;
820
821
  const toRegexRange = toRegexRange_1;
821
822
 
822
823
  const isObject$1 = val => val !== null && typeof val === 'object' && !Array.isArray(val);
@@ -1781,7 +1782,7 @@ var braces_1 = braces$1;
1781
1782
 
1782
1783
  var utils$f = {};
1783
1784
 
1784
- const path$7 = path__default;
1785
+ const path$7 = require$$0__default;
1785
1786
  const WIN_SLASH = '\\\\/';
1786
1787
  const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
1787
1788
 
@@ -1961,7 +1962,7 @@ var constants$3 = {
1961
1962
 
1962
1963
  (function (exports) {
1963
1964
 
1964
- const path = path__default;
1965
+ const path = require$$0__default;
1965
1966
  const win32 = process.platform === 'win32';
1966
1967
  const {
1967
1968
  REGEX_BACKSLASH,
@@ -3505,7 +3506,7 @@ parse$2.fastpaths = (input, options) => {
3505
3506
 
3506
3507
  var parse_1 = parse$2;
3507
3508
 
3508
- const path$6 = path__default;
3509
+ const path$6 = require$$0__default;
3509
3510
  const scan = scan_1;
3510
3511
  const parse$1 = parse_1;
3511
3512
  const utils$c = utils$f;
@@ -3848,7 +3849,7 @@ var picomatch_1 = picomatch$2;
3848
3849
 
3849
3850
  var picomatch$1 = picomatch_1;
3850
3851
 
3851
- const util = require$$0$1;
3852
+ const util = require$$0$2;
3852
3853
  const braces = braces_1;
3853
3854
  const picomatch = picomatch$1;
3854
3855
  const utils$b = utils$f;
@@ -4316,7 +4317,7 @@ var micromatch_1 = micromatch$1;
4316
4317
 
4317
4318
  Object.defineProperty(pattern$1, "__esModule", { value: true });
4318
4319
  pattern$1.removeDuplicateSlashes = pattern$1.matchAny = pattern$1.convertPatternsToRe = pattern$1.makeRe = pattern$1.getPatternParts = pattern$1.expandBraceExpansion = pattern$1.expandPatternsWithBraceExpansion = pattern$1.isAffectDepthOfReadingPattern = pattern$1.endsWithSlashGlobStar = pattern$1.hasGlobStar = pattern$1.getBaseDirectory = pattern$1.isPatternRelatedToParentDirectory = pattern$1.getPatternsOutsideCurrentDirectory = pattern$1.getPatternsInsideCurrentDirectory = pattern$1.getPositivePatterns = pattern$1.getNegativePatterns = pattern$1.isPositivePattern = pattern$1.isNegativePattern = pattern$1.convertToNegativePattern = pattern$1.convertToPositivePattern = pattern$1.isDynamicPattern = pattern$1.isStaticPattern = void 0;
4319
- const path$5 = path__default;
4320
+ const path$5 = require$$0__default;
4320
4321
  const globParent = globParent$1;
4321
4322
  const micromatch = micromatch_1;
4322
4323
  const GLOBSTAR = '**';
@@ -4511,7 +4512,7 @@ var stream$4 = {};
4511
4512
  * Copyright (c) 2014-2020 Teambition
4512
4513
  * Licensed under the MIT license.
4513
4514
  */
4514
- const Stream = require$$0$2;
4515
+ const Stream = require$$0$3;
4515
4516
  const PassThrough = Stream.PassThrough;
4516
4517
  const slice = Array.prototype.slice;
4517
4518
 
@@ -4891,7 +4892,7 @@ var fs$5 = {};
4891
4892
  (function (exports) {
4892
4893
  Object.defineProperty(exports, "__esModule", { value: true });
4893
4894
  exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
4894
- const fs = require$$0$3;
4895
+ const fs = require$$0$4;
4895
4896
  exports.FILE_SYSTEM_ADAPTER = {
4896
4897
  lstat: fs.lstat,
4897
4898
  stat: fs.stat,
@@ -5242,7 +5243,7 @@ var fs$1 = {};
5242
5243
  (function (exports) {
5243
5244
  Object.defineProperty(exports, "__esModule", { value: true });
5244
5245
  exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
5245
- const fs = require$$0$3;
5246
+ const fs = require$$0$4;
5246
5247
  exports.FILE_SYSTEM_ADAPTER = {
5247
5248
  lstat: fs.lstat,
5248
5249
  stat: fs.stat,
@@ -5261,7 +5262,7 @@ var fs$1 = {};
5261
5262
  } (fs$1));
5262
5263
 
5263
5264
  Object.defineProperty(settings$2, "__esModule", { value: true });
5264
- const path$3 = path__default;
5265
+ const path$3 = require$$0__default;
5265
5266
  const fsStat$3 = out$1;
5266
5267
  const fs = fs$1;
5267
5268
  let Settings$1 = class Settings {
@@ -5462,6 +5463,7 @@ function fastqueue (context, worker, concurrency) {
5462
5463
  current.release = release;
5463
5464
  current.value = value;
5464
5465
  current.callback = done || noop;
5466
+ current.errorHandler = errorHandler;
5465
5467
 
5466
5468
  if (_running === self.concurrency || self.paused) {
5467
5469
  if (queueHead) {
@@ -5681,7 +5683,7 @@ let Reader$1 = class Reader {
5681
5683
  reader$1.default = Reader$1;
5682
5684
 
5683
5685
  Object.defineProperty(async$4, "__esModule", { value: true });
5684
- const events_1 = require$$0$4;
5686
+ const events_1 = require$$0$5;
5685
5687
  const fsScandir$2 = out$2;
5686
5688
  const fastq = queueExports;
5687
5689
  const common$1 = common$3;
@@ -5810,7 +5812,7 @@ function callSuccessCallback(callback, entries) {
5810
5812
  var stream$2 = {};
5811
5813
 
5812
5814
  Object.defineProperty(stream$2, "__esModule", { value: true });
5813
- const stream_1$5 = require$$0$2;
5815
+ const stream_1$5 = require$$0$3;
5814
5816
  const async_1$3 = async$4;
5815
5817
  class StreamProvider {
5816
5818
  constructor(_root, _settings) {
@@ -5923,7 +5925,7 @@ sync$3.default = SyncProvider;
5923
5925
  var settings$1 = {};
5924
5926
 
5925
5927
  Object.defineProperty(settings$1, "__esModule", { value: true });
5926
- const path$2 = path__default;
5928
+ const path$2 = require$$0__default;
5927
5929
  const fsScandir = out$2;
5928
5930
  class Settings {
5929
5931
  constructor(_options = {}) {
@@ -5985,7 +5987,7 @@ function getSettings(settingsOrOptions = {}) {
5985
5987
  var reader = {};
5986
5988
 
5987
5989
  Object.defineProperty(reader, "__esModule", { value: true });
5988
- const path$1 = path__default;
5990
+ const path$1 = require$$0__default;
5989
5991
  const fsStat$2 = out$1;
5990
5992
  const utils$6 = utils$k;
5991
5993
  class Reader {
@@ -6020,7 +6022,7 @@ reader.default = Reader;
6020
6022
  var stream$1 = {};
6021
6023
 
6022
6024
  Object.defineProperty(stream$1, "__esModule", { value: true });
6023
- const stream_1$3 = require$$0$2;
6025
+ const stream_1$3 = require$$0$3;
6024
6026
  const fsStat$1 = out$1;
6025
6027
  const fsWalk$2 = out$3;
6026
6028
  const reader_1$2 = reader;
@@ -6373,7 +6375,7 @@ class EntryTransformer {
6373
6375
  entry.default = EntryTransformer;
6374
6376
 
6375
6377
  Object.defineProperty(provider, "__esModule", { value: true });
6376
- const path = path__default;
6378
+ const path = require$$0__default;
6377
6379
  const deep_1 = deep;
6378
6380
  const entry_1 = entry$1;
6379
6381
  const error_1 = error;
@@ -6446,7 +6448,7 @@ async$7.default = ProviderAsync;
6446
6448
  var stream = {};
6447
6449
 
6448
6450
  Object.defineProperty(stream, "__esModule", { value: true });
6449
- const stream_1$1 = require$$0$2;
6451
+ const stream_1$1 = require$$0$3;
6450
6452
  const stream_2 = stream$1;
6451
6453
  const provider_1$1 = provider;
6452
6454
  class ProviderStream extends provider_1$1.default {
@@ -6551,8 +6553,8 @@ var settings = {};
6551
6553
  (function (exports) {
6552
6554
  Object.defineProperty(exports, "__esModule", { value: true });
6553
6555
  exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
6554
- const fs = require$$0$3;
6555
- const os = require$$0;
6556
+ const fs = require$$0$4;
6557
+ const os = require$$0$1;
6556
6558
  /**
6557
6559
  * The `os.cpus` method can return zero. We expect the number of cores to be greater than zero.
6558
6560
  * https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107
@@ -7590,213 +7592,26 @@ function getParseErrorMessage(errorCode) {
7590
7592
  }
7591
7593
  }
7592
7594
 
7593
- var embeddedRegexp = /^data:(.*?),(.*?)/;
7594
- var commentRegexp = /\/\*([\s\S]*?)\*\//g;
7595
- var urlsRegexp = /(?:@import\s+)?url\s*\(\s*(("(.*?)")|('(.*?)')|(.*?))\s*\)|(?:@import\s+)(("(.*?)")|('(.*?)')|(.*?))[\s;]/ig;
7596
-
7597
- function isEmbedded (src) {
7598
- return embeddedRegexp.test(src.trim());
7599
- }
7600
-
7601
- function getUrls (text) {
7602
- var urls = [];
7603
- var urlMatch, url;
7604
-
7605
- text = text.replace(commentRegexp, '');
7606
-
7607
- while ((urlMatch = urlsRegexp.exec(text))) {
7608
- // Match 3, 5, 6 group if '[@import] url(path)', match 9, 11, 12 group if '@import path'
7609
- url = urlMatch[3] || urlMatch[5] || urlMatch[6] || urlMatch[9] || urlMatch[11] || urlMatch[12];
7610
-
7611
- if (url && !isEmbedded(url) && urls.indexOf(url) === -1) {
7612
- urls.push(url);
7613
- }
7614
- }
7615
-
7616
- return urls;
7617
- }
7618
-
7619
- var cssParser = getUrls;
7620
-
7621
- var parseCssUrls = cssParser;
7622
- var cssUrlParser = parseCssUrls;
7623
-
7624
- var parseCssUrl = /*@__PURE__*/getDefaultExportFromCjs(cssUrlParser);
7625
-
7626
- function extractCommandResources(command) {
7627
- if (Array.isArray(command)) {
7628
- return command.flatMap(extractCommandResources);
7595
+ function lookupMime(path) {
7596
+ const mimeType = mime.lookup(path);
7597
+ if (mimeType === false) {
7598
+ return undefined;
7629
7599
  }
7630
- if (command.icon != null) {
7631
- if (typeof command.icon === 'object') {
7632
- return [{ path: command.icon.light }, { path: command.icon.dark }];
7633
- }
7634
- else {
7635
- return [{ path: command.icon }];
7636
- }
7637
- }
7638
- return [];
7639
- }
7640
- function extractGrammarResources(grammar) {
7641
- return [{ path: grammar.path }];
7600
+ return mimeType;
7642
7601
  }
7643
- function extractLanguageResources(language) {
7644
- const resources = [];
7645
- if (language.icon != null) {
7646
- resources.push({ path: language.icon.dark }, { path: language.icon.light });
7647
- }
7648
- if (language.configuration != null) {
7649
- resources.push({ path: language.configuration, mimeType: 'application/json' });
7650
- }
7651
- return resources;
7652
- }
7653
- function extractSnippetsResources(snippet) {
7654
- return [{ path: snippet.path, mimeType: 'application/json' }];
7655
- }
7656
- async function extractThemeResources(theme, getFileContent) {
7657
- const themeContent = await getFileContent(theme.path);
7658
- const themeDocument = parseJson(theme.path, themeContent.toString('utf8'));
7659
- const paths = [{ path: theme.path, mimeType: 'application/json' }];
7660
- if (themeDocument.fonts != null) {
7661
- for (const font of themeDocument.fonts) {
7662
- for (const src of font.src) {
7663
- paths.push({ path: path$a.join(path$a.dirname(theme.path), src.path) });
7664
- }
7665
- }
7666
- }
7667
- if (themeDocument.iconDefinitions != null) {
7668
- for (const iconDefinition of Object.values(themeDocument.iconDefinitions)) {
7669
- if (iconDefinition.iconPath != null) {
7670
- paths.push({ path: path$a.join(path$a.dirname(theme.path), iconDefinition.iconPath) });
7671
- }
7672
- }
7602
+ function getPaths(filePath) {
7603
+ const paths = [filePath];
7604
+ if (path$a.extname(filePath) === '.js') {
7605
+ paths.push(filePath.substring(0, filePath.lastIndexOf('.')));
7673
7606
  }
7674
7607
  return paths;
7675
7608
  }
7676
- function extractJsonValidationResources(jsonValidation) {
7677
- if (jsonValidation.url.startsWith('./')) {
7678
- return [{ path: jsonValidation.url }];
7679
- }
7680
- return [];
7681
- }
7682
- function extractViewsContainerResources(viewContainers) {
7683
- return Object.values(viewContainers).flatMap(containers => containers.map(container => ({ path: container.icon })));
7684
- }
7685
- async function extractResourcesFromExtensionManifestContribute(contribute, getFileContent) {
7686
- const resources = [];
7687
- if (contribute.commands != null)
7688
- resources.push(...extractCommandResources(contribute.commands));
7689
- if (contribute.grammars != null)
7690
- resources.push(...contribute.grammars.flatMap(extractGrammarResources));
7691
- if (contribute.languages != null)
7692
- resources.push(...contribute.languages.flatMap(extractLanguageResources));
7693
- if (contribute.snippets != null)
7694
- resources.push(...contribute.snippets.flatMap(extractSnippetsResources));
7695
- if (contribute.themes != null)
7696
- resources.push(...((await Promise.all(contribute.themes.map(theme => extractThemeResources(theme, getFileContent), getFileContent))).flat()));
7697
- if (contribute.iconThemes != null)
7698
- resources.push(...((await Promise.all(contribute.iconThemes.map(theme => extractThemeResources(theme, getFileContent), getFileContent))).flat()));
7699
- if (contribute.productIconThemes != null)
7700
- resources.push(...((await Promise.all(contribute.productIconThemes.map(theme => extractThemeResources(theme, getFileContent), getFileContent))).flat()));
7701
- if (contribute.jsonValidation != null)
7702
- resources.push(...contribute.jsonValidation.flatMap(extractJsonValidationResources));
7703
- if (contribute.viewsContainers != null)
7704
- resources.push(...extractViewsContainerResources(contribute.viewsContainers));
7705
- if (contribute['markdown.previewStyles'] != null) {
7706
- resources.push(...(await Promise.all(contribute['markdown.previewStyles'].map(async (path) => [
7707
- { path, mimeType: 'text/css' },
7708
- ...(await extractResources(path, getFileContent))
7709
- ]))).flat());
7710
- }
7711
- if (contribute['markdown.previewScripts'] != null) {
7712
- resources.push(...(await Promise.all(contribute['markdown.previewScripts'].map(async (path) => [
7713
- { path, mimeType: 'text/javascript' },
7714
- ...(await extractResources(path, getFileContent))
7715
- ]))).flat());
7716
- }
7717
- return resources.filter((resource, index, list) => !resource.path.startsWith('$(') && !list.slice(0, index).some(o => o === resource));
7718
- }
7719
- async function extractResourcesFromExtensionManifest(manifest, getFileContent, listFiles) {
7720
- let resources = [];
7721
- if (manifest.contributes != null) {
7722
- resources.push(...await extractResourcesFromExtensionManifestContribute(manifest.contributes, getFileContent));
7723
- }
7724
- if (manifest.browser != null) {
7725
- const jsPath = addExtension(manifest.browser, '.js');
7726
- resources.push({ path: manifest.browser, mimeType: 'text/javascript', realPath: jsPath });
7727
- resources.push(...(await extractResources(jsPath, getFileContent)));
7728
- }
7729
- if (manifest.main != null) {
7730
- const jsPath = addExtension(manifest.main, '.js');
7731
- resources.push({ path: manifest.main, mimeType: 'text/javascript', realPath: jsPath });
7732
- resources.push(...(await extractResources(jsPath, getFileContent)));
7733
- }
7734
- const nlsFiles = (await listFiles('/')).filter(file => /^package\.nls(?:\..*)?\.json$/.exec(file) != null);
7735
- resources.push(...nlsFiles.map(path => ({
7609
+ function toResource(path) {
7610
+ return {
7736
7611
  path,
7737
- mimeType: 'application/json'
7738
- })));
7739
- if (manifest.l10n != null) {
7740
- const bundleFiles = (await listFiles(manifest.l10n)).filter(file => /^bundle\.l10n(?:\..*)?\.json$/.exec(file) != null);
7741
- resources.push(...bundleFiles.map(path => ({
7742
- path,
7743
- mimeType: 'application/json'
7744
- })));
7745
- }
7746
- resources = resources.map(r => {
7747
- if (r.mimeType == null) {
7748
- const detectedType = mime.lookup(r.path);
7749
- if (detectedType !== false) {
7750
- return {
7751
- ...r,
7752
- mimeType: detectedType
7753
- };
7754
- }
7755
- }
7756
- return r;
7757
- });
7758
- // remove duplicates
7759
- return Object.values(Object.fromEntries(resources.map(r => [r.path, r])));
7760
- }
7761
- async function extractResources(resourcePath, getFileContent) {
7762
- const resources = [];
7763
- const content = (await getFileContent(resourcePath)).toString('utf-8');
7764
- if (resourcePath.endsWith('.js')) {
7765
- for (const match of content.matchAll(/\/\/# sourceMappingURL=(.*)$/g)) {
7766
- resources.push({ path: path$a.join(path$a.dirname(resourcePath), match[1]) });
7767
- }
7768
- for (const match of content.matchAll(/Uri\.joinPath\(context\.extensionUri, '([^']+)'\)/g)) {
7769
- resources.push({ path: match[1] });
7770
- resources.push(...(await extractResources(match[1], getFileContent)));
7771
- }
7772
- for (const match of content.matchAll(/this.extensionResource\('media', '(.*)'\)/g)) {
7773
- resources.push({ path: `./media/${match[1]}` });
7774
- resources.push(...(await extractResources(`./media/${match[1]}`, getFileContent)));
7775
- }
7776
- for (const match of content.matchAll(/this\._extensionResourcePath\(resourceProvider, '(.*)'\)/g)) {
7777
- resources.push({ path: `./media/${match[1]}` });
7778
- resources.push(...(await extractResources(`./media/${match[1]}`, getFileContent)));
7779
- }
7780
- for (const match of content.matchAll(/this\.extensionResourceUrl\('media', '(.*)'\)/g)) {
7781
- resources.push({ path: `./media/${match[1]}` });
7782
- resources.push(...(await extractResources(`./media/${match[1]}`, getFileContent)));
7783
- }
7784
- }
7785
- if (resourcePath.endsWith('.css')) {
7786
- const urls = parseCssUrl(content);
7787
- for (const url of urls) {
7788
- const assetPath = './' + path$a.join(path$a.dirname(resourcePath), url);
7789
- try {
7790
- await getFileContent(assetPath);
7791
- resources.push({ path: assetPath });
7792
- }
7793
- catch (err) {
7794
- // ignore, the file doesn't exist
7795
- // It happens for the markdown-math extension without consequences
7796
- }
7797
- }
7798
- }
7799
- return resources;
7612
+ extensionPaths: getPaths(path),
7613
+ mimeType: lookupMime(path)
7614
+ };
7800
7615
  }
7801
7616
  function parseJson(path, text) {
7802
7617
  const errors = [];
@@ -7847,9 +7662,9 @@ async function readVsix(file) {
7847
7662
  });
7848
7663
  }
7849
7664
  function getVsixPath(file) {
7850
- return path$a.relative('/', path$a.resolve('/', file));
7665
+ return require$$0.relative('/', require$$0.resolve('/', file));
7851
7666
  }
7852
- function plugin({ include = '**/*.vsix', exclude, transformManifest = manifest => manifest, getAdditionalResources = () => Promise.resolve([]) } = {}) {
7667
+ function plugin({ include = '**/*.vsix', exclude, transformManifest = manifest => manifest } = {}) {
7853
7668
  const filter = createFilter(include, exclude);
7854
7669
  return {
7855
7670
  name: 'vsix-loader',
@@ -7866,29 +7681,15 @@ function plugin({ include = '**/*.vsix', exclude, transformManifest = manifest =
7866
7681
  if (!filter(id))
7867
7682
  return null;
7868
7683
  const vsixFS = await readVsix(id);
7869
- const readFileSync = (filePath) => vsixFS.readFileSync(path$a.join('/', filePath));
7684
+ const readFileSync = (filePath) => vsixFS.readFileSync(require$$0.join('/', filePath));
7870
7685
  const manifest = transformManifest(parseJson(id, readFileSync('package.json').toString('utf8')));
7871
- const getFileContent = async (filePath) => {
7872
- return readFileSync(filePath);
7873
- };
7874
- const listFiles = async (filePath) => {
7875
- return vsixFS.readdirSync(path$a.join('/', filePath));
7876
- };
7877
- const extensionResources = (await extractResourcesFromExtensionManifest(manifest, getFileContent, listFiles))
7878
- .filter(resource => vsixFS.existsSync(path$a.join('/', resource.realPath ?? resource.path)));
7879
- async function _glob(pattern) {
7880
- return (await glob(pattern, {
7881
- fs: vsixFS,
7882
- cwd: '/',
7883
- onlyFiles: true
7884
- })).map(path => ({ path }));
7885
- }
7886
- const resources = [
7887
- ...extensionResources,
7888
- ...await getAdditionalResources(manifest, getFileContent, listFiles, _glob)
7889
- ];
7686
+ const resources = (await glob('**/*', {
7687
+ fs: vsixFS,
7688
+ cwd: id,
7689
+ onlyFiles: true
7690
+ })).map(toResource);
7890
7691
  const pathMapping = (await Promise.all(resources.map(async (resource) => {
7891
- const assetPath = getVsixPath(resource.realPath ?? resource.path);
7692
+ const assetPath = getVsixPath(resource.path);
7892
7693
  let url;
7893
7694
  if (process.env.NODE_ENV === 'development') {
7894
7695
  const fileType = resource.mimeType ?? 'text/javascript';
@@ -7897,21 +7698,15 @@ function plugin({ include = '**/*.vsix', exclude, transformManifest = manifest =
7897
7698
  else {
7898
7699
  url = 'import.meta.ROLLUP_FILE_URL_' + this.emitFile({
7899
7700
  type: 'asset',
7900
- name: `${path$a.basename(id)}/${path$a.basename(assetPath)}`,
7701
+ name: `${require$$0.basename(id)}/${require$$0.basename(assetPath)}`,
7901
7702
  source: readFileSync(assetPath)
7902
7703
  });
7903
7704
  }
7904
- return [{
7905
- pathInExtension: getVsixPath(resource.path),
7906
- url,
7907
- mimeType: resource.mimeType
7908
- }, ...(resource.realPath != null
7909
- ? [{
7910
- pathInExtension: getVsixPath(resource.realPath),
7911
- url,
7912
- mimeType: resource.mimeType
7913
- }]
7914
- : [])];
7705
+ return resource.extensionPaths.map(extensionPath => ({
7706
+ pathInExtension: getVsixPath(extensionPath),
7707
+ url,
7708
+ mimeType: resource.mimeType
7709
+ }));
7915
7710
  }))).flat();
7916
7711
  return `
7917
7712
  import { registerExtension } from 'vscode/extensions'
@@ -0,0 +1,90 @@
1
+ type JSONSchemaType = 'string' | 'number' | 'integer' | 'boolean' | 'null' | 'array' | 'object';
2
+ interface IJSONSchema {
3
+ id?: string;
4
+ $id?: string;
5
+ $schema?: string;
6
+ type?: JSONSchemaType | JSONSchemaType[];
7
+ title?: string;
8
+ default?: any;
9
+ definitions?: IJSONSchemaMap;
10
+ description?: string;
11
+ properties?: IJSONSchemaMap;
12
+ patternProperties?: IJSONSchemaMap;
13
+ additionalProperties?: boolean | IJSONSchema;
14
+ minProperties?: number;
15
+ maxProperties?: number;
16
+ dependencies?: IJSONSchemaMap | {
17
+ [prop: string]: string[];
18
+ };
19
+ items?: IJSONSchema | IJSONSchema[];
20
+ minItems?: number;
21
+ maxItems?: number;
22
+ uniqueItems?: boolean;
23
+ additionalItems?: boolean | IJSONSchema;
24
+ pattern?: string;
25
+ minLength?: number;
26
+ maxLength?: number;
27
+ minimum?: number;
28
+ maximum?: number;
29
+ exclusiveMinimum?: boolean | number;
30
+ exclusiveMaximum?: boolean | number;
31
+ multipleOf?: number;
32
+ required?: string[];
33
+ $ref?: string;
34
+ anyOf?: IJSONSchema[];
35
+ allOf?: IJSONSchema[];
36
+ oneOf?: IJSONSchema[];
37
+ not?: IJSONSchema;
38
+ enum?: any[];
39
+ format?: string;
40
+ const?: any;
41
+ contains?: IJSONSchema;
42
+ propertyNames?: IJSONSchema;
43
+ examples?: any[];
44
+ $comment?: string;
45
+ if?: IJSONSchema;
46
+ then?: IJSONSchema;
47
+ else?: IJSONSchema;
48
+ unevaluatedProperties?: boolean | IJSONSchema;
49
+ unevaluatedItems?: boolean | IJSONSchema;
50
+ minContains?: number;
51
+ maxContains?: number;
52
+ deprecated?: boolean;
53
+ dependentRequired?: {
54
+ [prop: string]: string[];
55
+ };
56
+ dependentSchemas?: IJSONSchemaMap;
57
+ $defs?: {
58
+ [name: string]: IJSONSchema;
59
+ };
60
+ $anchor?: string;
61
+ $recursiveRef?: string;
62
+ $recursiveAnchor?: string;
63
+ $vocabulary?: any;
64
+ prefixItems?: IJSONSchema[];
65
+ $dynamicRef?: string;
66
+ $dynamicAnchor?: string;
67
+ defaultSnippets?: IJSONSchemaSnippet[];
68
+ errorMessage?: string;
69
+ patternErrorMessage?: string;
70
+ deprecationMessage?: string;
71
+ markdownDeprecationMessage?: string;
72
+ enumDescriptions?: string[];
73
+ markdownEnumDescriptions?: string[];
74
+ markdownDescription?: string;
75
+ doNotSuggest?: boolean;
76
+ suggestSortText?: string;
77
+ allowComments?: boolean;
78
+ allowTrailingCommas?: boolean;
79
+ }
80
+ interface IJSONSchemaMap {
81
+ [name: string]: IJSONSchema;
82
+ }
83
+ interface IJSONSchemaSnippet {
84
+ label?: string;
85
+ description?: string;
86
+ body?: any;
87
+ bodyText?: string;
88
+ }
89
+
90
+ export type { IJSONSchema, IJSONSchemaMap, IJSONSchemaSnippet, JSONSchemaType };