Skip to content

Function: prepareAndRunProjen()

prepareAndRunProjen(projenArgs, startDir?): Promise<void>

Prepare the workspace at root, then run projen (via bun) with projenArgs.

Three cases, in order:

  • no .projenrc.ts at all -> full bootstrap (scaffold + install + synth), which already runs the initial synth; nothing more to forward.
  • a .projenrc.ts but the engine/toolchain isn’t installed (e.g. a freshly copied project whose generated files + manifests are gitignored) -> seed the toolchain, then run the INITIAL synth directly (the projen tasks the args would name, like sync, don’t exist until .projenrc.ts has run once), and install. Don’t forward projenArgs - the synth is the work.
  • otherwise (established workspace) -> ensure deps, bring the engine up to this CLI’s version, then forward to projen.

string[]

string

Promise<void>