Skip to content

refactor: centralize fs usage in poml#69

Merged
ultmaster merged 1 commit intomainfrom
codex/move-fs-operations-to-dedicated-file
Aug 5, 2025
Merged

refactor: centralize fs usage in poml#69
ultmaster merged 1 commit intomainfrom
codex/move-fs-operations-to-dedicated-file

Conversation

@ultmaster
Copy link
Contributor

Summary

  • provide an fs wrapper so filesystem access can be mocked when bundling for the browser
  • route all packages/poml imports through the new wrapper

Testing

  • npm run build-webview
  • npm run build-cli
  • npm run lint
  • npm test
  • python -m pytest python/tests

https://chatgpt.com/codex/tasks/task_e_68905af06674832eb9d215e89e0fcfb1

Copilot AI review requested due to automatic review settings August 4, 2025 08:51
Copy link
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 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.ts wrapper module that re-exports Node.js filesystem functions
  • Updates all existing fs imports 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

@ultmaster ultmaster merged commit c42ac3d into main Aug 5, 2025
3 checks passed
@ultmaster ultmaster deleted the codex/move-fs-operations-to-dedicated-file branch August 27, 2025 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants