@rhtml/schematics 0.0.132 → 0.0.134
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/collection.json +6 -1
- package/dist/lib/component/schema.json +1 -1
- package/dist/lib/controller/controller.factory.d.ts +3 -0
- package/dist/lib/controller/controller.factory.js +62 -0
- package/dist/lib/controller/controller.factory.ts +92 -0
- package/dist/lib/controller/files/ts/__name__.controller.spec.ts +33 -0
- package/dist/lib/controller/files/ts/__name__.controller.ts +16 -0
- package/dist/lib/controller/schema.json +49 -0
- package/dist/lib/module/schema.json +4 -4
- package/dist/lib/provider/schema.json +4 -4
- package/dist/lib/service/schema.json +3 -3
- package/dist/lib/service/service.factory.js +1 -2
- package/dist/lib/service/service.factory.ts +1 -2
- package/dist/utils/metadata.manager.d.ts +65 -2
- package/dist/utils/metadata.manager.js +103 -23
- package/dist/utils/metadata.manager.ts +127 -46
- package/dist/utils/module-import.declarator.d.ts +31 -2
- package/dist/utils/module-import.declarator.js +42 -10
- package/dist/utils/module-import.declarator.ts +45 -12
- package/dist/utils/module-metadata.declarator.d.ts +12 -0
- package/dist/utils/module-metadata.declarator.js +13 -1
- package/dist/utils/module-metadata.declarator.ts +13 -1
- package/dist/utils/module.declarator.d.ts +21 -1
- package/dist/utils/module.declarator.js +23 -1
- package/dist/utils/module.declarator.ts +24 -2
- package/dist/utils/module.finder.d.ts +12 -0
- package/dist/utils/module.finder.js +13 -1
- package/dist/utils/module.finder.ts +13 -1
- package/dist/utils/name.parser.d.ts +6 -0
- package/dist/utils/name.parser.js +6 -0
- package/dist/utils/name.parser.ts +6 -0
- package/dist/utils/path.solver.d.ts +7 -0
- package/dist/utils/path.solver.js +7 -0
- package/dist/utils/path.solver.ts +7 -0
- package/dist/utils/source-root.helpers.d.ts +13 -1
- package/dist/utils/source-root.helpers.js +13 -1
- package/dist/utils/source-root.helpers.ts +14 -2
- package/package.json +5 -5
- package/src/lib/component/schema.json +1 -1
- package/src/lib/controller/controller.factory.ts +92 -0
- package/src/lib/controller/files/ts/__name__.controller.spec.ts +33 -0
- package/src/lib/controller/files/ts/__name__.controller.ts +16 -0
- package/src/lib/controller/schema.json +49 -0
- package/src/lib/module/schema.json +4 -4
- package/src/lib/provider/schema.json +4 -4
- package/src/lib/service/schema.json +3 -3
- package/src/lib/service/service.factory.ts +1 -2
- package/src/utils/metadata.manager.ts +127 -46
- package/src/utils/module-import.declarator.ts +45 -12
- package/src/utils/module-metadata.declarator.ts +13 -1
- package/src/utils/module.declarator.ts +24 -2
- package/src/utils/module.finder.ts +13 -1
- package/src/utils/name.parser.ts +6 -0
- package/src/utils/path.solver.ts +7 -0
- package/src/utils/source-root.helpers.ts +14 -2
package/collection.json
CHANGED
|
@@ -20,6 +20,11 @@
|
|
|
20
20
|
"factory": "./dist/lib/service/service.factory#main",
|
|
21
21
|
"description": "Create a @rhtml service.",
|
|
22
22
|
"schema": "./dist/lib/service/schema.json"
|
|
23
|
+
},
|
|
24
|
+
"controller": {
|
|
25
|
+
"factory": "./dist/lib/controller/controller.factory#main",
|
|
26
|
+
"description": "Create a @rhtml controller.",
|
|
27
|
+
"schema": "./dist/lib/controller/schema.json"
|
|
23
28
|
}
|
|
24
29
|
}
|
|
25
|
-
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.main = void 0;
|
|
4
|
+
const core_1 = require("@angular-devkit/core");
|
|
5
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
|
+
const module_declarator_1 = require("../../utils/module.declarator");
|
|
7
|
+
const module_finder_1 = require("../../utils/module.finder");
|
|
8
|
+
const name_parser_1 = require("../../utils/name.parser");
|
|
9
|
+
const source_root_helpers_1 = require("../../utils/source-root.helpers");
|
|
10
|
+
const defaults_1 = require("../defaults");
|
|
11
|
+
const ELEMENT_METADATA = 'bootstrap';
|
|
12
|
+
const ELEMENT_TYPE = 'controller';
|
|
13
|
+
function main(options) {
|
|
14
|
+
options = transform(options);
|
|
15
|
+
return (tree, context) => {
|
|
16
|
+
return (0, schematics_1.branchAndMerge)((0, schematics_1.chain)([
|
|
17
|
+
(0, source_root_helpers_1.mergeSourceRoot)(options),
|
|
18
|
+
(0, schematics_1.mergeWith)(generate(options)),
|
|
19
|
+
addDeclarationToModule(options),
|
|
20
|
+
]))(tree, context);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
exports.main = main;
|
|
24
|
+
function transform(source) {
|
|
25
|
+
const target = Object.assign({}, source);
|
|
26
|
+
target.metadata = ELEMENT_METADATA;
|
|
27
|
+
target.type = ELEMENT_TYPE;
|
|
28
|
+
const location = new name_parser_1.NameParser().parse(target);
|
|
29
|
+
target.name = core_1.strings.dasherize(location.name);
|
|
30
|
+
target.path = core_1.strings.dasherize(location.path);
|
|
31
|
+
target.language =
|
|
32
|
+
target.language !== undefined ? target.language : defaults_1.DEFAULT_LANGUAGE;
|
|
33
|
+
target.path = target.flat
|
|
34
|
+
? target.path
|
|
35
|
+
: (0, core_1.join)(target.path, target.name);
|
|
36
|
+
return target;
|
|
37
|
+
}
|
|
38
|
+
function generate(options) {
|
|
39
|
+
return (context) => (0, schematics_1.apply)((0, schematics_1.url)((0, core_1.join)('./files', options.language)), [
|
|
40
|
+
options.spec ? (0, schematics_1.noop)() : (0, schematics_1.filter)((path) => !path.endsWith('.spec.ts')),
|
|
41
|
+
(0, schematics_1.template)(Object.assign(Object.assign({}, core_1.strings), options)),
|
|
42
|
+
(0, schematics_1.move)(options.path),
|
|
43
|
+
])(context);
|
|
44
|
+
}
|
|
45
|
+
function addDeclarationToModule(options) {
|
|
46
|
+
return (tree) => {
|
|
47
|
+
if (options.skipImport !== undefined && options.skipImport) {
|
|
48
|
+
return tree;
|
|
49
|
+
}
|
|
50
|
+
options.module = new module_finder_1.ModuleFinder(tree).find({
|
|
51
|
+
name: options.name,
|
|
52
|
+
path: options.path,
|
|
53
|
+
});
|
|
54
|
+
if (!options.module) {
|
|
55
|
+
return tree;
|
|
56
|
+
}
|
|
57
|
+
const content = tree.read(options.module).toString();
|
|
58
|
+
const declarator = new module_declarator_1.ModuleDeclarator();
|
|
59
|
+
tree.overwrite(options.module, declarator.declare(content, options));
|
|
60
|
+
return tree;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { join, Path, strings } from '@angular-devkit/core';
|
|
2
|
+
import {
|
|
3
|
+
apply,
|
|
4
|
+
branchAndMerge,
|
|
5
|
+
chain,
|
|
6
|
+
filter,
|
|
7
|
+
mergeWith,
|
|
8
|
+
move,
|
|
9
|
+
noop,
|
|
10
|
+
Rule,
|
|
11
|
+
SchematicContext,
|
|
12
|
+
template,
|
|
13
|
+
Tree,
|
|
14
|
+
url,
|
|
15
|
+
} from '@angular-devkit/schematics';
|
|
16
|
+
|
|
17
|
+
import {
|
|
18
|
+
DeclarationOptions,
|
|
19
|
+
ModuleDeclarator,
|
|
20
|
+
} from '../../utils/module.declarator';
|
|
21
|
+
import { ModuleFinder } from '../../utils/module.finder';
|
|
22
|
+
import { Location, NameParser } from '../../utils/name.parser';
|
|
23
|
+
import { mergeSourceRoot } from '../../utils/source-root.helpers';
|
|
24
|
+
import { DEFAULT_LANGUAGE } from '../defaults';
|
|
25
|
+
import { ControllerOptions } from './controller.schema';
|
|
26
|
+
|
|
27
|
+
const ELEMENT_METADATA = 'bootstrap';
|
|
28
|
+
const ELEMENT_TYPE = 'controller';
|
|
29
|
+
|
|
30
|
+
export function main(options: ControllerOptions): Rule {
|
|
31
|
+
options = transform(options);
|
|
32
|
+
return (tree: Tree, context: SchematicContext) => {
|
|
33
|
+
return branchAndMerge(
|
|
34
|
+
chain([
|
|
35
|
+
mergeSourceRoot(options),
|
|
36
|
+
mergeWith(generate(options)),
|
|
37
|
+
addDeclarationToModule(options),
|
|
38
|
+
])
|
|
39
|
+
)(tree, context);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function transform(source: ControllerOptions): ControllerOptions {
|
|
44
|
+
const target: ControllerOptions = Object.assign({}, source);
|
|
45
|
+
target.metadata = ELEMENT_METADATA;
|
|
46
|
+
target.type = ELEMENT_TYPE;
|
|
47
|
+
|
|
48
|
+
const location: Location = new NameParser().parse(target);
|
|
49
|
+
target.name = strings.dasherize(location.name);
|
|
50
|
+
target.path = strings.dasherize(location.path);
|
|
51
|
+
target.language =
|
|
52
|
+
target.language !== undefined ? target.language : DEFAULT_LANGUAGE;
|
|
53
|
+
|
|
54
|
+
target.path = target.flat
|
|
55
|
+
? target.path
|
|
56
|
+
: join(target.path as Path, target.name);
|
|
57
|
+
return target;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function generate(options: ControllerOptions) {
|
|
61
|
+
return (context: SchematicContext) =>
|
|
62
|
+
apply(url(join('./files' as Path, options.language)), [
|
|
63
|
+
options.spec ? noop() : filter((path) => !path.endsWith('.spec.ts')),
|
|
64
|
+
template({
|
|
65
|
+
...strings,
|
|
66
|
+
...options,
|
|
67
|
+
}),
|
|
68
|
+
move(options.path),
|
|
69
|
+
])(context);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function addDeclarationToModule(options: ControllerOptions): Rule {
|
|
73
|
+
return (tree: Tree) => {
|
|
74
|
+
if (options.skipImport !== undefined && options.skipImport) {
|
|
75
|
+
return tree;
|
|
76
|
+
}
|
|
77
|
+
options.module = new ModuleFinder(tree).find({
|
|
78
|
+
name: options.name,
|
|
79
|
+
path: options.path as Path,
|
|
80
|
+
});
|
|
81
|
+
if (!options.module) {
|
|
82
|
+
return tree;
|
|
83
|
+
}
|
|
84
|
+
const content = tree.read(options.module).toString();
|
|
85
|
+
const declarator: ModuleDeclarator = new ModuleDeclarator();
|
|
86
|
+
tree.overwrite(
|
|
87
|
+
options.module,
|
|
88
|
+
declarator.declare(content, options as DeclarationOptions)
|
|
89
|
+
);
|
|
90
|
+
return tree;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Bootstrap, get, Module } from '@rhtml/di'
|
|
2
|
+
import { FastifyModule } from '@rhtml/fastify'
|
|
3
|
+
import fastify from 'fastify'
|
|
4
|
+
|
|
5
|
+
import { <%= classify(name) %>Controller } from './<%= name %>.controller';
|
|
6
|
+
|
|
7
|
+
describe('<%= classify(name) %> Controller', () => {
|
|
8
|
+
let <%= decamelize(name) %>Controller: <%= classify(name) %>Controller
|
|
9
|
+
|
|
10
|
+
beforeAll(async () => {
|
|
11
|
+
@Module({
|
|
12
|
+
imports: [
|
|
13
|
+
FastifyModule.forRoot(fastify, {
|
|
14
|
+
logger: true,
|
|
15
|
+
}),
|
|
16
|
+
],
|
|
17
|
+
bootstrap: [<%= classify(name) %>Controller],
|
|
18
|
+
})
|
|
19
|
+
class AppModule {}
|
|
20
|
+
|
|
21
|
+
await Bootstrap(AppModule)
|
|
22
|
+
<%= decamelize(name) %>Controller = get(<%= classify(name) %>Controller)
|
|
23
|
+
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('e2e: get => (<%= classify(name) %>) : Should sucessfully return expected result', async () => {
|
|
27
|
+
const response = {
|
|
28
|
+
hello: 'world',
|
|
29
|
+
}
|
|
30
|
+
const result = await <%= decamelize(name) %>Controller.get<%= classify(name) %>()
|
|
31
|
+
expect(result).toEqual(response)
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Controller, Route } from '@rhtml/fastify'
|
|
2
|
+
|
|
3
|
+
@Controller({
|
|
4
|
+
route: '/<%= decamelize(name) %>',
|
|
5
|
+
})
|
|
6
|
+
export class <%= classify(name) %>Controller {
|
|
7
|
+
|
|
8
|
+
@Route({
|
|
9
|
+
method: 'GET',
|
|
10
|
+
})
|
|
11
|
+
get<%= classify(name) %>() {
|
|
12
|
+
return {
|
|
13
|
+
hello: 'world'
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "SchematicsRHTMLController",
|
|
4
|
+
"title": "RHTML Controller Options Schema",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"name": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The name of the controller.",
|
|
10
|
+
"$default": {
|
|
11
|
+
"$source": "argv",
|
|
12
|
+
"index": 0
|
|
13
|
+
},
|
|
14
|
+
"x-prompt": "What name would you like to use for the controller?"
|
|
15
|
+
},
|
|
16
|
+
"path": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"format": "path",
|
|
19
|
+
"description": "The path to create the controller."
|
|
20
|
+
},
|
|
21
|
+
"language": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"description": "RHTML controller language (ts/js)."
|
|
24
|
+
},
|
|
25
|
+
"sourceRoot": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "RHTML controller source root directory."
|
|
28
|
+
},
|
|
29
|
+
"skipImport": {
|
|
30
|
+
"description": "Flag to skip the module import.",
|
|
31
|
+
"default": false
|
|
32
|
+
},
|
|
33
|
+
"module": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"description": "Allows specification of the declaring module."
|
|
36
|
+
},
|
|
37
|
+
"flat": {
|
|
38
|
+
"default": false,
|
|
39
|
+
"description": "Flag to indicate if a directory is created."
|
|
40
|
+
},
|
|
41
|
+
"spec": {
|
|
42
|
+
"default": true,
|
|
43
|
+
"description": "Specifies if a spec file is generated."
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"required": [
|
|
47
|
+
"name"
|
|
48
|
+
]
|
|
49
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"id": "
|
|
4
|
-
"title": "
|
|
3
|
+
"$id": "SchematicsRhtmlModule",
|
|
4
|
+
"title": "Rhtml Module Options Schema",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"properties": {
|
|
7
7
|
"name": {
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
},
|
|
26
26
|
"language": {
|
|
27
27
|
"type": "string",
|
|
28
|
-
"description": "
|
|
28
|
+
"description": "Rhtml module language (ts/js)."
|
|
29
29
|
},
|
|
30
30
|
"sourceRoot": {
|
|
31
31
|
"type": "string",
|
|
32
|
-
"description": "
|
|
32
|
+
"description": "Rhtml module source root directory."
|
|
33
33
|
},
|
|
34
34
|
"skipImport": {
|
|
35
35
|
"description": "Flag to skip the module import.",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"id": "
|
|
4
|
-
"title": "
|
|
3
|
+
"$id": "SchematicsRhtmlProvider",
|
|
4
|
+
"title": "Rhtml Provider Options Schema",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"properties": {
|
|
7
7
|
"name": {
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
},
|
|
21
21
|
"language": {
|
|
22
22
|
"type": "string",
|
|
23
|
-
"description": "
|
|
23
|
+
"description": "Rhtml provider language (ts/js)."
|
|
24
24
|
},
|
|
25
25
|
"sourceRoot": {
|
|
26
26
|
"type": "string",
|
|
27
|
-
"description": "
|
|
27
|
+
"description": "Rhtml provider source root directory."
|
|
28
28
|
},
|
|
29
29
|
"flat": {
|
|
30
30
|
"default": true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"id": "
|
|
4
|
-
"title": "
|
|
3
|
+
"$id": "SchematicsRhtmlService",
|
|
4
|
+
"title": "Rhtml Service Options Schema",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"properties": {
|
|
7
7
|
"name": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"language": {
|
|
22
22
|
"type": "string",
|
|
23
|
-
"description": "
|
|
23
|
+
"description": "Rhtml service language (ts/js)."
|
|
24
24
|
},
|
|
25
25
|
"sourceRoot": {
|
|
26
26
|
"type": "string",
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.main = void 0;
|
|
4
4
|
const core_1 = require("@angular-devkit/core");
|
|
5
5
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
|
-
const util_1 = require("util");
|
|
7
6
|
const module_declarator_1 = require("../../utils/module.declarator");
|
|
8
7
|
const module_finder_1 = require("../../utils/module.finder");
|
|
9
8
|
const name_parser_1 = require("../../utils/name.parser");
|
|
@@ -30,7 +29,7 @@ function transform(source) {
|
|
|
30
29
|
const target = Object.assign({}, source);
|
|
31
30
|
target.metadata = 'providers';
|
|
32
31
|
target.type = 'service';
|
|
33
|
-
if (
|
|
32
|
+
if (!target.name) {
|
|
34
33
|
throw new schematics_1.SchematicsException('Option (name) is required.');
|
|
35
34
|
}
|
|
36
35
|
const location = new name_parser_1.NameParser().parse(target);
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
Tree,
|
|
15
15
|
url,
|
|
16
16
|
} from '@angular-devkit/schematics';
|
|
17
|
-
import { isNullOrUndefined } from 'util';
|
|
18
17
|
|
|
19
18
|
import {
|
|
20
19
|
DeclarationOptions,
|
|
@@ -52,7 +51,7 @@ function transform(source: ServiceOptions): ServiceOptions {
|
|
|
52
51
|
target.metadata = 'providers';
|
|
53
52
|
target.type = 'service';
|
|
54
53
|
|
|
55
|
-
if (
|
|
54
|
+
if (!target.name) {
|
|
56
55
|
throw new SchematicsException('Option (name) is required.');
|
|
57
56
|
}
|
|
58
57
|
const location: Location = new NameParser().parse(target);
|
|
@@ -1,13 +1,76 @@
|
|
|
1
1
|
import { DeclarationOptions } from './module.declarator';
|
|
2
|
+
/**
|
|
3
|
+
* The `MetadataManager` class provides utilities for managing metadata entries
|
|
4
|
+
* within a `@Module` decorator in a TypeScript source file. It allows for the
|
|
5
|
+
* insertion of new metadata entries, merging symbols with static options, and
|
|
6
|
+
* handling various scenarios such as empty module decorators or existing metadata
|
|
7
|
+
* properties.
|
|
8
|
+
*/
|
|
2
9
|
export declare class MetadataManager {
|
|
3
10
|
private content;
|
|
4
11
|
constructor(content: string);
|
|
5
|
-
|
|
6
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Inserts a new metadata entry into the `@Module` decorator.
|
|
14
|
+
*
|
|
15
|
+
* @param metadata - The metadata key to insert.
|
|
16
|
+
* @param symbol - The symbol to insert.
|
|
17
|
+
* @param staticOptions - The static options to insert.
|
|
18
|
+
* @returns The new content string.
|
|
19
|
+
*/
|
|
20
|
+
insert(metadata: string, symbol: string, staticOptions?: DeclarationOptions['staticOptions']): string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Finds the first `@Module` decorator metadata in the source file.
|
|
23
|
+
*
|
|
24
|
+
* @param source - The source file to search.
|
|
25
|
+
* @param identifier - The identifier to match.
|
|
26
|
+
* @returns The first matching `ObjectLiteralExpression` or undefined.
|
|
27
|
+
*/
|
|
28
|
+
private findFirstDecoratorMetadata;
|
|
29
|
+
/**
|
|
30
|
+
* Returns an array of all nodes in the source file.
|
|
31
|
+
*/
|
|
7
32
|
private getSourceNodes;
|
|
33
|
+
/**
|
|
34
|
+
* Inserts a new metadata entry into an empty `@Module` decorator.
|
|
35
|
+
* This method is called when the `@Module` decorator has no properties.
|
|
36
|
+
* It inserts the metadata and symbol into the decorator.
|
|
37
|
+
* @param expr - The `@Module` decorator node.
|
|
38
|
+
* @param metadata - The metadata key to insert.
|
|
39
|
+
* @param symbol - The symbol to insert.
|
|
40
|
+
* @returns The new content string.
|
|
41
|
+
*/
|
|
8
42
|
private insertMetadataToEmptyModuleDecorator;
|
|
43
|
+
/**
|
|
44
|
+
* Inserts a new symbol into an existing metadata property in the `@Module` decorator.
|
|
45
|
+
* This method is called when the metadata property already exists in the decorator.
|
|
46
|
+
* It inserts the symbol into the existing metadata property.
|
|
47
|
+
* @param source - The source file.
|
|
48
|
+
* @param matchingProperties - The matching metadata properties.
|
|
49
|
+
* @param symbol - The symbol to insert.
|
|
50
|
+
* @param staticOptions - The static options to insert.
|
|
51
|
+
* @returns The new content string.
|
|
52
|
+
*/
|
|
9
53
|
private insertNewMetadataToDecorator;
|
|
54
|
+
/**
|
|
55
|
+
* Inserts a new symbol into an existing metadata property in the `@Module` decorator.
|
|
56
|
+
* This method is called when the metadata property already exists in the decorator.
|
|
57
|
+
* It inserts the symbol into the existing metadata property.
|
|
58
|
+
* @param source - The source file.
|
|
59
|
+
* @param matchingProperties - The matching metadata properties.
|
|
60
|
+
* @param symbol - The symbol to insert.
|
|
61
|
+
* @param staticOptions - The static options to insert.
|
|
62
|
+
* @returns The new content string.
|
|
63
|
+
*/
|
|
10
64
|
private insertSymbolToMetadata;
|
|
65
|
+
/**
|
|
66
|
+
* Merges a symbol with static options into a single string.
|
|
67
|
+
* @param symbol - The symbol to merge.
|
|
68
|
+
* @param staticOptions - The static options to merge.
|
|
69
|
+
* @returns The merged string.
|
|
70
|
+
*/
|
|
11
71
|
private mergeSymbolAndExpr;
|
|
72
|
+
/**
|
|
73
|
+
* Adds blank lines around an expression.
|
|
74
|
+
*/
|
|
12
75
|
private addBlankLines;
|
|
13
76
|
}
|