@sveltejs/kit 1.0.0-next.329 → 1.0.0-next.331

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -683,7 +683,7 @@ function create_client({ target, session, base, trailing_slash }) {
683
683
 
684
684
  getSelection()?.removeAllRanges();
685
685
  root.tabIndex = -1;
686
- root.focus();
686
+ root.focus({ preventScroll: true });
687
687
 
688
688
  // restore `tabindex` as to prevent `root` from stealing input from elements
689
689
  if (tabindex !== null) {
@@ -415,7 +415,7 @@ function find_deps(node, deps) {
415
415
  * @typedef {{
416
416
  * cwd: string,
417
417
  * port: number,
418
- * host?: string,
418
+ * host: string,
419
419
  * https: boolean,
420
420
  * config: import('types').ValidatedConfig
421
421
  * }} Options
@@ -1200,7 +1200,6 @@ async function prerender({ config, entries, files, log }) {
1200
1200
  const dest = `${config.kit.outDir}/output/prerendered/${category}/${file}`;
1201
1201
 
1202
1202
  if (written.has(file)) return;
1203
- written.add(file);
1204
1203
 
1205
1204
  if (response_type === REDIRECT) {
1206
1205
  const location = response.headers.get('location');
@@ -1221,6 +1220,8 @@ async function prerender({ config, entries, files, log }) {
1221
1220
  `<meta http-equiv="refresh" content=${escape_html_attr(`0;url=${location}`)}>`
1222
1221
  );
1223
1222
 
1223
+ written.add(file);
1224
+
1224
1225
  if (!prerendered.redirects.has(decoded)) {
1225
1226
  prerendered.redirects.set(decoded, {
1226
1227
  status: response.status,
@@ -1242,6 +1243,7 @@ async function prerender({ config, entries, files, log }) {
1242
1243
 
1243
1244
  log.info(`${response.status} ${decoded}`);
1244
1245
  writeFileSync(dest, body);
1246
+ written.add(file);
1245
1247
 
1246
1248
  if (is_html) {
1247
1249
  prerendered.pages.set(decoded, {
@@ -15632,6 +15632,7 @@ async function watch(config, cwd = process.cwd()) {
15632
15632
  let timeout;
15633
15633
 
15634
15634
  const watcher = chokidar.watch(lib, { ignoreInitial: true });
15635
+ const ready = new Promise((resolve) => watcher.on('ready', resolve));
15635
15636
 
15636
15637
  watcher.on('all', async (type, path) => {
15637
15638
  const file = analyze(config, relative(lib, path));
@@ -15699,6 +15700,7 @@ async function watch(config, cwd = process.cwd()) {
15699
15700
 
15700
15701
  return {
15701
15702
  watcher,
15703
+ ready,
15702
15704
  settled: () =>
15703
15705
  new Promise((fulfil, reject) => {
15704
15706
  fulfillers.push(fulfil);
package/dist/cli.js CHANGED
@@ -870,15 +870,15 @@ async function launch(port, https, base) {
870
870
  exec(`${cmd} ${https ? 'https' : 'http'}://localhost:${port}${base}`);
871
871
  }
872
872
 
873
- const prog = sade('svelte-kit').version('1.0.0-next.329');
873
+ const prog = sade('svelte-kit').version('1.0.0-next.331');
874
874
 
875
875
  prog
876
876
  .command('dev')
877
877
  .describe('Start a development server')
878
- .option('-p, --port', 'Port')
879
- .option('-o, --open', 'Open a browser tab')
880
- .option('--host', 'Host (only use this on trusted networks)')
881
- .option('--https', 'Use self-signed HTTPS certificate')
878
+ .option('-p, --port', 'Port', 3000)
879
+ .option('-o, --open', 'Open a browser tab', false)
880
+ .option('--host', 'Host (only use this on trusted networks)', 'localhost')
881
+ .option('--https', 'Use self-signed HTTPS certificate', false)
882
882
  .option('-H', 'no longer supported, use --https instead') // TODO remove for 1.0
883
883
  .action(async ({ port, host, https, open, H }) => {
884
884
  try {
@@ -1049,7 +1049,7 @@ async function check_port(port) {
1049
1049
  function welcome({ port, host, https, open, base, loose, allow, cwd }) {
1050
1050
  if (open) launch(port, https, base);
1051
1051
 
1052
- console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.329'}\n`));
1052
+ console.log($.bold().cyan(`\n SvelteKit v${'1.0.0-next.331'}\n`));
1053
1053
 
1054
1054
  const protocol = https ? 'https:' : 'http:';
1055
1055
  const exposed = typeof host !== 'undefined' && host !== 'localhost' && host !== '127.0.0.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/kit",
3
- "version": "1.0.0-next.329",
3
+ "version": "1.0.0-next.331",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sveltejs/kit",
@@ -19,6 +19,7 @@
19
19
  "@playwright/test": "^1.21.0",
20
20
  "@rollup/plugin-replace": "^4.0.0",
21
21
  "@types/amphtml-validator": "^1.0.1",
22
+ "@types/connect": "^3.4.35",
22
23
  "@types/cookie": "^0.5.0",
23
24
  "@types/marked": "^4.0.1",
24
25
  "@types/mime": "^2.0.3",
@@ -76,18 +77,18 @@
76
77
  },
77
78
  "types": "types/index.d.ts",
78
79
  "engines": {
79
- "node": ">=14.13"
80
+ "node": ">=16"
80
81
  },
81
82
  "scripts": {
82
83
  "build": "rollup -c && node scripts/cp.js src/runtime/components assets/components && npm run types",
83
84
  "dev": "rollup -cw",
84
85
  "lint": "eslint --ignore-path .gitignore --ignore-pattern \"src/packaging/test/**\" \"{src,test}/**/*.{ts,mjs,js,svelte}\" && npm run check-format",
85
86
  "check": "tsc",
86
- "check:all": "tsc && pnpm run -r check --filter ./",
87
+ "check:all": "tsc && pnpm -r --filter=\"./**\" check",
87
88
  "format": "npm run check-format -- --write",
88
89
  "check-format": "prettier --check . --config ../../.prettierrc --ignore-path .gitignore",
89
90
  "test": "npm run test:unit && npm run test:typings && npm run test:packaging && npm run test:integration",
90
- "test:integration": "pnpm run -r test --workspace-concurrency 1 --filter ./test",
91
+ "test:integration": "pnpm run -r --workspace-concurrency 1 --filter=\"./test/**\" test",
91
92
  "test:unit": "uvu src \"(spec\\.js|test[\\\\/]index\\.js)\" -i packaging",
92
93
  "test:typings": "tsc --project test/typings",
93
94
  "test:packaging": "uvu src/packaging \"(spec\\.js|test[\\\\/]index\\.js)\"",
@@ -27,7 +27,11 @@ export interface AdapterEntry {
27
27
  }
28
28
 
29
29
  export type BodyValidator<T> = {
30
- [P in keyof T]: T[P] extends JSONValue ? BodyValidator<T[P]> : never;
30
+ [P in keyof T]: T[P] extends { [k: string]: infer V }
31
+ ? BodyValidator<V> // recurse when T[P] is an object
32
+ : T[P] extends BigInt | Function | Symbol
33
+ ? never
34
+ : T[P];
31
35
  };
32
36
 
33
37
  // Based on https://github.com/josh-hemphill/csp-typed-directives/blob/latest/src/csp.types.ts