Implemented paragraph format extension for link element#61
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the ProtoLink protobuf message to carry paragraph-format metadata, regenerates the corresponding Go/JS/TS outputs, and updates/bump related dependencies.
Changes:
- Added
paragraphFormatUUIDandparagraphFormatInternalNametoProtoLinkin the source proto(s) and the combined build proto. - Regenerated Go (
docframepb) and JS/TS (build/Docframe.*) artifacts to include the new fields. - Updated Go and JS dependency versions and introduced a Bun lockfile.
Reviewed changes
Copilot reviewed 5 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/DocumentElements/documentelements.link.proto |
Adds paragraph-format metadata fields to ProtoLink. |
build/docframe.proto |
Updates the generated/combined proto to include the new ProtoLink fields. |
docframepb/docframe.pb.go |
Updates generated Go types and getters for the new ProtoLink fields. |
build/Docframe.js |
Updates generated JS encoder/decoder logic and ProtoLink fields. |
build/Docframe.d.ts |
Updates generated TS typings for the new ProtoLink fields. |
package.json |
Bumps package version and updates JS dependencies/devDependencies. |
package-lock.json |
Removes the npm lockfile. |
bun.lock |
Adds a Bun lockfile intended to replace/augment npm locking. |
go.mod |
Bumps golang.org/x/sys indirect dependency. |
go.sum |
Updates checksums for the bumped Go dependency. |
Comments suppressed due to low confidence (1)
package.json:32
package.jsonscripts still usenpm(e.g.,commit/prepublish), but this PR removespackage-lock.jsonand addsbun.lock. To avoid confusion and ensure reproducible installs, consider either restoring/updatingpackage-lock.json(if npm is the intended tool) or updating scripts/docs to consistently use Bun and its lockfile.
"scripts": {
"commit": "npm run-script build && npm version patch && npm publish && git push",
"build": "bash createDocframe.sh",
"prepublish": "npm run build"
},
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (!(reader instanceof $Reader)) | ||
| reader = $Reader.create(reader); | ||
| var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ProtoBoxedBool(); | ||
| while (reader.pos < end) { | ||
| var tag = reader.uint32(); | ||
| if (tag === error) | ||
| break; | ||
| switch (tag >>> 3) { |
There was a problem hiding this comment.
The generated decode methods now take an extra error parameter and contain if (tag === error) break;, but the JSDoc still documents only (reader, length) and there are no apparent call sites passing this third argument. If this isn't intentional/required by the generator, it adds confusing dead code and an undocumented API surface; consider regenerating with the intended protobufjs-cli version or updating the docs/generation settings so signatures and docs match.
There was a problem hiding this comment.
This is expected behavior — decode's third error param is internal/optional plumbing from protobufjs v8. pbts intentionally omits it from public type declarations because consumers shouldn't need to pass it.
JSDoc in .d.ts is not "wrong" — it's intentionally simplified public API. JS impl has error param for internal wire-format error recovery, but public TypeScript interface correctly shows only reader and length since that's all consumers should use.
861cc91 to
383dd63
Compare
|
@copilot I pushed a new commit. Review the changes. |
Reviewed the commit. Changes look correct and consistent across all generated artifacts (Go, JS/TS, C#):
No issues found. |
This pull request introduces enhancements to the
ProtoLinkmessage to support paragraph formatting metadata, updates generated Go code accordingly, and bumps several dependencies for both Go and JavaScript packages. The most significant changes are the addition of new fields to the protocol buffer definition and the corresponding updates in the generated code and dependencies.ProtoLink enhancements:
paragraphFormatUUIDandparagraphFormatInternalNamefields to theProtoLinkmessage inbuild/docframe.protoandsrc/DocumentElements/documentelements.link.prototo allow links to reference paragraph formatting information. [1] [2]Generated code updates:
ProtoLinkstruct indocframepb/docframe.pb.goto include the new fields, and added corresponding getter methods. [1] [2]docframepb/docframe.pb.goto reflect the new fields for serialization/deserialization.Dependency and version updates:
golang.org/x/systo v0.43.0 ingo.mod.package.jsonversion to 0.8.0, upgradedprotobufjsandlongdependencies, addednpm-check-updatesto devDependencies, and bumpedprotobufjs-cliversion. [1] [2] [3]