@gunshi/plugin-renderer 0.32.0 → 0.34.0

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.
Files changed (3) hide show
  1. package/README.md +20 -13
  2. package/lib/index.js +10 -3
  3. package/package.json +5 -7
package/README.md CHANGED
@@ -38,9 +38,13 @@ const command = define({
38
38
  description: 'Deploy your application',
39
39
  args: {
40
40
  environment: {
41
- type: 'string',
42
- description: 'Target environment',
43
- required: true
41
+ type: 'positional',
42
+ description: 'Target environment'
43
+ },
44
+ region: {
45
+ type: 'positional',
46
+ required: false,
47
+ description: 'Optional deployment region'
44
48
  },
45
49
  force: {
46
50
  type: 'boolean',
@@ -48,9 +52,10 @@ const command = define({
48
52
  description: 'Force deployment without confirmation'
49
53
  }
50
54
  },
51
- examples: '$ deploy production --force',
55
+ examples: ['$ deploy production --force', '$ deploy production us-east-1 --force'],
52
56
  run: async ctx => {
53
- console.log(`Deploying to ${ctx.values.environment}...`)
57
+ const region = ctx.values.region ? ` in ${ctx.values.region}` : ''
58
+ console.log(`Deploying to ${ctx.values.environment}${region}...`)
54
59
  }
55
60
  })
56
61
 
@@ -94,18 +99,20 @@ When a user runs `--help`, the output looks like:
94
99
  ```sh
95
100
  deploy - Deploy your application
96
101
 
97
- USAGE
98
- $ deploy [options] <environment>
102
+ USAGE:
103
+ deploy <OPTIONS> <environment> [<region>]
99
104
 
100
- ARGUMENTS
101
- environment Target environment
105
+ ARGUMENTS:
106
+ environment Target environment
107
+ region Optional deployment region
102
108
 
103
- OPTIONS
104
- -f, --force Force deployment without confirmation
105
- -h, --help Display this help message
109
+ OPTIONS:
110
+ -f, --force Force deployment without confirmation
111
+ -h, --help Display this help message
106
112
 
107
- EXAMPLES
113
+ EXAMPLES:
108
114
  $ deploy production --force
115
+ $ deploy production us-east-1 --force
109
116
  ```
110
117
 
111
118
  ### Exported Functions
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ANONYMOUS_COMMAND_NAME, plugin } from "@gunshi/plugin";
2
- //#region ../../node_modules/.pnpm/args-tokens@0.25.0/node_modules/args-tokens/lib/utils.js
2
+ //#region ../../node_modules/.pnpm/args-tokens@0.26.1/node_modules/args-tokens/lib/utils.js
3
3
  /**
4
4
  * Entry point of utils.
5
5
  *
@@ -595,11 +595,18 @@ async function generatePositionalArgsUsage(ctx) {
595
595
  function generatePositionalSymbols(args) {
596
596
  return hasPositionalArgs(args) ? getPositionalArgs(args).map(([name, arg]) => {
597
597
  const elements = [];
598
- if (!arg.multiple || arg.required) elements.push(`<${name}>`);
599
- if (arg.multiple) elements.push(`[<${name}> ...]`);
598
+ if (arg.multiple) {
599
+ if (arg.required) elements.push(`<${name}>`);
600
+ elements.push(`[<${name}> ...]`);
601
+ } else elements.push(isRequiredSinglePositionalArg(arg) ? `<${name}>` : `[<${name}>]`);
600
602
  return elements.join(" ");
601
603
  }).join(" ") : "";
602
604
  }
605
+ function isRequiredSinglePositionalArg(arg) {
606
+ if (arg.required === true) return true;
607
+ if (arg.required === false) return false;
608
+ return arg.default == null;
609
+ }
603
610
  //#endregion
604
611
  //#region src/validation.ts
605
612
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gunshi/plugin-renderer",
3
3
  "description": "usage renderer plugin for gunshi",
4
- "version": "0.32.0",
4
+ "version": "0.34.0",
5
5
  "author": {
6
6
  "name": "kazuya kawaguchi",
7
7
  "email": "kawakazu80@gmail.com"
@@ -53,10 +53,10 @@
53
53
  }
54
54
  },
55
55
  "dependencies": {
56
- "@gunshi/plugin": "0.32.0"
56
+ "@gunshi/plugin": "0.34.0"
57
57
  },
58
58
  "peerDependencies": {
59
- "@gunshi/plugin-i18n": "0.32.0"
59
+ "@gunshi/plugin-i18n": "0.34.0"
60
60
  },
61
61
  "devDependencies": {
62
62
  "deno": "^2.7.14",
@@ -64,13 +64,11 @@
64
64
  "jsr-exports-lint": "^0.4.2",
65
65
  "publint": "^0.3.20",
66
66
  "tsdown": "0.21.0",
67
- "typedoc": "^0.28.19",
68
- "typedoc-plugin-markdown": "^4.11.0",
69
- "@gunshi/shared": "0.32.0"
67
+ "@gunshi/shared": "0.34.0"
70
68
  },
71
69
  "scripts": {
72
70
  "build": "tsdown",
73
- "build:docs": "typedoc --excludeInternal",
71
+ "build:docs": "tsx ../../scripts/api-references.ts",
74
72
  "lint:jsr": "jsr publish --dry-run --allow-dirty",
75
73
  "typecheck:deno": "deno check --import-map=../../importmap.json ./src"
76
74
  }