MCPcopy Index your code
hub / github.com/CopilotKit/CopilotKit / runGenerator

Function runGenerator

showcase/scripts/__tests__/create-integration.test.ts:176–191  ·  view source on GitHub ↗

Invoke `npx tsx create-integration/index.ts` with argv-style args so none * of the slug / feature strings ever hit a shell parser. Previous revisions * used `execSync(string)` with interpolated slugs — safe today because the * slugs are constants, but a poor hygiene pattern worth stamping out.

(args: readonly string[])

Source from the content-addressed store, hash-verified

174 * Sets `CREATE_INTEGRATION_{PACKAGES,WORKFLOWS}_DIR` so the generator
175 * writes entirely inside our per-suite tmpdir. */
176function runGenerator(args: readonly string[]): { stdout: string } {
177 const baseOpts = execOptsFor(SCRIPTS_DIR);
178 const stdout = execFileSync(
179 "npx",
180 ["tsx", "create-integration/index.ts", ...args],
181 {
182 ...baseOpts,
183 env: {
184 ...process.env,
185 CREATE_INTEGRATION_PACKAGES_DIR: TMP_PACKAGES_DIR,
186 CREATE_INTEGRATION_WORKFLOWS_DIR: TMP_WORKFLOWS_DIR,
187 },
188 },
189 );
190 return { stdout: stdout.toString() };
191}
192
193describe("Template Generator", () => {
194 it("generates a valid package structure", () => {

Callers 1

Calls 1

execOptsForFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…