Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@forwardimpact/libcodegen

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@forwardimpact/libcodegen - npm Package Compare versions

Comparing version
0.1.28
to
0.1.29
+20
-7
bin/fit-codegen.js

@@ -7,3 +7,3 @@ #!/usr/bin/env node

import { fileURLToPath } from "node:url";
import { execSync } from "node:child_process";
import { execFileSync } from "node:child_process";
import { parseArgs } from "node:util";

@@ -46,8 +46,13 @@

try {
const directoriesArg = directories.join(" ");
execSync(`tar -czf "${bundlePath}" -C "${sourcePath}" ${directoriesArg}`, {
stdio: "pipe",
execFileSync(
"tar",
["-czf", bundlePath, "-C", sourcePath, ...directories],
{
stdio: "pipe",
},
);
} catch (error) {
throw new Error(`Failed to create bundle: ${error.message}`, {
cause: error,
});
} catch (error) {
throw new Error(`Failed to create bundle: ${error.message}`);
}

@@ -127,4 +132,12 @@ }

const base = new CodegenBase(projectRoot, path, mustache, protoLoader, fs);
const pbjsPath = path.resolve(
__dirname,
"..",
"node_modules",
"protobufjs-cli",
"bin",
"pbjs",
);
return {
types: new CodegenTypes(base),
types: new CodegenTypes(base, pbjsPath),
services: new CodegenServices(base),

@@ -131,0 +144,0 @@ definitions: new CodegenDefinitions(base),

{
"name": "@forwardimpact/libcodegen",
"version": "0.1.28",
"version": "0.1.29",
"description": "Protocol Buffer code generation utilities for Guide",

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

"@grpc/proto-loader": "^0.8.0",
"mustache": "^4.2.0",
"protobufjs": "^7.5.4",
"protobufjs-cli": "^1.2.0"
"mustache": "^4.2.0"
},
"devDependencies": {
"@forwardimpact/libharness": "^0.1.5"
"@forwardimpact/libharness": "^0.1.5",
"protobufjs": "^7.5.4",
"protobufjs-cli": "^2.0.0"
},

@@ -28,0 +28,0 @@ "publishConfig": {

@@ -7,2 +7,3 @@ /**

#base;
#pbjsPath;

@@ -12,6 +13,8 @@ /**

* @param {object} base - CodegenBase instance providing shared utilities
* @param {string} [pbjsPath] - Absolute path to the pbjs binary (resolved from protobufjs-cli)
*/
constructor(base) {
constructor(base, pbjsPath) {
if (!base) throw new Error("CodegenBase instance is required");
this.#base = base;
this.#pbjsPath = pbjsPath || null;
}

@@ -90,6 +93,12 @@

await this.#base.run("npx", ["pbjs", ...args], {
cwd: this.#base.projectRoot,
});
if (this.#pbjsPath) {
await this.#base.run(process.execPath, [this.#pbjsPath, ...args], {
cwd: this.#base.projectRoot,
});
} else {
await this.#base.run("npx", ["pbjs", ...args], {
cwd: this.#base.projectRoot,
});
}
}
}