-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
feat: make wrangler an optional peer dependency #12452
Open
benmccann
wants to merge
12
commits into
main
Choose a base branch
from
no-wrangler
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
3396927
chore: avoid installing wrangler
benmccann c04a2f1
wrangler types
benmccann 97893c9
format
benmccann 47d85c3
update typescript-eslint
benmccann 02c855d
ignore]
benmccann 484f9be
don't typecheck output
benmccann 4d4e162
update gitignore
benmccann f3ea310
add missing ignore
benmccann 2a62ce1
no src dir
benmccann e209f0c
merge main
benmccann 97d0233
make wrangler an optional peer dependency
benmccann a5d4790
Merge branch 'main' into no-wrangler
eltigerchino File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ | ||
--- | ||
'@sveltejs/adapter-cloudflare-workers': minor | ||
'@sveltejs/adapter-cloudflare': minor | ||
--- | ||
|
||
feat: make wrangler an optional peer dependency |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
link-workspace-packages = true | ||
auto-install-peers = false |
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
.DS_Store | ||
node_modules | ||
/files |
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,116 @@ | ||
import type { IncomingRequestCfProperties } from '@cloudflare/workers-types/experimental'; | ||
|
||
declare class ExecutionContext { | ||
waitUntil(promise: Promise<any>): void; | ||
passThroughOnException(): void; | ||
} | ||
|
||
declare type CacheQueryOptions_2 = { | ||
ignoreMethod?: boolean; | ||
}; | ||
|
||
declare type CacheRequest = any; | ||
|
||
declare type CacheResponse = any; | ||
|
||
/** | ||
* No-op implementation of Cache | ||
*/ | ||
declare class Cache_2 { | ||
delete(request: CacheRequest, options?: CacheQueryOptions_2): Promise<boolean>; | ||
match(request: CacheRequest, options?: CacheQueryOptions_2): Promise<CacheResponse | undefined>; | ||
put(request: CacheRequest, response: CacheResponse): Promise<void>; | ||
} | ||
|
||
/** | ||
* No-op implementation of CacheStorage | ||
*/ | ||
declare class CacheStorage_2 { | ||
constructor(); | ||
open(cacheName: string): Promise<Cache_2>; | ||
get default(): Cache_2; | ||
} | ||
|
||
/** | ||
* Result of the `getPlatformProxy` utility | ||
*/ | ||
export declare type PlatformProxy< | ||
Env = Record<string, unknown>, | ||
CfProperties extends Record<string, unknown> = IncomingRequestCfProperties | ||
> = { | ||
/** | ||
* Environment object containing the various Cloudflare bindings | ||
*/ | ||
env: Env; | ||
/** | ||
* Mock of the context object that Workers received in their request handler, all the object's methods are no-op | ||
*/ | ||
cf: CfProperties; | ||
/** | ||
* Mock of the context object that Workers received in their request handler, all the object's methods are no-op | ||
*/ | ||
ctx: ExecutionContext; | ||
/** | ||
* Caches object emulating the Workers Cache runtime API | ||
*/ | ||
caches: CacheStorage_2; | ||
/** | ||
* Function used to dispose of the child process providing the bindings implementation | ||
*/ | ||
dispose: () => Promise<void>; | ||
}; | ||
|
||
/** | ||
* By reading from a `wrangler.toml` file this function generates proxy objects that can be | ||
* used to simulate the interaction with the Cloudflare platform during local development | ||
* in a Node.js environment | ||
* | ||
* @param options The various options that can tweak this function's behavior | ||
* @returns An Object containing the generated proxies alongside other related utilities | ||
*/ | ||
export declare function getPlatformProxy< | ||
Env = Record<string, unknown>, | ||
CfProperties extends Record<string, unknown> = IncomingRequestCfProperties | ||
>(options?: GetPlatformProxyOptions): Promise<PlatformProxy<Env, CfProperties>>; | ||
|
||
/** | ||
* Options for the `getPlatformProxy` utility | ||
*/ | ||
export declare type GetPlatformProxyOptions = { | ||
/** | ||
* The name of the environment to use | ||
*/ | ||
environment?: string; | ||
/** | ||
* The path to the config file to use. | ||
* If no path is specified the default behavior is to search from the | ||
* current directory up the filesystem for a `wrangler.toml` to use. | ||
* | ||
* Note: this field is optional but if a path is specified it must | ||
* point to a valid file on the filesystem | ||
*/ | ||
configPath?: string; | ||
/** | ||
* Flag to indicate the utility to read a json config file (`wrangler.json`) | ||
* instead of the toml one (`wrangler.toml`) | ||
* | ||
* Note: this feature is experimental | ||
*/ | ||
experimentalJsonConfig?: boolean; | ||
/** | ||
* Indicates if and where to persist the bindings data, if not present or `true` it defaults to the same location | ||
* used by wrangler v3: `.wrangler/state/v3` (so that the same data can be easily used by the caller and wrangler). | ||
* If `false` is specified no data is persisted on the filesystem. | ||
*/ | ||
persist?: | ||
| boolean | ||
| { | ||
path: string; | ||
}; | ||
/** | ||
* Use the experimental file-based dev registry for service discovery | ||
* | ||
* Note: this feature is experimental | ||
*/ | ||
experimentalRegistry?: boolean; | ||
}; |
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 | ||||
---|---|---|---|---|---|---|
|
@@ -53,5 +53,13 @@ | |||||
"peerDependencies": { | ||||||
"@sveltejs/kit": "^2.0.0", | ||||||
"wrangler": "^3.28.4" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
}, | ||||||
"peerDependenciesMeta": { | ||||||
"wrangler": { | ||||||
"optional": true | ||||||
} | ||||||
}, | ||||||
"publishConfig": { | ||||||
"access": "public" | ||||||
} | ||||||
} |
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
instead of TLA with swallowing the error, what about lazily importing it when a feature is used that requires it and then logging a message asking the user to install wrangler to support it?