-
-
Notifications
You must be signed in to change notification settings - Fork 133
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
Support URL
as cwd
#201
Support URL
as cwd
#201
Conversation
I would prefer not to introduce a dependency for this. I have worked very hard in the past year to reduce the amount of dependencies I use. In this case, it's really just |
I think Node.js should expose a method for this. It's such a common need now that everything is starting to support |
|
Removed dependency, and added test for |
I think this is a temporary need. Once everything supports |
No, there will always be a need as your argument only works if you directly pass the input to a Node.js API. Many packages manipulate the paths somehow and dealing with path and not URL is much nicer then. |
} | ||
|
||
export interface GitignoreOptions { | ||
readonly cwd?: string; | ||
readonly cwd?: URL | string; |
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.
URL
interface belongs to lib.dom.d.ts
, so now we force TS users to inject compilerOptions.lib: ['dom']
to resolve URL
as global. It breaks TS builds and formally this is a breaking change.
[build:es6 ] ../../node_modules/globby/index.d.ts(54,17): error TS2304: Cannot find name 'URL'.
[build:es6 ] ../../node_modules/globby/index.d.ts(58,17): error TS2304: Cannot find name 'URL'.
[build:es6 ] ../../node_modules/globby/index.d.ts(162,18): error TS2304: Cannot find name 'URL'.
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.
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.
Otherwise it should be explicitly imported in index.d.ts
. It does not belong to global by default.
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.
@sindresorhus
I really don't want to fix hundreds of our globby@^12
-dependant projects all night )). Could you plz roll the patch #206?
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'm sorry for breaking your projects, but I know nothing about the typing, I can't help.
I build
url-or-path
few months ago, it actually acceptpath
,URL
andURL.href
, should we add test forURL.href
too?Fixes #176