From 526605a09159ee975ecb978823cfd866770003e7 Mon Sep 17 00:00:00 2001 From: Reino Muhl Date: Wed, 11 Oct 2023 18:15:13 -0400 Subject: [PATCH] fix(auth): replace ts alias with relative paths Because: * fxa-auth-server is failing to start up in build since TypeScript path aliases are still present in JavaScript files. This commit: * Replace ts path aliases in fxa-auth-server JS files, with relative paths. Closes # --- packages/fxa-auth-server/config/supportedLanguages.js | 2 +- packages/fxa-auth-server/lib/customs.js | 9 +++++---- packages/fxa-auth-server/lib/senders/email.js | 2 +- packages/fxa-auth-server/lib/server.js | 2 +- .../scripts/bulk-mailer/normalize-user-records.js | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/fxa-auth-server/config/supportedLanguages.js b/packages/fxa-auth-server/config/supportedLanguages.js index 09a53ad273..08faf520c9 100644 --- a/packages/fxa-auth-server/config/supportedLanguages.js +++ b/packages/fxa-auth-server/config/supportedLanguages.js @@ -7,4 +7,4 @@ // The list below should be kept in sync with: // https://github.com/mozilla/fxa/blob/main/libs/shared/l10n/src/lib/supportedLanguages.json -module.exports = require('@fxa/shared/l10n').supportedLanguages; +module.exports = require('../../../libs/shared/l10n/src').supportedLanguages; diff --git a/packages/fxa-auth-server/lib/customs.js b/packages/fxa-auth-server/lib/customs.js index 479b573c0f..3df8789bc2 100644 --- a/packages/fxa-auth-server/lib/customs.js +++ b/packages/fxa-auth-server/lib/customs.js @@ -7,10 +7,11 @@ const Joi = require('joi'); const createBackendServiceAPI = require('./backendService'); const { config } = require('../config'); -const localizeTimestamp = require('@fxa/shared/l10n').localizeTimestamp({ - supportedLanguages: config.get('i18n').supportedLanguages, - defaultLanguage: config.get('i18n').defaultLanguage, -}); +const localizeTimestamp = + require('../../../libs/shared/l10n/src').localizeTimestamp({ + supportedLanguages: config.get('i18n').supportedLanguages, + defaultLanguage: config.get('i18n').defaultLanguage, + }); const serviceName = 'customs'; module.exports = function (log, error, statsd) { diff --git a/packages/fxa-auth-server/lib/senders/email.js b/packages/fxa-auth-server/lib/senders/email.js index 9e043852d7..4e41fbf1a3 100644 --- a/packages/fxa-auth-server/lib/senders/email.js +++ b/packages/fxa-auth-server/lib/senders/email.js @@ -17,7 +17,7 @@ const { const { productDetailsFromPlan } = require('fxa-shared').subscriptions.metadata; const Renderer = require('./renderer').default; const { NodeRendererBindings } = require('./renderer/bindings-node'); -const { determineLocale } = require('@fxa/shared/l10n'); +const { determineLocale } = require('../../../../libs/shared/l10n/src'); const TEMPLATE_VERSIONS = require('./emails/templates/_versions.json'); diff --git a/packages/fxa-auth-server/lib/server.js b/packages/fxa-auth-server/lib/server.js index c8dbea1d89..d194e70bb8 100644 --- a/packages/fxa-auth-server/lib/server.js +++ b/packages/fxa-auth-server/lib/server.js @@ -19,7 +19,7 @@ const { HEX_STRING } = require('./routes/validators'); const { configureSentry } = require('./sentry'); const { swaggerOptions } = require('../docs/swagger/swagger-options'); const { Account } = require('fxa-shared/db/models/auth'); -const { determineLocale } = require('@fxa/shared/l10n'); +const { determineLocale } = require('../../../libs/shared/l10n/src'); const { reportValidationError, } = require('fxa-shared/sentry/report-validation-error'); diff --git a/packages/fxa-auth-server/scripts/bulk-mailer/normalize-user-records.js b/packages/fxa-auth-server/scripts/bulk-mailer/normalize-user-records.js index 37fb759076..8ef4ee8b24 100644 --- a/packages/fxa-auth-server/scripts/bulk-mailer/normalize-user-records.js +++ b/packages/fxa-auth-server/scripts/bulk-mailer/normalize-user-records.js @@ -5,7 +5,7 @@ 'use strict'; const leftpad = require('leftpad'); -const { determineLocale } = require('@fxa/shared/l10n'); +const { determineLocale } = require('../../../../libs/shared/l10n/src'); module.exports = class UserRecordNormalizer { /**