@rsdk/cli.cmd.start 5.0.0-next.4 → 5.0.0-next.6
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/CHANGELOG.md +10 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/start-dry.cmd.d.ts +4 -0
- package/dist/start-dry.cmd.js +47 -0
- package/dist/start-dry.cmd.js.map +1 -0
- package/package.json +2 -2
- package/src/index.ts +2 -0
- package/src/start-dry.cmd.ts +35 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [5.0.0-next.6](https://github.com/R-Vision/rsdk/compare/v5.0.0-next.5...v5.0.0-next.6) (2024-07-16)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* added start:dry cmd ([#266](https://github.com/R-Vision/rsdk/issues/266)) ([091ece7](https://github.com/R-Vision/rsdk/commit/091ece7b2eed6f4705a86ef57875f0ba6c688a47))
|
|
11
|
+
|
|
12
|
+
## [5.0.0-next.5](https://github.com/R-Vision/rsdk/compare/v5.0.0-next.4...v5.0.0-next.5) (2024-07-16)
|
|
13
|
+
|
|
14
|
+
**Note:** Version bump only for package @rsdk/cli.cmd.start
|
|
15
|
+
|
|
6
16
|
## [5.0.0-next.4](https://github.com/R-Vision/rsdk/compare/v5.0.0-next.3...v5.0.0-next.4) (2024-07-11)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @rsdk/cli.cmd.start
|
package/dist/index.js
CHANGED
|
@@ -4,11 +4,13 @@ exports.Cmd = void 0;
|
|
|
4
4
|
const cli_common_1 = require("@rsdk/cli.common");
|
|
5
5
|
const start_cmd_1 = require("./start.cmd");
|
|
6
6
|
const start_dev_cmd_1 = require("./start-dev.cmd");
|
|
7
|
+
const start_dry_cmd_1 = require("./start-dry.cmd");
|
|
7
8
|
class StartRsdkCmd {
|
|
8
9
|
getCommands() {
|
|
9
10
|
return [
|
|
10
11
|
...(0, cli_common_1.getCommanderCommand)(start_cmd_1.StartCmd),
|
|
11
12
|
...(0, cli_common_1.getCommanderCommand)(start_dev_cmd_1.StartDevCmd),
|
|
13
|
+
...(0, cli_common_1.getCommanderCommand)(start_dry_cmd_1.StartDryCmd),
|
|
12
14
|
];
|
|
13
15
|
}
|
|
14
16
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,iDAAuD;AAGvD,2CAAuC;AACvC,mDAA8C;AAE9C,MAAM,YAAY;IAChB,WAAW;QACT,OAAO;YACL,GAAG,IAAA,gCAAmB,EAAC,oBAAQ,CAAC;YAChC,GAAG,IAAA,gCAAmB,EAAC,2BAAW,CAAC;SACpC,CAAC;IACJ,CAAC;CACF;AAEY,QAAA,GAAG,GAAG,IAAI,YAAY,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,iDAAuD;AAGvD,2CAAuC;AACvC,mDAA8C;AAC9C,mDAA8C;AAE9C,MAAM,YAAY;IAChB,WAAW;QACT,OAAO;YACL,GAAG,IAAA,gCAAmB,EAAC,oBAAQ,CAAC;YAChC,GAAG,IAAA,gCAAmB,EAAC,2BAAW,CAAC;YACnC,GAAG,IAAA,gCAAmB,EAAC,2BAAW,CAAC;SACpC,CAAC;IACJ,CAAC;CACF;AAEY,QAAA,GAAG,GAAG,IAAI,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.StartDryCmd = void 0;
|
|
13
|
+
const cli_common_1 = require("@rsdk/cli.common");
|
|
14
|
+
const logging_1 = require("@rsdk/logging");
|
|
15
|
+
const node_path_1 = require("node:path");
|
|
16
|
+
class StartDryCmd {
|
|
17
|
+
logger = logging_1.LoggerFactory.create(StartDryCmd);
|
|
18
|
+
async handle() {
|
|
19
|
+
this.logger.trace('execute start:dry command');
|
|
20
|
+
try {
|
|
21
|
+
const appFile = (0, node_path_1.resolve)(`dist/app.js`);
|
|
22
|
+
this.logger.info('appFile resolved', {
|
|
23
|
+
appFile,
|
|
24
|
+
});
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
26
|
+
const app = require(appFile).app;
|
|
27
|
+
this.logger.info('app imported!');
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
29
|
+
if (!(app instanceof require('@rsdk/core').PlatformApp)) {
|
|
30
|
+
throw new TypeError('app is not instance PlatformApp');
|
|
31
|
+
}
|
|
32
|
+
this.logger.info('app is PlatformApp!');
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
this.logger.error(error);
|
|
36
|
+
throw error;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.StartDryCmd = StartDryCmd;
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, cli_common_1.SubCmd)('start:dry', 'just checking that the file exists, can be imported without errors (all peer dependencies are there) and .app from dist/app.js is PlatformApp'),
|
|
43
|
+
__metadata("design:type", Function),
|
|
44
|
+
__metadata("design:paramtypes", []),
|
|
45
|
+
__metadata("design:returntype", Promise)
|
|
46
|
+
], StartDryCmd.prototype, "handle", null);
|
|
47
|
+
//# sourceMappingURL=start-dry.cmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start-dry.cmd.js","sourceRoot":"","sources":["../src/start-dry.cmd.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA0C;AAC1C,2CAA8C;AAC9C,yCAAoC;AAEpC,MAAa,WAAW;IACL,MAAM,GAAG,uBAAa,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAMtD,AAAN,KAAK,CAAC,MAAM;QACV,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAE/C,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,IAAA,mBAAO,EAAC,aAAa,CAAC,CAAC;YAEvC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,EAAE;gBACnC,OAAO;aACR,CAAC,CAAC;YACH,8DAA8D;YAC9D,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC;YAEjC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YAClC,8DAA8D;YAC9D,IAAI,CAAC,CAAC,GAAG,YAAY,OAAO,CAAC,YAAY,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC;gBACxD,MAAM,IAAI,SAAS,CAAC,iCAAiC,CAAC,CAAC;YACzD,CAAC;YACD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QAC1C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAc,CAAC,CAAC;YAClC,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF;AA9BD,kCA8BC;AAvBO;IAJL,IAAA,mBAAM,EACL,WAAW,EACX,+IAA+I,CAChJ;;;;yCAuBA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdk/cli.cmd.start",
|
|
3
|
-
"version": "5.0.0-next.
|
|
3
|
+
"version": "5.0.0-next.6",
|
|
4
4
|
"description": "Start command for rsdk cli",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"optional": true
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "7ccec388cef9d385126ef0f86e5c33f726092074"
|
|
76
76
|
}
|
package/src/index.ts
CHANGED
|
@@ -4,12 +4,14 @@ import type { Command } from 'commander';
|
|
|
4
4
|
|
|
5
5
|
import { StartCmd } from './start.cmd';
|
|
6
6
|
import { StartDevCmd } from './start-dev.cmd';
|
|
7
|
+
import { StartDryCmd } from './start-dry.cmd';
|
|
7
8
|
|
|
8
9
|
class StartRsdkCmd implements RsdkCliCommand {
|
|
9
10
|
getCommands(): Command[] {
|
|
10
11
|
return [
|
|
11
12
|
...getCommanderCommand(StartCmd),
|
|
12
13
|
...getCommanderCommand(StartDevCmd),
|
|
14
|
+
...getCommanderCommand(StartDryCmd),
|
|
13
15
|
];
|
|
14
16
|
}
|
|
15
17
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { SubCmd } from '@rsdk/cli.common';
|
|
2
|
+
import { LoggerFactory } from '@rsdk/logging';
|
|
3
|
+
import { resolve } from 'node:path';
|
|
4
|
+
|
|
5
|
+
export class StartDryCmd {
|
|
6
|
+
private readonly logger = LoggerFactory.create(StartDryCmd);
|
|
7
|
+
|
|
8
|
+
@SubCmd(
|
|
9
|
+
'start:dry',
|
|
10
|
+
'just checking that the file exists, can be imported without errors (all peer dependencies are there) and .app from dist/app.js is PlatformApp',
|
|
11
|
+
)
|
|
12
|
+
async handle(): Promise<void> {
|
|
13
|
+
this.logger.trace('execute start:dry command');
|
|
14
|
+
|
|
15
|
+
try {
|
|
16
|
+
const appFile = resolve(`dist/app.js`);
|
|
17
|
+
|
|
18
|
+
this.logger.info('appFile resolved', {
|
|
19
|
+
appFile,
|
|
20
|
+
});
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
22
|
+
const app = require(appFile).app;
|
|
23
|
+
|
|
24
|
+
this.logger.info('app imported!');
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
26
|
+
if (!(app instanceof require('@rsdk/core').PlatformApp)) {
|
|
27
|
+
throw new TypeError('app is not instance PlatformApp');
|
|
28
|
+
}
|
|
29
|
+
this.logger.info('app is PlatformApp!');
|
|
30
|
+
} catch (error) {
|
|
31
|
+
this.logger.error(error as Error);
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|