-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(nx): handle workspace.json with project paths instead of config (#18
) * fix(nx): handle workspace.json with project paths instead of configuration * feat(nx): prefer configuration from `project.json` files * test(nx): add tests for handling nx workspace with mixed configuration * refactor: rename variables, return with spread * chore: remove `console.log` statements * fix: check for undefined instead of null * test(nx): remove asserts for console.log usage
- Loading branch information
Showing
10 changed files
with
194 additions
and
45 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
libs/nx/src/__fixtures__/nx-workspace-mixed/duplicated-config/proj1/project.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "proj1", | ||
"sourceRoot": "projectSourceRoot" | ||
} |
11 changes: 11 additions & 0 deletions
11
libs/nx/src/__fixtures__/nx-workspace-mixed/duplicated-config/workspace.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"projects": { | ||
"proj1": { | ||
"name": "proj1", | ||
"sourceRoot": "workspaceSourceRoot" | ||
}, | ||
"proj2": { | ||
"name": "proj2" | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
libs/nx/src/__fixtures__/nx-workspace-mixed/no-duplicates/proj1/project.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "proj1" | ||
} |
8 changes: 8 additions & 0 deletions
8
libs/nx/src/__fixtures__/nx-workspace-mixed/no-duplicates/workspace.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"projects": { | ||
"proj1": "proj1", | ||
"proj2": { | ||
"name": "proj2" | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
libs/nx/src/__fixtures__/nx-workspace-paths/proj1/project.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "proj1" | ||
} |
3 changes: 3 additions & 0 deletions
3
libs/nx/src/__fixtures__/nx-workspace-paths/proj2/project.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "proj2" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"projects": { | ||
"proj1": "proj1", | ||
"proj2": "proj2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,10 @@ | ||
export const workspaceCwd = 'libs/nx/src/__fixtures__/nx-workspace'; | ||
export const projectCwd = 'libs/nx/src/__fixtures__/nx-project'; | ||
export const workspaceWithPathsCwd = | ||
'libs/nx/src/__fixtures__/nx-workspace-paths'; | ||
|
||
export const workspaceMixedCwd = { | ||
noDuplicates: 'libs/nx/src/__fixtures__/nx-workspace-mixed/no-duplicates', | ||
duplicatedConfig: | ||
'libs/nx/src/__fixtures__/nx-workspace-mixed/duplicated-config', | ||
} as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters