You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(All other libs, libB, libC, libD have exactly the same package.json structure and naming scheme with the npm scopes and aliases and so on).
This is my current setup throughout the nx workspace: Every project/lib contains dependencies with npm aliases, in order to allow myself to easily switch my dependencies between local source code project reference and remote artifact registry pulling, where I simply switch the @scope-source to @scope-published and therefore handle several issues with how npm deals with these local references in the case I want to test my build with prebuilt published artifacts instead.
I do not need to adapt each and every import statement in my typescript code for example, I can leave them all with import { ... } from '@scope/package-name', they do not need to "know" whether the package is a local source or a external published bundle.
Now if I run npx nx sync for the first time after I changed my dependencies to use aliases, all the project references in the tsconfig files would get removed.
nx release is also broken when npm aliases are used.
it calls npm i --package-lock-only which would no longer find the locally referenced sources from the aliases as the aliases are not bumped by nx release while the package versions are indeed bumped.
Expected Behavior
This is not what I hoped for. I think nx should resolve npm aliases too.
GitHub Repo
No response
Steps to Reproduce
One lib (libA) with a package.json and a npm lib name containing "@some-scope-source/libA",
and possibly also a ts or js source file which imports stuff from libB via import { someFunc } from '@some-scope/libB' (this uses the alias, so the real source of the package can change in the package.json without affecting this import statement).
add libB also with a package.json and lib name containing "@some-scope-source/libB"
the whole nx workspace should be configured as a project-references thingy.
run npx nx sync. Observed output: nothing, there will not be any tsconfig references in libA/tsconfig.lib.json or libA/tsconfig.json, but they should there as expected.
If I add the non-aliased source dependency in addition to the alias, even tho the typescript source never directly imports from '@scope-source/package-name' but only ever from the alias '@scope/package-name', then nx sync will still generate the expected tsconfig path references, which I will use as a workaround for now:
Current Behavior
Not sure if this is a feature-request or a bug report, but anyways:
libA/package.json
:(All other libs, libB, libC, libD have exactly the same
package.json
structure and naming scheme with the npm scopes and aliases and so on).This is my current setup throughout the nx workspace: Every project/lib contains dependencies with npm aliases, in order to allow myself to easily switch my dependencies between local source code project reference and remote artifact registry pulling, where I simply switch the
@scope-source
to@scope-published
and therefore handle several issues with how npm deals with these local references in the case I want to test my build with prebuilt published artifacts instead.I do not need to adapt each and every import statement in my typescript code for example, I can leave them all with
import { ... } from '@scope/package-name'
, they do not need to "know" whether the package is a local source or a external published bundle.Now if I run
npx nx sync
for the first time after I changed my dependencies to use aliases, all the project references in the tsconfig files would get removed.nx release
is also broken when npm aliases are used.it calls
npm i --package-lock-only
which would no longer find the locally referenced sources from the aliases as the aliases are not bumped by nx release while the package versions are indeed bumped.Expected Behavior
This is not what I hoped for. I think nx should resolve npm aliases too.
GitHub Repo
No response
Steps to Reproduce
One lib (libA) with a package.json and a npm lib name containing "@some-scope-source/libA",
"dependencies": {"@some-scope/libB": "npm:@some-scope-source/[email protected]"}
and possibly also a ts or js source file which imports stuff from libB via
import { someFunc } from '@some-scope/libB'
(this uses the alias, so the real source of the package can change in the package.json without affecting this import statement).add libB also with a package.json and lib name containing "@some-scope-source/libB"
the whole nx workspace should be configured as a project-references thingy.
run
npx nx sync
. Observed output: nothing, there will not be any tsconfig references inlibA/tsconfig.lib.json
orlibA/tsconfig.json
, but they should there as expected.Expected:
libA/tsconfig.json
:libA/tsconfig.lib.json
:Nx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
If I add the non-aliased source dependency in addition to the alias, even tho the typescript source never directly imports from '@scope-source/package-name' but only ever from the alias '@scope/package-name', then
nx sync
will still generate the expected tsconfig path references, which I will use as a workaround for now:The text was updated successfully, but these errors were encountered: