Registry / devops / jr-common-micro

jr-common-micro

JSON →
library1.1.48jsnpmunverified

Internal gRPC module configuration library for BergX Team, providing shared protobuf definitions, generated TypeScript types, and gRPC client/server utilities. Current stable version: 1.1.48. The package is maintained actively with an irregular release cadence. It includes proto files and generated TypeScript files for gRPC services, as well as utility types (powered by type-fest). Key differentiators: tightly coupled with BergX microservice architecture, uses Buf for proto generation (with pinned versions to avoid breaking changes), and requires VSCode-specific proto path configuration. Not published on npm; installed via Git SSH dependency.

npm install jr-common-micro
INSTALL
IMPORT
SIG · JR-COMMON-MICRO
J
jr-common-micro
devopsjavascriptv1.1.48
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

GrpcModuleConfig
import { GrpcModuleConfig } from '@bergx/jr-common-micro';
import GrpcModuleConfig from '@bergx/jr-common-micro';
Named export; default export does not exist.
ProtoMessage
import { ProtoMessage } from '@bergx/jr-common-micro/dist/proto';
import { ProtoMessage } from '@bergx/jr-common-micro/dist/proto/types';
Use exact path from the dist folder; avoid adding extra subdirectories.
GrpcServiceDefinition
import { GrpcServiceDefinition } from '@bergx/jr-common-micro';
Direct named export from the main package index.

Initialise a gRPC client by loading proto files with minimal configuration.

import { GrpcModuleConfig } from '@bergx/jr-common-micro'; import { loadProtoFiles } from '@bergx/jr-common-micro/dist/proto-loader'; const config: GrpcModuleConfig = { packageName: 'myapp', serviceName: 'MyService', protoPath: 'path/to/root/proto', protoFiles: ['service.proto'], }; const grpc = loadProtoFiles(config.protoPath, config.protoFiles); console.log('gRPC client initialised');
Debug
Known issues
breakingNever upgrade bufbuild and its plugins versions. Breaking changes to structure.
fix
Pin buf and plugin versions to those specified in the repository. Do not update.
affects: >=1.0.0
gotchaVSCode integration for proto files requires adding lines to .vscode/settings.json for proto path.
fix
Add the protoc options block to .vscode/settings.json as shown in the README.
affects: >=1.0.0
gotchaThe generated TypeScript files in dist may not be compatible with recent TypeScript versions due to type-fest dependency.
fix
Ensure the installed type-fest version matches the one used during generation (see package.json).
affects: >=1.1.0
breakingImports from 'dist/proto' directory are fragile; path changes can break.
fix
Use only the main package export unless you need specific generated types.
affects: >=1.0.0
deprecatedOld usage of require() for configuration is deprecated; ESM imports preferred.
fix
Migrate all imports to ESM style as shown in the quickstart.
affects: >=1.1.0
Errors
Common errors & fixes
Error: Cannot find module '@bergx/jr-common-micro'
The package is not published on npm; installed via Git SSH dependency.
fix
Add the dependency line: "@bergx/jr-common-micro": "git+ssh://git@github.com/BergX-Team/jr-common-micro.git#main" to package.json and run npm install.
TypeError: Cannot read properties of undefined (reading 'MyMessage')
Proto file paths are not correctly resolved relative to the project root.
fix
Set the 'protoPath' config to an absolute path or a path relative to the project root, e.g., __dirname + '/../proto'.
ProtoBuf.js: Failed to load proto file: ENOENT: no such file or directory
The proto file is missing from the specified path, or the VSCode protoc settings are missing.
fix
Add the protoc options to .vscode/settings.json: { "protoc": { "options": ["--proto_path=${workspaceRoot}/proto"] } }
Upgrade
Version history
1.1.48latest on npm
Audit
Dependencies
type-festrequiredProvides utility types used in the generated TypeScript definitions.
protobufjsoptionalRuntime dependency for protobuf message serialization/deserialization.
@grpc/grpc-jsoptionalRequired for gRPC server/client implementations.
Agent activity
18 hits · last 30 days
node
18
Resources
jr-common-micro — npm install jr-common-micro · libregistry