@auto-engineer/react-gen 1.135.0 → 1.137.0
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/dist/src/agents/create-codegen-agent.d.ts +5 -0
- package/dist/src/agents/create-codegen-agent.d.ts.map +1 -0
- package/dist/src/agents/create-codegen-agent.js +30 -0
- package/dist/src/agents/create-codegen-agent.js.map +1 -0
- package/dist/src/agents/create-constants-agent.d.ts.map +1 -1
- package/dist/src/agents/create-constants-agent.js +25 -8
- package/dist/src/agents/create-constants-agent.js.map +1 -1
- package/dist/src/agents/create-landing-page-agent.d.ts.map +1 -1
- package/dist/src/agents/create-landing-page-agent.js +3 -4
- package/dist/src/agents/create-landing-page-agent.js.map +1 -1
- package/dist/src/agents/create-narrative-agent.d.ts.map +1 -1
- package/dist/src/agents/create-narrative-agent.js +4 -5
- package/dist/src/agents/create-narrative-agent.js.map +1 -1
- package/dist/src/agents/create-pipeline.d.ts +1 -0
- package/dist/src/agents/create-pipeline.d.ts.map +1 -1
- package/dist/src/agents/create-pipeline.js +4 -2
- package/dist/src/agents/create-pipeline.js.map +1 -1
- package/dist/src/agents/create-router-agent.d.ts.map +1 -1
- package/dist/src/agents/create-router-agent.js +3 -4
- package/dist/src/agents/create-router-agent.js.map +1 -1
- package/dist/src/agents/create-theme-agent.d.ts.map +1 -1
- package/dist/src/agents/create-theme-agent.js +3 -4
- package/dist/src/agents/create-theme-agent.js.map +1 -1
- package/dist/src/agents/create-validation-agent.d.ts.map +1 -1
- package/dist/src/agents/create-validation-agent.js +3 -4
- package/dist/src/agents/create-validation-agent.js.map +1 -1
- package/dist/src/commands/generate-react-app.d.ts.map +1 -1
- package/dist/src/commands/generate-react-app.js +2 -1
- package/dist/src/commands/generate-react-app.js.map +1 -1
- package/dist/src/prompts/build-narrative-context.d.ts +1 -1
- package/dist/src/prompts/build-narrative-context.d.ts.map +1 -1
- package/dist/src/prompts/build-narrative-context.js +25 -6
- package/dist/src/prompts/build-narrative-context.js.map +1 -1
- package/dist/src/prompts/narrative-system.d.ts +1 -1
- package/dist/src/prompts/narrative-system.d.ts.map +1 -1
- package/dist/src/prompts/narrative-system.js +15 -8
- package/dist/src/prompts/narrative-system.js.map +1 -1
- package/dist/src/prompts/router-system.d.ts +1 -1
- package/dist/src/prompts/router-system.d.ts.map +1 -1
- package/dist/src/prompts/router-system.js +2 -2
- package/dist/src/prompts/validation-system.d.ts +1 -1
- package/dist/src/prompts/validation-system.d.ts.map +1 -1
- package/dist/src/prompts/validation-system.js +5 -2
- package/dist/src/prompts/validation-system.js.map +1 -1
- package/dist/src/tools/check-imports.d.ts.map +1 -1
- package/dist/src/tools/check-imports.js +7 -2
- package/dist/src/tools/check-imports.js.map +1 -1
- package/dist/src/tools/list-files.d.ts.map +1 -1
- package/dist/src/tools/list-files.js +2 -0
- package/dist/src/tools/list-files.js.map +1 -1
- package/dist/src/tools/load-skills.d.ts +8 -0
- package/dist/src/tools/load-skills.d.ts.map +1 -0
- package/dist/src/tools/load-skills.js +28 -0
- package/dist/src/tools/load-skills.js.map +1 -0
- package/dist/src/tools/write-file.d.ts.map +1 -1
- package/dist/src/tools/write-file.js +10 -0
- package/dist/src/tools/write-file.js.map +1 -1
- package/dist/src/types.d.ts +19 -19
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +4 -4
- package/dist/src/types.js.map +1 -1
- package/dist/starter/codegen.ts +17 -0
- package/dist/starter/package.json +5 -1
- package/dist/starter/pnpm-lock.yaml +2382 -85
- package/dist/starter/src/App.tsx +1 -1
- package/dist/starter/src/gql/execute.ts +9 -0
- package/dist/starter/src/gql/fragment-masking.ts +82 -0
- package/dist/starter/src/gql/gql.ts +6 -0
- package/dist/starter/src/gql/graphql.ts +37 -0
- package/dist/starter/src/gql/index.ts +2 -0
- package/dist/starter/src/main.tsx +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/starter/codegen.ts +17 -0
- package/starter/package.json +5 -1
- package/starter/pnpm-lock.yaml +2382 -85
- package/starter/src/App.tsx +1 -1
- package/starter/src/gql/execute.ts +9 -0
- package/starter/src/gql/fragment-masking.ts +82 -0
- package/starter/src/gql/gql.ts +6 -0
- package/starter/src/gql/graphql.ts +37 -0
- package/starter/src/gql/index.ts +2 -0
- package/starter/src/main.tsx +1 -1
- package/dist/starter/package-lock.json +0 -7590
- package/starter/package-lock.json +0 -7590
package/starter/src/App.tsx
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { graphqlClient } from '@/lib/graphql-client';
|
|
2
|
+
import type { TypedDocumentString } from './graphql';
|
|
3
|
+
|
|
4
|
+
export async function execute<TResult, TVariables extends Record<string, unknown>>(
|
|
5
|
+
query: TypedDocumentString<TResult, TVariables>,
|
|
6
|
+
...[variables]: TVariables extends Record<string, never> ? [] : [TVariables]
|
|
7
|
+
): Promise<TResult> {
|
|
8
|
+
return graphqlClient.request<TResult>(query.toString(), variables as Record<string, unknown> | undefined);
|
|
9
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { DocumentTypeDecoration, ResultOf } from '@graphql-typed-document-node/core';
|
|
2
|
+
import { Incremental, TypedDocumentString } from './graphql';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> = TDocumentType extends DocumentTypeDecoration<
|
|
6
|
+
infer TType,
|
|
7
|
+
any
|
|
8
|
+
>
|
|
9
|
+
? [TType] extends [{ ' $fragmentName'?: infer TKey }]
|
|
10
|
+
? TKey extends string
|
|
11
|
+
? { ' $fragmentRefs'?: { [key in TKey]: TType } }
|
|
12
|
+
: never
|
|
13
|
+
: never
|
|
14
|
+
: never;
|
|
15
|
+
|
|
16
|
+
// return non-nullable if `fragmentType` is non-nullable
|
|
17
|
+
export function useFragment<TType>(
|
|
18
|
+
_documentNode: DocumentTypeDecoration<TType, any>,
|
|
19
|
+
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>>
|
|
20
|
+
): TType;
|
|
21
|
+
// return nullable if `fragmentType` is undefined
|
|
22
|
+
export function useFragment<TType>(
|
|
23
|
+
_documentNode: DocumentTypeDecoration<TType, any>,
|
|
24
|
+
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | undefined
|
|
25
|
+
): TType | undefined;
|
|
26
|
+
// return nullable if `fragmentType` is nullable
|
|
27
|
+
export function useFragment<TType>(
|
|
28
|
+
_documentNode: DocumentTypeDecoration<TType, any>,
|
|
29
|
+
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null
|
|
30
|
+
): TType | null;
|
|
31
|
+
// return nullable if `fragmentType` is nullable or undefined
|
|
32
|
+
export function useFragment<TType>(
|
|
33
|
+
_documentNode: DocumentTypeDecoration<TType, any>,
|
|
34
|
+
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null | undefined
|
|
35
|
+
): TType | null | undefined;
|
|
36
|
+
// return array of non-nullable if `fragmentType` is array of non-nullable
|
|
37
|
+
export function useFragment<TType>(
|
|
38
|
+
_documentNode: DocumentTypeDecoration<TType, any>,
|
|
39
|
+
fragmentType: Array<FragmentType<DocumentTypeDecoration<TType, any>>>
|
|
40
|
+
): Array<TType>;
|
|
41
|
+
// return array of nullable if `fragmentType` is array of nullable
|
|
42
|
+
export function useFragment<TType>(
|
|
43
|
+
_documentNode: DocumentTypeDecoration<TType, any>,
|
|
44
|
+
fragmentType: Array<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
|
|
45
|
+
): Array<TType> | null | undefined;
|
|
46
|
+
// return readonly array of non-nullable if `fragmentType` is array of non-nullable
|
|
47
|
+
export function useFragment<TType>(
|
|
48
|
+
_documentNode: DocumentTypeDecoration<TType, any>,
|
|
49
|
+
fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>
|
|
50
|
+
): ReadonlyArray<TType>;
|
|
51
|
+
// return readonly array of nullable if `fragmentType` is array of nullable
|
|
52
|
+
export function useFragment<TType>(
|
|
53
|
+
_documentNode: DocumentTypeDecoration<TType, any>,
|
|
54
|
+
fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
|
|
55
|
+
): ReadonlyArray<TType> | null | undefined;
|
|
56
|
+
export function useFragment<TType>(
|
|
57
|
+
_documentNode: DocumentTypeDecoration<TType, any>,
|
|
58
|
+
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | Array<FragmentType<DocumentTypeDecoration<TType, any>>> | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
|
|
59
|
+
): TType | Array<TType> | ReadonlyArray<TType> | null | undefined {
|
|
60
|
+
return fragmentType as any;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
export function makeFragmentData<
|
|
65
|
+
F extends DocumentTypeDecoration<any, any>,
|
|
66
|
+
FT extends ResultOf<F>
|
|
67
|
+
>(data: FT, _fragment: F): FragmentType<F> {
|
|
68
|
+
return data as FragmentType<F>;
|
|
69
|
+
}
|
|
70
|
+
export function isFragmentReady<TQuery, TFrag>(
|
|
71
|
+
queryNode: TypedDocumentString<TQuery, any>,
|
|
72
|
+
fragmentNode: TypedDocumentString<TFrag, any>,
|
|
73
|
+
data: FragmentType<TypedDocumentString<Incremental<TFrag>, any>> | null | undefined
|
|
74
|
+
): data is FragmentType<typeof fragmentNode> {
|
|
75
|
+
const deferredFields = queryNode.__meta__?.deferredFields as Record<string, (keyof TFrag)[]>;
|
|
76
|
+
const fragName = fragmentNode.__meta__?.fragmentName as string | undefined;
|
|
77
|
+
|
|
78
|
+
if (!deferredFields || !fragName) return true;
|
|
79
|
+
|
|
80
|
+
const fields = deferredFields[fragName] ?? [];
|
|
81
|
+
return fields.length > 0 && fields.every(field => data && field in data);
|
|
82
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
interface DocumentTypeDecoration<TResult, TVariables> {
|
|
2
|
+
__apiType?: (variables: TVariables) => TResult;
|
|
3
|
+
}
|
|
4
|
+
export type Maybe<T> = T | null;
|
|
5
|
+
export type InputMaybe<T> = T | null | undefined;
|
|
6
|
+
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
|
|
7
|
+
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
|
|
8
|
+
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
|
|
9
|
+
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
|
|
10
|
+
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
|
|
11
|
+
/** All built-in and custom scalars, mapped to their actual values */
|
|
12
|
+
export type Scalars = {
|
|
13
|
+
ID: { input: string; output: string; }
|
|
14
|
+
String: { input: string; output: string; }
|
|
15
|
+
Boolean: { input: boolean; output: boolean; }
|
|
16
|
+
Int: { input: number; output: number; }
|
|
17
|
+
Float: { input: number; output: number; }
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export class TypedDocumentString<TResult, TVariables>
|
|
21
|
+
extends String
|
|
22
|
+
implements DocumentTypeDecoration<TResult, TVariables>
|
|
23
|
+
{
|
|
24
|
+
__apiType?: NonNullable<DocumentTypeDecoration<TResult, TVariables>['__apiType']>;
|
|
25
|
+
private value: string;
|
|
26
|
+
public __meta__?: Record<string, any> | undefined;
|
|
27
|
+
|
|
28
|
+
constructor(value: string, __meta__?: Record<string, any> | undefined) {
|
|
29
|
+
super(value);
|
|
30
|
+
this.value = value;
|
|
31
|
+
this.__meta__ = __meta__;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
override toString(): string & DocumentTypeDecoration<TResult, TVariables> {
|
|
35
|
+
return this.value;
|
|
36
|
+
}
|
|
37
|
+
}
|
package/starter/src/main.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import { StrictMode } from 'react';
|
|
|
2
2
|
import { createRoot } from 'react-dom/client';
|
|
3
3
|
import { ErrorBoundary } from '@/components/error-boundary';
|
|
4
4
|
import { Providers } from '@/lib/providers';
|
|
5
|
-
import App from './App';
|
|
5
|
+
import { App } from './App';
|
|
6
6
|
import './index.css';
|
|
7
7
|
|
|
8
8
|
createRoot(document.getElementById('root')!).render(
|