@codingame/monaco-vscode-rollup-vsix-plugin 29.1.0 → 29.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-rollup-vsix-plugin",
3
- "version": "29.1.0",
3
+ "version": "29.1.1",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -2,7 +2,7 @@ import { createFilter } from '@rollup/pluginutils';
2
2
  import * as yauzl from 'yauzl';
3
3
  import { createFsFromVolume, Volume } from 'memfs';
4
4
  import thenby from 'thenby';
5
- import * as path$1 from 'node:path';
5
+ import * as nodePath from 'node:path';
6
6
  import parseCssUrl from 'css-url-parser';
7
7
  import * as mime from 'mime-types';
8
8
  import require$$0 from 'os';
@@ -8291,7 +8291,7 @@ function lookupMime(path) {
8291
8291
  }
8292
8292
  function getPaths(filePath) {
8293
8293
  const paths = [filePath];
8294
- if (path$1.extname(filePath) === '.js') {
8294
+ if (nodePath.extname(filePath) === '.js') {
8295
8295
  paths.push(filePath.substring(0, filePath.lastIndexOf('.')));
8296
8296
  }
8297
8297
  return paths;
@@ -8301,7 +8301,7 @@ function toResource(resourcePath, fs, cwd) {
8301
8301
  path: resourcePath,
8302
8302
  extensionPaths: getPaths(resourcePath),
8303
8303
  mimeType: lookupMime(resourcePath),
8304
- size: fs.statSync(path$1.resolve(cwd, resourcePath)).size
8304
+ size: fs.statSync(nodePath.resolve(cwd, resourcePath)).size
8305
8305
  };
8306
8306
  }
8307
8307
  function extractCommandResources(command) {
@@ -8335,25 +8335,25 @@ function extractSnippetsResources(snippet) {
8335
8335
  return [snippet.path];
8336
8336
  }
8337
8337
  async function extractThemeResources(theme, fs, cwd) {
8338
- const themeContent = await fs.promises.readFile(path$1.join(cwd, theme.path));
8338
+ const themeContent = await fs.promises.readFile(nodePath.join(cwd, theme.path));
8339
8339
  const themeDocument = parseJson(theme.path, themeContent.toString('utf8'));
8340
8340
  const paths = [theme.path];
8341
8341
  if (themeDocument.fonts != null) {
8342
8342
  for (const font of themeDocument.fonts) {
8343
8343
  for (const src of font.src) {
8344
- paths.push(path$1.join(path$1.dirname(theme.path), src.path));
8344
+ paths.push(nodePath.join(nodePath.dirname(theme.path), src.path));
8345
8345
  }
8346
8346
  }
8347
8347
  }
8348
8348
  if (themeDocument.iconDefinitions != null) {
8349
8349
  for (const iconDefinition of Object.values(themeDocument.iconDefinitions)) {
8350
8350
  if (iconDefinition.iconPath != null) {
8351
- paths.push(path$1.join(path$1.dirname(theme.path), iconDefinition.iconPath));
8351
+ paths.push(nodePath.join(nodePath.dirname(theme.path), iconDefinition.iconPath));
8352
8352
  }
8353
8353
  }
8354
8354
  }
8355
8355
  if (themeDocument.include != null) {
8356
- paths.push(path$1.join(path$1.dirname(theme.path), themeDocument.include));
8356
+ paths.push(nodePath.join(nodePath.dirname(theme.path), themeDocument.include));
8357
8357
  }
8358
8358
  return paths;
8359
8359
  }
@@ -8446,11 +8446,11 @@ async function extractResourcesFromExtensionManifest(manifest, fs, cwd) {
8446
8446
  cwd,
8447
8447
  onlyFiles: true
8448
8448
  });
8449
- resources.push(...manifestFiles.map((path) => path));
8449
+ resources.push(...manifestFiles);
8450
8450
  if (manifest.l10n != null) {
8451
8451
  const bundleFiles = await outExports.glob('{bundle.l10n.json,bundle.l10n.*.json}', {
8452
8452
  fs: fs,
8453
- cwd: path$1.join(cwd, manifest.l10n),
8453
+ cwd: nodePath.join(cwd, manifest.l10n),
8454
8454
  onlyFiles: true
8455
8455
  });
8456
8456
  resources.push(...bundleFiles);
@@ -8459,7 +8459,7 @@ async function extractResourcesFromExtensionManifest(manifest, fs, cwd) {
8459
8459
  resources.push(manifest.icon);
8460
8460
  }
8461
8461
  // remove duplicates
8462
- return Array.from(new Set(resources));
8462
+ return Array.from(new Set(resources.map((p) => nodePath.normalize(p))));
8463
8463
  }
8464
8464
  async function extractResources(resourcePath, fs, cwd) {
8465
8465
  const resources = [];
@@ -8467,9 +8467,9 @@ async function extractResources(resourcePath, fs, cwd) {
8467
8467
  if (resourcePath.endsWith('.css')) {
8468
8468
  const urls = parseCssUrl(content);
8469
8469
  for (const url of urls) {
8470
- const assetPath = './' + path$1.join(path$1.dirname(resourcePath), url);
8470
+ const assetPath = './' + nodePath.join(nodePath.dirname(resourcePath), url);
8471
8471
  try {
8472
- await fs.promises.access(path$1.join(cwd, assetPath));
8472
+ await fs.promises.access(nodePath.join(cwd, assetPath));
8473
8473
  resources.push(assetPath);
8474
8474
  }
8475
8475
  catch {
@@ -8530,7 +8530,7 @@ async function readVsix(file) {
8530
8530
  });
8531
8531
  }
8532
8532
  function getVsixPath(file) {
8533
- return path$1.posix.relative('/', path$1.posix.resolve('/', file));
8533
+ return nodePath.posix.relative('/', nodePath.posix.resolve('/', file));
8534
8534
  }
8535
8535
  function plugin({ include = '**/*.vsix', exclude, transformManifest = (manifest) => manifest } = {}) {
8536
8536
  const filter = createFilter(include, exclude);
@@ -8549,7 +8549,7 @@ function plugin({ include = '**/*.vsix', exclude, transformManifest = (manifest)
8549
8549
  if (!filter(id))
8550
8550
  return null;
8551
8551
  const vsixFS = await readVsix(id);
8552
- const readFileSync = (filePath) => vsixFS.readFileSync(path$1.join('/', filePath));
8552
+ const readFileSync = (filePath) => vsixFS.readFileSync(nodePath.join('/', filePath));
8553
8553
  const manifest = transformManifest(parseJson(id, readFileSync('package.json').toString('utf8')));
8554
8554
  const resources = await getExtensionResources(manifest, vsixFS, '/');
8555
8555
  const resourcePaths = resources.map((r) => r.path);
@@ -8567,7 +8567,7 @@ function plugin({ include = '**/*.vsix', exclude, transformManifest = (manifest)
8567
8567
  'import.meta.ROLLUP_FILE_URL_' +
8568
8568
  this.emitFile({
8569
8569
  type: 'asset',
8570
- name: `${path$1.basename(id)}/${path$1.basename(assetPath)}`,
8570
+ name: `${nodePath.basename(id)}/${nodePath.basename(assetPath)}`,
8571
8571
  source: readFileSync(assetPath)
8572
8572
  });
8573
8573
  }