-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
181 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
node_modules/ | ||
coverage/ | ||
dist/ | ||
stub/package-lock.json |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules/ | ||
coverage/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# KoalaTs | ||
|
||
This is the skeleton for a new KoalaTs project. | ||
|
||
## Getting Started | ||
|
||
Install the dependencies: | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
Start the development server: | ||
|
||
```bash | ||
npm start | ||
``` | ||
|
||
To run the tests: | ||
|
||
```bash | ||
npm test | ||
``` | ||
|
||
To build the project: | ||
|
||
```bash | ||
npm run build | ||
``` | ||
|
||
Then you can serve the `dist` folder with any static server. | ||
|
||
```bash | ||
npm run serve | ||
``` | ||
|
||
## Documentation | ||
|
||
You can find the KoalaTs documentation [here](https://koala-ts.github.io/docs/). |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"name": "koala-app", | ||
"version": "1.0.0", | ||
"description": "The skeleton application for Koala-Ts application", | ||
"keywords": [ | ||
"Koalats", | ||
"Framework" | ||
], | ||
"license": "ISC", | ||
"author": "", | ||
"type": "module", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"start": "tsx watch src/index.ts", | ||
"test": "vitest run --coverage", | ||
"build": "tsc && tsc-alias", | ||
"serve": "node dist/index.js" | ||
}, | ||
"dependencies": { | ||
"@koala-ts/framework": "^0.1.0" | ||
}, | ||
"devDependencies": { | ||
"tsc-alias": "^1.8.10", | ||
"typescript": "^5.7.2", | ||
"vitest": "^2.1.8", | ||
"@vitest/coverage-v8": "^2.1.8", | ||
"tsx": "^4.19.2", | ||
"supertest": "^7.0.0", | ||
"@types/supertest": "^6.0.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { HomeController } from '../controller/HomeController'; | ||
import { type IKoalaConfig } from '@koala-ts/framework/dist/config/types'; | ||
|
||
export const appConfig: IKoalaConfig = { | ||
controllers: [ | ||
HomeController, | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { type IScope, Route } from '@koala-ts/framework'; | ||
|
||
export class HomeController { | ||
@Route({ method: 'GET', path: '/' }) | ||
index(scope: IScope): void { | ||
scope.response.body = 'KoalaTS: Effortlessly elegant, relentlessly efficient. 🎩🐨'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { create } from '@koala-ts/framework'; | ||
import { appConfig } from './config/app'; | ||
|
||
const app = create(appConfig); | ||
|
||
app.listen(3000); | ||
|
||
console.log('Server is running on http://localhost:3000'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { beforeEach, describe, test } from 'vitest'; | ||
import { ITestAgent, testAgent } from '@koala-ts/framework'; | ||
import { appConfig } from '../src/config/app'; | ||
|
||
describe('Home Page', function () { | ||
let agent: ITestAgent; | ||
|
||
beforeEach(function () { | ||
agent = testAgent(appConfig); | ||
}); | ||
|
||
test('it should return welcome message', function () { | ||
return agent.get('/').expect(200, 'KoalaTS: Effortlessly elegant, relentlessly efficient. 🎩🐨'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"compilerOptions": { | ||
"esModuleInterop": true, | ||
"target": "ESNext", | ||
"allowJs": false, | ||
"resolveJsonModule": true, | ||
"moduleDetection": "force", | ||
"isolatedModules": true, | ||
"module": "Preserve", | ||
"moduleResolution": "Node", | ||
"strict": true, | ||
"noUncheckedIndexedAccess": true, | ||
"noImplicitOverride": true, | ||
"noImplicitAny": true, | ||
"rootDir": "./src", | ||
"outDir": "./dist", | ||
"strictNullChecks": true, | ||
"allowSyntheticDefaultImports": true, | ||
"baseUrl": ".", | ||
"experimentalDecorators": true, | ||
"emitDecoratorMetadata": true | ||
}, | ||
"include": [ | ||
"src/**/*.ts" | ||
], | ||
"exclude": [ | ||
"node_modules", | ||
"dist" | ||
], | ||
"tsc-alias": { | ||
"resolveFullPaths": true, | ||
"verbose": false | ||
}, | ||
"types": [ | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { configDefaults, defineConfig } from 'vitest/config'; | ||
|
||
export default defineConfig({ | ||
test: { | ||
coverage: { | ||
exclude: [ | ||
...configDefaults.exclude, | ||
'**/config/**', | ||
'src/index.ts', | ||
'**/tests/**', | ||
'**/types.ts', | ||
], | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters