@abp/ng.schematics 5.0.0-beta.3 → 5.0.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/README.md +3 -3
- package/collection.json +29 -29
- package/commands/api/files-enum/proxy/__namespace@dir__/__name@kebab__.enum.ts.template +8 -8
- package/commands/api/files-model/proxy/__namespace@dir__/models.ts.template +9 -9
- package/commands/api/files-service/proxy/__namespace@dir__/__name@kebab__.service.ts.template +25 -25
- package/commands/api/schema.json +45 -45
- package/commands/proxy-add/schema.json +45 -45
- package/commands/proxy-index/schema.json +18 -18
- package/commands/proxy-refresh/schema.json +45 -45
- package/commands/proxy-remove/schema.json +45 -45
- package/constants/proxy.js +17 -17
- package/package.json +1 -1
- package/utils/angular/validation.js +10 -10
- package/utils/barrel.js +5 -5
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# ABP Suite Schematics
|
|
2
|
-
|
|
3
|
-
TODO: Add usage and development information
|
|
1
|
+
# ABP Suite Schematics
|
|
2
|
+
|
|
3
|
+
TODO: Add usage and development information
|
package/collection.json
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schematics": {
|
|
3
|
-
"proxy-add": {
|
|
4
|
-
"description": "ABP Proxy Generator Add Schematics",
|
|
5
|
-
"factory": "./commands/proxy-add",
|
|
6
|
-
"schema": "./commands/proxy-add/schema.json"
|
|
7
|
-
},
|
|
8
|
-
"proxy-index": {
|
|
9
|
-
"description": "ABP Proxy Generator Index Schematics",
|
|
10
|
-
"factory": "./commands/proxy-index",
|
|
11
|
-
"schema": "./commands/proxy-index/schema.json"
|
|
12
|
-
},
|
|
13
|
-
"proxy-refresh": {
|
|
14
|
-
"description": "ABP Proxy Generator Refresh Schematics",
|
|
15
|
-
"factory": "./commands/proxy-refresh",
|
|
16
|
-
"schema": "./commands/proxy-refresh/schema.json"
|
|
17
|
-
},
|
|
18
|
-
"proxy-remove": {
|
|
19
|
-
"description": "ABP Proxy Generator Remove Schematics",
|
|
20
|
-
"factory": "./commands/proxy-remove",
|
|
21
|
-
"schema": "./commands/proxy-remove/schema.json"
|
|
22
|
-
},
|
|
23
|
-
"api": {
|
|
24
|
-
"description": "ABP API Generator Schematics",
|
|
25
|
-
"factory": "./commands/api",
|
|
26
|
-
"schema": "./commands/api/schema.json"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"schematics": {
|
|
3
|
+
"proxy-add": {
|
|
4
|
+
"description": "ABP Proxy Generator Add Schematics",
|
|
5
|
+
"factory": "./commands/proxy-add",
|
|
6
|
+
"schema": "./commands/proxy-add/schema.json"
|
|
7
|
+
},
|
|
8
|
+
"proxy-index": {
|
|
9
|
+
"description": "ABP Proxy Generator Index Schematics",
|
|
10
|
+
"factory": "./commands/proxy-index",
|
|
11
|
+
"schema": "./commands/proxy-index/schema.json"
|
|
12
|
+
},
|
|
13
|
+
"proxy-refresh": {
|
|
14
|
+
"description": "ABP Proxy Generator Refresh Schematics",
|
|
15
|
+
"factory": "./commands/proxy-refresh",
|
|
16
|
+
"schema": "./commands/proxy-refresh/schema.json"
|
|
17
|
+
},
|
|
18
|
+
"proxy-remove": {
|
|
19
|
+
"description": "ABP Proxy Generator Remove Schematics",
|
|
20
|
+
"factory": "./commands/proxy-remove",
|
|
21
|
+
"schema": "./commands/proxy-remove/schema.json"
|
|
22
|
+
},
|
|
23
|
+
"api": {
|
|
24
|
+
"description": "ABP API Generator Schematics",
|
|
25
|
+
"factory": "./commands/api",
|
|
26
|
+
"schema": "./commands/api/schema.json"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { mapEnumToOptions } from '@abp/ng.core';
|
|
2
|
-
|
|
3
|
-
export enum <%= name %> {<%
|
|
4
|
-
for (let member of members) { %>
|
|
5
|
-
<%= member.key %> = <%= quote(member.value) %>,<% } %>
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const <%= camel(name) %>Options = mapEnumToOptions(<%= name %>);
|
|
1
|
+
import { mapEnumToOptions } from '@abp/ng.core';
|
|
2
|
+
|
|
3
|
+
export enum <%= name %> {<%
|
|
4
|
+
for (let member of members) { %>
|
|
5
|
+
<%= member.key %> = <%= quote(member.value) %>,<% } %>
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const <%= camel(name) %>Options = mapEnumToOptions(<%= name %>);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
<%
|
|
2
|
-
for (const {keyword, specifiers, path} of imports) {
|
|
3
|
-
%><%= keyword %> { <%= specifiers.join(', ') %> } from '<%= path %>';
|
|
4
|
-
<% }
|
|
5
|
-
for (let {base, identifier, properties} of interfaces) { %>
|
|
6
|
-
export interface <%= identifier %> <%= base ? `extends ${base} ` : '' %>{<%
|
|
7
|
-
for (let {name, optional, type} of properties) { %>
|
|
8
|
-
<%= name + optional %>: <%= type %>;<% } %>
|
|
9
|
-
}
|
|
1
|
+
<%
|
|
2
|
+
for (const {keyword, specifiers, path} of imports) {
|
|
3
|
+
%><%= keyword %> { <%= specifiers.join(', ') %> } from '<%= path %>';
|
|
4
|
+
<% }
|
|
5
|
+
for (let {base, identifier, properties} of interfaces) { %>
|
|
6
|
+
export interface <%= identifier %> <%= base ? `extends ${base} ` : '' %>{<%
|
|
7
|
+
for (let {name, optional, type} of properties) { %>
|
|
8
|
+
<%= name + optional %>: <%= type %>;<% } %>
|
|
9
|
+
}
|
|
10
10
|
<% } %>
|
package/commands/api/files-service/proxy/__namespace@dir__/__name@kebab__.service.ts.template
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
<% for (const {keyword, specifiers, path} of imports) {
|
|
2
|
-
%><%= keyword %> { <%= specifiers.join(', ') %> } from '<%= path %>';
|
|
3
|
-
<% } %>
|
|
4
|
-
@Injectable({
|
|
5
|
-
providedIn: 'root',
|
|
6
|
-
})
|
|
7
|
-
export class <%= name %>Service {
|
|
8
|
-
apiName = '<%= apiName %>';<%
|
|
9
|
-
for (let {body, signature} of methods) { %>
|
|
10
|
-
|
|
11
|
-
<%= camel(signature.name) %> = (<%= serializeParameters(signature.parameters) %>) =>
|
|
12
|
-
this.restService.request<<%= body.requestType %>, <%= body.responseType %>>({
|
|
13
|
-
method: '<%= body.method %>',<%
|
|
14
|
-
if (body.responseType === 'string') { %>
|
|
15
|
-
responseType: 'text',<% } %>
|
|
16
|
-
url: <%= body.url %>,<%
|
|
17
|
-
if (body.params.length) { %>
|
|
18
|
-
params: { <%= body.params.join(', ') %> },<% }
|
|
19
|
-
if (body.body) { %>
|
|
20
|
-
body: <%= body.body %>,<% } %>
|
|
21
|
-
},
|
|
22
|
-
{ apiName: this.apiName });<% } %>
|
|
23
|
-
|
|
24
|
-
constructor(private restService: RestService) {}
|
|
25
|
-
}
|
|
1
|
+
<% for (const {keyword, specifiers, path} of imports) {
|
|
2
|
+
%><%= keyword %> { <%= specifiers.join(', ') %> } from '<%= path %>';
|
|
3
|
+
<% } %>
|
|
4
|
+
@Injectable({
|
|
5
|
+
providedIn: 'root',
|
|
6
|
+
})
|
|
7
|
+
export class <%= name %>Service {
|
|
8
|
+
apiName = '<%= apiName %>';<%
|
|
9
|
+
for (let {body, signature} of methods) { %>
|
|
10
|
+
|
|
11
|
+
<%= camel(signature.name) %> = (<%= serializeParameters(signature.parameters) %>) =>
|
|
12
|
+
this.restService.request<<%= body.requestType %>, <%= body.responseType %>>({
|
|
13
|
+
method: '<%= body.method %>',<%
|
|
14
|
+
if (body.responseType === 'string') { %>
|
|
15
|
+
responseType: 'text',<% } %>
|
|
16
|
+
url: <%= body.url %>,<%
|
|
17
|
+
if (body.params.length) { %>
|
|
18
|
+
params: { <%= body.params.join(', ') %> },<% }
|
|
19
|
+
if (body.body) { %>
|
|
20
|
+
body: <%= body.body %>,<% } %>
|
|
21
|
+
},
|
|
22
|
+
{ apiName: this.apiName });<% } %>
|
|
23
|
+
|
|
24
|
+
constructor(private restService: RestService) {}
|
|
25
|
+
}
|
package/commands/api/schema.json
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"id": "SchematicsAbpGenerateAPI",
|
|
4
|
-
"title": "ABP Generate API Schema",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {
|
|
7
|
-
"module": {
|
|
8
|
-
"description": "Backend module name",
|
|
9
|
-
"type": "string",
|
|
10
|
-
"$default": {
|
|
11
|
-
"$source": "argv",
|
|
12
|
-
"index": 0
|
|
13
|
-
},
|
|
14
|
-
"x-prompt": "Please enter backend module name. (default: \"app\")"
|
|
15
|
-
},
|
|
16
|
-
"apiName": {
|
|
17
|
-
"description": "Backend api name, a.k.a. remoteServiceName",
|
|
18
|
-
"type": "string",
|
|
19
|
-
"$default": {
|
|
20
|
-
"$source": "argv",
|
|
21
|
-
"index": 1
|
|
22
|
-
},
|
|
23
|
-
"x-prompt": "Please enter backend api name, a.k.a. remoteServiceName. (default: \"default\")"
|
|
24
|
-
},
|
|
25
|
-
"source": {
|
|
26
|
-
"description": "Source Angular project for API definition URL & root namespace resolution",
|
|
27
|
-
"type": "string",
|
|
28
|
-
"$default": {
|
|
29
|
-
"$source": "argv",
|
|
30
|
-
"index": 2
|
|
31
|
-
},
|
|
32
|
-
"x-prompt": "Please enter source Angular project for API definition URL & root namespace resolution. (default: workspace \"defaultProject\")"
|
|
33
|
-
},
|
|
34
|
-
"target": {
|
|
35
|
-
"description": "Target Angular project to place the generated code",
|
|
36
|
-
"type": "string",
|
|
37
|
-
"$default": {
|
|
38
|
-
"$source": "argv",
|
|
39
|
-
"index": 3
|
|
40
|
-
},
|
|
41
|
-
"x-prompt": "Please enter target Angular project to place the generated code. (default: workspace \"defaultProject\")"
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
"required": []
|
|
45
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"id": "SchematicsAbpGenerateAPI",
|
|
4
|
+
"title": "ABP Generate API Schema",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"module": {
|
|
8
|
+
"description": "Backend module name",
|
|
9
|
+
"type": "string",
|
|
10
|
+
"$default": {
|
|
11
|
+
"$source": "argv",
|
|
12
|
+
"index": 0
|
|
13
|
+
},
|
|
14
|
+
"x-prompt": "Please enter backend module name. (default: \"app\")"
|
|
15
|
+
},
|
|
16
|
+
"apiName": {
|
|
17
|
+
"description": "Backend api name, a.k.a. remoteServiceName",
|
|
18
|
+
"type": "string",
|
|
19
|
+
"$default": {
|
|
20
|
+
"$source": "argv",
|
|
21
|
+
"index": 1
|
|
22
|
+
},
|
|
23
|
+
"x-prompt": "Please enter backend api name, a.k.a. remoteServiceName. (default: \"default\")"
|
|
24
|
+
},
|
|
25
|
+
"source": {
|
|
26
|
+
"description": "Source Angular project for API definition URL & root namespace resolution",
|
|
27
|
+
"type": "string",
|
|
28
|
+
"$default": {
|
|
29
|
+
"$source": "argv",
|
|
30
|
+
"index": 2
|
|
31
|
+
},
|
|
32
|
+
"x-prompt": "Please enter source Angular project for API definition URL & root namespace resolution. (default: workspace \"defaultProject\")"
|
|
33
|
+
},
|
|
34
|
+
"target": {
|
|
35
|
+
"description": "Target Angular project to place the generated code",
|
|
36
|
+
"type": "string",
|
|
37
|
+
"$default": {
|
|
38
|
+
"$source": "argv",
|
|
39
|
+
"index": 3
|
|
40
|
+
},
|
|
41
|
+
"x-prompt": "Please enter target Angular project to place the generated code. (default: workspace \"defaultProject\")"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"required": []
|
|
45
|
+
}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"id": "SchematicsAbpGenerateProxy",
|
|
4
|
-
"title": "ABP Generate Proxy Schema",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {
|
|
7
|
-
"module": {
|
|
8
|
-
"description": "Backend module name",
|
|
9
|
-
"type": "string",
|
|
10
|
-
"$default": {
|
|
11
|
-
"$source": "argv",
|
|
12
|
-
"index": 0
|
|
13
|
-
},
|
|
14
|
-
"x-prompt": "Please enter backend module name. (default: \"app\")"
|
|
15
|
-
},
|
|
16
|
-
"apiName": {
|
|
17
|
-
"description": "Backend api name, a.k.a. remoteServiceName",
|
|
18
|
-
"type": "string",
|
|
19
|
-
"$default": {
|
|
20
|
-
"$source": "argv",
|
|
21
|
-
"index": 1
|
|
22
|
-
},
|
|
23
|
-
"x-prompt": "Please enter backend api name, a.k.a. remoteServiceName. (default: \"default\")"
|
|
24
|
-
},
|
|
25
|
-
"source": {
|
|
26
|
-
"description": "Source Angular project for API definition URL & root namespace resolution",
|
|
27
|
-
"type": "string",
|
|
28
|
-
"$default": {
|
|
29
|
-
"$source": "argv",
|
|
30
|
-
"index": 2
|
|
31
|
-
},
|
|
32
|
-
"x-prompt": "Please enter source Angular project for API definition URL & root namespace resolution. (default: workspace \"defaultProject\")"
|
|
33
|
-
},
|
|
34
|
-
"target": {
|
|
35
|
-
"description": "Target Angular project to place the generated code",
|
|
36
|
-
"type": "string",
|
|
37
|
-
"$default": {
|
|
38
|
-
"$source": "argv",
|
|
39
|
-
"index": 3
|
|
40
|
-
},
|
|
41
|
-
"x-prompt": "Please enter target Angular project to place the generated code. (default: workspace \"defaultProject\")"
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
"required": []
|
|
45
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"id": "SchematicsAbpGenerateProxy",
|
|
4
|
+
"title": "ABP Generate Proxy Schema",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"module": {
|
|
8
|
+
"description": "Backend module name",
|
|
9
|
+
"type": "string",
|
|
10
|
+
"$default": {
|
|
11
|
+
"$source": "argv",
|
|
12
|
+
"index": 0
|
|
13
|
+
},
|
|
14
|
+
"x-prompt": "Please enter backend module name. (default: \"app\")"
|
|
15
|
+
},
|
|
16
|
+
"apiName": {
|
|
17
|
+
"description": "Backend api name, a.k.a. remoteServiceName",
|
|
18
|
+
"type": "string",
|
|
19
|
+
"$default": {
|
|
20
|
+
"$source": "argv",
|
|
21
|
+
"index": 1
|
|
22
|
+
},
|
|
23
|
+
"x-prompt": "Please enter backend api name, a.k.a. remoteServiceName. (default: \"default\")"
|
|
24
|
+
},
|
|
25
|
+
"source": {
|
|
26
|
+
"description": "Source Angular project for API definition URL & root namespace resolution",
|
|
27
|
+
"type": "string",
|
|
28
|
+
"$default": {
|
|
29
|
+
"$source": "argv",
|
|
30
|
+
"index": 2
|
|
31
|
+
},
|
|
32
|
+
"x-prompt": "Please enter source Angular project for API definition URL & root namespace resolution. (default: workspace \"defaultProject\")"
|
|
33
|
+
},
|
|
34
|
+
"target": {
|
|
35
|
+
"description": "Target Angular project to place the generated code",
|
|
36
|
+
"type": "string",
|
|
37
|
+
"$default": {
|
|
38
|
+
"$source": "argv",
|
|
39
|
+
"index": 3
|
|
40
|
+
},
|
|
41
|
+
"x-prompt": "Please enter target Angular project to place the generated code. (default: workspace \"defaultProject\")"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"required": []
|
|
45
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"id": "SchematicsAbpIndexProxy",
|
|
4
|
-
"title": "ABP Index Proxy Schema",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {
|
|
7
|
-
"target": {
|
|
8
|
-
"description": "Target Angular project to place the generated code",
|
|
9
|
-
"type": "string",
|
|
10
|
-
"$default": {
|
|
11
|
-
"$source": "argv",
|
|
12
|
-
"index": 0
|
|
13
|
-
},
|
|
14
|
-
"x-prompt": "Please enter target Angular project to place the generated code. (default: workspace \"defaultProject\")"
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"required": []
|
|
18
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"id": "SchematicsAbpIndexProxy",
|
|
4
|
+
"title": "ABP Index Proxy Schema",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"target": {
|
|
8
|
+
"description": "Target Angular project to place the generated code",
|
|
9
|
+
"type": "string",
|
|
10
|
+
"$default": {
|
|
11
|
+
"$source": "argv",
|
|
12
|
+
"index": 0
|
|
13
|
+
},
|
|
14
|
+
"x-prompt": "Please enter target Angular project to place the generated code. (default: workspace \"defaultProject\")"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"required": []
|
|
18
|
+
}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"id": "SchematicsAbpGenerateProxy",
|
|
4
|
-
"title": "ABP Generate Proxy Schema",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {
|
|
7
|
-
"module": {
|
|
8
|
-
"description": "Backend module name",
|
|
9
|
-
"type": "string",
|
|
10
|
-
"$default": {
|
|
11
|
-
"$source": "argv",
|
|
12
|
-
"index": 0
|
|
13
|
-
},
|
|
14
|
-
"x-prompt": "Please enter backend module name. (default: \"app\")"
|
|
15
|
-
},
|
|
16
|
-
"apiName": {
|
|
17
|
-
"description": "Backend api name, a.k.a. remoteServiceName",
|
|
18
|
-
"type": "string",
|
|
19
|
-
"$default": {
|
|
20
|
-
"$source": "argv",
|
|
21
|
-
"index": 1
|
|
22
|
-
},
|
|
23
|
-
"x-prompt": "Please enter backend api name, a.k.a. remoteServiceName. (default: \"default\")"
|
|
24
|
-
},
|
|
25
|
-
"source": {
|
|
26
|
-
"description": "Source Angular project for API definition URL & root namespace resolution",
|
|
27
|
-
"type": "string",
|
|
28
|
-
"$default": {
|
|
29
|
-
"$source": "argv",
|
|
30
|
-
"index": 2
|
|
31
|
-
},
|
|
32
|
-
"x-prompt": "Please enter source Angular project for API definition URL & root namespace resolution. (default: workspace \"defaultProject\")"
|
|
33
|
-
},
|
|
34
|
-
"target": {
|
|
35
|
-
"description": "Target Angular project to place the generated code",
|
|
36
|
-
"type": "string",
|
|
37
|
-
"$default": {
|
|
38
|
-
"$source": "argv",
|
|
39
|
-
"index": 3
|
|
40
|
-
},
|
|
41
|
-
"x-prompt": "Please enter target Angular project to place the generated code. (default: workspace \"defaultProject\")"
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
"required": []
|
|
45
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"id": "SchematicsAbpGenerateProxy",
|
|
4
|
+
"title": "ABP Generate Proxy Schema",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"module": {
|
|
8
|
+
"description": "Backend module name",
|
|
9
|
+
"type": "string",
|
|
10
|
+
"$default": {
|
|
11
|
+
"$source": "argv",
|
|
12
|
+
"index": 0
|
|
13
|
+
},
|
|
14
|
+
"x-prompt": "Please enter backend module name. (default: \"app\")"
|
|
15
|
+
},
|
|
16
|
+
"apiName": {
|
|
17
|
+
"description": "Backend api name, a.k.a. remoteServiceName",
|
|
18
|
+
"type": "string",
|
|
19
|
+
"$default": {
|
|
20
|
+
"$source": "argv",
|
|
21
|
+
"index": 1
|
|
22
|
+
},
|
|
23
|
+
"x-prompt": "Please enter backend api name, a.k.a. remoteServiceName. (default: \"default\")"
|
|
24
|
+
},
|
|
25
|
+
"source": {
|
|
26
|
+
"description": "Source Angular project for API definition URL & root namespace resolution",
|
|
27
|
+
"type": "string",
|
|
28
|
+
"$default": {
|
|
29
|
+
"$source": "argv",
|
|
30
|
+
"index": 2
|
|
31
|
+
},
|
|
32
|
+
"x-prompt": "Please enter source Angular project for API definition URL & root namespace resolution. (default: workspace \"defaultProject\")"
|
|
33
|
+
},
|
|
34
|
+
"target": {
|
|
35
|
+
"description": "Target Angular project to place the generated code",
|
|
36
|
+
"type": "string",
|
|
37
|
+
"$default": {
|
|
38
|
+
"$source": "argv",
|
|
39
|
+
"index": 3
|
|
40
|
+
},
|
|
41
|
+
"x-prompt": "Please enter target Angular project to place the generated code. (default: workspace \"defaultProject\")"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"required": []
|
|
45
|
+
}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"id": "SchematicsAbpGenerateProxy",
|
|
4
|
-
"title": "ABP Generate Proxy Schema",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {
|
|
7
|
-
"module": {
|
|
8
|
-
"description": "Backend module name",
|
|
9
|
-
"type": "string",
|
|
10
|
-
"$default": {
|
|
11
|
-
"$source": "argv",
|
|
12
|
-
"index": 0
|
|
13
|
-
},
|
|
14
|
-
"x-prompt": "Please enter backend module name. (default: \"app\")"
|
|
15
|
-
},
|
|
16
|
-
"apiName": {
|
|
17
|
-
"description": "Backend api name, a.k.a. remoteServiceName",
|
|
18
|
-
"type": "string",
|
|
19
|
-
"$default": {
|
|
20
|
-
"$source": "argv",
|
|
21
|
-
"index": 1
|
|
22
|
-
},
|
|
23
|
-
"x-prompt": "Please enter backend api name, a.k.a. remoteServiceName. (default: \"default\")"
|
|
24
|
-
},
|
|
25
|
-
"source": {
|
|
26
|
-
"description": "Source Angular project for API definition URL & root namespace resolution",
|
|
27
|
-
"type": "string",
|
|
28
|
-
"$default": {
|
|
29
|
-
"$source": "argv",
|
|
30
|
-
"index": 2
|
|
31
|
-
},
|
|
32
|
-
"x-prompt": "Please enter source Angular project for API definition URL & root namespace resolution. (default: workspace \"defaultProject\")"
|
|
33
|
-
},
|
|
34
|
-
"target": {
|
|
35
|
-
"description": "Target Angular project to place the generated code",
|
|
36
|
-
"type": "string",
|
|
37
|
-
"$default": {
|
|
38
|
-
"$source": "argv",
|
|
39
|
-
"index": 3
|
|
40
|
-
},
|
|
41
|
-
"x-prompt": "Please enter target Angular project to place the generated code. (default: workspace \"defaultProject\")"
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
"required": []
|
|
45
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"id": "SchematicsAbpGenerateProxy",
|
|
4
|
+
"title": "ABP Generate Proxy Schema",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"module": {
|
|
8
|
+
"description": "Backend module name",
|
|
9
|
+
"type": "string",
|
|
10
|
+
"$default": {
|
|
11
|
+
"$source": "argv",
|
|
12
|
+
"index": 0
|
|
13
|
+
},
|
|
14
|
+
"x-prompt": "Please enter backend module name. (default: \"app\")"
|
|
15
|
+
},
|
|
16
|
+
"apiName": {
|
|
17
|
+
"description": "Backend api name, a.k.a. remoteServiceName",
|
|
18
|
+
"type": "string",
|
|
19
|
+
"$default": {
|
|
20
|
+
"$source": "argv",
|
|
21
|
+
"index": 1
|
|
22
|
+
},
|
|
23
|
+
"x-prompt": "Please enter backend api name, a.k.a. remoteServiceName. (default: \"default\")"
|
|
24
|
+
},
|
|
25
|
+
"source": {
|
|
26
|
+
"description": "Source Angular project for API definition URL & root namespace resolution",
|
|
27
|
+
"type": "string",
|
|
28
|
+
"$default": {
|
|
29
|
+
"$source": "argv",
|
|
30
|
+
"index": 2
|
|
31
|
+
},
|
|
32
|
+
"x-prompt": "Please enter source Angular project for API definition URL & root namespace resolution. (default: workspace \"defaultProject\")"
|
|
33
|
+
},
|
|
34
|
+
"target": {
|
|
35
|
+
"description": "Target Angular project to place the generated code",
|
|
36
|
+
"type": "string",
|
|
37
|
+
"$default": {
|
|
38
|
+
"$source": "argv",
|
|
39
|
+
"index": 3
|
|
40
|
+
},
|
|
41
|
+
"x-prompt": "Please enter target Angular project to place the generated code. (default: workspace \"defaultProject\")"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"required": []
|
|
45
|
+
}
|
package/constants/proxy.js
CHANGED
|
@@ -4,22 +4,22 @@ exports.PROXY_WARNING = exports.PROXY_WARNING_PATH = exports.PROXY_CONFIG_PATH =
|
|
|
4
4
|
exports.PROXY_PATH = '/proxy';
|
|
5
5
|
exports.PROXY_CONFIG_PATH = `${exports.PROXY_PATH}/generate-proxy.json`;
|
|
6
6
|
exports.PROXY_WARNING_PATH = `${exports.PROXY_PATH}/README.md`;
|
|
7
|
-
exports.PROXY_WARNING = `# Proxy Generation Output
|
|
8
|
-
|
|
9
|
-
This directory includes the output of the latest proxy generation.
|
|
10
|
-
The files and folders in it will be overwritten when proxy generation is run again.
|
|
11
|
-
Therefore, please do not place your own content in this folder.
|
|
12
|
-
|
|
13
|
-
In addition, \`generate-proxy.json\` works like a lock file.
|
|
14
|
-
It includes information used by the proxy generator, so please do not delete or modify it.
|
|
15
|
-
|
|
16
|
-
Finally, the name of the files and folders should not be changed for two reasons:
|
|
17
|
-
- Proxy generator will keep creating them at those paths and you will have multiple copies of the same content.
|
|
18
|
-
- ABP Suite generates files which include imports from this folder.
|
|
19
|
-
|
|
20
|
-
> **Important Notice:** If you are building a module and are planning to publish to npm,
|
|
21
|
-
> some of the generated proxies are likely to be exported from public-api.ts file. In such a case,
|
|
22
|
-
> please make sure you export files directly and not from barrel exports. In other words,
|
|
23
|
-
> do not include index.ts exports in your public-api.ts exports.
|
|
7
|
+
exports.PROXY_WARNING = `# Proxy Generation Output
|
|
8
|
+
|
|
9
|
+
This directory includes the output of the latest proxy generation.
|
|
10
|
+
The files and folders in it will be overwritten when proxy generation is run again.
|
|
11
|
+
Therefore, please do not place your own content in this folder.
|
|
12
|
+
|
|
13
|
+
In addition, \`generate-proxy.json\` works like a lock file.
|
|
14
|
+
It includes information used by the proxy generator, so please do not delete or modify it.
|
|
15
|
+
|
|
16
|
+
Finally, the name of the files and folders should not be changed for two reasons:
|
|
17
|
+
- Proxy generator will keep creating them at those paths and you will have multiple copies of the same content.
|
|
18
|
+
- ABP Suite generates files which include imports from this folder.
|
|
19
|
+
|
|
20
|
+
> **Important Notice:** If you are building a module and are planning to publish to npm,
|
|
21
|
+
> some of the generated proxies are likely to be exported from public-api.ts file. In such a case,
|
|
22
|
+
> please make sure you export files directly and not from barrel exports. In other words,
|
|
23
|
+
> do not include index.ts exports in your public-api.ts exports.
|
|
24
24
|
`;
|
|
25
25
|
//# sourceMappingURL=proxy.js.map
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@ const core_1 = require("@angular-devkit/core");
|
|
|
12
12
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
13
13
|
function validateName(name) {
|
|
14
14
|
if (name && /^\d/.test(name)) {
|
|
15
|
-
throw new schematics_1.SchematicsException(core_1.tags.oneLine `name (${name})
|
|
15
|
+
throw new schematics_1.SchematicsException(core_1.tags.oneLine `name (${name})
|
|
16
16
|
can not start with a digit.`);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -22,7 +22,7 @@ exports.validateName = validateName;
|
|
|
22
22
|
exports.htmlSelectorRe = /^[a-zA-Z][.0-9a-zA-Z]*(:?-[a-zA-Z][.0-9a-zA-Z]*)*$/;
|
|
23
23
|
function validateHtmlSelector(selector) {
|
|
24
24
|
if (selector && !exports.htmlSelectorRe.test(selector)) {
|
|
25
|
-
throw new schematics_1.SchematicsException(core_1.tags.oneLine `Selector (${selector})
|
|
25
|
+
throw new schematics_1.SchematicsException(core_1.tags.oneLine `Selector (${selector})
|
|
26
26
|
is invalid.`);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -32,15 +32,15 @@ function validateProjectName(projectName) {
|
|
|
32
32
|
const unsupportedProjectNames = [];
|
|
33
33
|
const packageNameRegex = /^(?:@[a-zA-Z0-9_-]+\/)?[a-zA-Z0-9_-]+$/;
|
|
34
34
|
if (errorIndex !== null) {
|
|
35
|
-
const firstMessage = core_1.tags.oneLine `
|
|
36
|
-
Project name "${projectName}" is not valid. New project names must
|
|
37
|
-
start with a letter, and must contain only alphanumeric characters or dashes.
|
|
38
|
-
When adding a dash the segment after the dash must also start with a letter.
|
|
35
|
+
const firstMessage = core_1.tags.oneLine `
|
|
36
|
+
Project name "${projectName}" is not valid. New project names must
|
|
37
|
+
start with a letter, and must contain only alphanumeric characters or dashes.
|
|
38
|
+
When adding a dash the segment after the dash must also start with a letter.
|
|
39
39
|
`;
|
|
40
|
-
const msg = core_1.tags.stripIndent `
|
|
41
|
-
${firstMessage}
|
|
42
|
-
${projectName}
|
|
43
|
-
${Array(errorIndex + 1).join(' ') + '^'}
|
|
40
|
+
const msg = core_1.tags.stripIndent `
|
|
41
|
+
${firstMessage}
|
|
42
|
+
${projectName}
|
|
43
|
+
${Array(errorIndex + 1).join(' ') + '^'}
|
|
44
44
|
`;
|
|
45
45
|
throw new schematics_1.SchematicsException(msg);
|
|
46
46
|
}
|
package/utils/barrel.js
CHANGED
|
@@ -26,19 +26,19 @@ exports.generateBarrelFromPath = generateBarrelFromPath;
|
|
|
26
26
|
function generateBarrelContent(asterisk, named) {
|
|
27
27
|
const namedImports = !named.imports.length
|
|
28
28
|
? ''
|
|
29
|
-
: named.imports.join(`
|
|
29
|
+
: named.imports.join(`
|
|
30
30
|
`) +
|
|
31
|
-
`
|
|
31
|
+
`
|
|
32
32
|
`;
|
|
33
33
|
const namedExports = !named.exports.length
|
|
34
34
|
? ''
|
|
35
|
-
: `export { ${named.exports.join(', ')} };
|
|
35
|
+
: `export { ${named.exports.join(', ')} };
|
|
36
36
|
`;
|
|
37
37
|
const asteriskExports = !asterisk.exports.length
|
|
38
38
|
? ''
|
|
39
|
-
: asterisk.exports.join(`
|
|
39
|
+
: asterisk.exports.join(`
|
|
40
40
|
`) +
|
|
41
|
-
`
|
|
41
|
+
`
|
|
42
42
|
`;
|
|
43
43
|
return namedImports + asteriskExports + namedExports;
|
|
44
44
|
}
|