Skip to content
This repository was archived by the owner on Feb 26, 2026. It is now read-only.

Extract PLC directory functions into plc.ts#39

Merged
johnbillion merged 2 commits intotrunkfrom
claude/extract-plc-functions-rXm9m
Jan 10, 2026
Merged

Extract PLC directory functions into plc.ts#39
johnbillion merged 2 commits intotrunkfrom
claude/extract-plc-functions-rXm9m

Conversation

@johnbillion
Copy link
Copy Markdown
Owner

Move all functions that call createPlcClient into a new plc.ts file:

  • createPlcClient() and PLC_DIRECTORY_URL constant
  • submitDID(), updateDID(), and all DID update functions
  • getFairAlias() and related error classes (NoAliasError, MultipleAliasesError)

The operation builder functions (updateServiceUrlInOp, addVerificationKeyToOp, etc.)
remain in did.ts as they are pure functions that don't interact with the network.

All moved functions are re-exported from did.ts and domain.ts for backward
compatibility, ensuring no breaking changes for existing code.

Move all functions that call createPlcClient into a new plc.ts file:
- createPlcClient() and PLC_DIRECTORY_URL constant
- submitDID(), updateDID(), and all DID update functions
- getFairAlias() and related error classes (NoAliasError, MultipleAliasesError)

The operation builder functions (updateServiceUrlInOp, addVerificationKeyToOp, etc.)
remain in did.ts as they are pure functions that don't interact with the network.

All moved functions are re-exported from did.ts and domain.ts for backward
compatibility, ensuring no breaking changes for existing code.
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 pull request extracts PLC directory client functions from did.ts and domain.ts into a new dedicated plc.ts file to improve code organization. The refactoring separates network-related functions (those that interact with the PLC directory) from pure data transformation functions.

Changes:

  • Created new plc.ts file containing PLC client functions, DID update operations, and alias management
  • Retained pure operation builder functions in did.ts for local data manipulation
  • Maintained backward compatibility through re-exports in both did.ts and domain.ts

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/plc.ts New file containing PLC directory client, all network-based DID update functions, and getFairAlias functionality with error classes
src/did.ts Removed network functions, kept pure operation builders, added re-exports for backward compatibility, imports submitDID from plc.ts
src/domain.ts Removed getFairAlias and error classes, re-exports them from plc.ts for backward compatibility
src/verify.ts Updated imports to reference plc.ts for PLC_DIRECTORY_URL and createPlcClient
src/plc-log.ts Updated import to reference plc.ts for PLC_DIRECTORY_URL

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@johnbillion johnbillion added this to the 0.7.3 milestone Jan 10, 2026
@johnbillion johnbillion merged commit 6ea0599 into trunk Jan 10, 2026
4 checks passed
@johnbillion johnbillion deleted the claude/extract-plc-functions-rXm9m branch January 10, 2026 22:17
@johnbillion johnbillion modified the milestones: 0.7.3, 0.8.0 Jan 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants