create-baeta 1.0.8 → 1.0.11
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/CHANGELOG.md +12 -0
- package/dist/chunk-YE4HGCCO.js +878 -0
- package/dist/chunk-YE4HGCCO.js.map +1 -0
- package/dist/cli.js +2 -2
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +8 -33
- package/dist/index.js +5 -9
- package/package.json +13 -22
- package/templates/apollo.ts +43 -0
- package/templates/shared.ts +346 -0
- package/templates/yoga.ts +133 -0
- package/dist/chunk-D5XH6R2Q.js +0 -491
- package/dist/chunk-D5XH6R2Q.js.map +0 -1
- package/templates/apollo/src/app.ts +0 -19
- package/templates/apollo/src/types/context.ts +0 -3
- package/templates/shared/baeta.ts +0 -19
- package/templates/shared/src/lib/extensions.ts +0 -17
- package/templates/shared/src/modules/user/user.gql +0 -16
- package/templates/shared/src/modules/user/user.resolvers.ts +0 -26
- package/templates/shared/src/modules/user-photos/user-photos.gql +0 -9
- package/templates/shared/src/modules/user-photos/user-photos.resolvers.ts +0 -11
- package/templates/yoga/src/app.bun.ts +0 -22
- package/templates/yoga/src/app.deno.ts +0 -25
- package/templates/yoga/src/app.node.ts +0 -22
- package/templates/yoga/src/types/context.ts +0 -6
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { getUserPhotosModule } from './typedef.ts';
|
|
2
|
-
|
|
3
|
-
const { User } = getUserPhotosModule();
|
|
4
|
-
|
|
5
|
-
User.photos(({ root }) => {
|
|
6
|
-
return Array.from({ length: 10 }).map((_, i) => ({
|
|
7
|
-
id: `u${root.id}_p${i}`,
|
|
8
|
-
userId: root.id,
|
|
9
|
-
url: `https://baeta.io/user/${root.id}/photo/${i}.png`,
|
|
10
|
-
}));
|
|
11
|
-
});
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { createApplication } from '@baeta/core';
|
|
2
|
-
import { createYoga } from 'graphql-yoga';
|
|
3
|
-
import { modules } from './modules/autoload.ts';
|
|
4
|
-
import type { Context, ServerContext } from './types/context.ts';
|
|
5
|
-
|
|
6
|
-
const baeta = createApplication({
|
|
7
|
-
modules,
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export const yoga = createYoga<ServerContext, Context>({
|
|
11
|
-
schema: baeta.schema,
|
|
12
|
-
context: {
|
|
13
|
-
appVersion: '1.0.0',
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
Bun.serve({
|
|
18
|
-
fetch: yoga.fetch,
|
|
19
|
-
port: 4000,
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
console.log(`🚀 Server ready at http://localhost:4000${yoga.graphqlEndpoint}`);
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { createApplication } from '@baeta/core';
|
|
2
|
-
import { createYoga } from 'graphql-yoga';
|
|
3
|
-
import { modules } from './modules/autoload.ts';
|
|
4
|
-
import type { Context, ServerContext } from './types/context.ts';
|
|
5
|
-
|
|
6
|
-
const baeta = createApplication({
|
|
7
|
-
modules,
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export const yoga = createYoga<ServerContext, Context>({
|
|
11
|
-
schema: baeta.schema,
|
|
12
|
-
context: {
|
|
13
|
-
appVersion: '1.0.0',
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
Deno.serve(
|
|
18
|
-
{
|
|
19
|
-
port: 4000,
|
|
20
|
-
onListen() {
|
|
21
|
-
console.log(`🚀 Server ready at http://localhost:4000${yoga.graphqlEndpoint}`);
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
yoga.fetch,
|
|
25
|
-
);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { createServer } from 'node:http';
|
|
2
|
-
import { createApplication } from '@baeta/core';
|
|
3
|
-
import { createYoga } from 'graphql-yoga';
|
|
4
|
-
import { modules } from './modules/autoload.ts';
|
|
5
|
-
import type { Context, ServerContext } from './types/context.ts';
|
|
6
|
-
|
|
7
|
-
const baeta = createApplication({
|
|
8
|
-
modules,
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
export const yoga = createYoga<ServerContext, Context>({
|
|
12
|
-
schema: baeta.schema,
|
|
13
|
-
context: {
|
|
14
|
-
appVersion: '1.0.0',
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
const server = createServer(yoga);
|
|
19
|
-
|
|
20
|
-
server.listen(4000, () => {
|
|
21
|
-
console.log(`🚀 Server ready at http://localhost:4000${yoga.graphqlEndpoint}`);
|
|
22
|
-
});
|