Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR centralizes filesystem access in the poml package by creating a wrapper module to enable browser compatibility when bundling. The change routes all direct Node.js fs module imports through a new wrapper to facilitate mocking filesystem operations.
- Creates a new
util/fs.tswrapper module that re-exports Node.js filesystem functions - Updates all existing
fsimports across the package to use the centralized wrapper - Maintains the same API surface while enabling future browser compatibility
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/poml/util/fs.ts | New filesystem wrapper module that re-exports Node.js fs functions |
| packages/poml/util/trace.ts | Updated to import fs functions from the wrapper |
| packages/poml/util/index.ts | Updated to import readFileSync from the wrapper |
| packages/poml/util/audio.ts | Updated to import fs default export from the wrapper |
| packages/poml/tests/writer.test.tsx | Updated test to import readFileSync from the wrapper |
| packages/poml/tests/util.test.tsx | Updated test to import readFileSync from the wrapper |
| packages/poml/tests/trace.test.tsx | Updated test to import fs default export from the wrapper |
| packages/poml/tests/table.test.tsx | Updated test to import readFileSync from the wrapper |
| packages/poml/tests/index.test.tsx | Updated test to import fs default export from the wrapper |
| packages/poml/tests/components.test.tsx | Updated test to import multiple fs functions from the wrapper |
| packages/poml/index.ts | Updated to import fs functions from the wrapper |
| packages/poml/file.tsx | Updated to import fs functions from the wrapper |
| packages/poml/essentials.tsx | Updated to import fs default export from the wrapper |
| packages/poml/components/webpage.tsx | Updated to import fs default export from the wrapper |
| packages/poml/components/tree.tsx | Updated to import fs default export from the wrapper |
| packages/poml/components/table.tsx | Updated to import readFileSync from the wrapper |
| packages/poml/components/document.tsx | Updated to import fs default export from the wrapper |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fswrapper so filesystem access can be mocked when bundling for the browserpackages/pomlimports through the new wrapperTesting
npm run build-webviewnpm run build-clinpm run lintnpm testpython -m pytest python/testshttps://chatgpt.com/codex/tasks/task_e_68905af06674832eb9d215e89e0fcfb1