@sveltejs/kit 1.0.0-next.442 → 1.0.0-next.443

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/kit",
3
- "version": "1.0.0-next.442",
3
+ "version": "1.0.0-next.443",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sveltejs/kit",
@@ -559,7 +559,13 @@ export function tweak_types(content, names) {
559
559
  arg.name.end,
560
560
  `: Parameters<${type}>[0]` + (add_parens ? ')' : '')
561
561
  );
562
+ } else {
563
+ // prevent "type X is imported but not used" (isn't silenced by @ts-nocheck) when svelte-check runs
564
+ code.append(`;${type};`);
562
565
  }
566
+ } else {
567
+ // prevent "type X is imported but not used" (isn't silenced by @ts-nocheck) when svelte-check runs
568
+ code.append(`;${type};`);
563
569
  }
564
570
 
565
571
  modified = true;
@@ -569,6 +575,16 @@ export function tweak_types(content, names) {
569
575
  }
570
576
  });
571
577
 
578
+ if (modified) {
579
+ // Ignore all type errors so they don't show up twice when svelte-check runs
580
+ // Account for possible @ts-check which would overwrite @ts-nocheck
581
+ if (code.original.startsWith('// @ts-check')) {
582
+ code.prependLeft('// @ts-check'.length, '\n// @ts-nocheck\n');
583
+ } else {
584
+ code.prepend('// @ts-nocheck\n');
585
+ }
586
+ }
587
+
572
588
  return {
573
589
  modified,
574
590
  code: code.toString(),
@@ -638,9 +638,10 @@ export function create_client({ target, base, trailing_slash }) {
638
638
 
639
639
  /**
640
640
  * @param {import('types').ServerDataNode | import('types').ServerDataSkippedNode | null} node
641
+ * @param {import('./types').DataNode | null} [previous]
641
642
  * @returns {import('./types').DataNode | null}
642
643
  */
643
- function create_data_node(node) {
644
+ function create_data_node(node, previous) {
644
645
  if (node?.type === 'data') {
645
646
  return {
646
647
  type: 'data',
@@ -652,6 +653,8 @@ export function create_client({ target, base, trailing_slash }) {
652
653
  url: !!node.uses.url
653
654
  }
654
655
  };
656
+ } else if (node?.type === 'skip') {
657
+ return previous ?? null;
655
658
  }
656
659
  return null;
657
660
  }
@@ -765,7 +768,7 @@ export function create_client({ target, base, trailing_slash }) {
765
768
  }
766
769
  return data;
767
770
  },
768
- server_data_node: create_data_node(server_data_node) ?? previous?.server ?? null
771
+ server_data_node: create_data_node(server_data_node, previous?.server)
769
772
  });
770
773
  });
771
774
 
@@ -194,6 +194,9 @@ export type ServerData =
194
194
  }
195
195
  | {
196
196
  type: 'data';
197
+ /**
198
+ * If `null`, then there was no load function
199
+ */
197
200
  nodes: Array<ServerDataNode | ServerDataSkippedNode | ServerErrorNode | null>;
198
201
  };
199
202