Kerick Howlett 9a9e6eb96b
fix(core): allow for non-js libs to be moved without errors or the creation of any unneeded tsconfig files (#28350)
## Current Behavior

I have a project that is utilizing the `@nx-go/nx-go` extension that's
used for supporting Go applications.

When I attempt to use the `@nx/workspace:move` generator to move a Go
library, it'll produce an error. (Please refer to the _Failure Logs_
section for said error.)

Sadly, there isn't a consistent means to get the bun to start showing
up, but once it does, the issue will persist throughout the workspace's
life cycle.

I was able to trace this to the compiled Javascript files within Nx's
installed project files under the `node_modules` directory, which is
where I found a workaround. That being to have the
`secondaryEntryPointImportPaths` variable (located within the
`updateImports` function) set with an empty array on the same line it's
declared.

However, this will produce a `tsconfig.base.json` file at the root of
the workspace with the text `undefined` contained within it and with no
actual JSON to speak of.

## Expected Behavior

I have a project that is utilizing the `@nx-go/nx-go` extension that's
used for supporting Go applications.

The `@nx/workspace:move` schematic generator should be able to move
libraries based in Go and other programming languages without any errors
popping up.

It should also do it without generating an empty `tsconfig.base.json`
file if one didn't exist previously. This tends to be the case when
there is no Typescript to speak of within the Nx workspace. For example,
an Nx workspace initiated with the `@nx-go/nx-go` preset.

## Related Issue(s)

- [#28349](https://github.com/nrwl/nx/issues/28349)

Co-authored-by: Kerick Howlett <88661181+KerickHowlett@users.noreply.github.com>
2025-01-28 09:59:53 -05:00
..

Nx - Smart Monorepos · Fast CI

{{links}}


Nx: Smart Monorepos · Fast CI

Nx is a build system, optimized for monorepos, with plugins for popular frameworks and tools and advanced CI capabilities including caching and distribution.

{{content}}