Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert to tsconfig's project references #18

Open
1 of 3 tasks
dudeofawesome opened this issue Apr 22, 2024 · 0 comments
Open
1 of 3 tasks

Convert to tsconfig's project references #18

dudeofawesome opened this issue Apr 22, 2024 · 0 comments
Labels
blocked This is blocked by something enhancement New feature or request

Comments

@dudeofawesome
Copy link
Owner

dudeofawesome commented Apr 22, 2024

https://www.typescriptlang.org/docs/handbook/project-references.html

This is the preferred way to having multiple tsconfig files in a project, unfortunately, some of our tooling does not support it yet.

Rough Implementation:

/tsconfig.json

// In order to update the this config, update @code-style/typescript-configs
{
  "extends": [
    "@code-style/typescript-configs/roles/node",
    "@code-style/typescript-configs/layers/esmodule"
  ],
  "include": ["./"],
  "exclude": ["dist/"],
  "references": [
    { "path": "./src/tsconfig.json" },
    { "path": "./tsconfig.test.json" }
  ]
}

/tsconfig.test.json

// In order to update the this config, update @code-style/typescript-configs
{
  "extends": [
    "@code-style/typescript-configs/roles/nest",
    "@code-style/typescript-configs/layers/esmodule"
  ],
  "compilerOptions": {
    "composite": true,
    "outDir": "dist/",
    "types": []
  },
  "include": ["**/*.spec.ts", "test/"]
}

/src/tsconfig.json

// In order to update the this config, update @code-style/typescript-configs
{
  "extends": [
    "@code-style/typescript-configs/roles/nest",
    "@code-style/typescript-configs/layers/esmodule"
  ],
  "compilerOptions": {
    "composite": true,
    "outDir": "../dist/",
    "types": []
  },
  "include": ["./"],
  "exclude": ["**/*.spec.ts"]
}

/package.json

{
  ...
  "scripts": {
    ...
    "build": "tsc --build src"
  }
}
@dudeofawesome dudeofawesome added enhancement New feature or request blocked This is blocked by something labels Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked This is blocked by something enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant