Skip to content

Commit 9c89f16

Browse files
authored
Merge pull request #38 from ITZSHOAIB/develop
Develop
2 parents 61825cd + e109187 commit 9c89f16

File tree

9 files changed

+33
-10
lines changed

9 files changed

+33
-10
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# chukti
22

3+
## 0.0.12
4+
5+
### Patch Changes
6+
7+
- [#36](https://github.com/ITZSHOAIB/chukti/pull/36) [`2b1d16f`](https://github.com/ITZSHOAIB/chukti/commit/2b1d16ff990193537b9dd8ca90f06c06363a1b0f) Thanks [@ITZSHOAIB](https://github.com/ITZSHOAIB)! - feat: chukti config changed from json to ts
8+
39
## 0.0.11
410

511
### Patch Changes

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "chukti",
3-
"version": "0.0.11",
3+
"version": "0.0.12",
44
"description": "A library designed to simplify the smart contracts testing using human-readable syntax",
55
"author": "Sohab Sk",
66
"license": "MIT",
@@ -84,7 +84,11 @@
8484
"typescript": "^5.1.6",
8585
"vitepress": "^1.3.4"
8686
},
87-
"files": ["dist", "sample-projects", "src"],
87+
"files": [
88+
"dist",
89+
"sample-projects",
90+
"src"
91+
],
8892
"keywords": [
8993
"Smart contract test",
9094
"Smart contract test cucumber",

sample-projects/forge-anvil/chukti.config.json

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { defineConfig, ProjectType } from "chukti";
2+
3+
export default defineConfig({
4+
projectType: ProjectType.ForgeAnvil,
5+
});

sample-projects/hardhat-viem/chukti.config.json

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { defineConfig, ProjectType } from "chukti";
2+
3+
export default defineConfig({
4+
projectType: ProjectType.HardhatViem,
5+
});

src/config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import type { ChuktiConfig } from "./internal/types.js";
2+
3+
export const defineConfig = (config: ChuktiConfig): ChuktiConfig => {
4+
return config;
5+
};

src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
export * from "./cucumber/index.js";
22
export * from "./local-blockchain/index.js";
33
export * from "./viem/index.js";
4+
export * from "./config.js";
5+
6+
import { ChuktiConfig, ProjectType } from "./internal/types.js";
7+
export { ChuktiConfig, ProjectType };

src/internal/utils/projectConfig.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ export const getProjectType = (projectPath: string): ProjectType | null => {
99
return projectTypeCache.get(projectPath) ?? null;
1010
}
1111

12-
const configFilePath = path.join(projectPath, "chukti.config.json");
12+
const configFilePath = path.join(projectPath, "chukti.config.ts");
1313
if (!fs.existsSync(configFilePath)) {
1414
return null;
1515
}
1616

17-
const config: ChuktiConfig = fs.readJsonSync(configFilePath);
17+
const config: ChuktiConfig = require(configFilePath).default;
1818
projectTypeCache.set(projectPath, config.projectType);
1919
return config.projectType;
2020
};

0 commit comments

Comments
 (0)