Skip to content

Commit c7381b7

Browse files
authored
[chore] cleanup a couple types (#2677)
1 parent fa25813 commit c7381b7

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

packages/kit/src/core/build/index.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ import { copy_assets, posixify, resolve_entry } from '../utils.js';
1717
/** @param {any} value */
1818
const s = (value) => JSON.stringify(value);
1919

20-
/** @typedef {Record<string, {
21-
* file: string;
22-
* css: string[];
23-
* imports: string[];
24-
* }>} ClientManifest */
25-
2620
/**
2721
* @param {import('types/config').ValidatedConfig} config
2822
* @param {{
@@ -113,7 +107,6 @@ async function build_client({
113107
process.env.VITE_SVELTEKIT_AMP = config.kit.amp ? 'true' : '';
114108

115109
const client_out_dir = `${output_dir}/client/${config.kit.appDir}`;
116-
const client_manifest_file = `${client_out_dir}/manifest.json`;
117110

118111
/** @type {Record<string, string>} */
119112
const input = {
@@ -188,7 +181,8 @@ async function build_client({
188181

189182
await vite.build(merged_config);
190183

191-
/** @type {ClientManifest} */
184+
const client_manifest_file = `${client_out_dir}/manifest.json`;
185+
/** @type {import('vite').Manifest} */
192186
const client_manifest = JSON.parse(fs.readFileSync(client_manifest_file, 'utf-8'));
193187
fs.renameSync(client_manifest_file, `${output_dir}/manifest.json`); // inspectable but not shipped
194188

@@ -206,7 +200,7 @@ async function build_client({
206200
* client_entry_file: string;
207201
* service_worker_entry_file: string | null;
208202
* }} options
209-
* @param {ClientManifest} client_manifest
203+
* @param {import('vite').Manifest} client_manifest
210204
* @param {string} runtime
211205
*/
212206
async function build_server(
@@ -512,7 +506,7 @@ async function build_server(
512506
* client_entry_file: string;
513507
* service_worker_entry_file: string | null;
514508
* }} options
515-
* @param {ClientManifest} client_manifest
509+
* @param {import('vite').Manifest} client_manifest
516510
*/
517511
async function build_service_worker(
518512
{ cwd, assets_base, config, manifest, build_dir, output_dir, service_worker_entry_file },

packages/kit/types/ambient-modules.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ declare module '@sveltejs/kit/ssr' {
161161
type State = import('@sveltejs/kit/types/internal').SSRRenderState;
162162

163163
export interface Respond {
164-
(incoming: IncomingRequest, options: Options, state?: State): Response;
164+
(incoming: IncomingRequest, options: Options, state?: State): Promise<Response>;
165165
}
166166
export const respond: Respond;
167167
}

packages/kit/types/internal.d.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,13 @@ export interface Hooks {
121121

122122
export interface SSRNode {
123123
module: SSRComponent;
124-
entry: string; // client-side module corresponding to this component
124+
/** client-side module URL for this component */
125+
entry: string;
126+
/** external CSS files */
125127
css: string[];
128+
/** external JS files */
126129
js: string[];
130+
/** inlined styles */
127131
styles: string[];
128132
}
129133

0 commit comments

Comments
 (0)