Skip to content

N3rdArtiste/sveltekit-website-test

Repository files navigation

Developing

Once you've cloned the project and installed dependencies with npm install, run the following command to make the .env file effective:

cp .env.bac .env

then start a development server:

npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open

Generating

create schema file in ./src/schemas/foo.gql each block needs to have an id field for caching handling with @urql

run:

npm run generate

Building

Before creating a production version of your app, install an adapter for your target environment. Then:

npm run build

You can preview the built app with npm run preview, regardless of whether you installed an adapter. This should not be used to serve your app in production.

Code formatting

install: VS Marketplace Link

Name: Prettier - Code formatter
Id: esbenp.prettier-vscode
Description: Code formatter using prettier
Publisher: Prettier
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode

Typescript required knowledge

/**
 * Construct a type with a set of properties K of type T
 */
type Record<K extends keyof any, T> = {
    [P in K]: T
}

/**
 * Make all properties in T optional
 */
type Partial<T> = {
    [P in keyof T]?: T[P]
}

/**
 * Construct a type with the properties of T except for those in type K.
 */
type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>

/**
 * Make all properties in T required
 */
type Required<T> = {
    [P in keyof T]-?: T[P]
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •