@kanjijs/cli 0.2.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -0
- package/dist/index.js +19817 -0
- package/package.json +29 -0
- package/templates/starter/README.md +34 -0
- package/templates/starter/package.json +24 -0
- package/templates/starter/src/app.controller.ts +12 -0
- package/templates/starter/src/app.module.ts +9 -0
- package/templates/starter/src/app.service.ts +8 -0
- package/templates/starter/src/main.ts +12 -0
- package/templates/starter/tsconfig.json +12 -0
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kanjijs/cli",
|
|
3
|
+
"version": "0.2.0-beta.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"bin": {
|
|
6
|
+
"kanji": "./dist/index.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"README.md",
|
|
11
|
+
"LICENSE",
|
|
12
|
+
"templates"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "bun build src/index.ts --outdir dist --target bun",
|
|
16
|
+
"watch": "bun build src/index.ts --outdir dist --target bun --watch"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@inquirer/prompts": "^8.2.0",
|
|
20
|
+
"commander": "^11.0.0",
|
|
21
|
+
"fs-extra": "^11.3.3",
|
|
22
|
+
"picocolors": "^1.1.1",
|
|
23
|
+
"openapi-typescript-codegen": "^0.25.0",
|
|
24
|
+
"@kanjijs/openapi": "workspace:*"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/fs-extra": "^11.0.4"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Kanjijs Project
|
|
2
|
+
|
|
3
|
+
Welcome to your new Kanjijs Framework project!
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
1. **Install dependencies**:
|
|
8
|
+
```bash
|
|
9
|
+
bun install
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
2. **Start the development server**:
|
|
13
|
+
```bash
|
|
14
|
+
bun run dev
|
|
15
|
+
```
|
|
16
|
+
To run on a different port:
|
|
17
|
+
```bash
|
|
18
|
+
PORT=4000 bun run dev
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## CLI Commands
|
|
22
|
+
|
|
23
|
+
Use the globally installed CLI to generate resources:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
kanjijs g resource users
|
|
27
|
+
```
|
|
28
|
+
This will:
|
|
29
|
+
* Create `src/modules/users` with Controller, Service, and Module.
|
|
30
|
+
* **Automatically** import `UsersModule` into your `src/app.module.ts`.
|
|
31
|
+
|
|
32
|
+
## Documentation
|
|
33
|
+
|
|
34
|
+
For more documentation, visit the [Kanjijs Framework Repository](https://github.com/kanjijs-framework).
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "kanjijs-starter",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "bun run --watch src/main.ts",
|
|
7
|
+
"start": "bun run src/main.ts"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@kanjijs/core": "0.1.0",
|
|
11
|
+
"@kanjijs/platform-bun": "0.1.0",
|
|
12
|
+
"@kanjijs/platform-hono": "0.1.0",
|
|
13
|
+
"@kanjijs/auth": "0.1.0",
|
|
14
|
+
"@kanjijs/logger": "0.1.0",
|
|
15
|
+
"@kanjijs/throttler": "0.1.0",
|
|
16
|
+
"hono": "^4.0.0",
|
|
17
|
+
"reflect-metadata": "^0.2.0",
|
|
18
|
+
"zod": "^3.0.0"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@types/bun": "latest",
|
|
22
|
+
"bun-types": "latest"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Controller, Get } from "@kanjijs/core";
|
|
2
|
+
import { AppService } from "./app.service";
|
|
3
|
+
|
|
4
|
+
@Controller()
|
|
5
|
+
export class AppController {
|
|
6
|
+
constructor(private readonly appService: AppService) {}
|
|
7
|
+
|
|
8
|
+
@Get("/")
|
|
9
|
+
getHello() {
|
|
10
|
+
return this.appService.getHello();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { KanjijsAdapter } from "@kanjijs/platform-hono";
|
|
2
|
+
import { AppModule } from "./app.module";
|
|
3
|
+
|
|
4
|
+
const app = KanjijsAdapter.create(AppModule);
|
|
5
|
+
const port = 3000;
|
|
6
|
+
|
|
7
|
+
console.log(`Server running on port ${port}`);
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
port,
|
|
11
|
+
fetch: app.fetch
|
|
12
|
+
};
|