@rxap/schematics-xml-parser 16.0.0-dev.7 → 16.0.0-dev.8
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/README.md +1 -1
- package/package.json +15 -15
- package/src/index.js +3 -6
- package/src/index.js.map +1 -1
- package/src/lib/elements/index.js +2 -5
- package/src/lib/elements/index.js.map +1 -1
- package/src/lib/elements/methods/index.js +3 -6
- package/src/lib/elements/methods/index.js.map +1 -1
- package/src/lib/elements/methods/method.element.js +29 -32
- package/src/lib/elements/methods/method.element.js.map +1 -1
- package/src/lib/elements/methods/methods.js +5 -8
- package/src/lib/elements/methods/methods.js.map +1 -1
- package/src/lib/elements/methods/open-api-remote-method.element.js +18 -21
- package/src/lib/elements/methods/open-api-remote-method.element.js.map +1 -1
- package/src/lib/elements/module.element.js +16 -19
- package/src/lib/elements/module.element.js.map +1 -1
- package/src/lib/elements/type.element.js +21 -24
- package/src/lib/elements/type.element.js.map +1 -1
- package/src/lib/index.js +1 -4
- package/src/lib/index.js.map +1 -1
- package/src/lib/parse-template.js +10 -15
- package/src/lib/parse-template.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
|
+
# [16.0.0-dev.8](https://gitlab.com/rxap/packages/compare/@rxap/schematics-xml-parser@16.0.0-dev.7...@rxap/schematics-xml-parser@16.0.0-dev.8) (2023-08-16)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- change from commonjs to es2022 ([fd0f2ba](https://gitlab.com/rxap/packages/commit/fd0f2bae24eae7c854e96f630076cd5598c30be6))
|
|
11
|
+
|
|
6
12
|
# [16.0.0-dev.7](https://gitlab.com/rxap/packages/compare/@rxap/schematics-xml-parser@16.0.0-dev.6...@rxap/schematics-xml-parser@16.0.0-dev.7) (2023-08-04)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -17,5 +17,5 @@ yarn add @rxap/schematics-xml-parser
|
|
|
17
17
|
```
|
|
18
18
|
**Install peer dependencies:**
|
|
19
19
|
```bash
|
|
20
|
-
yarn add @angular-devkit/core@^16.1.4 @angular-devkit/schematics@^16.1.4 @rxap/schematics-ts-morph@^16.0.0-dev.
|
|
20
|
+
yarn add @angular-devkit/core@^16.1.4 @angular-devkit/schematics@^16.1.4 @rxap/schematics-ts-morph@^16.0.0-dev.7 @rxap/schematics-utilities@^16.0.0-dev.7 @rxap/xml-parser@^16.0.0-dev.6 ts-morph@^18.0.0
|
|
21
21
|
```
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxap/schematics-xml-parser",
|
|
3
|
-
"version": "16.0.0-dev.
|
|
4
|
-
"type": "
|
|
3
|
+
"version": "16.0.0-dev.8",
|
|
4
|
+
"type": "module",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular-devkit/core": "^16.1.4",
|
|
7
7
|
"@angular-devkit/schematics": "^16.1.4",
|
|
8
|
-
"@rxap/schematics-ts-morph": "^16.0.0-dev.
|
|
9
|
-
"@rxap/schematics-utilities": "^16.0.0-dev.
|
|
10
|
-
"@rxap/xml-parser": "^16.0.0-dev.
|
|
8
|
+
"@rxap/schematics-ts-morph": "^16.0.0-dev.7",
|
|
9
|
+
"@rxap/schematics-utilities": "^16.0.0-dev.7",
|
|
10
|
+
"@rxap/xml-parser": "^16.0.0-dev.6",
|
|
11
11
|
"ts-morph": "^18.0.0",
|
|
12
|
-
"@rxap/mixin": "16.0.0-dev.
|
|
13
|
-
"@rxap/node-utilities": "1.1.0-dev.
|
|
14
|
-
"@rxap/reflect-metadata": "1.0.1-dev.
|
|
15
|
-
"@rxap/utilities": "16.0.0-dev.
|
|
16
|
-
"@rxap/workspace-ts-morph": "0.0
|
|
17
|
-
"@rxap/workspace-utilities": "0.1.0-dev.
|
|
12
|
+
"@rxap/mixin": "16.0.0-dev.7",
|
|
13
|
+
"@rxap/node-utilities": "1.1.0-dev.2",
|
|
14
|
+
"@rxap/reflect-metadata": "1.0.1-dev.3",
|
|
15
|
+
"@rxap/utilities": "16.0.0-dev.10",
|
|
16
|
+
"@rxap/workspace-ts-morph": "0.1.0-dev.1",
|
|
17
|
+
"@rxap/workspace-utilities": "0.1.0-dev.4",
|
|
18
18
|
"@types/xmldom": "0.1.31",
|
|
19
19
|
"handlebars": "4.7.7"
|
|
20
20
|
},
|
|
@@ -55,19 +55,19 @@
|
|
|
55
55
|
"packageGroup": [
|
|
56
56
|
{
|
|
57
57
|
"package": "@rxap/schematics-ts-morph",
|
|
58
|
-
"version": "16.0.0-dev.
|
|
58
|
+
"version": "16.0.0-dev.7"
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
"package": "@rxap/schematics-utilities",
|
|
62
|
-
"version": "16.0.0-dev.
|
|
62
|
+
"version": "16.0.0-dev.7"
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
"package": "@rxap/xml-parser",
|
|
66
|
-
"version": "16.0.0-dev.
|
|
66
|
+
"version": "16.0.0-dev.6"
|
|
67
67
|
}
|
|
68
68
|
]
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "bbab80e59acbe435a02e69c9fec022780cf4640d",
|
|
71
71
|
"main": "./src/index.js",
|
|
72
72
|
"types": "./src/index.d.ts"
|
|
73
73
|
}
|
package/src/index.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
tslib_1.__exportStar(require("./lib"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./lib/elements"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./lib/elements/methods"), exports);
|
|
1
|
+
export * from './lib';
|
|
2
|
+
export * from './lib/elements';
|
|
3
|
+
export * from './lib/elements/methods';
|
|
7
4
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/schematic/xml-parser/src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/schematic/xml-parser/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./module.element"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./type.element"), exports);
|
|
1
|
+
export * from './module.element';
|
|
2
|
+
export * from './type.element';
|
|
6
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/xml-parser/src/lib/elements/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/xml-parser/src/lib/elements/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
tslib_1.__exportStar(require("./method.element"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./methods"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./open-api-remote-method.element"), exports);
|
|
1
|
+
export * from './method.element';
|
|
2
|
+
export * from './methods';
|
|
3
|
+
export * from './open-api-remote-method.element';
|
|
7
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/xml-parser/src/lib/elements/methods/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/xml-parser/src/lib/elements/methods/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,kCAAkC,CAAC"}
|
|
@@ -1,56 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const type_element_1 = require("../type.element");
|
|
11
|
-
const { dasherize, classify, camelize, } = core_1.strings;
|
|
12
|
-
let MethodElement = exports.MethodElement = class MethodElement {
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { ElementAttribute, ElementChild, ElementDef, ElementRequired, ElementTextContent, } from '@rxap/xml-parser';
|
|
3
|
+
import { join } from 'path';
|
|
4
|
+
import { strings } from '@angular-devkit/core';
|
|
5
|
+
import { CoerceSuffix } from '@rxap/schematics-utilities';
|
|
6
|
+
import { CoerceImports, CoerceMethodClassLegacy, CoerceSourceFile, } from '@rxap/schematics-ts-morph';
|
|
7
|
+
import { TypeElement } from '../type.element';
|
|
8
|
+
const { dasherize, classify, camelize, } = strings;
|
|
9
|
+
export let MethodElement = class MethodElement {
|
|
13
10
|
toValue({ sourceFile, project, }) {
|
|
14
11
|
if (this.from) {
|
|
15
|
-
|
|
12
|
+
CoerceImports(sourceFile, {
|
|
16
13
|
namedImports: [this.name],
|
|
17
14
|
moduleSpecifier: this.from,
|
|
18
15
|
});
|
|
19
16
|
return this.name;
|
|
20
17
|
}
|
|
21
18
|
else {
|
|
22
|
-
const methodName =
|
|
23
|
-
const methodFilePath =
|
|
24
|
-
const methodSourceFile =
|
|
19
|
+
const methodName = CoerceSuffix(classify(this.name), 'Method');
|
|
20
|
+
const methodFilePath = join('/methods', `${dasherize(this.name.replace(/[-_\s]?[m|M]ethod$/, ''))}.method.ts`);
|
|
21
|
+
const methodSourceFile = CoerceSourceFile(project, methodFilePath);
|
|
25
22
|
const methodOptions = {
|
|
26
23
|
statements: [`console.log('${dasherize(methodName)}', parameters);`],
|
|
27
24
|
};
|
|
28
25
|
if (this.parameterType) {
|
|
29
26
|
methodOptions.parameterType = this.parameterType.toValue({ sourceFile: methodSourceFile });
|
|
30
27
|
}
|
|
31
|
-
|
|
28
|
+
CoerceMethodClassLegacy(methodSourceFile, methodName, methodOptions);
|
|
32
29
|
return methodName;
|
|
33
30
|
}
|
|
34
31
|
}
|
|
35
32
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
__decorate([
|
|
34
|
+
ElementTextContent(),
|
|
35
|
+
ElementRequired(),
|
|
36
|
+
__metadata("design:type", String)
|
|
40
37
|
], MethodElement.prototype, "name", void 0);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
__decorate([
|
|
39
|
+
ElementAttribute(),
|
|
40
|
+
__metadata("design:type", String)
|
|
44
41
|
], MethodElement.prototype, "from", void 0);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
__decorate([
|
|
43
|
+
ElementAttribute(),
|
|
44
|
+
__metadata("design:type", Boolean)
|
|
48
45
|
], MethodElement.prototype, "mock", void 0);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
__decorate([
|
|
47
|
+
ElementChild(TypeElement),
|
|
48
|
+
__metadata("design:type", TypeElement)
|
|
52
49
|
], MethodElement.prototype, "parameterType", void 0);
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
MethodElement = __decorate([
|
|
51
|
+
ElementDef('method')
|
|
55
52
|
], MethodElement);
|
|
56
53
|
//# sourceMappingURL=method.element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method.element.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/xml-parser/src/lib/elements/methods/method.element.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"method.element.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/xml-parser/src/lib/elements/methods/method.element.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,eAAe,EACf,kBAAkB,GAEnB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAEL,aAAa,EACb,uBAAuB,EACvB,gBAAgB,GAEjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,EACJ,SAAS,EACT,QAAQ,EACR,QAAQ,GACT,GAAG,OAAO,CAAC;AAOL,WAAM,aAAa,GAAnB,MAAM,aAAa;IAejB,OAAO,CAAC,EACE,UAAU,EACV,OAAO,GACqC;QAC3D,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,aAAa,CAAC,UAAU,EAAE;gBACxB,YAAY,EAAE,CAAE,IAAI,CAAC,IAAI,CAAE;gBAC3B,eAAe,EAAE,IAAI,CAAC,IAAI;aAC3B,CAAC,CAAC;YACH,OAAO,IAAI,CAAC,IAAI,CAAC;SAClB;aAAM;YACL,MAAM,UAAU,GAAG,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC;YAC/D,MAAM,cAAc,GAAG,IAAI,CAAC,UAAU,EAAE,GAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAE,YAAY,CAAC,CAAC;YACjH,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;YACnE,MAAM,aAAa,GAA0B;gBAC3C,UAAU,EAAE,CAAE,gBAAiB,SAAS,CAAC,UAAU,CAAE,iBAAiB,CAAE;aACzE,CAAC;YACF,IAAI,IAAI,CAAC,aAAa,EAAE;gBACtB,aAAa,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC,CAAC;aAC5F;YACD,uBAAuB,CAAC,gBAAgB,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;YACrE,OAAO,UAAU,CAAC;SACnB;IACH,CAAC;CAEF,CAAA;AApCQ;IAFN,kBAAkB,EAAE;IACpB,eAAe,EAAE;;2CACG;AAGd;IADN,gBAAgB,EAAE;;2CACE;AAGd;IADN,gBAAgB,EAAE;;2CACG;AAGf;IADN,YAAY,CAAC,WAAW,CAAC;8BACH,WAAW;oDAAC;AAbxB,aAAa;IADzB,UAAU,CAAC,QAAQ,CAAC;GACR,aAAa,CAwCzB"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.Methods = [
|
|
7
|
-
method_element_1.MethodElement,
|
|
8
|
-
open_api_remote_method_element_1.OpenApiRemoteMethodElement,
|
|
1
|
+
import { MethodElement } from './method.element';
|
|
2
|
+
import { OpenApiRemoteMethodElement } from './open-api-remote-method.element';
|
|
3
|
+
export const Methods = [
|
|
4
|
+
MethodElement,
|
|
5
|
+
OpenApiRemoteMethodElement,
|
|
9
6
|
];
|
|
10
7
|
//# sourceMappingURL=methods.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"methods.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/xml-parser/src/lib/elements/methods/methods.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"methods.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/xml-parser/src/lib/elements/methods/methods.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAE9E,MAAM,CAAC,MAAM,OAAO,GAAsC;IACxD,aAAa;IACb,0BAA0B;CAC3B,CAAC"}
|
|
@@ -1,36 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
9
|
-
const { dasherize, classify, camelize, } = core_1.strings;
|
|
10
|
-
let OpenApiRemoteMethodElement = exports.OpenApiRemoteMethodElement = class OpenApiRemoteMethodElement {
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { ElementAttribute, ElementDef, ElementExtends, ElementRequired, ElementTextContent, } from '@rxap/xml-parser';
|
|
3
|
+
import { strings } from '@angular-devkit/core';
|
|
4
|
+
import { MethodElement, } from './method.element';
|
|
5
|
+
import { CoerceImports } from '@rxap/schematics-ts-morph';
|
|
6
|
+
const { dasherize, classify, camelize, } = strings;
|
|
7
|
+
export let OpenApiRemoteMethodElement = class OpenApiRemoteMethodElement {
|
|
11
8
|
toValue({ sourceFile, options, }) {
|
|
12
9
|
const openApiRemoteMethodName = classify(this.name) + 'RemoteMethod';
|
|
13
10
|
if (!options.openApiModule) {
|
|
14
11
|
throw new Error('The open api module is not defined!');
|
|
15
12
|
}
|
|
16
|
-
|
|
13
|
+
CoerceImports(sourceFile, {
|
|
17
14
|
namedImports: [openApiRemoteMethodName],
|
|
18
15
|
moduleSpecifier: `${options.openApiModule}/remote-methods/${dasherize(this.name)}.remote-method`,
|
|
19
16
|
});
|
|
20
17
|
return openApiRemoteMethodName;
|
|
21
18
|
}
|
|
22
19
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
__decorate([
|
|
21
|
+
ElementTextContent(),
|
|
22
|
+
ElementRequired(),
|
|
23
|
+
__metadata("design:type", String)
|
|
27
24
|
], OpenApiRemoteMethodElement.prototype, "name", void 0);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
__decorate([
|
|
26
|
+
ElementAttribute(),
|
|
27
|
+
__metadata("design:type", Boolean)
|
|
31
28
|
], OpenApiRemoteMethodElement.prototype, "mock", void 0);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
OpenApiRemoteMethodElement = __decorate([
|
|
30
|
+
ElementExtends(MethodElement),
|
|
31
|
+
ElementDef('open-api-remote-method')
|
|
35
32
|
], OpenApiRemoteMethodElement);
|
|
36
33
|
//# sourceMappingURL=open-api-remote-method.element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open-api-remote-method.element.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/xml-parser/src/lib/elements/methods/open-api-remote-method.element.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"open-api-remote-method.element.js","sourceRoot":"","sources":["../../../../../../../../packages/schematic/xml-parser/src/lib/elements/methods/open-api-remote-method.element.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,eAAe,EACf,kBAAkB,GAEnB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAEL,aAAa,GACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,MAAM,EACJ,SAAS,EACT,QAAQ,EACR,QAAQ,GACT,GAAG,OAAO,CAAC;AAIL,WAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAS9B,OAAO,CAAC,EACE,UAAU,EACV,OAAO,GACyD;QAE/E,MAAM,uBAAuB,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC;QAErE,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;YAC1B,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;SACxD;QAED,aAAa,CAAC,UAAU,EAAE;YACxB,YAAY,EAAE,CAAE,uBAAuB,CAAE;YACzC,eAAe,EAAE,GAAI,OAAO,CAAC,aAAc,mBAAoB,SAAS,CAAC,IAAI,CAAC,IAAI,CAAE,gBAAgB;SACrG,CAAC,CAAC;QAEH,OAAO,uBAAuB,CAAC;IAEjC,CAAC;CAEF,CAAA;AAzBQ;IAFN,kBAAkB,EAAE;IACpB,eAAe,EAAE;;wDACG;AAGd;IADN,gBAAgB,EAAE;;wDACG;AAPX,0BAA0B;IAFtC,cAAc,CAAC,aAAa,CAAC;IAC7B,UAAU,CAAC,wBAAwB,CAAC;GACxB,0BAA0B,CA6BtC"}
|
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
7
|
-
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
8
|
-
let ModuleElement = exports.ModuleElement = class ModuleElement {
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { ElementChildTextContent, ElementDef, ElementRequired, } from '@rxap/xml-parser';
|
|
3
|
+
import { noop, } from '@angular-devkit/schematics';
|
|
4
|
+
import { AddNgModuleImport, } from '@rxap/schematics-ts-morph';
|
|
5
|
+
export let ModuleElement = class ModuleElement {
|
|
9
6
|
handleComponentModule({ sourceFile, project, options, }) {
|
|
10
|
-
|
|
7
|
+
AddNgModuleImport(sourceFile, this.name, this.form);
|
|
11
8
|
}
|
|
12
9
|
toValue({ project, options, }) {
|
|
13
|
-
return
|
|
10
|
+
return noop();
|
|
14
11
|
}
|
|
15
12
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
__decorate([
|
|
14
|
+
ElementChildTextContent(),
|
|
15
|
+
ElementRequired(),
|
|
16
|
+
__metadata("design:type", String)
|
|
20
17
|
], ModuleElement.prototype, "name", void 0);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
__decorate([
|
|
19
|
+
ElementChildTextContent(),
|
|
20
|
+
__metadata("design:type", String)
|
|
24
21
|
], ModuleElement.prototype, "form", void 0);
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
ModuleElement = __decorate([
|
|
23
|
+
ElementDef('module')
|
|
27
24
|
], ModuleElement);
|
|
28
25
|
//# sourceMappingURL=module.element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.element.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/xml-parser/src/lib/elements/module.element.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.element.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/xml-parser/src/lib/elements/module.element.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,uBAAuB,EACvB,UAAU,EACV,eAAe,GAEhB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,IAAI,GAEL,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,iBAAiB,GAGlB,MAAM,2BAA2B,CAAC;AAG5B,WAAM,aAAa,GAAnB,MAAM,aAAa;IASjB,qBAAqB,CAAC,EACE,UAAU,EACV,OAAO,EACP,OAAO,GACqC;QACzE,iBAAiB,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAEM,OAAO,CAAC,EACE,OAAO,EACP,OAAO,GACQ;QAC9B,OAAO,IAAI,EAAE,CAAC;IAChB,CAAC;CAEF,CAAA;AApBQ;IAFN,uBAAuB,EAAE;IACzB,eAAe,EAAE;;2CACG;AAGd;IADN,uBAAuB,EAAE;;2CACL;AAPV,aAAa;IADzB,UAAU,CAAC,QAAQ,CAAC;GACR,aAAa,CAwBzB"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const xml_parser_1 = require("@rxap/xml-parser");
|
|
6
|
-
const schematics_ts_morph_1 = require("@rxap/schematics-ts-morph");
|
|
7
|
-
let TypeElement = exports.TypeElement = class TypeElement {
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { ElementAttribute, ElementChildTextContent, ElementDef, ElementExtends, ElementRequired, } from '@rxap/xml-parser';
|
|
3
|
+
import { CoerceImports } from '@rxap/schematics-ts-morph';
|
|
4
|
+
export let TypeElement = class TypeElement {
|
|
8
5
|
get type() {
|
|
9
6
|
if (this.nullable) {
|
|
10
7
|
return [this.name, 'null'].join(' | ');
|
|
@@ -13,7 +10,7 @@ let TypeElement = exports.TypeElement = class TypeElement {
|
|
|
13
10
|
}
|
|
14
11
|
toValue({ sourceFile }) {
|
|
15
12
|
if (this.from) {
|
|
16
|
-
|
|
13
|
+
CoerceImports(sourceFile, {
|
|
17
14
|
namedImports: [this.name],
|
|
18
15
|
moduleSpecifier: this.from,
|
|
19
16
|
});
|
|
@@ -21,30 +18,30 @@ let TypeElement = exports.TypeElement = class TypeElement {
|
|
|
21
18
|
return this.type;
|
|
22
19
|
}
|
|
23
20
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
__decorate([
|
|
22
|
+
ElementChildTextContent(),
|
|
23
|
+
ElementRequired(),
|
|
24
|
+
__metadata("design:type", String)
|
|
28
25
|
], TypeElement.prototype, "name", void 0);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
__decorate([
|
|
27
|
+
ElementChildTextContent(),
|
|
28
|
+
__metadata("design:type", String)
|
|
32
29
|
], TypeElement.prototype, "from", void 0);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
__decorate([
|
|
31
|
+
ElementAttribute(),
|
|
32
|
+
__metadata("design:type", Boolean)
|
|
36
33
|
], TypeElement.prototype, "nullable", void 0);
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
TypeElement = __decorate([
|
|
35
|
+
ElementDef('type')
|
|
39
36
|
], TypeElement);
|
|
40
|
-
let StringTypeElement =
|
|
37
|
+
export let StringTypeElement = class StringTypeElement extends TypeElement {
|
|
41
38
|
constructor() {
|
|
42
39
|
super(...arguments);
|
|
43
40
|
this.name = 'string';
|
|
44
41
|
}
|
|
45
42
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
StringTypeElement = __decorate([
|
|
44
|
+
ElementExtends(TypeElement),
|
|
45
|
+
ElementDef('string-type')
|
|
49
46
|
], StringTypeElement);
|
|
50
47
|
//# sourceMappingURL=type.element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.element.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/xml-parser/src/lib/elements/type.element.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"type.element.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/xml-parser/src/lib/elements/type.element.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,UAAU,EACV,cAAc,EACd,eAAe,GAEhB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAGnD,WAAM,WAAW,GAAjB,MAAM,WAAW;IAYtB,IAAW,IAAI;QACb,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,OAAO,CAAE,IAAI,CAAC,IAAI,EAAE,MAAM,CAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC1C;QACD,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAEM,OAAO,CAAC,EAAE,UAAU,EAA8B;QACvD,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,aAAa,CAAC,UAAU,EAAE;gBACxB,YAAY,EAAE,CAAE,IAAI,CAAC,IAAI,CAAE;gBAC3B,eAAe,EAAE,IAAI,CAAC,IAAI;aAC3B,CAAC,CAAC;SACJ;QACD,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CAEF,CAAA;AAzBQ;IAFN,uBAAuB,EAAE;IACzB,eAAe,EAAE;;yCACG;AAGd;IADN,uBAAuB,EAAE;;yCACL;AAGd;IADN,gBAAgB,EAAE;;6CACO;AAVf,WAAW;IADvB,UAAU,CAAC,MAAM,CAAC;GACN,WAAW,CA6BvB;AAIM,WAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,WAAW;IAA3C;;QAEW,SAAI,GAAG,QAAQ,CAAC;IAElC,CAAC;CAAA,CAAA;AAJY,iBAAiB;IAF7B,cAAc,CAAC,WAAW,CAAC;IAC3B,UAAU,CAAC,aAAa,CAAC;GACb,iBAAiB,CAI7B"}
|
package/src/lib/index.js
CHANGED
package/src/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/schematic/xml-parser/src/lib/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/schematic/xml-parser/src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
6
|
-
const path_1 = require("path");
|
|
7
|
-
function FindTemplate(template, host, basePath, baseDirEntry = host.getDir('templates')) {
|
|
1
|
+
import { XmlParserService, } from '@rxap/xml-parser';
|
|
2
|
+
import { coerceArray, } from '@rxap/schematics-utilities';
|
|
3
|
+
import { join } from 'path';
|
|
4
|
+
export function FindTemplate(template, host, basePath, baseDirEntry = host.getDir('templates')) {
|
|
8
5
|
if (basePath) {
|
|
9
|
-
const path =
|
|
6
|
+
const path = join(baseDirEntry.path, basePath, template);
|
|
10
7
|
if (host.exists(path)) {
|
|
11
8
|
return path;
|
|
12
9
|
}
|
|
@@ -15,7 +12,7 @@ function FindTemplate(template, host, basePath, baseDirEntry = host.getDir('temp
|
|
|
15
12
|
}
|
|
16
13
|
}
|
|
17
14
|
else {
|
|
18
|
-
const path =
|
|
15
|
+
const path = join(baseDirEntry.path, template);
|
|
19
16
|
if (host.exists(path)) {
|
|
20
17
|
return path;
|
|
21
18
|
}
|
|
@@ -24,7 +21,7 @@ function FindTemplate(template, host, basePath, baseDirEntry = host.getDir('temp
|
|
|
24
21
|
}
|
|
25
22
|
}
|
|
26
23
|
{
|
|
27
|
-
const path =
|
|
24
|
+
const path = join(baseDirEntry.path, 'shared', template);
|
|
28
25
|
if (host.exists(path)) {
|
|
29
26
|
return path;
|
|
30
27
|
}
|
|
@@ -34,7 +31,6 @@ function FindTemplate(template, host, basePath, baseDirEntry = host.getDir('temp
|
|
|
34
31
|
}
|
|
35
32
|
return null;
|
|
36
33
|
}
|
|
37
|
-
exports.FindTemplate = FindTemplate;
|
|
38
34
|
/**
|
|
39
35
|
* Parse the template and returns the ParsedElement object
|
|
40
36
|
*
|
|
@@ -71,11 +67,11 @@ exports.FindTemplate = FindTemplate;
|
|
|
71
67
|
* @param basePath the basePath for the search
|
|
72
68
|
* @param elements a collection of ParsedElement class constructors that should be include in the xml parsing
|
|
73
69
|
*/
|
|
74
|
-
function ParseTemplate(host, template, basePath, ...elements) {
|
|
70
|
+
export function ParseTemplate(host, template, basePath, ...elements) {
|
|
75
71
|
let templateFile;
|
|
76
72
|
let filename = '__inline__';
|
|
77
73
|
let templateFilePath = template;
|
|
78
|
-
const basePathList =
|
|
74
|
+
const basePathList = coerceArray(basePath);
|
|
79
75
|
if (template.match(/\.xml$/)) {
|
|
80
76
|
if (!host.exists(template)) {
|
|
81
77
|
for (const bp of basePathList) {
|
|
@@ -104,12 +100,11 @@ function ParseTemplate(host, template, basePath, ...elements) {
|
|
|
104
100
|
else {
|
|
105
101
|
templateFile = template;
|
|
106
102
|
}
|
|
107
|
-
const parser = new
|
|
103
|
+
const parser = new XmlParserService();
|
|
108
104
|
parser.register(...elements);
|
|
109
105
|
if (!templateFile) {
|
|
110
106
|
throw new Error('The template for the xml parser is not defined');
|
|
111
107
|
}
|
|
112
108
|
return parser.parseFromXml(templateFile, filename, templateFilePath);
|
|
113
109
|
}
|
|
114
|
-
exports.ParseTemplate = ParseTemplate;
|
|
115
110
|
//# sourceMappingURL=parse-template.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-template.js","sourceRoot":"","sources":["../../../../../../packages/schematic/xml-parser/src/lib/parse-template.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parse-template.js","sourceRoot":"","sources":["../../../../../../packages/schematic/xml-parser/src/lib/parse-template.ts"],"names":[],"mappings":"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"}
|