
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
mock-block-dock
Advanced tools
A component which provides mocks for testing Block Protocol blocks.
When developing a block, wrap it in the embedder and pass your block its initial props:
<MockBlockDock>
<TestBlock {...props} />
</MockBlockDock>
The embedder will automatically pass the following Block Protocol functions to your block:
aggregateEntities
aggregateEntityTypes
getEntities
createEntities
deleteEntities
updateEntities
getLinks
createLinks
deleteLinks
updateLinks
uploadFile
For example, to update your block's props, get entityId
and updateEntities
from props and call:
updateEntities?.([{ entityId, data: { ...newProps } }]);
Your block will be re-rendered with its new properties.
It will also pass linkGroups
and linkedEntities
, which will be populated once you create links between entities using createLinks
(see linking entities for more).
The block will also be re-rendered with new properties if you update them on the child directly (e.g. if you are supplying the block component wrapped by MockBlockDock
with props from some outside state).
MockBlockDock
is automatically included in block-template, which you can copy via create-block-app
MockBlockDock
automatically supplies additional dummy entities and entity types in src/data/entities.ts
and src/data/entityTypes.ts
, and links between entities in src/data/links.ts
.
These dummy entities/links will be in the data store, and your block can discover them by calling aggregateEntityTypes
or aggregateEntities
.
If you prefer, you can provide your own initialEntities
and/or initialEntityTypes
and/or initialLinks
as props.
<MockBlockDock
initialEntities={[
// other entities for your block to use can be loaded into the datastore here
{
entityId: "my-dummy-entity",
entityTypeId: "dummy",
myOtherEntitysProperty: "foo",
},
]}
>
<TestBlock myBlockProperty="bar" /> // starting properties for your block
should still be set here
</MockBlockDock>
Only a subset of functionality listed in the Block Protocol spec is currently supported.
We will be adding more in the coming weeks.
FAQs
A mock embedding application for Block Protocol blocks
The npm package mock-block-dock receives a total of 328 weekly downloads. As such, mock-block-dock popularity was classified as not popular.
We found that mock-block-dock demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.