Skip to content

Implemented paragraph format extension for link element#61

Merged
gerhardgruber merged 1 commit into
mainfrom
lj/feat/linkParagraphExtension
May 11, 2026
Merged

Implemented paragraph format extension for link element#61
gerhardgruber merged 1 commit into
mainfrom
lj/feat/linkParagraphExtension

Conversation

@lukasbash
Copy link
Copy Markdown
Collaborator

This pull request introduces enhancements to the ProtoLink message 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:

  • Added paragraphFormatUUID and paragraphFormatInternalName fields to the ProtoLink message in build/docframe.proto and src/DocumentElements/documentelements.link.proto to allow links to reference paragraph formatting information. [1] [2]

Generated code updates:

  • Updated the ProtoLink struct in docframepb/docframe.pb.go to include the new fields, and added corresponding getter methods. [1] [2]
  • Modified the raw protobuf descriptor in docframepb/docframe.pb.go to reflect the new fields for serialization/deserialization.

Dependency and version updates:

  • Upgraded Go dependency golang.org/x/sys to v0.43.0 in go.mod.
  • Updated package.json version to 0.8.0, upgraded protobufjs and long dependencies, added npm-check-updates to devDependencies, and bumped protobufjs-cli version. [1] [2] [3]

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 paragraphFormatUUID and paragraphFormatInternalName to ProtoLink in 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.json scripts still use npm (e.g., commit / prepublish), but this PR removes package-lock.json and adds bun.lock. To avoid confusion and ensure reproducible installs, consider either restoring/updating package-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.

Comment thread build/Docframe.js Outdated
Comment on lines 97 to 116
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) {
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@lukasbash lukasbash force-pushed the lj/feat/linkParagraphExtension branch from 861cc91 to 383dd63 Compare May 11, 2026 04:18
@lukasbash
Copy link
Copy Markdown
Collaborator Author

@copilot I pushed a new commit. Review the changes.

Copy link
Copy Markdown

Copilot AI commented May 11, 2026

@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#):

  • 4 new fields added to ProtoLink with sequential field numbers 4–7: paragraphFormatUUID, paragraphFormatInternalName, urlCode, bindUrlCode
  • All generated code (Go getters, TS interface/class properties, C# properties) properly reflects the new fields
  • The protobufjs v7 → v8 upgrade explains the regenerated Docframe.js differences (decode signature, $unknowns handling, recursion depth protection, prototype pollution fix)
  • Version bump 0.8.0 → 0.8.1 is appropriate for additive changes

No issues found.

@gerhardgruber gerhardgruber merged commit d4cd8f3 into main May 11, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants