Starter Setup! Remove each item from the list as you complete it.
- Clone using the template in GitHub
- Copy the starters
.env
file to your own.env
file (you'll update this during sanity setup or ejection) - Update all existing packages with
pnpm dlx npm-check-updates --deep -u
(feel free to update the starter repository as well) - Update the README.md to add project-specific image and name below
- Delete the
app/visual-tests
folder
- Configure branch rules on github (you should export and import the starter's rule set)
- In repository settings, enable "Always suggest updating pull request branches", "Allow auto-merge", and "Automatically delete head branches"
- Set up a Netlify build and link to sanity if available/part of project
- Add .env variables (if any) to Netlify, Notion, and Github (beware fancy quotes) (see sanity setup)
- Delete summary commit checks from netlify notifications. do not delete the state commit checks.
- Add any typography to
app/styles/fonts/typography.ts
, and configure a default text color/style inapp/layout.tsx
- Add any text styles to
app/styles/text.ts
- Configure the library config according to this project's needs. for example, you should remove the default transitions.
- Update the
app/manifest.webmanifest
to include colors and metadata - If they exist, export the fullmark, logomark, and wordmark from figma and add them to
app/images
If this project is using a CMS, set up a new project in Sanity. If we're not sure, just leave it using the starter's project until we know (it's easy to remove if unneeded, but a pain to add back in)
- in
package.json
, delete thetypegen
andpostinstall
scripts - delete
app/(sanity)
,app/blog
,app/[slug]
, andsanity
folders - delete
.vscode/tasks.json
,sanity.config.ts
,sanity.types.ts
, andsanity.cli.ts
, and any other sanity-related files in the root of the project - remove
SanityLive
,SanityFetch
, anddefineQuery
, as well as any dependent code, fromapp/layout.tsx
,app/components/Header.tsx
,app/components/Footer.tsx
, andapp/sitemap.ts
- add
app/library/sanity
andapp/library/UniversalImage.tsx
to theexclude
array intsconfig.json
(you'll be using StaticImage instead) - remove any sanity-related packages from
package.json
- update isSanity to false in
.github/workflows/call-code-checks.yml
- run
npx tsc
and clean up any type errors or missed sanity files - if no env variables remain, you can also remove the
checkEnv
script frompackage.json
- Enable studio access for
https://localhost:3000/studio
under theStudios
tab - Ensure CORS access is enabled under the
API
tab (Sanity should do this for you when you add the studio) - You'll need the following variables in your
.env
file:NEXT_PUBLIC_SANITY_PROJECT_ID
is your project ID, for examplem85xxx23
NEXT_PUBLIC_SANITY_DATASET
is your dataset name, for a new project this isproduction
(if we're working on updates while the site is live we'll usedevelopment
)SANITY_AUTH_TOKEN
is a read only access token. Generate one in Sanity under theAPI
tab
Built with Next. Install and run with pnpm dev
-
Install nvm and Node.js The preferred way to install node is with nvm. After installing nvm, run
nvm install
in this project to download and use the correct version of node for this project. You should do this occasionally to ensure you're using the correct version of node. -
Install PNPM The preferred way to install pnpm is with corepack. After you've installed node, install pnpm with
corepack enable
. You should now be able to runpnpm dev
. Note that if you installed node from homebrew, you may need to install corepack separately:npm i -g corepack@latest