-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
append dirname of tsconfigPath to project reference paths #39
append dirname of tsconfigPath to project reference paths #39
Conversation
8738d36
to
ca5e290
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM
Can you add a test?
- Create(copy) your expected structure into https://github.com/azu/monorepo-utils/tree/master/packages/%40monorepo-utils/workspaces-to-typescript-project-references/test/fixtures
- Add test case with
checkOnly: true
to https://github.com/azu/monorepo-utils/blob/master/packages/%40monorepo-utils/workspaces-to-typescript-project-references/test/index.test.ts
This test works as Snapshot Testing-like testing.
@@ -52,24 +55,26 @@ export const toProjectReferences = (options: Options) => { | |||
if (!absolutePathOrNull) { | |||
return; | |||
} | |||
if (!path.isAbsolute(absolutePathOrNull)) { | |||
const tsConfigDirName = path.dirname(options.tsConfigPath ?? DEFAULT_TSCONFIGPATH); | |||
const absolutePath = path.join(absolutePathOrNull, tsConfigDirName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> require("path").dirname("tsconfig.json")
'.'
> require("path").join("a", ".")
'a'
aha. it will work correctly.
ca5e290
to
8bb4f76
Compare
Sorted @azu :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks!
Closes #38