Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error on uncommitted type changes #11243

Merged
merged 10 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run lint
- run: cd packages/kit && pnpm prepublishOnly && { [ "`git status --porcelain=v1`" == "" ] || echo "Generated types have changed — please run prepublishOnly locally and commit the changes after you have reviewed them"; }
- run: cd packages/kit && pnpm prepublishOnly && { [ "`git status --porcelain=v1`" == "" ] || (echo "Generated types have changed — please run prepublishOnly locally and commit the changes after you have reviewed them" && exit 1); }
Rich-Harris marked this conversation as resolved.
Show resolved Hide resolved
- run: pnpm run check
Tests:
runs-on: ${{ matrix.os }}
Expand Down
17 changes: 8 additions & 9 deletions packages/kit/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/// <reference types="vite/client" />

declare module '@sveltejs/kit' {
import type { CompileOptions } from 'svelte/types/compiler/interfaces';
import type { CompileOptions } from 'svelte/compiler';
import type { PluginOptions } from '@sveltejs/vite-plugin-svelte';
/**
* [Adapters](https://kit.svelte.dev/docs/adapters) are responsible for taking the production build and turning it into something that can be deployed to a platform of your choosing.
Expand Down Expand Up @@ -759,7 +759,7 @@ declare module '@sveltejs/kit' {
* <button on:click={increase}>Increase Count</button>
* ```
*/
depends(...deps: string[]): void;
depends(...deps: Array<`${string}:${string}`>): void;
}

export interface NavigationEvent<
Expand Down Expand Up @@ -826,7 +826,7 @@ declare module '@sveltejs/kit' {
/**
* The type of navigation:
* - `form`: The user submitted a `<form>`
* - `leave`: The user is leaving the app by closing the tab or using the back/forward buttons to go to a different document
* - `leave`: The app is being left either because the tab is being closed or a navigation to a different document is occurring
* - `link`: Navigation was triggered by a link click
* - `goto`: Navigation was triggered by a `goto(...)` call or a redirect
* - `popstate`: Navigation was triggered by back/forward navigation
Expand Down Expand Up @@ -1691,6 +1691,7 @@ declare module '@sveltejs/kit' {

type ValidatedConfig = RecursiveRequired<Config>;
export function error(status: number, body: App.Error): HttpError_1;

export function error(status: number, body?: {
message: string;
} extends App.Error ? App.Error | string | undefined : never): HttpError_1;
Expand Down Expand Up @@ -1821,10 +1822,7 @@ declare module '@sveltejs/kit/node/polyfills' {
/**
* Make various web APIs available as globals:
* - `crypto`
* - `fetch` (only in node < 18.11)
* - `Headers` (only in node < 18.11)
* - `Request` (only in node < 18.11)
* - `Response` (only in node < 18.11)
* - `File`
*/
export function installPolyfills(): void;
}
Expand All @@ -1835,6 +1833,9 @@ declare module '@sveltejs/kit/vite' {
* Returns the SvelteKit Vite plugins.
* */
export function sveltekit(): Promise<import('vite').Plugin[]>;
export type Req = import('http').IncomingMessage;
export type Res = import('http').ServerResponse;
export type Handler = (req: Req, res: Res, next: () => void) => void;
}

declare module '$app/environment' {
Expand Down Expand Up @@ -1911,8 +1912,6 @@ declare module '$app/navigation' {
*
* @param url Where to navigate to. Note that if you've set [`config.kit.paths.base`](https://kit.svelte.dev/docs/configuration#paths) and the URL is root-relative, you need to prepend the base path if you want to navigate within the app.
* @param {Object} opts Options related to the navigation
* @param invalidateAll If `true`, all `load` functions of the page will be rerun. See https://kit.svelte.dev/docs/load#rerunning-load-functions for more info on invalidation.
* @param opts.state The state of the new/updated history entry
Rich-Harris marked this conversation as resolved.
Show resolved Hide resolved
* */
export const goto: (url: string | URL, opts?: {
replaceState?: boolean;
Expand Down
Loading