Skip to content

Commit a8e7a0c

Browse files
committed
chore: fix gitignore and do some clean up
1 parent ce573c9 commit a8e7a0c

File tree

3 files changed

+24
-18
lines changed

3 files changed

+24
-18
lines changed

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
.idea
22
/node_modules/
3-
3+
commonjs_out
4+
google/protobuf
5+
bazel-*
6+
/deps.js
7+
/testproto_libs1.js
8+
/testproto_libs2.js
9+
/google-protobuf.js

gulpfile.js

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
var {series} = require('gulp');
2-
var execFile = require('child_process').execFile;
3-
var glob = require('glob');
4-
var fs = require('fs');
1+
const {series} = require('gulp');
2+
const execFile = require('child_process').execFile;
3+
const glob = require('glob');
54

65
function exec(command, cb) {
76
execFile('sh', ['-c', command], cb);
87
}
98

10-
var plugin = '--plugin=protoc-gen-js=bazel-bin/generator/protoc-gen-js';
11-
var protoc = [(process.env.PROTOC || 'protoc'), plugin].join(' ');
12-
var protocInc = process.env.PROTOC_INC || '../src';
9+
const plugin = '--plugin=protoc-gen-js=bazel-bin/generator/protoc-gen-js';
10+
const protoc = [(process.env.PROTOC || 'protoc'), plugin].join(' ');
11+
const protocInc = process.env.PROTOC_INC || '../src';
1312

14-
var wellKnownTypes = [
13+
const wellKnownTypes = [
1514
'google/protobuf/any.proto',
1615
'google/protobuf/api.proto',
1716
'google/protobuf/compiler/plugin.proto',
@@ -26,9 +25,9 @@ var wellKnownTypes = [
2625
'google/protobuf/wrappers.proto',
2726
];
2827

29-
wellKnownTypes.forEach((path, i) => protocInc + '/' + path);
28+
wellKnownTypes.forEach((path) => protocInc + '/' + path);
3029

31-
var group1Protos = [
30+
const group1Protos = [
3231
'data.proto',
3332
'test3.proto',
3433
'test5.proto',
@@ -45,14 +44,14 @@ var group1Protos = [
4544
'testlargenumbers.proto',
4645
];
4746

48-
var group2Protos = [
47+
const group2Protos = [
4948
'proto3_test.proto',
5049
'test2.proto',
5150
'test4.proto',
5251
'commonjs/test7/test7.proto',
5352
];
5453

55-
var group3Protos = [
54+
const group3Protos = [
5655
'test9.proto',
5756
'test10.proto'
5857
];
@@ -119,9 +118,9 @@ function genproto_group3_commonjs_strict(cb) {
119118

120119

121120
function getClosureCompilerCommand(exportsFile, outputFile, keepSymbols) {
122-
var compilationLevel = 'ADVANCED_OPTIMIZATIONS';
121+
let compilationLevel = 'ADVANCED';
123122
if (keepSymbols === true) {
124-
compilationLevel = 'SIMPLE_OPTIMIZATIONS';
123+
compilationLevel = 'SIMPLE';
125124
}
126125

127126
const closureLib = 'node_modules/google-closure-library';
@@ -132,8 +131,8 @@ function getClosureCompilerCommand(exportsFile, outputFile, keepSymbols) {
132131
'--js=message.js', '--js=binary/arith.js', '--js=binary/constants.js',
133132
'--js=binary/decoder.js', '--js=binary/encoder.js', '--js=binary/reader.js',
134133
'--js=binary/utils.js', '--js=binary/writer.js', `--js=${exportsFile}`,
135-
`--compilation_level=${compilationLevel}"`, '--generate_exports',
136-
'--export_local_property_definitions"',
134+
`--compilation_level="${compilationLevel}"`, '--generate_exports',
135+
'--export_local_property_definitions',
137136
`--entry_point=${exportsFile}`, `> ${outputFile}`
138137
].join(' ');
139138
}
@@ -170,7 +169,7 @@ function commonjs_testdeps(cb) {
170169
function commonjs_out(cb) {
171170
// TODO(haberman): minify this more aggressively.
172171
// Will require proper externs/exports.
173-
var cmd =
172+
let cmd =
174173
'mkdir -p commonjs_out/binary && mkdir -p commonjs_out/test_node_modules && ';
175174
function addTestFile(file) {
176175
cmd += 'node commonjs/rewrite_tests_for_commonjs.js < ' + file +

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"jasmine": "~3.4.0"
1717
},
1818
"scripts": {
19+
"build": "node ./node_modules/gulp/bin/gulp.js dist",
1920
"test": "node ./node_modules/gulp/bin/gulp.js test"
2021
},
2122
"repository": {

0 commit comments

Comments
 (0)