Repository navigation
Conversation
`@cordisjs/url-is-local@^1.0.0` is declared by adapters/dingtalk, adapters/discord,
adapters/kook and adapters/qq, but the package was never published, so every fresh
install fails at the resolution step. Define the helper in `@satorijs/core` and export
it from there, and drop the dependency from the four adapters.
The implementation is the one `HTTP#isLocal` used before cordiverse/http removed it in
678f1857d8 ("refa: remove http.isLocal()"), which is what the `v4` branch still calls as
`this.bot.http.isLocal(...)`.
Contributor
Author
|
Noting the CI state, because the red here is not this change. Before this branch, With this branch,
So the remaining red is the next layer, not a defect in this one. The |
Contributor
Author
|
Closing this: |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #432.
@cordisjs/url-is-local@^1.0.0is declared byadapters/dingtalk,adapters/discord,adapters/kookandadapters/qq, but the package was never published, so a fresh installdies in the resolution step before any job can run:
What this does
isLocalto@satorijs/core(packages/core/src/url.ts, re-exported fromindex.ts). This is option 2 of the three in the issue: a pure code change, no newdependency, no package to publish. All four adapters already declare
@satorijs/coreas a peer dependency, so nothing else has to move. Happy to switch to whichever option
you prefer.
import isLocal from ...sites at it, leaving every call site(
await isLocal(attrs.src || attrs.url)) untouched.package.jsonfiles.Semantics
HTTP#isLocalwas removed from the http plugin in678f1857d8("refa: removehttp.isLocal()"). Its last published implementation resolves the host and tests the address
against the bogon ranges; the
v4branch still calls it asthis.bot.http.isLocal(...).The new helper is that same implementation, so "local" keeps meaning exactly what it meant
on
v4. I could not find the package's own published source anywhere (it is not on npm,and no repo of that name is public), so
v4is the only reference I could match against.Verified on a clean clone of upstream
main:corepack yarn installexits 1 with theYN0035abovecorepack yarn installexits 0, 559 packages resolved, no stub orexternal/workaround of any kind
packages/core/src/url.tstype-checks;tscemitslib/url.d.tsand reports nothingfor it
CI, before and after
This branch (run 174): the
Installstep passes in all four jobs, where it used to abort.What it then reaches is a separate, older set of failures that this patch does not touch
and does not claim to fix:
lint: 36 problems (30 errors, 6 warnings) - identical to the count produced locallyagainst unmodified
main, all in files this patch does not touchbuild: 70tscerrors in 44 files - none of them inpackages/core, and all of theshape
"@cordisjs/plugin-http" has no exported member named 'HTTP'test (22)andtest (24): the protocol spec dies withERR_UNSUPPORTED_TYPESCRIPT_SYNTAXbecauseyakumo testremoves--import tsxfrom thechild
node --testinvocation, so the loader never reaches itThose are worth their own issues; they are not this one.