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

@bufbuild/protoplugin

Package Overview
Dependencies
Maintainers
0
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bufbuild/protoplugin - npm Package Compare versions

Comparing version 2.2.1 to 2.2.2

27

dist/cjs/transpile.js

@@ -121,5 +121,30 @@ "use strict";

if (result.emitSkipped) {
throw Error("A problem occurred during transpilation and files were not generated. Contact the plugin author for support.");
// When compilation fails, this error message is printed to stderr.
const diagnostics = formatDiagnostics(result.diagnostics);
throw Error(`A problem occurred during transpilation and files were not generated. Contact the plugin author for support.\n\n${diagnostics}`);
}
return results;
}
function formatDiagnostics(diagnostics) {
const sorted = typescript_1.default.sortAndDeduplicateDiagnostics(diagnostics);
if (sorted.length == 0) {
return "";
}
const first = sorted.slice(0, 3);
const formatHost = {
getCanonicalFileName(fileName) {
return fileName;
},
getCurrentDirectory() {
return ".";
},
getNewLine() {
return "\n";
},
};
let out = typescript_1.default.formatDiagnostics(first, formatHost).trim();
if (first.length < sorted.length) {
out += `\n${sorted.length - first.length} more diagnostics elided`;
}
return out;
}

@@ -115,5 +115,30 @@ // Copyright 2021-2024 Buf Technologies, Inc.

if (result.emitSkipped) {
throw Error("A problem occurred during transpilation and files were not generated. Contact the plugin author for support.");
// When compilation fails, this error message is printed to stderr.
const diagnostics = formatDiagnostics(result.diagnostics);
throw Error(`A problem occurred during transpilation and files were not generated. Contact the plugin author for support.\n\n${diagnostics}`);
}
return results;
}
function formatDiagnostics(diagnostics) {
const sorted = ts.sortAndDeduplicateDiagnostics(diagnostics);
if (sorted.length == 0) {
return "";
}
const first = sorted.slice(0, 3);
const formatHost = {
getCanonicalFileName(fileName) {
return fileName;
},
getCurrentDirectory() {
return ".";
},
getNewLine() {
return "\n";
},
};
let out = ts.formatDiagnostics(first, formatHost).trim();
if (first.length < sorted.length) {
out += `\n${sorted.length - first.length} more diagnostics elided`;
}
return out;
}

4

package.json
{
"name": "@bufbuild/protoplugin",
"version": "2.2.1",
"version": "2.2.2",
"license": "Apache-2.0",

@@ -38,3 +38,3 @@ "description": "Helps to create your own Protocol Buffers code generators.",

"dependencies": {
"@bufbuild/protobuf": "2.2.1",
"@bufbuild/protobuf": "2.2.2",
"@typescript/vfs": "^1.5.2",

@@ -41,0 +41,0 @@ "typescript": "5.4.5"

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