@rws-framework/client 2.7.2 → 2.8.1
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/.emerge-vis-output/fast-element/emerge-file_result_dependency_graph.graphml +126 -127
- package/.emerge-vis-output/fast-element/emerge-filesystem_graph.graphml +122 -123
- package/.emerge-vis-output/fast-element/emerge-statistics-and-metrics.json +1 -1
- package/.emerge-vis-output/fast-element/emerge-statistics-metrics.txt +43 -44
- package/.emerge-vis-output/fast-element/html/resources/js/emerge_data.js +9 -9
- package/.emerge-vis-output/fast-foundation/emerge-file_result_dependency_graph.graphml +1351 -1339
- package/.emerge-vis-output/fast-foundation/emerge-filesystem_graph.graphml +1314 -1299
- package/.emerge-vis-output/fast-foundation/emerge-statistics-and-metrics.json +1 -1
- package/.emerge-vis-output/fast-foundation/emerge-statistics-metrics.txt +1024 -1016
- package/.emerge-vis-output/fast-foundation/html/resources/js/emerge_data.js +9 -9
- package/.emerge-vis-output/rws-client/emerge-file_result_dependency_graph.graphml +61 -61
- package/.emerge-vis-output/rws-client/emerge-filesystem_graph.graphml +34 -34
- package/.emerge-vis-output/rws-client/emerge-statistics-and-metrics.json +1 -1
- package/.emerge-vis-output/rws-client/emerge-statistics-metrics.txt +623 -623
- package/.emerge-vis-output/rws-client/html/emerge.html +0 -0
- package/.emerge-vis-output/rws-client/html/jsconfig.json +0 -0
- package/.emerge-vis-output/rws-client/html/resources/css/custom.css +0 -0
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_common.js +0 -0
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_data.js +9 -9
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_git.js +0 -0
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_graph.js +0 -0
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_heatmap.js +0 -0
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_hull.js +0 -0
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_main.js +0 -0
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_search.js +0 -0
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_ui.js +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-grid.css +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-grid.css.map +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-grid.min.css +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-grid.min.css.map +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-grid.rtl.css +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-grid.rtl.css.map +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-grid.rtl.min.css +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-grid.rtl.min.css.map +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-reboot.css +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-reboot.css.map +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-reboot.min.css +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-reboot.min.css.map +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-reboot.rtl.css +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-reboot.rtl.css.map +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-reboot.rtl.min.css +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-reboot.rtl.min.css.map +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-utilities.css +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-utilities.css.map +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-utilities.min.css +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-utilities.min.css.map +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-utilities.rtl.css +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-utilities.rtl.css.map +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-utilities.rtl.min.css +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-utilities.rtl.min.css.map +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap.css +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap.css.map +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap.min.css +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap.min.css.map +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap.rtl.css +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap.rtl.css.map +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap.rtl.min.css +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap.rtl.min.css.map +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/js/bootstrap.bundle.js +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/js/bootstrap.bundle.js.map +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/js/bootstrap.bundle.min.js +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/js/bootstrap.bundle.min.js.map +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/js/bootstrap.esm.js +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/js/bootstrap.esm.js.map +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/js/bootstrap.esm.min.js +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/js/bootstrap.esm.min.js.map +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/js/bootstrap.js +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/js/bootstrap.js.map +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/js/bootstrap.min.js +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/js/bootstrap.min.js.map +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/d3/d3.v7.8.4.min.js +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/d3/d3.v7.min.js +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/dark-mode-switch/css/dark-mode.css +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/dark-mode-switch/js/dark-mode-switch.min.js +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/daterangepicker/daterangepicker.css +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/daterangepicker/daterangepicker.min.js +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/daterangepicker/moment.min.js +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/jquery/jquery-3.6.0.min.js +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/popper/popper.min.js +0 -0
- package/.emerge-vis-output/rws-client/html/vendors/simpleheat/simpleheat.js +0 -0
- package/PLUGINS.MD +188 -0
- package/README.md +6 -1
- package/_tools.js +30 -24
- package/cfg/tsconfigSetup.js +9 -1
- package/docs/assets/main.js +4 -4
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +7 -5
- package/docs/classes/ApiServiceInstance.html +26 -26
- package/docs/classes/ConfigServiceInstance.html +22 -21
- package/docs/classes/DOMServiceInstance.html +18 -18
- package/docs/classes/NotifyServiceInstance.html +16 -16
- package/docs/classes/RWSClientInstance.html +46 -0
- package/docs/classes/RWSPlugin.html +14 -0
- package/docs/classes/RWSService.html +11 -11
- package/docs/classes/RWSViewComponent.html +893 -705
- package/docs/classes/ServiceWorkerServiceInstance.html +14 -14
- package/docs/classes/UtilsServiceInstance.html +14 -14
- package/docs/functions/ApiService.html +1 -1
- package/docs/functions/ConfigService.html +1 -1
- package/docs/functions/DOMService.html +1 -1
- package/docs/functions/NotifyService.html +1 -1
- package/docs/functions/RWSClient.html +1 -0
- package/docs/functions/RWSContainer.html +1 -1
- package/docs/functions/RWSIgnore.html +1 -1
- package/docs/functions/RWSInject.html +1 -1
- package/docs/functions/RWSView.html +1 -1
- package/docs/functions/ServiceWorkerService.html +1 -1
- package/docs/functions/UtilsService.html +1 -1
- package/docs/functions/attr.html +6 -6
- package/docs/functions/declareRWSComponents.html +1 -1
- package/docs/functions/ngAttr.html +1 -1
- package/docs/functions/observable.html +4 -4
- package/docs/functions/provideRWSDesignSystem.html +1 -1
- package/docs/functions/sanitizedAttr.html +1 -1
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +3 -2
- package/docs/interfaces/HTMLAttributes.html +1 -1
- package/docs/interfaces/HTMLTag.html +4 -4
- package/docs/interfaces/IRWSConfig.html +21 -20
- package/docs/interfaces/IRWSDecoratorOptions.html +6 -6
- package/docs/interfaces/IRWSHttpRoute.html +3 -3
- package/docs/interfaces/IRWSPrefixedHTTProutes.html +3 -3
- package/docs/interfaces/IRWSUser.html +6 -6
- package/docs/modules.html +46 -53
- package/docs/types/DOMOutputType.html +1 -1
- package/docs/types/DefaultRWSPluginOptionsType.html +1 -0
- package/docs/types/HTMLTagTransformerType.html +1 -1
- package/docs/types/IRWSAssetShowOptions.html +1 -1
- package/docs/types/IRWSBackendRoute.html +1 -1
- package/docs/types/NotifyLogType.html +1 -1
- package/docs/types/NotifyUiType.html +1 -1
- package/docs/types/RWSNotify.html +1 -1
- package/docs/types/RWSPluginEntry.html +1 -0
- package/docs/types/TagsProcessorType.html +1 -1
- package/package.json +1 -1
- package/rws.webpack.config.js +25 -21
- package/src/client/components.ts +16 -4
- package/src/client/config.ts +38 -7
- package/src/client.ts +12 -17
- package/src/components/_component.ts +1 -3
- package/src/components/_decorator.ts +21 -3
- package/src/components/index.ts +1 -3
- package/src/components/loader/component.ts +1 -1
- package/src/index.ts +12 -26
- package/src/interfaces/IRWSConfig.ts +6 -1
- package/src/interfaces/RWSWindow.ts +5 -2
- package/src/plugins/_builder.js +32 -0
- package/src/plugins/_plugin.ts +63 -0
- package/src/services/ConfigService.ts +9 -1
- package/src/services/ServiceWorkerService.ts +1 -1
- package/tsconfig.json +3 -0
- package/webpack/loaders/rws_fast_ts_loader.js +80 -53
- package/docs/assets/icons.js +0 -15
- package/docs/assets/icons.svg +0 -1
- package/docs/classes/RWSRouter.html +0 -10
- package/docs/classes/RoutingServiceInstance.html +0 -18
- package/docs/classes/WSServiceInstance.html +0 -38
- package/docs/functions/RoutingService.html +0 -1
- package/docs/functions/WSService.html +0 -1
- package/docs/functions/realtimeWebSuiteClientPackage.html +0 -1
- package/docs/functions/renderRouteComponent.html +0 -1
- package/docs/interfaces/IRoutingEvent.html +0 -3
- package/docs/types/IRWSFrontRoutes.html +0 -1
- package/docs/types/IRWSRouteResult.html +0 -1
- package/docs/types/IRWSWebsocketStatus.html +0 -1
- package/docs/types/RouteReturn.html +0 -1
- package/docs/variables/_ROUTING_EVENT_NAME.html +0 -1
- package/package.webpack.config.js +0 -17
- package/src/components/router/component.ts +0 -79
- package/src/components/router/template.html +0 -1
- package/src/routing/_router.ts +0 -61
- package/src/routing/index.ts +0 -7
- package/src/run.ts +0 -33
- package/src/services/RoutingService.ts +0 -47
- package/src/services/WSService.ts +0 -226
- package/src/services/_ws_handlers/ConnectionHandler.ts +0 -52
- package/src/services/_ws_handlers/EventHandler.ts +0 -28
- package/src/services/_ws_handlers/MessageHandler.ts +0 -49
- package/tsdoc.json +0 -0
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-grid.rtl.min.css.map
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-reboot.min.css.map
CHANGED
|
File without changes
|
|
File without changes
|
package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-reboot.rtl.css.map
CHANGED
|
File without changes
|
package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-reboot.rtl.min.css
CHANGED
|
File without changes
|
package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-reboot.rtl.min.css.map
CHANGED
|
File without changes
|
|
File without changes
|
package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-utilities.css.map
CHANGED
|
File without changes
|
package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-utilities.min.css
CHANGED
|
File without changes
|
package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-utilities.min.css.map
CHANGED
|
File without changes
|
package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-utilities.rtl.css
CHANGED
|
File without changes
|
package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-utilities.rtl.css.map
CHANGED
|
File without changes
|
package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-utilities.rtl.min.css
CHANGED
|
File without changes
|
package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-utilities.rtl.min.css.map
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/.emerge-vis-output/rws-client/html/vendors/dark-mode-switch/js/dark-mode-switch.min.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/PLUGINS.MD
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# RWS Plugin system
|
|
2
|
+
|
|
3
|
+
Plugin systems lets users add functionality without writing too much code. Target of the functionality is to run with one config line per plugin.
|
|
4
|
+
|
|
5
|
+
## Table of contents
|
|
6
|
+
|
|
7
|
+
1. [TS work part](#ts-work-plugin-part)
|
|
8
|
+
2. [JS build plugin part](#js-build-plugin-part)
|
|
9
|
+
3. [Adding plugin to TS](#adding-plugin-to-ts)
|
|
10
|
+
4. [Adding plugin to build order](#adding-plugin-to-build-order)
|
|
11
|
+
5. [Examples](#examples)
|
|
12
|
+
|
|
13
|
+
***Currently there are separate frontend and build plugin parts. To be included in .rws.json***
|
|
14
|
+
|
|
15
|
+
## TS work plugin part
|
|
16
|
+
|
|
17
|
+
**src/plugin.ts**
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import { RWSClient, RWSClientInstance, RWSPlugin, DefaultRWSPluginOptionsType, NotifyService, NotifyServiceInstance, ConfigService, ConfigServiceInstance } from '@rws-framework/client';
|
|
21
|
+
import WSService, { WSServiceInstance, WSEvent, WSStatus } from './services/WSService';
|
|
22
|
+
|
|
23
|
+
WSService;
|
|
24
|
+
|
|
25
|
+
interface WSOptions extends DefaultRWSPluginOptionsType {
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
class RWSWebsocketsPlugin extends RWSPlugin<WSOptions> {
|
|
30
|
+
async onClientStart(): Promise<void>
|
|
31
|
+
{
|
|
32
|
+
const wsService: WSServiceInstance = this.container.get(WSService);
|
|
33
|
+
const notifyService: NotifyServiceInstance = this.container.get(NotifyService);
|
|
34
|
+
const appConfig: ConfigServiceInstance = this.container.get(ConfigService);
|
|
35
|
+
|
|
36
|
+
wsService.on('ws:disconnected', (instance, params) => {
|
|
37
|
+
notifyService.notify(`Your websocket client disconnected from the server. Your ID was <strong>${params.socketId}</strong>`, 'error');
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
wsService.on('ws:connected', (instance, params) => {
|
|
41
|
+
notifyService.notify('You are connected to websocket. Your ID is: <strong>' + instance.socket().id + '</strong>', 'info');
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
wsService.on('ws:reconnect', (instance, params) => {
|
|
45
|
+
console.info('WS RECONNECTION ' + (params.reconnects + 1));
|
|
46
|
+
notifyService.notify('Your websocket client has tried to reconnect to server. Attempt #' + (params.reconnects+1), 'warning');
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
wsService.init(appConfig.get('wsUrl'), appConfig.get('user'), appConfig.get('transports'));
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { RWSWebsocketsPlugin, WSService, WSServiceInstance, WSEvent, WSStatus };
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## JS build plugin part
|
|
57
|
+
|
|
58
|
+
**./build.js**
|
|
59
|
+
|
|
60
|
+
```javascript
|
|
61
|
+
const {RWSPluginBuilder} = require('@rws-framework/client/src/plugins/_builder');
|
|
62
|
+
class BrowserRouterBuilder extends RWSPluginBuilder{
|
|
63
|
+
constructor(buildConfigurator, baseBuildConfig){
|
|
64
|
+
super(__dirname, buildConfigurator, baseBuildConfig);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async onComponentsLocated(partedComponentsLocations = []){
|
|
68
|
+
if(!partedComponentsLocations){
|
|
69
|
+
partedComponentsLocations = [];
|
|
70
|
+
}
|
|
71
|
+
return [...partedComponentsLocations,`${this.pluginPath}/src/components`];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async onServicesLocated(servicesLocations){
|
|
75
|
+
return [...servicesLocations,`${this.pluginPath}/src/services`];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async onBuild(buildOptions){
|
|
79
|
+
this.log('webpack build modified');
|
|
80
|
+
return buildOptions;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
module.exports = BrowserRouterBuilder;
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Adding plugin to TS
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
import RWSClient, { RWSContainer, RWSPlugin, RWSPluginEntry } from '@rws-framework/client';
|
|
91
|
+
import { RWSBrowserRouter, BrowserRouterOpts } from '@rws-framework/browser-router';
|
|
92
|
+
|
|
93
|
+
import './styles/main.scss';
|
|
94
|
+
|
|
95
|
+
import routes from './routing/routes';
|
|
96
|
+
|
|
97
|
+
import backendImports from './backendImport';
|
|
98
|
+
import notifierMethod from './_notifier';
|
|
99
|
+
import _initComponents from './application/_initComponents';
|
|
100
|
+
import { loadRWSRichWindow } from '@rws-framework/client/src/interfaces/RWSWindow';
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
async function initializeApp() {
|
|
104
|
+
const theClient = RWSContainer().get(RWSClient);
|
|
105
|
+
|
|
106
|
+
//(...)
|
|
107
|
+
|
|
108
|
+
theClient.onInit(async () => {
|
|
109
|
+
console.log(loadRWSRichWindow().RWS);
|
|
110
|
+
RWSPlugin.getPlugin<RWSBrowserRouter>(RWSBrowserRouter).addRoutes(routes);
|
|
111
|
+
_initComponents(theClient.appConfig.get('parted'));
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
theClient.setup({
|
|
115
|
+
partedPrefix: 'rws',
|
|
116
|
+
partedDirUrlPrefix: '/js',
|
|
117
|
+
parted: true,
|
|
118
|
+
plugins: [ // RWS Plugins option for TS
|
|
119
|
+
RWSBrowserRouter //Plugin class name from package
|
|
120
|
+
]
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
initializeApp();
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Adding plugin to build order
|
|
128
|
+
|
|
129
|
+
**webpack.config.ts**
|
|
130
|
+
|
|
131
|
+
```javascript
|
|
132
|
+
const path = require('path');
|
|
133
|
+
|
|
134
|
+
const RWSWebpackWrapper = require('@rws-framework/client/rws.webpack.config');
|
|
135
|
+
const executionDir = process.cwd();
|
|
136
|
+
|
|
137
|
+
module.exports = RWSWebpackWrapper({
|
|
138
|
+
dev: false,
|
|
139
|
+
hot: false,
|
|
140
|
+
report: false,
|
|
141
|
+
tsConfigPath: executionDir + '/tsconfig.json',
|
|
142
|
+
entry: `${executionDir}/src/index.ts`,
|
|
143
|
+
executionDir: executionDir,
|
|
144
|
+
publicDir: path.resolve(executionDir, 'public'),
|
|
145
|
+
outputDir: path.resolve(executionDir, 'public', 'js'),
|
|
146
|
+
outputFileName: 'warlock.client.js',
|
|
147
|
+
parted: true,
|
|
148
|
+
partedDirUrlPrefix: '/js',
|
|
149
|
+
copyAssets: {
|
|
150
|
+
'./public/js/' : [
|
|
151
|
+
'./src/styles/compiled/main.css'
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
rwsPlugins: [
|
|
155
|
+
'@rws-framework/nest-interconnectors',
|
|
156
|
+
'@rws-framework/browser-router'
|
|
157
|
+
]
|
|
158
|
+
});
|
|
159
|
+
```
|
|
160
|
+
## Examples
|
|
161
|
+
|
|
162
|
+
### Example plugin package.json
|
|
163
|
+
|
|
164
|
+
```javascript
|
|
165
|
+
{
|
|
166
|
+
"name": "@rws-framework/some-plugin",
|
|
167
|
+
"version": "0.2.0",
|
|
168
|
+
"private": false,
|
|
169
|
+
"description": "",
|
|
170
|
+
"main": "src/plugin.ts",
|
|
171
|
+
"author": "papablack"
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
> [!CAUTION]
|
|
176
|
+
> EVERY plugin needs plugin-info.json
|
|
177
|
+
|
|
178
|
+
### Example plugin plugin-info.json
|
|
179
|
+
|
|
180
|
+
```javascript
|
|
181
|
+
{
|
|
182
|
+
"name": "some-plugin"
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Example plugin:
|
|
187
|
+
|
|
188
|
+
https://github.com/papablack/rws-browser-router
|
package/README.md
CHANGED
|
@@ -16,7 +16,8 @@ Realtime Web Suit is a web-component powered, MS FAST powered fullstack-oriented
|
|
|
16
16
|
10. [Service Worker](#service-worker)
|
|
17
17
|
11. [Example: WebChat Component](#example-webchat-component)
|
|
18
18
|
12. [Other configs](#other-configs)
|
|
19
|
-
13. [
|
|
19
|
+
13. [Plugins](#plugin-system)
|
|
20
|
+
14. [Links](#links)
|
|
20
21
|
|
|
21
22
|
## Overview
|
|
22
23
|
|
|
@@ -1010,6 +1011,10 @@ are defined in backend/src/config/config
|
|
|
1010
1011
|
}
|
|
1011
1012
|
```
|
|
1012
1013
|
|
|
1014
|
+
## Plugin system
|
|
1015
|
+
|
|
1016
|
+
[PLUGIN SYSTEM README](https://github.com/papablack/rws-client/blob/master/PLUGINS.md)
|
|
1017
|
+
|
|
1013
1018
|
## Links
|
|
1014
1019
|
- https://www.fast.design/docs/fast-element/getting-started ( Base FAST documentation, mostly valid not considering passing styles and templates as RWS handles it with Webpack loaders )
|
|
1015
1020
|
- https://www.webcomponents.org (open-source WebComponents repository)
|
package/_tools.js
CHANGED
|
@@ -158,34 +158,33 @@ function findServiceFilesWithClassExtend(dir, classPath) {
|
|
|
158
158
|
function findComponentFilesWithText(dir, text, ignored = [], fileList = []) {
|
|
159
159
|
const files = fs.readdirSync(dir);
|
|
160
160
|
|
|
161
|
+
|
|
161
162
|
files.forEach(file => {
|
|
162
163
|
const filePath = path.join(dir, file);
|
|
163
164
|
const fileStat = fs.statSync(filePath);
|
|
164
165
|
|
|
165
166
|
if (fileStat.isDirectory() && !ignored.includes(file)) {
|
|
166
|
-
// Recursively search this directory
|
|
167
167
|
findComponentFilesWithText(filePath, text, ignored, fileList);
|
|
168
168
|
} else if (fileStat.isFile() && filePath.endsWith('.ts')) {
|
|
169
|
-
// Read file content and check for text
|
|
170
169
|
const content = fs.readFileSync(filePath, 'utf8');
|
|
171
|
-
if (content.includes(text)) {
|
|
172
|
-
const compInfo = extractComponentInfo(content);
|
|
170
|
+
if (content.includes(text)) {
|
|
171
|
+
const compInfo = extractComponentInfo(content);
|
|
172
|
+
|
|
173
173
|
if (compInfo) {
|
|
174
|
+
|
|
174
175
|
const { tagName, className, options, isIgnored, isOreo } = compInfo;
|
|
175
176
|
|
|
176
177
|
if (isIgnored) {
|
|
177
178
|
return;
|
|
178
179
|
}
|
|
179
180
|
|
|
180
|
-
// const fileParts = filePath.split('/');
|
|
181
|
-
// const fpLen = fileParts.length;
|
|
182
|
-
|
|
183
181
|
fileList.push({
|
|
184
182
|
filePath,
|
|
185
183
|
tagName,
|
|
186
184
|
className,
|
|
187
185
|
sanitName: className.toLowerCase(),
|
|
188
186
|
content,
|
|
187
|
+
isDebugged: options?.debugPackaging,
|
|
189
188
|
isIgnored: options?.ignorePackaging,
|
|
190
189
|
isOreo: options?.oreoMode
|
|
191
190
|
});
|
|
@@ -205,30 +204,37 @@ function extractRWSViewArguments(sourceFile) {
|
|
|
205
204
|
};
|
|
206
205
|
|
|
207
206
|
let foundDecorator = false;
|
|
207
|
+
let className = null;
|
|
208
|
+
function visit(node) {
|
|
209
|
+
if (ts.isClassDeclaration(node)) {
|
|
210
|
+
className = node.name ? node.name.getText(sourceFile) : null;
|
|
211
|
+
}
|
|
208
212
|
|
|
209
|
-
function visit(node) {
|
|
210
213
|
if (ts.isDecorator(node) && ts.isCallExpression(node.expression)) {
|
|
211
214
|
const expression = node.expression;
|
|
212
|
-
const decoratorName = expression.expression.getText(sourceFile);
|
|
215
|
+
const decoratorName = expression.expression.getText(sourceFile);
|
|
216
|
+
|
|
213
217
|
if (decoratorName === 'RWSView') {
|
|
218
|
+
|
|
219
|
+
argumentsExtracted.className = className;
|
|
220
|
+
|
|
221
|
+
|
|
214
222
|
foundDecorator = true;
|
|
215
223
|
const args = expression.arguments;
|
|
224
|
+
let tagName = null;
|
|
225
|
+
let options = null;
|
|
226
|
+
|
|
216
227
|
if (args.length > 0 && ts.isStringLiteral(args[0])) {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
if (args.length > 1) {
|
|
220
|
-
if (ts.isObjectLiteralExpression(args[1])) {
|
|
221
|
-
const argVal = args[1].getText(sourceFile);
|
|
222
|
-
argumentsExtracted.options = JSON5.parse(argVal);
|
|
223
|
-
}
|
|
228
|
+
tagName = args[0].text;
|
|
229
|
+
argumentsExtracted.tagName = tagName;
|
|
224
230
|
}
|
|
225
231
|
|
|
226
|
-
if (
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
232
|
+
if (args.length > 1 && ts.isObjectLiteralExpression(args[1])) {
|
|
233
|
+
const argText = args[1].getText();
|
|
234
|
+
options = JSON5.parse(argText);
|
|
235
|
+
argumentsExtracted.options = options;
|
|
231
236
|
}
|
|
237
|
+
|
|
232
238
|
}
|
|
233
239
|
}
|
|
234
240
|
|
|
@@ -286,13 +292,13 @@ function extractRWSIgnoreArguments(sourceFile) {
|
|
|
286
292
|
}
|
|
287
293
|
|
|
288
294
|
function extractComponentInfo(componentCode) {
|
|
289
|
-
const componentNameRegex =
|
|
295
|
+
const componentNameRegex = /@RWSView/;
|
|
290
296
|
|
|
291
297
|
if (!componentNameRegex.test(componentCode)) {
|
|
292
298
|
return;
|
|
293
299
|
}
|
|
294
300
|
|
|
295
|
-
const tsSourceFile = ts.createSourceFile(`/tmp/temp_ts`, componentCode, ts.ScriptTarget.Latest, true);
|
|
301
|
+
const tsSourceFile = ts.createSourceFile(`/tmp/temp_ts`, componentCode, ts.ScriptTarget.Latest, true);
|
|
296
302
|
|
|
297
303
|
let decoratorArgs = extractRWSViewArguments(tsSourceFile);
|
|
298
304
|
|
|
@@ -339,7 +345,7 @@ function getPartedModeVendorsBannerParams(partedDirUrlPrefix, partedPrefix) {
|
|
|
339
345
|
script.type = 'text/javascript';
|
|
340
346
|
document.body.appendChild(script);
|
|
341
347
|
window.RWS_PARTS_LOADED = true;
|
|
342
|
-
console.log('[RWS
|
|
348
|
+
console.log('\x1b[1m[RWS]\x1b[0m', 'vendors injected for parted mode');
|
|
343
349
|
}`.replace('\n', ''),
|
|
344
350
|
raw: true,
|
|
345
351
|
entryOnly: true,
|
package/cfg/tsconfigSetup.js
CHANGED
|
@@ -47,8 +47,16 @@ function setupTsConfig(tsConfigPath, executionDir) {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
if (!Object.keys(tsConfig).includes('exclude')) {
|
|
50
|
-
tsConfig['exclude'] = [];
|
|
50
|
+
tsConfig['exclude'] = [];
|
|
51
|
+
changed = true;
|
|
51
52
|
}
|
|
53
|
+
|
|
54
|
+
const excludeString = '**/*.debug.ts';
|
|
55
|
+
|
|
56
|
+
if(!tsConfig['exclude'].includes(excludeString)){
|
|
57
|
+
tsConfig['exclude'].push(excludeString);
|
|
58
|
+
changed = true;
|
|
59
|
+
}
|
|
52
60
|
|
|
53
61
|
let probablyLinked = false;
|
|
54
62
|
|