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

feat: add CLI options to enable auto-updating studios #6514

Merged
merged 6 commits into from
Jun 11, 2024
Merged

Conversation

ricokahler
Copy link
Contributor

@ricokahler ricokahler commented Apr 29, 2024

Description

Adds the --enable-auto-updates and unstable_enableAutoUpdates flags to the CLI build options and config.

Additionally this PR:

  • Adds importMap support to renderDocument and sanityBuildEntries via node-html-parser (see tests)
  • Refactors the external array to derive the external values from the specified import map.

Note that this will only affect the built version of the Studio and local versions will not use import maps. This decision was made because we did not want to provide a react dev build however this could potentially be possible now with import maps.

What to review

  • Review the logic, did I miss anything?
  • Take a look at the tests, ensure the import map is being added correctly.

Testing

I added tests and I tried this out in the test-studio locally.

Notes for release

N/A

@ricokahler ricokahler requested a review from a team as a code owner April 29, 2024 15:56
@ricokahler ricokahler requested review from rexxars and removed request for a team April 29, 2024 15:56
Copy link

vercel bot commented Apr 29, 2024

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

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2024 7:37pm
performance-studio ✅ Ready (Inspect) Visit Preview Jun 10, 2024 7:37pm
test-compiled-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2024 7:37pm
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2024 7:37pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2024 7:37pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Jun 10, 2024 7:37pm

@ricokahler ricokahler requested a review from binoy14 April 29, 2024 15:56
Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Apr 29, 2024

Component Testing Report Updated Jun 10, 2024 7:39 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 36s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 6s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 26s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 32s 11 7 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 14s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 8s 3 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 36s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 17s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 5s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 7s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 21s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 14s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 30s 12 0 0

Copy link

socket-security bot commented Apr 29, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report↗︎

ricokahler and others added 6 commits June 10, 2024 15:28
* feat(cli): build user peer-deps

* chore: remove shared-modules build

* test(cli):  verify build config and `exports` subpaths

* text(cli): add depcheck config for fixture projects

* docs: update comments and test name

* feat: create import map w/ installed sanity version (#6784)

* feat: create import map w/ installed sanity version

* fix: use correct URL
if (autoUpdatesEnabled) {
const version = encodeURIComponent(`^${installedSanityVersion}`)
const autoUpdatesImports = {
'sanity': `https://api.sanity.work/v1/modules/sanity/default/${version}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

note this is changing in a PR in in the stack above

Copy link
Contributor

@binoy14 binoy14 left a comment

Choose a reason for hiding this comment

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

makes sense to me, I have tested it in canaries and locally

@binoy14 binoy14 added this pull request to the merge queue Jun 11, 2024
Merged via the queue into next with commit 5077c8b Jun 11, 2024
42 of 43 checks passed
@binoy14 binoy14 deleted the sdx-1242 branch June 11, 2024 20:40
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.

3 participants