From ed601ad7789027f98fe359ea27a504d4eee226e7 Mon Sep 17 00:00:00 2001
From: Simeon Griggs
- Or, run{' '} +
Or, run
+
npx sanity@latest exec ./scripts/createData.ts --with-user-token
-
{' '}
+
+
+ from the command line to delete existing documents populate the site with content.{' '}
diff --git a/package.json b/package.json index 7526ccc..bb381df 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "sanity-remix-template", + "private": true, "sideEffects": false, "type": "module", "scripts": { @@ -11,9 +12,9 @@ "dependencies": { "@faker-js/faker": "^8.4.1", "@portabletext/react": "^3.0.15", - "@remix-run/node": "^2.8.1", - "@remix-run/react": "^2.8.1", - "@remix-run/serve": "^2.8.1", + "@remix-run/node": "*", + "@remix-run/react": "*", + "@remix-run/serve": "*", "@resvg/resvg-js": "^2.6.2", "@sanity/asset-utils": "^1.3.0", "@sanity/block-tools": "^3.36.0", @@ -42,8 +43,8 @@ "zod": "^3.22.4" }, "devDependencies": { - "@remix-run/dev": "^2.8.1", - "@remix-run/eslint-config": "^2.8.1", + "@remix-run/dev": "*", + "@remix-run/eslint-config": "*", "@tailwindcss/typography": "^0.5.11", "@types/jsdom": "^21.1.6", "@types/react": "^18.2.72", @@ -62,6 +63,6 @@ "vite-tsconfig-paths": "^4.3.2" }, "engines": { - "node": "20.x" + "node": ">=18.0.0" } } diff --git a/sanity.cli.ts b/sanity.cli.ts index 3cefd03..268934e 100644 --- a/sanity.cli.ts +++ b/sanity.cli.ts @@ -1,10 +1,9 @@ import {defineCliConfig} from 'sanity/cli' -import {dataset, projectId} from '~/sanity/projectDetails' - +// We can assume this file will only be read in a Node.js environment export default defineCliConfig({ api: { - projectId, - dataset, + projectId: process.env.VITE_SANITY_PROJECT_ID, + dataset: process.env.VITE_SANITY_DATASET, }, }) diff --git a/tsconfig.json b/tsconfig.json index a80d00b..9d87dd3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,24 +1,32 @@ { - "include": ["env.d.ts", "**/*.ts", "**/*.tsx", "scripts/createData.cjs"], + "include": [ + "**/*.ts", + "**/*.tsx", + "**/.server/**/*.ts", + "**/.server/**/*.tsx", + "**/.client/**/*.ts", + "**/.client/**/*.tsx" + ], "compilerOptions": { - "skipLibCheck": true, - "lib": ["DOM", "DOM.Iterable", "ES2019"], + "lib": ["DOM", "DOM.Iterable", "ES2022"], + "types": ["@remix-run/node", "vite/client"], "isolatedModules": true, "esModuleInterop": true, "jsx": "react-jsx", "module": "ESNext", "moduleResolution": "Bundler", "resolveJsonModule": true, - "target": "ES2020", + "target": "ES2022", "strict": true, "allowJs": true, + "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "baseUrl": ".", "paths": { "~/*": ["./app/*"] }, - // Remix takes care of building everything in `remix build`. + // Vite takes care of building everything, not tsc. "noEmit": true } }