-
Notifications
You must be signed in to change notification settings - Fork 857
Fix --test-scheduled
with custom builds & --x-dev-env
#7164
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"wrangler": patch | ||
--- | ||
|
||
Fix `--test-scheduled` with custom builds & `--x-dev-env` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,6 +133,20 @@ export class BundlerController extends Controller<BundlerControllerEventMap> { | |
config.compatibilityDate, | ||
config.compatibilityFlags | ||
), | ||
testScheduled: config.dev.testScheduled, | ||
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. This is the actual fix for the reported issue |
||
plugins: undefined, | ||
|
||
// Pages specific options used by wrangler pages commands | ||
entryName: undefined, | ||
inject: undefined, | ||
isOutfile: undefined, | ||
external: undefined, | ||
|
||
// We don't use esbuild watching for custom builds | ||
watch: undefined, | ||
|
||
// sourcemap defaults to true in dev | ||
sourcemap: undefined, | ||
}); | ||
if (buildAborter.signal.aborted) { | ||
return; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,32 +115,31 @@ export type BundleOptions = { | |
// A module collector enables you to observe what modules are in the Worker. | ||
moduleCollector: ModuleCollector; | ||
serveLegacyAssetsFromWorker: boolean; | ||
legacyAssets?: Config["legacy_assets"]; | ||
bypassAssetCache?: boolean; | ||
legacyAssets: Config["legacy_assets"] | undefined; | ||
bypassAssetCache: boolean | undefined; | ||
doBindings: DurableObjectBindings; | ||
workflowBindings: WorkflowBinding[]; | ||
jsxFactory?: string; | ||
jsxFragment?: string; | ||
entryName?: string; | ||
watch?: boolean; | ||
tsconfig?: string; | ||
minify?: boolean; | ||
nodejsCompatMode?: NodeJSCompatMode; | ||
jsxFactory: string | undefined; | ||
jsxFragment: string | undefined; | ||
entryName: string | undefined; | ||
watch: boolean | undefined; | ||
tsconfig: string | undefined; | ||
minify: boolean | undefined; | ||
nodejsCompatMode: NodeJSCompatMode | undefined; | ||
define: Config["define"]; | ||
alias: Config["alias"]; | ||
checkFetch: boolean; | ||
mockAnalyticsEngineDatasets: Config["analytics_engine_datasets"]; | ||
targetConsumer: "dev" | "deploy"; | ||
testScheduled?: boolean; | ||
inject?: string[]; | ||
loader?: Record<string, string>; | ||
sourcemap?: esbuild.CommonOptions["sourcemap"]; | ||
plugins?: esbuild.Plugin[]; | ||
isOutfile?: boolean; | ||
testScheduled: boolean | undefined; | ||
inject: string[] | undefined; | ||
sourcemap: esbuild.CommonOptions["sourcemap"] | undefined; | ||
plugins: esbuild.Plugin[] | undefined; | ||
isOutfile: boolean | undefined; | ||
local: boolean; | ||
projectRoot: string | undefined; | ||
defineNavigatorUserAgent: boolean; | ||
external?: string[]; | ||
external: string[] | undefined; | ||
}; | ||
|
||
/** | ||
|
@@ -172,7 +171,6 @@ export async function bundleWorker( | |
targetConsumer, | ||
testScheduled, | ||
inject: injectOption, | ||
loader, | ||
sourcemap, | ||
plugins, | ||
isOutfile, | ||
|
@@ -424,10 +422,7 @@ export async function bundleWorker( | |
...define, | ||
}, | ||
}), | ||
loader: { | ||
...COMMON_ESBUILD_OPTIONS.loader, | ||
...(loader || {}), | ||
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. The loader option wasn't used anywhere, so I removed it |
||
}, | ||
loader: COMMON_ESBUILD_OPTIONS.loader, | ||
plugins: [ | ||
aliasPlugin, | ||
moduleCollector.plugin, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ import { | |
} from "../deployment-bundle/bundle-reporter"; | ||
import { getBundleType } from "../deployment-bundle/bundle-type"; | ||
import { createWorkerUploadForm } from "../deployment-bundle/create-worker-upload-form"; | ||
import { logBuildOutput } from "../deployment-bundle/esbuild-plugins/log-build-output"; | ||
import { | ||
findAdditionalModules, | ||
writeAdditionalModules, | ||
|
@@ -321,6 +322,17 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m | |
props.compatibilityDate ?? config.compatibility_date, | ||
props.compatibilityFlags ?? config.compatibility_flags | ||
), | ||
plugins: [logBuildOutput(nodejsCompatMode)], | ||
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. This is a separate fix to unify versions & deploy messaging |
||
|
||
// Pages specific options used by wrangler pages commands | ||
entryName: undefined, | ||
inject: undefined, | ||
isOutfile: undefined, | ||
external: undefined, | ||
|
||
// These options are dev-only | ||
testScheduled: undefined, | ||
watch: undefined, | ||
} | ||
); | ||
|
||
|
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.
Nit: Just wanted to avoid
@ts-expect-error
. This might also make the test clearer which options the tests really cares.