-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(web): add initial configuration
- Loading branch information
Showing
14 changed files
with
931 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,37 @@ | ||
/* eslint-disable node/prefer-global/process */ | ||
|
||
import 'dotenv/config'; | ||
|
||
function assertValue<T>(value: T | undefined, errorMessage: string): T { | ||
if (!value) throw new Error(errorMessage); | ||
return value; | ||
} | ||
|
||
/** | ||
* The Sanity Studio dataset to use. | ||
* This is loaded from the `SANITY_API_DATASET` environment variable. | ||
* If the environment variable is missing, an error will be thrown. | ||
*/ | ||
export const dataset = assertValue( | ||
process.env.SANITY_STUDIO_DATASET, | ||
'Missing environment variable: SANITY_STUDIO_DATASET', | ||
process.env.SANITY_API_DATASET, | ||
'Missing environment variable: SANITY_API_DATASET', | ||
); | ||
|
||
/** | ||
* The Sanity Studio project ID to use. | ||
* This is loaded from the `SANITY_API_PROJECT_ID` environment variable. | ||
* If the environment variable is missing, an error will be thrown. | ||
*/ | ||
export const projectId = assertValue( | ||
process.env.SANITY_STUDIO_PROJECT_ID, | ||
'Missing environment variable: SANITY_STUDIO_PROJECT_ID', | ||
process.env.SANITY_API_PROJECT_ID, | ||
'Missing environment variable: SANITY_API_PROJECT_ID', | ||
); | ||
|
||
/** | ||
* see https://www.sanity.io/docs/api-versioning for how versioning works | ||
* The Sanity Studio API version to use. | ||
* This is loaded from the `SANITY_API_VERSION` environment variable, or defaults to '2022-03-07' | ||
* if the environment variable is missing. | ||
* | ||
* @see https://www.sanity.io/docs/api-versioning for how versioning works | ||
*/ | ||
export const apiVersion = process.env.SANITY_API_VERSION ?? '2022-03-07'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,23 @@ | ||
import react from '@astrojs/react'; | ||
import tailwind from '@astrojs/tailwind'; | ||
import vercel from '@astrojs/vercel/serverless'; | ||
import sanity from '@sanity/astro'; | ||
import { defineConfig } from 'astro/config'; | ||
|
||
import { apiVersion, dataset, projectId } from './src/env'; | ||
|
||
// https://astro.build/config | ||
export default defineConfig({}); | ||
export default defineConfig({ | ||
adapter: vercel(), | ||
integrations: [ | ||
tailwind(), | ||
react(), | ||
sanity({ | ||
apiVersion, | ||
dataset, | ||
projectId, | ||
useCdn: true, | ||
}), | ||
], | ||
output: 'server', | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* eslint-disable node/prefer-global/process */ | ||
|
||
import 'dotenv/config'; | ||
|
||
function assertValue<T>(value: T | undefined, errorMessage: string): T { | ||
if (!value) throw new Error(errorMessage); | ||
return value; | ||
} | ||
|
||
/** | ||
* The Sanity Studio dataset to use. | ||
* This is loaded from the `SANITY_API_DATASET` environment variable. | ||
* If the environment variable is missing, an error will be thrown. | ||
*/ | ||
export const dataset = assertValue( | ||
process.env.SANITY_API_DATASET, | ||
'Missing environment variable: SANITY_API_DATASET', | ||
); | ||
|
||
/** | ||
* The Sanity Studio project ID to use. | ||
* This is loaded from the `SANITY_API_PROJECT_ID` environment variable. | ||
* If the environment variable is missing, an error will be thrown. | ||
*/ | ||
export const projectId = assertValue( | ||
process.env.SANITY_API_PROJECT_ID, | ||
'Missing environment variable: SANITY_API_PROJECT_ID', | ||
); | ||
|
||
/** | ||
* The Sanity Studio API version to use. | ||
* This is loaded from the `SANITY_API_VERSION` environment variable, or defaults to '2022-03-07' | ||
* if the environment variable is missing. | ||
* | ||
* @see https://www.sanity.io/docs/api-versioning for how versioning works | ||
*/ | ||
export const apiVersion = process.env.SANITY_API_VERSION ?? '2022-03-07'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** @type {import('tailwindcss').Config} */ | ||
export default { | ||
content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'], | ||
plugins: [], | ||
theme: { | ||
extend: {}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
{ | ||
"extends": "@mheob/tsconfig/astro" | ||
"extends": "@mheob/tsconfig/astro", | ||
"compilerOptions": { | ||
"jsx": "react-jsx", | ||
"jsxImportSource": "react" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "@tsg-irlich-web/shared", | ||
"version": "1.0.0", | ||
"description": "", | ||
"keywords": [], | ||
"license": "ISC", | ||
"author": "", | ||
"exports": { | ||
"./*": "./src/*.ts" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"dependencies": { | ||
"dotenv": "^16.4.5" | ||
}, | ||
"devDependencies": { | ||
"@mheob/tsconfig": "^2.2.1", | ||
"@types/node": "^20.14.8", | ||
"typescript": "^5.5.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* eslint-disable node/prefer-global/process */ | ||
|
||
import 'dotenv/config'; | ||
|
||
function assertValue<T>(value: T | undefined, errorMessage: string): T { | ||
if (!value) throw new Error(errorMessage); | ||
return value; | ||
} | ||
|
||
/** | ||
* The Sanity Studio dataset to use. | ||
* This is loaded from the `SANITY_API_DATASET` environment variable. | ||
* If the environment variable is missing, an error will be thrown. | ||
*/ | ||
export const dataset = assertValue( | ||
process.env.SANITY_API_DATASET, | ||
'Missing environment variable: SANITY_API_DATASET', | ||
); | ||
|
||
/** | ||
* The Sanity Studio project ID to use. | ||
* This is loaded from the `SANITY_API_PROJECT_ID` environment variable. | ||
* If the environment variable is missing, an error will be thrown. | ||
*/ | ||
export const projectId = assertValue( | ||
process.env.SANITY_API_PROJECT_ID, | ||
'Missing environment variable: SANITY_API_PROJECT_ID', | ||
); | ||
|
||
/** | ||
* The Sanity Studio API version to use. | ||
* This is loaded from the `SANITY_API_VERSION` environment variable, or defaults to '2022-03-07' | ||
* if the environment variable is missing. | ||
* | ||
* @see https://www.sanity.io/docs/api-versioning for how versioning works | ||
*/ | ||
export const apiVersion = process.env.SANITY_API_VERSION ?? '2022-03-07'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "@mheob/tsconfig/base" | ||
} |
Oops, something went wrong.