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(cli): --quickstart flag for ejecting server schemas #5797

Merged
merged 36 commits into from
Mar 4, 2024
Merged

Conversation

RostiMelk
Copy link
Member

@RostiMelk RostiMelk commented Feb 20, 2024

Description

This PR aims to add a --quickstart flag for initiating a project from a remote schema.

Beware that this new flag overrides some existing flags, as this data is already known and fetched from the API.

  • --project
  • --dataset
  • --template
  • --visibility

Fixes: GRO-1285, GRO-1589

What to review

  • Make sure existing functionality works as expected. Initing projects using the normal flow, or the --template flag should work as expected.
  • Make sure that using a combination of --quickstart and --template flags result in a CLI error.

Testing

Run init with --quickstart flag:

SANITY_INTERNAL_ENV=staging  sanity init --quickstart tpe1880t

Warning

Endpoints are still being built, will update once this whole flow works

Notes for release

I don't think we need to announce anything here. Flag should only be used in onboarding flow

@RostiMelk RostiMelk requested a review from a team as a code owner February 20, 2024 11:25
@RostiMelk RostiMelk requested review from cngonzalez and removed request for a team February 20, 2024 11:25
@RostiMelk RostiMelk marked this pull request as draft February 20, 2024 11:25
Copy link

vercel bot commented Feb 20, 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 Mar 4, 2024 4:11pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 4, 2024 4:11pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Mar 4, 2024 4:11pm

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Feb 20, 2024

Component Testing Report Updated Mar 4, 2024 4:14 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 31s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 6s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 12s 3 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 13s 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) 1m 2s 14 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 3s 18 0 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 12s 6 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 13s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ❌ Failed (Inspect) 24s 8 0 1

@RostiMelk RostiMelk changed the title feat(cli): --config flag for ejecting server schemas feat(cli): --quickstart flag for ejecting server schemas Feb 21, 2024
@@ -66,8 +67,17 @@ import {
// eslint-disable-next-line no-process-env
const isCI = process.env.CI

/**
* @deprecated - No longer used
*/
export interface InitOptions {
Copy link
Member Author

@RostiMelk RostiMelk Feb 21, 2024

Choose a reason for hiding this comment

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

This Interface is never used. Can it be removed to avoid confusion?

Copy link
Member

Choose a reason for hiding this comment

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

Good call. Looks like it's been superseded by InitFlags.

Copy link
Member

Choose a reason for hiding this comment

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

Do you want to remove it? Maybe better to do it in a separate PR

// We're authenticated, now lets select or create a project
debug('Prompting user to select or create a project')
Copy link
Member Author

Choose a reason for hiding this comment

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

All this code is moved into its own function getProjectDetails

@@ -66,8 +67,17 @@ import {
// eslint-disable-next-line no-process-env
const isCI = process.env.CI

/**
* @deprecated - No longer used
*/
export interface InitOptions {
Copy link
Member

Choose a reason for hiding this comment

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

Do you want to remove it? Maybe better to do it in a separate PR

packages/@sanity/cli/src/util/journeyConfig.ts Outdated Show resolved Hide resolved
Copy link

socket-security bot commented Mar 4, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@sanity/[email protected] None 0 439 kB ash, atombender, binoy14, ...41 more
npm/@sanity/[email protected] Transitive: environment +32 22.2 MB ash, atombender, binoy14, ...41 more
npm/@sanity/[email protected] None +1 757 kB ash, atombender, binoy14, ...41 more
npm/@sanity/[email protected] Transitive: filesystem +14 3.77 MB ash, atombender, binoy14, ...41 more
npm/@sanity/[email protected] Transitive: environment +6 1.66 MB ash, atombender, binoy14, ...41 more
npm/@sanity/[email protected] None +12 10.7 MB ash, atombender, binoy14, ...41 more
npm/@sanity/[email protected] None +3 1.24 MB ash, atombender, binoy14, ...41 more
npm/@sanity/[email protected] None +14 6.53 MB ash, atombender, binoy14, ...41 more
npm/@sanity/[email protected] None +11 3.54 MB ash, atombender, binoy14, ...41 more
npm/@sanity/[email protected] None +8 2.71 MB ash, atombender, binoy14, ...41 more
npm/@sanity/[email protected] None +9 2.86 MB ash, atombender, binoy14, ...41 more
npm/@sanity/[email protected] Transitive: environment +26 10.2 MB ash, atombender, binoy14, ...41 more
npm/[email protected] Transitive: environment, filesystem, unsafe +112 79.8 MB ash, atombender, binoy14, ...41 more

🚮 Removed packages: npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected]

View full report↗︎

Copy link
Member

@bjoerge bjoerge left a comment

Choose a reason for hiding this comment

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

Great work! Looks good from my side. Do you want/need a final approval from @joneidejohnsen re: the telemetry question below? (Edit: approved)

@sanity-io sanity-io deleted a comment from RostiMelk Mar 4, 2024
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