Skip to content

Commit

Permalink
CLI: pbjs/pbts no longer generate any volatile headers, see #614
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Jan 3, 2017
1 parent b52089e commit ee20b81
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 79 deletions.
5 changes: 0 additions & 5 deletions cli/pbjs.js
Expand Up @@ -174,11 +174,6 @@ exports.main = function(args, callback) {
throw err;
}
if (output !== "") {
output = [
"// $> pbjs " + args.join(" "),
"// Generated " + (new Date()).toUTCString().replace(/GMT/, "UTC"),
""
].join("\n") + "\n" + output;
if (argv.out)
fs.writeFileSync(argv.out, output, { encoding: "utf8" });
else
Expand Down
6 changes: 1 addition & 5 deletions cli/pbts.js
Expand Up @@ -125,11 +125,7 @@ exports.main = function(args, callback) {
return;
}

var output = [
"// $> pbts " + args.join(" "),
"// Generated " + (new Date()).toUTCString().replace(/GMT/, "UTC"),
""
];
var output = [];
if (argv.global)
output.push(
"export as namespace " + argv.global + ";",
Expand Down
3 changes: 0 additions & 3 deletions tests/data/ambiguous-names.js
@@ -1,6 +1,3 @@
// $> pbjs --target static-module --wrap commonjs --root test_ambiguous-names --out tests/data/ambiguous-names.js tests/data/ambiguous-names.proto
// Generated Mon, 02 Jan 2017 21:00:30 UTC

/*eslint-disable block-scoped-var, no-redeclare, no-control-regex*/
"use strict";

Expand Down
17 changes: 7 additions & 10 deletions tests/data/mapbox/vector_tile.js
@@ -1,6 +1,3 @@
// $> pbjs --target static-module --wrap commonjs --root test_vector_tile --out tests/data/mapbox/vector_tile.js tests/data/mapbox/vector_tile.proto
// Generated Mon, 02 Jan 2017 21:00:30 UTC

/*eslint-disable block-scoped-var, no-redeclare, no-control-regex*/
"use strict";

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

/**
* Value intValue.
* @type {number|Long}
* @type {number|$protobuf.Long}
*/
$prototype.intValue = $protobuf.util.emptyObject;

/**
* Value uintValue.
* @type {number|Long}
* @type {number|$protobuf.Long}
*/
$prototype.uintValue = $protobuf.util.emptyObject;

/**
* Value sintValue.
* @type {number|Long}
* @type {number|$protobuf.Long}
*/
$prototype.sintValue = $protobuf.util.emptyObject;

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

/**
* Feature id.
* @type {number|Long}
* @type {number|$protobuf.Long}
*/
$prototype.id = $protobuf.util.emptyObject;

Expand All @@ -526,7 +523,7 @@ $root.vector_tile = (function() {
* Feature type.
* @type {number}
*/
$prototype.type = 0;
$prototype.type = undefined;

/**
* Feature geometry.
Expand Down Expand Up @@ -567,7 +564,7 @@ $root.vector_tile = (function() {
}
writer.ldelim();
}
if (message.type !== undefined && message.type !== 0) {
if (message.type !== undefined && message.type !== undefined) {
writer.uint32(24).uint32(message.type);
}
if (message.geometry && message.geometry.length) {
Expand Down Expand Up @@ -731,7 +728,7 @@ $root.vector_tile = (function() {
dst.tags = [];
}
}
dst.type = impl.enums(src.type, 0, types[2], options);
dst.type = impl.enums(src.type, undefined, types[2], options);
if (src.geometry && src.geometry.length) {
dst.geometry = [];
for (var i = 0; i < src.geometry.length; ++i) {
Expand Down
13 changes: 5 additions & 8 deletions tests/data/package.js
@@ -1,6 +1,3 @@
// $> pbjs --target static-module --wrap commonjs --root test_package --out tests/data/package.js tests/data/package.proto
// Generated Mon, 02 Jan 2017 21:00:30 UTC

/*eslint-disable block-scoped-var, no-redeclare, no-control-regex*/
"use strict";

Expand Down Expand Up @@ -544,19 +541,19 @@ $root.Package = (function() {
dst.main = "";
}
if (dst.bin === undefined && options.defaults) {
dst.bin = {};
dst.bin = "";
}
if (dst.scripts === undefined && options.defaults) {
dst.scripts = {};
dst.scripts = "";
}
if (dst.dependencies === undefined && options.defaults) {
dst.dependencies = {};
dst.dependencies = "";
}
if (dst.optionalDependencies === undefined && options.defaults) {
dst.optionalDependencies = {};
dst.optionalDependencies = "";
}
if (dst.devDependencies === undefined && options.defaults) {
dst.devDependencies = {};
dst.devDependencies = "";
}
if (dst.types === undefined && options.defaults) {
dst.types = "";
Expand Down
3 changes: 0 additions & 3 deletions tests/data/rpc.js
@@ -1,6 +1,3 @@
// $> pbjs --target static-module --wrap commonjs --root test_rpc --out tests/data/rpc.js tests/data/rpc.proto
// Generated Mon, 02 Jan 2017 21:00:30 UTC

/*eslint-disable block-scoped-var, no-redeclare, no-control-regex*/
"use strict";

Expand Down
11 changes: 4 additions & 7 deletions tests/data/test.d.ts
@@ -1,6 +1,3 @@
// $> pbts --out tests/data/test.d.ts --no-comments tests/data/test.js
// Generated Mon, 02 Jan 2017 21:00:32 UTC

import * as $protobuf from "../..";

export namespace jspb {
Expand Down Expand Up @@ -234,7 +231,7 @@ export namespace jspb {
constructor(properties?: Object);
stringField: string;
boolField: boolean;
intField: (number|Long);
intField: (number|$protobuf.Long);
enumField: number;
emptyField: string;
bytesField: Uint8Array;
Expand Down Expand Up @@ -399,7 +396,7 @@ export namespace jspb {
constructor(properties?: Object);
mapStringString: string;
mapStringInt32: number;
mapStringInt64: (number|Long);
mapStringInt64: (number|$protobuf.Long);
mapStringBool: boolean;
mapStringDouble: number;
mapStringEnum: number;
Expand Down Expand Up @@ -901,8 +898,8 @@ export namespace google {
constructor(properties?: Object);
name: google.protobuf.UninterpretedOption.NamePart[];
identifierValue: string;
positiveIntValue: (number|Long);
negativeIntValue: (number|Long);
positiveIntValue: (number|$protobuf.Long);
negativeIntValue: (number|$protobuf.Long);
doubleValue: number;
stringValue: Uint8Array;
aggregateValue: string;
Expand Down

0 comments on commit ee20b81

Please sign in to comment.