Skip to content

refactor: inject I/O in fetch-all-bundles.ts, add-proposal.ts #249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 28, 2025

Conversation

dckc
Copy link
Member

@dckc dckc commented May 28, 2025

follow-up to #84 to inject I/O

@dckc dckc requested a review from turadg May 28, 2025 20:56
Copy link

semanticdiff-com bot commented May 28, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  packages/synthetic-chain/src/lib/bundles.ts  70% smaller
  packages/synthetic-chain/src/cli/chain.ts  39% smaller
  scripts/fetch-all-bundles.ts  38% smaller
  scripts/add-proposal.ts  32% smaller
  packages/synthetic-chain/src/lib/webAsset.js  9% smaller
  packages/synthetic-chain/src/cli/proposals.ts  0% smaller
  packages/synthetic-chain/test/snapshots/test-exports.ts.md Unsupported file format
  packages/synthetic-chain/test/snapshots/test-exports.ts.snap Unsupported file format

Copy link

changeset-bot bot commented May 28, 2025

⚠️ No Changeset found

Latest commit: ff884dd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

*
* @typedef {ReturnType<typeof makeDirRd>} DirRd
*/
export const makeDirRd = (root, { fsp, fs, path }) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

adding readdir and basename to the args of makeFileRd would be an incompatible change, so makeDirRd is separate.

@dckc dckc requested a review from gibson042 May 28, 2025 21:05
Copy link
Member

@turadg turadg left a comment

Choose a reason for hiding this comment

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

I'm approving reluctantly.

The code looks sound. My reservations are:

  1. Security that has no value for tests
  2. New abstractions that are unfamiliar and increase cognitive overhead
  3. More code to maintain
  4. One-off abstraction of file system

I would be less reluctant if Endo or some other package (@dckc/ocap?) had a thorough abstraction for FS that could be dropped in. Especially if it rhymes with existing APIs.

@dckc dckc merged commit 05bde38 into main May 28, 2025
4 checks passed
@dckc dckc deleted the dc-inject-io branch May 28, 2025 22:50
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.

2 participants