@forwardimpact/libcodegen 0.1.55 → 0.1.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/fit-codegen.js +2 -1
- package/package.json +2 -2
- package/src/types.js +8 -0
package/bin/fit-codegen.js
CHANGED
|
@@ -31,7 +31,8 @@ const VERSION =
|
|
|
31
31
|
const definition = {
|
|
32
32
|
name: "fit-codegen",
|
|
33
33
|
version: VERSION,
|
|
34
|
-
description:
|
|
34
|
+
description:
|
|
35
|
+
"Generate protobuf types, service clients, and definitions from .proto files in installed @forwardimpact/* packages (node_modules/@forwardimpact/*/proto/) and an optional project-local proto/ directory.",
|
|
35
36
|
globalOptions: {
|
|
36
37
|
all: { type: "boolean", description: "Generate all code" },
|
|
37
38
|
type: { type: "boolean", description: "Generate protobuf types only" },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forwardimpact/libcodegen",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.57",
|
|
4
4
|
"description": "Protobuf code generation — keep types in sync with proto definitions without hand-writing.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"codegen",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@forwardimpact/libutil": "^0.1.64",
|
|
52
52
|
"@grpc/proto-loader": "^0.8.1",
|
|
53
53
|
"mustache": "^4.2.0",
|
|
54
|
-
"protobufjs": "^7.
|
|
54
|
+
"protobufjs": "^7.6.1",
|
|
55
55
|
"protobufjs-cli": "1.2.2"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
package/src/types.js
CHANGED
|
@@ -58,6 +58,14 @@ export class CodegenTypes {
|
|
|
58
58
|
.replace(
|
|
59
59
|
/import\s+\*\s+as\s+\$protobuf\s+from\s+"protobufjs\/minimal\.js";/,
|
|
60
60
|
'import $protobuf from "protobufjs/minimal.js";',
|
|
61
|
+
)
|
|
62
|
+
// Statically bind protobufjs's $util.Long to the `long` package. Without
|
|
63
|
+
// this, `bun build --compile` tree-shakes `long` (only reached via
|
|
64
|
+
// protobufjs's lazy require) and module-init crashes on int64 prototype
|
|
65
|
+
// defaults like `Span.prototype.start_time_unix_nano = $util.Long.fromBits(...)`.
|
|
66
|
+
.replace(
|
|
67
|
+
/(import \$protobuf from "protobufjs\/minimal\.js";)/,
|
|
68
|
+
'$1\nimport Long from "long";\n$protobuf.util.Long = Long;\n$protobuf.configure();',
|
|
61
69
|
);
|
|
62
70
|
|
|
63
71
|
if (fixed !== content) {
|