Skip to content

Commit 2f07f9e

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 0e3c81b commit 2f07f9e

6 files changed

Lines changed: 26 additions & 8 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",
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",
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
"format": "prettier --write --config ../../_dev/.prettierrc '**'"
2020
},

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));
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"module": "commonjs",
5+
"allowJs": true,
6+
"checkJs": false,
7+
"outDir": "./dist",
8+
"types": ["mocha", "mozlog", "node"],
9+
"lib": ["ESNext"],
10+
"noImplicitAny": false
11+
},
12+
"include": [
13+
"bin/*",
14+
"lib/**/*",
15+
"scripts/**/*",
16+
"test/**/*"
17+
]
18+
}

0 commit comments

Comments
 (0)