Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): project root resolution #5712

Merged
merged 2 commits into from
Feb 14, 2024

Conversation

juice49
Copy link
Contributor

@juice49 juice49 commented Feb 12, 2024

Description

The CLI is intended to automatically resolve the project root if it's used inside the subdirectory of a Studio project. This behaviour has been broken for v3, because the resolution code mistakenly searches for studio.config.{ts,js} files, rather than sanity.config.{ts,js}. Therefore, it never finds the project root.

This was discovered and discussed in #5684.

What to review

  • That it's possible to use the CLI inside the subdirectory of a Studio project.
  • That when doing so, a warning is printed: "Not in project directory, assuming context of project at ${path}".

Testing

  • I've added a basic CLI unit test to ensure the help command can be executed inside Studio project subdirectories, and that the warning is printed.

Notes for release

Fixed a bug that prevented the CLI being used inside Studio project subdirectories.

Copy link

vercel bot commented Feb 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview Feb 12, 2024 4:51pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 12, 2024 4:51pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Feb 12, 2024 4:51pm

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Feb 12, 2024

Component Testing Report Updated Feb 12, 2024 4:51 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 33s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 6s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 13s 3 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 12s 4 2 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 12s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 33s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 18s 9 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 0s 18 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 13s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 20s 9 0 0

Copy link
Member

@rexxars rexxars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing!

@juice49 juice49 added this pull request to the merge queue Feb 14, 2024
Merged via the queue into next with commit 7ffd97d Feb 14, 2024
40 checks passed
@juice49 juice49 deleted the fix/sdx-1073-cli-project-root-resolution branch February 14, 2024 09:18
rexxars pushed a commit that referenced this pull request Feb 14, 2024
* fix(cli): project root resolution

* test(cli): test basic command can be run from Studio subdirectory
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.

2 participants