create-moost 0.5.21 → 0.5.22

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.
@@ -0,0 +1,14 @@
1
+ import { defineConfig } from 'rolldown'
2
+ import swc from 'unplugin-swc';
3
+
4
+ export default defineConfig({
5
+ input: 'src/main.ts',
6
+ output: {
7
+ format: 'cjs',
8
+ file: 'dist/main.cjs',
9
+ },
10
+ external: ['@moostjs/event-cli', 'moost'],
11
+ plugins: [
12
+ swc.rolldown(),
13
+ ]
14
+ })
@@ -1,29 +1,18 @@
1
- import { MoostCli, cliHelpInterceptor } from '@moostjs/event-cli'
2
- import { Moost } from 'moost'
3
- import { AppController } from './controllers/app.controller'
1
+ import { CliApp, Controller, Cli, Param } from '@moostjs/event-cli'
4
2
 
5
- function cli() {
6
- const app = new Moost()
7
-
8
- app.applyGlobalInterceptors(
9
- cliHelpInterceptor({
10
- colors: true,
11
- lookupLevel: 3,
12
- })
13
- )
14
-
15
- app.registerControllers(AppController)
16
- app.adapter(new MoostCli({
17
- debug: false,
18
- wooksCli: {
19
- cliHelp: { name: '{{ packageName }}' },
20
- },
21
- globalCliOptions: [
22
- { keys: ['help'], description: 'Display instructions for the command.', type: Boolean },
23
- ],
24
- }))
3
+ @Controller()
4
+ class Commands {
5
+ @Cli('hello/:name')
6
+ greet(@Param('name') name: string) {
7
+ return `Hello, ${name}!`
8
+ }
9
+ }
25
10
 
26
- void app.init()
11
+ function run() {
12
+ new CliApp()
13
+ .controllers(Commands)
14
+ .useHelp({ name: '{{ packageName }}'})
15
+ .useOptions([{ keys: ['help'], description: 'Display instructions for the command.' }])
27
16
  }
28
17
 
29
- cli()
18
+ run()
@@ -17,5 +17,5 @@
17
17
  "useDefineForClassFields": true
18
18
  },
19
19
  "exclude": ["node_modules", "dist"],
20
- "include": ["src", "vite.config.ts"]
20
+ "include": ["src", "*.config.ts"]
21
21
  }
@@ -21,10 +21,7 @@
21
21
  //=END IF
22
22
  //=IF (wf)
23
23
  "@moostjs/event-wf": "^{{ version }}",
24
- "@wooksjs/http-static": "^0.5.18",
25
- //=END IF
26
- //=IF (type === 'cli')
27
- "@moostjs/event-cli": "^{{ version }}",
24
+ "@wooksjs/http-static": "^0.5.25",
28
25
  //=END IF
29
26
  "moost": "^{{ version }}"
30
27
  },
@@ -33,6 +30,6 @@
33
30
  "@types/node": "^22.10.2",
34
31
  "typescript": "^5.7.2",
35
32
  "unplugin-swc": "^1.5.1",
36
- "vite": "^6.0.5"
33
+ "vite": "^6.1.0"
37
34
  }
38
35
  }
@@ -1,4 +1,4 @@
1
- import { defineConfig, type Plugin } from "vite";
1
+ import { defineConfig } from "vite";
2
2
  import swc from 'unplugin-swc';
3
3
  import { moostVite } from "@moostjs/vite";
4
4
 
@@ -1,10 +0,0 @@
1
- import { Cli } from '@moostjs/event-cli'
2
- import { Controller, Param } from 'moost'
3
-
4
- @Controller()
5
- export class AppController {
6
- @Cli('hello/:name')
7
- greet(@Param('name') name: string) {
8
- return `Hello, ${name}!`
9
- }
10
- }
File without changes