MCPcopy Index your code
hub / github.com/upstash/jstack / main

Function main

cli/src/index.ts:12–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10import { installDependencies } from "./helpers/install-deps.js"
11
12const main = async () => {
13 const results = await runCli()
14
15 if (!results) {
16 return
17 }
18
19 const { projectName, orm, dialect, provider } = results
20
21 const installers = buildInstallerMap(orm, provider)
22
23 const projectDir = await scaffoldProject({
24 orm,
25 dialect,
26 databaseProvider: provider ?? "neon",
27 installers,
28 projectName,
29 })
30
31 const pkgJson = fs.readJSONSync(path.join(projectDir, "package.json"))
32 pkgJson.name = projectName
33
34 fs.writeJSONSync(path.join(projectDir, "package.json"), pkgJson, {
35 spaces: 2,
36 })
37
38 if (!results.noInstall) {
39 await installDependencies({ projectDir })
40 }
41
42 process.exit(0)
43}
44
45main().catch((err) => {
46 logger.error("Aborting installation...")

Callers 1

index.tsFile · 0.70

Calls 5

runCliFunction · 0.85
buildInstallerMapFunction · 0.85
scaffoldProjectFunction · 0.85
installDependenciesFunction · 0.85
joinMethod · 0.80

Tested by

no test coverage detected