diff --git a/.svelte-kit/ambient.d.ts b/.svelte-kit/ambient.d.ts index 0bc0080..3d24964 100644 --- a/.svelte-kit/ambient.d.ts +++ b/.svelte-kit/ambient.d.ts @@ -5,393 +5,308 @@ /// /** - * Environment variables [loaded by Vite](https://vitejs.dev/guide/env-and-mode.html#env-files) from `.env` files and `process.env`. Like [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private), this module cannot be imported into client-side code. This module only includes variables that _do not_ begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) _and do_ start with [`config.kit.env.privatePrefix`](https://svelte.dev/docs/kit/configuration#env) (if configured). + * This module provides access to environment variables that are injected _statically_ into your bundle at build time and are limited to _private_ access. * - * _Unlike_ [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private), the values exported from this module are statically injected into your bundle at build time, enabling optimisations like dead code elimination. + * | | Runtime | Build time | + * | ------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ | + * | Private | [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private) | [`$env/static/private`](https://svelte.dev/docs/kit/$env-static-private) | + * | Public | [`$env/dynamic/public`](https://svelte.dev/docs/kit/$env-dynamic-public) | [`$env/static/public`](https://svelte.dev/docs/kit/$env-static-public) | * - * ```ts - * import { API_KEY } from '$env/static/private'; - * ``` + * Static environment variables are [loaded by Vite](https://vitejs.dev/guide/env-and-mode.html#env-files) from `.env` files and `process.env` at build time and then statically injected into your bundle at build time, enabling optimisations like dead code elimination. * - * Note that all environment variables referenced in your code should be declared (for example in an `.env` file), even if they don't have a value until the app is deployed: + * **_Private_ access:** * - * ``` - * MY_FEATURE_FLAG="" + * - This module cannot be imported into client-side code + * - This module only includes variables that _do not_ begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) _and do_ start with [`config.kit.env.privatePrefix`](https://svelte.dev/docs/kit/configuration#env) (if configured) + * + * For example, given the following build time environment: + * + * ```env + * ENVIRONMENT=production + * PUBLIC_BASE_URL=http://site.com * ``` * - * You can override `.env` values from the command line like so: + * With the default `publicPrefix` and `privatePrefix`: * - * ```bash - * MY_FEATURE_FLAG="enabled" npm run dev + * ```ts + * import { ENVIRONMENT, PUBLIC_BASE_URL } from '$env/static/private'; + * + * console.log(ENVIRONMENT); // => "production" + * console.log(PUBLIC_BASE_URL); // => throws error during build * ``` + * + * The above values will be the same _even if_ different values for `ENVIRONMENT` or `PUBLIC_BASE_URL` are set at runtime, as they are statically replaced in your code with their build time values. */ declare module '$env/static/private' { - export const REPLIT_PID1_FLAG_REPLIT_RTLD_LOADER: string; - export const npm_command: string; + export const LESSOPEN: string; + export const HISTTIMEFORMAT: string; + export const USER: string; + export const SSH_CLIENT: string; + export const npm_config_user_agent: string; + export const MANWIDTH: string; + export const QUOTING_STYLE: string; + export const XDG_SESSION_TYPE: string; + export const npm_node_execpath: string; + export const SHLVL: string; + export const npm_config_noproxy: string; + export const LESS: string; + export const MOTD_SHOWN: string; + export const HOME: string; + export const OLDPWD: string; + export const SSH_TTY: string; + export const npm_package_json: string; + export const PAGER: string; + export const PS1: string; export const npm_config_userconfig: string; - export const COLORTERM: string; + export const npm_config_local_prefix: string; + export const VISUAL: string; + export const DBUS_SESSION_BUS_ADDRESS: string; + export const COLOR: string; + export const LOGNAME: string; + export const AWS_DEFAULT_REGION: string; + export const _: string; + export const npm_config_prefix: string; + export const npm_config_npm_version: string; + export const XDG_SESSION_CLASS: string; + export const TERM: string; + export const XDG_SESSION_ID: string; export const npm_config_cache: string; - export const npm_package_dev_optional: string; - export const NIX_BUILD_CORES: string; export const HISTCONTROL: string; - export const REPL_OWNER: string; - export const TERM_PROGRAM_VERSION: string; - export const configureFlags: string; - export const REPLIT_SSL: string; - export const NIXPKGS_ALLOW_UNFREE: string; - export const mesonFlags: string; - export const npm_package_integrity: string; - export const HOSTNAME: string; - export const __EGL_VENDOR_LIBRARY_FILENAMES: string; - export const shell: string; - export const depsHostHost: string; + export const LC_COLLATE: string; + export const npm_config_node_gyp: string; + export const PATH: string; + export const LESSHISTFILE: string; + export const GOBIN: string; + export const AWS_PAGER: string; export const NODE: string; - export const REPLIT_DOMAINS: string; - export const LD_AUDIT: string; - export const NODE_EXTRA_CA_CERTS: string; - export const XDG_DATA_HOME: string; - export const REPL_OWNER_ID: string; - export const STRINGS: string; - export const XDG_CONFIG_HOME: string; - export const depsTargetTarget: string; - export const REPLIT_LD_AUDIT: string; - export const stdenv: string; - export const COLOR: string; - export const npm_config_local_prefix: string; - export const builder: string; - export const DENO_TLS_CA_STORE: string; - export const REPLIT_CLI: string; - export const shellHook: string; - export const npm_config_globalconfig: string; - export const EDITOR: string; - export const phases: string; - export const REPLIT_SUBCLUSTER: string; - export const PWD: string; - export const NIX_PROFILES: string; - export const SOURCE_DATE_EPOCH: string; - export const NIX_ENFORCE_NO_NATIVE: string; - export const REPLIT_DB_URL: string; - export const NIX_PATH: string; - export const npm_config_init_module: string; - export const npm_package_dev: string; - export const CXX: string; - export const REPL_ID: string; - export const system: string; - export const VSCODE_GIT_ASKPASS_NODE: string; - export const HOST_PATH: string; - export const doInstallCheck: string; - export const HOME: string; - export const NIX_BINTOOLS: string; - export const npm_package_peer: string; + export const npm_package_name: string; + export const AWS_DEFAULT_OUTPUT: string; + export const XDG_RUNTIME_DIR: string; + export const HISTSIZE: string; + export const NODEJS_HOME: string; export const LANG: string; - export const REPL_IDENTITY: string; export const LS_COLORS: string; - export const depsTargetTargetPropagated: string; - export const REPLIT_RIPPKGS_INDICES: string; - export const npm_package_version: string; - export const cmakeFlags: string; - export const SSL_CERT_DIR: string; - export const npm_package_resolved: string; - export const outputs: string; - export const NIX_STORE: string; - export const GIT_ASKPASS: string; - export const REPL_IMAGE: string; - export const LD: string; - export const buildPhase: string; - export const SSH_CONNECTION: string; - export const DIRENV_CONFIG: string; - export const INIT_CWD: string; - export const READELF: string; - export const REPLIT_PID1_FLAG_NIXMODULES_BEFORE_REPLIT_NIX: string; - export const XDG_CACHE_HOME: string; export const npm_lifecycle_script: string; - export const doCheck: string; - export const VSCODE_GIT_ASKPASS_EXTRA_ARGS: string; - export const npm_config_force: string; - export const REPLIT_RTLD_LOADER: string; - export const npm_package_optional: string; - export const npm_config_npm_version: string; - export const depsBuildBuild: string; - export const REPLIT_DEV_DOMAIN: string; - export const TERM: string; - export const npm_package_name: string; - export const REPLIT_CLUSTER: string; - export const REPLIT_BASHRC: string; - export const SIZE: string; - export const propagatedNativeBuildInputs: string; - export const npm_config_prefix: string; - export const REPL_LANGUAGE: string; - export const USER: string; - export const strictDeps: string; - export const VSCODE_GIT_IPC_HANDLE: string; - export const REPL_HOME: string; - export const REPLIT_PID1_VERSION: string; - export const AR: string; - export const AS: string; - export const DISPLAY: string; - export const NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu: string; + export const SSH_AUTH_SOCK: string; + export const SHELL: string; + export const GOPATH: string; + export const npm_package_version: string; export const npm_lifecycle_event: string; - export const SHLVL: string; - export const NIX_BUILD_TOP: string; - export const NM: string; - export const GIT_EDITOR: string; - export const REPLIT_NIX_CHANNEL: string; - export const NIX_CFLAGS_COMPILE: string; - export const patches: string; - export const PROMPT_DIRTRIM: string; - export const LIBGL_DRIVERS_PATH: string; - export const buildInputs: string; - export const LOCALE_ARCHIVE: string; - export const npm_config_user_agent: string; + export const npm_config_update_notifier: string; + export const LESSCLOSE: string; + export const CHECKPOINT_DISABLE: string; + export const npm_config_globalconfig: string; + export const npm_config_init_module: string; + export const PWD: string; export const npm_execpath: string; - export const SSL_CERT_FILE: string; - export const REPLIT_ENVIRONMENT: string; - export const NODE_PATH: string; - export const SSH_CLIENT: string; - export const depsBuildTarget: string; - export const OBJCOPY: string; - export const REQUESTS_CA_BUNDLE: string; - export const out: string; - export const npm_package_json: string; - export const REPLIT_LD_LIBRARY_PATH: string; - export const STRIP: string; - export const VSCODE_GIT_ASKPASS_MAIN: string; - export const XDG_DATA_DIRS: string; - export const REPL_IDENTITY_KEY: string; - export const OBJDUMP: string; - export const BROWSER: string; - export const npm_config_noproxy: string; - export const PATH: string; - export const propagatedBuildInputs: string; - export const npm_config_node_gyp: string; - export const DOCKER_CONFIG: string; - export const CC: string; - export const NIX_CC: string; - export const __ETC_PROFILE_SOURCED: string; - export const depsBuildTargetPropagated: string; - export const depsBuildBuildPropagated: string; + export const SSH_CONNECTION: string; export const npm_config_global_prefix: string; - export const NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu: string; - export const NIX_INDENT_MAKE: string; - export const REPL_PUBKEYS: string; - export const CONFIG_SHELL: string; - export const npm_node_execpath: string; - export const RANLIB: string; - export const NIX_HARDENING_ENABLE: string; - export const REPL_SLUG: string; - export const OLDPWD: string; - export const NIX_LDFLAGS: string; - export const nativeBuildInputs: string; - export const npm_package_engines_node: string; - export const TERM_PROGRAM: string; - export const depsHostHostPropagated: string; - export const VSCODE_IPC_HOOK_CLI: string; + export const npm_command: string; + export const EDITOR: string; + export const INIT_CWD: string; } /** - * Similar to [`$env/static/private`](https://svelte.dev/docs/kit/$env-static-private), except that it only includes environment variables that begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) (which defaults to `PUBLIC_`), and can therefore safely be exposed to client-side code. + * This module provides access to environment variables that are injected _statically_ into your bundle at build time and are _publicly_ accessible. + * + * | | Runtime | Build time | + * | ------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ | + * | Private | [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private) | [`$env/static/private`](https://svelte.dev/docs/kit/$env-static-private) | + * | Public | [`$env/dynamic/public`](https://svelte.dev/docs/kit/$env-dynamic-public) | [`$env/static/public`](https://svelte.dev/docs/kit/$env-static-public) | + * + * Static environment variables are [loaded by Vite](https://vitejs.dev/guide/env-and-mode.html#env-files) from `.env` files and `process.env` at build time and then statically injected into your bundle at build time, enabling optimisations like dead code elimination. + * + * **_Public_ access:** + * + * - This module _can_ be imported into client-side code + * - **Only** variables that begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) (which defaults to `PUBLIC_`) are included * - * Values are replaced statically at build time. + * For example, given the following build time environment: + * + * ```env + * ENVIRONMENT=production + * PUBLIC_BASE_URL=http://site.com + * ``` + * + * With the default `publicPrefix` and `privatePrefix`: * * ```ts - * import { PUBLIC_BASE_URL } from '$env/static/public'; + * import { ENVIRONMENT, PUBLIC_BASE_URL } from '$env/static/public'; + * + * console.log(ENVIRONMENT); // => throws error during build + * console.log(PUBLIC_BASE_URL); // => "http://site.com" * ``` + * + * The above values will be the same _even if_ different values for `ENVIRONMENT` or `PUBLIC_BASE_URL` are set at runtime, as they are statically replaced in your code with their build time values. */ declare module '$env/static/public' { } /** - * This module provides access to runtime environment variables, as defined by the platform you're running on. For example if you're using [`adapter-node`](https://github.com/sveltejs/kit/tree/main/packages/adapter-node) (or running [`vite preview`](https://svelte.dev/docs/kit/cli)), this is equivalent to `process.env`. This module only includes variables that _do not_ begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) _and do_ start with [`config.kit.env.privatePrefix`](https://svelte.dev/docs/kit/configuration#env) (if configured). + * This module provides access to environment variables set _dynamically_ at runtime and that are limited to _private_ access. + * + * | | Runtime | Build time | + * | ------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ | + * | Private | [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private) | [`$env/static/private`](https://svelte.dev/docs/kit/$env-static-private) | + * | Public | [`$env/dynamic/public`](https://svelte.dev/docs/kit/$env-dynamic-public) | [`$env/static/public`](https://svelte.dev/docs/kit/$env-static-public) | + * + * Dynamic environment variables are defined by the platform you're running on. For example if you're using [`adapter-node`](https://github.com/sveltejs/kit/tree/main/packages/adapter-node) (or running [`vite preview`](https://svelte.dev/docs/kit/cli)), this is equivalent to `process.env`. + * + * **_Private_ access:** * - * This module cannot be imported into client-side code. + * - This module cannot be imported into client-side code + * - This module includes variables that _do not_ begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) _and do_ start with [`config.kit.env.privatePrefix`](https://svelte.dev/docs/kit/configuration#env) (if configured) * - * Dynamic environment variables cannot be used during prerendering. + * > [!NOTE] In `dev`, `$env/dynamic` includes environment variables from `.env`. In `prod`, this behavior will depend on your adapter. + * + * > [!NOTE] To get correct types, environment variables referenced in your code should be declared (for example in an `.env` file), even if they don't have a value until the app is deployed: + * > + * > ```env + * > MY_FEATURE_FLAG= + * > ``` + * > + * > You can override `.env` values from the command line like so: + * > + * > ```sh + * > MY_FEATURE_FLAG="enabled" npm run dev + * > ``` + * + * For example, given the following runtime environment: + * + * ```env + * ENVIRONMENT=production + * PUBLIC_BASE_URL=http://site.com + * ``` + * + * With the default `publicPrefix` and `privatePrefix`: * * ```ts * import { env } from '$env/dynamic/private'; - * console.log(env.DEPLOYMENT_SPECIFIC_VARIABLE); - * ``` * - * > In `dev`, `$env/dynamic` always includes environment variables from `.env`. In `prod`, this behavior will depend on your adapter. + * console.log(env.ENVIRONMENT); // => "production" + * console.log(env.PUBLIC_BASE_URL); // => undefined + * ``` */ declare module '$env/dynamic/private' { export const env: { - REPLIT_PID1_FLAG_REPLIT_RTLD_LOADER: string; - npm_command: string; + LESSOPEN: string; + HISTTIMEFORMAT: string; + USER: string; + SSH_CLIENT: string; + npm_config_user_agent: string; + MANWIDTH: string; + QUOTING_STYLE: string; + XDG_SESSION_TYPE: string; + npm_node_execpath: string; + SHLVL: string; + npm_config_noproxy: string; + LESS: string; + MOTD_SHOWN: string; + HOME: string; + OLDPWD: string; + SSH_TTY: string; + npm_package_json: string; + PAGER: string; + PS1: string; npm_config_userconfig: string; - COLORTERM: string; + npm_config_local_prefix: string; + VISUAL: string; + DBUS_SESSION_BUS_ADDRESS: string; + COLOR: string; + LOGNAME: string; + AWS_DEFAULT_REGION: string; + _: string; + npm_config_prefix: string; + npm_config_npm_version: string; + XDG_SESSION_CLASS: string; + TERM: string; + XDG_SESSION_ID: string; npm_config_cache: string; - npm_package_dev_optional: string; - NIX_BUILD_CORES: string; HISTCONTROL: string; - REPL_OWNER: string; - TERM_PROGRAM_VERSION: string; - configureFlags: string; - REPLIT_SSL: string; - NIXPKGS_ALLOW_UNFREE: string; - mesonFlags: string; - npm_package_integrity: string; - HOSTNAME: string; - __EGL_VENDOR_LIBRARY_FILENAMES: string; - shell: string; - depsHostHost: string; + LC_COLLATE: string; + npm_config_node_gyp: string; + PATH: string; + LESSHISTFILE: string; + GOBIN: string; + AWS_PAGER: string; NODE: string; - REPLIT_DOMAINS: string; - LD_AUDIT: string; - NODE_EXTRA_CA_CERTS: string; - XDG_DATA_HOME: string; - REPL_OWNER_ID: string; - STRINGS: string; - XDG_CONFIG_HOME: string; - depsTargetTarget: string; - REPLIT_LD_AUDIT: string; - stdenv: string; - COLOR: string; - npm_config_local_prefix: string; - builder: string; - DENO_TLS_CA_STORE: string; - REPLIT_CLI: string; - shellHook: string; - npm_config_globalconfig: string; - EDITOR: string; - phases: string; - REPLIT_SUBCLUSTER: string; - PWD: string; - NIX_PROFILES: string; - SOURCE_DATE_EPOCH: string; - NIX_ENFORCE_NO_NATIVE: string; - REPLIT_DB_URL: string; - NIX_PATH: string; - npm_config_init_module: string; - npm_package_dev: string; - CXX: string; - REPL_ID: string; - system: string; - VSCODE_GIT_ASKPASS_NODE: string; - HOST_PATH: string; - doInstallCheck: string; - HOME: string; - NIX_BINTOOLS: string; - npm_package_peer: string; + npm_package_name: string; + AWS_DEFAULT_OUTPUT: string; + XDG_RUNTIME_DIR: string; + HISTSIZE: string; + NODEJS_HOME: string; LANG: string; - REPL_IDENTITY: string; LS_COLORS: string; - depsTargetTargetPropagated: string; - REPLIT_RIPPKGS_INDICES: string; - npm_package_version: string; - cmakeFlags: string; - SSL_CERT_DIR: string; - npm_package_resolved: string; - outputs: string; - NIX_STORE: string; - GIT_ASKPASS: string; - REPL_IMAGE: string; - LD: string; - buildPhase: string; - SSH_CONNECTION: string; - DIRENV_CONFIG: string; - INIT_CWD: string; - READELF: string; - REPLIT_PID1_FLAG_NIXMODULES_BEFORE_REPLIT_NIX: string; - XDG_CACHE_HOME: string; npm_lifecycle_script: string; - doCheck: string; - VSCODE_GIT_ASKPASS_EXTRA_ARGS: string; - npm_config_force: string; - REPLIT_RTLD_LOADER: string; - npm_package_optional: string; - npm_config_npm_version: string; - depsBuildBuild: string; - REPLIT_DEV_DOMAIN: string; - TERM: string; - npm_package_name: string; - REPLIT_CLUSTER: string; - REPLIT_BASHRC: string; - SIZE: string; - propagatedNativeBuildInputs: string; - npm_config_prefix: string; - REPL_LANGUAGE: string; - USER: string; - strictDeps: string; - VSCODE_GIT_IPC_HANDLE: string; - REPL_HOME: string; - REPLIT_PID1_VERSION: string; - AR: string; - AS: string; - DISPLAY: string; - NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu: string; + SSH_AUTH_SOCK: string; + SHELL: string; + GOPATH: string; + npm_package_version: string; npm_lifecycle_event: string; - SHLVL: string; - NIX_BUILD_TOP: string; - NM: string; - GIT_EDITOR: string; - REPLIT_NIX_CHANNEL: string; - NIX_CFLAGS_COMPILE: string; - patches: string; - PROMPT_DIRTRIM: string; - LIBGL_DRIVERS_PATH: string; - buildInputs: string; - LOCALE_ARCHIVE: string; - npm_config_user_agent: string; + npm_config_update_notifier: string; + LESSCLOSE: string; + CHECKPOINT_DISABLE: string; + npm_config_globalconfig: string; + npm_config_init_module: string; + PWD: string; npm_execpath: string; - SSL_CERT_FILE: string; - REPLIT_ENVIRONMENT: string; - NODE_PATH: string; - SSH_CLIENT: string; - depsBuildTarget: string; - OBJCOPY: string; - REQUESTS_CA_BUNDLE: string; - out: string; - npm_package_json: string; - REPLIT_LD_LIBRARY_PATH: string; - STRIP: string; - VSCODE_GIT_ASKPASS_MAIN: string; - XDG_DATA_DIRS: string; - REPL_IDENTITY_KEY: string; - OBJDUMP: string; - BROWSER: string; - npm_config_noproxy: string; - PATH: string; - propagatedBuildInputs: string; - npm_config_node_gyp: string; - DOCKER_CONFIG: string; - CC: string; - NIX_CC: string; - __ETC_PROFILE_SOURCED: string; - depsBuildTargetPropagated: string; - depsBuildBuildPropagated: string; + SSH_CONNECTION: string; npm_config_global_prefix: string; - NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu: string; - NIX_INDENT_MAKE: string; - REPL_PUBKEYS: string; - CONFIG_SHELL: string; - npm_node_execpath: string; - RANLIB: string; - NIX_HARDENING_ENABLE: string; - REPL_SLUG: string; - OLDPWD: string; - NIX_LDFLAGS: string; - nativeBuildInputs: string; - npm_package_engines_node: string; - TERM_PROGRAM: string; - depsHostHostPropagated: string; - VSCODE_IPC_HOOK_CLI: string; + npm_command: string; + EDITOR: string; + INIT_CWD: string; [key: `PUBLIC_${string}`]: undefined; [key: `${string}`]: string | undefined; } } /** - * Similar to [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private), but only includes variables that begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) (which defaults to `PUBLIC_`), and can therefore safely be exposed to client-side code. + * This module provides access to environment variables set _dynamically_ at runtime and that are _publicly_ accessible. + * + * | | Runtime | Build time | + * | ------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ | + * | Private | [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private) | [`$env/static/private`](https://svelte.dev/docs/kit/$env-static-private) | + * | Public | [`$env/dynamic/public`](https://svelte.dev/docs/kit/$env-dynamic-public) | [`$env/static/public`](https://svelte.dev/docs/kit/$env-static-public) | + * + * Dynamic environment variables are defined by the platform you're running on. For example if you're using [`adapter-node`](https://github.com/sveltejs/kit/tree/main/packages/adapter-node) (or running [`vite preview`](https://svelte.dev/docs/kit/cli)), this is equivalent to `process.env`. + * + * **_Public_ access:** + * + * - This module _can_ be imported into client-side code + * - **Only** variables that begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) (which defaults to `PUBLIC_`) are included * - * Note that public dynamic environment variables must all be sent from the server to the client, causing larger network requests — when possible, use `$env/static/public` instead. + * > [!NOTE] In `dev`, `$env/dynamic` includes environment variables from `.env`. In `prod`, this behavior will depend on your adapter. * - * Dynamic environment variables cannot be used during prerendering. + * > [!NOTE] To get correct types, environment variables referenced in your code should be declared (for example in an `.env` file), even if they don't have a value until the app is deployed: + * > + * > ```env + * > MY_FEATURE_FLAG= + * > ``` + * > + * > You can override `.env` values from the command line like so: + * > + * > ```sh + * > MY_FEATURE_FLAG="enabled" npm run dev + * > ``` + * + * For example, given the following runtime environment: + * + * ```env + * ENVIRONMENT=production + * PUBLIC_BASE_URL=http://example.com + * ``` + * + * With the default `publicPrefix` and `privatePrefix`: * * ```ts * import { env } from '$env/dynamic/public'; - * console.log(env.PUBLIC_DEPLOYMENT_SPECIFIC_VARIABLE); + * console.log(env.ENVIRONMENT); // => undefined, not public + * console.log(env.PUBLIC_BASE_URL); // => "http://example.com" + * ``` + * + * ``` + * * ``` */ declare module '$env/dynamic/public' { diff --git a/.svelte-kit/generated/client/app.js b/.svelte-kit/generated/client/app.js deleted file mode 100644 index 5c3f935..0000000 --- a/.svelte-kit/generated/client/app.js +++ /dev/null @@ -1,28 +0,0 @@ -export { matchers } from './matchers.js'; - -export const nodes = [ - () => import('./nodes/0'), - () => import('./nodes/1'), - () => import('./nodes/2'), - () => import('./nodes/3') -]; - -export const server_loads = []; - -export const dictionary = { - "/": [2], - "/savers": [3] - }; - -export const hooks = { - handleError: (({ error }) => { console.error(error) }), - - reroute: (() => {}), - transport: {} -}; - -export const decoders = Object.fromEntries(Object.entries(hooks.transport).map(([k, v]) => [k, v.decode])); - -export const decode = (type, value) => decoders[type](value); - -export { default as root } from '../root.svelte'; \ No newline at end of file diff --git a/.svelte-kit/generated/client/matchers.js b/.svelte-kit/generated/client/matchers.js deleted file mode 100644 index f6bd30a..0000000 --- a/.svelte-kit/generated/client/matchers.js +++ /dev/null @@ -1 +0,0 @@ -export const matchers = {}; \ No newline at end of file diff --git a/.svelte-kit/generated/client/nodes/0.js b/.svelte-kit/generated/client/nodes/0.js deleted file mode 100644 index fed1375..0000000 --- a/.svelte-kit/generated/client/nodes/0.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/+layout.svelte"; \ No newline at end of file diff --git a/.svelte-kit/generated/client/nodes/1.js b/.svelte-kit/generated/client/nodes/1.js deleted file mode 100644 index 9cae4f0..0000000 --- a/.svelte-kit/generated/client/nodes/1.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../node_modules/@sveltejs/kit/src/runtime/components/svelte-4/error.svelte"; \ No newline at end of file diff --git a/.svelte-kit/generated/client/nodes/2.js b/.svelte-kit/generated/client/nodes/2.js deleted file mode 100644 index 1cb4f85..0000000 --- a/.svelte-kit/generated/client/nodes/2.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../src/routes/+page.svelte"; \ No newline at end of file diff --git a/.svelte-kit/generated/client/nodes/3.js b/.svelte-kit/generated/client/nodes/3.js deleted file mode 100644 index 2663ba3..0000000 --- a/.svelte-kit/generated/client/nodes/3.js +++ /dev/null @@ -1,3 +0,0 @@ -import * as universal from "../../../../src/routes/savers/+page.js"; -export { universal }; -export { default as component } from "../../../../src/routes/savers/+page.svelte"; \ No newline at end of file diff --git a/.svelte-kit/generated/root.svelte b/.svelte-kit/generated/root.svelte deleted file mode 100644 index 594b8fd..0000000 --- a/.svelte-kit/generated/root.svelte +++ /dev/null @@ -1,61 +0,0 @@ - - - - -{#if constructors[1]} - - - - -{:else} - - -{/if} - -{#if mounted} -
- {#if navigated} - {title} - {/if} -
-{/if} \ No newline at end of file diff --git a/.svelte-kit/generated/server/internal.js b/.svelte-kit/generated/server/internal.js deleted file mode 100644 index ec18c15..0000000 --- a/.svelte-kit/generated/server/internal.js +++ /dev/null @@ -1,48 +0,0 @@ - -import root from '../root.svelte'; -import { set_building, set_prerendering } from '__sveltekit/environment'; -import { set_assets } from '__sveltekit/paths'; -import { set_manifest, set_read_implementation } from '__sveltekit/server'; -import { set_private_env, set_public_env, set_safe_public_env } from '../../../node_modules/@sveltejs/kit/src/runtime/shared-server.js'; - -export const options = { - app_dir: "_app", - app_template_contains_nonce: false, - csp: {"mode":"auto","directives":{"upgrade-insecure-requests":false,"block-all-mixed-content":false},"reportOnly":{"upgrade-insecure-requests":false,"block-all-mixed-content":false}}, - csrf_check_origin: true, - embedded: false, - env_public_prefix: 'PUBLIC_', - env_private_prefix: '', - hooks: null, // added lazily, via `get_hooks` - preload_strategy: "modulepreload", - root, - service_worker: false, - templates: { - app: ({ head, body, assets, nonce, env }) => "\n\n\t\n\t\t\n\t\t\n\t\t\n\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t\t\n\t\t\n\n\t\t\n\t\t\n\n\t\t\n\t\t\n\n\t\t" + head + "\n\t\n\t\n\t\t
" + body + "
\n\t\n\n", - error: ({ status, message }) => "\n\n\t\n\t\t\n\t\t" + message + "\n\n\t\t\n\t\n\t\n\t\t
\n\t\t\t" + status + "\n\t\t\t
\n\t\t\t\t

" + message + "

\n\t\t\t
\n\t\t
\n\t\n\n" - }, - version_hash: "1tqp0c0" -}; - -export async function get_hooks() { - let handle; - let handleFetch; - let handleError; - let init; - - - let reroute; - let transport; - - - return { - handle, - handleFetch, - handleError, - init, - reroute, - transport - }; -} - -export { set_assets, set_building, set_manifest, set_prerendering, set_private_env, set_public_env, set_read_implementation, set_safe_public_env }; diff --git a/.svelte-kit/non-ambient.d.ts b/.svelte-kit/non-ambient.d.ts index 46bd7fb..989e0ef 100644 --- a/.svelte-kit/non-ambient.d.ts +++ b/.svelte-kit/non-ambient.d.ts @@ -23,3 +23,20 @@ declare module "svelte/elements" { } export {}; + + +declare module "$app/types" { + export interface AppTypes { + RouteId(): "/" | "/savers"; + RouteParams(): { + + }; + LayoutParams(): { + "/": Record; + "/savers": Record + }; + Pathname(): "/" | "/savers"; + ResolvedPathname(): `${"" | `/${string}`}${ReturnType}`; + Asset(): string & {}; + } +} \ No newline at end of file diff --git a/.svelte-kit/tsconfig.json b/.svelte-kit/tsconfig.json index a2a7665..7692388 100644 --- a/.svelte-kit/tsconfig.json +++ b/.svelte-kit/tsconfig.json @@ -6,6 +6,9 @@ ], "$lib/*": [ "../src/lib/*" + ], + "$app/types": [ + "./types/index.d.ts" ] }, "rootDirs": [ @@ -33,6 +36,9 @@ "../src/**/*.js", "../src/**/*.ts", "../src/**/*.svelte", + "../test/**/*.js", + "../test/**/*.ts", + "../test/**/*.svelte", "../tests/**/*.js", "../tests/**/*.ts", "../tests/**/*.svelte" diff --git a/.svelte-kit/types/src/routes/$types.d.ts b/.svelte-kit/types/src/routes/$types.d.ts index d24f9eb..378222f 100644 --- a/.svelte-kit/types/src/routes/$types.d.ts +++ b/.svelte-kit/types/src/routes/$types.d.ts @@ -18,5 +18,7 @@ type LayoutParentData = EnsureDefined<{}>; export type PageServerData = null; export type PageData = Expand; +export type PageProps = { params: RouteParams; data: PageData } export type LayoutServerData = null; -export type LayoutData = Expand; \ No newline at end of file +export type LayoutData = Expand; +export type LayoutProps = { params: LayoutParams; data: LayoutData; children: import("svelte").Snippet } \ No newline at end of file diff --git a/.svelte-kit/types/src/routes/savers/$types.d.ts b/.svelte-kit/types/src/routes/savers/$types.d.ts index 2c4dbc5..5e86b04 100644 --- a/.svelte-kit/types/src/routes/savers/$types.d.ts +++ b/.svelte-kit/types/src/routes/savers/$types.d.ts @@ -16,4 +16,5 @@ type PageParentData = EnsureDefined; export type PageServerData = null; export type PageLoad = OutputDataShape> = Kit.Load; export type PageLoadEvent = Parameters[0]; -export type PageData = Expand> & OptionalUnion>>>; \ No newline at end of file +export type PageData = Expand> & OptionalUnion>>>; +export type PageProps = { params: RouteParams; data: PageData } \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..3aae8cc --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "./.svelte-kit/tsconfig.json", + "compilerOptions": { + "verbatimModuleSyntax": true, + "isolatedModules": true, + "target": "ES2022", + "module": "ESNext", + "strict": true, + "skipLibCheck": true, + "allowJs": true, + "checkJs": true + } +}