@codingame/monaco-vscode-rollup-vsix-plugin 29.1.0 → 30.0.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/package.json +1 -1
- package/rollup-vsix-plugin.d.ts +1 -0
- package/rollup-vsix-plugin.js +15 -15
package/package.json
CHANGED
package/rollup-vsix-plugin.d.ts
CHANGED
|
@@ -1506,6 +1506,7 @@ interface IExtensionContributions {
|
|
|
1506
1506
|
readonly chatInstructions?: ReadonlyArray<IChatFileContribution>;
|
|
1507
1507
|
readonly chatAgents?: ReadonlyArray<IChatFileContribution>;
|
|
1508
1508
|
readonly chatSkills?: ReadonlyArray<IChatFileContribution>;
|
|
1509
|
+
readonly chatPlugins?: ReadonlyArray<IChatFileContribution>;
|
|
1509
1510
|
readonly languageModelTools?: ReadonlyArray<IToolContribution>;
|
|
1510
1511
|
readonly languageModelToolSets?: ReadonlyArray<IToolSetContribution>;
|
|
1511
1512
|
readonly mcpServerDefinitionProviders?: ReadonlyArray<IMcpCollectionContribution>;
|
package/rollup-vsix-plugin.js
CHANGED
|
@@ -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
|
|
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 (
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
|
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:
|
|
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 = './' +
|
|
8470
|
+
const assetPath = './' + nodePath.join(nodePath.dirname(resourcePath), url);
|
|
8471
8471
|
try {
|
|
8472
|
-
await fs.promises.access(
|
|
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
|
|
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(
|
|
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: `${
|
|
8570
|
+
name: `${nodePath.basename(id)}/${nodePath.basename(assetPath)}`,
|
|
8571
8571
|
source: readFileSync(assetPath)
|
|
8572
8572
|
});
|
|
8573
8573
|
}
|