Skip to content

Commit 41fc803

Browse files
committed
Restructure the project
1 parent 4f8f1ca commit 41fc803

File tree

7 files changed

+37
-19
lines changed

7 files changed

+37
-19
lines changed

.gitignore

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
/dist/*
2-
!/dist/.gitkeep
1+
/dist
32
/node_modules
4-
/wordpress
5-
/server
6-
/export
7-
/composer.lock
83
.DS_Store
9-
/.env
10-
/.ENV
114
*.log
12-
13-
/vendor/
5+
npm-debug.log*
6+
yarn-debug.log*
7+
yarn-error.log*
8+
.env
9+
.ENV
10+
/.idea/*
11+
.vscode/*
12+
coverage/
13+
vendor/
1414
mix-manifest.json
1515
build
16-
17-
/.idea/*
18-
/*.js

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,14 @@ try {
168168
}
169169
```
170170

171+
## Project Structure
172+
173+
The project is organized into the following directories:
174+
175+
- `src/` - Source TypeScript files
176+
- `dist/` - Compiled JavaScript output (generated during build)
177+
- `test/` - Test files
178+
171179
## License
172180

173181
Apache-2.0

jest.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
2+
module.exports = {
3+
preset: 'ts-jest',
4+
testEnvironment: 'node',
5+
transform: {
6+
'^.+\\.tsx?$': 'ts-jest',
7+
},
8+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
9+
testMatch: ['**/test/**/*.test.ts'],
10+
};

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"name": "@timkit/json-to-php",
33
"version": "1.1.0",
4-
"main": "index.js",
4+
"main": "dist/index.js",
5+
"types": "dist/index.d.ts",
56
"scripts": {
67
"test": "npm run build && jest",
78
"build": "./node_modules/typescript/bin/tsc",
File renamed without changes.

index.test.ts renamed to test/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {jsonToPhp} from './';
1+
import {jsonToPhp} from '../src';
22

33
describe('jsonToPhp', () => {
44
test('convert simple JSON object', () => {

tsconfig.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@
77
"esModuleInterop": true,
88
"skipLibCheck": true,
99
"strict": true,
10-
"isolatedModules": true
10+
"isolatedModules": true,
11+
"outDir": "./dist",
12+
"declaration": true
1113
},
1214
"include": [
13-
"*.ts"
15+
"src/**/*.ts"
1416
],
1517
"exclude": [
1618
"node_modules",
17-
"*.test.ts",
18-
"*.test.js"
19+
"test",
20+
"dist"
1921
]
2022
}

0 commit comments

Comments
 (0)