#!/usr/bin/env node
import { createRequire as createRequire_BATI_CLI } from 'module';
const require = createRequire_BATI_CLI(import.meta.url);

import {
  nxs
} from "../../../../chunk-S47BAUBM.js";
import "../../../../chunk-IAWYWZSL.js";
import "../../../../chunk-DHZ7AZKP.js";

// ../../boilerplates/pnpm/dist/files/$pnpm-workspace.yaml.js
var dependenciesApproveBuild = [
  "@biomejs/biome",
  "@sentry/cli",
  "@tailwindcss/oxide",
  "better-sqlite3",
  "esbuild",
  "sharp",
  "workerd"
];
function intersect(a, b) {
  return a.filter((x) => b.includes(x));
}
async function getPnpmWorkspace(props) {
  const deps = [
    ...Object.keys(props.packageJson.dependencies ?? {}),
    ...Object.keys(props.packageJson.devDependencies ?? {})
  ];
  const intersection = intersect(dependenciesApproveBuild, deps);
  if (intersection.length === 0) return;
  const pnpmWorkspace = await nxs(props, { fallbackEmpty: true });
  if (!pnpmWorkspace.has("onlyBuiltDependencies")) {
    pnpmWorkspace.set("onlyBuiltDependencies", []);
  }
  for (const pack of intersection) {
    pnpmWorkspace.addIn(["onlyBuiltDependencies"], pack);
  }
  return pnpmWorkspace;
}
export {
  getPnpmWorkspace as default
};
