@rxap/plugin-library 16.1.0-dev.0 → 16.1.0-dev.2
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 +12 -0
- package/README.md +15 -1
- package/generators.json +10 -0
- package/package.json +13 -13
- package/src/generators/bundle-json-schema/generator.js +90 -22
- package/src/generators/bundle-json-schema/generator.js.map +1 -1
- package/src/generators/index-json-schema/generator.d.ts +10 -0
- package/src/generators/index-json-schema/generator.js +125 -0
- package/src/generators/index-json-schema/generator.js.map +1 -0
- package/src/generators/index-json-schema/index.d.ts +2 -0
- package/src/generators/index-json-schema/index.js +8 -0
- package/src/generators/index-json-schema/index.js.map +1 -0
- package/src/generators/index-json-schema/schema.d.ts +3 -0
- package/src/generators/index-json-schema/schema.json +13 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
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.1.0-dev.2](https://gitlab.com/rxap/packages/compare/@rxap/plugin-library@16.1.0-dev.1...@rxap/plugin-library@16.1.0-dev.2) (2024-03-04)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- generate valid schema ([aff3e0e](https://gitlab.com/rxap/packages/commit/aff3e0e0e340f1f2fbb6d08483a6199a1cabeb32))
|
|
11
|
+
|
|
12
|
+
# [16.1.0-dev.1](https://gitlab.com/rxap/packages/compare/@rxap/plugin-library@16.1.0-dev.0...@rxap/plugin-library@16.1.0-dev.1) (2024-02-28)
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- add bundle json schema ([07ff6b5](https://gitlab.com/rxap/packages/commit/07ff6b5ee90aa20912ece6ae4237faa037fe5088))
|
|
17
|
+
|
|
6
18
|
# [16.1.0-dev.0](https://gitlab.com/rxap/packages/compare/@rxap/plugin-library@16.0.1-dev.0...@rxap/plugin-library@16.1.0-dev.0) (2024-02-25)
|
|
7
19
|
|
|
8
20
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ yarn add @rxap/plugin-library
|
|
|
19
19
|
```
|
|
20
20
|
**Install peer dependencies:**
|
|
21
21
|
```bash
|
|
22
|
-
yarn add @nx/devkit@^16.5.0 @rxap/generator-ts-morph@^1.0.1 @rxap/generator-utilities@^1.1.0 @rxap/node-utilities@^1.1.0 @rxap/plugin-angular@^16.1.1-dev.
|
|
22
|
+
yarn add @nx/devkit@^16.5.0 @rxap/generator-ts-morph@^1.0.1 @rxap/generator-utilities@^1.1.0 @rxap/node-utilities@^1.1.0 @rxap/plugin-angular@^16.1.1-dev.1 @rxap/plugin-nestjs@^16.1.1-dev.0 @rxap/plugin-utilities@^16.1.1-dev.0 @rxap/ts-morph@^1.1.0-dev.5 @rxap/utilities@^16.1.0-dev.3 @rxap/workspace-utilities@^16.0.1 handlebars@^4.7.7 nx@^16.5.0 semver@^7.5.3 ts-morph@^18.0.0 tslib@2.6.2
|
|
23
23
|
```
|
|
24
24
|
**Execute the init generator:**
|
|
25
25
|
```bash
|
|
@@ -83,6 +83,13 @@ yarn nx g @rxap/plugin-library:expose-as-schematic
|
|
|
83
83
|
yarn nx g @rxap/plugin-library:bundle-json-schema
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
+
## index-json-schema
|
|
87
|
+
> index-json-schema generator
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
yarn nx g @rxap/plugin-library:index-json-schema
|
|
91
|
+
```
|
|
92
|
+
|
|
86
93
|
## init
|
|
87
94
|
> Create and update configurations to use rxap package publish concept
|
|
88
95
|
|
|
@@ -138,6 +145,13 @@ yarn nx g @rxap/plugin-library:expose-as-schematic
|
|
|
138
145
|
```bash
|
|
139
146
|
yarn nx g @rxap/plugin-library:bundle-json-schema
|
|
140
147
|
```
|
|
148
|
+
|
|
149
|
+
## index-json-schema
|
|
150
|
+
> index-json-schema generator
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
yarn nx g @rxap/plugin-library:index-json-schema
|
|
154
|
+
```
|
|
141
155
|
# Executors
|
|
142
156
|
|
|
143
157
|
## update-dependencies
|
package/generators.json
CHANGED
|
@@ -39,6 +39,11 @@
|
|
|
39
39
|
"factory": "./src/generators/bundle-json-schema/generator",
|
|
40
40
|
"schema": "./src/generators/bundle-json-schema/schema.json",
|
|
41
41
|
"description": "bundle-json-schema generator"
|
|
42
|
+
},
|
|
43
|
+
"index-json-schema": {
|
|
44
|
+
"factory": "./src/generators/index-json-schema/generator",
|
|
45
|
+
"schema": "./src/generators/index-json-schema/schema.json",
|
|
46
|
+
"description": "index-json-schema generator"
|
|
42
47
|
}
|
|
43
48
|
},
|
|
44
49
|
"schematics": {
|
|
@@ -81,6 +86,11 @@
|
|
|
81
86
|
"factory": "./src/generators/bundle-json-schema/index",
|
|
82
87
|
"schema": "./src/generators/bundle-json-schema/schema.json",
|
|
83
88
|
"description": "bundle-json-schema generator"
|
|
89
|
+
},
|
|
90
|
+
"index-json-schema": {
|
|
91
|
+
"factory": "./src/generators/index-json-schema/index",
|
|
92
|
+
"schema": "./src/generators/index-json-schema/schema.json",
|
|
93
|
+
"description": "index-json-schema generator"
|
|
84
94
|
}
|
|
85
95
|
}
|
|
86
96
|
}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "16.1.0-dev.
|
|
2
|
+
"version": "16.1.0-dev.2",
|
|
3
3
|
"name": "@rxap/plugin-library",
|
|
4
4
|
"license": "GPL-3.0-or-later",
|
|
5
5
|
"dependencies": {
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
"@rxap/generator-ts-morph": "^1.0.1",
|
|
15
15
|
"@rxap/generator-utilities": "^1.1.0",
|
|
16
16
|
"@rxap/node-utilities": "^1.1.0",
|
|
17
|
-
"@rxap/plugin-angular": "^16.1.1-dev.
|
|
18
|
-
"@rxap/plugin-nestjs": "^16.1.0",
|
|
19
|
-
"@rxap/plugin-utilities": "^16.1.0",
|
|
20
|
-
"@rxap/ts-morph": "^1.1.0-dev.
|
|
21
|
-
"@rxap/utilities": "^16.0.
|
|
17
|
+
"@rxap/plugin-angular": "^16.1.1-dev.1",
|
|
18
|
+
"@rxap/plugin-nestjs": "^16.1.1-dev.0",
|
|
19
|
+
"@rxap/plugin-utilities": "^16.1.1-dev.0",
|
|
20
|
+
"@rxap/ts-morph": "^1.1.0-dev.5",
|
|
21
|
+
"@rxap/utilities": "^16.1.0-dev.3",
|
|
22
22
|
"@rxap/workspace-utilities": "^16.0.1",
|
|
23
23
|
"handlebars": "^4.7.7",
|
|
24
24
|
"nx": "^16.5.0",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"ts-morph": "^18.0.0",
|
|
27
27
|
"tslib": "2.6.2",
|
|
28
28
|
"@rxap/plugin-localazy": "16.1.0",
|
|
29
|
-
"@rxap/workspace-ts-morph": "16.0.
|
|
29
|
+
"@rxap/workspace-ts-morph": "16.0.2-dev.0"
|
|
30
30
|
},
|
|
31
31
|
"author": {
|
|
32
32
|
"name": "Merzough Münker",
|
|
@@ -62,15 +62,15 @@
|
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
"package": "@rxap/plugin-angular",
|
|
65
|
-
"version": "16.1.1-dev.
|
|
65
|
+
"version": "16.1.1-dev.1"
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
68
|
"package": "@rxap/plugin-nestjs",
|
|
69
|
-
"version": "16.1.0"
|
|
69
|
+
"version": "16.1.1-dev.0"
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
"package": "@rxap/plugin-utilities",
|
|
73
|
-
"version": "16.1.0"
|
|
73
|
+
"version": "16.1.1-dev.0"
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
76
|
"package": "@rxap/schematics-utilities",
|
|
@@ -78,11 +78,11 @@
|
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
80
|
"package": "@rxap/ts-morph",
|
|
81
|
-
"version": "1.1.0-dev.
|
|
81
|
+
"version": "1.1.0-dev.5"
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
"package": "@rxap/utilities",
|
|
85
|
-
"version": "16.0.
|
|
85
|
+
"version": "16.1.0-dev.3"
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
"package": "@rxap/workspace-utilities",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
},
|
|
102
102
|
"schematics": "./generators.json",
|
|
103
103
|
"type": "commonjs",
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "1cbac86e12b74f4ffffb4b4b9b65f2bdfdb47384",
|
|
105
105
|
"main": "./src/index.js",
|
|
106
106
|
"types": "./src/index.d.ts"
|
|
107
107
|
}
|
|
@@ -6,10 +6,54 @@ const json_schema_ref_parser_1 = tslib_1.__importDefault(require("@apidevtools/j
|
|
|
6
6
|
const utilities_1 = require("@rxap/utilities");
|
|
7
7
|
const workspace_utilities_1 = require("@rxap/workspace-utilities");
|
|
8
8
|
const path_1 = require("path");
|
|
9
|
+
const generator_1 = require("../index-json-schema/generator");
|
|
10
|
+
/**
|
|
11
|
+
* Remove the definitions and $id and $schema properties from the schema and normalize the $ref properties to only have
|
|
12
|
+
* the prefix '#/definitions/' before the definition name
|
|
13
|
+
* @param tree
|
|
14
|
+
* @param projectSourceRoot
|
|
15
|
+
* @param $ref
|
|
16
|
+
*/
|
|
17
|
+
function loadCleanDefinition(tree, projectSourceRoot, { $ref }) {
|
|
18
|
+
const filePath = (0, path_1.join)(projectSourceRoot, $ref);
|
|
19
|
+
if (!tree.exists(filePath)) {
|
|
20
|
+
throw new Error(`The file '${filePath}' does not exist!`);
|
|
21
|
+
}
|
|
22
|
+
const schema = JSON.parse(tree.read(filePath).toString());
|
|
23
|
+
return cleanupDefinition(schema);
|
|
24
|
+
}
|
|
25
|
+
function cleanupDefinition(schema) {
|
|
26
|
+
if (schema['definitions']) {
|
|
27
|
+
delete schema['definitions'];
|
|
28
|
+
}
|
|
29
|
+
if (schema['$schema']) {
|
|
30
|
+
delete schema['$schema'];
|
|
31
|
+
}
|
|
32
|
+
if (schema['$id']) {
|
|
33
|
+
delete schema['$id'];
|
|
34
|
+
}
|
|
35
|
+
for (const { key, value, propertyPath, parent } of (0, utilities_1.EachProperty)(schema)) {
|
|
36
|
+
if (key === '$ref') {
|
|
37
|
+
if (typeof value === 'string') {
|
|
38
|
+
parent[key] = value.replace(/^#\/definitions\//, '#/definitions/');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return schema;
|
|
43
|
+
}
|
|
44
|
+
function getCleanDefinitionMap(tree, projectSourceRoot, definitions) {
|
|
45
|
+
const resolvedDefinitions = {};
|
|
46
|
+
for (const [key, definition] of Object.entries(definitions)) {
|
|
47
|
+
resolvedDefinitions[key] = loadCleanDefinition(tree, projectSourceRoot, definition);
|
|
48
|
+
}
|
|
49
|
+
return resolvedDefinitions;
|
|
50
|
+
}
|
|
9
51
|
function bundleJsonSchemaGenerator(tree, options) {
|
|
52
|
+
var _a;
|
|
10
53
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
54
|
const projectSourceRoot = (0, workspace_utilities_1.GetProjectSourceRoot)(tree, options.project);
|
|
12
55
|
const workspaceRoot = tree.root;
|
|
56
|
+
const definitions = getCleanDefinitionMap(tree, projectSourceRoot, (0, generator_1.GenerateDefinitionsMap)(tree, options));
|
|
13
57
|
for (const file of (0, workspace_utilities_1.SearchFile)(tree, projectSourceRoot)) {
|
|
14
58
|
if (file.path.endsWith('template.schema.json')) {
|
|
15
59
|
const relativePathFromProjectSourceRoot = (0, path_1.dirname)((0, path_1.relative)(projectSourceRoot, file.path));
|
|
@@ -35,10 +79,16 @@ function bundleJsonSchemaGenerator(tree, options) {
|
|
|
35
79
|
}
|
|
36
80
|
}
|
|
37
81
|
});
|
|
38
|
-
removeProperty(bundledSchema, 'definitions');
|
|
39
|
-
removeProperty(bundledSchema, '$id');
|
|
40
|
-
removeProperty(bundledSchema, '$schema');
|
|
82
|
+
// removeProperty(bundledSchema, 'definitions');
|
|
83
|
+
// removeProperty(bundledSchema, '$id');
|
|
84
|
+
// removeProperty(bundledSchema, '$schema');
|
|
85
|
+
bundledSchema['definitions'] = Object.assign(Object.assign({}, bundledSchema['definitions']), definitions);
|
|
41
86
|
fixNestaedDefinitions(bundledSchema);
|
|
87
|
+
for (const [, definition] of Object.entries(bundledSchema['definitions'])) {
|
|
88
|
+
cleanupDefinition(definition);
|
|
89
|
+
}
|
|
90
|
+
(_a = bundledSchema['definitions']) !== null && _a !== void 0 ? _a : (bundledSchema['definitions'] = {});
|
|
91
|
+
bundledSchema['definitions'] = Object.entries(bundledSchema['definitions']).sort(([a], [b]) => a.localeCompare(b)).reduce((acc, [key, value]) => (Object.assign(Object.assign({}, acc), { [key]: value })), {});
|
|
42
92
|
tree.write(file.path.replace('template.schema.json', 'schema.json'), JSON.stringify(bundledSchema, null, 2));
|
|
43
93
|
}
|
|
44
94
|
}
|
|
@@ -59,29 +109,47 @@ function removeProperty(obj, propertyName) {
|
|
|
59
109
|
(0, utilities_1.RemoveFromObject)(obj, propertyPath);
|
|
60
110
|
}
|
|
61
111
|
}
|
|
62
|
-
function
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
const nestedDefinitions = [];
|
|
69
|
-
for (const { key, value } of (0, utilities_1.EachProperty)(definition)) {
|
|
70
|
-
if (key === '$ref') {
|
|
71
|
-
nestedDefinitions.push(value);
|
|
112
|
+
function getUsedDefinitions(item) {
|
|
113
|
+
const usedDefinitions = [];
|
|
114
|
+
for (const { key, value, parent } of (0, utilities_1.EachProperty)(item)) {
|
|
115
|
+
if (key === '$ref') {
|
|
116
|
+
if (typeof value !== 'string') {
|
|
117
|
+
throw new Error(`The value of the key '$ref' in definition '${key}' is not a string!`);
|
|
72
118
|
}
|
|
119
|
+
usedDefinitions.push(value.replace(/^#\/definitions\//, ''));
|
|
73
120
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
121
|
+
}
|
|
122
|
+
return usedDefinitions;
|
|
123
|
+
}
|
|
124
|
+
function fixNestaedDefinitions(schema) {
|
|
125
|
+
var _a;
|
|
126
|
+
const usedDefinitions = [];
|
|
127
|
+
// create a list of used refs excluding the definitions
|
|
128
|
+
for (const [key, item] of Object.entries(schema !== null && schema !== void 0 ? schema : {})) {
|
|
129
|
+
if (key === 'definitions') {
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
if (typeof item !== 'object') {
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
(0, utilities_1.CoerceArrayItems)(usedDefinitions, getUsedDefinitions(item));
|
|
136
|
+
}
|
|
137
|
+
let removeList = Object.keys(schema.definitions).filter((key) => !usedDefinitions.includes(key));
|
|
138
|
+
let removeListLength = 0;
|
|
139
|
+
do {
|
|
140
|
+
removeListLength = removeList.length;
|
|
141
|
+
// check for each definition that will not be removed if it is using another definition that should be removed
|
|
142
|
+
// if yes remove this from the list of definitions to remove
|
|
143
|
+
for (const [key, item] of Object.entries((_a = schema.definitions) !== null && _a !== void 0 ? _a : {})) {
|
|
144
|
+
if (removeList.includes(key)) {
|
|
145
|
+
continue;
|
|
82
146
|
}
|
|
147
|
+
(0, utilities_1.CoerceArrayItems)(usedDefinitions, getUsedDefinitions(item));
|
|
83
148
|
}
|
|
84
|
-
|
|
149
|
+
removeList = removeList.filter((key) => !usedDefinitions.includes(key));
|
|
150
|
+
} while (removeListLength !== removeList.length);
|
|
151
|
+
for (const key of removeList) {
|
|
152
|
+
delete schema.definitions[key];
|
|
85
153
|
}
|
|
86
154
|
}
|
|
87
155
|
exports.default = bundleJsonSchemaGenerator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/bundle-json-schema/generator.ts"],"names":[],"mappings":";;;;AAAA,yGAA6D;AAE7D,+
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/bundle-json-schema/generator.ts"],"names":[],"mappings":";;;;AAAA,yGAA6D;AAE7D,+CAIyB;AACzB,mEAGmC;AACnC,+BAIc;AACd,8DAAwE;AAIxE;;;;;;GAMG;AACH,SAAS,mBAAmB,CAAC,IAAU,EAAE,iBAAyB,EAAE,EAAE,IAAI,EAAoB;IAC5F,MAAM,QAAQ,GAAG,IAAA,WAAI,EAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;IAC/C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;QAC1B,MAAM,IAAI,KAAK,CAAC,aAAa,QAAQ,mBAAmB,CAAC,CAAC;KAC3D;IACD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC1D,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAW;IACpC,IAAI,MAAM,CAAC,aAAa,CAAC,EAAE;QACzB,OAAO,MAAM,CAAC,aAAa,CAAC,CAAC;KAC9B;IACD,IAAI,MAAM,CAAC,SAAS,CAAC,EAAE;QACrB,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;KAC1B;IACD,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE;QACjB,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;KACtB;IACD,KAAK,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,IAAA,wBAAY,EAAC,MAAM,CAAC,EAAE;QACvE,IAAI,GAAG,KAAK,MAAM,EAAE;YAClB,IA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GAAG,CAAC,EAAE;gBAC5B,SAAS;aACV;YACD,IAAA,4BAAgB,EAAC,eAAe,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;SAC7D;QACD,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;KACzE,QAAQ,gBAAgB,KAAK,UAAU,CAAC,MAAM,EAAE;IACjD,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE;QAC5B,OAAO,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;KAChC;AACH,CAAC;AAED,kBAAe,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Tree } from '@nx/devkit';
|
|
2
|
+
import { IndexJsonSchemaGeneratorSchema } from './schema';
|
|
3
|
+
export declare function GenerateSchematicDefinitionsMap(tree: Tree, options: IndexJsonSchemaGeneratorSchema, basePath?: string): Record<string, {
|
|
4
|
+
$ref: string;
|
|
5
|
+
}>;
|
|
6
|
+
export declare function GenerateDefinitionsMap(tree: Tree, options: IndexJsonSchemaGeneratorSchema, basePath?: string): Record<string, {
|
|
7
|
+
$ref: string;
|
|
8
|
+
}>;
|
|
9
|
+
export declare function indexJsonSchemaGenerator(tree: Tree, options: IndexJsonSchemaGeneratorSchema): Promise<void>;
|
|
10
|
+
export default indexJsonSchemaGenerator;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.indexJsonSchemaGenerator = exports.GenerateDefinitionsMap = exports.GenerateSchematicDefinitionsMap = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const plugin_utilities_1 = require("@rxap/plugin-utilities");
|
|
6
|
+
const utilities_1 = require("@rxap/utilities");
|
|
7
|
+
const workspace_utilities_1 = require("@rxap/workspace-utilities");
|
|
8
|
+
const path_1 = require("path");
|
|
9
|
+
function getSchematicMap(tree, options) {
|
|
10
|
+
const { generators, schematics } = (0, plugin_utilities_1.GetGenerators)(tree, options.project);
|
|
11
|
+
const generatorMapList = Object.entries(generators !== null && generators !== void 0 ? generators : {});
|
|
12
|
+
(0, utilities_1.CoerceArrayItems)(generatorMapList, Object.entries(schematics !== null && schematics !== void 0 ? schematics : {}), (a, b) => a[0] === b[0]);
|
|
13
|
+
return generatorMapList;
|
|
14
|
+
}
|
|
15
|
+
function generateSchematicInputSchema(tree, options) {
|
|
16
|
+
const schemaList = [];
|
|
17
|
+
const projectRoot = (0, workspace_utilities_1.GetProjectRoot)(tree, options.project);
|
|
18
|
+
const packageJsonName = (0, workspace_utilities_1.GetPackageJson)(tree, projectRoot).name;
|
|
19
|
+
const generatorMapList = getSchematicMap(tree, options);
|
|
20
|
+
for (const [name, { schema }] of generatorMapList) {
|
|
21
|
+
const schemaPath = (0, path_1.dirname)(schema);
|
|
22
|
+
const schemaTemplatePath = './' + (0, path_1.join)(schemaPath, 'template.schema.json');
|
|
23
|
+
let schemaRefPath;
|
|
24
|
+
if (tree.exists((0, path_1.join)(projectRoot, schemaTemplatePath))) {
|
|
25
|
+
schemaRefPath = schemaTemplatePath;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
schemaRefPath = schema;
|
|
29
|
+
}
|
|
30
|
+
const content = JSON.parse(tree.read((0, path_1.join)(projectRoot, schemaRefPath)).toString());
|
|
31
|
+
schemaRefPath = schemaRefPath.replace(/^\.\/[^/]+\//, './');
|
|
32
|
+
schemaList.push({
|
|
33
|
+
type: 'object',
|
|
34
|
+
properties: {
|
|
35
|
+
package: {
|
|
36
|
+
type: "string",
|
|
37
|
+
const: packageJsonName,
|
|
38
|
+
},
|
|
39
|
+
name: {
|
|
40
|
+
type: "string",
|
|
41
|
+
const: name,
|
|
42
|
+
},
|
|
43
|
+
options: {
|
|
44
|
+
$ref: `#/definitions/${(0, utilities_1.camelize)(content.$id)}`,
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
$schema: 'http://json-schema.org/schema',
|
|
51
|
+
$id: 'schematic-input',
|
|
52
|
+
type: 'object',
|
|
53
|
+
oneOf: schemaList,
|
|
54
|
+
definitions: GenerateSchematicDefinitionsMap(tree, options)
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function GenerateSchematicDefinitionsMap(tree, options, basePath = './src') {
|
|
58
|
+
const projectRoot = (0, workspace_utilities_1.GetProjectRoot)(tree, options.project);
|
|
59
|
+
const generatorMapList = getSchematicMap(tree, options);
|
|
60
|
+
const definitions = {};
|
|
61
|
+
for (const [, { schema }] of generatorMapList) {
|
|
62
|
+
const schemaPath = (0, path_1.dirname)(schema);
|
|
63
|
+
const schemaTemplatePath = (0, path_1.join)(schemaPath, 'template.schema.json');
|
|
64
|
+
let schemaRefPath;
|
|
65
|
+
if (tree.exists((0, path_1.join)(projectRoot, schemaTemplatePath))) {
|
|
66
|
+
schemaRefPath = schemaTemplatePath;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
schemaRefPath = schema;
|
|
70
|
+
}
|
|
71
|
+
const content = JSON.parse(tree.read((0, path_1.join)(projectRoot, schemaRefPath)).toString());
|
|
72
|
+
definitions[(0, utilities_1.camelize)(content.$id)] = {
|
|
73
|
+
$ref: (0, path_1.relative)(basePath, schemaRefPath)
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
return definitions;
|
|
77
|
+
}
|
|
78
|
+
exports.GenerateSchematicDefinitionsMap = GenerateSchematicDefinitionsMap;
|
|
79
|
+
function GenerateDefinitionsMap(tree, options, basePath = './src') {
|
|
80
|
+
const projectSourceRoot = (0, workspace_utilities_1.GetProjectSourceRoot)(tree, options.project);
|
|
81
|
+
const schematicsFolder = (0, path_1.join)(projectSourceRoot, 'schematics');
|
|
82
|
+
const definitions = GenerateSchematicDefinitionsMap(tree, options, basePath);
|
|
83
|
+
for (const schematic of tree.children(schematicsFolder)) {
|
|
84
|
+
if (schematic.endsWith('schema.json')) {
|
|
85
|
+
const schema = JSON.parse(tree.read((0, path_1.join)(schematicsFolder, schematic)).toString());
|
|
86
|
+
definitions[(0, utilities_1.camelize)(schema.$id)] = {
|
|
87
|
+
$ref: (0, path_1.relative)(basePath, `./src/schematics/${schematic}`)
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return definitions;
|
|
92
|
+
}
|
|
93
|
+
exports.GenerateDefinitionsMap = GenerateDefinitionsMap;
|
|
94
|
+
function generateTemplateSchema(tree, options) {
|
|
95
|
+
const definitions = GenerateDefinitionsMap(tree, options);
|
|
96
|
+
definitions['schematicInput'] = {
|
|
97
|
+
$ref: './schematic-input.schema.json',
|
|
98
|
+
};
|
|
99
|
+
return {
|
|
100
|
+
$schema: 'http://json-schema.org/schema',
|
|
101
|
+
$id: 'schematic-angular',
|
|
102
|
+
oneOf: [
|
|
103
|
+
{
|
|
104
|
+
type: 'array',
|
|
105
|
+
items: {
|
|
106
|
+
$ref: '#/definitions/schematicInput'
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
$ref: '#/definitions/schematicInput'
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
definitions
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function indexJsonSchemaGenerator(tree, options) {
|
|
117
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
118
|
+
const projectSourceRoot = (0, workspace_utilities_1.GetProjectSourceRoot)(tree, options.project);
|
|
119
|
+
tree.write((0, path_1.join)(projectSourceRoot, 'schematic-input.schema.json'), JSON.stringify(generateSchematicInputSchema(tree, options), null, 2));
|
|
120
|
+
tree.write((0, path_1.join)(projectSourceRoot, 'template.schema.json'), JSON.stringify(generateTemplateSchema(tree, options), null, 2));
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
exports.indexJsonSchemaGenerator = indexJsonSchemaGenerator;
|
|
124
|
+
exports.default = indexJsonSchemaGenerator;
|
|
125
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/index-json-schema/generator.ts"],"names":[],"mappings":";;;;AACA,6DAAuD;AACvD,+CAGyB;AACzB,mEAImC;AACnC,+BAIc;AAGd,SAAS,eAAe,CAAC,IAAU,EAAE,OAAuC;IAC1E,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,IAAA,gCAAa,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACxE,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,EAAE,CAAC,CAAC;IAC1D,IAAA,4BAAgB,EAAC,gBAAgB,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9F,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED,SAAS,4BAA4B,CAAC,IAAU,EAAE,OAAuC;IACvF,MAAM,UAAU,GAAU,EAAE,CAAC;IAC7B,MAAM,WAAW,GAAG,IAAA,oCAAc,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1D,MAAM,eAAe,GAAG,IAAA,oCAAc,EAAC,IAAI,EAAE,WAAW,CAAC,CAAC,IAAI,CAAC;IAC/D,MAAM,gBAAgB,GAAG,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACxD,KAAK,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,IAAI,gBAAgB,EAAE;QACjD,MAAM,UAAU,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E,CAAC,CAAC,CAAC,CAAC;QACzI,IAAI,CAAC,KAAK,CAAC,IAAA,WAAI,EAAC,iBAAiB,EAAE,sBAAsB,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,sBAAsB,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC9H,CAAC;CAAA;AAPD,4DAOC;AAED,kBAAe,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const generator_1 = tslib_1.__importDefault(require("./generator"));
|
|
6
|
+
const schematic = (0, devkit_1.convertNxGenerator)(generator_1.default);
|
|
7
|
+
exports.default = schematic;
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/index-json-schema/index.ts"],"names":[],"mappings":";;;AAAA,uCAAgD;AAChD,oEAAoC;AAEpC,MAAM,SAAS,GAAG,IAAA,2BAAkB,EAAC,mBAAS,CAAC,CAAC;AAChD,kBAAe,SAAS,CAAC"}
|