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/block-tools@3.30.1 None 0 439 kB ash, atombender, binoy14, ...41 more
npm/@sanity/cli@3.30.1 Transitive: environment +32 22.2 MB ash, atombender, binoy14, ...41 more
npm/@sanity/diff@3.30.1 None +1 757 kB ash, atombender, binoy14, ...41 more
npm/@sanity/export@3.30.1 Transitive: filesystem +14 3.77 MB ash, atombender, binoy14, ...41 more
npm/@sanity/import@3.30.1 Transitive: environment +6 1.66 MB ash, atombender, binoy14, ...41 more
npm/@sanity/migrate@3.30.1 None +12 10.7 MB ash, atombender, binoy14, ...41 more
npm/@sanity/mutator@3.30.1 None +3 1.24 MB ash, atombender, binoy14, ...41 more
npm/@sanity/portable-text-editor@3.30.1 None +14 6.53 MB ash, atombender, binoy14, ...41 more
npm/@sanity/schema@3.30.1 None +11 3.54 MB ash, atombender, binoy14, ...41 more
npm/@sanity/types@3.30.1 None +8 2.71 MB ash, atombender, binoy14, ...41 more
npm/@sanity/util@3.30.1 None +9 2.86 MB ash, atombender, binoy14, ...41 more
npm/@sanity/vision@3.30.1 Transitive: environment +26 10.2 MB ash, atombender, binoy14, ...41 more
npm/sanity@3.30.1 Transitive: environment, filesystem, unsafe +112 79.8 MB ash, atombender, binoy14, ...41 more

🚮 Removed packages: npm/color2k@2.0.3, npm/configstore@5.0.1, npm/connect-history-api-fallback@1.6.0, npm/console-table-printer@2.12.0, npm/cpx@1.5.0, npm/dataloader@2.2.2, npm/date-fns@2.30.0, npm/debug@3.2.7, npm/debug@4.3.4, npm/decompress@4.2.1, npm/deep-sort-object@1.0.2, npm/depcheck@1.4.7, npm/dotenv-expand@9.0.0, npm/dotenv-flow@3.3.0, npm/dotenv@16.3.2, npm/esbuild-register@3.5.0, npm/esbuild@0.19.12, npm/eslint-config-next@14.1.0, npm/eslint-config-prettier@9.1.0, npm/eslint-config-sanity@7.0.1, npm/eslint-import-resolver-typescript@3.6.1, npm/eslint-plugin-boundaries@4.2.0, npm/eslint-plugin-import@2.29.1, npm/eslint-plugin-prettier@5.1.3, npm/eslint-plugin-react-hooks@4.6.0, npm/eslint-plugin-react@7.33.2, npm/eslint-plugin-simple-import-sort@11.0.0, npm/eslint-plugin-tsdoc@0.2.17, npm/eslint-plugin-unused-imports@3.0.0, npm/eslint@8.57.0, npm/execa@2.1.0, npm/exif-component@1.0.1, npm/express-ws@5.0.2, npm/express@4.18.2

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.

None yet

3 participants