mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-08 21:07:46 +00:00
Adds a Hydrogen v2 template which is the output of the `npm create @shopify/hydrogen@latest` command. Note that a `vercel.json` file is being used to define the environment variables that are required at runtime. This is required for the template to deploy with zero configuration, however the user should update these values (including replacing the session secret) and migrate them to the Project settings in the Vercel dashboard. [Live example](https://hydrogen-v2-template.vercel.app)
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
/// <reference types="@remix-run/dev" />
|
|
/// <reference types="@shopify/remix-oxygen" />
|
|
/// <reference types="@shopify/oxygen-workers-types" />
|
|
|
|
// Enhance TypeScript's built-in typings.
|
|
import '@total-typescript/ts-reset';
|
|
|
|
import type {Storefront, HydrogenCart} from '@shopify/hydrogen';
|
|
import type {HydrogenSession} from './server';
|
|
|
|
declare global {
|
|
/**
|
|
* A global `process` object is only available during build to access NODE_ENV.
|
|
*/
|
|
const process: {env: {NODE_ENV: 'production' | 'development'}};
|
|
|
|
/**
|
|
* Declare expected Env parameter in fetch handler.
|
|
*/
|
|
interface Env {
|
|
SESSION_SECRET: string;
|
|
PUBLIC_STOREFRONT_API_TOKEN: string;
|
|
PRIVATE_STOREFRONT_API_TOKEN: string;
|
|
PUBLIC_STORE_DOMAIN: string;
|
|
PUBLIC_STOREFRONT_ID: string;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Declare local additions to `AppLoadContext` to include the session utilities we injected in `server.ts`.
|
|
*/
|
|
declare module '@shopify/remix-oxygen' {
|
|
export interface AppLoadContext {
|
|
env: Env;
|
|
cart: HydrogenCart;
|
|
storefront: Storefront;
|
|
session: HydrogenSession;
|
|
}
|
|
}
|