Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(core): build project's that have buildable dependencies without p…
…ackage.json's (#9466)
  • Loading branch information
pemsbr committed Apr 8, 2022
1 parent 96db3c5 commit 8e3f7d8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/workspace/src/utilities/buildable-libs-utils.ts
@@ -1,5 +1,5 @@
import { dirname, join, relative, resolve } from 'path';
import { directoryExists } from './fileutils';
import { directoryExists, fileExists } from './fileutils';
import type { ProjectGraph, ProjectGraphProjectNode } from '@nrwl/devkit';
import {
ProjectGraphExternalNode,
Expand Down Expand Up @@ -50,12 +50,16 @@ export function calculateProjectDependencies(
const depNode = projGraph.nodes[dep] || projGraph.externalNodes[dep];
if (depNode.type === 'lib') {
if (isBuildable(targetName, depNode)) {
const libPackageJson = readJsonFile(
join(root, depNode.data.root, 'package.json')
const libPackageJsonPath = join(
root,
depNode.data.root,
'package.json'
);

project = {
name: libPackageJson.name, // i.e. @workspace/mylib
name: fileExists(libPackageJsonPath)
? readJsonFile(libPackageJsonPath).name // i.e. @workspace/mylib
: dep,
outputs: getOutputsForTargetAndConfiguration(
{
overrides: {},
Expand Down

0 comments on commit 8e3f7d8

Please sign in to comment.