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

protoscript

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

protoscript - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

2

codegen/autogenerate/index.js

@@ -648,3 +648,3 @@ import { processTypes } from "../utils.js";

IMPORT_TRACKER = { ...DEFAULT_IMPORT_TRACKER };
const { imports, types } = processTypes(fileDescriptorProto, identifierTable, config.isTS);
const { imports, types } = processTypes(fileDescriptorProto, identifierTable);
const sourceFile = fileDescriptorProto.getName();

@@ -651,0 +651,0 @@ if (!sourceFile) {

@@ -95,3 +95,3 @@ import type { CodeGeneratorRequest } from "google-protobuf/google/protobuf/compiler/plugin_pb.js";

}
export declare function processTypes(fileDescriptorProto: FileDescriptorProto, identifierTable: IdentifierTable, isTypescript: boolean): TypeFile;
export declare function processTypes(fileDescriptorProto: FileDescriptorProto, identifierTable: IdentifierTable): TypeFile;
export {};

@@ -277,8 +277,2 @@ import { dirname, relative } from "path";

}
function stripTSExtension(filename) {
return filename.replace(".ts", "");
}
function stripJSExtension(filename) {
return filename.replace(".js", "");
}
export function getProtobufTSFileName(protoFileName) {

@@ -392,9 +386,7 @@ return stripProtoExtension(protoFileName) + ".pb.ts";

}
function getImportForIdentifier(identifier, identifiers, fileDescriptorProto, isTypescript) {
function getImportForIdentifier(identifier, identifiers, fileDescriptorProto) {
const dep = getIdentifierEntryFromTable(identifier, identifiers, fileDescriptorProto);
const sourceFile = fileDescriptorProto.getName() ?? "";
const dependencyImportPath = dep.publicImport ?? dep.file;
const importPath = isTypescript
? stripTSExtension(relative(dirname(sourceFile), getProtobufTSFileName(dependencyImportPath)))
: stripJSExtension(relative(dirname(sourceFile), getProtobufJSFileName(dependencyImportPath)));
const importPath = relative(dirname(sourceFile), getProtobufJSFileName(dependencyImportPath));
const path = getImportPath(importPath);

@@ -423,3 +415,3 @@ const dependencyIdentifier = identifier.split(".").pop() ?? "";

}
export function processTypes(fileDescriptorProto, identifierTable, isTypescript) {
export function processTypes(fileDescriptorProto, identifierTable) {
const typeFile = {

@@ -432,3 +424,3 @@ packageName: fileDescriptorProto.getPackage(),

function addIdentiferToImports(identifier) {
const _import = getImportForIdentifier(identifier, identifierTable, fileDescriptorProto, isTypescript);
const _import = getImportForIdentifier(identifier, identifierTable, fileDescriptorProto);
const exisitingImport = typeFile.imports.find(({ path }) => path === _import.path);

@@ -435,0 +427,0 @@ if (exisitingImport) {

{
"name": "protoscript",
"version": "0.0.6",
"version": "0.0.7",
"description": "A Protobuf runtime and code generation tool for JavaScript and TypeScript",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -34,3 +34,3 @@ # ProtoScript

2. Code generation. This a replacement of `protoc`'s JavaScript generation that generates idiomatic JavaScript code, JSON serializers/deserializers, and includes TSDoc comments.
2. Code generation. This is a replacement of `protoc`'s JavaScript generation that generates idiomatic JavaScript code, JSON serializers/deserializers, and includes TSDoc comments.

@@ -37,0 +37,0 @@ If you're looking for an RPC framework, you may be interested in [TwirpScript](https://github.com/tatethurston/TwirpScript).

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