Skip to content

Commit 9e423be

Browse files
committed
Fix check command
1 parent 6a8bed3 commit 9e423be

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

packages/cli/src/check.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Miniflare } from 'miniflare';
22

33
import { buildScriptFromManifest } from './build';
44
import { getDefaultManifestPath, resolveIntegrationManifestPath } from './manifest';
5+
import { getMiniflareOptions } from './dev';
56

67
/**
78
* Check that an integration can build correctly without publishing it.
@@ -12,9 +13,7 @@ export async function checkIntegrationBuild() {
1213
mode: 'development',
1314
});
1415

15-
const mf = new Miniflare({
16-
scriptPath,
17-
});
16+
const mf = new Miniflare(getMiniflareOptions(scriptPath));
1817
await mf.ready;
1918

2019
await mf.dispose();

packages/cli/src/dev.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,19 @@ import { resolveFile } from './manifest';
99
import { getAPIClient } from './remote';
1010
import { createDevTunnel } from './tunnel';
1111

12+
/**
13+
* Get the global miniflare options for an integration.
14+
*/
15+
export function getMiniflareOptions(scriptPath: string): MiniflareOptions {
16+
return {
17+
scriptPath,
18+
modules: true,
19+
modulesRoot: path.dirname(scriptPath),
20+
compatibilityDate: '2025-05-25',
21+
compatibilityFlags: ['nodejs_compat'],
22+
};
23+
}
24+
1225
/**
1326
* Start the integrations dev server on a random available port.
1427
* The dev server will automatically reload changes to the integration script.
@@ -51,13 +64,9 @@ export async function startIntegrationsDevServer(
5164
spinner.start('Starting dev server...');
5265
console.log(scriptPath);
5366
const miniflareOptions: MiniflareOptions = {
54-
scriptPath,
67+
...getMiniflareOptions(scriptPath),
5568
port,
5669
verbose: true,
57-
modules: true,
58-
modulesRoot: path.dirname(scriptPath),
59-
compatibilityDate: '2025-05-25',
60-
compatibilityFlags: ['nodejs_compat'],
6170
log: new Log(LogLevel.DEBUG, {
6271
prefix: manifest.name,
6372
}),

0 commit comments

Comments
 (0)