"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.createWebsiteApp = createWebsiteApp;
var _enterprise = require("@webiny/pulumi-aws/enterprise");
var _plugins = require("../website/plugins");
var _ensureApiDeployed = require("../utils/ensureApiDeployed");
var _plugins2 = require("../react/plugins");
function createWebsiteApp(projectAppParams = {}) {
  const builtInPlugins = [(0, _plugins2.uploadAppToS3)({
    folder: "apps/website"
  }), _plugins.generateCommonHandlers, _plugins.lambdaEdgeWarning, (0, _plugins.renderWebsite)({
    prerender: projectAppParams.renderWebsiteAfterDeploy ?? (() => true)
  }), _plugins.telemetryNoLongerNewUser, ...(0, _ensureApiDeployed.createEnsureApiDeployedPlugins)("website")];
  const customPlugins = projectAppParams.plugins ? [...projectAppParams.plugins] : [];
  return {
    id: "website",
    name: "Website",
    description: "Your project's public website.",
    cli: {
      // Default args for the "yarn webiny watch ..." command (we don't need the deploy option while developing).
      watch: {
        // We disable local development for all AWS Lambda functions.
        // This can be changed down the line by passing another set of values
        // to the "watch" command (for example `-f ps-render-subscriber`).
        function: "none",
        // We can remove this once the new watch command is released.
        deploy: false
      }
    },
    pulumi: (0, _enterprise.createWebsitePulumiApp)(projectAppParams),
    plugins: [builtInPlugins, customPlugins]
  };
}

//# sourceMappingURL=createWebsiteApp.js.map