houdini 1.0.7 → 1.0.9

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.
@@ -43769,14 +43769,18 @@ var require_lib3 = __commonJS({
43769
43769
  }
43770
43770
  });
43771
43771
 
43772
- // ../../node_modules/.pnpm/tslib@2.4.1/node_modules/tslib/tslib.js
43772
+ // ../../node_modules/.pnpm/tslib@2.5.0/node_modules/tslib/tslib.js
43773
43773
  var require_tslib = __commonJS({
43774
- "../../node_modules/.pnpm/tslib@2.4.1/node_modules/tslib/tslib.js"(exports, module2) {
43774
+ "../../node_modules/.pnpm/tslib@2.5.0/node_modules/tslib/tslib.js"(exports, module2) {
43775
43775
  var __extends;
43776
43776
  var __assign;
43777
43777
  var __rest;
43778
43778
  var __decorate;
43779
43779
  var __param;
43780
+ var __esDecorate;
43781
+ var __runInitializers;
43782
+ var __propKey;
43783
+ var __setFunctionName;
43780
43784
  var __metadata;
43781
43785
  var __awaiter;
43782
43786
  var __generator;
@@ -43873,6 +43877,65 @@ var require_tslib = __commonJS({
43873
43877
  decorator(target, key, paramIndex);
43874
43878
  };
43875
43879
  };
43880
+ __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
43881
+ function accept(f3) {
43882
+ if (f3 !== void 0 && typeof f3 !== "function")
43883
+ throw new TypeError("Function expected");
43884
+ return f3;
43885
+ }
43886
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
43887
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
43888
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
43889
+ var _, done = false;
43890
+ for (var i2 = decorators.length - 1; i2 >= 0; i2--) {
43891
+ var context = {};
43892
+ for (var p in contextIn)
43893
+ context[p] = p === "access" ? {} : contextIn[p];
43894
+ for (var p in contextIn.access)
43895
+ context.access[p] = contextIn.access[p];
43896
+ context.addInitializer = function(f3) {
43897
+ if (done)
43898
+ throw new TypeError("Cannot add initializers after decoration has completed");
43899
+ extraInitializers.push(accept(f3 || null));
43900
+ };
43901
+ var result = (0, decorators[i2])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
43902
+ if (kind === "accessor") {
43903
+ if (result === void 0)
43904
+ continue;
43905
+ if (result === null || typeof result !== "object")
43906
+ throw new TypeError("Object expected");
43907
+ if (_ = accept(result.get))
43908
+ descriptor.get = _;
43909
+ if (_ = accept(result.set))
43910
+ descriptor.set = _;
43911
+ if (_ = accept(result.init))
43912
+ initializers.push(_);
43913
+ } else if (_ = accept(result)) {
43914
+ if (kind === "field")
43915
+ initializers.push(_);
43916
+ else
43917
+ descriptor[key] = _;
43918
+ }
43919
+ }
43920
+ if (target)
43921
+ Object.defineProperty(target, contextIn.name, descriptor);
43922
+ done = true;
43923
+ };
43924
+ __runInitializers = function(thisArg, initializers, value) {
43925
+ var useValue = arguments.length > 2;
43926
+ for (var i2 = 0; i2 < initializers.length; i2++) {
43927
+ value = useValue ? initializers[i2].call(thisArg, value) : initializers[i2].call(thisArg);
43928
+ }
43929
+ return useValue ? value : void 0;
43930
+ };
43931
+ __propKey = function(x2) {
43932
+ return typeof x2 === "symbol" ? x2 : "".concat(x2);
43933
+ };
43934
+ __setFunctionName = function(f3, name, prefix) {
43935
+ if (typeof name === "symbol")
43936
+ name = name.description ? "[".concat(name.description, "]") : "";
43937
+ return Object.defineProperty(f3, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
43938
+ };
43876
43939
  __metadata = function(metadataKey, metadataValue) {
43877
43940
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
43878
43941
  return Reflect.metadata(metadataKey, metadataValue);
@@ -44107,7 +44170,7 @@ var require_tslib = __commonJS({
44107
44170
  }, i2;
44108
44171
  function verb(n, f3) {
44109
44172
  i2[n] = o[n] ? function(v) {
44110
- return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f3 ? f3(v) : v;
44173
+ return (p = !p) ? { value: __await(o[n](v)), done: false } : f3 ? f3(v) : v;
44111
44174
  } : f3;
44112
44175
  }
44113
44176
  };
@@ -44185,6 +44248,10 @@ var require_tslib = __commonJS({
44185
44248
  exporter("__rest", __rest);
44186
44249
  exporter("__decorate", __decorate);
44187
44250
  exporter("__param", __param);
44251
+ exporter("__esDecorate", __esDecorate);
44252
+ exporter("__runInitializers", __runInitializers);
44253
+ exporter("__propKey", __propKey);
44254
+ exporter("__setFunctionName", __setFunctionName);
44188
44255
  exporter("__metadata", __metadata);
44189
44256
  exporter("__awaiter", __awaiter);
44190
44257
  exporter("__generator", __generator);
@@ -68469,6 +68536,10 @@ var CachePolicy = {
68469
68536
  NetworkOnly: "NetworkOnly",
68470
68537
  CacheAndNetwork: "CacheAndNetwork"
68471
68538
  };
68539
+ var PaginateMode = {
68540
+ Infinite: "Infinite",
68541
+ SinglePage: "SinglePage"
68542
+ };
68472
68543
  var ArtifactKind = {
68473
68544
  Query: "HoudiniQuery",
68474
68545
  Subscription: "HoudiniSubscription",
@@ -72079,6 +72150,7 @@ var Config = class {
72079
72150
  defaultPartial;
72080
72151
  internalListPosition;
72081
72152
  defaultListTarget = null;
72153
+ defaultPaginateMode;
72082
72154
  definitionsFolder;
72083
72155
  newDocuments = "";
72084
72156
  defaultKeys = ["id"];
@@ -72115,6 +72187,7 @@ var Config = class {
72115
72187
  defaultPartial = false,
72116
72188
  defaultListPosition = "append",
72117
72189
  defaultListTarget = null,
72190
+ defaultPaginateMode = PaginateMode.Infinite,
72118
72191
  defaultKeys,
72119
72192
  types: types16 = {},
72120
72193
  logLevel,
@@ -72148,6 +72221,7 @@ var Config = class {
72148
72221
  this.defaultPartial = defaultPartial;
72149
72222
  this.internalListPosition = defaultListPosition === "append" ? "last" : "first";
72150
72223
  this.defaultListTarget = defaultListTarget;
72224
+ this.defaultPaginateMode = defaultPaginateMode;
72151
72225
  this.definitionsFolder = definitionsPath;
72152
72226
  this.logLevel = (logLevel || LogLevel.Summary).toLowerCase();
72153
72227
  this.defaultFragmentMasking = defaultFragmentMasking;
@@ -72411,7 +72485,7 @@ var Config = class {
72411
72485
  get listAllListsDirective() {
72412
72486
  return "allLists";
72413
72487
  }
72414
- get listNameArg() {
72488
+ get listOrPaginateNameArg() {
72415
72489
  return "name";
72416
72490
  }
72417
72491
  get insertFragmentSuffix() {
@@ -72444,8 +72518,8 @@ var Config = class {
72444
72518
  get paginateDirective() {
72445
72519
  return "paginate";
72446
72520
  }
72447
- get paginateNameArg() {
72448
- return "name";
72521
+ get paginateModeArg() {
72522
+ return "mode";
72449
72523
  }
72450
72524
  get cacheDirective() {
72451
72525
  return "cache";
@@ -72487,7 +72561,7 @@ var Config = class {
72487
72561
  return name + this.removeFragmentSuffix;
72488
72562
  }
72489
72563
  isInternalEnum(node) {
72490
- return node.name.value === "CachePolicy";
72564
+ return node.name.value === "CachePolicy" || node.name.value === "PaginateMode";
72491
72565
  }
72492
72566
  isInternalDirective(name) {
72493
72567
  const internalDirectives = this.#newSchemaInstance?.getDirectives().reduce((list, directive) => {
@@ -73008,6 +73082,57 @@ function deepMerge(filepath, ...targets) {
73008
73082
  }
73009
73083
  }
73010
73084
 
73085
+ // src/lib/detectTools.ts
73086
+ async function detectFromPackageJSON(cwd) {
73087
+ try {
73088
+ const packageJSONFile = await fs_exports.readFile(path_exports.join(cwd, "package.json"));
73089
+ if (packageJSONFile) {
73090
+ var packageJSON = JSON.parse(packageJSONFile);
73091
+ } else {
73092
+ throw new Error("not found");
73093
+ }
73094
+ } catch {
73095
+ throw new Error(
73096
+ "\u274C houdini init must target an existing node project (with a package.json)"
73097
+ );
73098
+ }
73099
+ const { devDependencies, dependencies } = packageJSON;
73100
+ const hasDependency = (dep) => Boolean(devDependencies?.[dep] || dependencies?.[dep]);
73101
+ let framework = "svelte";
73102
+ if (hasDependency("@sveltejs/kit")) {
73103
+ framework = "kit";
73104
+ }
73105
+ return {
73106
+ framework,
73107
+ module: packageJSON["type"] === "module" ? "esm" : "commonjs"
73108
+ };
73109
+ }
73110
+ async function detectTools(cwd) {
73111
+ let typescript = false;
73112
+ try {
73113
+ await fs_exports.stat(path_exports.join(cwd, "tsconfig.json"));
73114
+ typescript = true;
73115
+ } catch {
73116
+ }
73117
+ let package_manager = "npm";
73118
+ let dir = cwd;
73119
+ do {
73120
+ if (fs_exports.existsSync(path_exports.join(dir, "pnpm-lock.yaml"))) {
73121
+ package_manager = "pnpm";
73122
+ break;
73123
+ }
73124
+ if (fs_exports.existsSync(path_exports.join(dir, "yarn.lock"))) {
73125
+ package_manager = "yarn";
73126
+ break;
73127
+ }
73128
+ } while (dir !== (dir = path_exports.dirname(dir)));
73129
+ return {
73130
+ typescript,
73131
+ package_manager,
73132
+ ...await detectFromPackageJSON(cwd)
73133
+ };
73134
+ }
73135
+
73011
73136
  // ../../node_modules/.pnpm/estree-walker@3.0.1/node_modules/estree-walker/src/walker.js
73012
73137
  var WalkerBase = class {
73013
73138
  constructor() {
@@ -74255,6 +74380,7 @@ async function paginate(config2, documents) {
74255
74380
  let refetchQueryName = "";
74256
74381
  let nodeQuery = false;
74257
74382
  let fragment = "";
74383
+ let paginateMode = config2.defaultPaginateMode;
74258
74384
  doc.document = graphql10.visit(doc.document, {
74259
74385
  OperationDefinition(node) {
74260
74386
  if (node.operation !== "query") {
@@ -74320,6 +74446,14 @@ async function paginate(config2, documents) {
74320
74446
  }
74321
74447
  },
74322
74448
  Directive(node) {
74449
+ if (node.name.value === config2.paginateDirective) {
74450
+ const paginateModeArg = node?.arguments?.find(
74451
+ (arg) => arg.name.value === config2.paginateModeArg
74452
+ );
74453
+ if (paginateModeArg && paginateModeArg.value.kind === "EnumValue") {
74454
+ paginateMode = paginateModeArg.value.value;
74455
+ }
74456
+ }
74323
74457
  if (node.name.value !== config2.argumentsDirective) {
74324
74458
  return;
74325
74459
  }
@@ -74364,7 +74498,8 @@ async function paginate(config2, documents) {
74364
74498
  targetType,
74365
74499
  paginated: true,
74366
74500
  direction,
74367
- start
74501
+ start,
74502
+ mode: paginateMode
74368
74503
  };
74369
74504
  if (!fragment) {
74370
74505
  continue;
@@ -74713,7 +74848,9 @@ async function addListFragments(config2, documents) {
74713
74848
  doc.document = graphql11.visit(doc.document, {
74714
74849
  Directive(node, key, parent, path2, ancestors) {
74715
74850
  if ([config2.listDirective, config2.paginateDirective].includes(node.name.value)) {
74716
- const nameArg = node.arguments?.find((arg) => arg.name.value === "name");
74851
+ const nameArg = node.arguments?.find(
74852
+ (arg) => arg.name.value === config2.listOrPaginateNameArg
74853
+ );
74717
74854
  let error = {
74718
74855
  ...new graphql11.GraphQLError(
74719
74856
  "",
@@ -75013,14 +75150,23 @@ function fieldKey(config2, field) {
75013
75150
  const attributeName = field.alias?.value || field.name.value;
75014
75151
  const printed = graphql12.print(field);
75015
75152
  const secondParse = graphql12.parse(`{${printed}}`).definitions[0].selectionSet.selections[0];
75016
- const paginated = !!field.directives?.find(
75153
+ let paginateMode = config2.defaultPaginateMode;
75154
+ const paginatedDirective = field.directives?.find(
75017
75155
  (directive) => directive.name.value === config2.paginateDirective
75018
75156
  );
75019
- const paginationArgs = ["first", "after", "last", "before", "limit", "offset"];
75157
+ if (paginatedDirective) {
75158
+ const paginateModeArg = paginatedDirective?.arguments?.find(
75159
+ (arg) => arg.name.value === config2.paginateModeArg
75160
+ );
75161
+ if (paginateModeArg && paginateModeArg.value.kind === "EnumValue") {
75162
+ paginateMode = paginateModeArg.value.value;
75163
+ }
75164
+ }
75165
+ const paginationArgs = paginateMode === "SinglePage" ? [] : ["first", "after", "last", "before", "limit", "offset"];
75020
75166
  const argObj = (secondParse.arguments || []).reduce((acc, arg) => {
75021
75167
  const start = arg.value.loc?.start;
75022
75168
  const end = arg.value.loc?.end;
75023
- if (paginated && paginationArgs.includes(arg.name.value)) {
75169
+ if (paginatedDirective && paginationArgs.includes(arg.name.value)) {
75024
75170
  return acc;
75025
75171
  }
75026
75172
  if (!start || !end) {
@@ -75034,7 +75180,7 @@ function fieldKey(config2, field) {
75034
75180
  const args = Object.keys(argObj);
75035
75181
  args.sort();
75036
75182
  let key = Object.values(argObj).length > 0 ? `${attributeName}(${args.map((key2) => `${key2}: ${argObj[key2]}`).join(", ")})` : attributeName;
75037
- if (paginated) {
75183
+ if (paginatedDirective) {
75038
75184
  key = key + "::paginated";
75039
75185
  }
75040
75186
  return key;
@@ -75174,7 +75320,9 @@ function selection({
75174
75320
  const listDirective = field.directives?.find(
75175
75321
  (directive) => [config2.listDirective, config2.paginateDirective].includes(directive.name.value)
75176
75322
  );
75177
- const nameArg = listDirective?.arguments?.find((arg) => arg.name.value === "name");
75323
+ const nameArg = listDirective?.arguments?.find(
75324
+ (arg) => arg.name.value === config2.listOrPaginateNameArg
75325
+ );
75178
75326
  if (nameArg && nameArg.value.kind === "StringValue") {
75179
75327
  const { connection, type: connectionType } = connectionSelection(
75180
75328
  config2,
@@ -75293,7 +75441,7 @@ function artifactGenerator(stats) {
75293
75441
  return;
75294
75442
  }
75295
75443
  const nameArg = node.arguments?.find(
75296
- (arg) => arg.name.value === config2.listNameArg
75444
+ (arg) => arg.name.value === config2.listOrPaginateNameArg
75297
75445
  );
75298
75446
  if (!nameArg || nameArg.value.kind !== "StringValue") {
75299
75447
  throw new HoudiniError({
@@ -76663,7 +76811,9 @@ function listDefinitions(config2, body, docs) {
76663
76811
  if (![config2.listDirective, config2.paginateDirective].includes(node.name.value)) {
76664
76812
  return;
76665
76813
  }
76666
- const nameArg = node.arguments?.find((arg) => arg.name.value === "name");
76814
+ const nameArg = node.arguments?.find(
76815
+ (arg) => arg.name.value === config2.listOrPaginateNameArg
76816
+ );
76667
76817
  const nameValue = nameArg?.value?.value || "";
76668
76818
  if (!nameValue || visitedLists.has(nameValue)) {
76669
76819
  return;
@@ -76988,17 +77138,22 @@ enum CachePolicy {
76988
77138
  ${CachePolicy.NetworkOnly}
76989
77139
  }
76990
77140
 
77141
+ enum PaginateMode {
77142
+ ${PaginateMode.Infinite}
77143
+ ${PaginateMode.SinglePage}
77144
+ }
77145
+
76991
77146
  """
76992
77147
  @${config2.listDirective} is used to mark a field for the runtime as a place to add or remove
76993
77148
  entities in mutations
76994
77149
  """
76995
- directive @${config2.listDirective}(${config2.listNameArg}: String!, connection: Boolean) on FIELD
77150
+ directive @${config2.listDirective}(${config2.listOrPaginateNameArg}: String!, connection: Boolean) on FIELD
76996
77151
 
76997
77152
  """
76998
77153
  @${config2.paginateDirective} is used to to mark a field for pagination.
76999
77154
  More info in the [doc](${siteURL}/guides/pagination).
77000
77155
  """
77001
- directive @${config2.paginateDirective}(${config2.paginateNameArg}: String) on FIELD
77156
+ directive @${config2.paginateDirective}(${config2.listOrPaginateNameArg}: String, ${config2.paginateModeArg}: PaginateMode) on FIELD
77002
77157
 
77003
77158
  """
77004
77159
  @${config2.listPrependDirective} is used to tell the runtime to add the result to the end of the list
@@ -77264,7 +77419,7 @@ async function typeCheck(config2, docs) {
77264
77419
  }
77265
77420
  needsParent = needsParent || definition.kind === "FragmentDefinition";
77266
77421
  const nameArg = directive.arguments?.find(
77267
- ({ name }) => name.value === config2.listNameArg
77422
+ ({ name }) => name.value === config2.listOrPaginateNameArg
77268
77423
  );
77269
77424
  if (!nameArg) {
77270
77425
  if (directive.name.value === config2.listDirective) {
@@ -77744,7 +77899,14 @@ function paginateArgs(config2, filepath) {
77744
77899
  )
77745
77900
  );
77746
77901
  }
77747
- if (forward && backwards) {
77902
+ const paginateModeArg = node?.arguments?.find(
77903
+ (arg) => arg.name.value === config2.paginateModeArg
77904
+ );
77905
+ let paginateMode = config2.defaultPaginateMode;
77906
+ if (paginateModeArg && paginateModeArg.value.kind === "EnumValue") {
77907
+ paginateMode = paginateModeArg.value.value;
77908
+ }
77909
+ if (forward && backwards && paginateMode === "Infinite") {
77748
77910
  ctx.reportError(
77749
77911
  new graphql25.GraphQLError(
77750
77912
  `A field with cursor pagination cannot go forwards an backwards simultaneously`
@@ -78522,15 +78684,15 @@ async function init(_path, args) {
78522
78684
  module: module2,
78523
78685
  url: is_remote_endpoint ? url : null
78524
78686
  });
78525
- await fs_exports.writeFile(houdiniClientPath, networkFile(url, typescript));
78687
+ await fs_exports.writeFile(houdiniClientPath, networkFile(url));
78526
78688
  await graphqlRCFile(targetPath);
78527
78689
  await gitIgnore(targetPath);
78528
78690
  if (framework === "kit") {
78529
78691
  await updateSvelteConfig(targetPath, typescript);
78530
78692
  } else if (framework === "svelte") {
78531
- await updateSvelteMainJs(targetPath);
78693
+ await updateSvelteMainJs(targetPath, typescript);
78532
78694
  }
78533
- await updateViteConfig(targetPath, framework);
78695
+ await updateViteConfig(targetPath, framework, typescript);
78534
78696
  await tjsConfig(targetPath, framework);
78535
78697
  console.log();
78536
78698
  console.log("\u{1F3A9} Welcome to Houdini!");
@@ -78549,16 +78711,16 @@ async function init(_path, args) {
78549
78711
  2\uFE0F\u20E3 Start your application: ${logGreen(cmd_run)}
78550
78712
  `);
78551
78713
  }
78552
- var networkFile = (url, typescript) => `import { HoudiniClient${typescript ? ", type RequestHandler" : ""} } from '$houdini';
78714
+ var networkFile = (url) => `import { HoudiniClient } from '$houdini';
78553
78715
 
78554
78716
  export default new HoudiniClient({
78555
78717
  url: '${url}'
78556
-
78718
+
78557
78719
  // uncomment this to configure the network call (for things like authentication)
78558
- // for more information, please visit here: https://www.houdinigraphql.com/guides/authentication
78720
+ // for more information, please visit here: https://www.houdinigraphql.com/guides/authentication
78559
78721
  // fetchParams({ session }) {
78560
78722
  // return {
78561
- // headers: {
78723
+ // headers: {
78562
78724
  // Authentication: \`Bearer \${session.token}\`,
78563
78725
  // }
78564
78726
  // }
@@ -78637,27 +78799,30 @@ async function tjsConfig(targetPath, framework) {
78637
78799
  }
78638
78800
  return false;
78639
78801
  }
78640
- async function updateViteConfig(targetPath, framework) {
78641
- const viteConfigPath = path_exports.join(targetPath, "vite.config.js");
78642
- const viteConfigKit = `import { sveltekit } from '@sveltejs/kit/vite';
78643
- import houdini from 'houdini/vite';
78644
-
78645
- /** @type {import('vite').UserConfig} */
78646
- const config = {
78647
- plugins: [houdini(), sveltekit()],
78648
- }
78649
-
78650
- export default config;
78802
+ async function updateViteConfig(targetPath, framework, typescript) {
78803
+ const viteConfigPath = path_exports.join(targetPath, typescript ? "vite.config.ts" : "vite.config.js");
78804
+ const viteConfigKit = `import { sveltekit } from '@sveltejs/kit/vite'
78805
+ import houdini from 'houdini/vite'
78806
+ import { defineConfig } from 'vite'
78807
+
78808
+ export default defineConfig({
78809
+ plugins: [houdini(), sveltekit()]
78810
+ });
78651
78811
  `;
78652
- const viteConfigSvelte = `import { svelte } from '@sveltejs/vite-plugin-svelte';
78653
- import houdini from 'houdini/vite';
78812
+ const viteConfigSvelte = `import { svelte } from '@sveltejs/vite-plugin-svelte'
78813
+ import houdini from 'houdini/vite'
78814
+ import * as path from 'path'
78815
+ import { defineConfig } from 'vite'
78654
78816
 
78655
- /** @type {import('vite').UserConfig} */
78656
- const config = {
78817
+ export default defineConfig({
78657
78818
  plugins: [houdini(), svelte()],
78658
- }
78659
78819
 
78660
- export default config;
78820
+ resolve: {
78821
+ alias: {
78822
+ $houdini: path.resolve('$houdini'),
78823
+ },
78824
+ },
78825
+ })
78661
78826
  `;
78662
78827
  let content;
78663
78828
  if (framework === "kit") {
@@ -78712,12 +78877,11 @@ export default config;
78712
78877
  content: typescript ? newContentTs : newContentJs
78713
78878
  });
78714
78879
  }
78715
- async function updateSvelteMainJs(targetPath) {
78716
- const svelteMainJsPath = path_exports.join(targetPath, "main.js");
78717
- const newContent = `import client from "../client";
78880
+ async function updateSvelteMainJs(targetPath, typescript) {
78881
+ const svelteMainJsPath = path_exports.join(targetPath, "src", typescript ? "main.ts" : "main.js");
78882
+ const newContent = `import client from "./client";
78718
78883
  import './app.css'
78719
78884
  import App from './App.svelte'
78720
- import { logGreen } from '@kitql/helper'
78721
78885
 
78722
78886
  client.init();
78723
78887
 
@@ -78741,8 +78905,8 @@ async function updatePackageJSON(targetPath) {
78741
78905
  }
78742
78906
  packageJSON.devDependencies = {
78743
78907
  ...packageJSON.devDependencies,
78744
- houdini: "^1.0.7",
78745
- "houdini-svelte": "^1.0.7"
78908
+ houdini: "^1.0.9",
78909
+ "houdini-svelte": "^1.0.9"
78746
78910
  };
78747
78911
  await fs_exports.writeFile(packagePath, JSON.stringify(packageJSON, null, 4));
78748
78912
  }
@@ -78770,50 +78934,6 @@ async function gitIgnore(targetPath) {
78770
78934
  await fs_exports.writeFile(filepath, existing + "\n$houdini\n");
78771
78935
  }
78772
78936
  }
78773
- async function detectTools(cwd) {
78774
- try {
78775
- const packageJSONFile = await fs_exports.readFile(path_exports.join(cwd, "package.json"));
78776
- if (packageJSONFile) {
78777
- var packageJSON = JSON.parse(packageJSONFile);
78778
- } else {
78779
- throw new Error("not found");
78780
- }
78781
- } catch {
78782
- throw new Error(
78783
- "\u274C houdini init must target an existing node project (with a package.json)"
78784
- );
78785
- }
78786
- const { devDependencies, dependencies } = packageJSON;
78787
- const hasDependency = (dep) => Boolean(devDependencies?.[dep] || dependencies?.[dep]);
78788
- let framework = "svelte";
78789
- if (hasDependency("@sveltejs/kit")) {
78790
- framework = "kit";
78791
- }
78792
- let typescript = false;
78793
- try {
78794
- await fs_exports.stat(path_exports.join(cwd, "tsconfig.json"));
78795
- typescript = true;
78796
- } catch {
78797
- }
78798
- let package_manager = "npm";
78799
- let dir = cwd;
78800
- do {
78801
- if (fs_exports.existsSync(path_exports.join(dir, "pnpm-lock.yaml"))) {
78802
- package_manager = "pnpm";
78803
- break;
78804
- }
78805
- if (fs_exports.existsSync(path_exports.join(dir, "yarn.lock"))) {
78806
- package_manager = "yarn";
78807
- break;
78808
- }
78809
- } while (dir !== (dir = path_exports.dirname(dir)));
78810
- return {
78811
- typescript,
78812
- framework,
78813
- module: packageJSON["type"] === "module" ? "esm" : "commonjs",
78814
- package_manager
78815
- };
78816
- }
78817
78937
  async function updateFile({ filepath, content }) {
78818
78938
  await fs_exports.writeFile(filepath, content);
78819
78939
  }