Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@eclipse-che/che-theia-devworkspace-handler

Package Overview
Dependencies
Maintainers
5
Versions
175
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eclipse-che/che-theia-devworkspace-handler - npm Package Compare versions

Comparing version 0.0.1-1637317148 to 0.0.1-1637339718

28

lib/devfile/che-theia-plugins-analyzer.js

@@ -28,11 +28,27 @@ "use strict";

const cheTheiaPluginsYamlInRepository = jsYaml.load(cheTheiaPluginsYamlContent);
// only format supported right now is list of ids as for example:
// example of the supported format:
// - id: redhat/java8/latest
// override:
// preferences:
// java.server.launchMode: LightWeight
// sidecar:
// memoryLimit: 1280Mi
// cpuLimit: 128Mi
if (cheTheiaPluginsYamlInRepository && Array.isArray(cheTheiaPluginsYamlInRepository)) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return cheTheiaPluginsYamlInRepository.map(entry => ({
id: entry.id,
resolved: false,
extensions: [],
}));
return cheTheiaPluginsYamlInRepository.map(entry => {
var _a, _b;
const sidecar = (_a = entry.override) === null || _a === void 0 ? void 0 : _a.sidecar;
if (sidecar && !sidecar.image) {
// image will be applied from the plugin registry
sidecar.image = '';
}
return {
id: entry.id,
resolved: false,
extensions: [],
preferences: (_b = entry.override) === null || _b === void 0 ? void 0 : _b.preferences,
sidecar: sidecar,
};
});
}

@@ -39,0 +55,0 @@ // not able to really see the content, return something empty

@@ -98,4 +98,17 @@ "use strict";

}
const vSCodeExtensionEntrySidecar = vSCodeExtensionEntry.sidecar;
vSCodeExtensionEntry.sidecar = sidecar;
vSCodeExtensionEntry.preferences = cheTheiaPluginYaml.preferences;
//overwrite cpu and memory limit in sidecar
if (vSCodeExtensionEntrySidecar === null || vSCodeExtensionEntrySidecar === void 0 ? void 0 : vSCodeExtensionEntrySidecar.cpuLimit) {
vSCodeExtensionEntry.sidecar.cpuLimit = vSCodeExtensionEntrySidecar.cpuLimit;
}
if (vSCodeExtensionEntrySidecar === null || vSCodeExtensionEntrySidecar === void 0 ? void 0 : vSCodeExtensionEntrySidecar.memoryLimit) {
vSCodeExtensionEntry.sidecar.memoryLimit = vSCodeExtensionEntrySidecar.memoryLimit;
}
// merge preferences
// a preference from entry should overwrite a preference from registry which has identical key
const pluginPreferences = cheTheiaPluginYaml.preferences || {};
const overriddenPreferences = vSCodeExtensionEntry.preferences || {};
const allPreferences = Object.assign(Object.assign({}, pluginPreferences), overriddenPreferences);
vSCodeExtensionEntry.preferences = allPreferences;
vSCodeExtensionEntry.dependencies = cheTheiaPluginYaml.dependencies;

@@ -102,0 +115,0 @@ }

{
"name": "@eclipse-che/che-theia-devworkspace-handler",
"version": "0.0.1-1637317148",
"version": "0.0.1-1637339718",
"private": false,

@@ -5,0 +5,0 @@ "description": "Handle management of che-theia-plugins and devWorkspace templates",

@@ -13,2 +13,3 @@ /**********************************************************************

import { V1alpha2DevWorkspaceSpecTemplateComponentsItemsContainer } from '@devfile/api';
import { VSCodeExtensionEntry } from '../api/vscode-extension-entry';

@@ -26,12 +27,27 @@ import { injectable } from 'inversify';

// only format supported right now is list of ids as for example:
// example of the supported format:
// - id: redhat/java8/latest
// override:
// preferences:
// java.server.launchMode: LightWeight
// sidecar:
// memoryLimit: 1280Mi
// cpuLimit: 128Mi
if (cheTheiaPluginsYamlInRepository && Array.isArray(cheTheiaPluginsYamlInRepository)) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return cheTheiaPluginsYamlInRepository.map(entry => ({
id: entry.id,
resolved: false,
extensions: [],
}));
return cheTheiaPluginsYamlInRepository.map(entry => {
const sidecar: V1alpha2DevWorkspaceSpecTemplateComponentsItemsContainer = entry.override?.sidecar;
if (sidecar && !sidecar.image) {
// image will be applied from the plugin registry
sidecar.image = '';
}
return {
id: entry.id,
resolved: false,
extensions: [],
preferences: entry.override?.preferences,
sidecar: sidecar,
};
});
}

@@ -38,0 +54,0 @@

@@ -137,6 +137,22 @@ /**********************************************************************

}
const vSCodeExtensionEntrySidecar = vSCodeExtensionEntry.sidecar;
vSCodeExtensionEntry.sidecar = sidecar;
vSCodeExtensionEntry.preferences = cheTheiaPluginYaml.preferences;
//overwrite cpu and memory limit in sidecar
if (vSCodeExtensionEntrySidecar?.cpuLimit) {
vSCodeExtensionEntry.sidecar.cpuLimit = vSCodeExtensionEntrySidecar.cpuLimit;
}
if (vSCodeExtensionEntrySidecar?.memoryLimit) {
vSCodeExtensionEntry.sidecar.memoryLimit = vSCodeExtensionEntrySidecar.memoryLimit;
}
// merge preferences
// a preference from entry should overwrite a preference from registry which has identical key
const pluginPreferences = cheTheiaPluginYaml.preferences || {};
const overriddenPreferences = vSCodeExtensionEntry.preferences || {};
const allPreferences = { ...pluginPreferences, ...overriddenPreferences };
vSCodeExtensionEntry.preferences = allPreferences;
vSCodeExtensionEntry.dependencies = cheTheiaPluginYaml.dependencies;
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc