houdini-svelte 2.2.0-next.0 → 2.2.0-next.1

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.
@@ -161741,22 +161741,45 @@ async function QueryProcessor(config, page) {
161741
161741
  if (propsStatement && propsStatement.id.type === "ObjectPattern") {
161742
161742
  propsStatement.id.properties.forEach((property) => {
161743
161743
  if (property.type === "ObjectProperty" && property.key.type === "Identifier") {
161744
- props.push(property.key.name);
161744
+ const key = property.key.name;
161745
+ let value = property.key.name;
161746
+ switch (property.value.type) {
161747
+ // `prop: renamed` - key is an Identifier
161748
+ case "Identifier":
161749
+ value = property.value.name;
161750
+ break;
161751
+ // `prop: renamed = "default"` - key is an AssignmentPattern
161752
+ case "AssignmentPattern":
161753
+ if (property.value.left.type === "Identifier") {
161754
+ value = property.value.left.name;
161755
+ }
161756
+ break;
161757
+ default:
161758
+ break;
161759
+ }
161760
+ props.push({ key, value });
161745
161761
  }
161746
161762
  });
161747
161763
  }
161748
161764
  }
161749
161765
  } else {
161750
161766
  props = page.script.body.filter(
161751
- (statement) => statement.type === "ExportNamedDeclaration" && statement.declaration?.type === "VariableDeclaration"
161752
- ).flatMap(
161753
- ({ declaration }) => declaration.declarations.map((dec) => {
161754
- if (dec.type === "VariableDeclarator") {
161755
- return dec.id.type === "Identifier" ? dec.id.name : "";
161756
- }
161757
- return dec.name;
161758
- })
161759
- );
161767
+ (statement) => statement.type === "ExportNamedDeclaration" && (!statement.declaration || statement.declaration.type === "VariableDeclaration")
161768
+ ).flatMap(({ declaration, specifiers }) => {
161769
+ if (declaration?.type === "VariableDeclaration") {
161770
+ return declaration.declarations.map((dec) => {
161771
+ if (dec.type === "VariableDeclarator") {
161772
+ const name = dec.id.type === "Identifier" ? dec.id.name : "";
161773
+ return { key: name, value: name };
161774
+ }
161775
+ return { key: dec.name, value: dec.name };
161776
+ });
161777
+ }
161778
+ return specifiers?.flatMap((spec) => ({
161779
+ key: spec.exported.name,
161780
+ value: spec.local?.name ?? ""
161781
+ })) ?? [];
161782
+ });
161760
161783
  }
161761
161784
  ensure_imports({
161762
161785
  config: page.config,
@@ -161849,10 +161872,10 @@ async function QueryProcessor(config, page) {
161849
161872
  props.map(
161850
161873
  (prop) => AST17.objectProperty(
161851
161874
  AST17.identifier(
161852
- prop
161875
+ prop.key
161853
161876
  ),
161854
161877
  AST17.identifier(
161855
- prop
161878
+ prop.value
161856
161879
  )
161857
161880
  )
161858
161881
  )
@@ -161736,22 +161736,45 @@ async function QueryProcessor(config, page) {
161736
161736
  if (propsStatement && propsStatement.id.type === "ObjectPattern") {
161737
161737
  propsStatement.id.properties.forEach((property) => {
161738
161738
  if (property.type === "ObjectProperty" && property.key.type === "Identifier") {
161739
- props.push(property.key.name);
161739
+ const key = property.key.name;
161740
+ let value = property.key.name;
161741
+ switch (property.value.type) {
161742
+ // `prop: renamed` - key is an Identifier
161743
+ case "Identifier":
161744
+ value = property.value.name;
161745
+ break;
161746
+ // `prop: renamed = "default"` - key is an AssignmentPattern
161747
+ case "AssignmentPattern":
161748
+ if (property.value.left.type === "Identifier") {
161749
+ value = property.value.left.name;
161750
+ }
161751
+ break;
161752
+ default:
161753
+ break;
161754
+ }
161755
+ props.push({ key, value });
161740
161756
  }
161741
161757
  });
161742
161758
  }
161743
161759
  }
161744
161760
  } else {
161745
161761
  props = page.script.body.filter(
161746
- (statement) => statement.type === "ExportNamedDeclaration" && statement.declaration?.type === "VariableDeclaration"
161747
- ).flatMap(
161748
- ({ declaration }) => declaration.declarations.map((dec) => {
161749
- if (dec.type === "VariableDeclarator") {
161750
- return dec.id.type === "Identifier" ? dec.id.name : "";
161751
- }
161752
- return dec.name;
161753
- })
161754
- );
161762
+ (statement) => statement.type === "ExportNamedDeclaration" && (!statement.declaration || statement.declaration.type === "VariableDeclaration")
161763
+ ).flatMap(({ declaration, specifiers }) => {
161764
+ if (declaration?.type === "VariableDeclaration") {
161765
+ return declaration.declarations.map((dec) => {
161766
+ if (dec.type === "VariableDeclarator") {
161767
+ const name = dec.id.type === "Identifier" ? dec.id.name : "";
161768
+ return { key: name, value: name };
161769
+ }
161770
+ return { key: dec.name, value: dec.name };
161771
+ });
161772
+ }
161773
+ return specifiers?.flatMap((spec) => ({
161774
+ key: spec.exported.name,
161775
+ value: spec.local?.name ?? ""
161776
+ })) ?? [];
161777
+ });
161755
161778
  }
161756
161779
  ensure_imports({
161757
161780
  config: page.config,
@@ -161844,10 +161867,10 @@ async function QueryProcessor(config, page) {
161844
161867
  props.map(
161845
161868
  (prop) => AST17.objectProperty(
161846
161869
  AST17.identifier(
161847
- prop
161870
+ prop.key
161848
161871
  ),
161849
161872
  AST17.identifier(
161850
- prop
161873
+ prop.value
161851
161874
  )
161852
161875
  )
161853
161876
  )
@@ -164685,22 +164685,45 @@ async function QueryProcessor(config, page) {
164685
164685
  if (propsStatement && propsStatement.id.type === "ObjectPattern") {
164686
164686
  propsStatement.id.properties.forEach((property) => {
164687
164687
  if (property.type === "ObjectProperty" && property.key.type === "Identifier") {
164688
- props.push(property.key.name);
164688
+ const key = property.key.name;
164689
+ let value = property.key.name;
164690
+ switch (property.value.type) {
164691
+ // `prop: renamed` - key is an Identifier
164692
+ case "Identifier":
164693
+ value = property.value.name;
164694
+ break;
164695
+ // `prop: renamed = "default"` - key is an AssignmentPattern
164696
+ case "AssignmentPattern":
164697
+ if (property.value.left.type === "Identifier") {
164698
+ value = property.value.left.name;
164699
+ }
164700
+ break;
164701
+ default:
164702
+ break;
164703
+ }
164704
+ props.push({ key, value });
164689
164705
  }
164690
164706
  });
164691
164707
  }
164692
164708
  }
164693
164709
  } else {
164694
164710
  props = page.script.body.filter(
164695
- (statement) => statement.type === "ExportNamedDeclaration" && statement.declaration?.type === "VariableDeclaration"
164696
- ).flatMap(
164697
- ({ declaration }) => declaration.declarations.map((dec) => {
164698
- if (dec.type === "VariableDeclarator") {
164699
- return dec.id.type === "Identifier" ? dec.id.name : "";
164700
- }
164701
- return dec.name;
164702
- })
164703
- );
164711
+ (statement) => statement.type === "ExportNamedDeclaration" && (!statement.declaration || statement.declaration.type === "VariableDeclaration")
164712
+ ).flatMap(({ declaration, specifiers }) => {
164713
+ if (declaration?.type === "VariableDeclaration") {
164714
+ return declaration.declarations.map((dec) => {
164715
+ if (dec.type === "VariableDeclarator") {
164716
+ const name = dec.id.type === "Identifier" ? dec.id.name : "";
164717
+ return { key: name, value: name };
164718
+ }
164719
+ return { key: dec.name, value: dec.name };
164720
+ });
164721
+ }
164722
+ return specifiers?.flatMap((spec) => ({
164723
+ key: spec.exported.name,
164724
+ value: spec.local?.name ?? ""
164725
+ })) ?? [];
164726
+ });
164704
164727
  }
164705
164728
  ensure_imports({
164706
164729
  config: page.config,
@@ -164793,10 +164816,10 @@ async function QueryProcessor(config, page) {
164793
164816
  props.map(
164794
164817
  (prop) => AST17.objectProperty(
164795
164818
  AST17.identifier(
164796
- prop
164819
+ prop.key
164797
164820
  ),
164798
164821
  AST17.identifier(
164799
- prop
164822
+ prop.value
164800
164823
  )
164801
164824
  )
164802
164825
  )
@@ -164681,22 +164681,45 @@ async function QueryProcessor(config, page) {
164681
164681
  if (propsStatement && propsStatement.id.type === "ObjectPattern") {
164682
164682
  propsStatement.id.properties.forEach((property) => {
164683
164683
  if (property.type === "ObjectProperty" && property.key.type === "Identifier") {
164684
- props.push(property.key.name);
164684
+ const key = property.key.name;
164685
+ let value = property.key.name;
164686
+ switch (property.value.type) {
164687
+ // `prop: renamed` - key is an Identifier
164688
+ case "Identifier":
164689
+ value = property.value.name;
164690
+ break;
164691
+ // `prop: renamed = "default"` - key is an AssignmentPattern
164692
+ case "AssignmentPattern":
164693
+ if (property.value.left.type === "Identifier") {
164694
+ value = property.value.left.name;
164695
+ }
164696
+ break;
164697
+ default:
164698
+ break;
164699
+ }
164700
+ props.push({ key, value });
164685
164701
  }
164686
164702
  });
164687
164703
  }
164688
164704
  }
164689
164705
  } else {
164690
164706
  props = page.script.body.filter(
164691
- (statement) => statement.type === "ExportNamedDeclaration" && statement.declaration?.type === "VariableDeclaration"
164692
- ).flatMap(
164693
- ({ declaration }) => declaration.declarations.map((dec) => {
164694
- if (dec.type === "VariableDeclarator") {
164695
- return dec.id.type === "Identifier" ? dec.id.name : "";
164696
- }
164697
- return dec.name;
164698
- })
164699
- );
164707
+ (statement) => statement.type === "ExportNamedDeclaration" && (!statement.declaration || statement.declaration.type === "VariableDeclaration")
164708
+ ).flatMap(({ declaration, specifiers }) => {
164709
+ if (declaration?.type === "VariableDeclaration") {
164710
+ return declaration.declarations.map((dec) => {
164711
+ if (dec.type === "VariableDeclarator") {
164712
+ const name = dec.id.type === "Identifier" ? dec.id.name : "";
164713
+ return { key: name, value: name };
164714
+ }
164715
+ return { key: dec.name, value: dec.name };
164716
+ });
164717
+ }
164718
+ return specifiers?.flatMap((spec) => ({
164719
+ key: spec.exported.name,
164720
+ value: spec.local?.name ?? ""
164721
+ })) ?? [];
164722
+ });
164700
164723
  }
164701
164724
  ensure_imports({
164702
164725
  config: page.config,
@@ -164789,10 +164812,10 @@ async function QueryProcessor(config, page) {
164789
164812
  props.map(
164790
164813
  (prop) => AST17.objectProperty(
164791
164814
  AST17.identifier(
164792
- prop
164815
+ prop.key
164793
164816
  ),
164794
164817
  AST17.identifier(
164795
- prop
164818
+ prop.value
164796
164819
  )
164797
164820
  )
164798
164821
  )
@@ -301383,22 +301383,45 @@ async function QueryProcessor(config, page) {
301383
301383
  if (propsStatement && propsStatement.id.type === "ObjectPattern") {
301384
301384
  propsStatement.id.properties.forEach((property) => {
301385
301385
  if (property.type === "ObjectProperty" && property.key.type === "Identifier") {
301386
- props.push(property.key.name);
301386
+ const key = property.key.name;
301387
+ let value = property.key.name;
301388
+ switch (property.value.type) {
301389
+ // `prop: renamed` - key is an Identifier
301390
+ case "Identifier":
301391
+ value = property.value.name;
301392
+ break;
301393
+ // `prop: renamed = "default"` - key is an AssignmentPattern
301394
+ case "AssignmentPattern":
301395
+ if (property.value.left.type === "Identifier") {
301396
+ value = property.value.left.name;
301397
+ }
301398
+ break;
301399
+ default:
301400
+ break;
301401
+ }
301402
+ props.push({ key, value });
301387
301403
  }
301388
301404
  });
301389
301405
  }
301390
301406
  }
301391
301407
  } else {
301392
301408
  props = page.script.body.filter(
301393
- (statement) => statement.type === "ExportNamedDeclaration" && statement.declaration?.type === "VariableDeclaration"
301394
- ).flatMap(
301395
- ({ declaration }) => declaration.declarations.map((dec) => {
301396
- if (dec.type === "VariableDeclarator") {
301397
- return dec.id.type === "Identifier" ? dec.id.name : "";
301398
- }
301399
- return dec.name;
301400
- })
301401
- );
301409
+ (statement) => statement.type === "ExportNamedDeclaration" && (!statement.declaration || statement.declaration.type === "VariableDeclaration")
301410
+ ).flatMap(({ declaration, specifiers }) => {
301411
+ if (declaration?.type === "VariableDeclaration") {
301412
+ return declaration.declarations.map((dec) => {
301413
+ if (dec.type === "VariableDeclarator") {
301414
+ const name = dec.id.type === "Identifier" ? dec.id.name : "";
301415
+ return { key: name, value: name };
301416
+ }
301417
+ return { key: dec.name, value: dec.name };
301418
+ });
301419
+ }
301420
+ return specifiers?.flatMap((spec) => ({
301421
+ key: spec.exported.name,
301422
+ value: spec.local?.name ?? ""
301423
+ })) ?? [];
301424
+ });
301402
301425
  }
301403
301426
  ensure_imports({
301404
301427
  config: page.config,
@@ -301491,10 +301514,10 @@ async function QueryProcessor(config, page) {
301491
301514
  props.map(
301492
301515
  (prop) => AST18.objectProperty(
301493
301516
  AST18.identifier(
301494
- prop
301517
+ prop.key
301495
301518
  ),
301496
301519
  AST18.identifier(
301497
- prop
301520
+ prop.value
301498
301521
  )
301499
301522
  )
301500
301523
  )
@@ -301372,22 +301372,45 @@ async function QueryProcessor(config, page) {
301372
301372
  if (propsStatement && propsStatement.id.type === "ObjectPattern") {
301373
301373
  propsStatement.id.properties.forEach((property) => {
301374
301374
  if (property.type === "ObjectProperty" && property.key.type === "Identifier") {
301375
- props.push(property.key.name);
301375
+ const key = property.key.name;
301376
+ let value = property.key.name;
301377
+ switch (property.value.type) {
301378
+ // `prop: renamed` - key is an Identifier
301379
+ case "Identifier":
301380
+ value = property.value.name;
301381
+ break;
301382
+ // `prop: renamed = "default"` - key is an AssignmentPattern
301383
+ case "AssignmentPattern":
301384
+ if (property.value.left.type === "Identifier") {
301385
+ value = property.value.left.name;
301386
+ }
301387
+ break;
301388
+ default:
301389
+ break;
301390
+ }
301391
+ props.push({ key, value });
301376
301392
  }
301377
301393
  });
301378
301394
  }
301379
301395
  }
301380
301396
  } else {
301381
301397
  props = page.script.body.filter(
301382
- (statement) => statement.type === "ExportNamedDeclaration" && statement.declaration?.type === "VariableDeclaration"
301383
- ).flatMap(
301384
- ({ declaration }) => declaration.declarations.map((dec) => {
301385
- if (dec.type === "VariableDeclarator") {
301386
- return dec.id.type === "Identifier" ? dec.id.name : "";
301387
- }
301388
- return dec.name;
301389
- })
301390
- );
301398
+ (statement) => statement.type === "ExportNamedDeclaration" && (!statement.declaration || statement.declaration.type === "VariableDeclaration")
301399
+ ).flatMap(({ declaration, specifiers }) => {
301400
+ if (declaration?.type === "VariableDeclaration") {
301401
+ return declaration.declarations.map((dec) => {
301402
+ if (dec.type === "VariableDeclarator") {
301403
+ const name = dec.id.type === "Identifier" ? dec.id.name : "";
301404
+ return { key: name, value: name };
301405
+ }
301406
+ return { key: dec.name, value: dec.name };
301407
+ });
301408
+ }
301409
+ return specifiers?.flatMap((spec) => ({
301410
+ key: spec.exported.name,
301411
+ value: spec.local?.name ?? ""
301412
+ })) ?? [];
301413
+ });
301391
301414
  }
301392
301415
  ensure_imports({
301393
301416
  config: page.config,
@@ -301480,10 +301503,10 @@ async function QueryProcessor(config, page) {
301480
301503
  props.map(
301481
301504
  (prop) => AST18.objectProperty(
301482
301505
  AST18.identifier(
301483
- prop
301506
+ prop.key
301484
301507
  ),
301485
301508
  AST18.identifier(
301486
- prop
301509
+ prop.value
301487
301510
  )
301488
301511
  )
301489
301512
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "houdini-svelte",
3
- "version": "2.2.0-next.0",
3
+ "version": "2.2.0-next.1",
4
4
  "description": "The svelte plugin for houdini",
5
5
  "keywords": [
6
6
  "typescript",