create-baeta 2.0.0-next.13 → 2.0.0-next.14

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 CHANGED
@@ -1,5 +1,7 @@
1
1
  # create-baeta
2
2
 
3
+ ## 2.0.0-next.14
4
+
3
5
  ## 2.0.0-next.13
4
6
 
5
7
  ## 2.0.0-next.12
package/dist/cli.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import { d as packageManagers, t as handler } from "./handler-C1DW6nsL.js";
2
+ import { d as packageManagers, t as handler } from "./handler-C71cBXgA.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.13";
8
+ var version = "2.0.0-next.14";
9
9
  //#endregion
10
10
  //#region cli.ts
11
11
  const requiredVersion = { "node": ">=22.20.0" }.node;
@@ -18,7 +18,7 @@ process.on("unhandledRejection", (err) => {
18
18
  logger.error(err);
19
19
  process.exit(1);
20
20
  });
21
- yargs(hideBin(process.argv)).version(version).command({
21
+ await yargs(hideBin(process.argv)).version(version).command({
22
22
  command: "* [appName] [template] [rootDir]",
23
23
  describe: "Initialize Baeta application",
24
24
  builder: (yargs) => {
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\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"],"mappings":";;;;;;;;;;ACUA,MAAM,kBAAkB,uBAAA,CAAQ;AAEhC,IAAI,CAAC,OAAO,UAAU,QAAQ,SAAS,gBAAgB,EAAE;AACxD,QAAO,MAAM,qCAAqC;AAClD,QAAO,IAAI,gCAAgC,QAAQ,QAAQ,gCAAgC,gBAAgB;AAC3G,SAAQ,KAAK,EAAE;;AAGhB,QAAQ,GAAG,uBAAuB,QAAQ;AACzC,QAAO,MAAM,IAAI;AACjB,SAAQ,KAAK,EAAE;EACd;AAEF,MAAM,QAAQ,QAAQ,KAAK,CAAC,CAC1B,QAAQ,QAAQ,CAChB,QAAQ;CACR,SAAS;CACT,UAAU;CACV,UAAU,UAAU;AACnB,SAAO,MACL,OAAO,mBAAmB;GAC1B,OAAO;GACP,UAAU;GACV,MAAM;GACN,SAAS;GACT,CAAC,CACD,OAAO,gBAAgB;GACvB,OAAO;GACP,UAAU;GACV,MAAM;GACN,CAAC,CACD,WAAW,WAAW;GACtB,MAAM;GACN,UAAU;GACV,CAAC,CACD,WAAW,YAAY;GACvB,MAAM;GACN,UAAU;GACV,SAAS,CAAC,QAAQ,SAAS;GAC3B,CAAC,CACD,WAAW,WAAW;GACtB,MAAM;GACN,UAAU;GACV,SAAS;GACT,CAAC;;CAEJ,UAAU,SAAS,QAAQ,KAAK;CAChC,CAAC,CACD,eAAe,KAAK,CACpB,QAAQ,CACR,MAAM,CACN,OAAO"}
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,uBAAA,CAAQ;AAEhC,IAAI,CAAC,OAAO,UAAU,QAAQ,SAAS,gBAAgB,EAAE;AACxD,QAAO,MAAM,qCAAqC;AAClD,QAAO,IAAI,gCAAgC,QAAQ,QAAQ,gCAAgC,gBAAgB;AAC3G,SAAQ,KAAK,EAAE;;AAGhB,QAAQ,GAAG,uBAAuB,QAAQ;AACzC,QAAO,MAAM,IAAI;AACjB,SAAQ,KAAK,EAAE;EACd;AAEF,MAAM,MAAM,QAAQ,QAAQ,KAAK,CAAC,CAChC,QAAQ,QAAQ,CAChB,QAAQ;CACR,SAAS;CACT,UAAU;CACV,UAAU,UAAU;AACnB,SAAO,MACL,OAAO,mBAAmB;GAC1B,OAAO;GACP,UAAU;GACV,MAAM;GACN,SAAS;GACT,CAAC,CACD,OAAO,gBAAgB;GACvB,OAAO;GACP,UAAU;GACV,MAAM;GACN,CAAC,CACD,WAAW,WAAW;GACtB,MAAM;GACN,UAAU;GACV,CAAC,CACD,WAAW,YAAY;GACvB,MAAM;GACN,UAAU;GACV,SAAS,CAAC,QAAQ,SAAS;GAC3B,CAAC,CACD,WAAW,WAAW;GACtB,MAAM;GACN,UAAU;GACV,SAAS;GACT,CAAC;;CAEJ,UAAU,SAAS,QAAQ,KAAK;CAChC,CAAC,CACD,eAAe,KAAK,CACpB,QAAQ,CACR,MAAM,CACN,OAAO"}
@@ -34,7 +34,7 @@ async function getAppName(reqName, rootDir) {
34
34
  if (typeof res === "string") throw new TypeError(res);
35
35
  return reqName;
36
36
  }
37
- return prompts({
37
+ return await prompts({
38
38
  type: "text",
39
39
  name: "appName",
40
40
  message: "What should we name this app?",
@@ -88,7 +88,7 @@ async function getPackageManager(dest, { packageManager, skipInstall }) {
88
88
  const fromUserAgent = findPackageManagerFromUserAgent();
89
89
  if (fromUserAgent) return fromUserAgent;
90
90
  if (skipInstall) return "npm";
91
- return askForPackageManagerChoice();
91
+ return await askForPackageManagerChoice();
92
92
  }
93
93
  function getInstallCommand(pkgManager) {
94
94
  if (pkgManager === "yarn") return "yarn";
@@ -147,13 +147,13 @@ var package_default$1 = {
147
147
  //#region versions.apollo.json
148
148
  var versions_apollo_default = {
149
149
  dependencies: {
150
- "@baeta/core": "^2.0.0-next.13",
151
- "@baeta/errors": "^2.0.0-next.13",
152
- "@baeta/extension-complexity": "^2.0.0-next.13",
150
+ "@baeta/core": "^2.0.0-next.14",
151
+ "@baeta/errors": "^2.0.0-next.14",
152
+ "@baeta/extension-complexity": "^2.0.0-next.14",
153
153
  "graphql": "^16.6.0"
154
154
  },
155
155
  devDependencies: {
156
- "@baeta/cli": "^2.0.0-next.13",
156
+ "@baeta/cli": "^2.0.0-next.14",
157
157
  "@types/node": "^22.19.17",
158
158
  "typescript": "^6.0.0"
159
159
  },
@@ -594,14 +594,14 @@ var package_default = {
594
594
  //#region versions.yoga.json
595
595
  var versions_yoga_default = {
596
596
  dependencies: {
597
- "@baeta/core": "^2.0.0-next.13",
598
- "@baeta/errors": "^2.0.0-next.13",
599
- "@baeta/extension-complexity": "^2.0.0-next.13",
597
+ "@baeta/core": "^2.0.0-next.14",
598
+ "@baeta/errors": "^2.0.0-next.14",
599
+ "@baeta/extension-complexity": "^2.0.0-next.14",
600
600
  "graphql": "^16.6.0",
601
601
  "graphql-yoga": "^5.21.0"
602
602
  },
603
603
  devDependencies: {
604
- "@baeta/cli": "^2.0.0-next.13",
604
+ "@baeta/cli": "^2.0.0-next.14",
605
605
  "@types/node": "^22.19.17",
606
606
  "typescript": "^6.0.0"
607
607
  },
@@ -728,7 +728,7 @@ function createTemplateChoices() {
728
728
  }));
729
729
  }
730
730
  async function askTemplateChoice() {
731
- return prompts({
731
+ return await prompts({
732
732
  type: "select",
733
733
  name: "template",
734
734
  message: "Select a template below...",
@@ -813,4 +813,4 @@ We recommend that you begin by typing:
813
813
  //#endregion
814
814
  export { getInstallCommand as a, defaultJavaScriptRuntime as c, packageManagers as d, runtimes as f, getRuntime as i, defaultPackageManager as l, copyTemplate as n, getPackageManager as o, templates as p, getTemplate as r, getAppName as s, handler as t, lockfileNames as u };
815
815
 
816
- //# sourceMappingURL=handler-C1DW6nsL.js.map
816
+ //# sourceMappingURL=handler-C71cBXgA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler-C71cBXgA.js","names":["tsconfig","tsconfig.compilerOptions","apolloPackageJson","versions","yogaPackageJson","versions"],"sources":["../lib/constants.ts","../lib/app-name.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":["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 TypeError(res);\n\t\t}\n\t\treturn reqName;\n\t}\n\n\treturn await 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 !== false)\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 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 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 !== false)\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 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/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\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 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 await 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","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\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}\ncode=${install}`;\n\n\t\t\tprocess.exit(0);\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":";;;;;;;AAAA,MAAa,wBAAwB;AAErC,MAAa,gBAAgB;CAC5B,KAAK;CACL,MAAM;CACN,MAAM;CACN,KAAK;CACL;AAED,MAAa,kBAAkB,OAAO,KAAK,cAAc;AAIzD,MAAa,WAAW;CAAC;CAAQ;CAAQ;CAAM;AAI/C,MAAa,2BAA2B;AAExC,MAAa,YAAY,CAAC,QAAQ,SAAS;;;ACd3C,eAAsB,WAAW,SAA6B,SAAkC;CAC/F,eAAe,gBAAgB,SAAiB;AAC/C,MAAI,CAAC,QACJ,QAAO;EAER,MAAM,OAAO,KAAK,QAAQ,SAAS,QAAQ;AAC3C,MAAI,MAAM,GA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,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;AAE9B,KAAI,CAAC,KAAK,aAAa;AACtB,QAAM,GAAG,KAAK;AACd,SAAO,IAAI,qCAAqC,WAAW;AAQ3D,MAPe,MAAM,KAAK,kBAAkB,WAAW,EAAE,EACxD,KAAK;GACJ,GAAG,QAAQ;GACX,GAAI,cAAc,SAAS,EAAE,aAAa,KAAK,GAAG,EAAE;GACpD,EACD,CAES,CAAC,SAAS,GAAG;AACtB,WAAQ,MAAM,kCAAkC;AAChD,UAAO,MAAM,kCAAkC;AAC/C,UAAO,IAAI;;OAEP,GAAG;OACH;AAEJ,WAAQ,KAAK,EAAE;;;AAIjB,QAAO,OAAO,gBAAgB,KAAK;AAEnC,QAAO,IAAI;;SAEH,MAAM;;;SAGN,MAAM;;;;;SAKN,GAAG;SACH,MAAM"}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as getInstallCommand, c as defaultJavaScriptRuntime, d as packageManagers, f as runtimes, i as getRuntime, l as defaultPackageManager, n as copyTemplate, o as getPackageManager, p as templates, r as getTemplate, s as getAppName, t as handler, u as lockfileNames } from "./handler-C1DW6nsL.js";
1
+ import { a as getInstallCommand, c as defaultJavaScriptRuntime, d as packageManagers, f as runtimes, i as getRuntime, l as defaultPackageManager, n as copyTemplate, o as getPackageManager, p as templates, r as getTemplate, s as getAppName, t as handler, u as lockfileNames } from "./handler-C71cBXgA.js";
2
2
  export { copyTemplate, defaultJavaScriptRuntime, defaultPackageManager, getAppName, getInstallCommand, getPackageManager, getRuntime, getTemplate, handler, lockfileNames, packageManagers, runtimes, templates };
package/package.json CHANGED
@@ -1,58 +1,62 @@
1
1
  {
2
2
  "name": "create-baeta",
3
- "version": "2.0.0-next.13",
3
+ "version": "2.0.0-next.14",
4
4
  "keywords": [
5
5
  "baeta",
6
+ "builder",
7
+ "framework",
6
8
  "graphql",
7
9
  "schema",
8
10
  "types",
9
- "typescript",
10
- "framework",
11
- "builder"
11
+ "typescript"
12
12
  ],
13
13
  "homepage": "https://github.com/andreisergiu98/baeta#readme",
14
14
  "bugs": {
15
15
  "url": "https://github.com/andreisergiu98/baeta/issues"
16
16
  },
17
- "repository": {
18
- "type": "git",
19
- "url": "https://github.com/andreisergiu98/baeta.git",
20
- "directory": "packages/create-baeta"
21
- },
22
17
  "license": "MIT",
23
18
  "author": {
24
19
  "name": "Andrei Pampu",
25
20
  "url": "https://github.com/andreisergiu98"
26
21
  },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://github.com/andreisergiu98/baeta.git",
25
+ "directory": "packages/create-baeta"
26
+ },
27
+ "bin": "dist/cli.js",
28
+ "files": [
29
+ "dist",
30
+ "package.json"
31
+ ],
27
32
  "type": "module",
33
+ "types": "dist/index.d.ts",
28
34
  "exports": {
29
35
  ".": {
30
36
  "types": "./dist/index.d.ts",
31
37
  "default": "./dist/index.js"
32
38
  }
33
39
  },
34
- "types": "dist/index.d.ts",
35
- "bin": "dist/cli.js",
36
- "files": [
37
- "dist",
38
- "package.json"
39
- ],
40
+ "publishConfig": {
41
+ "access": "public",
42
+ "exports": {
43
+ ".": {
44
+ "types": "./dist/index.d.ts",
45
+ "default": "./dist/index.js"
46
+ }
47
+ }
48
+ },
40
49
  "scripts": {
41
- "prebuild": "yarn write:apollo:versions && yarn write:yoga:versions",
42
50
  "build": "yarn prebuild && builder build",
43
51
  "check:deps": "builder check-deps",
44
- "prepack": "builder prepare",
45
52
  "postpack": "builder prepare --restore",
53
+ "prebuild": "yarn write:apollo:versions && yarn write:yoga:versions",
54
+ "prepack": "builder prepare",
46
55
  "test": "builder test",
47
56
  "types": "yarn prebuild && tsc --noEmit",
48
57
  "write:apollo:versions": "builder print-resolved-versions ./meta/apollo/package.json -o versions.apollo.json",
49
58
  "write:yoga:versions": "builder print-resolved-versions ./meta/yoga/package.json -o versions.yoga.json"
50
59
  },
51
- "ava": {
52
- "extensions": [
53
- "ts"
54
- ]
55
- },
56
60
  "dependencies": {
57
61
  "@docusaurus/logger": "^3.10.1",
58
62
  "fs-extra": "^11.3.4",
@@ -74,18 +78,14 @@
74
78
  "@types/yargs": "^17.0.35",
75
79
  "typescript": "^6.0.0"
76
80
  },
81
+ "ava": {
82
+ "extensions": [
83
+ "ts"
84
+ ]
85
+ },
77
86
  "engines": {
78
87
  "node": ">=22.20.0"
79
88
  },
80
- "publishConfig": {
81
- "access": "public",
82
- "exports": {
83
- ".": {
84
- "types": "./dist/index.d.ts",
85
- "default": "./dist/index.js"
86
- }
87
- }
88
- },
89
89
  "typedocOptions": {
90
90
  "entryPoints": [
91
91
  "./index.ts"
@@ -1 +0,0 @@
1
- {"version":3,"file":"handler-C1DW6nsL.js","names":["tsconfig","tsconfig.compilerOptions","apolloPackageJson","versions","yogaPackageJson","versions"],"sources":["../lib/constants.ts","../lib/app-name.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":["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 TypeError(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 !== false)\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 !== false)\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 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/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\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 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","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\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}\ncode=${install}`;\n\n\t\t\tprocess.exit(0);\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":";;;;;;;AAAA,MAAa,wBAAwB;AAErC,MAAa,gBAAgB;CAC5B,KAAK;CACL,MAAM;CACN,MAAM;CACN,KAAK;CACL;AAED,MAAa,kBAAkB,OAAO,KAAK,cAAc;AAIzD,MAAa,WAAW;CAAC;CAAQ;CAAQ;CAAM;AAI/C,MAAa,2BAA2B;AAExC,MAAa,YAAY,CAAC,QAAQ,SAAS;;;ACd3C,eAAsB,WAAW,SAA6B,SAAkC;CAC/F,eAAe,gBAAgB,SAAiB;AAC/C,MAAI,CAAC,QACJ,QAAO;EAER,MAAM,OAAO,KAAK,QAAQ,SAAS,QAAQ;AAC3C,MAAI,MAAM,GAAG,WAAW,KAAK,CAC5B,QAAO,OAAO,WAAW,oCAAoC,KAAK;AAEnE,SAAO;;AAGR,KAAI,SAAS;EACZ,MAAM,MAAM,MAAM,gBAAgB,QAAQ;AAC1C,MAAI,OAAO,QAAQ,SAClB,OAAM,IAAI,UAAU,IAAI;AAEzB,SAAO;;AAGR,QAAO,QACN;EACC,MAAM;EACN,MAAM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