-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inline
@josephg/resolvable
dependency (#7900)
Issue #7895 reports that AS4 fails to build for ESM due to the resolvable dependency. I'm actually unsure _why_ this is happening though, since the shipped JS appears to be ESM compatible: https://unpkg.com/@josephg/resolvable@1.0.1/index.js @macrozone would you mind testing the builds from this PR (see Codesandbox CI comment) and letting me know if this resolves the issue in your project?
- Loading branch information
1 parent
79dacd0
commit 86d7111
Showing
13 changed files
with
74 additions
and
15 deletions.
There are no files selected for viewing
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 @@ | ||
--- | ||
"@apollo/server-integration-testsuite": patch | ||
"@apollo/server": patch | ||
--- | ||
|
||
Inline a small dependency that was causing build issues for ESM projects |
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 |
---|---|---|
|
@@ -98,7 +98,6 @@ instanceof | |
iosapp | ||
isnodelike | ||
iteratees | ||
josephg | ||
jsdelivr | ||
keyv | ||
keyvadapter | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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,30 @@ | ||
// Copyright 2019 Joseph Gentle | ||
|
||
// Permission to use, copy, modify, and / or distribute this software for any | ||
// purpose with or without fee is hereby granted, provided that the above | ||
// copyright notice and this permission notice appear in all copies. | ||
|
||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND | ||
// FITNESS.IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
// PERFORMANCE OF THIS SOFTWARE. | ||
|
||
export type Resolvable<T> = Promise<T> & { | ||
resolve: (t: T) => void; | ||
reject: (e: any) => void; | ||
}; | ||
|
||
export default <T = void>(): Resolvable<T> => { | ||
let resolve: (val: T) => void; | ||
let reject: (err: any) => void; | ||
const promise = new Promise<T>((_resolve, _reject) => { | ||
resolve = _resolve; | ||
reject = _reject; | ||
}) as Resolvable<T>; | ||
promise.resolve = resolve!; | ||
promise.reject = reject!; | ||
return promise; | ||
}; |
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
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
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,30 @@ | ||
// Copyright 2019 Joseph Gentle | ||
|
||
// Permission to use, copy, modify, and / or distribute this software for any | ||
// purpose with or without fee is hereby granted, provided that the above | ||
// copyright notice and this permission notice appear in all copies. | ||
|
||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND | ||
// FITNESS.IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
// PERFORMANCE OF THIS SOFTWARE. | ||
|
||
export type Resolvable<T> = Promise<T> & { | ||
resolve: (t: T) => void; | ||
reject: (e: any) => void; | ||
}; | ||
|
||
export default <T = void>(): Resolvable<T> => { | ||
let resolve: (val: T) => void; | ||
let reject: (err: any) => void; | ||
const promise = new Promise<T>((_resolve, _reject) => { | ||
resolve = _resolve; | ||
reject = _reject; | ||
}) as Resolvable<T>; | ||
promise.resolve = resolve!; | ||
promise.reject = reject!; | ||
return promise; | ||
}; |