UNPKG

@react-gnome/core

Version:

## Getting Started

47 lines (46 loc) 1.47 kB
// src/cli.ts import { configure } from "clify.js"; import { BuildProgram } from "./programs/build-program.mjs"; import { BundleProgram } from "./programs/bundle-program.mjs"; import { InitProgram } from "./programs/init-program.mjs"; import { StartProgram } from "./programs/start-program.mjs"; var program = configure((main) => { main.setName("react-gtk"); main.setDescription("Build GTK apps with React."); main.command("bundle", (cmd) => { cmd.setDescription( "Create a bundled js file, without the tarball or meson configuration. This is useful if you want to manage the build process yourself." ); const bundle = new BundleProgram(cmd); return () => bundle.run(); }); main.command("build", (cmd) => { cmd.setDescription( "Create a tarball and meson configuration that's ready to be installed." ); const build = new BuildProgram(cmd); return () => build.run(); }); main.command("start", (cmd) => { cmd.setDescription("Build and run the app immediately."); const start2 = new StartProgram(cmd); return () => start2.run(); }); main.command("init", (cmd) => { cmd.setDescription( "Initialize a new project with the necessary files and scripts." ); const init = new InitProgram(cmd); return () => init.run(); }); }); async function start(command, args) { program.run(command, args); } export { BuildProgram, BundleProgram, InitProgram, StartProgram, start };