@sveltejs/kit
Advanced tools
Comparing version 1.27.4 to 1.27.5
{ | ||
"name": "@sveltejs/kit", | ||
"version": "1.27.4", | ||
"version": "1.27.5", | ||
"description": "The fastest way to build Svelte apps", | ||
@@ -5,0 +5,0 @@ "repository": { |
import { join } from 'node:path'; | ||
/** @typedef {import('./types').Validator} Validator */ | ||
/** @typedef {import('./types.js').Validator} Validator */ | ||
@@ -5,0 +5,0 @@ const directives = object({ |
@@ -447,3 +447,3 @@ import fs from 'node:fs'; | ||
* @param {string[]} module_extensions | ||
* @returns {import('./types').RouteFile} | ||
* @returns {import('./types.js').RouteFile} | ||
*/ | ||
@@ -450,0 +450,0 @@ function analyze(project_relative, file, component_extensions, module_extensions) { |
@@ -91,2 +91,3 @@ import fs from 'node:fs'; | ||
'./types/**/$types.d.ts', | ||
config_relative('vite.config.js'), | ||
config_relative('vite.config.ts') | ||
@@ -93,0 +94,0 @@ ]); |
@@ -13,3 +13,3 @@ import fs from 'node:fs'; | ||
* @param {import('vite').Manifest | null} client_manifest | ||
* @param {import('rollup').OutputAsset[] | null} css | ||
* @param {import('vite').Rollup.OutputAsset[] | null} css | ||
*/ | ||
@@ -16,0 +16,0 @@ export function build_server_nodes(out, kit, manifest_data, server_manifest, client_manifest, css) { |
@@ -28,3 +28,3 @@ import path from 'node:path'; | ||
* Creates a guard that checks that no id imports a module that is not allowed to be imported into client-side code. | ||
* @param {import('rollup').PluginContext} context | ||
* @param {import('vite').Rollup.PluginContext} context | ||
* @param {{ cwd: string; lib: string }} paths | ||
@@ -31,0 +31,0 @@ */ |
@@ -33,3 +33,3 @@ import fs from 'node:fs'; | ||
/** @type {import('./types').EnforcedConfig} */ | ||
/** @type {import('./types.js').EnforcedConfig} */ | ||
const enforced_config = { | ||
@@ -706,3 +706,3 @@ appType: true, | ||
const { output } = /** @type {import('rollup').RollupOutput} */ ( | ||
const { output } = /** @type {import('vite').Rollup.RollupOutput} */ ( | ||
await vite.build({ | ||
@@ -747,3 +747,3 @@ configFile: vite_config.configFile, | ||
const css = output.filter( | ||
/** @type {(value: any) => value is import('rollup').OutputAsset} */ | ||
/** @type {(value: any) => value is import('vite').Rollup.OutputAsset} */ | ||
(value) => value.type === 'asset' && value.fileName.endsWith('.css') | ||
@@ -869,3 +869,3 @@ ); | ||
* @param {Record<string, any>} resolved_config | ||
* @param {import('./types').EnforcedConfig} enforced_config | ||
* @param {import('./types.js').EnforcedConfig} enforced_config | ||
* @param {string} path | ||
@@ -872,0 +872,0 @@ * @param {string[]} out used locally to compute the return value |
@@ -18,6 +18,3 @@ import fs from 'node:fs'; | ||
/** | ||
* @param {{ | ||
* middlewares: import('connect').Server; | ||
* httpServer: import('http').Server; | ||
* }} vite | ||
* @param {{ middlewares: import('connect').Server }} vite | ||
* @param {import('vite').ResolvedConfig} vite_config | ||
@@ -24,0 +21,0 @@ * @param {import('types').ValidatedConfig} svelte_config |
@@ -25,3 +25,4 @@ import { DEV } from 'esm-env'; | ||
is_external_url, | ||
scroll_state | ||
scroll_state, | ||
origin | ||
} from './utils.js'; | ||
@@ -59,5 +60,5 @@ | ||
/** | ||
* @param {import('./types').SvelteKitApp} app | ||
* @param {import('./types.js').SvelteKitApp} app | ||
* @param {HTMLElement} target | ||
* @returns {import('./types').Client} | ||
* @returns {import('./types.js').Client} | ||
*/ | ||
@@ -87,3 +88,3 @@ export function create_client(app, target) { | ||
/** @type {{id: string, promise: Promise<import('./types').NavigationResult>} | null} */ | ||
/** @type {{id: string, promise: Promise<import('./types.js').NavigationResult>} | null} */ | ||
let load_cache = null; | ||
@@ -102,3 +103,3 @@ | ||
/** @type {import('./types').NavigationState} */ | ||
/** @type {import('./types.js').NavigationState} */ | ||
let current = { | ||
@@ -254,3 +255,3 @@ branch: [], | ||
/** @param {import('./types').NavigationIntent} intent */ | ||
/** @param {import('./types.js').NavigationIntent} intent */ | ||
async function preload_data(intent) { | ||
@@ -282,3 +283,3 @@ load_cache = { | ||
/** @param {import('./types').NavigationFinished} result */ | ||
/** @param {import('./types.js').NavigationFinished} result */ | ||
function initialize(result) { | ||
@@ -324,3 +325,3 @@ if (DEV && result.state.error && document.querySelector('vite-error-overlay')) return; | ||
* params: Record<string, string>; | ||
* branch: Array<import('./types').BranchNode | undefined>; | ||
* branch: Array<import('./types.js').BranchNode | undefined>; | ||
* status: number; | ||
@@ -350,3 +351,3 @@ * error: App.Error | null; | ||
/** @type {import('./types').NavigationFinished} */ | ||
/** @type {import('./types.js').NavigationFinished} */ | ||
const result = { | ||
@@ -428,5 +429,5 @@ type: 'loaded', | ||
* route: { id: string | null }; | ||
* server_data_node: import('./types').DataNode | null; | ||
* server_data_node: import('./types.js').DataNode | null; | ||
* }} options | ||
* @returns {Promise<import('./types').BranchNode>} | ||
* @returns {Promise<import('./types.js').BranchNode>} | ||
*/ | ||
@@ -601,4 +602,4 @@ async function load_node({ loader, parent, url, params, route, server_data_node }) { | ||
* @param {import('types').ServerDataNode | import('types').ServerDataSkippedNode | null} node | ||
* @param {import('./types').DataNode | null} [previous] | ||
* @returns {import('./types').DataNode | null} | ||
* @param {import('./types.js').DataNode | null} [previous] | ||
* @returns {import('./types.js').DataNode | null} | ||
*/ | ||
@@ -612,4 +613,4 @@ function create_data_node(node, previous) { | ||
/** | ||
* @param {import('./types').NavigationIntent} intent | ||
* @returns {Promise<import('./types').NavigationResult>} | ||
* @param {import('./types.js').NavigationIntent} intent | ||
* @returns {Promise<import('./types.js').NavigationResult>} | ||
*/ | ||
@@ -678,3 +679,3 @@ async function load_route({ id, invalidating, url, params, route }) { | ||
/** @type {import('./types').BranchNode | undefined} */ | ||
/** @type {import('./types.js').BranchNode | undefined} */ | ||
const previous = current.branch[i]; | ||
@@ -722,3 +723,3 @@ | ||
/** @type {Array<import('./types').BranchNode | undefined>} */ | ||
/** @type {Array<import('./types.js').BranchNode | undefined>} */ | ||
const branch = []; | ||
@@ -797,5 +798,5 @@ | ||
* @param {number} i Start index to backtrack from | ||
* @param {Array<import('./types').BranchNode | undefined>} branch Branch to backtrack | ||
* @param {Array<import('./types.js').BranchNode | undefined>} branch Branch to backtrack | ||
* @param {Array<import('types').CSRPageNodeLoader | undefined>} errors All error pages for this branch | ||
* @returns {Promise<{idx: number; node: import('./types').BranchNode} | undefined>} | ||
* @returns {Promise<{idx: number; node: import('./types.js').BranchNode} | undefined>} | ||
*/ | ||
@@ -832,3 +833,3 @@ async function load_nearest_error_page(i, branch, errors) { | ||
* }} opts | ||
* @returns {Promise<import('./types').NavigationFinished>} | ||
* @returns {Promise<import('./types.js').NavigationFinished>} | ||
*/ | ||
@@ -861,3 +862,3 @@ async function load_root_error_page({ status, error, url, route }) { | ||
// bring us right back here, turning this into an endless loop | ||
if (url.origin !== location.origin || url.pathname !== location.pathname || hydrated) { | ||
if (url.origin !== origin || url.pathname !== location.pathname || hydrated) { | ||
await native_navigation(url); | ||
@@ -877,3 +878,3 @@ } | ||
/** @type {import('./types').BranchNode} */ | ||
/** @type {import('./types.js').BranchNode} */ | ||
const root_error = { | ||
@@ -911,3 +912,3 @@ node: await default_error_loader(), | ||
const id = url.pathname + url.search; | ||
/** @type {import('./types').NavigationIntent} */ | ||
/** @type {import('./types.js').NavigationIntent} */ | ||
const intent = { id, invalidating, route, params: decode_params(params), url }; | ||
@@ -928,3 +929,3 @@ return intent; | ||
* type: import('@sveltejs/kit').Navigation["type"]; | ||
* intent?: import('./types').NavigationIntent; | ||
* intent?: import('./types.js').NavigationIntent; | ||
* delta?: number; | ||
@@ -1192,6 +1193,6 @@ * }} opts | ||
* @param {number} status | ||
* @returns {Promise<import('./types').NavigationFinished>} | ||
* @returns {Promise<import('./types.js').NavigationFinished>} | ||
*/ | ||
async function server_fallback(url, route, error, status) { | ||
if (url.origin === location.origin && url.pathname === location.pathname && !hydrated) { | ||
if (url.origin === origin && url.pathname === location.pathname && !hydrated) { | ||
// We would reload the same page we're currently on, which isn't hydrated, | ||
@@ -1788,3 +1789,3 @@ // which means no SSR, which means we would end up in an endless loop | ||
/** @type {import('./types').NavigationFinished | undefined} */ | ||
/** @type {import('./types.js').NavigationFinished | undefined} */ | ||
let result; | ||
@@ -1816,3 +1817,3 @@ | ||
/** @type {Array<import('./types').BranchNode | undefined>} */ | ||
/** @type {Array<import('./types.js').BranchNode | undefined>} */ | ||
const branch = await Promise.all(branch_promises); | ||
@@ -2043,4 +2044,4 @@ | ||
/** | ||
* @param {import('./types').NavigationState} current | ||
* @param {import('./types').NavigationIntent | undefined} intent | ||
* @param {import('./types.js').NavigationState} current | ||
* @param {import('./types.js').NavigationIntent | undefined} intent | ||
* @param {URL | null} url | ||
@@ -2047,0 +2048,0 @@ * @param {Exclude<import('@sveltejs/kit').NavigationType, 'enter'>} type |
import { exec, parse_route_id } from '../../utils/routing.js'; | ||
/** | ||
* @param {import('./types').SvelteKitApp} app | ||
* @param {import('./types.js').SvelteKitApp} app | ||
* @returns {import('types').CSRRoute[]} | ||
@@ -6,0 +6,0 @@ */ |
@@ -5,3 +5,3 @@ import { writable } from 'svelte/store'; | ||
/** @type {import('./types').Client} */ | ||
/** @type {import('./types.js').Client} */ | ||
export let client; | ||
@@ -11,3 +11,3 @@ | ||
* @param {{ | ||
* client: import('./types').Client; | ||
* client: import('./types.js').Client; | ||
* }} opts | ||
@@ -14,0 +14,0 @@ */ |
@@ -6,5 +6,5 @@ import { DEV } from 'esm-env'; | ||
/** | ||
* @param {import('./types').SvelteKitApp} app | ||
* @param {import('./types.js').SvelteKitApp} app | ||
* @param {HTMLElement} target | ||
* @param {Parameters<import('./types').Client['_hydrate']>[0]} [hydrate] | ||
* @param {Parameters<import('./types.js').Client['_hydrate']>[0]} [hydrate] | ||
*/ | ||
@@ -11,0 +11,0 @@ export async function start(app, target, hydrate) { |
@@ -1,2 +0,2 @@ | ||
import { applyAction } from '../app/forms'; | ||
import { applyAction } from '../app/forms.js'; | ||
import { | ||
@@ -11,3 +11,3 @@ afterNavigate, | ||
preloadData | ||
} from '../app/navigation'; | ||
} from '../app/navigation.js'; | ||
import { SvelteComponent } from 'svelte'; | ||
@@ -14,0 +14,0 @@ import { ClientHooks, CSRPageNode, CSRPageNodeLoader, CSRRoute, TrailingSlash, Uses } from 'types'; |
@@ -9,2 +9,4 @@ import { BROWSER, DEV } from 'esm-env'; | ||
export const origin = BROWSER ? location.origin : ''; | ||
/** @param {HTMLDocument} doc */ | ||
@@ -139,3 +141,3 @@ export function get_base_uri(doc) { | ||
const download = url?.origin === location.origin && a.hasAttribute('download'); | ||
const download = url?.origin === origin && a.hasAttribute('download'); | ||
@@ -295,3 +297,3 @@ return { url, external, target, download }; | ||
export function is_external_url(url, base) { | ||
return url.origin !== location.origin || !url.pathname.startsWith(base); | ||
return url.origin !== origin || !url.pathname.startsWith(base); | ||
} |
@@ -30,3 +30,3 @@ import { parse, serialize } from 'cookie'; | ||
/** @type {Record<string, import('./page/types').Cookie>} */ | ||
/** @type {Record<string, import('./page/types.js').Cookie>} */ | ||
const new_cookies = {}; | ||
@@ -236,3 +236,3 @@ | ||
* @param {Headers} headers | ||
* @param {import('./page/types').Cookie[]} cookies | ||
* @param {import('./page/types.js').Cookie[]} cookies | ||
*/ | ||
@@ -239,0 +239,0 @@ export function add_cookies_to_headers(headers, cookies) { |
@@ -226,4 +226,4 @@ import { escape_html_attr } from '../../../utils/escape.js'; | ||
/** | ||
* @param {import('./types').CspConfig} config | ||
* @param {import('./types').CspOpts} opts | ||
* @param {import('./types.js').CspConfig} config | ||
* @param {import('./types.js').CspOpts} opts | ||
*/ | ||
@@ -230,0 +230,0 @@ constructor({ mode, directives, reportOnly }, { prerender }) { |
@@ -99,3 +99,3 @@ import { text } from '../../../exports/index.js'; | ||
/** @type {import('./types').Fetched[]} */ | ||
/** @type {import('./types.js').Fetched[]} */ | ||
const fetched = []; | ||
@@ -102,0 +102,0 @@ |
@@ -147,3 +147,3 @@ import { disable_search, make_trackable } from '../../../utils/url.js'; | ||
* event: import('@sveltejs/kit').RequestEvent; | ||
* fetched: import('./types').Fetched[]; | ||
* fetched: import('./types.js').Fetched[]; | ||
* node: import('types').SSRNode | undefined; | ||
@@ -196,3 +196,3 @@ * parent: () => Promise<Record<string, any>>; | ||
* @param {import('types').SSRState} state | ||
* @param {import('./types').Fetched[]} fetched | ||
* @param {import('./types.js').Fetched[]} fetched | ||
* @param {boolean} csr | ||
@@ -199,0 +199,0 @@ * @param {Pick<Required<import('@sveltejs/kit').ResolveOptions>, 'filterSerializedResponseHeaders'>} resolve_opts |
@@ -29,4 +29,4 @@ import * as devalue from 'devalue'; | ||
* @param {{ | ||
* branch: Array<import('./types').Loaded>; | ||
* fetched: Array<import('./types').Fetched>; | ||
* branch: Array<import('./types.js').Loaded>; | ||
* fetched: Array<import('./types.js').Fetched>; | ||
* options: import('types').SSROptions; | ||
@@ -33,0 +33,0 @@ * manifest: import('@sveltejs/kit').SSRManifest; |
@@ -36,3 +36,3 @@ import { render_response } from './render.js'; | ||
/** @type {import('./types').Fetched[]} */ | ||
/** @type {import('./types.js').Fetched[]} */ | ||
const fetched = []; | ||
@@ -39,0 +39,0 @@ |
@@ -137,3 +137,3 @@ import { DEV } from 'esm-env'; | ||
/** @type {Record<string, import('./page/types').Cookie>} */ | ||
/** @type {Record<string, import('./page/types.js').Cookie>} */ | ||
let cookies_to_add = {}; | ||
@@ -140,0 +140,0 @@ |
@@ -417,3 +417,3 @@ import { SvelteComponent } from 'svelte'; | ||
export * from '../exports/index'; | ||
export * from '../exports/index.js'; | ||
export * from './private.js'; |
// generated during release, do not modify | ||
/** @type {string} */ | ||
export const VERSION = '1.27.4'; | ||
export const VERSION = '1.27.5'; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
674494