Skip to content

Commit

Permalink
use PartialDeep for message encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
tatethurston committed Jul 23, 2023
1 parent 4813142 commit 9c110c3
Show file tree
Hide file tree
Showing 60 changed files with 5,940 additions and 11,313 deletions.
18 changes: 5 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,15 @@ jobs:
- run: pnpm test:ci && pnpm codecov --token=$CODECOV_TOKEN
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Check for uncommited changes to well known types (pnpm build:wellknowntypes)
- name: Check for uncommited changes to generated files
run: |
pnpm build:wellknowntypes
pnpm regen
if git diff --quiet; then
echo "No changes detected."
else
echo "Changes detected:"
git diff --name-only
echo "Changes detected. Failing build."
exit 1
fi
- name: Check for uncommited changes to examples (pnpm examples:regen)
run: |
pnpm examples:regen
if git diff --quiet; then
echo "No changes detected."
else
git diff --name-only
echo "Changes detected. Failing build."
git diff
echo "Failing build."
exit 1
fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
coverage
node_modules
todo.txt
well-known-types/**/*.pb.ts
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
. "$(dirname -- "$0")/_/husky.sh"

pnpm run package:build
pnpm run regen
pnpm run lint:fix
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist
coverage
pnpm-lock.yaml
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## v0.0.15

- `encode` methods now accept partials for nested messages as well (`PartialDeep` instead of `Partial`). Previously, the types required that full messages were provided for any nested messages.

## v0.0.15

This release includes a number of bug fixes

- Fix treeshaking for nested messages. Previously, there were cases where protobuf did not tree shake out of JSON only client usage. Thanks @noahseger!
Expand Down
4 changes: 4 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ As part of installation, husky pre-commit hooks are installed to run linters aga
### Publishing

There are CI and publishing GitHub workflows in `./github/workflows`. These are named `ci.yml` and `publish.yml`.

### Note

`protoscript` package self referencing is used by the wellknowntypes. right now works in a surprising manner: the package is built into dist, but the source package.json has the same name as the package.json that will be generated into dist. This results in self referencing using the source directory when everything is built.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ console.log(json);
const userFromJSON = UserJSON.decode(json);
console.log(userFromJSON);

// ProtoScript generates and consumes plain JavaScript objects (POJOs) over classes. If you want to generate
// a full message with default fields, you can use the #initialize method on the generated message class:
// ProtoScript generates and consumes plain JavaScript objects (POJOs) over classes. If you want to generate a full message
// with default fields, you can use the #initialize method on the generated message class:
const user = User.initialize();
console.log(user);
```
Expand Down
4 changes: 2 additions & 2 deletions dist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"sideEffects": false,
"types": "./index.d.ts",
"dependencies": {
"google-protobuf": "^3.21.0",
"prettier": "^2.7.1"
"google-protobuf": "^3.21.2",
"prettier": "^3.0.0"
},
"keywords": ["protobuf", "protocol buffers", "typescript"],
"exports": {
Expand Down
1,560 changes: 1,560 additions & 0 deletions e2e/conformance/failing_tests.txt

Large diffs are not rendered by default.

Loading

0 comments on commit 9c110c3

Please sign in to comment.