New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@monokle/validation

Package Overview
Dependencies
Maintainers
4
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@monokle/validation - npm Package Compare versions

Comparing version 0.7.1 to 0.7.2

11

lib/MonokleValidator.js

@@ -43,3 +43,12 @@ import difference from "lodash/difference.js";

default:
throw new Error("plugin_not_found");
try {
const url = `https://plugins.monokle.com/validation/${pluginName}/latest.js`;
const customPlugin = await import(/* @vite-ignore */ url);
return new SimpleCustomValidator(customPlugin.default, parser);
}
catch (err) {
throw new Error(err instanceof Error
? `plugin_not_found: ${err.message}`
: `plugin_not_found: ${String(err)}`);
}
}

@@ -46,0 +55,0 @@ });

3

lib/node.js

@@ -27,3 +27,4 @@ import { ResourceParser } from "./common/resourceParser.js";

try {
const customPlugin = await importWithDataUrl("http://localhost:4111/plugin.js");
const url = `https://plugins.monokle.com/validation/${pluginName}/latest.js`;
const customPlugin = await importWithDataUrl(url);
return new SimpleCustomValidator(customPlugin.default, parser);

@@ -30,0 +31,0 @@ }

@@ -16,2 +16,3 @@ import { JsonObject } from "type-fest";

private _lastConfig?;
private _debug;
constructor(parser: ResourceParser);

@@ -18,0 +19,0 @@ onReload(callback: (hash: String) => void): void;

@@ -7,3 +7,2 @@ import { DEV_MODE_TOKEN } from "./constants.js";

displayName: "Developer mode",
icon: "k8s-schema",
learnMoreUrl: "https://github.com/kubeshop/monokle-community-plugins#readme",

@@ -23,2 +22,3 @@ description: "Develop custom validators in minutes. Enable your plugin's development server to get started. HMR will show your latest code directly in the browser.",

_lastConfig;
_debug = false;
constructor(parser) {

@@ -34,3 +34,5 @@ this.parser = parser;

this._source.onerror = (err) => {
console.error(err);
if (this._debug) {
console.log("[validator-dev] event source failed", err);
}
};

@@ -43,2 +45,5 @@ this._source.onmessage = (event) => {

}
if (this._debug) {
console.log("[validator-dev] bundle received", bundle.hash);
}
this._currentHash = bundle.hash;

@@ -54,5 +59,15 @@ const encodedSource = btoa(bundle.code);

.configure(this._lastConfig)
.then(() => this._handleReload?.(bundle.hash));
.then(() => {
if (this._debug)
console.log("[validator-dev] bundle loaded");
this._handleReload?.(bundle.hash);
})
.catch((err) => {
if (this._debug)
console.log("[validator-dev] bundle load failed", err instanceof Error ? err.message : "reason unknown");
});
}
else {
if (this._debug)
console.log("[validator-dev] bundle loaded");
this._handleReload?.(bundle.hash);

@@ -63,3 +78,5 @@ }

catch (err) {
console.error(err);
if (this._debug) {
console.error("[validator-dev] bundle failure", err instanceof Error ? err.message : "reason unknown");
}
}

@@ -114,2 +131,3 @@ };

configure(config) {
this._debug = Boolean(config?.settings?.debug);
if (!this._currentValidator) {

@@ -116,0 +134,0 @@ this._lastConfig = config;

@@ -89,3 +89,2 @@ import { paramCase, sentenceCase } from "change-case";

displayName: plugin.displayName ?? sentenceCase(plugin.name),
icon: plugin.icon ?? "k8s-schema",
};

@@ -92,0 +91,0 @@ }

{
"name": "@monokle/validation",
"version": "0.7.1",
"version": "0.7.2",
"description": "Kubernetes resource validation",

@@ -5,0 +5,0 @@ "author": "Kubeshop",

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