dapphub / dapphub/dpack

simpler declarative `build`

Open
#47 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
51
Forks
8
PR merge metrics
No merged PRs in 30d

Description

Based on our current usage it seems like we can just have a single pure `build` function. (We should also still have stateful builder pattern).

```
const pack = dpack.build({
network: hh.network.name,
types: {
'Gem': {
artifact: hh.artifacts.readArtifact('Gem')
},
},
objects: {
'gemfab': {
typename: 'Gem',
address: gem.address,
artifact: hh.artifacts.readArtifact('Gem'),
alsoPackType: true
}
}
})
```

notice:
* we can allow omitting redundant typename and objectname in places it can be inferred from the key. In later versions these could be distinct, but here they can't be
* `alsoPackType` can be patched onto the object directly

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the current stateful builder implementation and the existing public build entry point. Compare their current inputs and outputs with the declarative example, including inference from object keys and the alsoPackType behavior. Done means the pure build API works while the stateful builder pattern remains available, with tests covering both paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.