"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateFrontendBuildSh = generateFrontendBuildSh;
function generateFrontendBuildSh({ schema: { projectType, slug } }) {
    return projectType === 'workspace' ? buildShWorkspace({ slug }) : buildShStandalone({ slug });
}
const buildShWorkspace = ({ slug }) => {
    const name = slug.replaceAll('-', '_');
    return /*sh*/ `#!/bin/bash

rm -rf out/
npm i -g turbo@^2
turbo prune @postxl/${slug} @postxl/${slug}-frontend @postxl/${slug}-api --docker

cp tsconfig.json tsconfig.base.json tsconfig.build.json ./out/full/
cp projects/${slug}/docker/frontend/entrypoint.sh ./out/full/projects/${slug}/frontend/

rm -rf ./out/full/projects/${slug}/e2e/

docker build -f projects/${slug}/docker/frontend/Dockerfile \\
  --secret id=TURBO_TOKEN,env=TURBO_TOKEN \\
  -t ${name}_frontend:latest ./out
`;
};
const buildShStandalone = ({ slug }) => {
    const name = slug.replaceAll('-', '_');
    return /*sh*/ String.raw `#!/bin/bash

rm -rf out/
npm i -g turbo@^2
turbo prune @postxl/${slug}-frontend @postxl/${slug}-api --docker

cp tsconfig.json prisma.config.ts ./out/full/
cp docker/frontend/entrypoint.sh docker/frontend/frontend.conf ./out/full/frontend/

rm -rf ./out/full/e2e/

docker build -f docker/frontend/Dockerfile \
  --secret id=TURBO_TOKEN,env=TURBO_TOKEN \
  -t ${name}_frontend:latest ./out
`;
};
//# sourceMappingURL=frontend-build-sh.generator.js.map