919 Commits

Author SHA1 Message Date
Alexander Fenster
fa01883a0f
fix(deps): use eslint 8.x (#1728) 2022-05-19 15:05:18 -07:00
Taylor McIntyre
d13d5d5688
feat: add getTypeUrl method to generated code (#1463)
* Add getTypeUrl method to static-module generated code

* add tests for getTypeUrl method
2021-05-21 15:53:03 -07:00
Aleksei Androsov
f5b893c03e
fix: support for options with repeated_value: [ "foo", "bar" ] (#1574)
Co-authored-by: Alexander Fenster <fenster@google.com>
2021-05-13 18:00:49 -07:00
Simon Lipp
6e713baf54
feat: add null-defaults option (#1611)
* feat: add null-defaults option

* fix: linting

Co-authored-by: Alexander Fenster <github@fenster.name>
Co-authored-by: Alexander Fenster <fenster@google.com>
2021-05-07 20:29:36 -07:00
Iaroslav Kolbin
9011aac161
fix: handling properly fields with leading and trailing comments after field with trailing comment (#1593)
Co-authored-by: Iaroslav Kolbin <y.kolbin@team.bumble.com>
Co-authored-by: Alexander Fenster <fenster@google.com>
2021-05-07 17:04:51 -07:00
Ikko Ashimine
57fc524948
Fix typo in roots.js (#1608)
accross -> across
2021-05-03 10:04:41 -07:00
Jeffory Orrok
af1b449602
fix: allow for an optional semicolon where there is an optional comma in parseOptionValue (#1571)
* allow for an optional semicolon where there is an optional comma in parseOptionValue

* set allowShortCircuit to true to prevent no-unused-expressions error

* add test for semicolon

Co-authored-by: Alexander Fenster <fenster@google.com>
2021-04-29 00:49:40 -07:00
Alexander Fenster
90afe4412d
fix: fromObject should not initialize oneof members (#1597)
* test: adding test for pbjs static code generation

* fix: fromObject should not initialize oneof members
2021-04-28 18:25:37 -07:00
Alexander Fenster
6c4d30716a
feat: proto3 optional support (#1584)
Co-authored-by: Benjamin E. Coe <bencoe@google.com>
2021-04-15 10:56:00 -07:00
Fedor Indutny
94e9ef0224
deps: set @types/node to >= (#1575)
* deps: set @types/node to star version

When using `protobuf.js` as a dependency in a project it is important
that `@types/node` package gets de-duped and has the same version as for
the rest of the modules in the project. Otherwise, typing conflicts
could happen as they do between v13 and v14 node types.

* fix: use @types/node >=13.7.0

* fix: use @types/node >=13.7.0

Co-authored-by: Alexander Fenster <fenster@google.com>
Co-authored-by: Alexander Fenster <github@fenster.name>
2021-04-14 10:53:03 -07:00
Matthew Douglass
d01394a146
feat: add --no-service option for pbjs static target (#1577)
This option skips generation of service clients.

Co-authored-by: Alexander Fenster <fenster@google.com>
2021-04-14 10:33:42 -07:00
SK
40a6b353f9
docs: fix pbjs link in README (#1578)
parent README doesn't have documentation about pbjs and it is moved to cli's README, update the link to the correct one.
2021-04-09 15:43:38 -07:00
Benjamin E. Coe
95b56817ef
deps(security): address elliptic security warning (#1564) 2021-03-12 16:01:59 -08:00
Mike Ralphson
7f46dbeb53
fix: typo in pbjs help text (#1552) 2021-03-12 15:54:47 -08:00
Taylor McIntyre
da34f43ccd
feat!: move command line tool to a new package named protobufjs-cli (#1234)
* Get protobufjs-cli to a publishable state

* Fix eslint issues

* Fix pbts path

* Install cli package deps on CI 'build' job

* fix: get rid of require-protobufjs.js

* fix: lint

* fix: versions

* chore(deps): update package-lock.json

Co-authored-by: Stacey Sern <stacey@dropbox.com>
Co-authored-by: Gabriel Cangussu <gabrielcangussu@gmail.com>
Co-authored-by: Alexander Fenster <fenster@google.com>
2021-01-15 16:02:00 -08:00
Victor Berchet
b4cae07440
fix!: encoding of empty Buffers (#1514)
closes #1500
fixes #885

Co-authored-by: Benjamin E. Coe <bencoe@google.com>
2020-12-07 14:40:34 -08:00
Benjamin E. Coe
52d4f0027b
build: use action for publishing (#1518) 2020-12-07 14:36:01 -08:00
renovate[bot]
e8860ab17a
chore(deps): update dependency gulp-sourcemaps to v3 (#1508)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Alexander Fenster <fenster@google.com>
2020-12-01 14:31:40 -08:00
dependabot[bot]
08855f6907
build(deps): bump bl from 1.2.2 to 1.2.3 (#1510)
Bumps [bl](https://github.com/rvagg/bl) from 1.2.2 to 1.2.3.
- [Release notes](https://github.com/rvagg/bl/releases)
- [Commits](https://github.com/rvagg/bl/compare/v1.2.2...v1.2.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-01 14:26:30 -08:00
release-please[bot]
aea41b87da
chore: release 6.10.2 (#1454)
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
v6.10.2
2020-11-16 13:15:22 -08:00
Alexander Fenster
3d29969865
fix: make parsedOptions appear in method JSON representation (#1506) 2020-11-13 15:51:07 -08:00
renovate[bot]
ade223dfdf
chore(deps): update dependency browserify to v17 (#1496)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-10 17:33:16 -07:00
Alexander Fenster
4549383783
chore(deps): update dependency escodegen to v2
chore(deps): update dependency escodegen to v2
2020-10-10 16:10:11 -07:00
Renovate Bot
b77a0cde62
chore(deps): update dependency escodegen to v2 2020-10-10 03:18:06 +00:00
Alexander Fenster
80451da939
docs: fix JSON formatting
docs: fix JSON formatting
2020-10-09 20:07:26 -07:00
Alexander Fenster
b6b845b2c8
docs: fix JSON formatting 2020-10-09 15:56:11 -07:00
Alexander Fenster
7b1efdb8b6
Update readme.md => fix the json example (#1360)
The json example was not equivalent to the .proto file. The message type should be nested in a namespace.
2020-10-09 15:54:49 -07:00
Mason Clayton
75172cd11b
fix: utf8 -> utf16 decoding bug on surrogate pairs (#1486)
* fix utf8 -> utf16 decoding bug on surrogate pairs

This fixes https://github.com/protobufjs/protobuf.js/issues/1473

The custom utf8 -> utf16 decoder appears to be subtly flawed. From my reading it appears the chunking mechanism doesn't account for surrogate pairs at the end of a chunk causing variable size chunks. A larger chunk followed by a smaller chunk leaves behind garbage that'll be included in the latter chunk.

It looks like the chunking mechanism was added to prevent stack overflows when calling `formCharCode` with too many args. From some benchmarking it appears putting utf16 code units in an array and spreading that into `fromCharCode` wasn't helping performance much anyway. I simplified it significantly.

Here's a repro of the existing encoding bug in a fuzzing suite
https://repl.it/@turbio/oh-no-our-strings#decoder.js

* fix lint

* add test case for surrogate pair bug

Co-authored-by: Alexander Fenster <fenster@google.com>
2020-10-09 15:54:17 -07:00
Kevin Decker
d871d97278
test: rebuild tests for current runtime (#1476)
* Rebuild gentest sources

* Incorporate gentests into make

Also reorder tasks so type linting is done against newly generated code vs. old.

* fix: add newline to package.json

Co-authored-by: Alexander Fenster <fenster@google.com>
Co-authored-by: Alexander Fenster <github@fenster.name>
2020-09-18 16:01:05 -07:00
Christopher Dignam
9893e35b85
docs: fix homepage 404 in npm package (#1458)
Based on this comment I think this is the correct URL.
https://github.com/protobufjs/protobuf.js/issues/1210#issuecomment-485744621

Co-authored-by: Alexander Fenster <fenster@google.com>
2020-08-07 15:27:12 -07:00
renovate[bot]
2ddf3dcbd0
chore(deps): update dependency tslint to v6 (#1466)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-08-01 15:08:21 -07:00
dependabot[bot]
07486327ca
build(deps): bump elliptic from 6.5.2 to 6.5.3 (#1462)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.2...v6.5.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-31 13:18:24 -07:00
翠 / green
9f33784350
fix: es6 export enum (#1446)
Co-authored-by: Alexander Fenster <fenster@google.com>
2020-07-17 15:59:03 -07:00
dependabot[bot]
f9f2c43e77
build(deps): bump lodash from 4.17.15 to 4.17.19 (#1450)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-17 15:36:40 -07:00
release-please[bot]
0fea8cd361
chore: release 6.10.1 (#1448)
* updated CHANGELOG.md [ci skip]

* updated package.json [ci skip]

* updated package-lock.json [ci skip]

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
v6.10.1
2020-07-15 19:51:39 -07:00
Alexander Fenster
c1f2d7b4ac
build: regenerate dist (#1449) v6.10.1-beta.0 2020-07-15 17:34:54 -07:00
Daniel Wirtz
4e75f6de4a
fix: make node detection a bit more forgiving (#1445)
* Make node detection a bit more forgiving

* reorder

* make sure we get a boolean
2020-07-15 16:30:05 -07:00
release-please[bot]
07e8185379
chore: release 6.10.0 (#1424)
* updated CHANGELOG.md [ci skip]

* updated package.json [ci skip]

* updated package-lock.json [ci skip]

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Alexander Fenster <fenster@google.com>
v6.10.0
2020-07-13 16:32:57 -07:00
Alexander Fenster
8fe584bf00
build: rebuild bundle (#1442) v6.10.0-beta.2 2020-07-13 16:05:35 -07:00
Daniel Wirtz
742b8dcbc7
fix: fix util.global (#1441) 2020-07-13 15:57:03 -07:00
Alexander Fenster
f2faa8c32e
fix: do not fail if no process (#1440) 2020-07-13 15:33:10 -07:00
Matthias Schiffer
b950877c86
fix: handling of map entries with omitted key or value (#1348)
According to [1], map encoding must be compatible with a repeated message
using indices 1 and 2 for key and value. In particular this implies that
both key and value may be omitted when they are equal to the default
value - which some protobuf implementations like protobuf-c actually do.

The comments in the added testcase are based on the output of
protobuf-inspector [2].

[1] https://developers.google.com/protocol-buffers/docs/proto3#backwards-compatibility
[2] https://github.com/jmendeth/protobuf-inspector

Based-on-patch-by: Shrimpz <Shrimpz@qq.com>

Co-authored-by: Alexander Fenster <fenster@google.com>
v6.10.0-beta.1
2020-07-10 15:52:56 -07:00
Eyal Post
7a25398430
feat: parsed options (#1256)
* Add option parsing tests to ensure no regressions are caused

* Properly parse option values into objects in addition to the regular option parsing. Repeated options are preserved as well as repeated fields within nested options.
Parsed options are kept in a parsedOptions field on every level (message, field etc.)

* fix: bad merge

* fix: lint

* fix: lint

* fix: lint

* fix: lint

* fix: lint

* fix: build types

Co-authored-by: Alexander Fenster <fenster@google.com>
Co-authored-by: Alexander Fenster <github@fenster.name>
2020-07-10 15:43:30 -07:00
recih
7fd2e18215
feat: better comment parse (#1419)
* fix trailing comment in last line recognized as leading comment for current token.

* add preferTrailingComment to IParseOptions

Co-authored-by: Alexander Fenster <fenster@google.com>
2020-06-26 15:48:30 -07:00
Nicolas Noble
b6abd93bde
Merge pull request #1430 from webmaster128/allow-commonjs-es6
fix: Don't imply --wrap es6 from --es6 in pbjs
2020-06-26 15:20:29 -07:00
Tom Willoughby
cd4aeda803
fix: allow Windows unc paths to be resolved and normalized (#1351)
* Add unc paths to isAbsolute regex

* Allow unc paths to be resolved and normalized

* Remove trailing whitespace
2020-06-25 09:56:45 -07:00
Simon Warta
6698d59243 Don't imply --wrap es6 from --es6 2020-06-18 11:13:31 +02:00
Michael Lumish
7fbc79f11d
fix: properly parse empty messages in options (#1429)
* Properly parse empty messages in options

* Add missing semicolon in test
v6.10.0-beta.0
2020-06-17 16:04:47 -07:00
recih
ad3cffdc5a
feat: add configurable Root.prototype.fetch 2020-06-12 15:24:26 -07:00
renovate[bot]
1b8aa8f482
chore(deps): update dependency gh-pages to v3 (#1416)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-30 02:15:02 -07:00