From 7261d166d4d3de8ff2cf6c55ae12bfa14ff73d4d Mon Sep 17 00:00:00 2001 From: Patrick Taylor Date: Sat, 26 Oct 2024 22:57:20 +0100 Subject: [PATCH] =?UTF-8?q?Support=20JSON=20=F0=9F=99=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jest.config.ts | 4 +--- package.json | 1 + rollup.config.js | 2 ++ tsconfig.json | 1 + yarn.lock | 7 +++++++ 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/jest.config.ts b/jest.config.ts index 274046d..04ede1a 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -6,9 +6,7 @@ const config: JestConfigWithTsJest = { clearMocks: true, collectCoverageFrom: [ 'src/**/*', - // TODO: Write tests for these files when they are less likely to change '!src/index.ts', - '!src/linters/index.ts', ], coverageDirectory: 'coverage', coverageThreshold: { @@ -36,7 +34,7 @@ const config: JestConfigWithTsJest = { }, transformIgnorePatterns: [ './node_modules/(?!(chalk)/)', - ] + ], } export default config diff --git a/package.json b/package.json index fad64a7..9d117ec 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "@babel/core": "7.25.2", "@babel/preset-env": "7.25.4", "@babel/preset-typescript": "7.24.7", + "@rollup/plugin-json": "6.1.0", "@rollup/plugin-node-resolve": "15.2.3", "@rollup/plugin-typescript": "11.1.6", "@types/eslint": "9.6.1", diff --git a/rollup.config.js b/rollup.config.js index f18a0d7..532b67c 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,6 +1,7 @@ import { readFileSync } from 'node:fs' import { resolve } from 'node:path' +import json from '@rollup/plugin-json' import { nodeResolve } from '@rollup/plugin-node-resolve' import typescript from '@rollup/plugin-typescript' import copy from 'rollup-plugin-copy' @@ -37,6 +38,7 @@ export default [{ format: 'es', }, plugins: [ + json(), nodeResolve({ preferBuiltins: true, }), diff --git a/tsconfig.json b/tsconfig.json index b93a333..943869b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,6 +10,7 @@ "@Types": ["./src/types/index.ts"], "@Utils/*": ["./src/utils/*"], }, + "resolveJsonModule": true, "rootDir": "./", "strict": true, "target": "ESNext" diff --git a/yarn.lock b/yarn.lock index 54b58fb..8066fbe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1722,6 +1722,13 @@ resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== +"@rollup/plugin-json@6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-json/-/plugin-json-6.1.0.tgz#fbe784e29682e9bb6dee28ea75a1a83702e7b805" + integrity sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA== + dependencies: + "@rollup/pluginutils" "^5.1.0" + "@rollup/plugin-node-resolve@15.2.3": version "15.2.3" resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.2.3.tgz#e5e0b059bd85ca57489492f295ce88c2d4b0daf9"