First Commit
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { Command } from "commander";
|
||||
import grabConfig from "../../functions/grab-config";
|
||||
|
||||
export default function () {
|
||||
return new Command("build")
|
||||
.description("Build project")
|
||||
.action(async () => {
|
||||
console.log(`Building project ...`);
|
||||
|
||||
const config = await grabConfig();
|
||||
global.CONFIG = config;
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import { Command } from "commander";
|
||||
import grabConfig from "../../functions/grab-config";
|
||||
import grabDirNames from "../../utils/grab-dir-names";
|
||||
import AppNames from "../../utils/grab-app-names";
|
||||
|
||||
export default function () {
|
||||
return new Command("dev")
|
||||
.description("Run development server")
|
||||
.action(async () => {
|
||||
console.log(`Running development server ...`);
|
||||
|
||||
const config = await grabConfig();
|
||||
global.CONFIG = config;
|
||||
|
||||
const { entrypoint } = grabDirNames();
|
||||
const { defaultDistDir } = AppNames;
|
||||
|
||||
let buildCmd = ["bun"];
|
||||
|
||||
buildCmd.push(
|
||||
"build",
|
||||
entrypoint,
|
||||
"--outdir",
|
||||
config.distDir || defaultDistDir,
|
||||
"--watch"
|
||||
);
|
||||
|
||||
const spawnedProcess = Bun.spawn({
|
||||
cmd: buildCmd,
|
||||
});
|
||||
|
||||
const exitCode = await spawnedProcess.exited;
|
||||
|
||||
// Bun.build({
|
||||
// entrypoints: [entrypoint],
|
||||
// outdir: config.distDir || defaultDistDir,
|
||||
// minify: true,
|
||||
// });
|
||||
|
||||
// await startServer();
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { Command } from "commander";
|
||||
import AppNames from "../../utils/grab-app-names";
|
||||
|
||||
export default function () {
|
||||
return new Command("init")
|
||||
.description("Initialize project")
|
||||
.action(async () => {
|
||||
console.log(`Initializing ${AppNames.name} ...`);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Command } from "commander";
|
||||
import grabConfig from "../../functions/grab-config";
|
||||
|
||||
export default function () {
|
||||
return new Command("start")
|
||||
.description("Start production server")
|
||||
.action(async () => {
|
||||
console.log(`Starting production server ...`);
|
||||
|
||||
const config = await grabConfig();
|
||||
global.CONFIG = config;
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user