rwsdk 0.1.35 → 0.1.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,5 +9,7 @@ export interface RequestInfo<Params = any, AppContext = DefaultAppContext> {
9
9
  headers: Headers;
10
10
  rw: RwContext;
11
11
  cf: ExecutionContext;
12
- response: ResponseInit;
12
+ response: ResponseInit & {
13
+ headers: Headers;
14
+ };
13
15
  }
@@ -16,13 +16,18 @@ export const runWorkerScript = async (relativeScriptPath) => {
16
16
  console.error("Error: Script path is required");
17
17
  console.log("\nUsage:");
18
18
  console.log(" npm run worker:run <script-path>");
19
- console.log("\nExample:");
20
- console.log(" npm run worker:run src/scripts/seed.ts\n");
19
+ console.log("\nOptions:");
20
+ console.log(" RWSDK_WRANGLER_CONFIG Environment variable for config path");
21
+ console.log("\nExamples:");
22
+ console.log(" npm run worker:run src/scripts/seed.ts");
23
+ console.log(" RWSDK_WRANGLER_CONFIG=custom.toml npm run worker:run src/scripts/seed.ts\n");
21
24
  process.exit(1);
22
25
  }
23
26
  const scriptPath = resolve(process.cwd(), relativeScriptPath);
24
27
  debug("Running worker script: %s", scriptPath);
25
- const workerConfigPath = await findWranglerConfig(process.cwd());
28
+ const workerConfigPath = process.env.RWSDK_WRANGLER_CONFIG
29
+ ? resolve(process.cwd(), process.env.RWSDK_WRANGLER_CONFIG)
30
+ : await findWranglerConfig(process.cwd());
26
31
  debug("Using wrangler config: %s", workerConfigPath);
27
32
  const workerConfig = unstable_readConfig({
28
33
  config: workerConfigPath,
@@ -31,7 +31,10 @@ const determineWorkerEntryPathname = async (projectRootDir, workerConfigPath, op
31
31
  };
32
32
  export const redwoodPlugin = async (options = {}) => {
33
33
  const projectRootDir = process.cwd();
34
- const workerConfigPath = options.configPath ?? (await findWranglerConfig(projectRootDir));
34
+ const workerConfigPath = options.configPath ??
35
+ (process.env.RWSDK_WRANGLER_CONFIG
36
+ ? resolve(projectRootDir, process.env.RWSDK_WRANGLER_CONFIG)
37
+ : await findWranglerConfig(projectRootDir));
35
38
  const workerEntryPathname = await determineWorkerEntryPathname(projectRootDir, workerConfigPath, options);
36
39
  const clientEntryPathnames = (Array.isArray(options.entry?.client)
37
40
  ? options.entry.client
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rwsdk",
3
- "version": "0.1.35",
3
+ "version": "0.1.37",
4
4
  "description": "Build fast, server-driven webapps on Cloudflare with SSR, RSC, and realtime",
5
5
  "type": "module",
6
6
  "bin": {