Skip to content

Conversation

@JkrishnaD
Copy link

Summary

This PR extracts the filesystem and path helpers previously located in @codama/renderers-core
into a new shared package: @codama/runtime-utils.

The goal is to centralize runtime-specific interactions (e.g. node:fs, node:path) in a
dedicated package so that Codama packages — including renderers — can be imported safely in
non-Node environments.

What changed

  • Introduced a new @codama/runtime-utils package
  • Moved fs and path helpers into this package without changing behavior
  • Updated renderers-core to consume the new shared helpers
  • Documented explicit failure behavior in non-Node environments

Notes

  • Behavior remains unchanged: filesystem helpers throw in non-Node environments.
  • This PR is intentionally scoped to extraction only.

Closes #67

@changeset-bot
Copy link

changeset-bot bot commented Dec 31, 2025

🦋 Changeset detected

Latest commit: 05b2684

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@codama/runtime-utils Major
@codama/renderers-core Patch

Not sure what this means? Click here to learn what changesets are.

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

@JkrishnaD
Copy link
Author

@lorisleiva have a look into this and let me know if there is any requirement for the changes

@lorisleiva
Copy link
Member

Hi there, thanks for this.

However, I can see a few issues by just running the code with my eyes though:

  • @codama/fs-path residues.
  • Not re-exporting @codama/runtime-utils inside @codama/renderers-core introduces a breaking change.
  • No changesets.
  • You're not actually making use of the new @codama/runtime-utils in the anchor adapter.

This is giving me AI slop vibes. Please review your own code thoroughly before publishing and ensure all tests are passing locally.

@JkrishnaD
Copy link
Author

hey @lorisleiva

  • I’ve pushed follow-up commits addressing the issues you pointed out and which i should have done in the first place.
  • Regarding the anchor adapter, I went through nodes-from-anchor and didn’t find any current usage of filesystem or path helpers that would benefit from runtime-utils

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.

[renderers-core] Create fs and path helper package that fails in non-node environments

2 participants