-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Address msal-node tsdx warning #2202
Conversation
import { Constants as NodeConstants } from './../utils/Constants'; | ||
import { TokenCache } from '../cache/TokenCache'; | ||
import { ClientAssertion } from "../client/ClientAssertion"; | ||
const pjson = require("../../package.json"); |
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.
I thought we are avoiding require
except in tests.
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.
+1
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.
Hmm then we may need to think of something because we can't import package.json from outside the root without using require
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.
I think it's ok for this scenario. Did some testing and there isn't any way this will work otherwise currently because tsdx
has issues with .
as the rootDir. This is one reason I don't think we should have used tsdx
.
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.
So even adding a @ts-ignore
in order to import, silently changes the rootDir
back to ./
in the background. We'll move forward with the require
for now and revisit later
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
Addresses warning when building msal-node:
[tsdx]: Your rootDir is currently set to "./". Please change your rootDir to "./src". TSDX has deprecated setting tsconfig.compilerOptions.rootDir to "./" as it caused buggy output for declarationMaps and occassionally for type declarations themselves. You may also need to change your include to remove "test", which also caused declarations to be unnecessarily created for test files.
Also hopefully fixes intermittent build error:
EBUSY: resource busy or locked, copyfile 'D:\a\1\s\lib\msal-node\dist\src\utils\NetworkUtils.d.ts' -> 'D:\a\1\s\lib\msal-node\dist\utils\NetworkUtils.d.ts'