Skip to content

Commit dd26b92

Browse files
authored
fix: add pbjs namespace (#145)
To prevent namespace conflicts with protobuf message names. Refs ipfs/js-ipfs-bitswap#323
1 parent 27d57df commit dd26b92

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/ipfs-unixfs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"scripts": {
1111
"prepare": "run-s prepare:*",
12-
"prepare:proto": "pbjs -t static-module -w commonjs --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/unixfs.js ./src/unixfs.proto",
12+
"prepare:proto": "pbjs -t static-module -w commonjs -r ipfs-unixfs --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/unixfs.js ./src/unixfs.proto",
1313
"prepare:proto-types": "pbts -o src/unixfs.d.ts src/unixfs.js",
1414
"prepare:types": "aegir build --no-bundle",
1515
"test": "aegir test",

packages/ipfs-unixfs/src/unixfs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var $protobuf = require("protobufjs/minimal");
77
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
88

99
// Exported root namespace
10-
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
10+
var $root = $protobuf.roots["ipfs-unixfs"] || ($protobuf.roots["ipfs-unixfs"] = {});
1111

1212
$root.Data = (function() {
1313

0 commit comments

Comments
 (0)