UNPKG

@featurevisor/core

Version:

Core package of Featurevisor for Node.js usage

43 lines 1.36 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.sitePlugin = void 0; const exportSite_1 = require("./exportSite"); const serveSite_1 = require("./serveSite"); exports.sitePlugin = { command: "site [subcommand]", handler: async function ({ rootDirectoryPath, projectConfig, datasource, parsed }) { const deps = { rootDirectoryPath, projectConfig, datasource, options: parsed, }; const allowedSubcommands = ["export", "serve"]; if (!allowedSubcommands.includes(parsed.subcommand)) { console.log("Please specify a subcommand: `export` or `serve`"); return; } // export if (parsed.subcommand === "export") { const hasError = await (0, exportSite_1.exportSite)(deps); if (hasError) { return false; } } // serve if (parsed.subcommand === "serve") { (0, serveSite_1.serveSite)(deps); } }, examples: [ { command: "site export", description: "generate static site with project data", }, { command: "site serve", description: "serve already exported site locally", }, ], }; //# sourceMappingURL=index.js.map