diff --git a/.github/workflows/npmPublish.yml b/.github/workflows/npmPublish.yml index f6a35c0..a4d4c44 100644 --- a/.github/workflows/npmPublish.yml +++ b/.github/workflows/npmPublish.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 20 registry-url: https://registry.npmjs.org/ - run: yarn install - run: npm publish --access public diff --git a/jest.config.ts b/jest.config.ts index 27285af..a7df7d6 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -3,8 +3,8 @@ * https://jestjs.io/docs/configuration */ -const { pathsToModuleNameMapper } = require('ts-jest'); -const tsConfigFile = require('./tsconfig'); +import { pathsToModuleNameMapper } from 'ts-jest'; +import tsConfigFile from './tsconfig.json'; export default { // All imported modules in your tests should be mocked automatically diff --git a/src/JSONUtils.ts b/src/JSONUtils.ts index c185957..d2d693d 100644 --- a/src/JSONUtils.ts +++ b/src/JSONUtils.ts @@ -1,7 +1,7 @@ +import * as fs from 'fs'; + export class JSONUtils { static readFile(filePath: string): T { - const fs = require('fs'); - const raw = fs.readFileSync(filePath, 'utf8'); return JSON.parse(raw); }