houdini 0.17.8 → 0.17.10
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/README.md +33 -0
- package/build/cmd-cjs/index.js +124 -38
- package/build/cmd-esm/index.js +124 -38
- package/build/codegen-cjs/index.js +112 -36
- package/build/codegen-esm/index.js +112 -36
- package/build/lib/config.d.ts +3 -0
- package/build/lib-cjs/index.js +31 -12
- package/build/lib-esm/index.js +31 -12
- package/build/runtime/cache/cache.d.ts +1 -1
- package/build/runtime/cache/lists.d.ts +1 -1
- package/build/runtime/lib/config.d.ts +10 -2
- package/build/runtime/lib/types.d.ts +1 -0
- package/build/runtime-cjs/cache/cache.d.ts +1 -1
- package/build/runtime-cjs/cache/cache.js +6 -6
- package/build/runtime-cjs/cache/lists.d.ts +1 -1
- package/build/runtime-cjs/cache/lists.js +15 -6
- package/build/runtime-cjs/cache/tests/list.test.js +160 -70
- package/build/runtime-cjs/lib/config.d.ts +10 -2
- package/build/runtime-cjs/lib/types.d.ts +1 -0
- package/build/runtime-esm/cache/cache.d.ts +1 -1
- package/build/runtime-esm/cache/cache.js +6 -6
- package/build/runtime-esm/cache/lists.d.ts +1 -1
- package/build/runtime-esm/cache/lists.js +15 -6
- package/build/runtime-esm/cache/tests/list.test.js +160 -70
- package/build/runtime-esm/lib/config.d.ts +10 -2
- package/build/runtime-esm/lib/types.d.ts +1 -0
- package/build/test-cjs/index.js +122 -36
- package/build/test-esm/index.js +122 -36
- package/build/vite-cjs/index.js +122 -36
- package/build/vite-esm/index.js +122 -36
- package/package.json +16 -1
- package/.turbo/turbo-compile.log +0 -5
- package/.turbo/turbo-typedefs.log +0 -5
- package/CHANGELOG.md +0 -367
- package/src/cmd/generate.ts +0 -54
- package/src/cmd/index.ts +0 -60
- package/src/cmd/init.ts +0 -637
- package/src/cmd/pullSchema.ts +0 -40
- package/src/codegen/generators/artifacts/artifacts.test.ts +0 -2978
- package/src/codegen/generators/artifacts/fieldKey.ts +0 -60
- package/src/codegen/generators/artifacts/index.ts +0 -330
- package/src/codegen/generators/artifacts/indexFile.ts +0 -24
- package/src/codegen/generators/artifacts/inputs.ts +0 -81
- package/src/codegen/generators/artifacts/operations.ts +0 -263
- package/src/codegen/generators/artifacts/pagination.test.ts +0 -664
- package/src/codegen/generators/artifacts/policy.test.ts +0 -298
- package/src/codegen/generators/artifacts/selection.ts +0 -208
- package/src/codegen/generators/artifacts/utils.test.ts +0 -118
- package/src/codegen/generators/artifacts/utils.ts +0 -108
- package/src/codegen/generators/definitions/enums.test.ts +0 -61
- package/src/codegen/generators/definitions/enums.ts +0 -68
- package/src/codegen/generators/definitions/index.ts +0 -11
- package/src/codegen/generators/definitions/schema.test.ts +0 -227
- package/src/codegen/generators/index.ts +0 -6
- package/src/codegen/generators/indexFile/index.ts +0 -63
- package/src/codegen/generators/indexFile/indexFile.test.ts +0 -72
- package/src/codegen/generators/persistedQueries/index.ts +0 -55
- package/src/codegen/generators/persistedQueries/persistedQuery.test.ts +0 -26
- package/src/codegen/generators/runtime/index.test.ts +0 -74
- package/src/codegen/generators/runtime/index.ts +0 -64
- package/src/codegen/generators/runtime/runtime.test.ts +0 -25
- package/src/codegen/generators/typescript/addReferencedInputTypes.ts +0 -77
- package/src/codegen/generators/typescript/index.ts +0 -412
- package/src/codegen/generators/typescript/inlineType.ts +0 -409
- package/src/codegen/generators/typescript/typeReference.ts +0 -44
- package/src/codegen/generators/typescript/types.ts +0 -81
- package/src/codegen/generators/typescript/typescript.test.ts +0 -1434
- package/src/codegen/index.ts +0 -406
- package/src/codegen/transforms/addID.test.ts +0 -93
- package/src/codegen/transforms/addID.ts +0 -86
- package/src/codegen/transforms/composeQueries.test.ts +0 -50
- package/src/codegen/transforms/composeQueries.ts +0 -154
- package/src/codegen/transforms/fragmentVariables.test.ts +0 -636
- package/src/codegen/transforms/fragmentVariables.ts +0 -417
- package/src/codegen/transforms/index.ts +0 -7
- package/src/codegen/transforms/list.ts +0 -485
- package/src/codegen/transforms/lists.test.ts +0 -530
- package/src/codegen/transforms/paginate.test.ts +0 -1481
- package/src/codegen/transforms/paginate.ts +0 -750
- package/src/codegen/transforms/schema.test.ts +0 -136
- package/src/codegen/transforms/schema.ts +0 -104
- package/src/codegen/transforms/typename.test.ts +0 -125
- package/src/codegen/transforms/typename.ts +0 -55
- package/src/codegen/utils/commonjs.ts +0 -26
- package/src/codegen/utils/flattenSelections.ts +0 -179
- package/src/codegen/utils/graphql.test.ts +0 -35
- package/src/codegen/utils/graphql.ts +0 -79
- package/src/codegen/utils/index.ts +0 -5
- package/src/codegen/utils/moduleExport.ts +0 -27
- package/src/codegen/utils/murmur.ts +0 -79
- package/src/codegen/validators/index.ts +0 -4
- package/src/codegen/validators/noIDAlias.test.ts +0 -71
- package/src/codegen/validators/noIDAlias.ts +0 -39
- package/src/codegen/validators/plugins.ts +0 -25
- package/src/codegen/validators/typeCheck.test.ts +0 -904
- package/src/codegen/validators/typeCheck.ts +0 -1031
- package/src/codegen/validators/uniqueNames.test.ts +0 -59
- package/src/codegen/validators/uniqueNames.ts +0 -39
- package/src/lib/cleanupFiles.ts +0 -20
- package/src/lib/config.test.ts +0 -13
- package/src/lib/config.ts +0 -943
- package/src/lib/constants.ts +0 -11
- package/src/lib/error.ts +0 -24
- package/src/lib/fs.ts +0 -285
- package/src/lib/graphql.test.ts +0 -211
- package/src/lib/graphql.ts +0 -200
- package/src/lib/imports.ts +0 -82
- package/src/lib/index.ts +0 -17
- package/src/lib/introspection.ts +0 -39
- package/src/lib/parse.test.ts +0 -75
- package/src/lib/parse.ts +0 -23
- package/src/lib/path.ts +0 -49
- package/src/lib/pipeline.ts +0 -17
- package/src/lib/types.ts +0 -34
- package/src/lib/walk.ts +0 -104
- package/src/runtime/cache/cache.ts +0 -1023
- package/src/runtime/cache/gc.ts +0 -56
- package/src/runtime/cache/index.ts +0 -3
- package/src/runtime/cache/lists.ts +0 -502
- package/src/runtime/cache/storage.ts +0 -574
- package/src/runtime/cache/stuff.ts +0 -77
- package/src/runtime/cache/subscription.ts +0 -329
- package/src/runtime/cache/tests/availability.test.ts +0 -408
- package/src/runtime/cache/tests/gc.test.ts +0 -319
- package/src/runtime/cache/tests/keys.test.ts +0 -36
- package/src/runtime/cache/tests/list.test.ts +0 -3747
- package/src/runtime/cache/tests/readwrite.test.ts +0 -1201
- package/src/runtime/cache/tests/scalars.test.ts +0 -218
- package/src/runtime/cache/tests/storage.test.ts +0 -426
- package/src/runtime/cache/tests/subscriptions.test.ts +0 -1757
- package/src/runtime/index.ts +0 -29
- package/src/runtime/lib/config.ts +0 -201
- package/src/runtime/lib/constants.ts +0 -17
- package/src/runtime/lib/deepEquals.ts +0 -32
- package/src/runtime/lib/errors.ts +0 -8
- package/src/runtime/lib/index.ts +0 -8
- package/src/runtime/lib/log.ts +0 -69
- package/src/runtime/lib/network.ts +0 -303
- package/src/runtime/lib/networkUtils.ts +0 -151
- package/src/runtime/lib/scalars.test.ts +0 -877
- package/src/runtime/lib/scalars.ts +0 -195
- package/src/runtime/lib/types.ts +0 -194
- package/src/test/index.ts +0 -294
- package/src/vite/ast.ts +0 -107
- package/src/vite/houdini.ts +0 -113
- package/src/vite/imports.ts +0 -129
- package/src/vite/index.ts +0 -55
- package/src/vite/schema.ts +0 -80
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { test } from 'vitest'
|
|
2
|
-
|
|
3
|
-
import { CollectedGraphQLDocument } from '../../lib/types'
|
|
4
|
-
import { pipelineTest, testConfig } from '../../test'
|
|
5
|
-
|
|
6
|
-
const table: Row[] = [
|
|
7
|
-
{
|
|
8
|
-
title: 'base case',
|
|
9
|
-
pass: false,
|
|
10
|
-
documents: [
|
|
11
|
-
`
|
|
12
|
-
query QueryA {
|
|
13
|
-
version
|
|
14
|
-
}
|
|
15
|
-
`,
|
|
16
|
-
`
|
|
17
|
-
query QueryA {
|
|
18
|
-
version
|
|
19
|
-
}
|
|
20
|
-
`,
|
|
21
|
-
],
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
title: 'positive case',
|
|
25
|
-
pass: true,
|
|
26
|
-
documents: [
|
|
27
|
-
`
|
|
28
|
-
query QueryA {
|
|
29
|
-
version
|
|
30
|
-
}
|
|
31
|
-
`,
|
|
32
|
-
`
|
|
33
|
-
query QueryB {
|
|
34
|
-
version
|
|
35
|
-
}
|
|
36
|
-
`,
|
|
37
|
-
],
|
|
38
|
-
},
|
|
39
|
-
]
|
|
40
|
-
|
|
41
|
-
type Row =
|
|
42
|
-
| {
|
|
43
|
-
title: string
|
|
44
|
-
pass: true
|
|
45
|
-
documents: string[]
|
|
46
|
-
check?: (docs: CollectedGraphQLDocument[]) => void
|
|
47
|
-
}
|
|
48
|
-
| {
|
|
49
|
-
title: string
|
|
50
|
-
pass: false
|
|
51
|
-
documents: string[]
|
|
52
|
-
check?: (result: Error | Error[]) => void
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// run the tests
|
|
56
|
-
for (const { title, pass, documents, check } of table) {
|
|
57
|
-
// run the pipeline over the documents
|
|
58
|
-
test(title, pipelineTest(testConfig(), documents, pass, check))
|
|
59
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { Config, CollectedGraphQLDocument } from '../../lib'
|
|
2
|
-
import { HoudiniError } from '../../lib/error'
|
|
3
|
-
|
|
4
|
-
// uniqueDocumentNames verifies that the documents all have unique names
|
|
5
|
-
export default async function uniqueDocumentNames(
|
|
6
|
-
config: Config,
|
|
7
|
-
docs: CollectedGraphQLDocument[]
|
|
8
|
-
): Promise<void> {
|
|
9
|
-
// build up a list of document names
|
|
10
|
-
const nameMap = docs.reduce<{ [docName: string]: string[] }>(
|
|
11
|
-
(acc, { name, filename }) => ({
|
|
12
|
-
...acc,
|
|
13
|
-
[name]: [...(acc[name] || []), filename],
|
|
14
|
-
}),
|
|
15
|
-
{}
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
// look for names with more than one entry and turn them into errors
|
|
19
|
-
const errors: HoudiniError[] = Object.entries(nameMap)
|
|
20
|
-
.filter(([_, filenames]) => filenames.length > 1)
|
|
21
|
-
.map(
|
|
22
|
-
([docName, fileNames]) =>
|
|
23
|
-
new HoudiniError({
|
|
24
|
-
message: fileNames.join(', '),
|
|
25
|
-
description: `Operation names must be unique. Encountered duplicate definitions of ${docName} in these files:`,
|
|
26
|
-
})
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
// if we got errors
|
|
30
|
-
if (errors.length > 0) {
|
|
31
|
-
throw new HoudiniError({
|
|
32
|
-
filepath: errors[0].description,
|
|
33
|
-
message: errors[0].message,
|
|
34
|
-
})
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// we're done here
|
|
38
|
-
return
|
|
39
|
-
}
|
package/src/lib/cleanupFiles.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as fs from './fs'
|
|
2
|
-
import * as path from './path'
|
|
3
|
-
|
|
4
|
-
export async function cleanupFiles(pathFolder: string, listOfObj: string[]): Promise<string[]> {
|
|
5
|
-
const listFile = await fs.readdir(pathFolder)
|
|
6
|
-
const storeListFile = listFile
|
|
7
|
-
.filter((c) => c.endsWith('.js') && c !== 'index.js')
|
|
8
|
-
.map((c) => c.slice(0, -3))
|
|
9
|
-
.sort()
|
|
10
|
-
|
|
11
|
-
let allFilesNotInList = storeListFile.filter((x) => !listOfObj.includes(x))
|
|
12
|
-
await Promise.all(
|
|
13
|
-
allFilesNotInList.map(async (storeName) => {
|
|
14
|
-
await fs.remove(path.join(pathFolder, `${storeName}.js`))
|
|
15
|
-
await fs.remove(path.join(pathFolder, `${storeName}.d.ts`))
|
|
16
|
-
})
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
return allFilesNotInList
|
|
20
|
-
}
|
package/src/lib/config.test.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { test, describe, expect } from 'vitest'
|
|
2
|
-
|
|
3
|
-
import { readConfigFile } from './config'
|
|
4
|
-
|
|
5
|
-
describe('loadConfig', function () {
|
|
6
|
-
test('handles malformed config file', async () => {
|
|
7
|
-
const INVALID_CONFIG = '__mocks__/config.invalid.mock'
|
|
8
|
-
|
|
9
|
-
await expect(async () => {
|
|
10
|
-
await readConfigFile(INVALID_CONFIG)
|
|
11
|
-
}).rejects.toThrowError(`Could not load config`)
|
|
12
|
-
})
|
|
13
|
-
})
|