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

@connectrpc/protoc-gen-connect-es

Package Overview
Dependencies
Maintainers
7
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@connectrpc/protoc-gen-connect-es - npm Package Compare versions

Comparing version 1.1.4 to 1.2.0

10

dist/cjs/package.json
{
"name": "@connectrpc/protoc-gen-connect-es",
"version": "1.1.4",
"version": "1.2.0",
"description": "Code generator for Connect",

@@ -23,8 +23,8 @@ "license": "Apache-2.0",

"dependencies": {
"@bufbuild/protobuf": "^1.4.2",
"@bufbuild/protoplugin": "^1.4.1"
"@bufbuild/protobuf": "^1.6.0",
"@bufbuild/protoplugin": "^1.6.0"
},
"peerDependencies": {
"@connectrpc/connect": "1.1.4",
"@bufbuild/protoc-gen-es": "^1.3.3"
"@connectrpc/connect": "1.2.0",
"@bufbuild/protoc-gen-es": "^1.6.0"
},

@@ -31,0 +31,0 @@ "peerDependenciesMeta": {

@@ -32,10 +32,10 @@ "use strict";

const { MethodKind: rtMethodKind, MethodIdempotency: rtMethodIdempotency } = schema.runtime;
f.print((0, ecmascript_1.makeJsDoc)(service));
f.print("export declare const ", (0, ecmascript_1.localName)(service), ": {");
f.print(` readonly typeName: `, (0, ecmascript_1.literalString)(service.typeName), `,`);
f.print(f.jsDoc(service));
f.print(f.exportDecl("declare const", (0, ecmascript_1.localName)(service)), ": {");
f.print(` readonly typeName: `, f.string(service.typeName), `,`);
f.print(" readonly methods: {");
for (const method of service.methods) {
f.print((0, ecmascript_1.makeJsDoc)(method, " "));
f.print(f.jsDoc(method, " "));
f.print(" readonly ", (0, ecmascript_1.localName)(method), ": {");
f.print(` readonly name: `, (0, ecmascript_1.literalString)(method.name), `,`);
f.print(` readonly name: `, f.string(method.name), `,`);
f.print(" readonly I: typeof ", method.input, ",");

@@ -42,0 +42,0 @@ f.print(" readonly O: typeof ", method.output, ",");

@@ -32,10 +32,10 @@ "use strict";

const { MethodKind: rtMethodKind, MethodIdempotency: rtMethodIdempotency } = schema.runtime;
f.print((0, ecmascript_1.makeJsDoc)(service));
f.print("export const ", (0, ecmascript_1.localName)(service), " = {");
f.print(` typeName: `, (0, ecmascript_1.literalString)(service.typeName), `,`);
f.print(f.jsDoc(service));
f.print(f.exportDecl("const", (0, ecmascript_1.localName)(service)), " = {");
f.print(` typeName: `, f.string(service.typeName), `,`);
f.print(" methods: {");
for (const method of service.methods) {
f.print((0, ecmascript_1.makeJsDoc)(method, " "));
f.print(f.jsDoc(method, " "));
f.print(" ", (0, ecmascript_1.localName)(method), ": {");
f.print(` name: `, (0, ecmascript_1.literalString)(method.name), `,`);
f.print(` name: `, f.string(method.name), `,`);
f.print(" I: ", method.input, ",");

@@ -42,0 +42,0 @@ f.print(" O: ", method.output, ",");

@@ -32,10 +32,10 @@ "use strict";

const { MethodKind: rtMethodKind, MethodIdempotency: rtMethodIdempotency } = schema.runtime;
f.print((0, ecmascript_1.makeJsDoc)(service));
f.print("export const ", (0, ecmascript_1.localName)(service), " = {");
f.print(` typeName: `, (0, ecmascript_1.literalString)(service.typeName), `,`);
f.print(f.jsDoc(service));
f.print(f.exportDecl("const", (0, ecmascript_1.localName)(service)), " = {");
f.print(` typeName: `, f.string(service.typeName), `,`);
f.print(" methods: {");
for (const method of service.methods) {
f.print((0, ecmascript_1.makeJsDoc)(method, " "));
f.print(f.jsDoc(method, " "));
f.print(" ", (0, ecmascript_1.localName)(method), ": {");
f.print(` name: `, (0, ecmascript_1.literalString)(method.name), `,`);
f.print(` name: `, f.string(method.name), `,`);
f.print(" I: ", method.input, ",");

@@ -42,0 +42,0 @@ f.print(" O: ", method.output, ",");

{
"name": "@connectrpc/protoc-gen-connect-es",
"version": "1.1.4",
"version": "1.2.0",
"description": "Code generator for Connect",

@@ -23,8 +23,8 @@ "license": "Apache-2.0",

"dependencies": {
"@bufbuild/protobuf": "^1.4.2",
"@bufbuild/protoplugin": "^1.4.1"
"@bufbuild/protobuf": "^1.6.0",
"@bufbuild/protoplugin": "^1.6.0"
},
"peerDependencies": {
"@connectrpc/connect": "1.1.4",
"@bufbuild/protoc-gen-es": "^1.3.3"
"@connectrpc/connect": "1.2.0",
"@bufbuild/protoc-gen-es": "^1.6.0"
},

@@ -31,0 +31,0 @@ "peerDependenciesMeta": {

@@ -128,3 +128,15 @@ # @connectrpc/protoc-gen-connect-es

### `js_import_style`
By default, [protoc-gen-connect-es](https://www.npmjs.com/package/@connectrpc/protoc-gen-connect-es)
(and all other plugins based on [@bufbuild/protoplugin](https://www.npmjs.com/package/@bufbuild/protoplugin))
generate ECMAScript `import` and `export` statements. For use cases where
CommonJS is difficult to avoid, this option can be used to generate CommonJS
`require()` calls.
Possible values:
- `js_import_style=module` generate ECMAScript `import` / `export` statements -
the default behavior.
- `js_import_style=legacy_commonjs` generate CommonJS `require()` calls.
### `keep_empty_files=true`

@@ -131,0 +143,0 @@

@@ -18,7 +18,3 @@ // Copyright 2021-2023 The Connect Authors

import type { GeneratedFile, Schema } from "@bufbuild/protoplugin/ecmascript";
import {
literalString,
makeJsDoc,
localName,
} from "@bufbuild/protoplugin/ecmascript";
import { localName } from "@bufbuild/protoplugin/ecmascript";

@@ -38,10 +34,10 @@ export function generateDts(schema: Schema) {

const { MethodKind: rtMethodKind, MethodIdempotency: rtMethodIdempotency } = schema.runtime;
f.print(makeJsDoc(service));
f.print("export declare const ", localName(service), ": {");
f.print(` readonly typeName: `, literalString(service.typeName), `,`);
f.print(f.jsDoc(service));
f.print(f.exportDecl("declare const", localName(service)), ": {");
f.print(` readonly typeName: `, f.string(service.typeName), `,`);
f.print(" readonly methods: {");
for (const method of service.methods) {
f.print(makeJsDoc(method, " "));
f.print(f.jsDoc(method, " "));
f.print(" readonly ", localName(method), ": {");
f.print(` readonly name: `, literalString(method.name), `,`);
f.print(` readonly name: `, f.string(method.name), `,`);
f.print(" readonly I: typeof ", method.input, ",");

@@ -48,0 +44,0 @@ f.print(" readonly O: typeof ", method.output, ",");

@@ -18,7 +18,3 @@ // Copyright 2021-2023 The Connect Authors

import type { GeneratedFile, Schema } from "@bufbuild/protoplugin/ecmascript";
import {
literalString,
makeJsDoc,
localName,
} from "@bufbuild/protoplugin/ecmascript";
import { localName } from "@bufbuild/protoplugin/ecmascript";

@@ -38,10 +34,10 @@ export function generateJs(schema: Schema) {

const { MethodKind: rtMethodKind, MethodIdempotency: rtMethodIdempotency } = schema.runtime;
f.print(makeJsDoc(service));
f.print("export const ", localName(service), " = {");
f.print(` typeName: `, literalString(service.typeName), `,`);
f.print(f.jsDoc(service));
f.print(f.exportDecl("const", localName(service)), " = {");
f.print(` typeName: `, f.string(service.typeName), `,`);
f.print(" methods: {");
for (const method of service.methods) {
f.print(makeJsDoc(method, " "));
f.print(f.jsDoc(method, " "));
f.print(" ", localName(method), ": {");
f.print(` name: `, literalString(method.name), `,`);
f.print(` name: `, f.string(method.name), `,`);
f.print(" I: ", method.input, ",");

@@ -48,0 +44,0 @@ f.print(" O: ", method.output, ",");

@@ -18,7 +18,3 @@ // Copyright 2021-2023 The Connect Authors

import type { GeneratedFile, Schema } from "@bufbuild/protoplugin/ecmascript";
import {
literalString,
makeJsDoc,
localName,
} from "@bufbuild/protoplugin/ecmascript";
import { localName } from "@bufbuild/protoplugin/ecmascript";

@@ -43,10 +39,10 @@ export function generateTs(schema: Schema) {

schema.runtime;
f.print(makeJsDoc(service));
f.print("export const ", localName(service), " = {");
f.print(` typeName: `, literalString(service.typeName), `,`);
f.print(f.jsDoc(service));
f.print(f.exportDecl("const", localName(service)), " = {");
f.print(` typeName: `, f.string(service.typeName), `,`);
f.print(" methods: {");
for (const method of service.methods) {
f.print(makeJsDoc(method, " "));
f.print(f.jsDoc(method, " "));
f.print(" ", localName(method), ": {");
f.print(` name: `, literalString(method.name), `,`);
f.print(` name: `, f.string(method.name), `,`);
f.print(" I: ", method.input, ",");

@@ -53,0 +49,0 @@ f.print(" O: ", method.output, ",");

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