polen 0.0.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.
- package/build/_exports.d.ts +1 -0
- package/build/_exports.js +1 -0
- package/build/_namespace.d.ts +1 -0
- package/build/_namespace.js +1 -0
- package/build/app-template/components/ArgumentAnnotation.d.ts +9 -0
- package/build/app-template/components/ArgumentAnnotation.jsx +15 -0
- package/build/app-template/components/ArgumentList.d.ts +6 -0
- package/build/app-template/components/ArgumentList.jsx +15 -0
- package/build/app-template/components/ArgumentListAnnotation.d.ts +6 -0
- package/build/app-template/components/ArgumentListAnnotation.jsx +22 -0
- package/build/app-template/components/ColumnView.d.ts +6 -0
- package/build/app-template/components/ColumnView.jsx +26 -0
- package/build/app-template/components/DeprecationReason.d.ts +5 -0
- package/build/app-template/components/DeprecationReason.jsx +9 -0
- package/build/app-template/components/Description.d.ts +6 -0
- package/build/app-template/components/Description.jsx +9 -0
- package/build/app-template/components/Field.d.ts +7 -0
- package/build/app-template/components/Field.jsx +19 -0
- package/build/app-template/components/FieldList.d.ts +6 -0
- package/build/app-template/components/FieldList.jsx +13 -0
- package/build/app-template/components/FieldListSection.d.ts +6 -0
- package/build/app-template/components/FieldListSection.jsx +14 -0
- package/build/app-template/components/Link.d.ts +3 -0
- package/build/app-template/components/Link.jsx +5 -0
- package/build/app-template/components/Markdown.d.ts +4 -0
- package/build/app-template/components/Markdown.jsx +13 -0
- package/build/app-template/components/NamedType.d.ts +6 -0
- package/build/app-template/components/NamedType.jsx +15 -0
- package/build/app-template/components/RadixLink.d.ts +1 -0
- package/build/app-template/components/RadixLink.jsx +1 -0
- package/build/app-template/components/TypeAnnotation.d.ts +9 -0
- package/build/app-template/components/TypeAnnotation.jsx +42 -0
- package/build/app-template/components/TypeFieldsLinkList.d.ts +6 -0
- package/build/app-template/components/TypeFieldsLinkList.jsx +16 -0
- package/build/app-template/entry.client.d.ts +1 -0
- package/build/app-template/entry.client.jsx +22 -0
- package/build/app-template/entry.server.d.ts +3 -0
- package/build/app-template/entry.server.jsx +96 -0
- package/build/app-template/routes/index.d.ts +1 -0
- package/build/app-template/routes/index.jsx +6 -0
- package/build/app-template/routes/reference.$type.$field.d.ts +4 -0
- package/build/app-template/routes/reference.$type.$field.jsx +24 -0
- package/build/app-template/routes/reference.$type.d.ts +4 -0
- package/build/app-template/routes/reference.$type.jsx +18 -0
- package/build/app-template/routes/reference.d.ts +12 -0
- package/build/app-template/routes/reference.jsx +34 -0
- package/build/app-template/routes/root.d.ts +17 -0
- package/build/app-template/routes/root.jsx +33 -0
- package/build/app-template/routes.d.ts +2 -0
- package/build/app-template/routes.jsx +4 -0
- package/build/lib/code-builder/_exports.d.ts +7 -0
- package/build/lib/code-builder/_exports.js +11 -0
- package/build/lib/code-builder/_namespace.d.ts +1 -0
- package/build/lib/code-builder/_namespace.js +1 -0
- package/build/lib/debug/_namespace.d.ts +1 -0
- package/build/lib/debug/_namespace.js +1 -0
- package/build/lib/debug/debug.d.ts +4 -0
- package/build/lib/debug/debug.js +37 -0
- package/build/lib/fs/_namespace.d.ts +1 -0
- package/build/lib/fs/_namespace.js +1 -0
- package/build/lib/fs/main.d.ts +3 -0
- package/build/lib/fs/main.js +17 -0
- package/build/lib/grafaid/helpers.d.ts +62 -0
- package/build/lib/grafaid/helpers.js +140 -0
- package/build/lib/grafaid/index.d.ts +7 -0
- package/build/lib/grafaid/index.js +9 -0
- package/build/lib/h3/_namespace.d.ts +1 -0
- package/build/lib/h3/_namespace.js +1 -0
- package/build/lib/hono/_exports.d.ts +2 -0
- package/build/lib/hono/_exports.js +2 -0
- package/build/lib/hono/_namespace.d.ts +1 -0
- package/build/lib/hono/_namespace.js +1 -0
- package/build/lib/hono/ssg.d.ts +1 -0
- package/build/lib/hono/ssg.js +1 -0
- package/build/lib/nitro/_namespace.d.ts +2 -0
- package/build/lib/nitro/_namespace.js +1 -0
- package/build/lib/path/_namespace.d.ts +1 -0
- package/build/lib/path/_namespace.js +1 -0
- package/build/lib/path/main.d.ts +9 -0
- package/build/lib/path/main.js +14 -0
- package/build/lib/prelude/main.d.ts +3 -0
- package/build/lib/prelude/main.js +3 -0
- package/build/lib/react/_namespace.d.ts +2 -0
- package/build/lib/react/_namespace.js +2 -0
- package/build/lib/react-dom-client/_namespace.d.ts +2 -0
- package/build/lib/react-dom-client/_namespace.js +2 -0
- package/build/lib/react-dom-server/_namespace.d.ts +2 -0
- package/build/lib/react-dom-server/_namespace.js +2 -0
- package/build/lib/react-router/_namespace.d.ts +1 -0
- package/build/lib/react-router/_namespace.js +1 -0
- package/build/lib/react-router-helpers.d.ts +4 -0
- package/build/lib/react-router-helpers.js +13 -0
- package/build/lib/rollup/_namespace.d.ts +1 -0
- package/build/lib/rollup/_namespace.js +1 -0
- package/build/lib/tan-stack-router-vite.d.ts +1 -0
- package/build/lib/tan-stack-router-vite.js +1 -0
- package/build/lib/vite/_exports.d.ts +21 -0
- package/build/lib/vite/_exports.js +18 -0
- package/build/lib/vite/_namespace.d.ts +1 -0
- package/build/lib/vite/_namespace.js +1 -0
- package/build/lib/vite/virtual-identifier.d.ts +21 -0
- package/build/lib/vite/virtual-identifier.js +94 -0
- package/build/lib/vite-plugins/_exports.d.ts +2 -0
- package/build/lib/vite-plugins/_exports.js +2 -0
- package/build/lib/vite-plugins/_namespace.d.ts +4 -0
- package/build/lib/vite-plugins/_namespace.js +4 -0
- package/build/lib/vite-plugins/build-logger.d.ts +2 -0
- package/build/lib/vite-plugins/build-logger.js +30 -0
- package/build/lib/vite-plugins/output-logger.d.ts +2 -0
- package/build/lib/vite-plugins/output-logger.js +12 -0
- package/build/vite-plugin/_exports.d.ts +3 -0
- package/build/vite-plugin/_exports.js +81 -0
- package/build/vite-plugin/build.d.ts +5 -0
- package/build/vite-plugin/build.js +144 -0
- package/build/vite-plugin/configurator/_namespace.d.ts +1 -0
- package/build/vite-plugin/configurator/_namespace.js +1 -0
- package/build/vite-plugin/configurator/main.d.ts +35 -0
- package/build/vite-plugin/configurator/main.js +36 -0
- package/build/vite-plugin/helpers.d.ts +2 -0
- package/build/vite-plugin/helpers.js +2 -0
- package/build/vite-plugin/renderer.d.ts +2 -0
- package/build/vite-plugin/renderer.js +3 -0
- package/package.json +77 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const Component: () => import("react").JSX.Element;
|
|
2
|
+
export declare const root: {
|
|
3
|
+
id: string;
|
|
4
|
+
path: string;
|
|
5
|
+
Component: () => import("react").JSX.Element;
|
|
6
|
+
children: (import("react-router").IndexRouteObject | {
|
|
7
|
+
path: string;
|
|
8
|
+
loader: () => {
|
|
9
|
+
documentNode: import("graphql").DocumentNode;
|
|
10
|
+
};
|
|
11
|
+
Component: () => import("react").JSX.Element;
|
|
12
|
+
children: {
|
|
13
|
+
path: string;
|
|
14
|
+
Component: () => string | import("react").JSX.Element;
|
|
15
|
+
}[];
|
|
16
|
+
})[];
|
|
17
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Outlet, ScrollRestoration } from 'react-router';
|
|
2
|
+
import { Theme } from '@radix-ui/themes';
|
|
3
|
+
import { createRoute } from '../../lib/react-router-helpers.js';
|
|
4
|
+
import { index } from './index.jsx';
|
|
5
|
+
import { reference } from './reference.jsx';
|
|
6
|
+
import radixStylesUrl from '@radix-ui/themes/styles.css?url';
|
|
7
|
+
import entryClientUrl from '../entry.client.jsx?url';
|
|
8
|
+
export const Component = () => {
|
|
9
|
+
return (<html lang="en">
|
|
10
|
+
<head>
|
|
11
|
+
<meta charSet="utf-8"/>
|
|
12
|
+
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
13
|
+
<title>My Developer Portal</title>
|
|
14
|
+
{import.meta.env.DEV && <link rel="stylesheet" href={radixStylesUrl}/>}
|
|
15
|
+
</head>
|
|
16
|
+
<body>
|
|
17
|
+
<Theme>
|
|
18
|
+
<Outlet />
|
|
19
|
+
</Theme>
|
|
20
|
+
<ScrollRestoration />
|
|
21
|
+
{import.meta.env.DEV && <script type="module" src={entryClientUrl}></script>}
|
|
22
|
+
</body>
|
|
23
|
+
</html>);
|
|
24
|
+
};
|
|
25
|
+
export const root = createRoute({
|
|
26
|
+
id: `root`, // todo remove
|
|
27
|
+
path: `/`,
|
|
28
|
+
Component,
|
|
29
|
+
children: [
|
|
30
|
+
index,
|
|
31
|
+
reference,
|
|
32
|
+
],
|
|
33
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as CodeBuilder from './_exports.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as CodeBuilder from './_exports.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as Debug from './debug.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as Debug from './debug.js';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { inspect } from 'node:util';
|
|
2
|
+
import { colorize } from 'consola/utils';
|
|
3
|
+
import { snakeCase } from 'es-toolkit';
|
|
4
|
+
export const create = (namespace) => {
|
|
5
|
+
return (...args) => {
|
|
6
|
+
const isDebug = process.env[`DEBUG`] === `true` || process.env[`DEBUG`] === `*` ||
|
|
7
|
+
process.env[`DEBUG`] === `1`;
|
|
8
|
+
const isPayloadPassed = args.length === 2;
|
|
9
|
+
const [event, payload] = args;
|
|
10
|
+
if (isDebug) {
|
|
11
|
+
const debugDepth = parseNumberOr(process.env[`DEBUG_DEPTH`], 0);
|
|
12
|
+
const isPayloadDisabled = debugDepth < 0;
|
|
13
|
+
const payloadRendered = isPayloadPassed && !isPayloadDisabled
|
|
14
|
+
? inspect(payload, {
|
|
15
|
+
colors: true,
|
|
16
|
+
depth: debugDepth,
|
|
17
|
+
compact: true,
|
|
18
|
+
maxStringLength: 1000,
|
|
19
|
+
})
|
|
20
|
+
: ``;
|
|
21
|
+
const namespaceRendered = namespace
|
|
22
|
+
? colorize(`bold`, colorize(`bgYellowBright`, ` ` + snakeCase(namespace).toUpperCase() + ` `))
|
|
23
|
+
: ``;
|
|
24
|
+
const eventRendered = colorize(`bold`, colorize(`bgMagentaBright`, ` ` + snakeCase(event).toUpperCase() + ` `));
|
|
25
|
+
const prefixRendered = `${namespaceRendered} ${eventRendered}`;
|
|
26
|
+
console.debug(prefixRendered, payloadRendered);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export const debug = create();
|
|
31
|
+
const parseNumberOr = (str, defaultValue) => {
|
|
32
|
+
const parsed = Number(str);
|
|
33
|
+
if (Number.isNaN(parsed)) {
|
|
34
|
+
return defaultValue;
|
|
35
|
+
}
|
|
36
|
+
return parsed;
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as Fs from './main.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as Fs from './main.js';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { access, appendFile, chmod, chown, copyFile, cp, glob, lchown, link, lstat, mkdir, mkdtemp, open, opendir, readFile, readlink, realpath, rename, rm, unlink, watch, writeFile, } from 'node:fs/promises';
|
|
2
|
+
export declare const emptyDirIfExists: (dirPath: string) => Promise<void>;
|
|
3
|
+
export declare const rmDirIfExists: (dirPath: string) => Promise<void>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { mkdir, rm } from 'node:fs/promises';
|
|
2
|
+
export { access, appendFile, chmod, chown, copyFile, cp, glob, lchown, link, lstat, mkdir, mkdtemp, open, opendir, readFile, readlink, realpath, rename, rm, unlink, watch, writeFile, } from 'node:fs/promises';
|
|
3
|
+
export const emptyDirIfExists = async (dirPath) => {
|
|
4
|
+
await rmDirIfExists(dirPath);
|
|
5
|
+
await mkdir(dirPath);
|
|
6
|
+
};
|
|
7
|
+
export const rmDirIfExists = async (dirPath) => {
|
|
8
|
+
try {
|
|
9
|
+
await rm(dirPath, { recursive: true });
|
|
10
|
+
}
|
|
11
|
+
catch (error_) {
|
|
12
|
+
const error = error_;
|
|
13
|
+
if (error.code !== `ENOENT`) {
|
|
14
|
+
throw error;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GraphQL type guard utilities for checking and narrowing GraphQL types.
|
|
3
|
+
* This module provides type-safe helper functions for working with GraphQL types.
|
|
4
|
+
*/
|
|
5
|
+
import type { GraphQLEnumType, GraphQLField as GraphQLField_graphql, GraphQLInputField, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLNamedType, GraphQLObjectType, GraphQLOutputType, GraphQLScalarType, GraphQLSchema, GraphQLUnionType } from 'graphql';
|
|
6
|
+
export type GraphQLOutputField<Source = any, Context = any, Args = any> = GraphQLField_graphql<Source, Context, Args>;
|
|
7
|
+
export type GraphQLField<Source = any, Context = any, Args = any> = GraphQLOutputField<Source, Context, Args> | GraphQLInputField;
|
|
8
|
+
export declare const isOutputField: (field: GraphQLField) => field is GraphQLOutputField;
|
|
9
|
+
export declare const isInputField: (field: GraphQLField) => field is GraphQLInputField;
|
|
10
|
+
export declare const isEntrypointType: (type: GraphQLNamedType) => type is GraphQLObjectType;
|
|
11
|
+
/**
|
|
12
|
+
* Checks if a GraphQLOutputType is expandable (object or interface type).
|
|
13
|
+
* This handles unwrapping non-null and list types to check the underlying named type.
|
|
14
|
+
*
|
|
15
|
+
* @param type - The GraphQL output type to check
|
|
16
|
+
* @returns True if the unwrapped type is either an object or interface type
|
|
17
|
+
*/
|
|
18
|
+
export declare const isExpandableType: (type: GraphQLOutputType) => boolean;
|
|
19
|
+
export type TypeWithFields = OutputTypeWithFields | InputTypeWithFields;
|
|
20
|
+
export type InputTypeWithFields = GraphQLInputObjectType;
|
|
21
|
+
export type OutputTypeWithFields = GraphQLInterfaceType | GraphQLObjectType;
|
|
22
|
+
export declare const isOutputTypeWithFields: (type: GraphQLNamedType) => type is OutputTypeWithFields;
|
|
23
|
+
export declare const isInputTypeWithFields: (type: GraphQLNamedType) => type is InputTypeWithFields;
|
|
24
|
+
export declare const isTypeWithFields: (type: GraphQLNamedType) => type is TypeWithFields;
|
|
25
|
+
export declare const isUsingInputArgumentPattern: (field: GraphQLOutputField) => boolean;
|
|
26
|
+
export declare const getIAP: (field: GraphQLOutputField) => GraphQLInputObjectType | null;
|
|
27
|
+
export declare const getFields: (type: TypeWithFields) => (GraphQLOutputField | GraphQLInputField)[];
|
|
28
|
+
export declare const getKindMap: (schema: GraphQLSchema) => KindMap;
|
|
29
|
+
export interface KindMap {
|
|
30
|
+
index: {
|
|
31
|
+
Root: {
|
|
32
|
+
query: GraphQLObjectType | null;
|
|
33
|
+
mutation: GraphQLObjectType | null;
|
|
34
|
+
subscription: GraphQLObjectType | null;
|
|
35
|
+
};
|
|
36
|
+
OutputObject: Record<string, GraphQLObjectType>;
|
|
37
|
+
InputObject: Record<string, GraphQLInputObjectType>;
|
|
38
|
+
Interface: Record<string, GraphQLInterfaceType>;
|
|
39
|
+
Union: Record<string, GraphQLUnionType>;
|
|
40
|
+
Enum: Record<string, GraphQLEnumType>;
|
|
41
|
+
ScalarCustom: Record<string, GraphQLScalarType>;
|
|
42
|
+
ScalarStandard: Record<string, GraphQLScalarType>;
|
|
43
|
+
};
|
|
44
|
+
list: {
|
|
45
|
+
Root: GraphQLObjectType[];
|
|
46
|
+
OutputObject: GraphQLObjectType[];
|
|
47
|
+
InputObject: GraphQLInputObjectType[];
|
|
48
|
+
Interface: GraphQLInterfaceType[];
|
|
49
|
+
Union: GraphQLUnionType[];
|
|
50
|
+
Enum: GraphQLEnumType[];
|
|
51
|
+
ScalarCustom: GraphQLScalarType[];
|
|
52
|
+
ScalarStandard: GraphQLScalarType[];
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export declare const standardScalarTypeNames: {
|
|
56
|
+
String: string;
|
|
57
|
+
ID: string;
|
|
58
|
+
Int: string;
|
|
59
|
+
Float: string;
|
|
60
|
+
Boolean: string;
|
|
61
|
+
};
|
|
62
|
+
export declare const isScalarTypeCustom: (node: GraphQLScalarType) => boolean;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GraphQL type guard utilities for checking and narrowing GraphQL types.
|
|
3
|
+
* This module provides type-safe helper functions for working with GraphQL types.
|
|
4
|
+
*/
|
|
5
|
+
import { getNamedType, isEnumType, isInputObjectType, isInterfaceType, isNonNullType, isObjectType, isScalarType, isUnionType, } from 'graphql';
|
|
6
|
+
import { includesUnknown } from '../prelude/main.js';
|
|
7
|
+
export const isOutputField = (field) => {
|
|
8
|
+
return `args` in field;
|
|
9
|
+
};
|
|
10
|
+
export const isInputField = (field) => {
|
|
11
|
+
return !isOutputField(field);
|
|
12
|
+
};
|
|
13
|
+
export const isEntrypointType = (type) => [`Query`, `Mutation`, `Subscription`].includes(type.name) && isObjectType(type);
|
|
14
|
+
/**
|
|
15
|
+
* Checks if a GraphQLOutputType is expandable (object or interface type).
|
|
16
|
+
* This handles unwrapping non-null and list types to check the underlying named type.
|
|
17
|
+
*
|
|
18
|
+
* @param type - The GraphQL output type to check
|
|
19
|
+
* @returns True if the unwrapped type is either an object or interface type
|
|
20
|
+
*/
|
|
21
|
+
export const isExpandableType = (type) => {
|
|
22
|
+
const namedType = getNamedType(type);
|
|
23
|
+
return isObjectType(namedType) || isInterfaceType(namedType);
|
|
24
|
+
};
|
|
25
|
+
export const isOutputTypeWithFields = (type) => {
|
|
26
|
+
return isInterfaceType(type) || isObjectType(type);
|
|
27
|
+
};
|
|
28
|
+
export const isInputTypeWithFields = (type) => {
|
|
29
|
+
return isInputObjectType(type);
|
|
30
|
+
};
|
|
31
|
+
export const isTypeWithFields = (type) => {
|
|
32
|
+
return isOutputTypeWithFields(type) || isInputTypeWithFields(type);
|
|
33
|
+
};
|
|
34
|
+
export const isUsingInputArgumentPattern = (field) => {
|
|
35
|
+
if (field.args.length !== 1)
|
|
36
|
+
return false;
|
|
37
|
+
const arg = field.args[0];
|
|
38
|
+
if (arg.name !== `input`)
|
|
39
|
+
return false;
|
|
40
|
+
if (isInputObjectType(arg))
|
|
41
|
+
return true;
|
|
42
|
+
if (isNonNullType(arg.type) && isInputObjectType(arg.type.ofType))
|
|
43
|
+
return true;
|
|
44
|
+
return false;
|
|
45
|
+
};
|
|
46
|
+
export const getIAP = (field) => {
|
|
47
|
+
if (!isUsingInputArgumentPattern(field))
|
|
48
|
+
return null;
|
|
49
|
+
// IAP could be non-null or nullable so need to unwrap case of it being non-null
|
|
50
|
+
return getNamedType(field.args[0].type);
|
|
51
|
+
};
|
|
52
|
+
export const getFields = (type) => {
|
|
53
|
+
return Object.values(type.getFields());
|
|
54
|
+
};
|
|
55
|
+
export const getKindMap = (schema) => {
|
|
56
|
+
const queryType = schema.getQueryType() ?? null;
|
|
57
|
+
const mutationType = schema.getMutationType() ?? null;
|
|
58
|
+
const subscriptionType = schema.getSubscriptionType() ?? null;
|
|
59
|
+
const rootTypeNames = [queryType?.name, mutationType?.name, subscriptionType?.name].filter(_ => _ !== undefined);
|
|
60
|
+
const typeMap = schema.getTypeMap();
|
|
61
|
+
const typeMapValues = Object.values(typeMap);
|
|
62
|
+
const kindMap = {
|
|
63
|
+
index: {
|
|
64
|
+
Root: {
|
|
65
|
+
query: queryType,
|
|
66
|
+
mutation: mutationType,
|
|
67
|
+
subscription: subscriptionType,
|
|
68
|
+
},
|
|
69
|
+
OutputObject: {},
|
|
70
|
+
InputObject: {},
|
|
71
|
+
Interface: {},
|
|
72
|
+
Union: {},
|
|
73
|
+
Enum: {},
|
|
74
|
+
ScalarCustom: {},
|
|
75
|
+
ScalarStandard: {},
|
|
76
|
+
},
|
|
77
|
+
list: {
|
|
78
|
+
Root: [queryType, mutationType, subscriptionType].filter(_ => _ !== null),
|
|
79
|
+
OutputObject: [],
|
|
80
|
+
InputObject: [],
|
|
81
|
+
Interface: [],
|
|
82
|
+
Union: [],
|
|
83
|
+
Enum: [],
|
|
84
|
+
ScalarCustom: [],
|
|
85
|
+
ScalarStandard: [],
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
for (const type of typeMapValues) {
|
|
89
|
+
if (type.name.startsWith(`__`))
|
|
90
|
+
continue;
|
|
91
|
+
switch (true) {
|
|
92
|
+
case isScalarType(type):
|
|
93
|
+
if (isScalarTypeCustom(type)) {
|
|
94
|
+
kindMap.list.ScalarCustom.push(type);
|
|
95
|
+
kindMap.index.ScalarCustom[type.name] = type;
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
kindMap.list.ScalarStandard.push(type);
|
|
99
|
+
kindMap.index.ScalarStandard[type.name] = type;
|
|
100
|
+
}
|
|
101
|
+
break;
|
|
102
|
+
case isEnumType(type):
|
|
103
|
+
kindMap.list.Enum.push(type);
|
|
104
|
+
kindMap.index.Enum[type.name] = type;
|
|
105
|
+
break;
|
|
106
|
+
case isInputObjectType(type):
|
|
107
|
+
kindMap.list.InputObject.push(type);
|
|
108
|
+
kindMap.index.InputObject[type.name] = type;
|
|
109
|
+
break;
|
|
110
|
+
case isInterfaceType(type):
|
|
111
|
+
kindMap.list.Interface.push(type);
|
|
112
|
+
kindMap.index.Interface[type.name] = type;
|
|
113
|
+
break;
|
|
114
|
+
case isObjectType(type):
|
|
115
|
+
if (!includesUnknown(rootTypeNames, type.name)) {
|
|
116
|
+
kindMap.list.OutputObject.push(type);
|
|
117
|
+
kindMap.index.OutputObject[type.name] = type;
|
|
118
|
+
}
|
|
119
|
+
break;
|
|
120
|
+
case isUnionType(type):
|
|
121
|
+
kindMap.list.Union.push(type);
|
|
122
|
+
kindMap.index.Union[type.name] = type;
|
|
123
|
+
break;
|
|
124
|
+
default:
|
|
125
|
+
// skip
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return kindMap;
|
|
130
|
+
};
|
|
131
|
+
export const standardScalarTypeNames = {
|
|
132
|
+
String: `String`,
|
|
133
|
+
ID: `ID`,
|
|
134
|
+
Int: `Int`,
|
|
135
|
+
Float: `Float`,
|
|
136
|
+
Boolean: `Boolean`,
|
|
137
|
+
};
|
|
138
|
+
export const isScalarTypeCustom = (node) => {
|
|
139
|
+
return !(node.name in standardScalarTypeNames);
|
|
140
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grafaid - GraphQL utility helpers
|
|
3
|
+
* A collection of type-safe utility functions for working with GraphQL types.
|
|
4
|
+
*/
|
|
5
|
+
// Re-export all utilities from the helpers module
|
|
6
|
+
export * from './helpers.js';
|
|
7
|
+
// Import and re-export as a namespace for users who want to use the Grafaid.* syntax
|
|
8
|
+
import * as Grafaid from './helpers.js';
|
|
9
|
+
export { Grafaid };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as H3 from 'h3';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as H3 from 'h3';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as Hono from './_exports.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as Hono from './_exports.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as SSG from 'hono/ssg';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as SSG from 'hono/ssg';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as Nitro from 'nitropack';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as Path from './main.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as Path from './main.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { basename, delimiter, dirname, extname, format, isAbsolute, join, normalize, parse, relative, resolve, sep, toNamespacedPath, } from 'node:path';
|
|
2
|
+
/**
|
|
3
|
+
* Make a path absolute if it isn't already
|
|
4
|
+
*
|
|
5
|
+
* @param filePath - The path to ensure is absolute
|
|
6
|
+
* @param basePath - The base path to resolve against (defaults to current working directory)
|
|
7
|
+
* @returns An absolute path
|
|
8
|
+
*/
|
|
9
|
+
export declare const absolutify: (filePath: string, basePath?: string) => string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as NodePath from 'node:path';
|
|
2
|
+
export { basename, delimiter, dirname, extname, format, isAbsolute, join, normalize, parse, relative, resolve, sep, toNamespacedPath, } from 'node:path';
|
|
3
|
+
/**
|
|
4
|
+
* Make a path absolute if it isn't already
|
|
5
|
+
*
|
|
6
|
+
* @param filePath - The path to ensure is absolute
|
|
7
|
+
* @param basePath - The base path to resolve against (defaults to current working directory)
|
|
8
|
+
* @returns An absolute path
|
|
9
|
+
*/
|
|
10
|
+
export const absolutify = (filePath, basePath = process.cwd()) => {
|
|
11
|
+
return NodePath.isAbsolute(filePath)
|
|
12
|
+
? filePath
|
|
13
|
+
: NodePath.resolve(basePath, filePath);
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as ReactRouter from 'react-router';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as ReactRouter from 'react-router';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ReactRouter } from './react-router/_namespace.js';
|
|
2
|
+
export declare const createRoute: <routeObject extends ReactRouter.RouteObject>(routeObject: routeObject) => routeObject;
|
|
3
|
+
export type IndexRouteObjectInput = Omit<ReactRouter.IndexRouteObject, `index` | `children`>;
|
|
4
|
+
export declare const createRouteIndex: (indexRouteObjectInput: IndexRouteObjectInput) => ReactRouter.IndexRouteObject;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const createRoute = (routeObject) => {
|
|
2
|
+
return {
|
|
3
|
+
id: routeObject.path,
|
|
4
|
+
...routeObject,
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export const createRouteIndex = (indexRouteObjectInput) => {
|
|
8
|
+
return {
|
|
9
|
+
...indexRouteObjectInput,
|
|
10
|
+
index: true,
|
|
11
|
+
children: undefined,
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as Rollup from 'rollup';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as Rollup from 'rollup';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TanStackRouterVite } from '@tanstack/router-plugin/vite';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TanStackRouterVite } from '@tanstack/router-plugin/vite';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as Vite from 'vite';
|
|
2
|
+
export * as VirtualIdentifier from './virtual-identifier.js';
|
|
3
|
+
type AnyFunction = (...args: any[]) => any;
|
|
4
|
+
export type HookLoadFn = Extract<Vite.Plugin[`load`], AnyFunction>;
|
|
5
|
+
export type HookLoadFnPure = OmitThisParameter<HookLoadFn>;
|
|
6
|
+
export type HookResolveIdFn = Extract<Vite.Plugin[`resolveId`], AnyFunction>;
|
|
7
|
+
export type HookResolveIdFnPure = OmitThisParameter<HookResolveIdFn>;
|
|
8
|
+
export type PartialEnvironment = Parameters<Exclude<Vite.Plugin[`applyToEnvironment`], undefined>>[0];
|
|
9
|
+
export * from 'vite';
|
|
10
|
+
export declare const defaultPort = 5173;
|
|
11
|
+
export declare const mergeRootConfig: (target: Vite.InlineConfig, source: Vite.InlineConfig) => Vite.InlineConfig;
|
|
12
|
+
export declare const EnvironmentName: {
|
|
13
|
+
client: string;
|
|
14
|
+
ssr: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const isEnvironmentSsr: (environment: PartialEnvironment) => boolean;
|
|
17
|
+
export declare const isEnvironmentClient: (environment: PartialEnvironment) => boolean;
|
|
18
|
+
export declare const ModeName: {
|
|
19
|
+
build: string;
|
|
20
|
+
dev: string;
|
|
21
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as Vite from 'vite';
|
|
2
|
+
export * as VirtualIdentifier from './virtual-identifier.js';
|
|
3
|
+
export * from 'vite';
|
|
4
|
+
export const defaultPort = 5173;
|
|
5
|
+
export const mergeRootConfig = (target, source) => Vite.mergeConfig(target, source);
|
|
6
|
+
export const EnvironmentName = {
|
|
7
|
+
client: `client`,
|
|
8
|
+
ssr: `ssr`,
|
|
9
|
+
};
|
|
10
|
+
export const isEnvironmentSsr = (environment) => {
|
|
11
|
+
// console.log(environment.name, EnvironmentName.ssr)
|
|
12
|
+
return environment.name === EnvironmentName.ssr;
|
|
13
|
+
};
|
|
14
|
+
export const isEnvironmentClient = (environment) => environment.name === EnvironmentName.client;
|
|
15
|
+
export const ModeName = {
|
|
16
|
+
build: `build`,
|
|
17
|
+
dev: `dev`,
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as Vite from './_exports.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as Vite from './_exports.js';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Vite } from './_namespace.js';
|
|
2
|
+
export declare const idPrefix = "virtual:";
|
|
3
|
+
export declare const resolvedPrefix = "\0";
|
|
4
|
+
export interface VirtualIdentifier {
|
|
5
|
+
id: string;
|
|
6
|
+
resolved: string;
|
|
7
|
+
namespace: string | null;
|
|
8
|
+
separator: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const createNamespaceFactory: (namespace: string, separator?: string) => (idOrIdSegments: string | string[]) => VirtualIdentifier;
|
|
11
|
+
export declare const toHookResolveId: (virtualIdentifier: VirtualIdentifier) => Vite.HookResolveIdFnPure;
|
|
12
|
+
export declare const toHookLoad: (virtualIdentifier: VirtualIdentifier, loader: Vite.HookLoadFnPure) => Vite.HookLoadFnPure;
|
|
13
|
+
export declare const toHooks: (virtualIdentifier: VirtualIdentifier, loader: Vite.HookLoadFnPure) => Pick<Vite.Plugin, `resolveId` | `load`>;
|
|
14
|
+
type VirtualIdentifierToLoaderMap = Map<VirtualIdentifier, Vite.HookLoadFnPure>;
|
|
15
|
+
export declare const toHookLoad$FromMap: (virtualIdentifierToLoaderMap: VirtualIdentifierToLoaderMap) => Vite.HookLoadFnPure;
|
|
16
|
+
export declare const toHookResolveId$FromMap: (virtualIdentifierToLoaderMap: VirtualIdentifierToLoaderMap) => Vite.HookResolveIdFnPure;
|
|
17
|
+
export declare const toHooks$FromMap: (virtualIdentifierToLoaderMap: VirtualIdentifierToLoaderMap) => {
|
|
18
|
+
resolveId: Vite.HookResolveIdFnPure;
|
|
19
|
+
load: Vite.HookLoadFnPure;
|
|
20
|
+
};
|
|
21
|
+
export {};
|