houdini-svelte 0.17.0 → 0.17.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.
@@ -1,5 +1,5 @@
1
- houdini-svelte:compile: cache hit, replaying output d2038584b36d45dd
1
+ houdini-svelte:compile: cache hit, replaying output aadda8d104f20a37
2
2
  houdini-svelte:compile:
3
- houdini-svelte:compile: > houdini-svelte@0.17.0 compile /home/runner/work/houdini/houdini/packages/houdini-svelte
3
+ houdini-svelte:compile: > houdini-svelte@0.17.1 compile /home/runner/work/houdini/houdini/packages/houdini-svelte
4
4
  houdini-svelte:compile: > scripts build --plugin
5
5
  houdini-svelte:compile:
@@ -1,5 +1,5 @@
1
- houdini-svelte:typedefs: cache hit, replaying output 72fe195e637ee1e9
1
+ houdini-svelte:typedefs: cache hit, replaying output e36eb7179ec2204c
2
2
  houdini-svelte:typedefs:
3
- houdini-svelte:typedefs: > houdini-svelte@0.17.0 typedefs /home/runner/work/houdini/houdini/packages/houdini-svelte
3
+ houdini-svelte:typedefs: > houdini-svelte@0.17.1 typedefs /home/runner/work/houdini/houdini/packages/houdini-svelte
4
4
  houdini-svelte:typedefs: > scripts typedefs --plugin
5
5
  houdini-svelte:typedefs:
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # houdini-svelte
2
2
 
3
+ ## 0.17.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#630](https://github.com/HoudiniGraphql/houdini/pull/630) [`02d8fc4`](https://github.com/HoudiniGraphql/houdini/commit/02d8fc47f71980bd2b6492162b8e57808447bdbc) Thanks [@AlecAivazis](https://github.com/AlecAivazis)! - Fix relative imports from root layout
8
+
9
+ - Updated dependencies [[`02d8fc4`](https://github.com/HoudiniGraphql/houdini/commit/02d8fc47f71980bd2b6492162b8e57808447bdbc)]:
10
+ - houdini@0.17.1
11
+
3
12
  ## 0.17.0
4
13
 
5
14
  ### ⚠️ Breaking Changes
@@ -183561,14 +183561,20 @@ async function codegen_default(input) {
183561
183561
  // src/plugin/fsPatch.ts
183562
183562
  var import_fs = __toESM(require("fs"), 1);
183563
183563
  var fsPatch_default = (getFramwork) => ({
183564
- resolveId(filepath, _, { config: config2 }) {
183564
+ async resolveId(filepath, _, { config: config2, isEntry }) {
183565
+ if (!isEntry) {
183566
+ const match = filepath.match("^((../)+)src/routes");
183567
+ if (match) {
183568
+ return path_exports.join(config2.projectRoot, filepath.substring(match[1].length));
183569
+ }
183570
+ return;
183571
+ }
183565
183572
  filepath = path_exports.posixify(filepath.toString());
183566
183573
  if (is_route_script(getFramwork(), filepath) || is_root_layout(config2, filepath) || is_root_layout_server(config2, filepath)) {
183567
183574
  return {
183568
- id: filepath
183575
+ id: resolve_relative(config2, filepath)
183569
183576
  };
183570
183577
  }
183571
- return null;
183572
183578
  },
183573
183579
  load: async (filepath, { config: config2 }) => {
183574
183580
  filepath = path_exports.posixify(filepath.toString());
@@ -183584,7 +183590,6 @@ var fsPatch_default = (getFramwork) => ({
183584
183590
  code: await fs_exports.readFile(filepath) || await fs_exports.readFile(path_exports.join(config2.projectRoot, filepath)) || empty_layout
183585
183591
  };
183586
183592
  }
183587
- return null;
183588
183593
  }
183589
183594
  });
183590
183595
  var _readDirSync = import_fs.default.readdirSync;
@@ -183557,14 +183557,20 @@ async function codegen_default(input) {
183557
183557
  // src/plugin/fsPatch.ts
183558
183558
  import filesystem, { Dirent } from "fs";
183559
183559
  var fsPatch_default = (getFramwork) => ({
183560
- resolveId(filepath, _, { config: config2 }) {
183560
+ async resolveId(filepath, _, { config: config2, isEntry }) {
183561
+ if (!isEntry) {
183562
+ const match = filepath.match("^((../)+)src/routes");
183563
+ if (match) {
183564
+ return path_exports.join(config2.projectRoot, filepath.substring(match[1].length));
183565
+ }
183566
+ return;
183567
+ }
183561
183568
  filepath = path_exports.posixify(filepath.toString());
183562
183569
  if (is_route_script(getFramwork(), filepath) || is_root_layout(config2, filepath) || is_root_layout_server(config2, filepath)) {
183563
183570
  return {
183564
- id: filepath
183571
+ id: resolve_relative(config2, filepath)
183565
183572
  };
183566
183573
  }
183567
- return null;
183568
183574
  },
183569
183575
  load: async (filepath, { config: config2 }) => {
183570
183576
  filepath = path_exports.posixify(filepath.toString());
@@ -183580,7 +183586,6 @@ var fsPatch_default = (getFramwork) => ({
183580
183586
  code: await fs_exports.readFile(filepath) || await fs_exports.readFile(path_exports.join(config2.projectRoot, filepath)) || empty_layout
183581
183587
  };
183582
183588
  }
183583
- return null;
183584
183589
  }
183585
183590
  });
183586
183591
  var _readDirSync = filesystem.readdirSync;
@@ -300305,14 +300305,20 @@ async function codegen_default(input) {
300305
300305
  // src/plugin/fsPatch.ts
300306
300306
  var import_fs = __toESM(require("fs"), 1);
300307
300307
  var fsPatch_default = (getFramwork) => ({
300308
- resolveId(filepath, _, { config: config3 }) {
300308
+ async resolveId(filepath, _, { config: config3, isEntry }) {
300309
+ if (!isEntry) {
300310
+ const match = filepath.match("^((../)+)src/routes");
300311
+ if (match) {
300312
+ return path_exports.join(config3.projectRoot, filepath.substring(match[1].length));
300313
+ }
300314
+ return;
300315
+ }
300309
300316
  filepath = path_exports.posixify(filepath.toString());
300310
300317
  if (is_route_script(getFramwork(), filepath) || is_root_layout(config3, filepath) || is_root_layout_server(config3, filepath)) {
300311
300318
  return {
300312
- id: filepath
300319
+ id: resolve_relative(config3, filepath)
300313
300320
  };
300314
300321
  }
300315
- return null;
300316
300322
  },
300317
300323
  load: async (filepath, { config: config3 }) => {
300318
300324
  filepath = path_exports.posixify(filepath.toString());
@@ -300328,7 +300334,6 @@ var fsPatch_default = (getFramwork) => ({
300328
300334
  code: await fs_exports.readFile(filepath) || await fs_exports.readFile(path_exports.join(config3.projectRoot, filepath)) || empty_layout
300329
300335
  };
300330
300336
  }
300331
- return null;
300332
300337
  }
300333
300338
  });
300334
300339
  var _readDirSync = import_fs.default.readdirSync;
@@ -300294,14 +300294,20 @@ async function codegen_default(input) {
300294
300294
  // src/plugin/fsPatch.ts
300295
300295
  import filesystem, { Dirent } from "fs";
300296
300296
  var fsPatch_default = (getFramwork) => ({
300297
- resolveId(filepath, _, { config: config3 }) {
300297
+ async resolveId(filepath, _, { config: config3, isEntry }) {
300298
+ if (!isEntry) {
300299
+ const match = filepath.match("^((../)+)src/routes");
300300
+ if (match) {
300301
+ return path_exports.join(config3.projectRoot, filepath.substring(match[1].length));
300302
+ }
300303
+ return;
300304
+ }
300298
300305
  filepath = path_exports.posixify(filepath.toString());
300299
300306
  if (is_route_script(getFramwork(), filepath) || is_root_layout(config3, filepath) || is_root_layout_server(config3, filepath)) {
300300
300307
  return {
300301
- id: filepath
300308
+ id: resolve_relative(config3, filepath)
300302
300309
  };
300303
300310
  }
300304
- return null;
300305
300311
  },
300306
300312
  load: async (filepath, { config: config3 }) => {
300307
300313
  filepath = path_exports.posixify(filepath.toString());
@@ -300317,7 +300323,6 @@ var fsPatch_default = (getFramwork) => ({
300317
300323
  code: await fs_exports.readFile(filepath) || await fs_exports.readFile(path_exports.join(config3.projectRoot, filepath)) || empty_layout
300318
300324
  };
300319
300325
  }
300320
- return null;
300321
300326
  }
300322
300327
  });
300323
300328
  var _readDirSync = filesystem.readdirSync;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "houdini-svelte",
3
- "version": "0.17.0",
3
+ "version": "0.17.1",
4
4
  "description": "The svelte plugin for houdini",
5
5
  "type": "module",
6
6
  "dependencies": {
@@ -9,7 +9,7 @@
9
9
  "ast-types": "^0.15.1",
10
10
  "estree-walker": "^3.0.1",
11
11
  "graphql": "^16.6.0",
12
- "houdini": "^0.17.0",
12
+ "houdini": "^0.17.1",
13
13
  "minimatch": "^5.1.0",
14
14
  "recast": "^0.21.5",
15
15
  "svelte": "^3.52.0"
@@ -12,7 +12,18 @@ import {
12
12
  // this plugin is responsible for faking `+page.js` existence in the eyes of sveltekit
13
13
  export default (getFramwork: () => Framework) =>
14
14
  ({
15
- resolveId(filepath, _, { config }) {
15
+ async resolveId(filepath, _, { config, isEntry }) {
16
+ // without this check, the block underneath breaks relative imports from root layout
17
+ if (!isEntry) {
18
+ // make sure there is no
19
+ const match = filepath.match('^((../)+)src/routes')
20
+ if (match) {
21
+ return path.join(config.projectRoot, filepath.substring(match[1].length))
22
+ }
23
+ // if there is no deep relative import, do the default thing
24
+ return
25
+ }
26
+
16
27
  // everything internal to houdini should assume posix paths
17
28
  filepath = path.posixify(filepath.toString())
18
29
 
@@ -23,11 +34,9 @@ export default (getFramwork: () => Framework) =>
23
34
  is_root_layout_server(config, filepath)
24
35
  ) {
25
36
  return {
26
- id: filepath,
37
+ id: resolve_relative(config, filepath),
27
38
  }
28
39
  }
29
-
30
- return null
31
40
  },
32
41
 
33
42
  load: async (filepath, { config }) => {
@@ -57,9 +66,6 @@ export default (getFramwork: () => Framework) =>
57
66
  empty_layout,
58
67
  }
59
68
  }
60
-
61
- // do the normal thing
62
- return null
63
69
  },
64
70
  } as Plugin['vite'])
65
71