create-baeta 1.0.11 → 2.0.0-next.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/CHANGELOG.md +20 -0
- package/dist/{chunk-YE4HGCCO.js → chunk-CKNLELYM.js} +135 -100
- package/dist/chunk-CKNLELYM.js.map +1 -0
- package/dist/cli.js +3 -3
- package/dist/cli.js.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +11 -11
- package/templates/apollo.ts +1 -1
- package/templates/shared.ts +83 -43
- package/templates/yoga.ts +3 -3
- package/dist/chunk-YE4HGCCO.js.map +0 -1
- package/dist/cli.d.ts +0 -1
- package/dist/index.d.ts +0 -45
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# create-baeta
|
|
2
2
|
|
|
3
|
+
## 2.0.0-next.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fix release version
|
|
8
|
+
|
|
9
|
+
## 2.0.0-next.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- [#214](https://github.com/andreisergiu98/baeta/pull/214) [`31d1a50`](https://github.com/andreisergiu98/baeta/commit/31d1a509f96535b43ae85d19c770eb1a5f09dc94) Thanks [@andreisergiu98](https://github.com/andreisergiu98)! - Baeta v2 – major refactor
|
|
14
|
+
- **Side-effect-free type generation & resolver definitions.**
|
|
15
|
+
The types generator and resolver definitions were reworked to be side-effect free, improving type safety.
|
|
16
|
+
- **Stricter type safety.**
|
|
17
|
+
You must now **explicitly define resolvers for every field** during development—breakages that used to surface at runtime are now caught at compile time.
|
|
18
|
+
- **Removed `@baeta/compiler`.**
|
|
19
|
+
Since modern runtimes can execute TypeScript natively, the separate compiler package is no longer needed. Use your runtime’s native TS support or your existing build setup.
|
|
20
|
+
- **Subscriptions update.**
|
|
21
|
+
`@baeta/subscriptions-pubsub` now targets **`graphql-subscriptions` v3**.
|
|
22
|
+
|
|
3
23
|
## 1.0.11
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -172,11 +172,11 @@ var package_default = {
|
|
|
172
172
|
private: true,
|
|
173
173
|
type: "module",
|
|
174
174
|
scripts: {
|
|
175
|
-
build: "baeta
|
|
176
|
-
start: "baeta
|
|
175
|
+
build: "baeta generate",
|
|
176
|
+
start: "baeta generate --watch --run='node --watch --enable-source-maps --inspect src/app.ts'"
|
|
177
177
|
},
|
|
178
178
|
dependencies: {
|
|
179
|
-
"@apollo/server": "^
|
|
179
|
+
"@apollo/server": "^5.0.0",
|
|
180
180
|
"@baeta/core": "workspace:^",
|
|
181
181
|
"@baeta/errors": "workspace:^",
|
|
182
182
|
"@baeta/extension-complexity": "workspace:^",
|
|
@@ -184,12 +184,10 @@ var package_default = {
|
|
|
184
184
|
},
|
|
185
185
|
devDependencies: {
|
|
186
186
|
"@baeta/cli": "workspace:^",
|
|
187
|
-
"@
|
|
188
|
-
"@
|
|
189
|
-
"@types/
|
|
190
|
-
|
|
191
|
-
"@types/node": "^22.15.21",
|
|
192
|
-
typescript: "^5.8.3"
|
|
187
|
+
"@types/bun": "^1.3.0",
|
|
188
|
+
"@types/deno": "^2.5.0",
|
|
189
|
+
"@types/node": "^22.18.11",
|
|
190
|
+
typescript: "^5.9.3"
|
|
193
191
|
}
|
|
194
192
|
};
|
|
195
193
|
|
|
@@ -202,53 +200,52 @@ var tsconfig_default = {
|
|
|
202
200
|
"es2024"
|
|
203
201
|
],
|
|
204
202
|
module: "esnext",
|
|
203
|
+
moduleResolution: "bundler",
|
|
205
204
|
noEmit: true,
|
|
206
205
|
strict: true,
|
|
207
206
|
noImplicitAny: true,
|
|
207
|
+
erasableSyntaxOnly: true,
|
|
208
208
|
isolatedModules: true,
|
|
209
209
|
esModuleInterop: true,
|
|
210
210
|
verbatimModuleSyntax: true,
|
|
211
211
|
allowImportingTsExtensions: true,
|
|
212
212
|
allowSyntheticDefaultImports: true,
|
|
213
213
|
skipLibCheck: true,
|
|
214
|
-
forceConsistentCasingInFileNames: true
|
|
215
|
-
moduleResolution: "bundler"
|
|
214
|
+
forceConsistentCasingInFileNames: true
|
|
216
215
|
}
|
|
217
216
|
};
|
|
218
217
|
|
|
219
218
|
// versions.json
|
|
220
219
|
var versions_default = {
|
|
221
|
-
"@baeta/cli": "
|
|
222
|
-
"@baeta/
|
|
223
|
-
"
|
|
224
|
-
"
|
|
225
|
-
"@baeta/
|
|
226
|
-
"@baeta/
|
|
227
|
-
"@baeta/
|
|
228
|
-
"@baeta/extension-
|
|
229
|
-
"@baeta/extension-cache": "
|
|
230
|
-
"@baeta/extension-cache-
|
|
231
|
-
"@baeta/extension-cache-
|
|
232
|
-
"@baeta/extension-cache-
|
|
233
|
-
"@baeta/extension-
|
|
234
|
-
"@baeta/
|
|
235
|
-
"@baeta/generator": "
|
|
236
|
-
"@baeta/
|
|
237
|
-
"@baeta/plugin": "
|
|
238
|
-
"@baeta/plugin-
|
|
239
|
-
"@baeta/plugin-
|
|
240
|
-
"@baeta/plugin-
|
|
241
|
-
"@baeta/plugin-
|
|
242
|
-
"@baeta/plugin-
|
|
243
|
-
"@baeta/plugin-
|
|
244
|
-
"@baeta/
|
|
245
|
-
"@baeta/
|
|
246
|
-
"@baeta/
|
|
247
|
-
"@baeta/
|
|
248
|
-
"@baeta/util-
|
|
249
|
-
"@baeta/util-
|
|
250
|
-
"@baeta/util-log": "1.0.1",
|
|
251
|
-
"@baeta/util-path": "1.0.1"
|
|
220
|
+
"@baeta/cli": "2.0.0-next.1",
|
|
221
|
+
"@baeta/core": "2.0.0-next.1",
|
|
222
|
+
"create-baeta": "2.0.0-next.1",
|
|
223
|
+
"@baeta/directives": "2.0.0-next.1",
|
|
224
|
+
"@baeta/env": "2.0.0-next.1",
|
|
225
|
+
"@baeta/errors": "2.0.0-next.1",
|
|
226
|
+
"@baeta/extension-auth": "2.0.0-next.1",
|
|
227
|
+
"@baeta/extension-cache": "2.0.0-next.1",
|
|
228
|
+
"@baeta/extension-cache-cloudflare": "2.0.0-next.1",
|
|
229
|
+
"@baeta/extension-cache-keyv": "2.0.0-next.1",
|
|
230
|
+
"@baeta/extension-cache-redis": "2.0.0-next.1",
|
|
231
|
+
"@baeta/extension-cache-upstash": "2.0.0-next.1",
|
|
232
|
+
"@baeta/extension-complexity": "2.0.0-next.1",
|
|
233
|
+
"@baeta/generator": "2.0.0-next.1",
|
|
234
|
+
"@baeta/generator-sdk": "2.0.0-next.1",
|
|
235
|
+
"@baeta/plugin": "2.0.0-next.1",
|
|
236
|
+
"@baeta/plugin-cloudflare": "2.0.0-next.1",
|
|
237
|
+
"@baeta/plugin-directives": "2.0.0-next.1",
|
|
238
|
+
"@baeta/plugin-exec": "2.0.0-next.1",
|
|
239
|
+
"@baeta/plugin-gitignore": "2.0.0-next.1",
|
|
240
|
+
"@baeta/plugin-graphql": "2.0.0-next.1",
|
|
241
|
+
"@baeta/plugin-pagination": "2.0.0-next.1",
|
|
242
|
+
"@baeta/plugin-prisma": "2.0.0-next.1",
|
|
243
|
+
"@baeta/subscriptions-cloudflare": "0.2.0-next.1",
|
|
244
|
+
"@baeta/subscriptions-pubsub": "2.0.0-next.1",
|
|
245
|
+
"@baeta/util-encoding": "2.0.0-next.1",
|
|
246
|
+
"@baeta/util-env": "2.0.0-next.1",
|
|
247
|
+
"@baeta/util-log": "2.0.0-next.1",
|
|
248
|
+
"@baeta/util-path": "2.0.0-next.1"
|
|
252
249
|
};
|
|
253
250
|
|
|
254
251
|
// templates/shared.ts
|
|
@@ -274,7 +271,7 @@ function makeSharedTemplate(appName, runtime, packageJson) {
|
|
|
274
271
|
)
|
|
275
272
|
},
|
|
276
273
|
{
|
|
277
|
-
relativePath: "./src/
|
|
274
|
+
relativePath: "./src/modules/extensions.ts",
|
|
278
275
|
content: `import { createExtensions } from '@baeta/core';
|
|
279
276
|
import { complexityExtension } from '@baeta/extension-complexity';
|
|
280
277
|
import type { Context } from '../types/context.ts';
|
|
@@ -291,7 +288,9 @@ const complexity = complexityExtension<Context>({
|
|
|
291
288
|
},
|
|
292
289
|
});
|
|
293
290
|
|
|
294
|
-
export default createExtensions(
|
|
291
|
+
export default createExtensions({
|
|
292
|
+
complexityExtension: complexity
|
|
293
|
+
});
|
|
295
294
|
`
|
|
296
295
|
},
|
|
297
296
|
{
|
|
@@ -315,33 +314,51 @@ type Query {
|
|
|
315
314
|
`
|
|
316
315
|
},
|
|
317
316
|
{
|
|
318
|
-
relativePath: "./src/modules/user/
|
|
319
|
-
content: `import {
|
|
320
|
-
|
|
321
|
-
const { Query } =
|
|
322
|
-
|
|
323
|
-
Query.user
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
}
|
|
329
|
-
})
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
317
|
+
relativePath: "./src/modules/user/index.ts",
|
|
318
|
+
content: `import { UserModule } from './typedef.ts';
|
|
319
|
+
|
|
320
|
+
const { Query, User } = UserModule;
|
|
321
|
+
|
|
322
|
+
const userQuery = Query.user
|
|
323
|
+
.use(async (next, { args }) => {
|
|
324
|
+
const result = await next();
|
|
325
|
+
console.log('Got user:', result, 'for args:', args);
|
|
326
|
+
return result;
|
|
327
|
+
})
|
|
328
|
+
.resolve(({ args }) => {
|
|
329
|
+
return {
|
|
330
|
+
id: args.where.id,
|
|
331
|
+
email: 'jon.doe@baeta.io',
|
|
332
|
+
lastName: 'Doe',
|
|
333
|
+
givenName: null,
|
|
334
|
+
profile: null,
|
|
335
|
+
};
|
|
336
|
+
});
|
|
336
337
|
|
|
337
|
-
Query.users(() => {
|
|
338
|
+
const usersQuery = Query.users.resolve(() => {
|
|
338
339
|
const users = Array.from({ length: 10 }).map((_, i) => ({
|
|
339
340
|
id: i.toString(),
|
|
340
341
|
email: \`jon.doe\${i}@baeta.io\`,
|
|
341
342
|
lastName: \`Doe \${i}\`,
|
|
343
|
+
givenName: null,
|
|
344
|
+
profile: null,
|
|
342
345
|
}));
|
|
343
346
|
return users;
|
|
344
347
|
});
|
|
348
|
+
|
|
349
|
+
export default UserModule.$schema({
|
|
350
|
+
User: User.$fields({
|
|
351
|
+
id: User.id.key('id'),
|
|
352
|
+
email: User.email.key('email'),
|
|
353
|
+
lastName: User.lastName.key('lastName'),
|
|
354
|
+
givenName: User.givenName.key('givenName').undefinedAsNull(),
|
|
355
|
+
profile: User.profile.key('profile').undefinedAsNull(),
|
|
356
|
+
}),
|
|
357
|
+
Query: Query.$fields({
|
|
358
|
+
user: userQuery,
|
|
359
|
+
users: usersQuery,
|
|
360
|
+
}),
|
|
361
|
+
});
|
|
345
362
|
`
|
|
346
363
|
},
|
|
347
364
|
{
|
|
@@ -358,40 +375,60 @@ extend type User {
|
|
|
358
375
|
`
|
|
359
376
|
},
|
|
360
377
|
{
|
|
361
|
-
relativePath: "./src/modules/user-photos/
|
|
362
|
-
content: `import {
|
|
378
|
+
relativePath: "./src/modules/user-photos/index.ts",
|
|
379
|
+
content: `import { UserPhotosModule } from './typedef.ts';
|
|
380
|
+
|
|
381
|
+
const { User, UserPhoto } = UserPhotosModule;
|
|
382
|
+
|
|
383
|
+
export default UserPhotosModule.$schema({
|
|
384
|
+
User: User.$fields({
|
|
385
|
+
photos: User.photos.resolve(({ source }) => {
|
|
386
|
+
return Array.from({ length: 10 }).map((_, i) => ({
|
|
387
|
+
id: \`u\${source.id}_p\${i}\`,
|
|
388
|
+
userId: source.id,
|
|
389
|
+
url: \`https://baeta.io/user/\${source.id}/photo/\${i}.png\`,
|
|
390
|
+
}));
|
|
391
|
+
}),
|
|
392
|
+
}),
|
|
393
|
+
UserPhoto: UserPhoto.$fields({
|
|
394
|
+
id: UserPhoto.id.key('id'),
|
|
395
|
+
url: UserPhoto.url.key('url'),
|
|
396
|
+
userId: UserPhoto.userId.key('userId'),
|
|
397
|
+
}),
|
|
398
|
+
});
|
|
399
|
+
`
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
relativePath: "./src/modules/types.ts",
|
|
403
|
+
content: `import type { GraphQLResolveInfo } from 'graphql';
|
|
404
|
+
import type { BaseObjectTypes, BaseScalars } from '../__generated__/utility.ts';
|
|
405
|
+
import type { Context } from '../types/context.ts';
|
|
363
406
|
|
|
364
|
-
|
|
407
|
+
export interface Scalars extends BaseScalars {}
|
|
365
408
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
id:
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
409
|
+
export interface ObjectTypes extends BaseObjectTypes {
|
|
410
|
+
User: {
|
|
411
|
+
id: string;
|
|
412
|
+
email: string;
|
|
413
|
+
lastName: string;
|
|
414
|
+
givenName?: string | null;
|
|
415
|
+
profile?: string | null;
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
export type Ctx = Context;
|
|
420
|
+
|
|
421
|
+
export type Info = GraphQLResolveInfo;
|
|
373
422
|
`
|
|
374
423
|
},
|
|
375
424
|
{
|
|
376
425
|
relativePath: "./baeta.ts",
|
|
377
426
|
content: `import { defineConfig } from '@baeta/cli';
|
|
378
|
-
import { autoloadPlugin } from '@baeta/plugin-autoload';
|
|
379
427
|
|
|
380
428
|
export default defineConfig({
|
|
381
429
|
graphql: {
|
|
382
430
|
schemas: ['src/**/*.gql'],
|
|
383
|
-
contextType: 'src/types/context#Context',
|
|
384
|
-
extensions: 'src/lib/extensions.ts',
|
|
385
|
-
},
|
|
386
|
-
compiler: {
|
|
387
|
-
src: 'src/app.ts',
|
|
388
|
-
dist: 'dist',
|
|
389
|
-
bundleWorkspaces: true,
|
|
390
|
-
esbuild: {
|
|
391
|
-
format: 'esm',
|
|
392
|
-
},
|
|
393
431
|
},
|
|
394
|
-
plugins: [autoloadPlugin()],
|
|
395
432
|
});
|
|
396
433
|
`
|
|
397
434
|
},
|
|
@@ -583,7 +620,7 @@ async function makeApolloTemplate(appName, runtime) {
|
|
|
583
620
|
content: `import { ApolloServer } from '@apollo/server';
|
|
584
621
|
import { startStandaloneServer } from '@apollo/server/standalone';
|
|
585
622
|
import { createApplication } from '@baeta/core';
|
|
586
|
-
import
|
|
623
|
+
import modules from './modules/index.ts';
|
|
587
624
|
import type { Context } from './types/context.ts';
|
|
588
625
|
|
|
589
626
|
const baeta = createApplication({
|
|
@@ -611,24 +648,22 @@ var package_default2 = {
|
|
|
611
648
|
private: true,
|
|
612
649
|
type: "module",
|
|
613
650
|
scripts: {
|
|
614
|
-
build: "baeta
|
|
615
|
-
start: "baeta
|
|
651
|
+
build: "baeta generate",
|
|
652
|
+
start: "baeta generate --watch --run='node --watch --enable-source-maps --inspect src/app.ts'"
|
|
616
653
|
},
|
|
617
654
|
dependencies: {
|
|
618
655
|
"@baeta/core": "workspace:^",
|
|
619
656
|
"@baeta/errors": "workspace:^",
|
|
620
657
|
"@baeta/extension-complexity": "workspace:^",
|
|
621
658
|
graphql: "^16.11.0",
|
|
622
|
-
"graphql-yoga": "^5.
|
|
659
|
+
"graphql-yoga": "^5.16.0"
|
|
623
660
|
},
|
|
624
661
|
devDependencies: {
|
|
625
662
|
"@baeta/cli": "workspace:^",
|
|
626
|
-
"@
|
|
627
|
-
"@
|
|
628
|
-
"@types/
|
|
629
|
-
|
|
630
|
-
"@types/node": "^22.15.21",
|
|
631
|
-
typescript: "^5.8.3"
|
|
663
|
+
"@types/bun": "^1.3.0",
|
|
664
|
+
"@types/deno": "^2.5.0",
|
|
665
|
+
"@types/node": "^22.18.11",
|
|
666
|
+
typescript: "^5.9.3"
|
|
632
667
|
}
|
|
633
668
|
};
|
|
634
669
|
|
|
@@ -667,7 +702,7 @@ function makeBunFiles() {
|
|
|
667
702
|
relativePath: "./src/app.ts",
|
|
668
703
|
content: `import { createApplication } from '@baeta/core';
|
|
669
704
|
import { createYoga } from 'graphql-yoga';
|
|
670
|
-
import
|
|
705
|
+
import modules from './modules/index.ts';
|
|
671
706
|
import type { Context, ServerContext } from './types/context.ts';
|
|
672
707
|
|
|
673
708
|
const baeta = createApplication({
|
|
@@ -697,7 +732,7 @@ function makeDenoFiles() {
|
|
|
697
732
|
relativePath: "./src/app.ts",
|
|
698
733
|
content: `import { createApplication } from '@baeta/core';
|
|
699
734
|
import { createYoga } from 'graphql-yoga';
|
|
700
|
-
import
|
|
735
|
+
import modules from './modules/index.ts';
|
|
701
736
|
import type { Context, ServerContext } from './types/context.ts';
|
|
702
737
|
|
|
703
738
|
const baeta = createApplication({
|
|
@@ -731,7 +766,7 @@ function makeNodeFiles() {
|
|
|
731
766
|
content: `import { createServer } from 'node:http';
|
|
732
767
|
import { createApplication } from '@baeta/core';
|
|
733
768
|
import { createYoga } from 'graphql-yoga';
|
|
734
|
-
import
|
|
769
|
+
import modules from './modules/index.ts';
|
|
735
770
|
import type { Context, ServerContext } from './types/context.ts';
|
|
736
771
|
|
|
737
772
|
const baeta = createApplication({
|
|
@@ -851,7 +886,7 @@ code=${`${pkgManager} install`}`;
|
|
|
851
886
|
Starts the development server.
|
|
852
887
|
|
|
853
888
|
code=${`${pkgManager} ${useRunCommand ? "run " : ""}build`}
|
|
854
|
-
|
|
889
|
+
Generates the Baeta application.
|
|
855
890
|
|
|
856
891
|
We recommend that you begin by typing:
|
|
857
892
|
|
|
@@ -875,4 +910,4 @@ export {
|
|
|
875
910
|
copyTemplate,
|
|
876
911
|
handler
|
|
877
912
|
};
|
|
878
|
-
//# sourceMappingURL=chunk-
|
|
913
|
+
//# sourceMappingURL=chunk-CKNLELYM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../lib/constants.ts","../lib/app-name.ts","../lib/package-manager.ts","../lib/runtime.ts","../lib/templates.ts","../meta/apollo/package.json","../../../tools/tsconfig/tsconfig.json","../versions.json","../templates/shared.ts","../templates/apollo.ts","../meta/yoga/package.json","../templates/yoga.ts","../lib/handler.ts"],"sourcesContent":["export const defaultPackageManager = 'npm';\n\nexport const lockfileNames = {\n\tnpm: 'package-lock.json',\n\tyarn: 'yarn.lock',\n\tpnpm: 'pnpm-lock.yaml',\n\tbun: 'bun.lockb',\n};\n\nexport const packageManagers = Object.keys(lockfileNames) as PackageManager[];\n\nexport type PackageManager = keyof typeof lockfileNames;\n\nexport const runtimes = ['node', 'deno', 'bun'] as const;\n\nexport type JavaScriptRuntime = (typeof runtimes)[number];\n\nexport const defaultJavaScriptRuntime = 'node';\n\nexport const templates = ['yoga', 'apollo'] as const;\nexport type Template = (typeof templates)[number];\n","import path from 'node:path';\nimport { logger } from '@docusaurus/logger';\nimport fs from 'fs-extra';\nimport prompts from 'prompts';\n\nexport async function getAppName(reqName: string | undefined, rootDir: string): Promise<string> {\n\tasync function validateAppName(appName: string) {\n\t\tif (!appName) {\n\t\t\treturn 'An app name is required.';\n\t\t}\n\t\tconst dest = path.resolve(rootDir, appName);\n\t\tif (await fs.pathExists(dest)) {\n\t\t\treturn logger.interpolate`Directory already exists at path=${dest}!`;\n\t\t}\n\t\treturn true;\n\t}\n\n\tif (reqName) {\n\t\tconst res = await validateAppName(reqName);\n\t\tif (typeof res === 'string') {\n\t\t\tthrow new Error(res);\n\t\t}\n\t\treturn reqName;\n\t}\n\n\treturn prompts(\n\t\t{\n\t\t\ttype: 'text',\n\t\t\tname: 'appName',\n\t\t\tmessage: 'What should we name this app?',\n\t\t\tinitial: 'baeta-app',\n\t\t\tvalidate: validateAppName,\n\t\t},\n\t\t{\n\t\t\tonCancel() {\n\t\t\t\tlogger.error('An app name is required.');\n\t\t\t\tprocess.exit(1);\n\t\t\t},\n\t\t},\n\t).then((result) => (result as { appName: string }).appName);\n}\n","import path from 'node:path';\nimport { logger } from '@docusaurus/logger';\nimport fs from 'fs-extra';\nimport prompts from 'prompts';\nimport shell from 'shelljs';\nimport type { CliOptions } from './cli-options.ts';\nimport {\n\tdefaultPackageManager,\n\tlockfileNames,\n\ttype PackageManager,\n\tpackageManagers,\n} from './constants.ts';\n\nasync function findPackageManagerFromLockFile(\n\trootDir: string,\n): Promise<PackageManager | undefined> {\n\tfor (const packageManager of packageManagers) {\n\t\tconst lockFilePath = path.join(rootDir, lockfileNames[packageManager]);\n\t\tif (await fs.pathExists(lockFilePath)) {\n\t\t\treturn packageManager;\n\t\t}\n\t}\n\treturn undefined;\n}\n\nfunction findPackageManagerFromUserAgent(): PackageManager | undefined {\n\treturn packageManagers.find((packageManager) =>\n\t\tprocess.env.npm_config_user_agent?.startsWith(packageManager),\n\t);\n}\n\nasync function askForPackageManagerChoice(): Promise<PackageManager> {\n\tconst hasYarn = shell.exec('yarn --version', { silent: true }).code === 0;\n\tconst hasPnpm = shell.exec('pnpm --version', { silent: true }).code === 0;\n\tconst hasBun = shell.exec('bun --version', { silent: true }).code === 0;\n\n\tif (!hasYarn && !hasPnpm && !hasBun) {\n\t\treturn 'npm';\n\t}\n\tconst choices = ['npm', hasYarn && 'yarn', hasPnpm && 'pnpm', hasBun && 'bun']\n\t\t.filter((p): p is string => Boolean(p))\n\t\t.map((p) => ({ title: p, value: p }));\n\n\tconst manager = await prompts(\n\t\t{\n\t\t\ttype: 'select',\n\t\t\tname: 'packageManager',\n\t\t\tmessage: 'Select a package manager...',\n\t\t\tchoices,\n\t\t},\n\t\t{\n\t\t\tonCancel() {\n\t\t\t\tlogger.info`Falling back to name=${defaultPackageManager}`;\n\t\t\t},\n\t\t},\n\t).then((result) => (result as { packageManager?: PackageManager }).packageManager);\n\n\treturn manager ?? defaultPackageManager;\n}\n\nexport async function getPackageManager(\n\tdest: string,\n\t{ packageManager, skipInstall }: CliOptions,\n): Promise<PackageManager> {\n\tif (packageManager && !packageManagers.includes(packageManager)) {\n\t\tthrow new Error(\n\t\t\t`Invalid package manager choice ${packageManager}. Must be one of ${packageManagers.join(\n\t\t\t\t', ',\n\t\t\t)}`,\n\t\t);\n\t}\n\n\tconst fromLockfile = await findPackageManagerFromLockFile(dest);\n\n\tif (fromLockfile) {\n\t\treturn fromLockfile;\n\t}\n\n\tif (packageManager) {\n\t\treturn packageManager;\n\t}\n\n\tconst fromLockfileInCwd = await findPackageManagerFromLockFile('.');\n\n\tif (fromLockfileInCwd) {\n\t\treturn fromLockfileInCwd;\n\t}\n\n\tconst fromUserAgent = findPackageManagerFromUserAgent();\n\n\tif (fromUserAgent) {\n\t\treturn fromUserAgent;\n\t}\n\n\tif (skipInstall) {\n\t\treturn defaultPackageManager;\n\t}\n\n\treturn askForPackageManagerChoice();\n}\n\nexport function getInstallCommand(pkgManager: PackageManager): string {\n\tif (pkgManager === 'yarn') {\n\t\treturn 'yarn';\n\t}\n\tif (pkgManager === 'bun') {\n\t\treturn 'bun install';\n\t}\n\treturn `${pkgManager} install --color always`;\n}\n","import { logger } from '@docusaurus/logger';\nimport prompts from 'prompts';\nimport shell from 'shelljs';\nimport { defaultJavaScriptRuntime, type JavaScriptRuntime } from './constants.ts';\n\nexport async function getRuntime(): Promise<JavaScriptRuntime> {\n\tconst hasBun = shell.exec('bun --version', { silent: true }).code === 0;\n\tconst hasDeno = shell.exec('deno --version', { silent: true }).code === 0;\n\n\tif (!hasDeno && !hasBun) {\n\t\treturn 'node';\n\t}\n\tconst choices = ['node', hasBun && 'bun', hasDeno && 'deno']\n\t\t.filter((p): p is string => Boolean(p))\n\t\t.map((p) => ({ title: p, value: p }));\n\n\tconst runtime = await prompts(\n\t\t{\n\t\t\ttype: 'select',\n\t\t\tname: 'runtime',\n\t\t\tmessage: 'Select a runtime...',\n\t\t\tchoices,\n\t\t},\n\t\t{\n\t\t\tonCancel() {\n\t\t\t\tlogger.info`Falling back to name=${defaultJavaScriptRuntime}`;\n\t\t\t},\n\t\t},\n\t).then((result) => (result as { runtime?: JavaScriptRuntime }).runtime);\n\n\treturn runtime ?? defaultJavaScriptRuntime;\n}\n","import path from 'node:path';\nimport { logger } from '@docusaurus/logger';\nimport fs from 'fs-extra';\nimport prompts, { type Choice } from 'prompts';\nimport { makeApolloTemplate } from '../templates/apollo.ts';\nimport { makeYogaTemplate } from '../templates/yoga.ts';\nimport { type JavaScriptRuntime, type Template, templates } from './constants.ts';\n\nfunction createTemplateChoices(): Choice[] {\n\treturn templates.map((template) => ({ title: template, value: template }));\n}\n\nasync function askTemplateChoice() {\n\treturn prompts(\n\t\t{\n\t\t\ttype: 'select',\n\t\t\tname: 'template',\n\t\t\tmessage: 'Select a template below...',\n\t\t\tchoices: createTemplateChoices(),\n\t\t},\n\t\t{\n\t\t\tonCancel() {\n\t\t\t\tlogger.error('A choice is required.');\n\t\t\t\tprocess.exit(1);\n\t\t\t},\n\t\t},\n\t).then((result) => {\n\t\treturn (result as { template: Template }).template;\n\t});\n}\n\nexport async function getTemplate(reqTemplate: string | undefined) {\n\tconst userProvided = reqTemplate ? templates.find((t) => t === reqTemplate) : null;\n\tconst template = userProvided ?? (await askTemplateChoice());\n\n\tif (!template) {\n\t\tthrow new Error('Template not found');\n\t}\n\n\treturn template;\n}\n\nfunction getTemplateFiles(template: Template, appName: string, runtime: JavaScriptRuntime) {\n\tswitch (template) {\n\t\tcase 'yoga':\n\t\t\treturn makeYogaTemplate(appName, runtime);\n\t\tcase 'apollo':\n\t\t\treturn makeApolloTemplate(appName, runtime);\n\t\tdefault:\n\t\t\treturn [] satisfies never[];\n\t}\n}\n\nexport async function copyTemplate(\n\tappName: string,\n\truntime: JavaScriptRuntime,\n\ttemplate: Template,\n\tdest: string,\n) {\n\tconst files = await getTemplateFiles(template, appName, runtime);\n\n\tconst promises = files.map((file) => {\n\t\tconst filePath = path.join(dest, file.relativePath);\n\t\treturn fs.ensureDir(path.dirname(filePath)).then(() => fs.writeFile(filePath, file.content));\n\t});\n\n\tawait Promise.all(promises);\n}\n","{\n \"name\": \"@baeta/template-apollo\",\n \"version\": \"0.0.0\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"build\": \"baeta generate\",\n \"start\": \"baeta generate --watch --run='node --watch --enable-source-maps --inspect src/app.ts'\"\n },\n \"dependencies\": {\n \"@apollo/server\": \"^5.0.0\",\n \"@baeta/core\": \"workspace:^\",\n \"@baeta/errors\": \"workspace:^\",\n \"@baeta/extension-complexity\": \"workspace:^\",\n \"graphql\": \"^16.11.0\"\n },\n \"devDependencies\": {\n \"@baeta/cli\": \"workspace:^\",\n \"@types/bun\": \"^1.3.0\",\n \"@types/deno\": \"^2.5.0\",\n \"@types/node\": \"^22.18.11\",\n \"typescript\": \"^5.9.3\"\n }\n}\n","{\n \"$schema\": \"https://json.schemastore.org/tsconfig\",\n \"compilerOptions\": {\n \"target\": \"es2024\",\n \"lib\": [\n \"es2024\"\n ],\n \"module\": \"esnext\",\n \"moduleResolution\": \"bundler\",\n \"noEmit\": true,\n \"strict\": true,\n \"noImplicitAny\": true,\n \"erasableSyntaxOnly\": true,\n \"isolatedModules\": true,\n \"esModuleInterop\": true,\n \"verbatimModuleSyntax\": true,\n \"allowImportingTsExtensions\": true,\n \"allowSyntheticDefaultImports\": true,\n \"skipLibCheck\": true,\n \"forceConsistentCasingInFileNames\": true\n }\n}\n","{\n \"@baeta/cli\": \"2.0.0-next.1\",\n \"@baeta/core\": \"2.0.0-next.1\",\n \"create-baeta\": \"2.0.0-next.1\",\n \"@baeta/directives\": \"2.0.0-next.1\",\n \"@baeta/env\": \"2.0.0-next.1\",\n \"@baeta/errors\": \"2.0.0-next.1\",\n \"@baeta/extension-auth\": \"2.0.0-next.1\",\n \"@baeta/extension-cache\": \"2.0.0-next.1\",\n \"@baeta/extension-cache-cloudflare\": \"2.0.0-next.1\",\n \"@baeta/extension-cache-keyv\": \"2.0.0-next.1\",\n \"@baeta/extension-cache-redis\": \"2.0.0-next.1\",\n \"@baeta/extension-cache-upstash\": \"2.0.0-next.1\",\n \"@baeta/extension-complexity\": \"2.0.0-next.1\",\n \"@baeta/generator\": \"2.0.0-next.1\",\n \"@baeta/generator-sdk\": \"2.0.0-next.1\",\n \"@baeta/plugin\": \"2.0.0-next.1\",\n \"@baeta/plugin-cloudflare\": \"2.0.0-next.1\",\n \"@baeta/plugin-directives\": \"2.0.0-next.1\",\n \"@baeta/plugin-exec\": \"2.0.0-next.1\",\n \"@baeta/plugin-gitignore\": \"2.0.0-next.1\",\n \"@baeta/plugin-graphql\": \"2.0.0-next.1\",\n \"@baeta/plugin-pagination\": \"2.0.0-next.1\",\n \"@baeta/plugin-prisma\": \"2.0.0-next.1\",\n \"@baeta/subscriptions-cloudflare\": \"0.2.0-next.1\",\n \"@baeta/subscriptions-pubsub\": \"2.0.0-next.1\",\n \"@baeta/util-encoding\": \"2.0.0-next.1\",\n \"@baeta/util-env\": \"2.0.0-next.1\",\n \"@baeta/util-log\": \"2.0.0-next.1\",\n \"@baeta/util-path\": \"2.0.0-next.1\"\n}","import tsconfig from '../../../tools/tsconfig/tsconfig.json';\nimport type { JavaScriptRuntime } from '../lib/constants.ts';\nimport type { TemplateFile } from '../lib/template-file.ts';\nimport dependenciesVersions from '../versions.json';\n\nexport type PackageJson = {\n\tname: string;\n\tscripts: Record<string, string | undefined>;\n\tdependencies: Record<string, string | undefined>;\n\tdevDependencies: Record<string, string | undefined>;\n};\n\nexport function makeSharedTemplate(\n\tappName: string,\n\truntime: JavaScriptRuntime,\n\tpackageJson: PackageJson,\n): TemplateFile[] {\n\treturn [\n\t\tmakePackageJson(appName, runtime, packageJson),\n\t\t{\n\t\t\trelativePath: './tsconfig.json',\n\t\t\tcontent: JSON.stringify(\n\t\t\t\t{\n\t\t\t\t\t...tsconfig,\n\t\t\t\t\tcompilerOptions: {\n\t\t\t\t\t\t...tsconfig.compilerOptions,\n\t\t\t\t\t\trootDir: 'src',\n\t\t\t\t\t\toutDir: 'dist',\n\t\t\t\t\t\tnoEmit: true,\n\t\t\t\t\t\temitDeclarationOnly: false,\n\t\t\t\t\t},\n\t\t\t\t\texclude: ['baeta.ts'],\n\t\t\t\t},\n\t\t\t\tnull,\n\t\t\t\t2,\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\trelativePath: './src/modules/extensions.ts',\n\t\t\tcontent: `import { createExtensions } from '@baeta/core';\nimport { complexityExtension } from '@baeta/extension-complexity';\nimport type { Context } from '../types/context.ts';\n\nconst complexity = complexityExtension<Context>({\n\tdefaultComplexity: 1,\n\tdefaultListMultiplier: 10,\n\tasync limit(ctx) {\n\t\treturn {\n\t\t\tdepth: 10,\n\t\t\tbreadth: 50,\n\t\t\tcomplexity: 1000,\n\t\t};\n\t},\n});\n\nexport default createExtensions({\n\tcomplexityExtension: complexity\n});\n`,\n\t\t},\n\t\t{\n\t\t\trelativePath: './src/modules/user/user.gql',\n\t\t\tcontent: `type User {\n\tid: ID!\n\temail: String!\n\tlastName: String!\n\tprofile: String\n\tgivenName: String\n}\n\ninput UserWhereUniqueInput {\n\tid: ID!\n}\n\ntype Query {\n\tuser(where: UserWhereUniqueInput!): User\n\tusers: [User!]\n}\n`,\n\t\t},\n\t\t{\n\t\t\trelativePath: './src/modules/user/index.ts',\n\t\t\tcontent: `import { UserModule } from './typedef.ts';\n\nconst { Query, User } = UserModule;\n\nconst userQuery = Query.user\n\t.use(async (next, { args }) => {\n\t\tconst result = await next();\n\t\tconsole.log('Got user:', result, 'for args:', args);\n\t\treturn result;\n\t})\n\t.resolve(({ args }) => {\n\t\treturn {\n\t\t\tid: args.where.id,\n\t\t\temail: 'jon.doe@baeta.io',\n\t\t\tlastName: 'Doe',\n\t\t\tgivenName: null,\n\t\t\tprofile: null,\n\t\t};\n\t});\n\nconst usersQuery = Query.users.resolve(() => {\n\tconst users = Array.from({ length: 10 }).map((_, i) => ({\n\t\tid: i.toString(),\n\t\temail: \\`jon.doe\\${i}@baeta.io\\`,\n\t\tlastName: \\`Doe \\${i}\\`,\n\t\tgivenName: null,\n\t\tprofile: null,\n\t}));\n\treturn users;\n});\n\nexport default UserModule.$schema({\n\tUser: User.$fields({\n\t\tid: User.id.key('id'),\n\t\temail: User.email.key('email'),\n\t\tlastName: User.lastName.key('lastName'),\n\t\tgivenName: User.givenName.key('givenName').undefinedAsNull(),\n\t\tprofile: User.profile.key('profile').undefinedAsNull(),\n\t}),\n\tQuery: Query.$fields({\n\t\tuser: userQuery,\n\t\tusers: usersQuery,\n\t}),\n});\n`,\n\t\t},\n\t\t{\n\t\t\trelativePath: './src/modules/user-photos/user-photos.gql',\n\t\t\tcontent: `type UserPhoto {\n\tid: ID!\n\tuserId: ID!\n\turl: String!\n}\n\nextend type User {\n\tphotos: [UserPhoto!]\n}\n`,\n\t\t},\n\t\t{\n\t\t\trelativePath: './src/modules/user-photos/index.ts',\n\t\t\tcontent: `import { UserPhotosModule } from './typedef.ts';\n\nconst { User, UserPhoto } = UserPhotosModule;\n\nexport default UserPhotosModule.$schema({\n\tUser: User.$fields({\n\t\tphotos: User.photos.resolve(({ source }) => {\n\t\t\treturn Array.from({ length: 10 }).map((_, i) => ({\n\t\t\t\tid: \\`u\\${source.id}_p\\${i}\\`,\n\t\t\t\tuserId: source.id,\n\t\t\t\turl: \\`https://baeta.io/user/\\${source.id}/photo/\\${i}.png\\`,\n\t\t\t}));\n\t\t}),\n\t}),\n\tUserPhoto: UserPhoto.$fields({\n\t\tid: UserPhoto.id.key('id'),\n\t\turl: UserPhoto.url.key('url'),\n\t\tuserId: UserPhoto.userId.key('userId'),\n\t}),\n});\n`,\n\t\t},\n\t\t{\n\t\t\trelativePath: './src/modules/types.ts',\n\t\t\tcontent: `import type { GraphQLResolveInfo } from 'graphql';\nimport type { BaseObjectTypes, BaseScalars } from '../__generated__/utility.ts';\nimport type { Context } from '../types/context.ts';\n\nexport interface Scalars extends BaseScalars {}\n\nexport interface ObjectTypes extends BaseObjectTypes {\n\tUser: {\n\t\tid: string;\n\t\temail: string;\n\t\tlastName: string;\n\t\tgivenName?: string | null;\n\t\tprofile?: string | null;\n\t};\n}\n\nexport type Ctx = Context;\n\nexport type Info = GraphQLResolveInfo;\n`,\n\t\t},\n\t\t{\n\t\t\trelativePath: './baeta.ts',\n\t\t\tcontent: `import { defineConfig } from '@baeta/cli';\n\nexport default defineConfig({\n\tgraphql: {\n\t\tschemas: ['src/**/*.gql'],\n\t},\n});\n`,\n\t\t},\n\t\t{\n\t\t\trelativePath: './.gitignore',\n\t\t\tcontent: `# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\nlerna-debug.log*\n.pnpm-debug.log*\n\n# Diagnostic reports (https://nodejs.org/api/report.html)\nreport.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json\n\n# Runtime data\npids\n*.pid\n*.seed\n*.pid.lock\n\n# Directory for instrumented libs generated by jscoverage/JSCover\nlib-cov\n\n# Coverage directory used by tools like istanbul\ncoverage\n*.lcov\n\n# nyc test coverage\n.nyc_output\n\n# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)\n.grunt\n\n# Bower dependency directory (https://bower.io/)\nbower_components\n\n# node-waf configuration\n.lock-wscript\n\n# Compiled binary addons (https://nodejs.org/api/addons.html)\nbuild/Release\n\n# Dependency directories\nnode_modules/\njspm_packages/\n\n# Snowpack dependency directory (https://snowpack.dev/)\nweb_modules/\n\n# TypeScript cache\n*.tsbuildinfo\n\n# Optional npm cache directory\n.npm\n\n# Optional eslint cache\n.eslintcache\n\n# Optional stylelint cache\n.stylelintcache\n\n# Microbundle cache\n.rpt2_cache/\n.rts2_cache_cjs/\n.rts2_cache_es/\n.rts2_cache_umd/\n\n# Optional REPL history\n.node_repl_history\n\n# Output of 'npm pack'\n*.tgz\n\n# Yarn Integrity file\n.yarn-integrity\n\n# dotenv environment variable files\n.env\n.env.development.local\n.env.test.local\n.env.production.local\n.env.local\n\n# parcel-bundler cache (https://parceljs.org/)\n.cache\n.parcel-cache\n\n# Next.js build output\n.next\nout\n\n# Nuxt.js build / generate output\n.nuxt\ndist\n\n# Gatsby files\n.cache/\n# Comment in the public line in if your project uses Gatsby and not Next.js\n# https://nextjs.org/blog/next-9-1#public-directory-support\n# public\n\n# vuepress build output\n.vuepress/dist\n\n# vuepress v2.x temp and cache directory\n.temp\n.cache\n\n# vitepress build output\n**/.vitepress/dist\n\n# vitepress cache directory\n**/.vitepress/cache\n\n# Docusaurus cache and generated files\n.docusaurus\n\n# Serverless directories\n.serverless/\n\n# FuseBox cache\n.fusebox/\n\n# DynamoDB Local files\n.dynamodb/\n\n# TernJS port file\n.tern-port\n\n# Stores VSCode versions used for testing VSCode extensions\n.vscode-test\n\n# yarn v2\n.yarn/cache\n.yarn/unplugged\n.yarn/build-state.yml\n.yarn/install-state.gz\n.pnp.*\n`,\n\t\t},\n\t];\n}\n\nfunction makePackageJson(\n\tappName: string,\n\truntime: JavaScriptRuntime,\n\tpackageJson: {\n\t\tname: string;\n\t\tscripts: Record<string, string | undefined>;\n\t\tdependencies: Record<string, string | undefined>;\n\t\tdevDependencies: Record<string, string | undefined>;\n\t},\n) {\n\tconst meta = structuredClone(packageJson);\n\n\tfor (const [dep, version] of Object.entries(dependenciesVersions)) {\n\t\tif (dep in meta.dependencies) {\n\t\t\tmeta.dependencies[dep] = version;\n\t\t} else if (dep in packageJson.devDependencies) {\n\t\t\tmeta.devDependencies[dep] = version;\n\t\t}\n\t}\n\n\tif (runtime === 'node') {\n\t\tmeta.devDependencies['@types/bun'] = undefined;\n\t\tmeta.devDependencies['@types/deno'] = undefined;\n\t}\n\n\tif (runtime === 'bun') {\n\t\tmeta.scripts.start = `baeta generate --watch --run='bun --watch --inspect src/app.ts'`;\n\t\tmeta.devDependencies['@types/node'] = undefined;\n\t\tmeta.devDependencies['@types/deno'] = undefined;\n\t}\n\n\tif (runtime === 'deno') {\n\t\tmeta.scripts.start = `baeta generate --watch --run='deno --watch --allow-env --allow-read --allow-net src/app.ts'`;\n\t\tmeta.devDependencies['@types/node'] = undefined;\n\t\tmeta.devDependencies['@types/bun'] = undefined;\n\t}\n\n\tmeta.name = appName;\n\n\treturn {\n\t\trelativePath: './package.json',\n\t\tcontent: JSON.stringify(meta, null, 2),\n\t};\n}\n","import type { JavaScriptRuntime } from '../lib/constants.ts';\nimport type { TemplateFile } from '../lib/template-file.ts';\nimport apolloPackageJson from '../meta/apollo/package.json';\nimport { makeSharedTemplate } from './shared.ts';\n\nexport async function makeApolloTemplate(\n\tappName: string,\n\truntime: JavaScriptRuntime,\n): Promise<TemplateFile[]> {\n\treturn [\n\t\t...makeSharedTemplate(appName, runtime, apolloPackageJson),\n\t\t{\n\t\t\trelativePath: './src/types/context.ts',\n\t\t\tcontent: `export type Context = {\n\tuserId?: string;\n};\n`,\n\t\t},\n\t\t{\n\t\t\trelativePath: './src/app.ts',\n\t\t\tcontent: `import { ApolloServer } from '@apollo/server';\nimport { startStandaloneServer } from '@apollo/server/standalone';\nimport { createApplication } from '@baeta/core';\nimport modules from './modules/index.ts';\nimport type { Context } from './types/context.ts';\n\nconst baeta = createApplication({\n\tmodules,\n});\n\nconst server = new ApolloServer<Context>({\n\tschema: baeta.schema,\n});\n\nconst { url } = await startStandaloneServer(server, {\n\tlisten: { port: 4000 },\n});\n\nconsole.log(\\`🚀 Server ready at: \\${url}\\`);\n`,\n\t\t},\n\t];\n}\n","{\n \"name\": \"@baeta/template-yoga\",\n \"version\": \"0.0.0\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"build\": \"baeta generate\",\n \"start\": \"baeta generate --watch --run='node --watch --enable-source-maps --inspect src/app.ts'\"\n },\n \"dependencies\": {\n \"@baeta/core\": \"workspace:^\",\n \"@baeta/errors\": \"workspace:^\",\n \"@baeta/extension-complexity\": \"workspace:^\",\n \"graphql\": \"^16.11.0\",\n \"graphql-yoga\": \"^5.16.0\"\n },\n \"devDependencies\": {\n \"@baeta/cli\": \"workspace:^\",\n \"@types/bun\": \"^1.3.0\",\n \"@types/deno\": \"^2.5.0\",\n \"@types/node\": \"^22.18.11\",\n \"typescript\": \"^5.9.3\"\n }\n}\n","import type { JavaScriptRuntime } from '../lib/constants.ts';\nimport type { TemplateFile } from '../lib/template-file.ts';\nimport yogaPackageJson from '../meta/yoga/package.json';\nimport { makeSharedTemplate } from './shared.ts';\n\nexport async function makeYogaTemplate(\n\tappName: string,\n\truntime: JavaScriptRuntime,\n): Promise<TemplateFile[]> {\n\treturn [\n\t\t...makeSharedTemplate(appName, runtime, yogaPackageJson),\n\t\t...makeRuntimeFiles(runtime),\n\t\t{\n\t\t\trelativePath: './src/types/context.ts',\n\t\t\tcontent: `export type Context = {\n\tappVersion: string;\n};\n\n// biome-ignore lint/complexity/noBannedTypes: Empty context\nexport type ServerContext = {};\n`,\n\t\t},\n\t];\n}\n\nfunction makeRuntimeFiles(runtime: JavaScriptRuntime): TemplateFile[] {\n\tswitch (runtime) {\n\t\tcase 'bun':\n\t\t\treturn makeBunFiles();\n\t\tcase 'deno':\n\t\t\treturn makeDenoFiles();\n\t\tcase 'node':\n\t\t\treturn makeNodeFiles();\n\t\tdefault:\n\t\t\treturn [] satisfies never[];\n\t}\n}\n\nfunction makeBunFiles(): TemplateFile[] {\n\treturn [\n\t\t{\n\t\t\trelativePath: './src/app.ts',\n\t\t\tcontent: `import { createApplication } from '@baeta/core';\nimport { createYoga } from 'graphql-yoga';\nimport modules from './modules/index.ts';\nimport type { Context, ServerContext } from './types/context.ts';\n\nconst baeta = createApplication({\n\tmodules,\n});\n\nexport const yoga = createYoga<ServerContext, Context>({\n\tschema: baeta.schema,\n\tcontext: {\n\t\tappVersion: '1.0.0',\n\t},\n});\n\nBun.serve({\n\tfetch: yoga.fetch,\n\tport: 4000,\n});\n\nconsole.log(\\`🚀 Server ready at http://localhost:4000\\${yoga.graphqlEndpoint}\\`);\n`,\n\t\t},\n\t];\n}\n\nfunction makeDenoFiles(): TemplateFile[] {\n\treturn [\n\t\t{\n\t\t\trelativePath: './src/app.ts',\n\t\t\tcontent: `import { createApplication } from '@baeta/core';\nimport { createYoga } from 'graphql-yoga';\nimport modules from './modules/index.ts';\nimport type { Context, ServerContext } from './types/context.ts';\n\nconst baeta = createApplication({\n\tmodules,\n});\n\nexport const yoga = createYoga<ServerContext, Context>({\n\tschema: baeta.schema,\n\tcontext: {\n\t\tappVersion: '1.0.0',\n\t},\n});\n\nDeno.serve(\n\t{\n\t\tport: 4000,\n\t\tonListen() {\n\t\t\tconsole.log(\\`🚀 Server ready at http://localhost:4000\\${yoga.graphqlEndpoint}\\`);\n\t\t},\n\t},\n\tyoga.fetch,\n);\n`,\n\t\t},\n\t];\n}\n\nfunction makeNodeFiles(): TemplateFile[] {\n\treturn [\n\t\t{\n\t\t\trelativePath: './src/app.ts',\n\t\t\tcontent: `import { createServer } from 'node:http';\nimport { createApplication } from '@baeta/core';\nimport { createYoga } from 'graphql-yoga';\nimport modules from './modules/index.ts';\nimport type { Context, ServerContext } from './types/context.ts';\n\nconst baeta = createApplication({\n\tmodules,\n});\n\nexport const yoga = createYoga<ServerContext, Context>({\n\tschema: baeta.schema,\n\tcontext: {\n\t\tappVersion: '1.0.0',\n\t},\n});\n\nconst server = createServer(yoga);\n\nserver.listen(4000, () => {\n\tconsole.log(\\`🚀 Server ready at http://localhost:4000\\${yoga.graphqlEndpoint}\\`);\n});\n`,\n\t\t},\n\t];\n}\n","import path from 'node:path';\nimport { logger } from '@docusaurus/logger';\nimport shell from 'shelljs';\nimport supportsColor from 'supports-color';\nimport { getAppName } from './app-name.ts';\nimport type { PackageManager } from './constants.ts';\nimport { getInstallCommand, getPackageManager } from './package-manager.ts';\nimport { getRuntime } from './runtime.ts';\nimport { copyTemplate, getTemplate } from './templates.ts';\n\nexport interface Args {\n\tpackageManager?: PackageManager;\n\tskipInstall?: boolean;\n\tappName?: string;\n\ttemplate?: string;\n\trootDir: string;\n}\n\nexport async function handler(args: Args) {\n\tconst appName = await getAppName(args.appName, args.rootDir);\n\tconst dest = path.resolve(args.rootDir, appName);\n\n\tconst template = await getTemplate(args.template);\n\n\tconst runtime = await getRuntime();\n\n\tlogger.info('Creating new Baeta project...');\n\n\ttry {\n\t\tawait copyTemplate(appName, runtime, template, dest);\n\t} catch (err) {\n\t\tlogger.error`Copying Baeta template name=${template} failed!`;\n\t\tthrow err;\n\t}\n\n\tconst pkgManager = await getPackageManager(dest, args);\n\n\tif (!args.skipInstall) {\n\t\tshell.cd(dest);\n\t\tlogger.info`Installing dependencies with name=${pkgManager}...`;\n\t\tconst result = shell.exec(getInstallCommand(pkgManager), {\n\t\t\tenv: {\n\t\t\t\t...process.env,\n\t\t\t\t...(supportsColor.stdout ? { FORCE_COLOR: '1' } : {}),\n\t\t\t},\n\t\t});\n\n\t\tif (result.code !== 0) {\n\t\t\tconsole.error('Dependency installation failed.');\n\t\t\tlogger.error('Dependency installation failed.');\n\t\t\tlogger.info`The app directory has already been created, and you can retry by typing:\n\ncode=${`cd ${dest}`}\ncode=${`${pkgManager} install`}`;\n\n\t\t\tprocess.exit(0);\n\t\t}\n\t}\n\n\tconst useNpm = pkgManager === 'npm';\n\tconst useBun = pkgManager === 'bun';\n\tconst useRunCommand = useNpm || useBun;\n\n\tlogger.success`Created name=${dest}.`;\n\n\tlogger.info`Inside that directory, you can run several commands:\n\n code=${`${pkgManager} start`}\n Starts the development server.\n\n code=${`${pkgManager} ${useRunCommand ? 'run ' : ''}build`}\n Generates the Baeta application.\n\nWe recommend that you begin by typing:\n\n code=${`cd ${dest}`}\n code=${`${pkgManager} start`}\n`;\n}\n"],"mappings":";AAAO,IAAM,wBAAwB;AAE9B,IAAM,gBAAgB;AAAA,EAC5B,KAAK;AAAA,EACL,MAAM;AAAA,EACN,MAAM;AAAA,EACN,KAAK;AACN;AAEO,IAAM,kBAAkB,OAAO,KAAK,aAAa;AAIjD,IAAM,WAAW,CAAC,QAAQ,QAAQ,KAAK;AAIvC,IAAM,2BAA2B;AAEjC,IAAM,YAAY,CAAC,QAAQ,QAAQ;;;ACnB1C,OAAO,UAAU;AACjB,SAAS,cAAc;AACvB,OAAO,QAAQ;AACf,OAAO,aAAa;AAEpB,eAAsB,WAAW,SAA6B,SAAkC;AAC/F,iBAAe,gBAAgB,SAAiB;AAC/C,QAAI,CAAC,SAAS;AACb,aAAO;AAAA,IACR;AACA,UAAM,OAAO,KAAK,QAAQ,SAAS,OAAO;AAC1C,QAAI,MAAM,GAAG,WAAW,IAAI,GAAG;AAC9B,aAAO,OAAO,+CAA+C,IAAI;AAAA,IAClE;AACA,WAAO;AAAA,EACR;AAEA,MAAI,SAAS;AAC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,QAAM,WAAW,MAAM,YAAY,KAAK,QAAQ;AAEhD,QAAM,UAAU,MAAM,WAAW;AAEjC,EAAAC,QAAO,KAAK,+BAA+B;AAE3C,MAAI;AACH,UAAM,aAAa,SAAS,SAAS,UAAU,IAAI;AAAA,EACpD,SAAS,KAAK;AACb,IAAAA,QAAO,oCAAoC,QAAQ;AACnD,UAAM;AAAA,EACP;AAEA,QAAM,aAAa,MAAM,kBAAkB,MAAM,IAAI;AAErD,MAAI,CAAC,KAAK,aAAa;AACtB,IAAAC,OAAM,GAAG,IAAI;AACb,IAAAD,QAAO,yCAAyC,UAAU;AAC1D,UAAM,SAASC,OAAM,KAAK,kBAAkB,UAAU,GAAG;AAAA,MACxD,KAAK;AAAA,QACJ,GAAG,QAAQ;AAAA,QACX,GAAI,cAAc,SAAS,EAAE,aAAa,IAAI,IAAI,CAAC;AAAA,MACpD;AAAA,IACD,CAAC;AAED,QAAI,OAAO,SAAS,GAAG;AACtB,cAAQ,MAAM,iCAAiC;AAC/C,MAAAD,QAAO,MAAM,iCAAiC;AAC9C,MAAAA,QAAO;AAAA;AAAA,OAEH,MAAM,IAAI,EAAE;AAAA,OACZ,GAAG,UAAU,UAAU;AAE3B,cAAQ,KAAK,CAAC;AAAA,IACf;AAAA,EACD;AAEA,QAAM,SAAS,eAAe;AAC9B,QAAM,SAAS,eAAe;AAC9B,QAAM,gBAAgB,UAAU;AAEhC,EAAAA,QAAO,uBAAuB,IAAI;AAElC,EAAAA,QAAO;AAAA;AAAA,SAEC,GAAG,UAAU,QAAQ;AAAA;AAAA;AAAA,SAGrB,GAAG,UAAU,IAAI,gBAAgB,SAAS,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,SAKnD,MAAM,IAAI,EAAE;AAAA,SACZ,GAAG,UAAU,QAAQ;AAAA;AAE9B;","names":["path","logger","fs","prompts","path","fs","prompts","logger","logger","prompts","shell","shell","prompts","logger","path","logger","fs","prompts","package_default","package_default","prompts","logger","path","fs","path","logger","shell","path","logger","shell"]}
|
package/dist/cli.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
handler,
|
|
4
4
|
packageManagers
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CKNLELYM.js";
|
|
6
6
|
|
|
7
7
|
// cli.ts
|
|
8
8
|
import { logger } from "@docusaurus/logger";
|
|
@@ -11,9 +11,9 @@ import yargs from "yargs";
|
|
|
11
11
|
import { hideBin } from "yargs/helpers";
|
|
12
12
|
|
|
13
13
|
// package.json
|
|
14
|
-
var version = "
|
|
14
|
+
var version = "2.0.0-next.1";
|
|
15
15
|
var engines = {
|
|
16
|
-
node: ">=22.
|
|
16
|
+
node: ">=22.20.0"
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
// cli.ts
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../cli.ts","../package.json"],"sourcesContent":["#!/usr/bin/env node\n\nimport { logger } from '@docusaurus/logger';\nimport semver from 'semver';\nimport yargs from 'yargs';\nimport { hideBin } from 'yargs/helpers';\nimport { packageManagers } from './lib/constants.ts';\nimport { handler } from './lib/handler.ts';\nimport { engines, version } from './package.json';\n\nconst requiredVersion = engines.node;\n\nif (!semver.satisfies(process.version, requiredVersion)) {\n\tlogger.error('Minimum Node.js version not met :(');\n\tlogger.info`You are using Node.js number=${process.version}, Requirement: Node.js number=${requiredVersion}.`;\n\tprocess.exit(1);\n}\n\nprocess.on('unhandledRejection', (err) => {\n\tlogger.error(err);\n\tprocess.exit(1);\n});\n\nyargs(hideBin(process.argv))\n\t.version(version)\n\t.command({\n\t\tcommand: '* [appName] [template] [rootDir]',\n\t\tdescribe: 'Initialize Baeta application',\n\t\tbuilder: (yargs) => {\n\t\t\treturn yargs\n\t\t\t\t.option('package-manager', {\n\t\t\t\t\talias: 'p',\n\t\t\t\t\tdescribe: 'The package manager used to install dependencies.',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tchoices: packageManagers,\n\t\t\t\t})\n\t\t\t\t.option('skip-install', {\n\t\t\t\t\talias: 's',\n\t\t\t\t\tdescribe: 'Do not run package manager immediately after scaffolding',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t})\n\t\t\t\t.positional('appName', {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdescribe: 'Name of the app',\n\t\t\t\t})\n\t\t\t\t.positional('template', {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdescribe: 'Template to use',\n\t\t\t\t\tchoices: ['yoga', 'apollo'],\n\t\t\t\t})\n\t\t\t\t.positional('rootDir', {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdescribe: 'Root directory',\n\t\t\t\t\tdefault: '.',\n\t\t\t\t});\n\t\t},\n\t\thandler: (argv) => handler(argv),\n\t})\n\t.showHelpOnFail(true)\n\t.strict()\n\t.help()\n\t.parse();\n","{\n \"name\": \"create-baeta\",\n \"version\": \"
|
|
1
|
+
{"version":3,"sources":["../cli.ts","../package.json"],"sourcesContent":["#!/usr/bin/env node\n\nimport { logger } from '@docusaurus/logger';\nimport semver from 'semver';\nimport yargs from 'yargs';\nimport { hideBin } from 'yargs/helpers';\nimport { packageManagers } from './lib/constants.ts';\nimport { handler } from './lib/handler.ts';\nimport { engines, version } from './package.json';\n\nconst requiredVersion = engines.node;\n\nif (!semver.satisfies(process.version, requiredVersion)) {\n\tlogger.error('Minimum Node.js version not met :(');\n\tlogger.info`You are using Node.js number=${process.version}, Requirement: Node.js number=${requiredVersion}.`;\n\tprocess.exit(1);\n}\n\nprocess.on('unhandledRejection', (err) => {\n\tlogger.error(err);\n\tprocess.exit(1);\n});\n\nyargs(hideBin(process.argv))\n\t.version(version)\n\t.command({\n\t\tcommand: '* [appName] [template] [rootDir]',\n\t\tdescribe: 'Initialize Baeta application',\n\t\tbuilder: (yargs) => {\n\t\t\treturn yargs\n\t\t\t\t.option('package-manager', {\n\t\t\t\t\talias: 'p',\n\t\t\t\t\tdescribe: 'The package manager used to install dependencies.',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tchoices: packageManagers,\n\t\t\t\t})\n\t\t\t\t.option('skip-install', {\n\t\t\t\t\talias: 's',\n\t\t\t\t\tdescribe: 'Do not run package manager immediately after scaffolding',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t})\n\t\t\t\t.positional('appName', {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdescribe: 'Name of the app',\n\t\t\t\t})\n\t\t\t\t.positional('template', {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdescribe: 'Template to use',\n\t\t\t\t\tchoices: ['yoga', 'apollo'],\n\t\t\t\t})\n\t\t\t\t.positional('rootDir', {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdescribe: 'Root directory',\n\t\t\t\t\tdefault: '.',\n\t\t\t\t});\n\t\t},\n\t\thandler: (argv) => handler(argv),\n\t})\n\t.showHelpOnFail(true)\n\t.strict()\n\t.help()\n\t.parse();\n","{\n \"name\": \"create-baeta\",\n \"version\": \"2.0.0-next.1\",\n \"keywords\": [\n \"baeta\",\n \"graphql\",\n \"schema\",\n \"types\",\n \"typescript\",\n \"framework\",\n \"builder\"\n ],\n \"homepage\": \"https://github.com/andreisergiu98/baeta#readme\",\n \"bugs\": {\n \"url\": \"https://github.com/andreisergiu98/baeta/issues\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/andreisergiu98/baeta.git\",\n \"directory\": \"packages/create-baeta\"\n },\n \"license\": \"MIT\",\n \"author\": {\n \"name\": \"Andrei Pampu\",\n \"url\": \"https://github.com/andreisergiu98\"\n },\n \"type\": \"module\",\n \"bin\": \"dist/cli.js\",\n \"exports\": {\n \".\": {\n \"types\": \"./index.ts\",\n \"default\": \"./index.ts\"\n }\n },\n \"types\": \"dist/index.d.ts\",\n \"files\": [\n \"dist\",\n \"templates\",\n \"package.json\"\n ],\n \"scripts\": {\n \"prebuild\": \"node --no-warnings --experimental-transform-types ./scripts/version-manifest.ts\",\n \"build\": \"yarn prebuild && tsup\",\n \"prepack\": \"prep\",\n \"postpack\": \"prep --clean\",\n \"types\": \"yarn prebuild && tsc --noEmit\"\n },\n \"dependencies\": {\n \"@docusaurus/logger\": \"^3.9.2\",\n \"fs-extra\": \"^11.3.2\",\n \"prompts\": \"^2.4.2\",\n \"semver\": \"^7.7.3\",\n \"shelljs\": \"^0.10.0\",\n \"supports-color\": \"^10.2.2\",\n \"yargs\": \"^18.0.0\"\n },\n \"devDependencies\": {\n \"@baeta/builder\": \"workspace:^\",\n \"@baeta/tsconfig\": \"workspace:^\",\n \"@types/fs-extra\": \"^11.0.4\",\n \"@types/node\": \"^22.18.11\",\n \"@types/prompts\": \"^2.4.9\",\n \"@types/semver\": \"^7.7.1\",\n \"@types/shelljs\": \"^0.8.17\",\n \"@types/yargs\": \"^17.0.33\",\n \"typescript\": \"^5.9.3\"\n },\n \"engines\": {\n \"node\": \">=22.20.0\"\n },\n \"publishConfig\": {\n \"access\": \"public\",\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"default\": \"./dist/index.js\"\n }\n }\n },\n \"typedocOptions\": {\n \"entryPoints\": [\n \"./index.ts\"\n ],\n \"readme\": \"none\",\n \"tsconfig\": \"./tsconfig.json\",\n \"sort\": [\n \"kind\",\n \"instance-first\",\n \"required-first\",\n \"alphabetical-ignoring-documents\"\n ]\n }\n}\n"],"mappings":";;;;;;;AAEA,SAAS,cAAc;AACvB,OAAO,YAAY;AACnB,OAAO,WAAW;AAClB,SAAS,eAAe;;;ACHtB,cAAW;AAiEX,cAAW;AAAA,EACT,MAAQ;AACV;;;AD3DF,IAAM,kBAAkB,QAAQ;AAEhC,IAAI,CAAC,OAAO,UAAU,QAAQ,SAAS,eAAe,GAAG;AACxD,SAAO,MAAM,oCAAoC;AACjD,SAAO,oCAAoC,QAAQ,OAAO,iCAAiC,eAAe;AAC1G,UAAQ,KAAK,CAAC;AACf;AAEA,QAAQ,GAAG,sBAAsB,CAAC,QAAQ;AACzC,SAAO,MAAM,GAAG;AAChB,UAAQ,KAAK,CAAC;AACf,CAAC;AAED,MAAM,QAAQ,QAAQ,IAAI,CAAC,EACzB,QAAQ,OAAO,EACf,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS,CAACA,WAAU;AACnB,WAAOA,OACL,OAAO,mBAAmB;AAAA,MAC1B,OAAO;AAAA,MACP,UAAU;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,IACV,CAAC,EACA,OAAO,gBAAgB;AAAA,MACvB,OAAO;AAAA,MACP,UAAU;AAAA,MACV,MAAM;AAAA,IACP,CAAC,EACA,WAAW,WAAW;AAAA,MACtB,MAAM;AAAA,MACN,UAAU;AAAA,IACX,CAAC,EACA,WAAW,YAAY;AAAA,MACvB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,SAAS,CAAC,QAAQ,QAAQ;AAAA,IAC3B,CAAC,EACA,WAAW,WAAW;AAAA,MACtB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,SAAS;AAAA,IACV,CAAC;AAAA,EACH;AAAA,EACA,SAAS,CAAC,SAAS,QAAQ,IAAI;AAChC,CAAC,EACA,eAAe,IAAI,EACnB,OAAO,EACP,KAAK,EACL,MAAM;","names":["yargs"]}
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-baeta",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-next.1",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"baeta",
|
|
6
6
|
"graphql",
|
|
@@ -46,27 +46,27 @@
|
|
|
46
46
|
"types": "yarn prebuild && tsc --noEmit"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@docusaurus/logger": "^3.
|
|
50
|
-
"fs-extra": "^11.3.
|
|
49
|
+
"@docusaurus/logger": "^3.9.2",
|
|
50
|
+
"fs-extra": "^11.3.2",
|
|
51
51
|
"prompts": "^2.4.2",
|
|
52
|
-
"semver": "^7.7.
|
|
52
|
+
"semver": "^7.7.3",
|
|
53
53
|
"shelljs": "^0.10.0",
|
|
54
|
-
"supports-color": "^10.
|
|
55
|
-
"yargs": "^
|
|
54
|
+
"supports-color": "^10.2.2",
|
|
55
|
+
"yargs": "^18.0.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@baeta/builder": "^0.0.0",
|
|
59
59
|
"@baeta/tsconfig": "^0.0.0",
|
|
60
60
|
"@types/fs-extra": "^11.0.4",
|
|
61
|
-
"@types/node": "^22.
|
|
61
|
+
"@types/node": "^22.18.11",
|
|
62
62
|
"@types/prompts": "^2.4.9",
|
|
63
|
-
"@types/semver": "^7.7.
|
|
64
|
-
"@types/shelljs": "^0.8.
|
|
63
|
+
"@types/semver": "^7.7.1",
|
|
64
|
+
"@types/shelljs": "^0.8.17",
|
|
65
65
|
"@types/yargs": "^17.0.33",
|
|
66
|
-
"typescript": "^5.
|
|
66
|
+
"typescript": "^5.9.3"
|
|
67
67
|
},
|
|
68
68
|
"engines": {
|
|
69
|
-
"node": ">=22.
|
|
69
|
+
"node": ">=22.20.0"
|
|
70
70
|
},
|
|
71
71
|
"publishConfig": {
|
|
72
72
|
"access": "public",
|
package/templates/apollo.ts
CHANGED
|
@@ -21,7 +21,7 @@ export async function makeApolloTemplate(
|
|
|
21
21
|
content: `import { ApolloServer } from '@apollo/server';
|
|
22
22
|
import { startStandaloneServer } from '@apollo/server/standalone';
|
|
23
23
|
import { createApplication } from '@baeta/core';
|
|
24
|
-
import
|
|
24
|
+
import modules from './modules/index.ts';
|
|
25
25
|
import type { Context } from './types/context.ts';
|
|
26
26
|
|
|
27
27
|
const baeta = createApplication({
|
package/templates/shared.ts
CHANGED
|
@@ -36,7 +36,7 @@ export function makeSharedTemplate(
|
|
|
36
36
|
),
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
|
-
relativePath: './src/
|
|
39
|
+
relativePath: './src/modules/extensions.ts',
|
|
40
40
|
content: `import { createExtensions } from '@baeta/core';
|
|
41
41
|
import { complexityExtension } from '@baeta/extension-complexity';
|
|
42
42
|
import type { Context } from '../types/context.ts';
|
|
@@ -53,7 +53,9 @@ const complexity = complexityExtension<Context>({
|
|
|
53
53
|
},
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
-
export default createExtensions(
|
|
56
|
+
export default createExtensions({
|
|
57
|
+
complexityExtension: complexity
|
|
58
|
+
});
|
|
57
59
|
`,
|
|
58
60
|
},
|
|
59
61
|
{
|
|
@@ -77,33 +79,51 @@ type Query {
|
|
|
77
79
|
`,
|
|
78
80
|
},
|
|
79
81
|
{
|
|
80
|
-
relativePath: './src/modules/user/
|
|
81
|
-
content: `import {
|
|
82
|
-
|
|
83
|
-
const { Query } =
|
|
84
|
-
|
|
85
|
-
Query.user
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
82
|
+
relativePath: './src/modules/user/index.ts',
|
|
83
|
+
content: `import { UserModule } from './typedef.ts';
|
|
84
|
+
|
|
85
|
+
const { Query, User } = UserModule;
|
|
86
|
+
|
|
87
|
+
const userQuery = Query.user
|
|
88
|
+
.use(async (next, { args }) => {
|
|
89
|
+
const result = await next();
|
|
90
|
+
console.log('Got user:', result, 'for args:', args);
|
|
91
|
+
return result;
|
|
92
|
+
})
|
|
93
|
+
.resolve(({ args }) => {
|
|
94
|
+
return {
|
|
95
|
+
id: args.where.id,
|
|
96
|
+
email: 'jon.doe@baeta.io',
|
|
97
|
+
lastName: 'Doe',
|
|
98
|
+
givenName: null,
|
|
99
|
+
profile: null,
|
|
100
|
+
};
|
|
101
|
+
});
|
|
98
102
|
|
|
99
|
-
Query.users(() => {
|
|
103
|
+
const usersQuery = Query.users.resolve(() => {
|
|
100
104
|
const users = Array.from({ length: 10 }).map((_, i) => ({
|
|
101
105
|
id: i.toString(),
|
|
102
106
|
email: \`jon.doe\${i}@baeta.io\`,
|
|
103
107
|
lastName: \`Doe \${i}\`,
|
|
108
|
+
givenName: null,
|
|
109
|
+
profile: null,
|
|
104
110
|
}));
|
|
105
111
|
return users;
|
|
106
112
|
});
|
|
113
|
+
|
|
114
|
+
export default UserModule.$schema({
|
|
115
|
+
User: User.$fields({
|
|
116
|
+
id: User.id.key('id'),
|
|
117
|
+
email: User.email.key('email'),
|
|
118
|
+
lastName: User.lastName.key('lastName'),
|
|
119
|
+
givenName: User.givenName.key('givenName').undefinedAsNull(),
|
|
120
|
+
profile: User.profile.key('profile').undefinedAsNull(),
|
|
121
|
+
}),
|
|
122
|
+
Query: Query.$fields({
|
|
123
|
+
user: userQuery,
|
|
124
|
+
users: usersQuery,
|
|
125
|
+
}),
|
|
126
|
+
});
|
|
107
127
|
`,
|
|
108
128
|
},
|
|
109
129
|
{
|
|
@@ -120,40 +140,60 @@ extend type User {
|
|
|
120
140
|
`,
|
|
121
141
|
},
|
|
122
142
|
{
|
|
123
|
-
relativePath: './src/modules/user-photos/
|
|
124
|
-
content: `import {
|
|
143
|
+
relativePath: './src/modules/user-photos/index.ts',
|
|
144
|
+
content: `import { UserPhotosModule } from './typedef.ts';
|
|
145
|
+
|
|
146
|
+
const { User, UserPhoto } = UserPhotosModule;
|
|
147
|
+
|
|
148
|
+
export default UserPhotosModule.$schema({
|
|
149
|
+
User: User.$fields({
|
|
150
|
+
photos: User.photos.resolve(({ source }) => {
|
|
151
|
+
return Array.from({ length: 10 }).map((_, i) => ({
|
|
152
|
+
id: \`u\${source.id}_p\${i}\`,
|
|
153
|
+
userId: source.id,
|
|
154
|
+
url: \`https://baeta.io/user/\${source.id}/photo/\${i}.png\`,
|
|
155
|
+
}));
|
|
156
|
+
}),
|
|
157
|
+
}),
|
|
158
|
+
UserPhoto: UserPhoto.$fields({
|
|
159
|
+
id: UserPhoto.id.key('id'),
|
|
160
|
+
url: UserPhoto.url.key('url'),
|
|
161
|
+
userId: UserPhoto.userId.key('userId'),
|
|
162
|
+
}),
|
|
163
|
+
});
|
|
164
|
+
`,
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
relativePath: './src/modules/types.ts',
|
|
168
|
+
content: `import type { GraphQLResolveInfo } from 'graphql';
|
|
169
|
+
import type { BaseObjectTypes, BaseScalars } from '../__generated__/utility.ts';
|
|
170
|
+
import type { Context } from '../types/context.ts';
|
|
125
171
|
|
|
126
|
-
|
|
172
|
+
export interface Scalars extends BaseScalars {}
|
|
127
173
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
id:
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
174
|
+
export interface ObjectTypes extends BaseObjectTypes {
|
|
175
|
+
User: {
|
|
176
|
+
id: string;
|
|
177
|
+
email: string;
|
|
178
|
+
lastName: string;
|
|
179
|
+
givenName?: string | null;
|
|
180
|
+
profile?: string | null;
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export type Ctx = Context;
|
|
185
|
+
|
|
186
|
+
export type Info = GraphQLResolveInfo;
|
|
135
187
|
`,
|
|
136
188
|
},
|
|
137
189
|
{
|
|
138
190
|
relativePath: './baeta.ts',
|
|
139
191
|
content: `import { defineConfig } from '@baeta/cli';
|
|
140
|
-
import { autoloadPlugin } from '@baeta/plugin-autoload';
|
|
141
192
|
|
|
142
193
|
export default defineConfig({
|
|
143
194
|
graphql: {
|
|
144
195
|
schemas: ['src/**/*.gql'],
|
|
145
|
-
contextType: 'src/types/context#Context',
|
|
146
|
-
extensions: 'src/lib/extensions.ts',
|
|
147
|
-
},
|
|
148
|
-
compiler: {
|
|
149
|
-
src: 'src/app.ts',
|
|
150
|
-
dist: 'dist',
|
|
151
|
-
bundleWorkspaces: true,
|
|
152
|
-
esbuild: {
|
|
153
|
-
format: 'esm',
|
|
154
|
-
},
|
|
155
196
|
},
|
|
156
|
-
plugins: [autoloadPlugin()],
|
|
157
197
|
});
|
|
158
198
|
`,
|
|
159
199
|
},
|
package/templates/yoga.ts
CHANGED
|
@@ -42,7 +42,7 @@ function makeBunFiles(): TemplateFile[] {
|
|
|
42
42
|
relativePath: './src/app.ts',
|
|
43
43
|
content: `import { createApplication } from '@baeta/core';
|
|
44
44
|
import { createYoga } from 'graphql-yoga';
|
|
45
|
-
import
|
|
45
|
+
import modules from './modules/index.ts';
|
|
46
46
|
import type { Context, ServerContext } from './types/context.ts';
|
|
47
47
|
|
|
48
48
|
const baeta = createApplication({
|
|
@@ -73,7 +73,7 @@ function makeDenoFiles(): TemplateFile[] {
|
|
|
73
73
|
relativePath: './src/app.ts',
|
|
74
74
|
content: `import { createApplication } from '@baeta/core';
|
|
75
75
|
import { createYoga } from 'graphql-yoga';
|
|
76
|
-
import
|
|
76
|
+
import modules from './modules/index.ts';
|
|
77
77
|
import type { Context, ServerContext } from './types/context.ts';
|
|
78
78
|
|
|
79
79
|
const baeta = createApplication({
|
|
@@ -108,7 +108,7 @@ function makeNodeFiles(): TemplateFile[] {
|
|
|
108
108
|
content: `import { createServer } from 'node:http';
|
|
109
109
|
import { createApplication } from '@baeta/core';
|
|
110
110
|
import { createYoga } from 'graphql-yoga';
|
|
111
|
-
import
|
|
111
|
+
import modules from './modules/index.ts';
|
|
112
112
|
import type { Context, ServerContext } from './types/context.ts';
|
|
113
113
|
|
|
114
114
|
const baeta = createApplication({
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../lib/constants.ts","../lib/app-name.ts","../lib/package-manager.ts","../lib/runtime.ts","../lib/templates.ts","../meta/apollo/package.json","../../../tools/tsconfig/tsconfig.json","../versions.json","../templates/shared.ts","../templates/apollo.ts","../meta/yoga/package.json","../templates/yoga.ts","../lib/handler.ts"],"sourcesContent":["export const defaultPackageManager = 'npm';\n\nexport const lockfileNames = {\n\tnpm: 'package-lock.json',\n\tyarn: 'yarn.lock',\n\tpnpm: 'pnpm-lock.yaml',\n\tbun: 'bun.lockb',\n};\n\nexport const packageManagers = Object.keys(lockfileNames) as PackageManager[];\n\nexport type PackageManager = keyof typeof lockfileNames;\n\nexport const runtimes = ['node', 'deno', 'bun'] as const;\n\nexport type JavaScriptRuntime = (typeof runtimes)[number];\n\nexport const defaultJavaScriptRuntime = 'node';\n\nexport const templates = ['yoga', 'apollo'] as const;\nexport type Template = (typeof templates)[number];\n","import path from 'node:path';\nimport { logger } from '@docusaurus/logger';\nimport fs from 'fs-extra';\nimport prompts from 'prompts';\n\nexport async function getAppName(reqName: string | undefined, rootDir: string): Promise<string> {\n\tasync function validateAppName(appName: string) {\n\t\tif (!appName) {\n\t\t\treturn 'An app name is required.';\n\t\t}\n\t\tconst dest = path.resolve(rootDir, appName);\n\t\tif (await fs.pathExists(dest)) {\n\t\t\treturn logger.interpolate`Directory already exists at path=${dest}!`;\n\t\t}\n\t\treturn true;\n\t}\n\n\tif (reqName) {\n\t\tconst res = await validateAppName(reqName);\n\t\tif (typeof res === 'string') {\n\t\t\tthrow new Error(res);\n\t\t}\n\t\treturn reqName;\n\t}\n\n\treturn prompts(\n\t\t{\n\t\t\ttype: 'text',\n\t\t\tname: 'appName',\n\t\t\tmessage: 'What should we name this app?',\n\t\t\tinitial: 'baeta-app',\n\t\t\tvalidate: validateAppName,\n\t\t},\n\t\t{\n\t\t\tonCancel() {\n\t\t\t\tlogger.error('An app name is required.');\n\t\t\t\tprocess.exit(1);\n\t\t\t},\n\t\t},\n\t).then((result) => (result as { appName: string }).appName);\n}\n","import path from 'node:path';\nimport { logger } from '@docusaurus/logger';\nimport fs from 'fs-extra';\nimport prompts from 'prompts';\nimport shell from 'shelljs';\nimport type { CliOptions } from './cli-options.ts';\nimport {\n\tdefaultPackageManager,\n\tlockfileNames,\n\ttype PackageManager,\n\tpackageManagers,\n} from './constants.ts';\n\nasync function findPackageManagerFromLockFile(\n\trootDir: string,\n): Promise<PackageManager | undefined> {\n\tfor (const packageManager of packageManagers) {\n\t\tconst lockFilePath = path.join(rootDir, lockfileNames[packageManager]);\n\t\tif (await fs.pathExists(lockFilePath)) {\n\t\t\treturn packageManager;\n\t\t}\n\t}\n\treturn undefined;\n}\n\nfunction findPackageManagerFromUserAgent(): PackageManager | undefined {\n\treturn packageManagers.find((packageManager) =>\n\t\tprocess.env.npm_config_user_agent?.startsWith(packageManager),\n\t);\n}\n\nasync function askForPackageManagerChoice(): Promise<PackageManager> {\n\tconst hasYarn = shell.exec('yarn --version', { silent: true }).code === 0;\n\tconst hasPnpm = shell.exec('pnpm --version', { silent: true }).code === 0;\n\tconst hasBun = shell.exec('bun --version', { silent: true }).code === 0;\n\n\tif (!hasYarn && !hasPnpm && !hasBun) {\n\t\treturn 'npm';\n\t}\n\tconst choices = ['npm', hasYarn && 'yarn', hasPnpm && 'pnpm', hasBun && 'bun']\n\t\t.filter((p): p is string => Boolean(p))\n\t\t.map((p) => ({ title: p, value: p }));\n\n\tconst manager = await prompts(\n\t\t{\n\t\t\ttype: 'select',\n\t\t\tname: 'packageManager',\n\t\t\tmessage: 'Select a package manager...',\n\t\t\tchoices,\n\t\t},\n\t\t{\n\t\t\tonCancel() {\n\t\t\t\tlogger.info`Falling back to name=${defaultPackageManager}`;\n\t\t\t},\n\t\t},\n\t).then((result) => (result as { packageManager?: PackageManager }).packageManager);\n\n\treturn manager ?? defaultPackageManager;\n}\n\nexport async function getPackageManager(\n\tdest: string,\n\t{ packageManager, skipInstall }: CliOptions,\n): Promise<PackageManager> {\n\tif (packageManager && !packageManagers.includes(packageManager)) {\n\t\tthrow new Error(\n\t\t\t`Invalid package manager choice ${packageManager}. Must be one of ${packageManagers.join(\n\t\t\t\t', ',\n\t\t\t)}`,\n\t\t);\n\t}\n\n\tconst fromLockfile = await findPackageManagerFromLockFile(dest);\n\n\tif (fromLockfile) {\n\t\treturn fromLockfile;\n\t}\n\n\tif (packageManager) {\n\t\treturn packageManager;\n\t}\n\n\tconst fromLockfileInCwd = await findPackageManagerFromLockFile('.');\n\n\tif (fromLockfileInCwd) {\n\t\treturn fromLockfileInCwd;\n\t}\n\n\tconst fromUserAgent = findPackageManagerFromUserAgent();\n\n\tif (fromUserAgent) {\n\t\treturn fromUserAgent;\n\t}\n\n\tif (skipInstall) {\n\t\treturn defaultPackageManager;\n\t}\n\n\treturn askForPackageManagerChoice();\n}\n\nexport function getInstallCommand(pkgManager: PackageManager): string {\n\tif (pkgManager === 'yarn') {\n\t\treturn 'yarn';\n\t}\n\tif (pkgManager === 'bun') {\n\t\treturn 'bun install';\n\t}\n\treturn `${pkgManager} install --color always`;\n}\n","import { logger } from '@docusaurus/logger';\nimport prompts from 'prompts';\nimport shell from 'shelljs';\nimport { defaultJavaScriptRuntime, type JavaScriptRuntime } from './constants.ts';\n\nexport async function getRuntime(): Promise<JavaScriptRuntime> {\n\tconst hasBun = shell.exec('bun --version', { silent: true }).code === 0;\n\tconst hasDeno = shell.exec('deno --version', { silent: true }).code === 0;\n\n\tif (!hasDeno && !hasBun) {\n\t\treturn 'node';\n\t}\n\tconst choices = ['node', hasBun && 'bun', hasDeno && 'deno']\n\t\t.filter((p): p is string => Boolean(p))\n\t\t.map((p) => ({ title: p, value: p }));\n\n\tconst runtime = await prompts(\n\t\t{\n\t\t\ttype: 'select',\n\t\t\tname: 'runtime',\n\t\t\tmessage: 'Select a runtime...',\n\t\t\tchoices,\n\t\t},\n\t\t{\n\t\t\tonCancel() {\n\t\t\t\tlogger.info`Falling back to name=${defaultJavaScriptRuntime}`;\n\t\t\t},\n\t\t},\n\t).then((result) => (result as { runtime?: JavaScriptRuntime }).runtime);\n\n\treturn runtime ?? defaultJavaScriptRuntime;\n}\n","import path from 'node:path';\nimport { logger } from '@docusaurus/logger';\nimport fs from 'fs-extra';\nimport prompts, { type Choice } from 'prompts';\nimport { makeApolloTemplate } from '../templates/apollo.ts';\nimport { makeYogaTemplate } from '../templates/yoga.ts';\nimport { type JavaScriptRuntime, type Template, templates } from './constants.ts';\n\nfunction createTemplateChoices(): Choice[] {\n\treturn templates.map((template) => ({ title: template, value: template }));\n}\n\nasync function askTemplateChoice() {\n\treturn prompts(\n\t\t{\n\t\t\ttype: 'select',\n\t\t\tname: 'template',\n\t\t\tmessage: 'Select a template below...',\n\t\t\tchoices: createTemplateChoices(),\n\t\t},\n\t\t{\n\t\t\tonCancel() {\n\t\t\t\tlogger.error('A choice is required.');\n\t\t\t\tprocess.exit(1);\n\t\t\t},\n\t\t},\n\t).then((result) => {\n\t\treturn (result as { template: Template }).template;\n\t});\n}\n\nexport async function getTemplate(reqTemplate: string | undefined) {\n\tconst userProvided = reqTemplate ? templates.find((t) => t === reqTemplate) : null;\n\tconst template = userProvided ?? (await askTemplateChoice());\n\n\tif (!template) {\n\t\tthrow new Error('Template not found');\n\t}\n\n\treturn template;\n}\n\nfunction getTemplateFiles(template: Template, appName: string, runtime: JavaScriptRuntime) {\n\tswitch (template) {\n\t\tcase 'yoga':\n\t\t\treturn makeYogaTemplate(appName, runtime);\n\t\tcase 'apollo':\n\t\t\treturn makeApolloTemplate(appName, runtime);\n\t\tdefault:\n\t\t\treturn [] satisfies never[];\n\t}\n}\n\nexport async function copyTemplate(\n\tappName: string,\n\truntime: JavaScriptRuntime,\n\ttemplate: Template,\n\tdest: string,\n) {\n\tconst files = await getTemplateFiles(template, appName, runtime);\n\n\tconst promises = files.map((file) => {\n\t\tconst filePath = path.join(dest, file.relativePath);\n\t\treturn fs.ensureDir(path.dirname(filePath)).then(() => fs.writeFile(filePath, file.content));\n\t});\n\n\tawait Promise.all(promises);\n}\n","{\n \"name\": \"@baeta/template-apollo\",\n \"version\": \"0.0.0\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"build\": \"baeta build --generate\",\n \"start\": \"baeta build --watch --generate --onSuccess='node --enable-source-maps --inspect dist/app.js'\"\n },\n \"dependencies\": {\n \"@apollo/server\": \"^4.12.1\",\n \"@baeta/core\": \"workspace:^\",\n \"@baeta/errors\": \"workspace:^\",\n \"@baeta/extension-complexity\": \"workspace:^\",\n \"graphql\": \"^16.11.0\"\n },\n \"devDependencies\": {\n \"@baeta/cli\": \"workspace:^\",\n \"@baeta/compiler\": \"workspace:^\",\n \"@baeta/plugin-autoload\": \"workspace:^\",\n \"@types/bun\": \"^1.2.14\",\n \"@types/deno\": \"^2.3.0\",\n \"@types/node\": \"^22.15.21\",\n \"typescript\": \"^5.8.3\"\n }\n}\n","{\n \"$schema\": \"https://json.schemastore.org/tsconfig\",\n \"compilerOptions\": {\n \"target\": \"es2024\",\n \"lib\": [\n \"es2024\"\n ],\n \"module\": \"esnext\",\n \"noEmit\": true,\n \"strict\": true,\n \"noImplicitAny\": true,\n \"isolatedModules\": true,\n \"esModuleInterop\": true,\n \"verbatimModuleSyntax\": true,\n \"allowImportingTsExtensions\": true,\n \"allowSyntheticDefaultImports\": true,\n \"skipLibCheck\": true,\n \"forceConsistentCasingInFileNames\": true,\n \"moduleResolution\": \"bundler\"\n }\n}\n","{\n \"@baeta/cli\": \"1.0.11\",\n \"@baeta/compiler\": \"1.0.9\",\n \"@baeta/core\": \"1.0.11\",\n \"create-baeta\": \"1.0.11\",\n \"@baeta/directives\": \"1.0.11\",\n \"@baeta/env\": \"1.0.9\",\n \"@baeta/errors\": \"1.0.9\",\n \"@baeta/extension-auth\": \"1.0.11\",\n \"@baeta/extension-cache\": \"1.0.11\",\n \"@baeta/extension-cache-cloudflare\": \"1.0.11\",\n \"@baeta/extension-cache-keyv\": \"1.0.11\",\n \"@baeta/extension-cache-redis\": \"1.0.11\",\n \"@baeta/extension-cache-upstash\": \"1.0.11\",\n \"@baeta/extension-complexity\": \"1.0.11\",\n \"@baeta/generator\": \"1.0.2\",\n \"@baeta/generator-sdk\": \"1.0.2\",\n \"@baeta/plugin\": \"1.0.1\",\n \"@baeta/plugin-autoload\": \"1.0.11\",\n \"@baeta/plugin-cloudflare\": \"1.0.11\",\n \"@baeta/plugin-directives\": \"1.0.11\",\n \"@baeta/plugin-exec\": \"1.0.11\",\n \"@baeta/plugin-gitignore\": \"1.0.11\",\n \"@baeta/plugin-graphql\": \"1.0.11\",\n \"@baeta/plugin-pagination\": \"1.0.11\",\n \"@baeta/plugin-prisma\": \"1.0.11\",\n \"@baeta/subscriptions-cloudflare\": \"0.1.6\",\n \"@baeta/subscriptions-pubsub\": \"1.0.9\",\n \"@baeta/util-encoding\": \"1.0.1\",\n \"@baeta/util-env\": \"1.0.1\",\n \"@baeta/util-log\": \"1.0.1\",\n \"@baeta/util-path\": \"1.0.1\"\n}","import tsconfig from '../../../tools/tsconfig/tsconfig.json';\nimport type { JavaScriptRuntime } from '../lib/constants.ts';\nimport type { TemplateFile } from '../lib/template-file.ts';\nimport dependenciesVersions from '../versions.json';\n\nexport type PackageJson = {\n\tname: string;\n\tscripts: Record<string, string | undefined>;\n\tdependencies: Record<string, string | undefined>;\n\tdevDependencies: Record<string, string | undefined>;\n};\n\nexport function makeSharedTemplate(\n\tappName: string,\n\truntime: JavaScriptRuntime,\n\tpackageJson: PackageJson,\n): TemplateFile[] {\n\treturn [\n\t\tmakePackageJson(appName, runtime, packageJson),\n\t\t{\n\t\t\trelativePath: './tsconfig.json',\n\t\t\tcontent: JSON.stringify(\n\t\t\t\t{\n\t\t\t\t\t...tsconfig,\n\t\t\t\t\tcompilerOptions: {\n\t\t\t\t\t\t...tsconfig.compilerOptions,\n\t\t\t\t\t\trootDir: 'src',\n\t\t\t\t\t\toutDir: 'dist',\n\t\t\t\t\t\tnoEmit: true,\n\t\t\t\t\t\temitDeclarationOnly: false,\n\t\t\t\t\t},\n\t\t\t\t\texclude: ['baeta.ts'],\n\t\t\t\t},\n\t\t\t\tnull,\n\t\t\t\t2,\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\trelativePath: './src/lib/extensions.ts',\n\t\t\tcontent: `import { createExtensions } from '@baeta/core';\nimport { complexityExtension } from '@baeta/extension-complexity';\nimport type { Context } from '../types/context.ts';\n\nconst complexity = complexityExtension<Context>({\n\tdefaultComplexity: 1,\n\tdefaultListMultiplier: 10,\n\tasync limit(ctx) {\n\t\treturn {\n\t\t\tdepth: 10,\n\t\t\tbreadth: 50,\n\t\t\tcomplexity: 1000,\n\t\t};\n\t},\n});\n\nexport default createExtensions(complexity);\n`,\n\t\t},\n\t\t{\n\t\t\trelativePath: './src/modules/user/user.gql',\n\t\t\tcontent: `type User {\n\tid: ID!\n\temail: String!\n\tlastName: String!\n\tprofile: String\n\tgivenName: String\n}\n\ninput UserWhereUniqueInput {\n\tid: ID!\n}\n\ntype Query {\n\tuser(where: UserWhereUniqueInput!): User\n\tusers: [User!]\n}\n`,\n\t\t},\n\t\t{\n\t\t\trelativePath: './src/modules/user/user.resolvers.ts',\n\t\t\tcontent: `import { getUserModule } from './typedef.ts';\n\nconst { Query } = getUserModule();\n\nQuery.user(({ args }) => {\n\treturn {\n\t\tid: args.where.id,\n\t\temail: 'jon.doe@baeta.io',\n\t\tlastName: 'Doe',\n\t};\n});\n\nQuery.user.$use(async ({ args }, next) => {\n\tconst result = await next();\n\tconsole.log('Got user:', result, 'for args:', args);\n\treturn result;\n});\n\nQuery.users(() => {\n\tconst users = Array.from({ length: 10 }).map((_, i) => ({\n\t\tid: i.toString(),\n\t\temail: \\`jon.doe\\${i}@baeta.io\\`,\n\t\tlastName: \\`Doe \\${i}\\`,\n\t}));\n\treturn users;\n});\n`,\n\t\t},\n\t\t{\n\t\t\trelativePath: './src/modules/user-photos/user-photos.gql',\n\t\t\tcontent: `type UserPhoto {\n\tid: ID!\n\tuserId: ID!\n\turl: String!\n}\n\nextend type User {\n\tphotos: [UserPhoto!]\n}\n`,\n\t\t},\n\t\t{\n\t\t\trelativePath: './src/modules/user-photos/user-photos.resolvers.ts',\n\t\t\tcontent: `import { getUserPhotosModule } from './typedef.ts';\n\nconst { User } = getUserPhotosModule();\n\nUser.photos(({ root }) => {\n\treturn Array.from({ length: 10 }).map((_, i) => ({\n\t\tid: \\`u\\${root.id}_p\\${i}\\`,\n\t\tuserId: root.id,\n\t\turl: \\`https://baeta.io/user/\\${root.id}/photo/\\${i}.png\\`,\n\t}));\n});\n`,\n\t\t},\n\t\t{\n\t\t\trelativePath: './baeta.ts',\n\t\t\tcontent: `import { defineConfig } from '@baeta/cli';\nimport { autoloadPlugin } from '@baeta/plugin-autoload';\n\nexport default defineConfig({\n\tgraphql: {\n\t\tschemas: ['src/**/*.gql'],\n\t\tcontextType: 'src/types/context#Context',\n\t\textensions: 'src/lib/extensions.ts',\n\t},\n\tcompiler: {\n\t\tsrc: 'src/app.ts',\n\t\tdist: 'dist',\n\t\tbundleWorkspaces: true,\n\t\tesbuild: {\n\t\t\tformat: 'esm',\n\t\t},\n\t},\n\tplugins: [autoloadPlugin()],\n});\n`,\n\t\t},\n\t\t{\n\t\t\trelativePath: './.gitignore',\n\t\t\tcontent: `# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\nlerna-debug.log*\n.pnpm-debug.log*\n\n# Diagnostic reports (https://nodejs.org/api/report.html)\nreport.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json\n\n# Runtime data\npids\n*.pid\n*.seed\n*.pid.lock\n\n# Directory for instrumented libs generated by jscoverage/JSCover\nlib-cov\n\n# Coverage directory used by tools like istanbul\ncoverage\n*.lcov\n\n# nyc test coverage\n.nyc_output\n\n# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)\n.grunt\n\n# Bower dependency directory (https://bower.io/)\nbower_components\n\n# node-waf configuration\n.lock-wscript\n\n# Compiled binary addons (https://nodejs.org/api/addons.html)\nbuild/Release\n\n# Dependency directories\nnode_modules/\njspm_packages/\n\n# Snowpack dependency directory (https://snowpack.dev/)\nweb_modules/\n\n# TypeScript cache\n*.tsbuildinfo\n\n# Optional npm cache directory\n.npm\n\n# Optional eslint cache\n.eslintcache\n\n# Optional stylelint cache\n.stylelintcache\n\n# Microbundle cache\n.rpt2_cache/\n.rts2_cache_cjs/\n.rts2_cache_es/\n.rts2_cache_umd/\n\n# Optional REPL history\n.node_repl_history\n\n# Output of 'npm pack'\n*.tgz\n\n# Yarn Integrity file\n.yarn-integrity\n\n# dotenv environment variable files\n.env\n.env.development.local\n.env.test.local\n.env.production.local\n.env.local\n\n# parcel-bundler cache (https://parceljs.org/)\n.cache\n.parcel-cache\n\n# Next.js build output\n.next\nout\n\n# Nuxt.js build / generate output\n.nuxt\ndist\n\n# Gatsby files\n.cache/\n# Comment in the public line in if your project uses Gatsby and not Next.js\n# https://nextjs.org/blog/next-9-1#public-directory-support\n# public\n\n# vuepress build output\n.vuepress/dist\n\n# vuepress v2.x temp and cache directory\n.temp\n.cache\n\n# vitepress build output\n**/.vitepress/dist\n\n# vitepress cache directory\n**/.vitepress/cache\n\n# Docusaurus cache and generated files\n.docusaurus\n\n# Serverless directories\n.serverless/\n\n# FuseBox cache\n.fusebox/\n\n# DynamoDB Local files\n.dynamodb/\n\n# TernJS port file\n.tern-port\n\n# Stores VSCode versions used for testing VSCode extensions\n.vscode-test\n\n# yarn v2\n.yarn/cache\n.yarn/unplugged\n.yarn/build-state.yml\n.yarn/install-state.gz\n.pnp.*\n`,\n\t\t},\n\t];\n}\n\nfunction makePackageJson(\n\tappName: string,\n\truntime: JavaScriptRuntime,\n\tpackageJson: {\n\t\tname: string;\n\t\tscripts: Record<string, string | undefined>;\n\t\tdependencies: Record<string, string | undefined>;\n\t\tdevDependencies: Record<string, string | undefined>;\n\t},\n) {\n\tconst meta = structuredClone(packageJson);\n\n\tfor (const [dep, version] of Object.entries(dependenciesVersions)) {\n\t\tif (dep in meta.dependencies) {\n\t\t\tmeta.dependencies[dep] = version;\n\t\t} else if (dep in packageJson.devDependencies) {\n\t\t\tmeta.devDependencies[dep] = version;\n\t\t}\n\t}\n\n\tif (runtime === 'node') {\n\t\tmeta.devDependencies['@types/bun'] = undefined;\n\t\tmeta.devDependencies['@types/deno'] = undefined;\n\t}\n\n\tif (runtime === 'bun') {\n\t\tmeta.scripts.start = `baeta generate --watch --run='bun --watch --inspect src/app.ts'`;\n\t\tmeta.devDependencies['@types/node'] = undefined;\n\t\tmeta.devDependencies['@types/deno'] = undefined;\n\t}\n\n\tif (runtime === 'deno') {\n\t\tmeta.scripts.start = `baeta generate --watch --run='deno --watch --allow-env --allow-read --allow-net src/app.ts'`;\n\t\tmeta.devDependencies['@types/node'] = undefined;\n\t\tmeta.devDependencies['@types/bun'] = undefined;\n\t}\n\n\tmeta.name = appName;\n\n\treturn {\n\t\trelativePath: './package.json',\n\t\tcontent: JSON.stringify(meta, null, 2),\n\t};\n}\n","import type { JavaScriptRuntime } from '../lib/constants.ts';\nimport type { TemplateFile } from '../lib/template-file.ts';\nimport apolloPackageJson from '../meta/apollo/package.json';\nimport { makeSharedTemplate } from './shared.ts';\n\nexport async function makeApolloTemplate(\n\tappName: string,\n\truntime: JavaScriptRuntime,\n): Promise<TemplateFile[]> {\n\treturn [\n\t\t...makeSharedTemplate(appName, runtime, apolloPackageJson),\n\t\t{\n\t\t\trelativePath: './src/types/context.ts',\n\t\t\tcontent: `export type Context = {\n\tuserId?: string;\n};\n`,\n\t\t},\n\t\t{\n\t\t\trelativePath: './src/app.ts',\n\t\t\tcontent: `import { ApolloServer } from '@apollo/server';\nimport { startStandaloneServer } from '@apollo/server/standalone';\nimport { createApplication } from '@baeta/core';\nimport { modules } from './modules/autoload.ts';\nimport type { Context } from './types/context.ts';\n\nconst baeta = createApplication({\n\tmodules,\n});\n\nconst server = new ApolloServer<Context>({\n\tschema: baeta.schema,\n});\n\nconst { url } = await startStandaloneServer(server, {\n\tlisten: { port: 4000 },\n});\n\nconsole.log(\\`🚀 Server ready at: \\${url}\\`);\n`,\n\t\t},\n\t];\n}\n","{\n \"name\": \"@baeta/template-yoga\",\n \"version\": \"0.0.0\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"build\": \"baeta build --generate\",\n \"start\": \"baeta build --watch --generate --onSuccess='node --enable-source-maps --inspect dist/app.js'\"\n },\n \"dependencies\": {\n \"@baeta/core\": \"workspace:^\",\n \"@baeta/errors\": \"workspace:^\",\n \"@baeta/extension-complexity\": \"workspace:^\",\n \"graphql\": \"^16.11.0\",\n \"graphql-yoga\": \"^5.13.5\"\n },\n \"devDependencies\": {\n \"@baeta/cli\": \"workspace:^\",\n \"@baeta/compiler\": \"workspace:^\",\n \"@baeta/plugin-autoload\": \"workspace:^\",\n \"@types/bun\": \"^1.2.14\",\n \"@types/deno\": \"^2.3.0\",\n \"@types/node\": \"^22.15.21\",\n \"typescript\": \"^5.8.3\"\n }\n}\n","import type { JavaScriptRuntime } from '../lib/constants.ts';\nimport type { TemplateFile } from '../lib/template-file.ts';\nimport yogaPackageJson from '../meta/yoga/package.json';\nimport { makeSharedTemplate } from './shared.ts';\n\nexport async function makeYogaTemplate(\n\tappName: string,\n\truntime: JavaScriptRuntime,\n): Promise<TemplateFile[]> {\n\treturn [\n\t\t...makeSharedTemplate(appName, runtime, yogaPackageJson),\n\t\t...makeRuntimeFiles(runtime),\n\t\t{\n\t\t\trelativePath: './src/types/context.ts',\n\t\t\tcontent: `export type Context = {\n\tappVersion: string;\n};\n\n// biome-ignore lint/complexity/noBannedTypes: Empty context\nexport type ServerContext = {};\n`,\n\t\t},\n\t];\n}\n\nfunction makeRuntimeFiles(runtime: JavaScriptRuntime): TemplateFile[] {\n\tswitch (runtime) {\n\t\tcase 'bun':\n\t\t\treturn makeBunFiles();\n\t\tcase 'deno':\n\t\t\treturn makeDenoFiles();\n\t\tcase 'node':\n\t\t\treturn makeNodeFiles();\n\t\tdefault:\n\t\t\treturn [] satisfies never[];\n\t}\n}\n\nfunction makeBunFiles(): TemplateFile[] {\n\treturn [\n\t\t{\n\t\t\trelativePath: './src/app.ts',\n\t\t\tcontent: `import { createApplication } from '@baeta/core';\nimport { createYoga } from 'graphql-yoga';\nimport { modules } from './modules/autoload.ts';\nimport type { Context, ServerContext } from './types/context.ts';\n\nconst baeta = createApplication({\n\tmodules,\n});\n\nexport const yoga = createYoga<ServerContext, Context>({\n\tschema: baeta.schema,\n\tcontext: {\n\t\tappVersion: '1.0.0',\n\t},\n});\n\nBun.serve({\n\tfetch: yoga.fetch,\n\tport: 4000,\n});\n\nconsole.log(\\`🚀 Server ready at http://localhost:4000\\${yoga.graphqlEndpoint}\\`);\n`,\n\t\t},\n\t];\n}\n\nfunction makeDenoFiles(): TemplateFile[] {\n\treturn [\n\t\t{\n\t\t\trelativePath: './src/app.ts',\n\t\t\tcontent: `import { createApplication } from '@baeta/core';\nimport { createYoga } from 'graphql-yoga';\nimport { modules } from './modules/autoload.ts';\nimport type { Context, ServerContext } from './types/context.ts';\n\nconst baeta = createApplication({\n\tmodules,\n});\n\nexport const yoga = createYoga<ServerContext, Context>({\n\tschema: baeta.schema,\n\tcontext: {\n\t\tappVersion: '1.0.0',\n\t},\n});\n\nDeno.serve(\n\t{\n\t\tport: 4000,\n\t\tonListen() {\n\t\t\tconsole.log(\\`🚀 Server ready at http://localhost:4000\\${yoga.graphqlEndpoint}\\`);\n\t\t},\n\t},\n\tyoga.fetch,\n);\n`,\n\t\t},\n\t];\n}\n\nfunction makeNodeFiles(): TemplateFile[] {\n\treturn [\n\t\t{\n\t\t\trelativePath: './src/app.ts',\n\t\t\tcontent: `import { createServer } from 'node:http';\nimport { createApplication } from '@baeta/core';\nimport { createYoga } from 'graphql-yoga';\nimport { modules } from './modules/autoload.ts';\nimport type { Context, ServerContext } from './types/context.ts';\n\nconst baeta = createApplication({\n\tmodules,\n});\n\nexport const yoga = createYoga<ServerContext, Context>({\n\tschema: baeta.schema,\n\tcontext: {\n\t\tappVersion: '1.0.0',\n\t},\n});\n\nconst server = createServer(yoga);\n\nserver.listen(4000, () => {\n\tconsole.log(\\`🚀 Server ready at http://localhost:4000\\${yoga.graphqlEndpoint}\\`);\n});\n`,\n\t\t},\n\t];\n}\n","import path from 'node:path';\nimport { logger } from '@docusaurus/logger';\nimport shell from 'shelljs';\nimport supportsColor from 'supports-color';\nimport { getAppName } from './app-name.ts';\nimport type { PackageManager } from './constants.ts';\nimport { getInstallCommand, getPackageManager } from './package-manager.ts';\nimport { getRuntime } from './runtime.ts';\nimport { copyTemplate, getTemplate } from './templates.ts';\n\nexport interface Args {\n\tpackageManager?: PackageManager;\n\tskipInstall?: boolean;\n\tappName?: string;\n\ttemplate?: string;\n\trootDir: string;\n}\n\nexport async function handler(args: Args) {\n\tconst appName = await getAppName(args.appName, args.rootDir);\n\tconst dest = path.resolve(args.rootDir, appName);\n\n\tconst template = await getTemplate(args.template);\n\n\tconst runtime = await getRuntime();\n\n\tlogger.info('Creating new Baeta project...');\n\n\ttry {\n\t\tawait copyTemplate(appName, runtime, template, dest);\n\t} catch (err) {\n\t\tlogger.error`Copying Baeta template name=${template} failed!`;\n\t\tthrow err;\n\t}\n\n\tconst pkgManager = await getPackageManager(dest, args);\n\n\tif (!args.skipInstall) {\n\t\tshell.cd(dest);\n\t\tlogger.info`Installing dependencies with name=${pkgManager}...`;\n\t\tconst result = shell.exec(getInstallCommand(pkgManager), {\n\t\t\tenv: {\n\t\t\t\t...process.env,\n\t\t\t\t...(supportsColor.stdout ? { FORCE_COLOR: '1' } : {}),\n\t\t\t},\n\t\t});\n\n\t\tif (result.code !== 0) {\n\t\t\tconsole.error('Dependency installation failed.');\n\t\t\tlogger.error('Dependency installation failed.');\n\t\t\tlogger.info`The app directory has already been created, and you can retry by typing:\n\ncode=${`cd ${dest}`}\ncode=${`${pkgManager} install`}`;\n\n\t\t\tprocess.exit(0);\n\t\t}\n\t}\n\n\tconst useNpm = pkgManager === 'npm';\n\tconst useBun = pkgManager === 'bun';\n\tconst useRunCommand = useNpm || useBun;\n\n\tlogger.success`Created name=${dest}.`;\n\n\tlogger.info`Inside that directory, you can run several commands:\n\n code=${`${pkgManager} start`}\n Starts the development server.\n\n code=${`${pkgManager} ${useRunCommand ? 'run ' : ''}build`}\n Bundles your server application.\n\nWe recommend that you begin by typing:\n\n code=${`cd ${dest}`}\n code=${`${pkgManager} start`}\n`;\n}\n"],"mappings":";AAAO,IAAM,wBAAwB;AAE9B,IAAM,gB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;AAC9B,QAAM,SAAS,eAAe;AAC9B,QAAM,gBAAgB,UAAU;AAEhC,EAAAA,QAAO,uBAAuB,IAAI;AAElC,EAAAA,QAAO;AAAA;AAAA,SAEC,GAAG,UAAU,QAAQ;AAAA;AAAA;AAAA,SAGrB,GAAG,UAAU,IAAI,gBAAgB,SAAS,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,SAKnD,MAAM,IAAI,EAAE;AAAA,SACZ,GAAG,UAAU,QAAQ;AAAA;AAE9B;","names":["path","logger","fs","prompts","path","fs","prompts","logger","logger","prompts","shell","shell","prompts","logger","path","logger","fs","prompts","package_default","package_default","prompts","logger","path","fs","path","logger","shell","path","logger","shell"]}
|
package/dist/cli.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
package/dist/index.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
declare function getAppName(reqName: string | undefined, rootDir: string): Promise<string>;
|
|
2
|
-
|
|
3
|
-
declare const defaultPackageManager = "npm";
|
|
4
|
-
declare const lockfileNames: {
|
|
5
|
-
npm: string;
|
|
6
|
-
yarn: string;
|
|
7
|
-
pnpm: string;
|
|
8
|
-
bun: string;
|
|
9
|
-
};
|
|
10
|
-
declare const packageManagers: PackageManager[];
|
|
11
|
-
type PackageManager = keyof typeof lockfileNames;
|
|
12
|
-
declare const runtimes: readonly ["node", "deno", "bun"];
|
|
13
|
-
type JavaScriptRuntime = (typeof runtimes)[number];
|
|
14
|
-
declare const defaultJavaScriptRuntime = "node";
|
|
15
|
-
declare const templates: readonly ["yoga", "apollo"];
|
|
16
|
-
type Template = (typeof templates)[number];
|
|
17
|
-
|
|
18
|
-
interface CliOptions {
|
|
19
|
-
packageManager?: PackageManager;
|
|
20
|
-
skipInstall?: boolean;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface Args {
|
|
24
|
-
packageManager?: PackageManager;
|
|
25
|
-
skipInstall?: boolean;
|
|
26
|
-
appName?: string;
|
|
27
|
-
template?: string;
|
|
28
|
-
rootDir: string;
|
|
29
|
-
}
|
|
30
|
-
declare function handler(args: Args): Promise<void>;
|
|
31
|
-
|
|
32
|
-
declare function getPackageManager(dest: string, { packageManager, skipInstall }: CliOptions): Promise<PackageManager>;
|
|
33
|
-
declare function getInstallCommand(pkgManager: PackageManager): string;
|
|
34
|
-
|
|
35
|
-
declare function getRuntime(): Promise<JavaScriptRuntime>;
|
|
36
|
-
|
|
37
|
-
type TemplateFile = {
|
|
38
|
-
relativePath: string;
|
|
39
|
-
content: string;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
declare function getTemplate(reqTemplate: string | undefined): Promise<"yoga" | "apollo">;
|
|
43
|
-
declare function copyTemplate(appName: string, runtime: JavaScriptRuntime, template: Template, dest: string): Promise<void>;
|
|
44
|
-
|
|
45
|
-
export { type Args, type CliOptions, type JavaScriptRuntime, type PackageManager, type Template, type TemplateFile, copyTemplate, defaultJavaScriptRuntime, defaultPackageManager, getAppName, getInstallCommand, getPackageManager, getRuntime, getTemplate, handler, lockfileNames, packageManagers, runtimes, templates };
|