Skip to content

Commit

Permalink
rm cjs import for app config
Browse files Browse the repository at this point in the history
  • Loading branch information
charmingduchess committed Jan 8, 2025
1 parent 163134b commit e9f01a5
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 28 deletions.
43 changes: 21 additions & 22 deletions appConfig.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
module.exports = {
appTitle: "Library Card Application Form",
appName: "NYPL Library Card App",
favIconPath: "https://ux-static.nypl.org/images/favicon.ico",
api: {
oauth: process.env.OAUTH_PROVIDER_URL,
patron: process.env.PATRON_CREATION_URL,
validate: process.env.PATRON_VALIDATION_URL,
},
clientId: process.env.OAUTH_CLIENT_ID,
clientSecret: process.env.OAUTH_CLIENT_SECRET,
ipStackKey: process.env.IPSTACK_KEY,
nodeEnv: process.env.NODE_ENV,
agencyType: {
default: "198",
nys: "199",
},
scopes: "account:write account:read",
dsHeader: process.env.NEXT_PUBLIC_DS_GLOBAL_HEADER,
dsFooter: process.env.NEXT_PUBLIC_DS_GLOBAL_FOOTER,
adobeAnalyticsTag: process.env.NEXT_PUBLIC_ADOBE_ANALYTICS_TAG,
cookieDomain: process.env.COOKIE_DOMAIN,
export const appTitle = "Library Card Application Form"
export const appName = "NYPL Library Card App"
export const favIconPath = "https://ux-static.nypl.org/images/favicon.ico"
export const api = {
oauth: process.env.OAUTH_PROVIDER_URL,
patron: process.env.PATRON_CREATION_URL,
validate: process.env.PATRON_VALIDATION_URL,
};
export const clientId = process.env.OAUTH_CLIENT_ID
export const clientSecret = process.env.OAUTH_CLIENT_SECRET
export const ipStackKey = process.env.IPSTACK_KEY
export const nodeEnv = process.env.NODE_ENV
export const agencyType = {
default: "198",
nys: "199",
};
export const scopes = "account:write account:read"
export const dsHeader = process.env.NEXT_PUBLIC_DS_GLOBAL_HEADER
export const dsFooter = process.env.NEXT_PUBLIC_DS_GLOBAL_FOOTER
export const adobeAnalyticsTag = process.env.NEXT_PUBLIC_ADOBE_ANALYTICS_TAG
export const cookieDomain = process.env.COOKIE_DOMAIN

2 changes: 1 addition & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
FormDataContextProvider,
formInitialState,
} from "../src/context/FormDataContext";
import appConfig from "../appConfig";
import * as appConfig from "../appConfig";
import { FormInputData } from "../src/interfaces";
import ApplicationContainer from "../src/components/ApplicationContainer";
import { getPageTitles } from "../src/utils/utils";
Expand Down
2 changes: 1 addition & 1 deletion pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Document, { Html, Head, Main, NextScript } from "next/document";
import appConfig from "../appConfig";
import * as appConfig from "../appConfig";
const { adobeAnalyticsTag, dsHeader, dsFooter } = appConfig;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/utils/IPLocationAPI.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NextPageContext } from "next";
import requestIp from "request-ip";
import axios from "axios";
import appConfig from "../../appConfig";
import * as appConfig from "../../appConfig";
import { LocationResponse } from "../interfaces";

interface LocationPoint {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import qs from "qs";
import moment from "moment";
import Cors from "cors";

import config from "../../appConfig";
import * as config from "../../appConfig";
import logger from "../logger/index";
import { constructPatronObject, constructProblemDetail } from "./formDataUtils";
import {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/formDataUtils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import isEmpty from "lodash/isEmpty";
import { isEmail, isAlphanumeric, isLength } from "validator";
import ilsLibraryList from "../data/ilsLibraryList";
import config from "../../appConfig";
import * as config from "../../appConfig";
import {
Address,
Addresses,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import isEmpty from "lodash/isEmpty";
import { createHash, randomBytes } from "crypto";
import { PageTitles } from "../interfaces";
import cookie from "./CookieUtils";
import appConfig from "../../appConfig";
import * as appConfig from "../../appConfig";

export const redirectIfUserHasRegistered = (hasRegistered: boolean, router) => {
if (hasRegistered) {
Expand Down

0 comments on commit e9f01a5

Please sign in to comment.