File tree Expand file tree Collapse file tree
modules/connectivity_check Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { Socket } from 'node: net';
2- import { lookup } from 'node: dns/promises';
3- import * as stats from '@racker/janus-core/lib/stats' ;
4- import * as log from '@racker/janus-core/lib/log' ;
1+ const { Socket } = require ( ' net') ;
2+ const { lookup } = require ( ' dns/promises') ;
3+ const stats = require ( '@racker/janus-core/lib/stats' ) ;
4+ const log = require ( '@racker/janus-core/lib/log' ) ;
55
66interface TestTarget {
77 host : string ;
@@ -28,7 +28,7 @@ interface LambdaEvent {
2828 targets : TestTarget [ ] ;
2929}
3030
31- export const handler = async ( event : LambdaEvent ) : Promise < TestResult [ ] > => {
31+ exports . handler = async ( event : LambdaEvent ) : Promise < TestResult [ ] > => {
3232 const env = process . env . ENVIRONMENT || 'unknown' ;
3333
3434 log . initialize ( 'connectivity-check' , {
Original file line number Diff line number Diff line change 11{
22 "name" : " connectivity-check-lambda" ,
33 "version" : " 1.0.0" ,
4- "type" : " module" ,
54 "engines" : {
65 "node" : " ~22"
76 },
Original file line number Diff line number Diff line change 11{
22 "compilerOptions" : {
33 "target" : " ES2022" ,
4- "module" : " ES2022 " ,
4+ "module" : " commonjs " ,
55 "lib" : [" ES2022" ],
66 "outDir" : " ." ,
77 "rootDir" : " ." ,
88 "strict" : false ,
9- "esModuleInterop" : true ,
109 "skipLibCheck" : true ,
11- "forceConsistentCasingInFileNames" : true ,
12- "moduleResolution" : " bundler" ,
1310 "resolveJsonModule" : true
1411 },
1512 "include" : [" index.ts" ],
Original file line number Diff line number Diff line change @@ -30,11 +30,6 @@ npm install --no-package-lock
3030echo " Compiling TypeScript..."
3131npx tsc
3232
33- # Fix ES module imports - add /index.js to janus-core subpath imports
34- echo " Fixing ES module imports..."
35- sed -i " s|from '@racker/janus-core/lib/stats'|from '@racker/janus-core/lib/stats/index.js'|g" index.js
36- sed -i " s|from '@racker/janus-core/lib/log'|from '@racker/janus-core/lib/log/index.js'|g" index.js
37-
3833# Remove TypeScript source and dev dependencies
3934rm -f index.ts tsconfig.json
4035npm prune --production
You can’t perform that action at this time.
0 commit comments