@travetto/cli 8.0.0-alpha.3 → 8.0.0-alpha.5
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 +1 -1
- package/package.json +3 -3
- package/src/parse.ts +1 -1
- package/src/registry/decorator.ts +2 -6
package/README.md
CHANGED
|
@@ -542,7 +542,7 @@ A simple example of the validation can be found in the `doc` command:
|
|
|
542
542
|
```typescript
|
|
543
543
|
@Validator(async (cmd) => {
|
|
544
544
|
const docFile = path.resolve(cmd.input);
|
|
545
|
-
if (!(await fs.stat(docFile
|
|
545
|
+
if (!(await fs.stat(docFile, { throwIfNoEntry: false }))) {
|
|
546
546
|
return { message: `input: ${cmd.input} does not exist`, path: 'input', source: 'flag', kind: 'invalid' };
|
|
547
547
|
}
|
|
548
548
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/cli",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI infrastructure for Travetto framework",
|
|
6
6
|
"keywords": [
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"directory": "module/cli"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@travetto/schema": "^8.0.0-alpha.
|
|
33
|
-
"@travetto/terminal": "^8.0.0-alpha.
|
|
32
|
+
"@travetto/schema": "^8.0.0-alpha.3",
|
|
33
|
+
"@travetto/terminal": "^8.0.0-alpha.3"
|
|
34
34
|
},
|
|
35
35
|
"travetto": {
|
|
36
36
|
"displayName": "Command Line Interface",
|
package/src/parse.ts
CHANGED
|
@@ -95,7 +95,7 @@ export class CliParseUtil {
|
|
|
95
95
|
|
|
96
96
|
const file = path.resolve(relativePath);
|
|
97
97
|
|
|
98
|
-
if (!await fs.stat(file
|
|
98
|
+
if (!await fs.stat(file, { throwIfNoEntry: false })) {
|
|
99
99
|
throw new Error(`Missing flag file: ${key}, unable to proceed`);
|
|
100
100
|
}
|
|
101
101
|
|
|
@@ -129,9 +129,7 @@ export function CliRestartOnChangeFlag(config: CliFlagOptions = {}) {
|
|
|
129
129
|
const cls = getClass(instance);
|
|
130
130
|
SchemaRegistryIndex.getForRegister(cls).registerField(property, {
|
|
131
131
|
...CliParseUtil.buildAliases(config),
|
|
132
|
-
description: 'Should the invocation automatically restart on source changes'
|
|
133
|
-
default: Runtime.localDevelopment,
|
|
134
|
-
required: { active: false },
|
|
132
|
+
description: 'Should the invocation automatically restart on source changes'
|
|
135
133
|
});
|
|
136
134
|
|
|
137
135
|
runBeforeMain(cls, (cmd: typeof instance) => CliUtil.runWithRestartOnChange(cmd[property]), true);
|
|
@@ -148,9 +146,7 @@ export function CliDebugIpcFlag(config: CliFlagOptions = {}) {
|
|
|
148
146
|
const cls = getClass(instance);
|
|
149
147
|
SchemaRegistryIndex.getForRegister(cls).registerField(property, {
|
|
150
148
|
...CliParseUtil.buildAliases(config, Env.TRV_DEBUG_IPC.key),
|
|
151
|
-
description: 'Should the invocation automatically restart on source changes'
|
|
152
|
-
default: Runtime.localDevelopment,
|
|
153
|
-
required: { active: false },
|
|
149
|
+
description: 'Should the invocation automatically restart on source changes'
|
|
154
150
|
});
|
|
155
151
|
|
|
156
152
|
runBeforeMain(cls,
|