create-baeta 2.0.0-next.15 → 2.0.0-next.16
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 +4 -54
- package/README.md +2 -1
- package/dist/cli.js +2 -2
- package/dist/cli.js.map +1 -1
- package/dist/{handler-BVAo8CHH.js → handler-DCzxj3hC.js} +10 -9
- package/dist/handler-DCzxj3hC.js.map +1 -0
- package/dist/index.js +1 -1
- package/package.json +4 -4
- package/dist/handler-BVAo8CHH.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,62 +1,12 @@
|
|
|
1
1
|
# create-baeta
|
|
2
2
|
|
|
3
|
-
## 2.0.0-next.
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- Drop Node v23 and v25 by [@andreisergiu98](https://github.com/andreisergiu98) in [#474](https://github.com/andreisergiu98/baeta/pull/474)
|
|
8
|
-
|
|
9
|
-
- Validate app name by [@andreisergiu98](https://github.com/andreisergiu98) in [#512](https://github.com/andreisergiu98/baeta/pull/512)
|
|
10
|
-
|
|
11
|
-
- Drop prompts dependency in favor of inquirer by [@andreisergiu98](https://github.com/andreisergiu98) in [#418](https://github.com/andreisergiu98/baeta/pull/418)
|
|
12
|
-
|
|
13
|
-
- Check for bun.lock by [@andreisergiu98](https://github.com/andreisergiu98) in [#516](https://github.com/andreisergiu98/baeta/pull/516)
|
|
14
|
-
|
|
15
|
-
## 2.0.0-next.14
|
|
16
|
-
|
|
17
|
-
## 2.0.0-next.13
|
|
18
|
-
|
|
19
|
-
## 2.0.0-next.12
|
|
20
|
-
|
|
21
|
-
## 2.0.0-next.11
|
|
22
|
-
|
|
23
|
-
## 2.0.0-next.10
|
|
24
|
-
|
|
25
|
-
## 2.0.0-next.9
|
|
26
|
-
|
|
27
|
-
## 2.0.0-next.8
|
|
28
|
-
|
|
29
|
-
## 2.0.0-next.7
|
|
30
|
-
|
|
31
|
-
### Patch Changes
|
|
32
|
-
|
|
33
|
-
- [#214](https://github.com/andreisergiu98/baeta/pull/214) [`c47665a`](https://github.com/andreisergiu98/baeta/commit/c47665a76a0f88bae07f42983b380361e4f0843a) Thanks [@andreisergiu98](https://github.com/andreisergiu98)! - Fix create-baeta template using the old middleware function call
|
|
34
|
-
|
|
35
|
-
## 2.0.0-next.2
|
|
36
|
-
|
|
37
|
-
### Patch Changes
|
|
38
|
-
|
|
39
|
-
- Fix broken types
|
|
40
|
-
|
|
41
|
-
## 2.0.0-next.1
|
|
42
|
-
|
|
43
|
-
### Patch Changes
|
|
44
|
-
|
|
45
|
-
- Fix release version
|
|
46
|
-
|
|
47
|
-
## 2.0.0-next.0
|
|
3
|
+
## 2.0.0-next.16
|
|
48
4
|
|
|
49
5
|
### Major Changes
|
|
50
6
|
|
|
51
|
-
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
- **Stricter type safety.**
|
|
55
|
-
You must now **explicitly define resolvers for every field** during development—breakages that used to surface at runtime are now caught at compile time.
|
|
56
|
-
- **Removed `@baeta/compiler`.**
|
|
57
|
-
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.
|
|
58
|
-
- **Subscriptions update.**
|
|
59
|
-
`@baeta/subscriptions-pubsub` now targets **`graphql-subscriptions` v3**.
|
|
7
|
+
- `create baeta` (still offering the `yoga` and `apollo` templates with Node/Bun/Deno runtime selection) now scaffolds a v2 project end to end. by [@andreisergiu98](https://github.com/andreisergiu98) in [#290](https://github.com/andreisergiu98/baeta/pull/290)
|
|
8
|
+
|
|
9
|
+
- Drop support for Node.js v23 and v25. Baeta now targets the active LTS releases — Node.js `^22.20.0`, `^24.0.0`, or `>=26.0.0`. by [@andreisergiu98](https://github.com/andreisergiu98) in [#290](https://github.com/andreisergiu98/baeta/pull/290)
|
|
60
10
|
|
|
61
11
|
## 1.0.11
|
|
62
12
|
|
package/README.md
CHANGED
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
<div align="center">
|
|
6
6
|
<h1>Baeta</h1>
|
|
7
7
|
<a href="https://www.npmjs.com/package/@baeta/cli"><img src="https://img.shields.io/npm/v/@baeta/cli.svg?style=flat" /></a>
|
|
8
|
-
<a href="https://github.com/andreisergiu98/baeta/actions/workflows/
|
|
8
|
+
<a href="https://github.com/andreisergiu98/baeta/actions/workflows/build.yml"><img src="https://img.shields.io/github/actions/workflow/status/andreisergiu98/baeta/build.yml" /></a>
|
|
9
9
|
<a href="https://github.com/andreisergiu98/baeta/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" /></a>
|
|
10
10
|
<a href="https://github.com/andreisergiu98/baeta/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" /></a>
|
|
11
|
+
<img alt="nycrc config on GitHub" src="https://img.shields.io/nycrc/andreisergiu98/baeta?config=.nycrc.json&preferredThreshold=branches&color=green">
|
|
11
12
|
<br />
|
|
12
13
|
<br />
|
|
13
14
|
<a href="https://baeta.io/docs/getting-started/installation">Getting Started</a>
|
package/dist/cli.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as handler, u as packageManagers } from "./handler-
|
|
2
|
+
import { t as handler, u as packageManagers } from "./handler-DCzxj3hC.js";
|
|
3
3
|
import { logger } from "@docusaurus/logger";
|
|
4
4
|
import semver from "semver";
|
|
5
5
|
import yargs from "yargs";
|
|
6
6
|
import { hideBin } from "yargs/helpers";
|
|
7
7
|
//#region package.json
|
|
8
|
-
var version = "2.0.0-next.
|
|
8
|
+
var version = "2.0.0-next.16";
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region cli.ts
|
|
11
11
|
const requiredVersion = { "node": "^22.20.0 || ^24.0.0 || >=26.0.0" }.node;
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","names":[],"sources":["../package.json","../cli.ts"],"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\nawait yargs(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"],"mappings":";;;;;;;;;;ACUA,MAAM,kBAAkB,4CAAA,EAAQ;AAEhC,IAAI,CAAC,OAAO,UAAU,QAAQ,SAAS,eAAe,GAAG;CACxD,OAAO,MAAM,oCAAoC;CACjD,OAAO,IAAI,gCAAgC,QAAQ,QAAQ,gCAAgC,gBAAgB;CAC3G,QAAQ,KAAK,CAAC;AACf;AAEA,QAAQ,GAAG,uBAAuB,QAAQ;CACzC,OAAO,MAAM,GAAG;CAChB,QAAQ,KAAK,CAAC;AACf,CAAC;AAED,MAAM,MAAM,QAAQ,QAAQ,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"cli.js","names":[],"sources":["../package.json","../cli.ts"],"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\nawait yargs(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"],"mappings":";;;;;;;;;;ACUA,MAAM,kBAAkB,4CAAA,EAAQ;AAEhC,IAAI,CAAC,OAAO,UAAU,QAAQ,SAAS,eAAe,GAAG;CACxD,OAAO,MAAM,oCAAoC;CACjD,OAAO,IAAI,gCAAgC,QAAQ,QAAQ,gCAAgC,gBAAgB;CAC3G,QAAQ,KAAK,CAAC;AACf;AAEA,QAAQ,GAAG,uBAAuB,QAAQ;CACzC,OAAO,MAAM,GAAG;CAChB,QAAQ,KAAK,CAAC;AACf,CAAC;AAED,MAAM,MAAM,QAAQ,QAAQ,IAAI,CAAC,CAAC,CAChC,QAAQ,OAAO,CAAC,CAChB,QAAQ;CACR,SAAS;CACT,UAAU;CACV,UAAU,UAAU;EACnB,OAAO,MACL,OAAO,mBAAmB;GAC1B,OAAO;GACP,UAAU;GACV,MAAM;GACN,SAAS;EACV,CAAC,CAAC,CACD,OAAO,gBAAgB;GACvB,OAAO;GACP,UAAU;GACV,MAAM;EACP,CAAC,CAAC,CACD,WAAW,WAAW;GACtB,MAAM;GACN,UAAU;EACX,CAAC,CAAC,CACD,WAAW,YAAY;GACvB,MAAM;GACN,UAAU;GACV,SAAS,CAAC,QAAQ,QAAQ;EAC3B,CAAC,CAAC,CACD,WAAW,WAAW;GACtB,MAAM;GACN,UAAU;GACV,SAAS;EACV,CAAC;CACH;CACA,UAAU,SAAS,QAAQ,IAAI;AAChC,CAAC,CAAC,CACD,eAAe,IAAI,CAAC,CACpB,OAAO,CAAC,CACR,KAAK,CAAC,CACN,MAAM"}
|
|
@@ -159,13 +159,13 @@ var package_default$1 = {
|
|
|
159
159
|
//#region versions.apollo.json
|
|
160
160
|
var versions_apollo_default = {
|
|
161
161
|
dependencies: {
|
|
162
|
-
"@baeta/complexity": "^2.0.0-next.
|
|
163
|
-
"@baeta/core": "^2.0.0-next.
|
|
164
|
-
"@baeta/errors": "^2.0.0-next.
|
|
162
|
+
"@baeta/complexity": "^2.0.0-next.16",
|
|
163
|
+
"@baeta/core": "^2.0.0-next.16",
|
|
164
|
+
"@baeta/errors": "^2.0.0-next.16",
|
|
165
165
|
"graphql": "^16.6.0"
|
|
166
166
|
},
|
|
167
167
|
devDependencies: {
|
|
168
|
-
"@baeta/cli": "^2.0.0-next.
|
|
168
|
+
"@baeta/cli": "^2.0.0-next.16",
|
|
169
169
|
"@types/node": "^22.19.17",
|
|
170
170
|
"typescript": "^6.0.0"
|
|
171
171
|
},
|
|
@@ -213,6 +213,7 @@ function makeSharedTemplate(appName, runtime, packageJson, versions) {
|
|
|
213
213
|
rootDir: "src",
|
|
214
214
|
outDir: "dist",
|
|
215
215
|
noEmit: true,
|
|
216
|
+
types: [runtime],
|
|
216
217
|
emitDeclarationOnly: false
|
|
217
218
|
},
|
|
218
219
|
exclude: ["baeta.ts"]
|
|
@@ -589,14 +590,14 @@ var package_default = {
|
|
|
589
590
|
//#region versions.yoga.json
|
|
590
591
|
var versions_yoga_default = {
|
|
591
592
|
dependencies: {
|
|
592
|
-
"@baeta/complexity": "^2.0.0-next.
|
|
593
|
-
"@baeta/core": "^2.0.0-next.
|
|
594
|
-
"@baeta/errors": "^2.0.0-next.
|
|
593
|
+
"@baeta/complexity": "^2.0.0-next.16",
|
|
594
|
+
"@baeta/core": "^2.0.0-next.16",
|
|
595
|
+
"@baeta/errors": "^2.0.0-next.16",
|
|
595
596
|
"graphql": "^16.6.0",
|
|
596
597
|
"graphql-yoga": "^5.21.0"
|
|
597
598
|
},
|
|
598
599
|
devDependencies: {
|
|
599
|
-
"@baeta/cli": "^2.0.0-next.
|
|
600
|
+
"@baeta/cli": "^2.0.0-next.16",
|
|
600
601
|
"@types/node": "^22.19.17",
|
|
601
602
|
"typescript": "^6.0.0"
|
|
602
603
|
},
|
|
@@ -812,4 +813,4 @@ We recommend that you begin by typing:
|
|
|
812
813
|
//#endregion
|
|
813
814
|
export { getInstallCommand as a, defaultPackageManager as c, runtimes as d, templates as f, getRuntime as i, lockfileNames as l, copyTemplate as n, getPackageManager as o, getAppName as p, getTemplate as r, defaultJavaScriptRuntime as s, handler as t, packageManagers as u };
|
|
814
815
|
|
|
815
|
-
//# sourceMappingURL=handler-
|
|
816
|
+
//# sourceMappingURL=handler-DCzxj3hC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handler-DCzxj3hC.js","names":["tsconfig","tsconfig.compilerOptions","apolloPackageJson","versions","yogaPackageJson","versions"],"sources":["../lib/app-name.ts","../lib/constants.ts","../lib/package-manager.ts","../lib/runtime.ts","../meta/apollo/package.json","../versions.apollo.json","../../../tools/tsconfig/tsconfig.json","../templates/shared.ts","../templates/apollo.ts","../meta/yoga/package.json","../versions.yoga.json","../templates/yoga.ts","../lib/templates.ts","../lib/handler.ts"],"sourcesContent":["import path from 'node:path';\nimport { logger } from '@docusaurus/logger';\nimport input from '@inquirer/input';\nimport fs from 'fs-extra';\n\nconst APP_NAME_RE = /^(?:@[a-z0-9][a-z0-9._-]*\\/)?[a-z0-9][a-z0-9._-]*$/;\n\nexport async function getAppName(reqName: string | undefined, rootDir: string): Promise<string> {\n\tconst resolvedRoot = path.resolve(rootDir);\n\n\tasync function validateAppName(appName: string) {\n\t\tif (!appName) {\n\t\t\treturn 'An app name is required.';\n\t\t}\n\t\tif (!APP_NAME_RE.test(appName)) {\n\t\t\treturn 'App name must contain only lowercase letters, digits, dashes, underscores, or dots, and may optionally include an npm scope.';\n\t\t}\n\t\tconst dest = path.resolve(resolvedRoot, 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 TypeError(res);\n\t\t}\n\t\treturn reqName;\n\t}\n\n\ttry {\n\t\treturn await input({\n\t\t\tmessage: 'What should we name this app?',\n\t\t\tdefault: 'baeta-app',\n\t\t\tvalidate: validateAppName,\n\t\t});\n\t} catch (error) {\n\t\tif (error instanceof Error && error.name === 'ExitPromptError') {\n\t\t\tlogger.error('An app name is required.');\n\t\t\tprocess.exit(1);\n\t\t}\n\t\tthrow error;\n\t}\n}\n","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.lock', 'bun.lockb'],\n} as const;\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 select from '@inquirer/select';\nimport fs from 'fs-extra';\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\tfor (const lockFileName of lockfileNames[packageManager]) {\n\t\t\tconst lockFilePath = path.join(rootDir, lockFileName);\n\t\t\tif (await fs.pathExists(lockFilePath)) {\n\t\t\t\treturn packageManager;\n\t\t\t}\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 = [\n\t\t'npm' as const,\n\t\thasYarn && ('yarn' as const),\n\t\thasPnpm && ('pnpm' as const),\n\t\thasBun && ('bun' as const),\n\t]\n\t\t.filter((p) => p !== false)\n\t\t.map((p) => ({ value: p }));\n\n\ttry {\n\t\treturn await select<PackageManager>({\n\t\t\tmessage: 'Select a package manager...',\n\t\t\tchoices,\n\t\t\tdefault: defaultPackageManager,\n\t\t});\n\t} catch (error) {\n\t\tif (error instanceof Error && error.name === 'ExitPromptError') {\n\t\t\tlogger.info`Falling back to name=${defaultPackageManager}`;\n\t\t\treturn defaultPackageManager;\n\t\t}\n\t\tthrow error;\n\t}\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 await 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 select from '@inquirer/select';\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' as const, hasBun && ('bun' as const), hasDeno && ('deno' as const)]\n\t\t.filter((p) => p !== false)\n\t\t.map((p) => ({ value: p }));\n\n\ttry {\n\t\treturn await select<JavaScriptRuntime>({\n\t\t\tmessage: 'Select a runtime...',\n\t\t\tchoices,\n\t\t});\n\t} catch (error) {\n\t\tif (error instanceof Error && error.name === 'ExitPromptError') {\n\t\t\tlogger.info`Falling back to name=${defaultJavaScriptRuntime}`;\n\t\t\treturn defaultJavaScriptRuntime;\n\t\t}\n\t\tthrow error;\n\t}\n}\n","","","","import tsconfig from '../../../tools/tsconfig/tsconfig.json';\nimport type { JavaScriptRuntime } from '../lib/constants.ts';\nimport type { TemplateFile } from '../lib/template-file.ts';\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 type ResolvedPackageVersions = {\n\tdependencies: Record<string, string | undefined>;\n\tdevDependencies: Record<string, string | undefined>;\n\tpeerDependencies: Record<string, string | undefined>;\n};\n\nexport function makeSharedTemplate(\n\tappName: string,\n\truntime: JavaScriptRuntime,\n\tpackageJson: PackageJson,\n\tversions: ResolvedPackageVersions,\n): TemplateFile[] {\n\treturn [\n\t\tmakePackageJson(appName, runtime, packageJson, versions),\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\ttypes: [runtime],\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/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\tversions: ResolvedPackageVersions,\n) {\n\tconst meta = structuredClone(packageJson);\n\tconst fields = ['dependencies', 'devDependencies'] as const;\n\tfor (const field of fields) {\n\t\tfor (const [dep, version] of Object.entries(versions[field] ?? {})) {\n\t\t\tmeta[field][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 versions from '../versions.apollo.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, versions),\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","","","import type { JavaScriptRuntime } from '../lib/constants.ts';\nimport type { TemplateFile } from '../lib/template-file.ts';\nimport yogaPackageJson from '../meta/yoga/package.json';\nimport versions from '../versions.yoga.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, versions),\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\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 select from '@inquirer/select';\nimport fs from 'fs-extra';\nimport { makeApolloTemplate } from '../templates/apollo.ts';\nimport { makeYogaTemplate } from '../templates/yoga.ts';\nimport { type JavaScriptRuntime, type Template, templates } from './constants.ts';\n\nfunction createTemplateChoices() {\n\treturn templates.map((template) => ({ name: template, value: template }));\n}\n\nasync function askTemplateChoice() {\n\ttry {\n\t\treturn await select<Template>({\n\t\t\tmessage: 'Select a template below...',\n\t\t\tchoices: createTemplateChoices(),\n\t\t});\n\t} catch (error) {\n\t\tif (error instanceof Error && error.name === 'ExitPromptError') {\n\t\t\tlogger.error('A choice is required.');\n\t\t\tprocess.exit(1);\n\t\t}\n\t\tthrow error;\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\tconst promises = files.map(async (file) => {\n\t\tconst filePath = path.join(dest, file.relativePath);\n\t\tawait fs.ensureDir(path.dirname(filePath));\n\t\tawait fs.writeFile(filePath, file.content);\n\t});\n\tawait Promise.all(promises);\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\tconst useNpm = pkgManager === 'npm';\n\tconst useBun = pkgManager === 'bun';\n\tconst useRunCommand = useNpm || useBun;\n\tconst runCommand = useRunCommand ? 'run ' : '';\n\n\tconst start = `${pkgManager} start`;\n\tconst build = `${pkgManager} ${runCommand}build`;\n\tconst cd = `cd ${dest}`;\n\tconst install = `${pkgManager} install`;\n\n\tif (!args.skipInstall) {\n\t\tlogger.info`Installing dependencies with name=${pkgManager}...`;\n\t\tconst result = shell.exec(getInstallCommand(pkgManager), {\n\t\t\tcwd: dest,\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}\ncode=${install}`;\n\n\t\t\tprocess.exit(1);\n\t\t}\n\t}\n\n\tlogger.success`Created name=${dest}.`;\n\n\tlogger.info`Inside that directory, you can run several commands:\n\n code=${start}\n Starts the development server.\n\n code=${build}\n Generates the Baeta application.\n\nWe recommend that you begin by typing:\n\n code=${cd}\n code=${start}\n`;\n}\n"],"mappings":";;;;;;;;AAKA,MAAM,cAAc;AAEpB,eAAsB,WAAW,SAA6B,SAAkC;CAC/F,MAAM,eAAe,KAAK,QAAQ,OAAO;CAEzC,eAAe,gBAAgB,SAAiB;EAC/C,IAAI,CAAC,SACJ,OAAO;EAER,IAAI,CAAC,YAAY,KAAK,OAAO,GAC5B,OAAO;EAER,MAAM,OAAO,KAAK,QAAQ,cAAc,OAAO;EAC/C,IAAI,MAAM,GAAG,WAAW,IAAI,GAC3B,OAAO,OAAO,WAAW,oCAAoC,KAAK;EAEnE,OAAO;CACR;CAEA,IAAI,SAAS;EACZ,MAAM,MAAM,MAAM,gBAAgB,OAAO;EACzC,IAAI,OAAO,QAAQ,UAClB,MAAM,IAAI,UAAU,GAAG;EAExB,OAAO;CACR;CAEA,IAAI;EACH,OAAO,MAAM,MAAM;GAClB,SAAS;GACT,SAAS;GACT,UAAU;EACX,CAAC;CACF,SAAS,OAAO;EACf,IAAI,iBAAiB,SAAS,MAAM,SAAS,mBAAmB;GAC/D,OAAO,MAAM,0BAA0B;GACvC,QAAQ,KAAK,CAAC;EACf;EACA,MAAM;CACP;AACD;;;AC7CA,MAAa,wBAAwB;AAErC,MAAa,gBAAgB;CAC5B,KAAK,CAAC,mBAAmB;CACzB,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,MAAM;CACP;CAEA,MAAM,aAAa,MAAM,kBAAkB,MAAM,IAAI;CAKrD,MAAM,aAHS,eAAe,SACf,eAAe,QAEK,SAAS;CAE5C,MAAM,QAAQ,GAAG,WAAW;CAC5B,MAAM,QAAQ,GAAG,WAAW,GAAG,WAAW;CAC1C,MAAM,KAAK,MAAM;CACjB,MAAM,UAAU,GAAG,WAAW;CAE9B,IAAI,CAAC,KAAK,aAAa;EACtB,OAAO,IAAI,qCAAqC,WAAW;EAS3D,IARe,MAAM,KAAK,kBAAkB,UAAU,GAAG;GACxD,KAAK;GACL,KAAK;IACJ,GAAG,QAAQ;IACX,GAAI,cAAc,SAAS,EAAE,aAAa,IAAI,IAAI,CAAC;GACpD;EACD,CAES,CAAC,CAAC,SAAS,GAAG;GACtB,QAAQ,MAAM,iCAAiC;GAC/C,OAAO,MAAM,iCAAiC;GAC9C,OAAO,IAAI;;OAEP,GAAG;OACH;GAEJ,QAAQ,KAAK,CAAC;EACf;CACD;CAEA,OAAO,OAAO,gBAAgB,KAAK;CAEnC,OAAO,IAAI;;SAEH,MAAM;;;SAGN,MAAM;;;;;SAKN,GAAG;SACH,MAAM;;AAEf"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as getInstallCommand, c as defaultPackageManager, d as runtimes, f as templates, i as getRuntime, l as lockfileNames, n as copyTemplate, o as getPackageManager, p as getAppName, r as getTemplate, s as defaultJavaScriptRuntime, t as handler, u as packageManagers } from "./handler-
|
|
1
|
+
import { a as getInstallCommand, c as defaultPackageManager, d as runtimes, f as templates, i as getRuntime, l as lockfileNames, n as copyTemplate, o as getPackageManager, p as getAppName, r as getTemplate, s as defaultJavaScriptRuntime, t as handler, u as packageManagers } from "./handler-DCzxj3hC.js";
|
|
2
2
|
export { copyTemplate, defaultJavaScriptRuntime, defaultPackageManager, getAppName, getInstallCommand, getPackageManager, getRuntime, getTemplate, handler, lockfileNames, packageManagers, runtimes, templates };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-baeta",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.16",
|
|
4
4
|
"description": "Scaffold new Baeta projects.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"baeta",
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@docusaurus/logger": "^3.10.1",
|
|
63
|
-
"@inquirer/input": "^5.1.
|
|
64
|
-
"@inquirer/select": "^5.2.
|
|
63
|
+
"@inquirer/input": "^5.1.2",
|
|
64
|
+
"@inquirer/select": "^5.2.1",
|
|
65
65
|
"fs-extra": "^11.3.5",
|
|
66
|
-
"semver": "^7.8.
|
|
66
|
+
"semver": "^7.8.2",
|
|
67
67
|
"shelljs": "^0.10.0",
|
|
68
68
|
"supports-color": "^10.2.2",
|
|
69
69
|
"yargs": "^18.0.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handler-BVAo8CHH.js","names":["tsconfig","tsconfig.compilerOptions","apolloPackageJson","versions","yogaPackageJson","versions"],"sources":["../lib/app-name.ts","../lib/constants.ts","../lib/package-manager.ts","../lib/runtime.ts","../meta/apollo/package.json","../versions.apollo.json","../../../tools/tsconfig/tsconfig.json","../templates/shared.ts","../templates/apollo.ts","../meta/yoga/package.json","../versions.yoga.json","../templates/yoga.ts","../lib/templates.ts","../lib/handler.ts"],"sourcesContent":["import path from 'node:path';\nimport { logger } from '@docusaurus/logger';\nimport input from '@inquirer/input';\nimport fs from 'fs-extra';\n\nconst APP_NAME_RE = /^(?:@[a-z0-9][a-z0-9._-]*\\/)?[a-z0-9][a-z0-9._-]*$/;\n\nexport async function getAppName(reqName: string | undefined, rootDir: string): Promise<string> {\n\tconst resolvedRoot = path.resolve(rootDir);\n\n\tasync function validateAppName(appName: string) {\n\t\tif (!appName) {\n\t\t\treturn 'An app name is required.';\n\t\t}\n\t\tif (!APP_NAME_RE.test(appName)) {\n\t\t\treturn 'App name must contain only lowercase letters, digits, dashes, underscores, or dots, and may optionally include an npm scope.';\n\t\t}\n\t\tconst dest = path.resolve(resolvedRoot, 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 TypeError(res);\n\t\t}\n\t\treturn reqName;\n\t}\n\n\ttry {\n\t\treturn await input({\n\t\t\tmessage: 'What should we name this app?',\n\t\t\tdefault: 'baeta-app',\n\t\t\tvalidate: validateAppName,\n\t\t});\n\t} catch (error) {\n\t\tif (error instanceof Error && error.name === 'ExitPromptError') {\n\t\t\tlogger.error('An app name is required.');\n\t\t\tprocess.exit(1);\n\t\t}\n\t\tthrow error;\n\t}\n}\n","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.lock', 'bun.lockb'],\n} as const;\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 select from '@inquirer/select';\nimport fs from 'fs-extra';\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\tfor (const lockFileName of lockfileNames[packageManager]) {\n\t\t\tconst lockFilePath = path.join(rootDir, lockFileName);\n\t\t\tif (await fs.pathExists(lockFilePath)) {\n\t\t\t\treturn packageManager;\n\t\t\t}\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 = [\n\t\t'npm' as const,\n\t\thasYarn && ('yarn' as const),\n\t\thasPnpm && ('pnpm' as const),\n\t\thasBun && ('bun' as const),\n\t]\n\t\t.filter((p) => p !== false)\n\t\t.map((p) => ({ value: p }));\n\n\ttry {\n\t\treturn await select<PackageManager>({\n\t\t\tmessage: 'Select a package manager...',\n\t\t\tchoices,\n\t\t\tdefault: defaultPackageManager,\n\t\t});\n\t} catch (error) {\n\t\tif (error instanceof Error && error.name === 'ExitPromptError') {\n\t\t\tlogger.info`Falling back to name=${defaultPackageManager}`;\n\t\t\treturn defaultPackageManager;\n\t\t}\n\t\tthrow error;\n\t}\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 await 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 select from '@inquirer/select';\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' as const, hasBun && ('bun' as const), hasDeno && ('deno' as const)]\n\t\t.filter((p) => p !== false)\n\t\t.map((p) => ({ value: p }));\n\n\ttry {\n\t\treturn await select<JavaScriptRuntime>({\n\t\t\tmessage: 'Select a runtime...',\n\t\t\tchoices,\n\t\t});\n\t} catch (error) {\n\t\tif (error instanceof Error && error.name === 'ExitPromptError') {\n\t\t\tlogger.info`Falling back to name=${defaultJavaScriptRuntime}`;\n\t\t\treturn defaultJavaScriptRuntime;\n\t\t}\n\t\tthrow error;\n\t}\n}\n","","","","import tsconfig from '../../../tools/tsconfig/tsconfig.json';\nimport type { JavaScriptRuntime } from '../lib/constants.ts';\nimport type { TemplateFile } from '../lib/template-file.ts';\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 type ResolvedPackageVersions = {\n\tdependencies: Record<string, string | undefined>;\n\tdevDependencies: Record<string, string | undefined>;\n\tpeerDependencies: Record<string, string | undefined>;\n};\n\nexport function makeSharedTemplate(\n\tappName: string,\n\truntime: JavaScriptRuntime,\n\tpackageJson: PackageJson,\n\tversions: ResolvedPackageVersions,\n): TemplateFile[] {\n\treturn [\n\t\tmakePackageJson(appName, runtime, packageJson, versions),\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/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\tversions: ResolvedPackageVersions,\n) {\n\tconst meta = structuredClone(packageJson);\n\tconst fields = ['dependencies', 'devDependencies'] as const;\n\tfor (const field of fields) {\n\t\tfor (const [dep, version] of Object.entries(versions[field] ?? {})) {\n\t\t\tmeta[field][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 versions from '../versions.apollo.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, versions),\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","","","import type { JavaScriptRuntime } from '../lib/constants.ts';\nimport type { TemplateFile } from '../lib/template-file.ts';\nimport yogaPackageJson from '../meta/yoga/package.json';\nimport versions from '../versions.yoga.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, versions),\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\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 select from '@inquirer/select';\nimport fs from 'fs-extra';\nimport { makeApolloTemplate } from '../templates/apollo.ts';\nimport { makeYogaTemplate } from '../templates/yoga.ts';\nimport { type JavaScriptRuntime, type Template, templates } from './constants.ts';\n\nfunction createTemplateChoices() {\n\treturn templates.map((template) => ({ name: template, value: template }));\n}\n\nasync function askTemplateChoice() {\n\ttry {\n\t\treturn await select<Template>({\n\t\t\tmessage: 'Select a template below...',\n\t\t\tchoices: createTemplateChoices(),\n\t\t});\n\t} catch (error) {\n\t\tif (error instanceof Error && error.name === 'ExitPromptError') {\n\t\t\tlogger.error('A choice is required.');\n\t\t\tprocess.exit(1);\n\t\t}\n\t\tthrow error;\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\tconst promises = files.map(async (file) => {\n\t\tconst filePath = path.join(dest, file.relativePath);\n\t\tawait fs.ensureDir(path.dirname(filePath));\n\t\tawait fs.writeFile(filePath, file.content);\n\t});\n\tawait Promise.all(promises);\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\tconst useNpm = pkgManager === 'npm';\n\tconst useBun = pkgManager === 'bun';\n\tconst useRunCommand = useNpm || useBun;\n\tconst runCommand = useRunCommand ? 'run ' : '';\n\n\tconst start = `${pkgManager} start`;\n\tconst build = `${pkgManager} ${runCommand}build`;\n\tconst cd = `cd ${dest}`;\n\tconst install = `${pkgManager} install`;\n\n\tif (!args.skipInstall) {\n\t\tlogger.info`Installing dependencies with name=${pkgManager}...`;\n\t\tconst result = shell.exec(getInstallCommand(pkgManager), {\n\t\t\tcwd: dest,\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}\ncode=${install}`;\n\n\t\t\tprocess.exit(1);\n\t\t}\n\t}\n\n\tlogger.success`Created name=${dest}.`;\n\n\tlogger.info`Inside that directory, you can run several commands:\n\n code=${start}\n Starts the development server.\n\n code=${build}\n Generates the Baeta application.\n\nWe recommend that you begin by typing:\n\n code=${cd}\n code=${start}\n`;\n}\n"],"mappings":";;;;;;;;AAKA,MAAM,cAAc;AAEpB,eAAsB,WAAW,SAA6B,SAAkC;CAC/F,MAAM,eAAe,KAAK,QAAQ,OAAO;CAEzC,eAAe,gBAAgB,SAAiB;EAC/C,IAAI,CAAC,SACJ,OAAO;EAER,IAAI,CAAC,YAAY,KAAK,OAAO,GAC5B,OAAO;EAER,MAAM,OAAO,KAAK,QAAQ,cAAc,OAAO;EAC/C,IAAI,MAAM,GAAG,WAAW,IAAI,GAC3B,OAAO,OAAO,WAAW,oCAAoC,KAAK;EAEnE,OAAO;CACR;CAEA,IAAI,SAAS;EACZ,MAAM,MAAM,MAAM,gBAAgB,OAAO;EACzC,IAAI,OAAO,QAAQ,UAClB,MAAM,IAAI,UAAU,GAAG;EAExB,OAAO;CACR;CAEA,IAAI;EACH,OAAO,MAAM,MAAM;GAClB,SAAS;GACT,SAAS;GACT,UAAU;EACX,CAAC;CACF,SAAS,OAAO;EACf,IAAI,iBAAiB,SAAS,MAAM,SAAS,mBAAmB;GAC/D,OAAO,MAAM,0BAA0B;GACvC,QAAQ,KAAK,CAAC;EACf;EACA,MAAM;CACP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