Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 65f2efd879 | |||
| 041d5a4934 | |||
| 12721f0984 |
Vendored
+6
-1
@@ -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
@@ -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
@@ -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"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user