@react-gnome/core
Version:
## Getting Started
68 lines (66 loc) • 2.66 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/cli.ts
var cli_exports = {};
__export(cli_exports, {
BuildProgram: () => import_build_program.BuildProgram,
BundleProgram: () => import_bundle_program.BundleProgram,
InitProgram: () => import_init_program.InitProgram,
StartProgram: () => import_start_program.StartProgram,
start: () => start
});
module.exports = __toCommonJS(cli_exports);
var import_clify = require("clify.js");
var import_build_program = require("./programs/build-program.cjs");
var import_bundle_program = require("./programs/bundle-program.cjs");
var import_init_program = require("./programs/init-program.cjs");
var import_start_program = require("./programs/start-program.cjs");
var program = (0, import_clify.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 import_bundle_program.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 import_build_program.BuildProgram(cmd);
return () => build.run();
});
main.command("start", (cmd) => {
cmd.setDescription("Build and run the app immediately.");
const start2 = new import_start_program.StartProgram(cmd);
return () => start2.run();
});
main.command("init", (cmd) => {
cmd.setDescription(
"Initialize a new project with the necessary files and scripts."
);
const init = new import_init_program.InitProgram(cmd);
return () => init.run();
});
});
async function start(command, args) {
program.run(command, args);
}