Skip to content

Commit 0fd0adc

Browse files
committed
chore(profile): Update refs to use libs instead of fxa-shared
Because: - Cleaning up code duplication This Commit: - References @fxa/shared/sentry - References @fxa/shared/otel - References @fxa/shared/monitoring
1 parent bd111cf commit 0fd0adc

6 files changed

Lines changed: 12 additions & 10 deletions

File tree

packages/fxa-profile-server/lib/config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@
55
const fs = require('fs');
66
const path = require('path');
77

8-
const tracing = require('fxa-shared/tracing/config');
8+
const { tracingConfig } = require('@fxa/shared/otel');
99
const convict = require('convict');
1010
const convict_format_with_validator = require('convict-format-with-validator');
1111
const convict_format_with_moment = require('convict-format-with-moment');
1212
convict.addFormats(convict_format_with_validator);
1313
convict.addFormats(convict_format_with_moment);
1414

15-
const tracingConfig = tracing.tracingConfig;
16-
1715
const conf = convict({
1816
api: {
1917
version: {

packages/fxa-profile-server/lib/monitoring.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

55
const Sentry = require('@sentry/node');
6-
const { initMonitoring } = require('fxa-shared/monitoring');
6+
const { initMonitoring } = require('@fxa/shared/monitoring');
77
const config = require('./config').getProperties();
88
const log = require('./logging')('configure-sentry');
99
const { version } = require('../package.json');

packages/fxa-profile-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"restart": "pm2 restart pm2.config.js",
1515
"delete": "pm2 delete pm2.config.js",
1616
"test": "scripts/test-local.sh",
17-
"test-unit": "MOCHA_FILE=../../artifacts/tests/$npm_package_name/fxa-profile-server-mocha-unit-results.xml node ./scripts/mocha-coverage.js --recursive test/*.js test/routes/*/*.js -g '#integration' --invert && NODE_ENV=test npx jest --no-coverage --forceExit --testPathPattern='spec\\.ts$' --testPathIgnorePatterns='in\\.spec\\.ts$'",
17+
"test-unit": "MOCHA_FILE=../../artifacts/tests/$npm_package_name/fxa-profile-server-mocha-unit-results.xml node -r esbuild-register ./scripts/mocha-coverage.js --recursive test/*.js test/routes/*/*.js -g '#integration' --invert && NODE_ENV=test npx jest --no-coverage --forceExit --testPathPattern='spec\\.ts$' --testPathIgnorePatterns='in\\.spec\\.ts$'",
1818
"test-integration": "MOCHA_FILE=../../artifacts/tests/$npm_package_name/fxa-profile-server-mocha-integration-results.xml node ./scripts/mocha-coverage.js --recursive test/*.js test/routes/*/*.js -g '#integration'",
1919
"test-jest-unit": "NODE_ENV=test npx jest --no-coverage --forceExit --testPathPattern='spec\\.ts$' --testPathIgnorePatterns='in\\.spec\\.ts$'",
2020
"test-integration-jest": "NODE_ENV=test npx jest --no-coverage --forceExit --testPathPattern='in\\.spec\\.ts$'",

packages/fxa-profile-server/pm2.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = {
1010
apps: [
1111
{
1212
name: 'profile',
13-
script: 'node bin/server.js',
13+
script: 'node -r esbuild-register bin/server.js',
1414
cwd: __dirname,
1515
max_restarts: '1',
1616
env: {
@@ -30,7 +30,7 @@ module.exports = {
3030
},
3131
{
3232
name: 'profile-worker',
33-
script: 'node bin/worker.js',
33+
script: 'node -r esbuild-register bin/worker.js',
3434
cwd: __dirname,
3535
max_restarts: '1',
3636
env: {
@@ -46,7 +46,7 @@ module.exports = {
4646
},
4747
{
4848
name: 'profile-static',
49-
script: 'node bin/_static.js',
49+
script: 'node -r esbuild-register bin/_static.js',
5050
cwd: __dirname,
5151
max_restarts: '1',
5252
env: {

packages/fxa-profile-server/scripts/mocha-coverage.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ const argv = [
2828
'--reporter=text',
2929
'--report-dir=coverage',
3030
MOCHA_BIN,
31+
'--require',
32+
'module-alias/register',
3133
];
3234

3335
const arg = argv.concat(process.argv.slice(2));

packages/fxa-profile-server/tsconfig.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
"target": "ES2021",
99
"esModuleInterop": true,
1010
"resolveJsonModule": true,
11-
"types": ["jest", "node"]
11+
"types": ["jest", "mocha", "mozlog", "node"],
12+
"lib": ["ESNext"],
13+
"noImplicitAny": false
1214
},
13-
"include": ["lib/**/*", "test/**/*"],
15+
"include": ["bin/*", "lib/**/*", "scripts/**/*", "test/**/*"],
1416
"exclude": ["node_modules", "dist"]
1517
}

0 commit comments

Comments
 (0)