Skip to content
Merged
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
1 change: 0 additions & 1 deletion .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { TestComponentWrapper } from "../src/TestComponentWrapper";

const inter = Inter({ subsets: ["latin"], variable: "--font-inter" });

sb.mock("../src/initializeEnvVars", { spy: false });
sb.mock("../src/config", { spy: false });

const AppDecorator: Preview["decorators"] = (storyFn) => {
Expand Down
29 changes: 28 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,24 @@

// Only process.env variables starting with `NEXT_PUBLIC_` will be shipped to the client:
import "./app/functions/server/notInClientComponent";
import "./initializeEnvVars";

import { resolve } from "node:path";
import { fileURLToPath } from "node:url";
import env from "@next/env";

// Initialize variables from env file if appropriate
// Doesn't run in tests by design, so ignore for coverage:
/* c8 ignore start */
if (
typeof process.env.NEXT_RUNTIME !== "string" &&
(process.env.NODE_ENV !== "test" || process.env.PLAYWRIGHT === "true")
) {
// If we're in Next.js, our `.env` files are already set up to be loaded.
// Outside of Next.js (e.g. in cron jobs), however, we need to explicitly load them.
// (In unit tests, `next/jest` takes care of this, so no need to run this there.)
env.loadEnvConfig(resolve(fileURLToPath(import.meta.url), "../../"));
}
/* c8 ignore end */

// Don't need to have coverage on config object
/* c8 ignore start */
Expand Down Expand Up @@ -92,6 +109,16 @@ export const config = {
}),
},
},
aws: {
accessKeyId: getEnvString("AWS_ACCESS_KEY_ID", { fallbackValue: "" }),
secretAccessKey: getEnvString("AWS_SECRET_ACCESS_KEY", {
fallbackValue: "",
}),
region: getEnvString("AWS_REGION", { fallbackValue: "us-west-1" }),
s3: {
logoBucket: getEnvString("S3_BUCKET", { fallbackValue: "" }),
},
},
} as const;
/* c8 ignore end */

Expand Down
23 changes: 0 additions & 23 deletions src/initializeEnvVars.js

This file was deleted.

137 changes: 0 additions & 137 deletions src/scripts/cronjobs/deleteSubsNoFxaUid.ts

This file was deleted.

Loading
Loading