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

@elastic.io/component-build-helper

Package Overview
Dependencies
Maintainers
9
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elastic.io/component-build-helper - npm Package Compare versions

Comparing version 0.0.1-alpha.1 to 0.0.1-alpha.2

./@types/ls-archive/index.d.ts

5

dist/src/cli.js

@@ -31,6 +31,3 @@ #!/usr/bin/env node

case 'getComponentLogo':
(0, metaloader_1.getComponentLogo)(componentPath)
.then(logo => {
console.log(logo);
});
(0, metaloader_1.getComponentLogo)(componentPath).then(console.log);
break;

@@ -37,0 +34,0 @@ default:

1

dist/src/interfaces.d.ts

@@ -21,2 +21,3 @@ export interface Field {

export interface Component {
version: string;
triggers: {

@@ -23,0 +24,0 @@ [trigger: string]: Trigger;

@@ -9,2 +9,11 @@ "use strict";

const fs_1 = __importDefault(require("fs"));
const semver_1 = __importDefault(require("semver"));
function validateComponentVersion(version) {
if (!version) {
return;
}
if (!semver_1.default.valid(version)) {
throw new Error('Invalid component version. Please specify the valid semantic version');
}
}
// Action/Trigger names should not intersect each other

@@ -26,2 +35,3 @@ function validateFunctionNamesIntersection(component) {

function validateFunctionsNames(component) {
validateComponentVersion(component.version);
const { triggers, actions } = component;

@@ -28,0 +38,0 @@ // regex for valid javascript variable (except $, and starts only with letter)

{
"name": "@elastic.io/component-build-helper",
"version": "0.0.1-alpha.1",
"version": "0.0.1-alpha.2",
"description": "Helpers for the component build process",

@@ -17,3 +17,3 @@ "main": "dist/src/index.js",

"bin": {
"componentcli": "./dist/src/cli.js",
"component_cli": "./dist/src/cli.js",
"build_component_docker": "./component/build_docker.sh"

@@ -23,4 +23,6 @@ },

"@types/chai": "4.3.0",
"@types/chai-as-promised": "^7.1.4",
"@types/mocha": "9.0.0",
"@types/node": "12.0.4",
"@types/semver": "^7.3.9",
"@types/sinon": "10.0.6",

@@ -45,3 +47,7 @@ "@types/sinon-chai": "3.2.8",

"typescript": "4.4.4"
},
"dependencies": {
"chai-as-promised": "^7.1.1",
"semver": "^7.3.5"
}
}
/* eslint-disable @typescript-eslint/ban-ts-comment, no-dupe-keys, @typescript-eslint/ban-ts-ignore */
export default {
invalidSemverComponent: {
version: 'invalidSemver'
},
recursiveComponentPut: {

@@ -4,0 +7,0 @@ loaded: true

@@ -9,3 +9,7 @@ /* eslint-disable @typescript-eslint/camelcase */

import { DEFAULT_ICON } from '../../src';
chai.use(require('sinon-chai'));
import chaiAsPromised from 'chai-as-promised';
import sinonChai from 'sinon-chai';
chai.use(chaiAsPromised);
chai.use(sinonChai);
const { expect } = chai;

@@ -25,2 +29,3 @@

'withoutTriggers./component.json': data.withoutTriggersComponent,
'invalidSemver./component.json': data.invalidSemverComponent,
'withoutActions./component.json': data.withoutActionsComponent,

@@ -217,2 +222,11 @@ 'sameFuncNamesOneDuplicate./component.json': data.oneDuplicateSameFuncNamesComponent,

});
it('should ignore if version is undefined', async () => {
await validateComponentJSON(getFileFunction('flat'));
});
it('should throw an error if version is invalid semver', async () => {
await expect(validateComponentJSON(getFileFunction('invalidSemver'))).to.be
.rejectedWith('Invalid component version. Please specify the valid semantic version');
});
});

@@ -219,0 +233,0 @@ });

@@ -33,6 +33,3 @@ #!/usr/bin/env node

case 'getComponentLogo':
getComponentLogo(componentPath)
.then(logo => {
console.log(logo);
});
getComponentLogo(componentPath).then(console.log);
break;

@@ -39,0 +36,0 @@ default:

@@ -23,2 +23,3 @@ export interface Field {

export interface Component {
version: string;
triggers: { [trigger: string]: Trigger };

@@ -25,0 +26,0 @@ actions: { [action: string]: Action };

import { Action, Component, Metadata } from './interfaces';
import { DEFAULT_ICON } from './index';
import fs from 'fs';
import semver from 'semver';
function validateComponentVersion(version: string) {
if (!version) {
return;
}
if (!semver.valid(version)) {
throw new Error('Invalid component version. Please specify the valid semantic version');
}
}
// Action/Trigger names should not intersect each other

@@ -26,2 +36,4 @@ function validateFunctionNamesIntersection(component: Component) {

function validateFunctionsNames(component: Component) {
validateComponentVersion(component.version);
const { triggers, actions } = component;

@@ -28,0 +40,0 @@ // regex for valid javascript variable (except $, and starts only with letter)

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