@linyjs/plugin-templates 0.0.11 → 0.0.13
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.
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Uncomment and modify the code below to create your own UI.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type { IModule } from '@linyjs/client-module-interface';
|
|
8
|
+
import type { IModule, IServiceDef } from '@linyjs/client-module-interface';
|
|
9
9
|
import React from 'react';
|
|
10
10
|
|
|
11
11
|
// Example Page Component
|
|
@@ -34,16 +34,16 @@ class ExampleRouteService {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
const exampleRouteDef: IServiceDef = {
|
|
38
|
+
serviceTag: 'exampleRoute',
|
|
39
|
+
serviceImpl: ExampleRouteService,
|
|
40
|
+
meta: { usageType: 'route' }
|
|
41
|
+
};
|
|
42
|
+
|
|
37
43
|
// Define the client module
|
|
38
44
|
export const exampleClientModule: IModule = {
|
|
39
45
|
name: 'exampleClient',
|
|
40
|
-
serviceDefs: [
|
|
41
|
-
{
|
|
42
|
-
serviceTag: 'exampleRoute',
|
|
43
|
-
serviceImpl: ExampleRouteService,
|
|
44
|
-
meta: { usageType: 'route' }
|
|
45
|
-
}
|
|
46
|
-
]
|
|
46
|
+
serviceDefs: [exampleRouteDef]
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
// Export the module (required)
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Uncomment and modify the code below to create your own API.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type { IModule } from '@linyjs/server-module-interface';
|
|
8
|
+
import type { IModule, IServiceDef } from '@linyjs/server-module-interface';
|
|
9
9
|
|
|
10
10
|
// Example Controller
|
|
11
11
|
class ExampleController {
|
|
@@ -27,16 +27,16 @@ class ExampleController {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
const exampleControllerDef: IServiceDef = {
|
|
31
|
+
serviceTag: 'exampleController',
|
|
32
|
+
serviceImpl: ExampleController,
|
|
33
|
+
meta: { usageType: 'controller' }
|
|
34
|
+
};
|
|
35
|
+
|
|
30
36
|
// Define the server module
|
|
31
37
|
export const exampleServerModule: IModule = {
|
|
32
38
|
name: 'exampleServer',
|
|
33
|
-
serviceDefs: [
|
|
34
|
-
{
|
|
35
|
-
serviceTag: 'exampleController',
|
|
36
|
-
serviceImpl: ExampleController,
|
|
37
|
-
meta: { usageType: 'controller' }
|
|
38
|
-
}
|
|
39
|
-
]
|
|
39
|
+
serviceDefs: [exampleControllerDef]
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
// Export the module (required)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linyjs/plugin-templates",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "Templates for linyjs framework plugins",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ling",
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
"templates"
|
|
9
9
|
],
|
|
10
10
|
"license": "MIT",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "echo \"No build step\""
|
|
13
|
+
},
|
|
11
14
|
"files": [
|
|
12
15
|
"default-template"
|
|
13
16
|
]
|