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

@eclipse-che/che-devworkspace-generator

Package Overview
Dependencies
Maintainers
5
Versions
163
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eclipse-che/che-devworkspace-generator - npm Package Compare versions

Comparing version 0.0.1-58f79fb to 0.0.1-602dcb4

1

lib/generate.d.ts

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

generateContent(devfileContent: string, editorContent: string, injectDefaultComponent?: string, defaultComponentImage?: string): Promise<DevfileContext>;
private createDevWorkspaceMetadata;
}

@@ -114,3 +114,3 @@ "use strict";

editorDevfile = jsYaml.load(editorContent);
metadata = editorDevfile.metadata;
metadata = this.createDevWorkspaceMetadata(editorDevfile);
// add sufix

@@ -126,3 +126,3 @@ metadata.name = metadata.name + "-" + suffix;

};
devfileMetadata = devfile.metadata;
devfileMetadata = this.createDevWorkspaceMetadata(devfile, true);
devfileCopy = Object.assign({}, devfile);

@@ -143,2 +143,3 @@ delete devfileCopy.schemaVersion;

started: true,
routingClass: 'che',
template: devfileCopy,

@@ -175,2 +176,19 @@ contributions: [editorSpecContribution]

};
Generate.prototype.createDevWorkspaceMetadata = function (devfile, addDevfileContent) {
if (addDevfileContent === void 0) { addDevfileContent = false; }
var devWorkspaceMetadata = {};
var devfileMetadata = devfile.metadata;
if (devfileMetadata.name) {
devWorkspaceMetadata.name = devfileMetadata.name;
}
if (devfileMetadata.generateName) {
devWorkspaceMetadata.generateName = devfileMetadata.generateName;
}
if (addDevfileContent) {
devWorkspaceMetadata.annotations = {
'che.eclipse.org/devfile': jsYaml.dump(devfile)
};
}
return devWorkspaceMetadata;
};
var Generate_1;

@@ -177,0 +195,0 @@ Generate.MERGE_CONTRIBUTION = 'controller.devfile.io/merge-contribution';

2

package.json
{
"name": "@eclipse-che/che-devworkspace-generator",
"version": "0.0.1-58f79fb",
"version": "0.0.1-602dcb4",
"private": false,

@@ -5,0 +5,0 @@ "description": "Generates DevWorkspaces by transforming existing devfiles",

@@ -12,3 +12,6 @@ /**********************************************************************

import {
V221Devfile,
V221DevfileMetadata,
V1alpha2DevWorkspace,
V1alpha2DevWorkspaceMetadata,
V1alpha2DevWorkspaceSpecContributions,

@@ -25,2 +28,8 @@ V1alpha2DevWorkspaceSpecTemplateComponents,

type DevfileLike = V221Devfile & {
metadata: V221DevfileMetadata & {
generateName?: string;
};
};
@injectable()

@@ -78,3 +87,3 @@ export class Generate {

// transform it into a devWorkspace template
const metadata = editorDevfile.metadata;
const metadata = this.createDevWorkspaceMetadata(editorDevfile);
// add sufix

@@ -92,3 +101,3 @@ metadata.name = `${metadata.name}-${suffix}`;

// transform it into a devWorkspace
const devfileMetadata = devfile.metadata;
const devfileMetadata = this.createDevWorkspaceMetadata(devfile, true);
const devfileCopy = Object.assign({}, devfile);

@@ -109,2 +118,3 @@ delete devfileCopy.schemaVersion;

started: true,
routingClass: 'che',
template: devfileCopy,

@@ -145,2 +155,21 @@ contributions: [editorSpecContribution],

}
private createDevWorkspaceMetadata(devfile: DevfileLike, addDevfileContent = false): V1alpha2DevWorkspaceMetadata {
const devWorkspaceMetadata = {} as V1alpha2DevWorkspaceMetadata;
const devfileMetadata = devfile.metadata;
if (devfileMetadata.name) {
devWorkspaceMetadata.name = devfileMetadata.name;
}
if (devfileMetadata.generateName) {
devWorkspaceMetadata.generateName = devfileMetadata.generateName;
}
if (addDevfileContent) {
devWorkspaceMetadata.annotations = {
'che.eclipse.org/devfile': jsYaml.dump(devfile),
};
}
return devWorkspaceMetadata;
}
}

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