@rxap/plugin-open-api 16.1.1-dev.3 → 16.2.0-dev.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.
- package/CHANGELOG.md +10 -0
- package/README.md +7 -0
- package/generators.json +5 -0
- package/package.json +3 -3
- package/src/generators/init-library/generator.d.ts +4 -0
- package/src/generators/init-library/generator.js +51 -0
- package/src/generators/init-library/generator.js.map +1 -0
- package/src/generators/init-library/schema.d.ts +3 -0
- package/src/generators/init-library/schema.json +12 -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
|
+
# [16.2.0-dev.0](https://gitlab.com/rxap/packages/compare/@rxap/plugin-open-api@16.1.1-dev.3...@rxap/plugin-open-api@16.2.0-dev.0) (2024-04-03)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- use the old import path scopes ([fa6fe9d](https://gitlab.com/rxap/packages/commit/fa6fe9d9530335979f734c1f49c19f97f6118832))
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- add open api client sdk library init generator ([1c5e8e0](https://gitlab.com/rxap/packages/commit/1c5e8e05614124a1d7d618d013a433830ec80832))
|
|
15
|
+
|
|
6
16
|
## [16.1.1-dev.3](https://gitlab.com/rxap/packages/compare/@rxap/plugin-open-api@16.1.1-dev.2...@rxap/plugin-open-api@16.1.1-dev.3) (2024-03-31)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @rxap/plugin-open-api
|
package/README.md
CHANGED
|
@@ -29,6 +29,13 @@ yarn add @nx/devkit@^16.5.0 @rxap/node-utilities@^1.2.0-dev.1 @rxap/plugin-libra
|
|
|
29
29
|
```bash
|
|
30
30
|
yarn nx g @rxap/plugin-open-api:generate
|
|
31
31
|
```
|
|
32
|
+
|
|
33
|
+
## init-library
|
|
34
|
+
> init-library generator
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
yarn nx g @rxap/plugin-open-api:init-library
|
|
38
|
+
```
|
|
32
39
|
# Executors
|
|
33
40
|
|
|
34
41
|
## copy-client-sdk
|
package/generators.json
CHANGED
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
"factory": "./src/generators/generate/generator",
|
|
5
5
|
"schema": "./src/generators/generate/schema.json",
|
|
6
6
|
"description": "generate generator"
|
|
7
|
+
},
|
|
8
|
+
"init-library": {
|
|
9
|
+
"factory": "./src/generators/init-library/generator",
|
|
10
|
+
"schema": "./src/generators/init-library/schema.json",
|
|
11
|
+
"description": "init-library generator"
|
|
7
12
|
}
|
|
8
13
|
}
|
|
9
14
|
}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "16.
|
|
2
|
+
"version": "16.2.0-dev.0",
|
|
3
3
|
"name": "@rxap/plugin-open-api",
|
|
4
4
|
"license": "GPL-3.0-or-later",
|
|
5
5
|
"dependencies": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"tslib": "2.6.2",
|
|
27
27
|
"@rxap/generator-ts-morph": "1.0.2-dev.0",
|
|
28
28
|
"@rxap/json-schema-to-typescript": "16.0.1-dev.5",
|
|
29
|
-
"@rxap/ts-morph": "1.1.0-dev.
|
|
29
|
+
"@rxap/ts-morph": "1.1.0-dev.24"
|
|
30
30
|
},
|
|
31
31
|
"author": {
|
|
32
32
|
"name": "Merzough Münker",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"directory": "packages/plugin/open-api"
|
|
94
94
|
},
|
|
95
95
|
"type": "commonjs",
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "0276631a9cfe70681ea9081a434744cf07e4ee6c",
|
|
97
97
|
"main": "./src/index.js",
|
|
98
98
|
"types": "./src/index.d.ts"
|
|
99
99
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initLibraryGenerator = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const utilities_1 = require("@rxap/utilities");
|
|
7
|
+
const workspace_utilities_1 = require("@rxap/workspace-utilities");
|
|
8
|
+
const path_1 = require("path");
|
|
9
|
+
function initLibraryGenerator(tree, options) {
|
|
10
|
+
var _a;
|
|
11
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
12
|
+
const projectRoot = (0, workspace_utilities_1.GetProjectRoot)(tree, options.project);
|
|
13
|
+
console.log(`The project root is: ${projectRoot}`);
|
|
14
|
+
const apiProjectName = (0, path_1.basename)(projectRoot);
|
|
15
|
+
if (!(0, workspace_utilities_1.HasProject)(tree, apiProjectName)) {
|
|
16
|
+
throw new Error(`The api project '${apiProjectName}' for the open api client sdk library '${options.project}' does not exists!`);
|
|
17
|
+
}
|
|
18
|
+
// region delete the source directory
|
|
19
|
+
const projectSourceRoot = (0, workspace_utilities_1.GetProjectSourceRoot)(tree, options.project);
|
|
20
|
+
(0, workspace_utilities_1.DeleteRecursive)(tree, projectSourceRoot);
|
|
21
|
+
tree.write(`${projectSourceRoot}/index.ts`, 'export {};');
|
|
22
|
+
// endregion
|
|
23
|
+
// region add the implicit dependency to the api project
|
|
24
|
+
const projectConfiguration = (0, workspace_utilities_1.GetProject)(tree, options.project);
|
|
25
|
+
(_a = projectConfiguration.implicitDependencies) !== null && _a !== void 0 ? _a : (projectConfiguration.implicitDependencies = []);
|
|
26
|
+
projectConfiguration.implicitDependencies.push(apiProjectName);
|
|
27
|
+
(0, devkit_1.updateProjectConfiguration)(tree, options.project, projectConfiguration);
|
|
28
|
+
// endregion
|
|
29
|
+
// region align the tsconfig.base.json
|
|
30
|
+
const tsConfigBasePath = `tsconfig.base.json`;
|
|
31
|
+
if (!tree.exists(tsConfigBasePath)) {
|
|
32
|
+
throw new Error(`The tsconfig.base.json file does not exists in the workspace root!`);
|
|
33
|
+
}
|
|
34
|
+
yield (0, workspace_utilities_1.UpdateTsConfigJson)(tree, tsConfig => {
|
|
35
|
+
var _a, _b, _c;
|
|
36
|
+
var _d, _e, _f;
|
|
37
|
+
(_a = tsConfig.compilerOptions) !== null && _a !== void 0 ? _a : (tsConfig.compilerOptions = {});
|
|
38
|
+
(_b = (_d = tsConfig.compilerOptions).paths) !== null && _b !== void 0 ? _b : (_d.paths = {});
|
|
39
|
+
if (tsConfig.compilerOptions.paths[options.project]) {
|
|
40
|
+
delete tsConfig.compilerOptions.paths[options.project];
|
|
41
|
+
}
|
|
42
|
+
const scope = (0, workspace_utilities_1.GetWorkspaceScope)(tree);
|
|
43
|
+
tsConfig.compilerOptions.paths[`${options.project}/*`] = [`${projectSourceRoot}/lib/*`];
|
|
44
|
+
(_c = (_e = tsConfig.compilerOptions.paths)[_f = `${scope}/open-api/*`]) !== null && _c !== void 0 ? _c : (_e[_f] = []);
|
|
45
|
+
(0, utilities_1.CoerceArrayItems)(tsConfig.compilerOptions.paths[`${scope}/open-api/*`], tsConfig.compilerOptions.paths[`${options.project}/*`]);
|
|
46
|
+
}, { infix: 'base' });
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
exports.initLibraryGenerator = initLibraryGenerator;
|
|
50
|
+
exports.default = initLibraryGenerator;
|
|
51
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/open-api/src/generators/init-library/generator.ts"],"names":[],"mappings":";;;;AAAA,uCAGoB;AACpB,+CAAmD;AACnD,mEAQmC;AACnC,+BAAgC;AAGhC,SAAsB,oBAAoB,CACxC,IAAU,EACV,OAAmC;;;QAEnC,MAAM,WAAW,GAAG,IAAA,oCAAc,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,C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