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.
- package/LICENSE +21 -0
- package/dist/index.cjs +271 -282
- package/dist/index.mjs +248 -281
- package/package.json +22 -9
- package/templates/cli/bin.js +1 -1
- package/templates/cli/package.jsonc +25 -0
- package/templates/cli/rolldown.config.ts +14 -0
- package/templates/cli/src/main.ts +14 -25
- package/templates/common/tsconfig.json +1 -1
- package/templates/{common → http}/package.jsonc +2 -5
- package/templates/{common → http}/vite.config.ts +1 -1
- package/templates/cli/src/controllers/app.controller.ts +0 -10
- /package/{bin.js → bin.cjs} +0 -0
|
@@ -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 {
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
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
|
-
|
|
18
|
+
run()
|
|
@@ -21,10 +21,7 @@
|
|
|
21
21
|
//=END IF
|
|
22
22
|
//=IF (wf)
|
|
23
23
|
"@moostjs/event-wf": "^{{ version }}",
|
|
24
|
-
"@wooksjs/http-static": "^0.5.
|
|
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
|
|
33
|
+
"vite": "^6.1.0"
|
|
37
34
|
}
|
|
38
35
|
}
|
/package/{bin.js → bin.cjs}
RENAMED
|
File without changes
|