houdini 0.17.5 → 0.17.6
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/.turbo/turbo-compile.log +2 -2
- package/.turbo/turbo-typedefs.log +2 -2
- package/CHANGELOG.md +12 -0
- package/build/cmd/init.d.ts +2 -2
- package/build/cmd-cjs/index.js +222 -188
- package/build/cmd-esm/index.js +222 -188
- package/build/codegen-cjs/index.js +84 -31
- package/build/codegen-esm/index.js +84 -31
- package/build/lib/constants.d.ts +7 -0
- package/build/lib/fs.d.ts +2 -0
- package/build/lib-cjs/index.js +87 -32
- package/build/lib-esm/index.js +86 -32
- package/build/runtime/cache/subscription.d.ts +2 -1
- package/build/runtime/lib/network.d.ts +4 -2
- package/build/runtime-cjs/cache/cache.js +5 -3
- package/build/runtime-cjs/cache/subscription.d.ts +2 -1
- package/build/runtime-cjs/cache/subscription.js +6 -4
- package/build/runtime-cjs/cache/tests/subscriptions.test.js +101 -0
- package/build/runtime-cjs/lib/network.d.ts +4 -2
- package/build/runtime-cjs/lib/network.js +8 -4
- package/build/runtime-esm/cache/cache.js +5 -3
- package/build/runtime-esm/cache/subscription.d.ts +2 -1
- package/build/runtime-esm/cache/subscription.js +6 -4
- package/build/runtime-esm/cache/tests/subscriptions.test.js +101 -0
- package/build/runtime-esm/lib/network.d.ts +4 -2
- package/build/runtime-esm/lib/network.js +8 -4
- package/build/test-cjs/index.js +86 -33
- package/build/test-esm/index.js +86 -33
- package/build/vite-cjs/index.js +86 -33
- package/build/vite-esm/index.js +86 -33
- package/package.json +1 -1
- package/src/cmd/init.ts +169 -187
- package/src/codegen/generators/runtime/index.ts +2 -2
- package/src/lib/config.ts +3 -2
- package/src/lib/constants.ts +10 -0
- package/src/lib/fs.ts +59 -12
- package/src/runtime/cache/cache.ts +3 -1
- package/src/runtime/cache/subscription.ts +6 -4
- package/src/runtime/cache/tests/subscriptions.test.ts +115 -0
- package/src/runtime/lib/network.ts +11 -5
package/build/vite-cjs/index.js
CHANGED
|
@@ -18745,8 +18745,8 @@ var require_graceful_fs = __commonJS({
|
|
|
18745
18745
|
}
|
|
18746
18746
|
var fs$copyFile = fs4.copyFile;
|
|
18747
18747
|
if (fs$copyFile)
|
|
18748
|
-
fs4.copyFile =
|
|
18749
|
-
function
|
|
18748
|
+
fs4.copyFile = copyFile2;
|
|
18749
|
+
function copyFile2(src, dest, flags, cb) {
|
|
18750
18750
|
if (typeof flags === "function") {
|
|
18751
18751
|
cb = flags;
|
|
18752
18752
|
flags = 0;
|
|
@@ -19419,7 +19419,7 @@ var require_copy = __commonJS({
|
|
|
19419
19419
|
}
|
|
19420
19420
|
function onFile(srcStat, destStat, src, dest, opts, cb) {
|
|
19421
19421
|
if (!destStat)
|
|
19422
|
-
return
|
|
19422
|
+
return copyFile2(srcStat, src, dest, opts, cb);
|
|
19423
19423
|
return mayCopyFile(srcStat, src, dest, opts, cb);
|
|
19424
19424
|
}
|
|
19425
19425
|
function mayCopyFile(srcStat, src, dest, opts, cb) {
|
|
@@ -19427,14 +19427,14 @@ var require_copy = __commonJS({
|
|
|
19427
19427
|
fs3.unlink(dest, (err) => {
|
|
19428
19428
|
if (err)
|
|
19429
19429
|
return cb(err);
|
|
19430
|
-
return
|
|
19430
|
+
return copyFile2(srcStat, src, dest, opts, cb);
|
|
19431
19431
|
});
|
|
19432
19432
|
} else if (opts.errorOnExist) {
|
|
19433
19433
|
return cb(new Error(`'${dest}' already exists`));
|
|
19434
19434
|
} else
|
|
19435
19435
|
return cb();
|
|
19436
19436
|
}
|
|
19437
|
-
function
|
|
19437
|
+
function copyFile2(srcStat, src, dest, opts, cb) {
|
|
19438
19438
|
fs3.copyFile(src, dest, (err) => {
|
|
19439
19439
|
if (err)
|
|
19440
19440
|
return cb(err);
|
|
@@ -19617,18 +19617,18 @@ var require_copy_sync = __commonJS({
|
|
|
19617
19617
|
}
|
|
19618
19618
|
function onFile(srcStat, destStat, src, dest, opts) {
|
|
19619
19619
|
if (!destStat)
|
|
19620
|
-
return
|
|
19620
|
+
return copyFile2(srcStat, src, dest, opts);
|
|
19621
19621
|
return mayCopyFile(srcStat, src, dest, opts);
|
|
19622
19622
|
}
|
|
19623
19623
|
function mayCopyFile(srcStat, src, dest, opts) {
|
|
19624
19624
|
if (opts.overwrite) {
|
|
19625
19625
|
fs3.unlinkSync(dest);
|
|
19626
|
-
return
|
|
19626
|
+
return copyFile2(srcStat, src, dest, opts);
|
|
19627
19627
|
} else if (opts.errorOnExist) {
|
|
19628
19628
|
throw new Error(`'${dest}' already exists`);
|
|
19629
19629
|
}
|
|
19630
19630
|
}
|
|
19631
|
-
function
|
|
19631
|
+
function copyFile2(srcStat, src, dest, opts) {
|
|
19632
19632
|
fs3.copyFileSync(src, dest);
|
|
19633
19633
|
if (opts.preserveTimestamps)
|
|
19634
19634
|
handleTimestamps(srcStat.mode, src, dest);
|
|
@@ -64776,10 +64776,11 @@ var InMemorySubscriptions = class {
|
|
|
64776
64776
|
parent,
|
|
64777
64777
|
selection: selection2,
|
|
64778
64778
|
variables,
|
|
64779
|
-
subscribers
|
|
64779
|
+
subscribers,
|
|
64780
|
+
parentType
|
|
64780
64781
|
}) {
|
|
64781
64782
|
for (const fieldSelection of Object.values(selection2)) {
|
|
64782
|
-
const { keyRaw, fields } = fieldSelection;
|
|
64783
|
+
const { type: linkedType, keyRaw, fields } = fieldSelection;
|
|
64783
64784
|
const key = evaluateKey(keyRaw, variables);
|
|
64784
64785
|
for (const spec of subscribers) {
|
|
64785
64786
|
this.addFieldSubscription({
|
|
@@ -64787,7 +64788,7 @@ var InMemorySubscriptions = class {
|
|
|
64787
64788
|
key,
|
|
64788
64789
|
selection: fieldSelection,
|
|
64789
64790
|
spec,
|
|
64790
|
-
parentType
|
|
64791
|
+
parentType,
|
|
64791
64792
|
variables
|
|
64792
64793
|
});
|
|
64793
64794
|
}
|
|
@@ -64802,7 +64803,8 @@ var InMemorySubscriptions = class {
|
|
|
64802
64803
|
parent: linkedRecord,
|
|
64803
64804
|
selection: fields,
|
|
64804
64805
|
variables,
|
|
64805
|
-
subscribers
|
|
64806
|
+
subscribers,
|
|
64807
|
+
parentType: linkedType
|
|
64806
64808
|
});
|
|
64807
64809
|
}
|
|
64808
64810
|
}
|
|
@@ -64982,7 +64984,7 @@ var CacheInternal = class {
|
|
|
64982
64984
|
this.cache = cache;
|
|
64983
64985
|
this.lifetimes = lifetimes;
|
|
64984
64986
|
try {
|
|
64985
|
-
this._disabled = process.env.
|
|
64987
|
+
this._disabled = process.env.HOUDINI_TEST !== "true";
|
|
64986
64988
|
} catch {
|
|
64987
64989
|
this._disabled = typeof globalThis.window === "undefined";
|
|
64988
64990
|
}
|
|
@@ -65080,7 +65082,8 @@ var CacheInternal = class {
|
|
|
65080
65082
|
parent: linkedID,
|
|
65081
65083
|
selection: fields,
|
|
65082
65084
|
subscribers: currentSubscribers,
|
|
65083
|
-
variables
|
|
65085
|
+
variables,
|
|
65086
|
+
parentType: linkedType
|
|
65084
65087
|
});
|
|
65085
65088
|
toNotify.push(...currentSubscribers);
|
|
65086
65089
|
}
|
|
@@ -65186,7 +65189,8 @@ var CacheInternal = class {
|
|
|
65186
65189
|
parent: id,
|
|
65187
65190
|
selection: fields,
|
|
65188
65191
|
subscribers: currentSubscribers,
|
|
65189
|
-
variables
|
|
65192
|
+
variables,
|
|
65193
|
+
parentType: linkedType
|
|
65190
65194
|
});
|
|
65191
65195
|
}
|
|
65192
65196
|
}
|
|
@@ -65471,6 +65475,14 @@ var CompiledMutationKind = "HoudiniMutation" /* Mutation */;
|
|
|
65471
65475
|
var CompiledQueryKind = "HoudiniQuery" /* Query */;
|
|
65472
65476
|
var CompiledSubscriptionKind = "HoudiniSubscription" /* Subscription */;
|
|
65473
65477
|
|
|
65478
|
+
// src/lib/constants.ts
|
|
65479
|
+
var siteURL = "https://houdinigraphql.com";
|
|
65480
|
+
var houdini_mode = {
|
|
65481
|
+
get is_testing() {
|
|
65482
|
+
return process.env.HOUDINI_TEST === "true";
|
|
65483
|
+
}
|
|
65484
|
+
};
|
|
65485
|
+
|
|
65474
65486
|
// src/lib/error.ts
|
|
65475
65487
|
var HoudiniError = class extends Error {
|
|
65476
65488
|
filepath = null;
|
|
@@ -65494,6 +65506,8 @@ var HoudiniError = class extends Error {
|
|
|
65494
65506
|
var fs_exports = {};
|
|
65495
65507
|
__export(fs_exports, {
|
|
65496
65508
|
access: () => access,
|
|
65509
|
+
copyFile: () => copyFile,
|
|
65510
|
+
copyFileSync: () => copyFileSync,
|
|
65497
65511
|
existsSync: () => existsSync,
|
|
65498
65512
|
glob: () => glob,
|
|
65499
65513
|
mkdir: () => mkdir,
|
|
@@ -65563,8 +65577,50 @@ function importPath(target) {
|
|
|
65563
65577
|
}
|
|
65564
65578
|
|
|
65565
65579
|
// src/lib/fs.ts
|
|
65580
|
+
function copyFileSync(src, dest) {
|
|
65581
|
+
if (houdini_mode.is_testing) {
|
|
65582
|
+
try {
|
|
65583
|
+
if (src.includes("build/runtime") || dest.includes("build/runtime")) {
|
|
65584
|
+
import_fs_extra.default.copyFileSync(src, dest);
|
|
65585
|
+
return;
|
|
65586
|
+
}
|
|
65587
|
+
import_memfs.fs.copyFileSync(src, dest);
|
|
65588
|
+
return;
|
|
65589
|
+
} catch (e2) {
|
|
65590
|
+
return null;
|
|
65591
|
+
}
|
|
65592
|
+
}
|
|
65593
|
+
try {
|
|
65594
|
+
import_fs_extra.default.copyFileSync(src, dest);
|
|
65595
|
+
return;
|
|
65596
|
+
} catch (e2) {
|
|
65597
|
+
}
|
|
65598
|
+
return null;
|
|
65599
|
+
}
|
|
65600
|
+
async function copyFile(src, dest) {
|
|
65601
|
+
if (houdini_mode.is_testing) {
|
|
65602
|
+
try {
|
|
65603
|
+
if (src.includes("build/runtime") || dest.includes("build/runtime")) {
|
|
65604
|
+
await import_promises.default.copyFile(src, dest);
|
|
65605
|
+
return;
|
|
65606
|
+
}
|
|
65607
|
+
await import_memfs.fs.copyFile(src, dest, (err) => {
|
|
65608
|
+
throw err;
|
|
65609
|
+
});
|
|
65610
|
+
return;
|
|
65611
|
+
} catch (e2) {
|
|
65612
|
+
return null;
|
|
65613
|
+
}
|
|
65614
|
+
}
|
|
65615
|
+
try {
|
|
65616
|
+
await import_promises.default.copyFile(src, dest);
|
|
65617
|
+
return;
|
|
65618
|
+
} catch (e2) {
|
|
65619
|
+
}
|
|
65620
|
+
return null;
|
|
65621
|
+
}
|
|
65566
65622
|
async function readFile(filepath) {
|
|
65567
|
-
if (
|
|
65623
|
+
if (houdini_mode.is_testing) {
|
|
65568
65624
|
try {
|
|
65569
65625
|
if (filepath.includes("build/runtime")) {
|
|
65570
65626
|
return await import_promises.default.readFile(filepath, "utf-8");
|
|
@@ -65581,7 +65637,7 @@ async function readFile(filepath) {
|
|
|
65581
65637
|
return null;
|
|
65582
65638
|
}
|
|
65583
65639
|
function readFileSync(filepath) {
|
|
65584
|
-
if (
|
|
65640
|
+
if (houdini_mode.is_testing) {
|
|
65585
65641
|
try {
|
|
65586
65642
|
if (filepath.includes("build/runtime")) {
|
|
65587
65643
|
return import_fs_extra.default.readFileSync(filepath, "utf-8");
|
|
@@ -65602,13 +65658,13 @@ async function writeFile(filepath, data) {
|
|
|
65602
65658
|
if (data === existingFileData) {
|
|
65603
65659
|
return;
|
|
65604
65660
|
}
|
|
65605
|
-
if (
|
|
65661
|
+
if (houdini_mode.is_testing) {
|
|
65606
65662
|
return import_memfs.fs.writeFileSync(filepath, data);
|
|
65607
65663
|
}
|
|
65608
65664
|
return await import_promises.default.writeFile(filepath, data, "utf8");
|
|
65609
65665
|
}
|
|
65610
65666
|
async function access(filepath) {
|
|
65611
|
-
if (
|
|
65667
|
+
if (!houdini_mode.is_testing) {
|
|
65612
65668
|
return await import_promises.default.access(filepath);
|
|
65613
65669
|
}
|
|
65614
65670
|
if (filepath.includes("build/runtime")) {
|
|
@@ -65617,25 +65673,25 @@ async function access(filepath) {
|
|
|
65617
65673
|
return import_memfs.fs.statSync(filepath);
|
|
65618
65674
|
}
|
|
65619
65675
|
async function mkdirp(filepath) {
|
|
65620
|
-
if (
|
|
65676
|
+
if (!houdini_mode.is_testing) {
|
|
65621
65677
|
return await import_fs_extra.default.mkdirp(filepath);
|
|
65622
65678
|
}
|
|
65623
65679
|
return import_memfs.fs.mkdirpSync(filepath);
|
|
65624
65680
|
}
|
|
65625
65681
|
async function mkdirpSync(filepath) {
|
|
65626
|
-
if (
|
|
65682
|
+
if (!houdini_mode.is_testing) {
|
|
65627
65683
|
return import_fs_extra.default.mkdirpSync(filepath);
|
|
65628
65684
|
}
|
|
65629
65685
|
return import_memfs.fs.mkdirpSync(filepath);
|
|
65630
65686
|
}
|
|
65631
65687
|
async function mkdir(filepath) {
|
|
65632
|
-
if (
|
|
65688
|
+
if (!houdini_mode.is_testing) {
|
|
65633
65689
|
return await import_promises.default.mkdir(filepath);
|
|
65634
65690
|
}
|
|
65635
65691
|
return import_memfs.fs.mkdirSync(filepath);
|
|
65636
65692
|
}
|
|
65637
65693
|
async function rmdir(filepath) {
|
|
65638
|
-
if (
|
|
65694
|
+
if (!houdini_mode.is_testing) {
|
|
65639
65695
|
return await import_promises.default.rm(filepath, {
|
|
65640
65696
|
recursive: true
|
|
65641
65697
|
});
|
|
@@ -65643,7 +65699,7 @@ async function rmdir(filepath) {
|
|
|
65643
65699
|
return await (0, import_util.promisify)(import_memfs.fs.rmdir)(filepath);
|
|
65644
65700
|
}
|
|
65645
65701
|
async function stat(filepath) {
|
|
65646
|
-
if (
|
|
65702
|
+
if (!houdini_mode.is_testing) {
|
|
65647
65703
|
return await import_promises.default.stat(filepath);
|
|
65648
65704
|
}
|
|
65649
65705
|
if (filepath.includes("build/runtime")) {
|
|
@@ -65652,13 +65708,13 @@ async function stat(filepath) {
|
|
|
65652
65708
|
return import_memfs.fs.statSync(filepath);
|
|
65653
65709
|
}
|
|
65654
65710
|
function existsSync(dirPath) {
|
|
65655
|
-
if (
|
|
65711
|
+
if (!houdini_mode.is_testing) {
|
|
65656
65712
|
return import_fs_extra.default.existsSync(dirPath);
|
|
65657
65713
|
}
|
|
65658
65714
|
return import_memfs.fs.existsSync(dirPath);
|
|
65659
65715
|
}
|
|
65660
65716
|
async function readdir(filepath) {
|
|
65661
|
-
if (
|
|
65717
|
+
if (!houdini_mode.is_testing) {
|
|
65662
65718
|
return await import_promises.default.readdir(filepath);
|
|
65663
65719
|
}
|
|
65664
65720
|
if (filepath.includes("build/runtime")) {
|
|
@@ -65671,7 +65727,7 @@ async function readdir(filepath) {
|
|
|
65671
65727
|
}
|
|
65672
65728
|
}
|
|
65673
65729
|
async function remove(filepath) {
|
|
65674
|
-
if (
|
|
65730
|
+
if (!houdini_mode.is_testing) {
|
|
65675
65731
|
return await import_promises.default.rm(filepath);
|
|
65676
65732
|
}
|
|
65677
65733
|
return import_memfs.vol.rmSync(filepath);
|
|
@@ -67145,7 +67201,7 @@ var Config = class {
|
|
|
67145
67201
|
return locationFound;
|
|
67146
67202
|
}
|
|
67147
67203
|
get runtimeSource() {
|
|
67148
|
-
const relative2 =
|
|
67204
|
+
const relative2 = houdini_mode.is_testing ? join2(currentDir, "..", "..") : this.findModule();
|
|
67149
67205
|
const which = this.module === "esm" ? "esm" : "cjs";
|
|
67150
67206
|
return resolve(relative2, "build", `runtime-${which}`);
|
|
67151
67207
|
}
|
|
@@ -67223,7 +67279,7 @@ var Config = class {
|
|
|
67223
67279
|
return join2(this.pluginDirectory(name2), "runtime");
|
|
67224
67280
|
}
|
|
67225
67281
|
pluginDirectory(name2) {
|
|
67226
|
-
return
|
|
67282
|
+
return houdini_mode.is_testing ? resolve("../../../", name2) : join2(this.rootDir, "plugins", name2);
|
|
67227
67283
|
}
|
|
67228
67284
|
get houdiniDirective() {
|
|
67229
67285
|
return "houdini";
|
|
@@ -67685,9 +67741,6 @@ function ensureImports({
|
|
|
67685
67741
|
return Array.isArray(importID) ? toImport : toImport[0];
|
|
67686
67742
|
}
|
|
67687
67743
|
|
|
67688
|
-
// src/lib/constants.ts
|
|
67689
|
-
var siteURL = "https://houdinigraphql.com";
|
|
67690
|
-
|
|
67691
67744
|
// src/lib/cleanupFiles.ts
|
|
67692
67745
|
async function cleanupFiles(pathFolder, listOfObj) {
|
|
67693
67746
|
const listFile = await readdir(pathFolder);
|
|
@@ -69698,7 +69751,7 @@ async function runtimeGenerator(config3) {
|
|
|
69698
69751
|
]);
|
|
69699
69752
|
}
|
|
69700
69753
|
async function generatePluginRuntime(config3, plugin) {
|
|
69701
|
-
if (
|
|
69754
|
+
if (houdini_mode.is_testing) {
|
|
69702
69755
|
return;
|
|
69703
69756
|
}
|
|
69704
69757
|
const source = path_exports.join(
|
package/build/vite-esm/index.js
CHANGED
|
@@ -18750,8 +18750,8 @@ var require_graceful_fs = __commonJS({
|
|
|
18750
18750
|
}
|
|
18751
18751
|
var fs$copyFile = fs4.copyFile;
|
|
18752
18752
|
if (fs$copyFile)
|
|
18753
|
-
fs4.copyFile =
|
|
18754
|
-
function
|
|
18753
|
+
fs4.copyFile = copyFile2;
|
|
18754
|
+
function copyFile2(src, dest, flags, cb) {
|
|
18755
18755
|
if (typeof flags === "function") {
|
|
18756
18756
|
cb = flags;
|
|
18757
18757
|
flags = 0;
|
|
@@ -19424,7 +19424,7 @@ var require_copy = __commonJS({
|
|
|
19424
19424
|
}
|
|
19425
19425
|
function onFile(srcStat, destStat, src, dest, opts, cb) {
|
|
19426
19426
|
if (!destStat)
|
|
19427
|
-
return
|
|
19427
|
+
return copyFile2(srcStat, src, dest, opts, cb);
|
|
19428
19428
|
return mayCopyFile(srcStat, src, dest, opts, cb);
|
|
19429
19429
|
}
|
|
19430
19430
|
function mayCopyFile(srcStat, src, dest, opts, cb) {
|
|
@@ -19432,14 +19432,14 @@ var require_copy = __commonJS({
|
|
|
19432
19432
|
fs3.unlink(dest, (err) => {
|
|
19433
19433
|
if (err)
|
|
19434
19434
|
return cb(err);
|
|
19435
|
-
return
|
|
19435
|
+
return copyFile2(srcStat, src, dest, opts, cb);
|
|
19436
19436
|
});
|
|
19437
19437
|
} else if (opts.errorOnExist) {
|
|
19438
19438
|
return cb(new Error(`'${dest}' already exists`));
|
|
19439
19439
|
} else
|
|
19440
19440
|
return cb();
|
|
19441
19441
|
}
|
|
19442
|
-
function
|
|
19442
|
+
function copyFile2(srcStat, src, dest, opts, cb) {
|
|
19443
19443
|
fs3.copyFile(src, dest, (err) => {
|
|
19444
19444
|
if (err)
|
|
19445
19445
|
return cb(err);
|
|
@@ -19622,18 +19622,18 @@ var require_copy_sync = __commonJS({
|
|
|
19622
19622
|
}
|
|
19623
19623
|
function onFile(srcStat, destStat, src, dest, opts) {
|
|
19624
19624
|
if (!destStat)
|
|
19625
|
-
return
|
|
19625
|
+
return copyFile2(srcStat, src, dest, opts);
|
|
19626
19626
|
return mayCopyFile(srcStat, src, dest, opts);
|
|
19627
19627
|
}
|
|
19628
19628
|
function mayCopyFile(srcStat, src, dest, opts) {
|
|
19629
19629
|
if (opts.overwrite) {
|
|
19630
19630
|
fs3.unlinkSync(dest);
|
|
19631
|
-
return
|
|
19631
|
+
return copyFile2(srcStat, src, dest, opts);
|
|
19632
19632
|
} else if (opts.errorOnExist) {
|
|
19633
19633
|
throw new Error(`'${dest}' already exists`);
|
|
19634
19634
|
}
|
|
19635
19635
|
}
|
|
19636
|
-
function
|
|
19636
|
+
function copyFile2(srcStat, src, dest, opts) {
|
|
19637
19637
|
fs3.copyFileSync(src, dest);
|
|
19638
19638
|
if (opts.preserveTimestamps)
|
|
19639
19639
|
handleTimestamps(srcStat.mode, src, dest);
|
|
@@ -64771,10 +64771,11 @@ var InMemorySubscriptions = class {
|
|
|
64771
64771
|
parent,
|
|
64772
64772
|
selection: selection2,
|
|
64773
64773
|
variables,
|
|
64774
|
-
subscribers
|
|
64774
|
+
subscribers,
|
|
64775
|
+
parentType
|
|
64775
64776
|
}) {
|
|
64776
64777
|
for (const fieldSelection of Object.values(selection2)) {
|
|
64777
|
-
const { keyRaw, fields } = fieldSelection;
|
|
64778
|
+
const { type: linkedType, keyRaw, fields } = fieldSelection;
|
|
64778
64779
|
const key = evaluateKey(keyRaw, variables);
|
|
64779
64780
|
for (const spec of subscribers) {
|
|
64780
64781
|
this.addFieldSubscription({
|
|
@@ -64782,7 +64783,7 @@ var InMemorySubscriptions = class {
|
|
|
64782
64783
|
key,
|
|
64783
64784
|
selection: fieldSelection,
|
|
64784
64785
|
spec,
|
|
64785
|
-
parentType
|
|
64786
|
+
parentType,
|
|
64786
64787
|
variables
|
|
64787
64788
|
});
|
|
64788
64789
|
}
|
|
@@ -64797,7 +64798,8 @@ var InMemorySubscriptions = class {
|
|
|
64797
64798
|
parent: linkedRecord,
|
|
64798
64799
|
selection: fields,
|
|
64799
64800
|
variables,
|
|
64800
|
-
subscribers
|
|
64801
|
+
subscribers,
|
|
64802
|
+
parentType: linkedType
|
|
64801
64803
|
});
|
|
64802
64804
|
}
|
|
64803
64805
|
}
|
|
@@ -64977,7 +64979,7 @@ var CacheInternal = class {
|
|
|
64977
64979
|
this.cache = cache;
|
|
64978
64980
|
this.lifetimes = lifetimes;
|
|
64979
64981
|
try {
|
|
64980
|
-
this._disabled = process.env.
|
|
64982
|
+
this._disabled = process.env.HOUDINI_TEST !== "true";
|
|
64981
64983
|
} catch {
|
|
64982
64984
|
this._disabled = typeof globalThis.window === "undefined";
|
|
64983
64985
|
}
|
|
@@ -65075,7 +65077,8 @@ var CacheInternal = class {
|
|
|
65075
65077
|
parent: linkedID,
|
|
65076
65078
|
selection: fields,
|
|
65077
65079
|
subscribers: currentSubscribers,
|
|
65078
|
-
variables
|
|
65080
|
+
variables,
|
|
65081
|
+
parentType: linkedType
|
|
65079
65082
|
});
|
|
65080
65083
|
toNotify.push(...currentSubscribers);
|
|
65081
65084
|
}
|
|
@@ -65181,7 +65184,8 @@ var CacheInternal = class {
|
|
|
65181
65184
|
parent: id,
|
|
65182
65185
|
selection: fields,
|
|
65183
65186
|
subscribers: currentSubscribers,
|
|
65184
|
-
variables
|
|
65187
|
+
variables,
|
|
65188
|
+
parentType: linkedType
|
|
65185
65189
|
});
|
|
65186
65190
|
}
|
|
65187
65191
|
}
|
|
@@ -65466,6 +65470,14 @@ var CompiledMutationKind = "HoudiniMutation" /* Mutation */;
|
|
|
65466
65470
|
var CompiledQueryKind = "HoudiniQuery" /* Query */;
|
|
65467
65471
|
var CompiledSubscriptionKind = "HoudiniSubscription" /* Subscription */;
|
|
65468
65472
|
|
|
65473
|
+
// src/lib/constants.ts
|
|
65474
|
+
var siteURL = "https://houdinigraphql.com";
|
|
65475
|
+
var houdini_mode = {
|
|
65476
|
+
get is_testing() {
|
|
65477
|
+
return process.env.HOUDINI_TEST === "true";
|
|
65478
|
+
}
|
|
65479
|
+
};
|
|
65480
|
+
|
|
65469
65481
|
// src/lib/error.ts
|
|
65470
65482
|
var HoudiniError = class extends Error {
|
|
65471
65483
|
filepath = null;
|
|
@@ -65489,6 +65501,8 @@ var HoudiniError = class extends Error {
|
|
|
65489
65501
|
var fs_exports = {};
|
|
65490
65502
|
__export(fs_exports, {
|
|
65491
65503
|
access: () => access,
|
|
65504
|
+
copyFile: () => copyFile,
|
|
65505
|
+
copyFileSync: () => copyFileSync,
|
|
65492
65506
|
existsSync: () => existsSync,
|
|
65493
65507
|
glob: () => glob,
|
|
65494
65508
|
mkdir: () => mkdir,
|
|
@@ -65558,8 +65572,50 @@ function importPath(target) {
|
|
|
65558
65572
|
}
|
|
65559
65573
|
|
|
65560
65574
|
// src/lib/fs.ts
|
|
65575
|
+
function copyFileSync(src, dest) {
|
|
65576
|
+
if (houdini_mode.is_testing) {
|
|
65577
|
+
try {
|
|
65578
|
+
if (src.includes("build/runtime") || dest.includes("build/runtime")) {
|
|
65579
|
+
import_fs_extra.default.copyFileSync(src, dest);
|
|
65580
|
+
return;
|
|
65581
|
+
}
|
|
65582
|
+
import_memfs.fs.copyFileSync(src, dest);
|
|
65583
|
+
return;
|
|
65584
|
+
} catch (e2) {
|
|
65585
|
+
return null;
|
|
65586
|
+
}
|
|
65587
|
+
}
|
|
65588
|
+
try {
|
|
65589
|
+
import_fs_extra.default.copyFileSync(src, dest);
|
|
65590
|
+
return;
|
|
65591
|
+
} catch (e2) {
|
|
65592
|
+
}
|
|
65593
|
+
return null;
|
|
65594
|
+
}
|
|
65595
|
+
async function copyFile(src, dest) {
|
|
65596
|
+
if (houdini_mode.is_testing) {
|
|
65597
|
+
try {
|
|
65598
|
+
if (src.includes("build/runtime") || dest.includes("build/runtime")) {
|
|
65599
|
+
await fs.copyFile(src, dest);
|
|
65600
|
+
return;
|
|
65601
|
+
}
|
|
65602
|
+
await import_memfs.fs.copyFile(src, dest, (err) => {
|
|
65603
|
+
throw err;
|
|
65604
|
+
});
|
|
65605
|
+
return;
|
|
65606
|
+
} catch (e2) {
|
|
65607
|
+
return null;
|
|
65608
|
+
}
|
|
65609
|
+
}
|
|
65610
|
+
try {
|
|
65611
|
+
await fs.copyFile(src, dest);
|
|
65612
|
+
return;
|
|
65613
|
+
} catch (e2) {
|
|
65614
|
+
}
|
|
65615
|
+
return null;
|
|
65616
|
+
}
|
|
65561
65617
|
async function readFile(filepath) {
|
|
65562
|
-
if (
|
|
65618
|
+
if (houdini_mode.is_testing) {
|
|
65563
65619
|
try {
|
|
65564
65620
|
if (filepath.includes("build/runtime")) {
|
|
65565
65621
|
return await fs.readFile(filepath, "utf-8");
|
|
@@ -65576,7 +65632,7 @@ async function readFile(filepath) {
|
|
|
65576
65632
|
return null;
|
|
65577
65633
|
}
|
|
65578
65634
|
function readFileSync(filepath) {
|
|
65579
|
-
if (
|
|
65635
|
+
if (houdini_mode.is_testing) {
|
|
65580
65636
|
try {
|
|
65581
65637
|
if (filepath.includes("build/runtime")) {
|
|
65582
65638
|
return import_fs_extra.default.readFileSync(filepath, "utf-8");
|
|
@@ -65597,13 +65653,13 @@ async function writeFile(filepath, data) {
|
|
|
65597
65653
|
if (data === existingFileData) {
|
|
65598
65654
|
return;
|
|
65599
65655
|
}
|
|
65600
|
-
if (
|
|
65656
|
+
if (houdini_mode.is_testing) {
|
|
65601
65657
|
return import_memfs.fs.writeFileSync(filepath, data);
|
|
65602
65658
|
}
|
|
65603
65659
|
return await fs.writeFile(filepath, data, "utf8");
|
|
65604
65660
|
}
|
|
65605
65661
|
async function access(filepath) {
|
|
65606
|
-
if (
|
|
65662
|
+
if (!houdini_mode.is_testing) {
|
|
65607
65663
|
return await fs.access(filepath);
|
|
65608
65664
|
}
|
|
65609
65665
|
if (filepath.includes("build/runtime")) {
|
|
@@ -65612,25 +65668,25 @@ async function access(filepath) {
|
|
|
65612
65668
|
return import_memfs.fs.statSync(filepath);
|
|
65613
65669
|
}
|
|
65614
65670
|
async function mkdirp(filepath) {
|
|
65615
|
-
if (
|
|
65671
|
+
if (!houdini_mode.is_testing) {
|
|
65616
65672
|
return await import_fs_extra.default.mkdirp(filepath);
|
|
65617
65673
|
}
|
|
65618
65674
|
return import_memfs.fs.mkdirpSync(filepath);
|
|
65619
65675
|
}
|
|
65620
65676
|
async function mkdirpSync(filepath) {
|
|
65621
|
-
if (
|
|
65677
|
+
if (!houdini_mode.is_testing) {
|
|
65622
65678
|
return import_fs_extra.default.mkdirpSync(filepath);
|
|
65623
65679
|
}
|
|
65624
65680
|
return import_memfs.fs.mkdirpSync(filepath);
|
|
65625
65681
|
}
|
|
65626
65682
|
async function mkdir(filepath) {
|
|
65627
|
-
if (
|
|
65683
|
+
if (!houdini_mode.is_testing) {
|
|
65628
65684
|
return await fs.mkdir(filepath);
|
|
65629
65685
|
}
|
|
65630
65686
|
return import_memfs.fs.mkdirSync(filepath);
|
|
65631
65687
|
}
|
|
65632
65688
|
async function rmdir(filepath) {
|
|
65633
|
-
if (
|
|
65689
|
+
if (!houdini_mode.is_testing) {
|
|
65634
65690
|
return await fs.rm(filepath, {
|
|
65635
65691
|
recursive: true
|
|
65636
65692
|
});
|
|
@@ -65638,7 +65694,7 @@ async function rmdir(filepath) {
|
|
|
65638
65694
|
return await promisify(import_memfs.fs.rmdir)(filepath);
|
|
65639
65695
|
}
|
|
65640
65696
|
async function stat(filepath) {
|
|
65641
|
-
if (
|
|
65697
|
+
if (!houdini_mode.is_testing) {
|
|
65642
65698
|
return await fs.stat(filepath);
|
|
65643
65699
|
}
|
|
65644
65700
|
if (filepath.includes("build/runtime")) {
|
|
@@ -65647,13 +65703,13 @@ async function stat(filepath) {
|
|
|
65647
65703
|
return import_memfs.fs.statSync(filepath);
|
|
65648
65704
|
}
|
|
65649
65705
|
function existsSync(dirPath) {
|
|
65650
|
-
if (
|
|
65706
|
+
if (!houdini_mode.is_testing) {
|
|
65651
65707
|
return import_fs_extra.default.existsSync(dirPath);
|
|
65652
65708
|
}
|
|
65653
65709
|
return import_memfs.fs.existsSync(dirPath);
|
|
65654
65710
|
}
|
|
65655
65711
|
async function readdir(filepath) {
|
|
65656
|
-
if (
|
|
65712
|
+
if (!houdini_mode.is_testing) {
|
|
65657
65713
|
return await fs.readdir(filepath);
|
|
65658
65714
|
}
|
|
65659
65715
|
if (filepath.includes("build/runtime")) {
|
|
@@ -65666,7 +65722,7 @@ async function readdir(filepath) {
|
|
|
65666
65722
|
}
|
|
65667
65723
|
}
|
|
65668
65724
|
async function remove(filepath) {
|
|
65669
|
-
if (
|
|
65725
|
+
if (!houdini_mode.is_testing) {
|
|
65670
65726
|
return await fs.rm(filepath);
|
|
65671
65727
|
}
|
|
65672
65728
|
return import_memfs.vol.rmSync(filepath);
|
|
@@ -67139,7 +67195,7 @@ var Config = class {
|
|
|
67139
67195
|
return locationFound;
|
|
67140
67196
|
}
|
|
67141
67197
|
get runtimeSource() {
|
|
67142
|
-
const relative2 =
|
|
67198
|
+
const relative2 = houdini_mode.is_testing ? join2(currentDir, "..", "..") : this.findModule();
|
|
67143
67199
|
const which = this.module === "esm" ? "esm" : "cjs";
|
|
67144
67200
|
return resolve(relative2, "build", `runtime-${which}`);
|
|
67145
67201
|
}
|
|
@@ -67217,7 +67273,7 @@ var Config = class {
|
|
|
67217
67273
|
return join2(this.pluginDirectory(name2), "runtime");
|
|
67218
67274
|
}
|
|
67219
67275
|
pluginDirectory(name2) {
|
|
67220
|
-
return
|
|
67276
|
+
return houdini_mode.is_testing ? resolve("../../../", name2) : join2(this.rootDir, "plugins", name2);
|
|
67221
67277
|
}
|
|
67222
67278
|
get houdiniDirective() {
|
|
67223
67279
|
return "houdini";
|
|
@@ -67679,9 +67735,6 @@ function ensureImports({
|
|
|
67679
67735
|
return Array.isArray(importID) ? toImport : toImport[0];
|
|
67680
67736
|
}
|
|
67681
67737
|
|
|
67682
|
-
// src/lib/constants.ts
|
|
67683
|
-
var siteURL = "https://houdinigraphql.com";
|
|
67684
|
-
|
|
67685
67738
|
// src/lib/cleanupFiles.ts
|
|
67686
67739
|
async function cleanupFiles(pathFolder, listOfObj) {
|
|
67687
67740
|
const listFile = await readdir(pathFolder);
|
|
@@ -69692,7 +69745,7 @@ async function runtimeGenerator(config3) {
|
|
|
69692
69745
|
]);
|
|
69693
69746
|
}
|
|
69694
69747
|
async function generatePluginRuntime(config3, plugin) {
|
|
69695
|
-
if (
|
|
69748
|
+
if (houdini_mode.is_testing) {
|
|
69696
69749
|
return;
|
|
69697
69750
|
}
|
|
69698
69751
|
const source = path_exports.join(
|