const path = require("path");
const cliPkg = require("../package.json");
const pkgPath = path.join(process.cwd(), "package.json");
// the project's package.json content
const pkg = require(pkgPath);

module.exports = {
  npmScope: (pkg.config && pkg.config.npmScope) || "@acanto",
  coreLibrary: (pkg.config && pkg.config.coreLibrary) || "@acanto/core",
  isProduction: process.env.NODE_ENV === "production",
  isHttps: /^https:\/\//.test(process.env.APP_URL),
  isTurbo: true,
  cliPkg,
  pkg,
  filenames: {
    assetsHeadPartial: "assets-head.blade.php",
    assetsBodyPartial: "assets-body.blade.php",
    faviconsPartial: "favicons.blade.php",
    svgIconsPartial: "svgicons.blade.php",
    routesBarba: "routesBarba.js",
  },
  // https://browserl.ist/
  browserslist: ["last 2 versions", "> 1%"],
  husky: {
    hooks: {
      "pre-commit": "lint-staged",
    },
  },
  overrides: require("../scripts/prettier").PRETTIER_OVERRIDES,
  lintStaged: {
    [require("../scripts/prettier").PRETTIER_PATH]: "prettier --write",
  },
};
