Skip to content

Refactor TypeScript SDK paths and simplify component registry#1602

Merged
Adammatthiesen merged 6 commits into
mainfrom
more-progress
Jul 15, 2026
Merged

Refactor TypeScript SDK paths and simplify component registry#1602
Adammatthiesen merged 6 commits into
mainfrom
more-progress

Conversation

@Adammatthiesen

@Adammatthiesen Adammatthiesen commented Jul 14, 2026

Copy link
Copy Markdown
Member

This pull request includes several dependency and codebase cleanups, as well as improvements to path resolution and configuration handling in the component registry. The most significant changes are the removal of the custom resolver utility in favor of a new createPathResolver, simplification of the code and tests, and removal of the S3 storage integration from the playground. There are also minor updates to VSCode settings and the frontend code component.

Component Registry Refactoring and Path Resolution:

  • Replaced the custom resolver utility with a new createPathResolver from @withstudiocms/internal_helpers/pathResolver, simplifying path resolution logic in handler.ts and removing the old implementation and related tests (packages/@withstudiocms/component-registry/src/registry/handler.ts, packages/@withstudiocms/component-registry/src/utils.ts, packages/@withstudiocms/component-registry/test/utils.test.ts). [1] [2] [3] [4] [5] [6] [7] [8]

  • Improved naming logic for the registry name to ensure it always includes -component-registry (packages/@withstudiocms/component-registry/src/registry/handler.ts).

Configuration and Integration Cleanup:

  • Updated the StudioCMS config resolver to use the non-Effect version (configResolverBuilder) and removed the S3 storage manager integration from the playground and related dependency files (packages/studiocms/src/index.ts, playground/package.json, playground/studiocms.config.mts, pnpm-lock.yaml). [1] [2] [3] [4] [5]

VSCode and Dev Environment Updates:

  • Updated VSCode settings to use the new js/ts.tsdk.path key and removed unused or deprecated settings and extensions (.devcontainer/devcontainer.json, .vscode/settings.json, .vscode/extensions.json). [1] [2] [3] [4]

Frontend and Test Improvements:

  • Wrapped the code-diff highlighting logic in an IIFE for better encapsulation and updated related tests and snapshots (packages/studiocms/frontend/components/shared/Code.astro, packages/studiocms/test/__snapshots__/components.test.ts.snap). [1] [2] [3] [4]

Miscellaneous:

  • Simplified the dynamic import for server translations in the i18n config (packages/studiocms/src/virtuals/i18n/config.ts).

Summary by CodeRabbit

  • Bug Fixes

    • Improved component registry path resolution for more reliable component loading.
    • Fixed Code component script execution and translation import handling.
    • Simplified configuration and translation loading for improved compatibility.
  • Chores

    • Removed S3 storage from the playground configuration.
    • Updated development environment TypeScript settings and extension recommendations.

@changeset-bot

changeset-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6a3d452

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

This PR includes changesets to release 2 packages
Name Type
@withstudiocms/component-registry Patch
studiocms 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

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6d610de1-7b58-4a57-86b6-66b96b2ba3de

📥 Commits

Reviewing files that changed from the base of the PR and between 579ec33 and 6a3d452.

⛔ Files ignored due to path filters (2)
  • packages/studiocms/test/__snapshots__/components.test.ts.snap is excluded by !**/*.snap
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (13)
  • .changeset/beige-lizards-cover.md
  • .changeset/whole-clocks-say.md
  • .devcontainer/devcontainer.json
  • .vscode/extensions.json
  • .vscode/settings.json
  • packages/@withstudiocms/component-registry/src/registry/handler.ts
  • packages/@withstudiocms/component-registry/src/utils.ts
  • packages/@withstudiocms/component-registry/test/utils.test.ts
  • packages/studiocms/frontend/components/shared/Code.astro
  • packages/studiocms/src/index.ts
  • packages/studiocms/src/virtuals/i18n/config.ts
  • playground/package.json
  • playground/studiocms.config.mts
💤 Files with no reviewable changes (5)
  • .vscode/extensions.json
  • playground/package.json
  • packages/@withstudiocms/component-registry/test/utils.test.ts
  • playground/studiocms.config.mts
  • packages/@withstudiocms/component-registry/src/utils.ts

📝 Walkthrough

Walkthrough

The changes replace component registry path resolution, fix StudioCMS script and import behavior, remove playground S3 storage, and update VS Code configuration. Changesets record patch releases for the affected packages.

Changes

Component registry resolution

Layer / File(s) Summary
Direct component path resolution
packages/@withstudiocms/component-registry/src/{utils.ts,registry/handler.ts}, packages/@withstudiocms/component-registry/test/utils.test.ts, .changeset/beige-lizards-cover.md
Component registry setup uses createPathResolver directly, removes the exported Effect-based resolver, removes its tests, and records a patch changeset.

StudioCMS runtime fixes

Layer / File(s) Summary
Runtime script and import fixes
packages/studiocms/frontend/components/shared/Code.astro, packages/studiocms/src/index.ts, packages/studiocms/src/virtuals/i18n/config.ts, .changeset/whole-clocks-say.md
The Code diff script is wrapped in an IIFE, configuration uses configResolverBuilder, translations use a direct JSON import, and a patch changeset is added.

Playground storage configuration

Layer / File(s) Summary
Remove playground S3 storage
playground/package.json, playground/studiocms.config.mts
The playground removes its S3 storage dependency and storageManager configuration.

Workspace editor settings

Layer / File(s) Summary
Update editor configuration
.devcontainer/devcontainer.json, .vscode/settings.json, .vscode/extensions.json
TypeScript SDK settings use js/ts.tsdk.path, the Vitest workspace warning setting is removed, and the GitLens recommendation is deleted.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR bundles multiple unrelated changes, including registry, tooling, playground, and translation updates beyond the Code.astro fix. Split the unrelated registry, tooling, playground, and config updates into separate PRs, and keep this one focused on the Code.astro compiler fix.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise, imperative, and describes the main refactor areas accurately.
Linked Issues check ✅ Passed Code.astro now wraps the inline script in an IIFE, which resolves the top-level return compiler error from #1555.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch more-progress

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.

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Allure Test Report for this PR:

Allure Report | History

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/studiocms/src/index.ts 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@pkg-pr-new

pkg-pr-new Bot commented Jul 14, 2026

Copy link
Copy Markdown
create-studiocms

npm i https://pkg.pr.new/create-studiocms@1602

effectify

npm i https://pkg.pr.new/effectify@1602

studiocms

npm i https://pkg.pr.new/studiocms@1602

@studiocms/auth0

npm i https://pkg.pr.new/@studiocms/auth0@1602

@studiocms/blog

npm i https://pkg.pr.new/@studiocms/blog@1602

@studiocms/cloudinary-image-service

npm i https://pkg.pr.new/@studiocms/cloudinary-image-service@1602

@studiocms/devapps

npm i https://pkg.pr.new/@studiocms/devapps@1602

@studiocms/discord

npm i https://pkg.pr.new/@studiocms/discord@1602

@studiocms/github

npm i https://pkg.pr.new/@studiocms/github@1602

@studiocms/google

npm i https://pkg.pr.new/@studiocms/google@1602

@studiocms/html

npm i https://pkg.pr.new/@studiocms/html@1602

@studiocms/markdoc

npm i https://pkg.pr.new/@studiocms/markdoc@1602

@studiocms/markdown-remark

npm i https://pkg.pr.new/@studiocms/markdown-remark@1602

@studiocms/md

npm i https://pkg.pr.new/@studiocms/md@1602

@studiocms/mdx

npm i https://pkg.pr.new/@studiocms/mdx@1602

@studiocms/s3-storage

npm i https://pkg.pr.new/@studiocms/s3-storage@1602

@studiocms/upgrade

npm i https://pkg.pr.new/@studiocms/upgrade@1602

@studiocms/wysiwyg

npm i https://pkg.pr.new/@studiocms/wysiwyg@1602

@withstudiocms/api-spec

npm i https://pkg.pr.new/@withstudiocms/api-spec@1602

@withstudiocms/auth-kit

npm i https://pkg.pr.new/@withstudiocms/auth-kit@1602

@withstudiocms/cli-kit

npm i https://pkg.pr.new/@withstudiocms/cli-kit@1602

@withstudiocms/component-registry

npm i https://pkg.pr.new/@withstudiocms/component-registry@1602

@withstudiocms/config-utils

npm i https://pkg.pr.new/@withstudiocms/config-utils@1602

@withstudiocms/effect

npm i https://pkg.pr.new/@withstudiocms/effect@1602

@withstudiocms/internal_helpers

npm i https://pkg.pr.new/@withstudiocms/internal_helpers@1602

@withstudiocms/kysely

npm i https://pkg.pr.new/@withstudiocms/kysely@1602

@withstudiocms/sdk

npm i https://pkg.pr.new/@withstudiocms/sdk@1602

@withstudiocms/template-lang

npm i https://pkg.pr.new/@withstudiocms/template-lang@1602

commit: 6a3d452

@Adammatthiesen
Adammatthiesen marked this pull request as ready for review July 14, 2026 23:20
@Adammatthiesen
Adammatthiesen requested a review from a team as a code owner July 14, 2026 23:20
@Adammatthiesen
Adammatthiesen merged commit c5070e8 into main Jul 15, 2026
29 checks passed
@Adammatthiesen
Adammatthiesen deleted the more-progress branch July 15, 2026 18:51
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.

[Bug]: A 'return' statement can only be used within a function body.

3 participants