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.
|
@@ -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("\
|
|
20
|
-
console.log("
|
|
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 =
|
|
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 ??
|
|
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
|