Skip to content

Commit

Permalink
feat: indicate in metadata that the quickstart option was used in pro…
Browse files Browse the repository at this point in the history
…ject creation (#6065)

* feat: indicate in metadata that the quickstart option was used in project creation

* add quickstart template directory

* feat: use quickstart template

* Update packages/@sanity/cli/templates/quickstart/README.md

Co-authored-by: Jon Eide Johnsen <[email protected]>

* Update packages/@sanity/cli/templates/quickstart/README.md

Co-authored-by: Jon Eide Johnsen <[email protected]>

* update selectProjectTemplate comment

---------

Co-authored-by: RostiMelk <[email protected]>
Co-authored-by: Jon Eide Johnsen <[email protected]>
  • Loading branch information
3 people authored Mar 26, 2024
1 parent 97c0b0c commit 468e76c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 2 deletions.
3 changes: 1 addition & 2 deletions packages/@sanity/cli/src/actions/init-project/initProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -964,9 +964,8 @@ export default async function initSanity(

function selectProjectTemplate() {
// Make sure the --quickstart and --template are not used together
// Force template to clean if --quickstart is used
if (flags.quickstart) {
return 'clean'
return 'quickstart'
}

const defaultTemplate = unattended || flags.template ? flags.template || 'clean' : null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import blog from './blog'
import clean from './clean'
import getStartedTemplate from './getStarted'
import moviedb from './moviedb'
import quickstart from './quickstart'
import shopify from './shopify'
import shopifyOnline from './shopifyOnline'

Expand All @@ -13,6 +14,7 @@ const templates: Record<string, ProjectTemplate | undefined> = {
moviedb,
shopify,
'shopify-online-storefront': shopifyOnline,
quickstart, // empty project that dynamically imports its own schema
}

export default templates
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {type ProjectTemplate} from '../initProject'

const quickStartTemplate: ProjectTemplate = {}

export default quickStartTemplate
9 changes: 9 additions & 0 deletions packages/@sanity/cli/templates/quickstart/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Sanity Studio

Congratulations, you have now installed Sanity Studio, an open source real-time content editing environment connected to the Sanity Content Lake backend.

Now you can do the following things:

- [Read “getting started” in the docs](https://www.sanity.io/docs/introduction/getting-started?utm_source=readme)
- [Join the community Slack](https://slack.sanity.io/?utm_source=readme)
- [Extend and build plugins](https://www.sanity.io/docs/content-studio/extending?utm_source=readme)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const schemaTypes = []
1 change: 1 addition & 0 deletions packages/@sanity/cli/templates/quickstart/static/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Files placed here will be served by the Sanity server under the `/static`-prefix

0 comments on commit 468e76c

Please sign in to comment.