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

[Bug]: tsconfig.base.json and tsconfig.build.json are not properly generated #2665

Closed
malek-benazzouz opened this issue Jan 6, 2025 · 2 comments · Fixed by #2648
Closed
Labels
bug Something isn't working triage

Comments

@malek-benazzouz
Copy link

malek-benazzouz commented Jan 6, 2025

Package name

core

Package version

11.5.3

Reproduction steps

Create a project with @o3r/create, then generate an app and a lib:

npm create @o3r project
ng g application app
ng g library lib

Current result

  • File tsconfig.base.json is not generated.
  • File tsconfig.build.json is not generated.
  • The app and lib tsconfig files extend ../../tsconfig.json root file.
  • In the lib tsconfig.spec.json file, there is a reference to path ./tsconfig.build.composite.json, but this file was not generated.
  • The path mapping in tsconfig.json file is not properly configured: the generated path mapping is "lib": ["libs/lib/dist", "libs/lib/src/public-api"], which does not allow for a proper IDE navigation. A proper config could also ease local lib development (today you have to run ng build lib --watch to have your lib changes live reloaded).

Expected result

The generated configuration should be similar to the one of o3r monorepo, with tsconfig.base.json and tsconfig.build.json files generated, and the app and lib properly referencing these files. Path mappings should also be properly configured.

Additional comments

No response

@malek-benazzouz malek-benazzouz added bug Something isn't working triage labels Jan 6, 2025
@malek-benazzouz malek-benazzouz changed the title [Bug]: tsconfig.base.json and tsconfig.build.json are not properly generated [Bug]: tsconfig.base.json and tsconfig.build.json are not properly generated Jan 6, 2025
@malek-benazzouz malek-benazzouz changed the title [Bug]: tsconfig.base.json and tsconfig.build.json are not properly generated [Bug]: tsconfig.base.json and tsconfig.build.json are not properly generated Jan 6, 2025
@kpanot kpanot added this to the On boarding improvement milestone Jan 7, 2025
@malek-benazzouz
Copy link
Author

Additional note: fixing the path mappings will also fix the following unit test issue, that is raised as soon as we try to call a lib component from the app:

Could not locate module @nevio/library mapped as:  ..\libs\lib\dist,libs\lib\src\public-api

@malek-benazzouz
Copy link
Author

To be confirmed:
Today the generated tsconfig.lib.prod.json extends ./tsconfig.lib.json, but the expected behavior is that it should extend ../../tsconfig.build.json instead.

github-merge-queue bot pushed a commit that referenced this issue Jan 25, 2025
## Proposed change

fix(workspace): the tsconfig links to generate libraries

It fixes the following points:
- generate the tsconfig.build.json (mandatory for lib standalone
publishing)
- remove the `dist/` path from the `tsconfig.base.json` which is leading
to wrong path mapping when the library was locally built
- register properly the lib in both tsconfig files
- update the tsconfig.lib.prod.json to extend the correct tsconfig

<!--
Please include a summary of the changes and the related issue.
Please also include relevant motivation and context.
-->

## Related issues

<!--
Please make sure to follow the [contribution
guidelines](https://github.com/amadeus-digital/Otter/blob/main/CONTRIBUTING.md)
-->

<!-- * 🐛 Fix #issue -->
* 🐛 Fix resolves #2665
<!-- * 🚀 Feature #issue -->
<!-- * 🚀 Feature resolves #issue -->
<!-- * :octocat: Pull Request #issue -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants