Compare commits

..

3 Commits

Author SHA1 Message Date
HorizonCode 65f2efd879 chore: compile, remove debug log 2026-06-11 16:28:54 +02:00
HorizonCode 041d5a4934 fix: rootDir 2026-06-11 16:28:25 +02:00
HorizonCode 12721f0984 fix: use original runner 2026-06-11 16:26:05 +02:00
3 changed files with 9 additions and 4 deletions
+6 -1
View File
@@ -4,6 +4,7 @@ import path from "path";
import { execSync } from "child_process"; import { execSync } from "child_process";
import { fileURLToPath } from "url"; import { fileURLToPath } from "url";
import { input, select } from "@inquirer/prompts"; import { input, select } from "@inquirer/prompts";
const runnerPath = process.argv0;
const projectTypes = [ const projectTypes = [
{ {
name: "blank", name: "blank",
@@ -52,7 +53,11 @@ async function main() {
console.error("❌ Directory already exists"); console.error("❌ Directory already exists");
process.exit(1); process.exit(1);
} }
const buildThemeScript = path.resolve(__dirname, `../scripts/build-theme.ts`);
fs.cpSync(templateDir, targetDir, { recursive: true }); fs.cpSync(templateDir, targetDir, { recursive: true });
fs.cpSync(buildThemeScript, path.join(targetDir, "build-theme.ts"), {
recursive: true,
});
const pkgPath = path.join(targetDir, "package.json"); const pkgPath = path.join(targetDir, "package.json");
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8")); const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
pkg.name = projectName; pkg.name = projectName;
@@ -62,7 +67,7 @@ async function main() {
theme.name = projectName; theme.name = projectName;
fs.writeFileSync(themePath, JSON.stringify(theme, null, 2)); fs.writeFileSync(themePath, JSON.stringify(theme, null, 2));
console.log("📦 Installing dependencies..."); console.log("📦 Installing dependencies...");
execSync("npm install", { cwd: targetDir, stdio: "inherit" }); execSync(`${runnerPath} install`, { cwd: targetDir, stdio: "inherit" });
console.log(`\n✅ Theme created!\n`); console.log(`\n✅ Theme created!\n`);
} }
main().catch((err) => { main().catch((err) => {
+1 -1
View File
@@ -5,7 +5,7 @@ import { execSync } from "child_process";
import { fileURLToPath } from "url"; import { fileURLToPath } from "url";
import { input, select } from "@inquirer/prompts"; import { input, select } from "@inquirer/prompts";
const runnerPath = process.argv[0]; const runnerPath = process.argv0;
const projectTypes = [ const projectTypes = [
{ {
+2 -2
View File
@@ -4,10 +4,10 @@
"module": "ESNext", "module": "ESNext",
"moduleResolution": "bundler", "moduleResolution": "bundler",
"outDir": "dist", "outDir": "dist",
"rootDir": ".", "rootDir": "./src",
"esModuleInterop": true, "esModuleInterop": true,
"strict": true, "strict": true,
"types": ["node"] "types": ["node"]
}, },
"include": ["src", "scripts"] "include": ["src"]
} }