@rxap/plugin-nestjs 20.1.0-dev.8 → 20.1.0-dev.9
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 +6 -0
- package/package.json +2 -2
- package/src/executors/is-legacy-configuration.d.ts +2 -0
- package/src/executors/is-legacy-configuration.js +9 -0
- package/src/executors/is-legacy-configuration.js.map +1 -0
- package/src/executors/swagger-generate/executor.d.ts +3 -0
- package/src/executors/swagger-generate/executor.js +49 -27
- package/src/executors/swagger-generate/executor.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
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
|
+
# [20.1.0-dev.9](https://gitlab.com/rxap/packages/compare/@rxap/plugin-nestjs@20.1.0-dev.8...@rxap/plugin-nestjs@20.1.0-dev.9) (2025-01-29)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- simplify swagger generate exception ([aa96e2b](https://gitlab.com/rxap/packages/commit/aa96e2bd4d6586ac489f89f0ac23f84561cff6a0))
|
|
11
|
+
|
|
6
12
|
# [20.1.0-dev.8](https://gitlab.com/rxap/packages/compare/@rxap/plugin-nestjs@20.1.0-dev.7...@rxap/plugin-nestjs@20.1.0-dev.8) (2025-01-29)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "20.1.0-dev.
|
|
2
|
+
"version": "20.1.0-dev.9",
|
|
3
3
|
"name": "@rxap/plugin-nestjs",
|
|
4
4
|
"license": "GPL-3.0-or-later",
|
|
5
5
|
"dependencies": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"schematics": "./generators.json",
|
|
56
56
|
"type": "commonjs",
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "9a1c8f721a06fcc9d235db5cedff1c1d564baca2",
|
|
58
58
|
"exports": {
|
|
59
59
|
"./package.json": "./package.json",
|
|
60
60
|
".": {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isLegacyConfiguration = isLegacyConfiguration;
|
|
4
|
+
const plugin_utilities_1 = require("@rxap/plugin-utilities");
|
|
5
|
+
function isLegacyConfiguration(context) {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
return ((_b = (_a = (0, plugin_utilities_1.GetProjectConfiguration)(context).targets) === null || _a === void 0 ? void 0 : _a['build']) === null || _b === void 0 ? void 0 : _b['executor']) === '@nx/webpack:webpack';
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=is-legacy-configuration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-legacy-configuration.js","sourceRoot":"","sources":["../../../../../../packages/plugin/nestjs/src/executors/is-legacy-configuration.ts"],"names":[],"mappings":";;AAGA,sDAEC;AAJD,6DAAiE;AAEjE,SAAgB,qBAAqB,CAAC,OAAwB;;IAC5D,OAAO,CAAA,MAAA,MAAA,IAAA,0CAAuB,EAAC,OAAO,CAAC,CAAC,OAAO,0CAAG,OAAO,CAAC,0CAAG,UAAU,CAAC,MAAK,qBAAqB,CAAC;AACrG,CAAC"}
|
|
@@ -2,4 +2,7 @@ import { ExecutorContext } from '@nx/devkit';
|
|
|
2
2
|
import { SwaggerGenerateExecutorSchema } from './schema';
|
|
3
3
|
export default function runExecutor(options: SwaggerGenerateExecutorSchema, context: ExecutorContext): Promise<{
|
|
4
4
|
success: boolean;
|
|
5
|
+
terminalOutput: string;
|
|
6
|
+
} | {
|
|
7
|
+
success: boolean;
|
|
5
8
|
}>;
|
|
@@ -7,6 +7,8 @@ const node_impl_1 = require("@nx/js/src/executors/node/node.impl");
|
|
|
7
7
|
const plugin_utilities_1 = require("@rxap/plugin-utilities");
|
|
8
8
|
const fs_1 = require("fs");
|
|
9
9
|
const path_1 = require("path");
|
|
10
|
+
const is_legacy_configuration_1 = require("../is-legacy-configuration");
|
|
11
|
+
const run_commands_impl_1 = require("nx/src/executors/run-commands/run-commands.impl");
|
|
10
12
|
function checkIfOpenApiFileExists(context) {
|
|
11
13
|
const outputPath = (0, plugin_utilities_1.GuessOutputPathFromContext)(context, undefined, undefined, 'swagger-build');
|
|
12
14
|
const openApiPath = (0, path_1.join)(outputPath, 'openapi.json');
|
|
@@ -31,41 +33,61 @@ function runExecutor(options, context) {
|
|
|
31
33
|
var _a, e_1, _b, _c;
|
|
32
34
|
var _d;
|
|
33
35
|
console.log('Executor ran for SwaggerGenerate', options);
|
|
36
|
+
const projectRoot = (0, plugin_utilities_1.GetProjectRoot)(context);
|
|
34
37
|
const projectName = context.projectName;
|
|
35
38
|
yield linkLibrariesToDistNodeModules(context);
|
|
36
39
|
// This will give a random number between 9000 and 9999
|
|
37
40
|
const port = Math.floor(Math.random() * 1000) + 9000;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
41
|
+
if ((0, is_legacy_configuration_1.isLegacyConfiguration)(context)) {
|
|
42
|
+
const nodeProc = (0, node_impl_1.default)({
|
|
43
|
+
watch: false,
|
|
44
|
+
buildTarget: (_d = options.buildTarget) !== null && _d !== void 0 ? _d : `${projectName}:swagger-build`,
|
|
45
|
+
inspect: false,
|
|
46
|
+
runtimeArgs: [],
|
|
47
|
+
args: [],
|
|
48
|
+
waitUntilTargets: [],
|
|
49
|
+
buildTargetOptions: {},
|
|
50
|
+
host: 'localhost',
|
|
51
|
+
port: port
|
|
52
|
+
}, context);
|
|
53
|
+
try {
|
|
54
|
+
for (var _e = true, nodeProc_1 = tslib_1.__asyncValues(nodeProc), nodeProc_1_1; nodeProc_1_1 = yield nodeProc_1.next(), _a = nodeProc_1_1.done, !_a; _e = true) {
|
|
55
|
+
_c = nodeProc_1_1.value;
|
|
56
|
+
_e = false;
|
|
57
|
+
const event = _c;
|
|
58
|
+
console.log('Node executor event', event);
|
|
59
|
+
if (!event.success) {
|
|
60
|
+
console.log('Node executor target was not successful');
|
|
61
|
+
return {
|
|
62
|
+
success: false,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
68
|
+
finally {
|
|
69
|
+
try {
|
|
70
|
+
if (!_e && !_a && (_b = nodeProc_1.return)) yield _b.call(nodeProc_1);
|
|
60
71
|
}
|
|
72
|
+
finally { if (e_1) throw e_1.error; }
|
|
61
73
|
}
|
|
62
74
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
75
|
+
else {
|
|
76
|
+
const result = yield (0, run_commands_impl_1.default)({
|
|
77
|
+
cwd: context.root,
|
|
78
|
+
command: 'node',
|
|
79
|
+
env: {
|
|
80
|
+
PORT: port.toFixed(0),
|
|
81
|
+
},
|
|
82
|
+
args: [
|
|
83
|
+
(0, path_1.join)('swagger', projectRoot || projectName, 'main.js'),
|
|
84
|
+
],
|
|
85
|
+
__unparsed__: [],
|
|
86
|
+
}, context);
|
|
87
|
+
if (!result.success) {
|
|
88
|
+
console.log('Failed to run the swagger node application');
|
|
89
|
+
return result;
|
|
67
90
|
}
|
|
68
|
-
finally { if (e_1) throw e_1.error; }
|
|
69
91
|
}
|
|
70
92
|
if (checkIfOpenApiFileExists(context)) {
|
|
71
93
|
console.log('OpenAPI file exists');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/nestjs/src/executors/swagger-generate/executor.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/nestjs/src/executors/swagger-generate/executor.ts"],"names":[],"mappings":";;AAqCA,8BAmEC;;AAxGD,uCAGoB;AACpB,mEAA+D;AAC/D,6DAIgC;AAChC,2BAAgC;AAChC,+BAA4B;AAC5B,wEAAmE;AAEnE,uFAAkE;AAElE,SAAS,wBAAwB,CAAC,OAAwB;IACxD,MAAM,UAAU,GAAG,IAAA,6CAA0B,EAAC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;IAC9F,MAAM,WAAW,GAAG,IAAA,WAAI,EAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IACrD,MAAM,QAAQ,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACjD,OAAO,CAAC,GAAG,CAAC,oCAAoC,EAAE,QAAQ,CAAC,CAAC;IAC5D,OAAO,IAAA,eAAU,EAAC,QAAQ,CAAC,CAAC;AAC9B,CAAC;AAED,SAAe,8BAA8B,CAAC,OAAwB;;QACpE,MAAM,iBAAiB,GAAG,IAAA,iDAA8B,EAAC,OAAO,CAAC;aAC9D,MAAM,CAAC,OAAO,CAAC,EAAE,mBAAC,OAAA,MAAA,MAAA,MAAA,OAAO,CAAC,sBAAsB,0CAAE,QAAQ,CAAC,OAAO,CAAC,0CAAE,OAAO,0CAAG,SAAS,CAAC,CAAA,EAAA,CAAC;aAC1F,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;QAEvD,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,iBAAiB,CAAC,CAAC;QAErD,KAAK,MAAM,MAAM,IAAI,iBAA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