nx icon indicating copy to clipboard operation
nx copied to clipboard

feat(js): add `srcRootForCompilationRoot` option to tsc executor

Open nontangent opened this issue 2 years ago • 5 comments

Current Behavior

Not support srcRootForCompilationRoot option in @nrwl/js:tsc executor. This option have been existed on before package(@nrwl/node:package).

Now, we can build directory structure like not dist/libs/<:libName>/<:moduleName> but only dist/libs/<:libName>/src/<:moduleName> by using @nwrl/js:tsc.

Expected Behavior

We should be able to build directory structure like dist/libs/<:libName>/<:moduleName> by srcRootForCompilationRoot option(srcRootForCompilationRoot: libs/<:libName>/src).

Related Issue(s)

Fixes https://github.com/nrwl/nx/issues/9410

nontangent avatar Jun 11 '22 14:06 nontangent

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 453b4d749bd78bf065e043a058ed68bb7012f589. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 12 targets

Sent with 💌 from NxCloud.

nx-cloud[bot] avatar Jun 11 '22 14:06 nx-cloud[bot]

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
nx-dev ✅ Ready (Inspect) Visit Preview Jun 11, 2022 at 2:44PM (UTC)

vercel[bot] avatar Jun 11 '22 14:06 vercel[bot]

Hi @nontangent , thank you for the contribution. Can you add some tests to verify the behavior of whether the srcRootForCompilationRoot is provided or not?

nartc avatar Jun 15 '22 19:06 nartc

@nartc Hi, I'd like to contribute but I don't know where should I put the test.

I took a look into the js package (library.spec.ts) but I don't know how I should proceed since the srcRootForCompilationRoot is only used in the compileTypeScriptFiles & there is no tests on it (at least inside the library.spec.ts).

Maybe you could give me a hint, where or how could I test this behaviour?

Thank you for reading! :)

geofmigliacci avatar Jul 29 '22 06:07 geofmigliacci

@geofmigliacci thank you for the offer. Since it is a schema change to the tsc executor, we'd have an e2e test for it.

You can look into: e2e/js/src/js.test.ts to see how the current e2e are setup.

What we'd like to test is to verify the behavior when srcRootForCompilationRoot is provided versus when it's not provided.

nartc avatar Jul 29 '22 07:07 nartc

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

github-actions[bot] avatar Mar 17 '23 21:03 github-actions[bot]