"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateTsConfig = generateTsConfig;
const generator_1 = require("@postxl/generator");
function generateTsConfig({ frontend: { tsConfigReferences } }) {
    const paths = [
        '"@assets/*": ["assets/*"]',
        '"@components/*": ["components/*"]',
        '"@context-providers/*": ["context-providers/*"]',
        '"@hooks/*": ["hooks/*"]',
        '"@i18n/*": ["i18n/*"]',
        '"@lib/*": ["lib/*"]',
        '"@pages/*": ["pages/*"]',
        '"@public/*": ["../public/*"]',
        '"@routes/*": ["routes/*"]',
        '"@styles/*": ["styles/*"]',
    ];
    for (const reference of tsConfigReferences.values()) {
        const relativePath = reference.isAbsolute
            ? reference.filePath
            : (0, generator_1.getRelativePath)({ from: './frontend/src/', to: reference.filePath });
        paths.push(`"@${reference.name}/*": ["${relativePath}/*"]`);
        if (reference.hasIndex) {
            paths.push(`"@${reference.name}": ["${relativePath}"]`);
        }
    }
    return /*json*/ `
  {
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "target": "ES2020",
    "lib": ["dom", "dom.iterable", "esnext"],
    "noEmit": true,
    "module": "esnext",
    "moduleResolution": "bundler",
    "resolveJsonModule": true,
    "jsx": "preserve",
    "jsxImportSource": "react",
    "baseUrl": "./src",

    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,

    "allowJs": true,
     
    "paths": {
      ${paths.toSorted((a, b) => a.localeCompare(b)).join(',\n')}
    }
  },

  "include": ["vite.config.ts", "**/*.ts", "**/*.tsx", ".storybook/**/*"],
  "exclude": ["node_modules", "tests"]
}`;
}
//# sourceMappingURL=tsconfig.generator.js.map