Use the paths to find workspace files

Signed-off-by: Harrison Hogg <hhogg@spotify.com>
This commit is contained in:
Harrison Hogg
2024-09-23 09:46:39 +01:00
parent 59d6bf3ab4
commit e69428c5f8
+2 -4
View File
@@ -13,16 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { findPaths } from '@backstage/cli-common';
import { PackageRole } from '@backstage/cli-node';
import { resolve as resolvePath } from 'path';
import { Project, SourceFile, SyntaxKind, ts, Type } from 'ts-morph';
import { paths } from './paths';
export const createTypeDistProject = async () => {
const workspaceRoot = findPaths(process.cwd()).targetRoot;
return new Project({
tsConfigFilePath: resolvePath(workspaceRoot, 'tsconfig.json'),
tsConfigFilePath: paths.resolveTargetRoot('tsconfig.json'),
skipAddingFilesFromTsConfig: true,
});
};