Skip to content

Commit

Permalink
fix: json read and ts error
Browse files Browse the repository at this point in the history
  • Loading branch information
winchesHe committed Mar 29, 2024
1 parent f118e86 commit ec98c8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/helpers/package.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { readFileSync } from 'fs';

import { type NextUIComponents, nextUIComponents } from 'src/constants/component';

import { Logger } from './logger';
Expand All @@ -10,7 +12,7 @@ export async function getPackageInfo(packagePath: string) {
let pkg;

try {
pkg = await import(packagePath);
pkg = JSON.parse(readFileSync(packagePath, 'utf-8'));
} catch (error) {
Logger.prefix('error', `Error reading package.json file: ${packagePath} \nError: ${error}`);
}
Expand Down
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"compilerOptions": {
"module": "ESNext",
"baseUrl": ".",
"rootDir": ".",
"lib": ["ESNext"],
"target": "ES2019",
"moduleDetection": "auto",
Expand Down Expand Up @@ -32,7 +33,8 @@
"verbatimModuleSyntax": true,
"noImplicitAny": false,
"paths": {
"@helpers/*": ["src/helpers/*"]
"@helpers/*": ["src/helpers/*"],
"src/*": ["src/*"]
}
},
"include": ["**/*.js", "**/*.cjs", "**/*.mjs", "**/*.ts", "**/*.tsx", "**/*.d.ts"],
Expand Down

0 comments on commit ec98c8b

Please sign in to comment.