Skip to content
Snippets Groups Projects
Commit 5fec80ce authored by Marcus Schiesser's avatar Marcus Schiesser
Browse files

fix: use CJS for create-llama

parent 7364f71a
No related branches found
No related tags found
No related merge requests found
{
"extends": "../tsconfig.json",
"compilerOptions": {
"module": "ESNext",
"target": "ESNext",
"verbatimModuleSyntax": true
},
"include": [
"./**/*.ts"
]
}
import { ChildProcess, exec, execSync } from "child_process";
import crypto from "node:crypto";
import { mkdir } from "node:fs/promises";
import { fileURLToPath } from "node:url";
import * as path from "path";
import waitPort from "wait-port";
export type AppType = "--frontend" | "--no-frontend" | "";
......@@ -13,7 +13,7 @@ export async function runApp(
appType: AppType,
port: number,
): Promise<ChildProcess[]> {
const cps = [];
const cps: ChildProcess[] = [];
try {
switch (appType) {
......@@ -71,9 +71,7 @@ export function runCreateLlama(
templateUI: string,
appType: AppType,
) {
const createLlama = fileURLToPath(
new URL("../dist/index.js", import.meta.url),
);
const createLlama = path.join(__dirname, "..", "dist", "index.js");
const name = [
templateType,
......@@ -110,9 +108,7 @@ export function runCreateLlama(
return name;
}
export async function createTestDir() {
const cwd = fileURLToPath(
new URL(`.cache/${crypto.randomUUID()}`, import.meta.url),
);
const cwd = path.join(__dirname, ".cache", crypto.randomUUID());
await mkdir(cwd, { recursive: true });
return cwd;
}
{
"name": "create-llama",
"version": "0.0.11",
"type": "module",
"keywords": [
"rag",
"llamaindex",
......
......@@ -7,10 +7,8 @@
"esModuleInterop": true,
"skipLibCheck": false
},
"exclude": ["templates", "dist"],
"references": [
{
"path": "./e2e/tsconfig.json"
}
"exclude": [
"templates",
"dist"
]
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment