Skip to content

Commit

Permalink
Build scan package with esnext and bundler module resolution to fix J…
Browse files Browse the repository at this point in the history
…S tests
  • Loading branch information
nateweller committed Nov 5, 2024
1 parent 5c84d70 commit 377e873
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
6 changes: 3 additions & 3 deletions projects/js-packages/scan/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './types/index.js';
export * from './constants/index.js';
export * from './utils/index.js';
export * from './types';
export * from './constants';
export * from './utils';
4 changes: 2 additions & 2 deletions projects/js-packages/scan/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './fixers.js';
export * from './threats.js';
export * from './fixers';
export * from './threats';
2 changes: 1 addition & 1 deletion projects/js-packages/scan/src/types/threats.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ThreatFixStatus } from './fixers.js';
import { ThreatFixStatus } from '..';

export type ThreatStatus = 'fixed' | 'ignored' | 'current';

Expand Down
6 changes: 2 additions & 4 deletions projects/js-packages/scan/src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { FIXER_IS_STALE_THRESHOLD } from '../constants/index.js';
import { ThreatFixStatus } from '../types/fixers.js';
import { Threat } from '../types/threats.js';
import { Threat, ThreatFixStatus, FIXER_IS_STALE_THRESHOLD } from '..';

export const getThreatType = ( threat: Threat ) => {
if ( threat.signature === 'Vulnerable.WP.Core' ) {
Expand All @@ -26,6 +24,6 @@ export const fixerStatusIsStale = ( fixerStatus: ThreatFixStatus ) => {
return (
'status' in fixerStatus &&
fixerStatus.status === 'in_progress' &&
fixerTimestampIsStale( fixerStatus.last_updated )
fixerTimestampIsStale( fixerStatus.lastUpdated )
);
};
3 changes: 2 additions & 1 deletion projects/js-packages/scan/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"typeRoots": [ "./node_modules/@types/", "src/types/*" ],
"sourceMap": false,
"outDir": "./build/",
"target": "esnext"
"module": "ESNext",
"moduleResolution": "bundler"
}
}

0 comments on commit 377e873

Please sign in to comment.