Skip to content

Commit ee20b81

Browse files
committed
CLI: pbjs/pbts no longer generate any volatile headers, see #614
1 parent b52089e commit ee20b81

File tree

8 files changed

+52
-79
lines changed

8 files changed

+52
-79
lines changed

cli/pbjs.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,6 @@ exports.main = function(args, callback) {
174174
throw err;
175175
}
176176
if (output !== "") {
177-
output = [
178-
"// $> pbjs " + args.join(" "),
179-
"// Generated " + (new Date()).toUTCString().replace(/GMT/, "UTC"),
180-
""
181-
].join("\n") + "\n" + output;
182177
if (argv.out)
183178
fs.writeFileSync(argv.out, output, { encoding: "utf8" });
184179
else

cli/pbts.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,7 @@ exports.main = function(args, callback) {
125125
return;
126126
}
127127

128-
var output = [
129-
"// $> pbts " + args.join(" "),
130-
"// Generated " + (new Date()).toUTCString().replace(/GMT/, "UTC"),
131-
""
132-
];
128+
var output = [];
133129
if (argv.global)
134130
output.push(
135131
"export as namespace " + argv.global + ";",

tests/data/ambiguous-names.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// $> pbjs --target static-module --wrap commonjs --root test_ambiguous-names --out tests/data/ambiguous-names.js tests/data/ambiguous-names.proto
2-
// Generated Mon, 02 Jan 2017 21:00:30 UTC
3-
41
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex*/
52
"use strict";
63

tests/data/mapbox/vector_tile.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// $> pbjs --target static-module --wrap commonjs --root test_vector_tile --out tests/data/mapbox/vector_tile.js tests/data/mapbox/vector_tile.proto
2-
// Generated Mon, 02 Jan 2017 21:00:30 UTC
3-
41
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex*/
52
"use strict";
63

@@ -254,19 +251,19 @@ $root.vector_tile = (function() {
254251

255252
/**
256253
* Value intValue.
257-
* @type {number|Long}
254+
* @type {number|$protobuf.Long}
258255
*/
259256
$prototype.intValue = $protobuf.util.emptyObject;
260257

261258
/**
262259
* Value uintValue.
263-
* @type {number|Long}
260+
* @type {number|$protobuf.Long}
264261
*/
265262
$prototype.uintValue = $protobuf.util.emptyObject;
266263

267264
/**
268265
* Value sintValue.
269-
* @type {number|Long}
266+
* @type {number|$protobuf.Long}
270267
*/
271268
$prototype.sintValue = $protobuf.util.emptyObject;
272269

@@ -512,7 +509,7 @@ $root.vector_tile = (function() {
512509

513510
/**
514511
* Feature id.
515-
* @type {number|Long}
512+
* @type {number|$protobuf.Long}
516513
*/
517514
$prototype.id = $protobuf.util.emptyObject;
518515

@@ -526,7 +523,7 @@ $root.vector_tile = (function() {
526523
* Feature type.
527524
* @type {number}
528525
*/
529-
$prototype.type = 0;
526+
$prototype.type = undefined;
530527

531528
/**
532529
* Feature geometry.
@@ -567,7 +564,7 @@ $root.vector_tile = (function() {
567564
}
568565
writer.ldelim();
569566
}
570-
if (message.type !== undefined && message.type !== 0) {
567+
if (message.type !== undefined && message.type !== undefined) {
571568
writer.uint32(24).uint32(message.type);
572569
}
573570
if (message.geometry && message.geometry.length) {
@@ -731,7 +728,7 @@ $root.vector_tile = (function() {
731728
dst.tags = [];
732729
}
733730
}
734-
dst.type = impl.enums(src.type, 0, types[2], options);
731+
dst.type = impl.enums(src.type, undefined, types[2], options);
735732
if (src.geometry && src.geometry.length) {
736733
dst.geometry = [];
737734
for (var i = 0; i < src.geometry.length; ++i) {

tests/data/package.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// $> pbjs --target static-module --wrap commonjs --root test_package --out tests/data/package.js tests/data/package.proto
2-
// Generated Mon, 02 Jan 2017 21:00:30 UTC
3-
41
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex*/
52
"use strict";
63

@@ -544,19 +541,19 @@ $root.Package = (function() {
544541
dst.main = "";
545542
}
546543
if (dst.bin === undefined && options.defaults) {
547-
dst.bin = {};
544+
dst.bin = "";
548545
}
549546
if (dst.scripts === undefined && options.defaults) {
550-
dst.scripts = {};
547+
dst.scripts = "";
551548
}
552549
if (dst.dependencies === undefined && options.defaults) {
553-
dst.dependencies = {};
550+
dst.dependencies = "";
554551
}
555552
if (dst.optionalDependencies === undefined && options.defaults) {
556-
dst.optionalDependencies = {};
553+
dst.optionalDependencies = "";
557554
}
558555
if (dst.devDependencies === undefined && options.defaults) {
559-
dst.devDependencies = {};
556+
dst.devDependencies = "";
560557
}
561558
if (dst.types === undefined && options.defaults) {
562559
dst.types = "";

tests/data/rpc.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// $> pbjs --target static-module --wrap commonjs --root test_rpc --out tests/data/rpc.js tests/data/rpc.proto
2-
// Generated Mon, 02 Jan 2017 21:00:30 UTC
3-
41
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex*/
52
"use strict";
63

tests/data/test.d.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// $> pbts --out tests/data/test.d.ts --no-comments tests/data/test.js
2-
// Generated Mon, 02 Jan 2017 21:00:32 UTC
3-
41
import * as $protobuf from "../..";
52

63
export namespace jspb {
@@ -234,7 +231,7 @@ export namespace jspb {
234231
constructor(properties?: Object);
235232
stringField: string;
236233
boolField: boolean;
237-
intField: (number|Long);
234+
intField: (number|$protobuf.Long);
238235
enumField: number;
239236
emptyField: string;
240237
bytesField: Uint8Array;
@@ -399,7 +396,7 @@ export namespace jspb {
399396
constructor(properties?: Object);
400397
mapStringString: string;
401398
mapStringInt32: number;
402-
mapStringInt64: (number|Long);
399+
mapStringInt64: (number|$protobuf.Long);
403400
mapStringBool: boolean;
404401
mapStringDouble: number;
405402
mapStringEnum: number;
@@ -901,8 +898,8 @@ export namespace google {
901898
constructor(properties?: Object);
902899
name: google.protobuf.UninterpretedOption.NamePart[];
903900
identifierValue: string;
904-
positiveIntValue: (number|Long);
905-
negativeIntValue: (number|Long);
901+
positiveIntValue: (number|$protobuf.Long);
902+
negativeIntValue: (number|$protobuf.Long);
906903
doubleValue: number;
907904
stringValue: Uint8Array;
908905
aggregateValue: string;

0 commit comments

Comments
 (0)