Skip to content

chore(structure): rename URL_file to URL_fromFile for clarity - #2712

Merged
Tobbe merged 3 commits into
cedarjs:mainfrom
lisa-assistant:lisa/rename-url-file-to-url-fromfile
Sep 15, 2026
Merged

Tobbe merged 3 commits into
cedarjs:mainfrom
lisa-assistant:lisa/rename-url-file-to-url-fromfile

Conversation

@lisa-assistant

@lisa-assistant lisa-assistant commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

URL_file's name is ambiguous. It's not clear from the name alone which direction the conversion goes. This renames it to URL_fromFile, which was already the target name noted in the function's own TODO comment.

Fixes #2673.

Fixes cedarjs#2673.

URL_file's name is ambiguous next to URL_toFile - it wasn't clear from
the name alone which direction the conversion goes. Renames the
function (self-documented with its own TODO for the target name) and
updates all internal call sites in nodes.ts, RWProject.ts, RWRouter.ts,
diagnostics.ts, prisma.ts, and the test suites.

Since URL_file is re-exported from the package's public barrel
(index.ts), keeps a deprecated `URL_fromFile as URL_file` alias for one
release cycle rather than a hard rename, since there's no way to know
whether anything outside this monorepo depends on the old name.
@netlify

netlify Bot commented Sep 14, 2026

Copy link
Copy Markdown

👷 Deploy request for cedarjs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 636b4fc

@github-actions github-actions Bot added this to the chore milestone Sep 14, 2026
@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 9f59a64d-ffca-4992-a614-ad915ea987ec

📥 Commits

Reviewing files that changed from the base of the PR and between c02cd85 and 636b4fc.

📒 Files selected for processing (10)
  • .changesets/2712.md
  • packages/structure/src/index.ts
  • packages/structure/src/model/RWProject.ts
  • packages/structure/src/model/RWRouter.ts
  • packages/structure/src/model/__tests__/model.test.ts
  • packages/structure/src/nodes.ts
  • packages/structure/src/x/URL.ts
  • packages/structure/src/x/__tests__/URL.test.ts
  • packages/structure/src/x/diagnostics.ts
  • packages/structure/src/x/prisma.ts

Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review.


📝 Summary

Summary by CodeRabbit

  • New Features

    • Added the URL_fromFile helper name for converting file paths to URLs.
    • Existing URL_file usage remains available as a deprecated compatibility alias for one release cycle.
  • Refactor

    • Updated internal URL, diagnostic, model, router, and schema handling to use URL_fromFile.
    • Updated automated tests to use the new helper name.

Walkthrough

The structure package renames URL_file to URL_fromFile, updates internal callers and tests, and retains URL_file as a deprecated public alias for one release cycle.

Changes

URL helper rename

Layer / File(s) Summary
Helper implementation and public export
packages/structure/src/x/URL.ts, packages/structure/src/index.ts, .changesets/2712.md
The helper is renamed to URL_fromFile. The package exports the new name and retains URL_file as a deprecated alias. The changeset records the rename.
Internal call-site migration
packages/structure/src/model/*, packages/structure/src/nodes.ts, packages/structure/src/x/diagnostics.ts, packages/structure/src/x/prisma.ts
Internal imports and calls now use URL_fromFile. Conversion behavior remains unchanged.
Test usage updates
packages/structure/src/x/__tests__/URL.test.ts, packages/structure/src/model/__tests__/model.test.ts
Tests now import and call URL_fromFile. Existing expectations remain unchanged.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 636b4

The rename and deprecated alias are mergeable after the changeset lint concern was disproved.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 9 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Issue #2673 requires the rename, internal call-site updates, and a deprecated public alias. packages/structure/src/x/URL.ts now exports URL_fromFile and removes the resolved TODO. The diff updates…
Out of Scope Changes check ✅ Passed The changes remain within issue #2673. The changeset documents the rename, and the TODO removal, call-site updates, alias, and test updates directly support the issue.
Title check ✅ Passed The title clearly and concisely describes the main change: renaming URL_file to URL_fromFile for clarity.
Description check ✅ Passed The description directly explains the rename, updated call sites, deprecated compatibility alias, changeset, and test results.
Full details: Docstring Coverage

Explanation

Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 9 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge because the rename is complete and the supported public API remains backward compatible.

Summary

  • Updates all internal source and test call sites.
  • Preserves the old package-root export as a deprecated compatibility alias.
  • Adds release-note metadata describing the rename and compatibility policy.

Reviews (1) · Last reviewed commit: "style: apply prose-wrap formatting to ch..."

@nx-cloud

nx-cloud Bot commented Sep 14, 2026

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 636b4fc

Command Status Duration Result
nx run-many -t test --maxWorkers=4 ✅ Succeeded 4m 24s View ↗
nx run-many -t test:types ✅ Succeeded 17s View ↗
nx run-many -t build:pack --exclude create-ceda... ✅ Succeeded 6s View ↗
nx run-many -t build --output-style=stream ✅ Succeeded 5s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-09-14 07:35:43 UTC

@Tobbe
Tobbe merged commit 5c78601 into cedarjs:main Sep 15, 2026
39 checks passed
@github-actions

Copy link
Copy Markdown

The changes in this PR are now available on npm.

Try them out by running yarn cedar upgrade -t 7.0.0-canary.3177

Or try it in a new app with yarn dlx create-cedar-app@7.0.0-canary.3177

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.

structure: rename URL_file to URL_fromFile for clarity

2 participants