Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion alchemy-effect/src/Cloudflare/Website/Vite.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { InputProps } from "../../Input.ts";
import type { MemoOptions } from "../../Build/Memo.ts";
import { Worker, type WorkerProps } from "../Workers/Worker.ts";

Expand Down Expand Up @@ -54,7 +55,7 @@ export interface ViteProps extends Omit<WorkerProps, "vite" | "main"> {
* });
* ```
*/
export const Vite = (id: string, props: ViteProps = {}) =>
export const Vite = (id: string, props: InputProps<ViteProps> = {}) =>
Worker(id, {
...props,
main: undefined!,
Expand Down
21 changes: 14 additions & 7 deletions alchemy-effect/src/Cloudflare/Workers/Worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export interface WorkerProps<
};
limits?: WorkerLimits;
placement?: WorkerPlacement;
env?: Record<string, any>;
env?: Record<string, string | Redacted.Redacted<string>>;
exports?: string[];
bindings?: Bindings;
build?: {
Expand Down Expand Up @@ -998,12 +998,19 @@ ${[
if (news.env) {
for (const [key, value] of Object.entries(news.env)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to update the env type in WorkerProps to allow string | Redacted<string>?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed in other PR

if (value == null) continue;
const text = typeof value === "string" ? value : String(value);
metadataBindings.push({
type: "secret_text",
name: key,
text,
});
if (Redacted.isRedacted(value)) {
metadataBindings.push({
type: "secret_text",
name: key,
text: Redacted.value(value),
});
} else {
metadataBindings.push({
type: "plain_text",
name: key,
text: typeof value === "string" ? value : String(value),
});
}
}
}
yield* Effect.logInfo(
Expand Down
Loading