@wix/cli
Version:
CLI tool for building Wix sites and applications
144 lines (134 loc) • 5.27 kB
JavaScript
import { createRequire as _createRequire } from 'node:module';
const require = _createRequire(import.meta.url);
import {
messages_default
} from "./chunk-GL7CIIX2.js";
import {
Option,
createCommand
} from "./chunk-4CMTZJ25.js";
import {
createI18n
} from "./chunk-TIVTYCB2.js";
import "./chunk-RPTAJN5Y.js";
import "./chunk-UC5LTXTA.js";
import "./chunk-5VIJC5EU.js";
import "./chunk-MZDJNQLB.js";
import {
require_react
} from "./chunk-QNHANFRW.js";
import "./chunk-AFPDHQYI.js";
import "./chunk-XZUGLEBK.js";
import "./chunk-SDLCFZRL.js";
import "./chunk-CO5A7CZG.js";
import {
__toESM,
init_esm_shims
} from "./chunk-EXLZF52D.js";
// ../cli-site/src/index.ts
init_esm_shims();
// ../cli-site/src/commands/root-command.ts
init_esm_shims();
// ../cli-site/src/commands/dev.tsx
init_esm_shims();
var import_react = __toESM(require_react(), 1);
// ../cli-site/src/i18n.ts
init_esm_shims();
function createI18nT() {
const i18n = createI18n(messages_default);
return i18n.t.bind(i18n);
}
// ../cli-site/src/commands/dev.tsx
var devCommand = (services, cliVersion) => {
const t = createI18nT();
return createCommand("dev").description(t("site_dev_command_def.description")).option("--tunnel", t("site_dev_command_def.option.tunnel")).action(async (options, command) => {
const { tunnel = false } = options;
const { renderCommand } = await import("./render-command-MWPGW5QH.js");
const { DevCommand } = await import("./DevCommand-B4X36FQP.js");
await renderCommand(
command,
services,
cliVersion,
/* @__PURE__ */ import_react.default.createElement(DevCommand, { useTunnel: tunnel })
);
});
};
// ../cli-site/src/commands/preview.tsx
init_esm_shims();
var import_react2 = __toESM(require_react(), 1);
var previewCommand = (services, cliVersion) => {
const t = createI18nT();
return createCommand("preview").description(t("site_preview_command_def.description")).option("-f, --force", t("site_preview_command_def.option.force")).action(async (options, command) => {
const { force = false } = options;
const { renderCommand } = await import("./render-command-MWPGW5QH.js");
const { PreviewCommand } = await import("./PreviewCommand-PTNCCYOJ.js");
await renderCommand(
command,
services,
cliVersion,
/* @__PURE__ */ import_react2.default.createElement(PreviewCommand, { force })
);
});
};
// ../cli-site/src/commands/publish.tsx
init_esm_shims();
var import_react3 = __toESM(require_react(), 1);
var publishCommand = (services, cliVersion) => {
const t = createI18nT();
return createCommand("publish").description(t("site_publish_command_def.description")).addOption(
new Option(
"-y, --approve-preview",
t("site_publish_command_def.option.approve_preview")
).conflicts("force")
).option("-f, --force", t("site_publish_command_def.option.force")).action(async (options, command) => {
const { approvePreview = false, force = false } = options;
const { renderCommand } = await import("./render-command-MWPGW5QH.js");
const { PublishCommand } = await import("./PublishCommand-QEDIYJDF.js");
await renderCommand(
command,
services,
cliVersion,
/* @__PURE__ */ import_react3.default.createElement(PublishCommand, { approvePreview, force })
);
});
};
// ../cli-site/src/commands/install.tsx
init_esm_shims();
var import_react4 = __toESM(require_react(), 1);
var installCommand = (services, cliVersion) => {
const t = createI18nT();
return createCommand("install").description(t("site_install_command_def.description")).argument("[package]", t("site_install_command_def.argument.package")).action(async (packageName, _opts, command) => {
const { renderCommand } = await import("./render-command-MWPGW5QH.js");
const { InstallCommand } = await import("./InstallCommand-JGJFXTO7.js");
await renderCommand(
command,
services,
cliVersion,
/* @__PURE__ */ import_react4.default.createElement(InstallCommand, { packageName })
);
});
};
// ../cli-site/src/commands/uninstall.tsx
init_esm_shims();
var import_react5 = __toESM(require_react(), 1);
var uninstallCommand = (services, cliVersion) => {
const t = createI18nT();
return createCommand("uninstall").description(t("site_uninstall_command_def.description")).argument("<package>", t("site_uninstall_command_def.argument.package")).action(async (packageName, _opts, command) => {
const { renderCommand } = await import("./render-command-MWPGW5QH.js");
const { UninstallCommand } = await import("./UninstallCommand-TCGJKWVQ.js");
await renderCommand(
command,
services,
cliVersion,
/* @__PURE__ */ import_react5.default.createElement(UninstallCommand, { packageName })
);
});
};
// ../cli-site/src/commands/root-command.ts
var getRootCommand = async function getRootCommand2(services, cliVersion) {
return createCommand("site").addCommand(devCommand(services, cliVersion)).addCommand(previewCommand(services, cliVersion)).addCommand(publishCommand(services, cliVersion)).addCommand(installCommand(services, cliVersion)).addCommand(uninstallCommand(services, cliVersion));
};
export {
getRootCommand
};
//# sourceMappingURL=src-ZB2WHYLP.js.map