@codingame/monaco-vscode-rollup-vsix-plugin 2.1.4 → 2.2.0-next.2
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 +2 -2
- package/rollup-vsix-plugin.js +14 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-rollup-vsix-plugin",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0-next.2",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,7 +18,7 @@
|
|
|
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@2.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@2.2.0-next.2",
|
|
22
22
|
"css-url-parser": "^1.1.3",
|
|
23
23
|
"memfs": "^4.6.0",
|
|
24
24
|
"mime-types": "^2.1.35",
|
package/rollup-vsix-plugin.js
CHANGED
|
@@ -7736,6 +7736,13 @@ async function getExtensionResources(manifest, fs, cwd) {
|
|
|
7736
7736
|
}
|
|
7737
7737
|
async function extractResourcesFromExtensionManifest(manifest, fs, cwd) {
|
|
7738
7738
|
const resources = [];
|
|
7739
|
+
const children = await fs.promises.readdir('/');
|
|
7740
|
+
const readme = children.filter(child => /^readme(\.txt|\.md|)$/i.test(child))[0];
|
|
7741
|
+
if (readme != null)
|
|
7742
|
+
resources.push(readme);
|
|
7743
|
+
const changelog = children.filter(child => /^changelog(\.txt|\.md|)$/i.test(child))[0];
|
|
7744
|
+
if (changelog != null)
|
|
7745
|
+
resources.push(changelog);
|
|
7739
7746
|
if (manifest.contributes != null) {
|
|
7740
7747
|
resources.push(...await extractResourcesFromExtensionManifestContribute(manifest.contributes, fs, cwd));
|
|
7741
7748
|
}
|
|
@@ -7753,6 +7760,9 @@ async function extractResourcesFromExtensionManifest(manifest, fs, cwd) {
|
|
|
7753
7760
|
}));
|
|
7754
7761
|
resources.push(...bundleFiles);
|
|
7755
7762
|
}
|
|
7763
|
+
if (manifest.icon != null) {
|
|
7764
|
+
resources.push(manifest.icon);
|
|
7765
|
+
}
|
|
7756
7766
|
// remove duplicates
|
|
7757
7767
|
return Array.from(new Set(resources));
|
|
7758
7768
|
}
|
|
@@ -7846,6 +7856,9 @@ function plugin({ include = '**/*.vsix', exclude, transformManifest = manifest =
|
|
|
7846
7856
|
const readFileSync = (filePath) => vsixFS.readFileSync(path$a.join('/', filePath));
|
|
7847
7857
|
const manifest = transformManifest(parseJson(id, readFileSync('package.json').toString('utf8')));
|
|
7848
7858
|
const resources = await getExtensionResources(manifest, vsixFS, '/');
|
|
7859
|
+
const resourcePaths = resources.map(r => r.path);
|
|
7860
|
+
const readmePath = resourcePaths.filter(child => /^readme(\.txt|\.md|)$/i.test(child))[0];
|
|
7861
|
+
const changelogPath = resourcePaths.filter(child => /^changelog(\.txt|\.md|)$/i.test(child))[0];
|
|
7849
7862
|
const pathMapping = (await Promise.all(resources.map(async (resource) => {
|
|
7850
7863
|
const assetPath = getVsixPath(resource.path);
|
|
7851
7864
|
let url;
|
|
@@ -7871,7 +7884,7 @@ import { registerExtension } from 'vscode/extensions'
|
|
|
7871
7884
|
|
|
7872
7885
|
const manifest = ${JSON.stringify(manifest)}
|
|
7873
7886
|
|
|
7874
|
-
const { registerFileUrl, whenReady } = registerExtension(manifest)
|
|
7887
|
+
const { registerFileUrl, whenReady } = registerExtension(manifest, undefined, ${JSON.stringify({ system: true, readmePath, changelogPath })})
|
|
7875
7888
|
|
|
7876
7889
|
${pathMapping.map(({ pathInExtension, url, mimeType }) => (`
|
|
7877
7890
|
registerFileUrl('${pathInExtension}', ${url}${mimeType != null ? `, '${mimeType}'` : ''})`)).join('\n')}
|