create-moost 0.5.22 → 0.5.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-moost",
3
- "version": "0.5.22",
3
+ "version": "0.5.23",
4
4
  "description": "create-moost",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -46,8 +46,8 @@
46
46
  "@prostojs/rewrite": "^0.1.1",
47
47
  "@wooksjs/event-cli": "^0.5.25",
48
48
  "prompts": "^2.4.2",
49
- "@moostjs/event-cli": "^0.5.22",
50
- "moost": "^0.5.22"
49
+ "@moostjs/event-cli": "^0.5.23",
50
+ "moost": "^0.5.23"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@moostjs/vite": "^0.5.21",
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- require('./dist/main.cjs');
2
+ import('./dist/main.js');
@@ -2,12 +2,20 @@
2
2
  "name": "{{ packageName }}",
3
3
  "version": "1.0.0",
4
4
  "description": "",
5
- "main": "dist/main.cjs",
5
+ "main": "dist/main.js",
6
+ "type": "module",
7
+ "bin": {
8
+ "{{ packageName }}": "./bin.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "bin.js"
13
+ ],
6
14
  "scripts": {
7
15
  //=IF (domelint)
8
16
  "postinstall": "npx do-me-lint",
9
17
  //=END IF
10
- "dev": "pnpm build && node ./dist/main.cjs",
18
+ "dev": "pnpm build && node ./dist/main.js",
11
19
  "build": "rolldown build -c rolldown.config.ts",
12
20
  "test": "echo \"Error: no test specified\" && exit 1"
13
21
  },
@@ -4,8 +4,8 @@ import swc from 'unplugin-swc';
4
4
  export default defineConfig({
5
5
  input: 'src/main.ts',
6
6
  output: {
7
- format: 'cjs',
8
- file: 'dist/main.cjs',
7
+ format: 'esm',
8
+ file: 'dist/main.js',
9
9
  },
10
10
  external: ['@moostjs/event-cli', 'moost'],
11
11
  plugins: [
@@ -1,10 +1,16 @@
1
- import { CliApp, Controller, Cli, Param } from '@moostjs/event-cli'
1
+ import { CliApp, Controller, Cli, Param, CliExample, CliOption } from '@moostjs/event-cli'
2
2
 
3
3
  @Controller()
4
4
  class Commands {
5
+ @CliExample('hello world', 'Prints "Hello, world!"')
6
+ @CliExample('hello world -u', 'Prints "HELLO, WORLD!"')
5
7
  @Cli('hello/:name')
6
- greet(@Param('name') name: string) {
7
- return `Hello, ${name}!`
8
+ greet(
9
+ @Param('name') name: string,
10
+ @CliOption('uppercase', 'u') uppercase: boolean,
11
+ ) {
12
+ const output = `Hello, ${name}!`
13
+ return uppercase ? output.toUpperCase() : output
8
14
  }
9
15
  }
10
16
 
@@ -13,6 +19,7 @@ function run() {
13
19
  .controllers(Commands)
14
20
  .useHelp({ name: '{{ packageName }}'})
15
21
  .useOptions([{ keys: ['help'], description: 'Display instructions for the command.' }])
22
+ .start()
16
23
  }
17
24
 
18
25
  run()