@travetto/web-rpc 8.0.0-alpha.0 → 8.0.0-alpha.1
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 +4 -4
- package/src/service.ts +3 -2
- package/support/cli.web_rpc-client.ts +8 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/web-rpc",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "RPC support for a Web Application",
|
|
6
6
|
"keywords": [
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"directory": "module/web-rpc"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@travetto/config": "^8.0.0-alpha.
|
|
31
|
-
"@travetto/schema": "^8.0.0-alpha.
|
|
32
|
-
"@travetto/web": "^8.0.0-alpha.
|
|
30
|
+
"@travetto/config": "^8.0.0-alpha.1",
|
|
31
|
+
"@travetto/schema": "^8.0.0-alpha.1",
|
|
32
|
+
"@travetto/web": "^8.0.0-alpha.1"
|
|
33
33
|
},
|
|
34
34
|
"travetto": {
|
|
35
35
|
"displayName": "Web RPC Support"
|
package/src/service.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import fs from 'node:fs/promises';
|
|
3
3
|
|
|
4
|
-
import { Inject, Injectable } from '@travetto/di';
|
|
4
|
+
import { Inject, Injectable, PostConstruct } from '@travetto/di';
|
|
5
5
|
import { ControllerRegistryIndex } from '@travetto/web';
|
|
6
6
|
import { Runtime, RuntimeIndex } from '@travetto/runtime';
|
|
7
7
|
import { ManifestModuleUtil } from '@travetto/manifest';
|
|
@@ -16,7 +16,8 @@ export class WebRpcClientGeneratorService {
|
|
|
16
16
|
@Inject()
|
|
17
17
|
config: WebRpcConfig;
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
@PostConstruct()
|
|
20
|
+
async initialRender(): Promise<void> {
|
|
20
21
|
this.render();
|
|
21
22
|
}
|
|
22
23
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
|
|
3
3
|
import { Env } from '@travetto/runtime';
|
|
4
|
-
import { CliCommand, type CliCommandShape, CliValidationResultError } from '@travetto/cli';
|
|
4
|
+
import { CliCommand, type CliCommandShape, CliModuleFlag, CliProfilesFlag, CliValidationResultError } from '@travetto/cli';
|
|
5
5
|
import { DependencyRegistryIndex } from '@travetto/di';
|
|
6
6
|
import { Registry } from '@travetto/registry';
|
|
7
|
-
import { Ignore } from '@travetto/schema';
|
|
8
7
|
|
|
9
8
|
import type { WebRpcClient } from '../src/config.ts';
|
|
10
9
|
import { WebRpcClientGeneratorService } from '../src/service.ts';
|
|
@@ -12,13 +11,16 @@ import { WebRpcClientGeneratorService } from '../src/service.ts';
|
|
|
12
11
|
/**
|
|
13
12
|
* Generate the web-rpc client
|
|
14
13
|
*/
|
|
15
|
-
@CliCommand(
|
|
14
|
+
@CliCommand()
|
|
16
15
|
export class CliWebRpcCommand implements CliCommandShape {
|
|
17
16
|
|
|
18
|
-
@
|
|
17
|
+
@CliProfilesFlag()
|
|
18
|
+
profile: string[];
|
|
19
|
+
|
|
20
|
+
@CliModuleFlag({ short: 'm' })
|
|
19
21
|
module: string;
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
finalize(): void {
|
|
22
24
|
Env.DEBUG.set(false);
|
|
23
25
|
}
|
|
24
26
|
|
|
@@ -33,7 +35,7 @@ export class CliWebRpcCommand implements CliCommandShape {
|
|
|
33
35
|
} else {
|
|
34
36
|
if (!output) {
|
|
35
37
|
throw new CliValidationResultError(this, [
|
|
36
|
-
{ message: 'output is required when type is not `config`', source: 'arg' }
|
|
38
|
+
{ message: 'output is required when type is not `config`', source: 'arg', kind: 'missing', path: 'output' }
|
|
37
39
|
]);
|
|
38
40
|
}
|
|
39
41
|
output = path.resolve(output);
|