Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
nana4rider committed Jan 28, 2025
1 parent 4d29c14 commit bdcc28d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
9 changes: 6 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ const tsconfig = JSON.parse(fs.readFileSync("./tsconfig.json", "utf-8"));
/** @type {import('ts-jest').JestConfigWithTsJest} **/
export default {
testEnvironment: "node",
moduleNameMapper: pathsToModuleNameMapper(tsconfig.compilerOptions.paths, {
prefix: "<rootDir>/",
}),
moduleNameMapper: {
...pathsToModuleNameMapper(tsconfig.compilerOptions.paths, {
prefix: "<rootDir>/",
}),
"package.json": "<rootDir>/package.json",
},
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
transform: {
"^.+\\.(t|j)sx?$": "@swc/jest",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wisun2mqtt",
"version": "1.1.2",
"version": "1.1.3",
"author": "nana4rider",
"license": "ISC",
"main": "dist/index.js",
Expand All @@ -10,7 +10,7 @@
"dev": "tsx --env-file=.env src/index.ts",
"start": "node dist/index",
"build": "node build.js",
"lint": "tsc --noEmit && eslint --max-warnings 0 && prettier . --check",
"lint": "tsc && eslint --max-warnings 0 && prettier . --check",
"lint:fix": "eslint --fix && prettier . --write",
"test": "jest",
"prepare": "husky"
Expand Down
4 changes: 2 additions & 2 deletions src/payload/builder.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Entity } from "@/entity";
import env from "@/env";
import { getTopic, TopicType } from "@/payload/topic";
import type { JsonObject } from "type-fest";
import {
homepage as packageHomepage,
name as packageName,
version as packageVersion,
} from "~/package.json";
} from "package.json";
import type { JsonObject } from "type-fest";

export type Payload = JsonObject;

Expand Down
9 changes: 5 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ES2022",
"target": "es2022",
"module": "es2022",
"baseUrl": ".",
"outDir": "./dist",
"strict": true,
"moduleResolution": "node",
"esModuleInterop": true,
"skipLibCheck": true,
"noEmit": true,
"resolveJsonModule": true,
"paths": {
"@/*": ["src/*"],
"~/*": ["*"]
"@/*": ["src/*"]
}
}
}

0 comments on commit bdcc28d

Please sign in to comment.