@rws-framework/client 2.16.3 → 2.17.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/builder/webpack/rws.webpack.config.js +8 -10
- package/cfg/build_steps/webpack/_aliases.js +24 -6
- package/cfg/build_steps/webpack/_build_config.js +5 -3
- package/cfg/build_steps/webpack/_env_defines.js +0 -2
- package/cfg/build_steps/webpack/_hot_reload.js +14 -0
- package/cfg/build_steps/webpack/_loaders.js +0 -1
- package/cfg/build_steps/webpack/_plugins.js +0 -10
- package/cfg/build_steps/webpack/_webpack_config.js +10 -2
- package/package.json +1 -1
- package/src/client/config.ts +13 -1
- package/src/client/hotReload.ts +23 -0
- package/src/client.ts +6 -2
- package/src/components/_component.ts +2 -0
- package/src/components/index.ts +5 -0
- package/src/components/loader/component.ts +2 -2
- package/src/components/progress/component.ts +3 -4
- package/src/components/reformer/component.ts +29 -0
- package/src/components/reformer/fields/_field.ts +14 -0
- package/src/components/reformer/fields/text/component.ts +9 -0
- package/src/components/reformer/fields/text/styles/layout.scss +5 -0
- package/src/components/reformer/fields/text/template.html +7 -0
- package/src/components/reformer/styles/layout.scss +5 -0
- package/src/components/reformer/template.html +7 -0
- package/src/components/rws-api-resource/component.ts +20 -0
- package/src/components/rws-api-resource/styles/layout.scss +5 -0
- package/src/components/rws-api-resource/template.html +3 -0
- package/src/components/rws-api-resource/variants/form/component.ts +11 -0
- package/src/components/rws-api-resource/variants/form/styles/layout.scss +0 -0
- package/src/components/rws-api-resource/variants/form/template.html +3 -0
- package/src/components/rws-api-resource/variants/list/component.ts +11 -0
- package/src/components/rws-api-resource/variants/list/styles/layout.scss +0 -0
- package/src/components/rws-api-resource/variants/list/template.html +3 -0
- package/src/components/uploader/component.ts +3 -1
- package/src/index.ts +31 -37
- package/src/types/IRWSConfig.ts +2 -0
- package/src/types/IReFormerField.ts +5 -0
|
@@ -28,7 +28,6 @@ const RWSWebpackWrapper = async (appRoot, rwsFrontendConfig, _packageDir) => {
|
|
|
28
28
|
executionDir,
|
|
29
29
|
isWatcher,
|
|
30
30
|
isDev,
|
|
31
|
-
isHotReload,
|
|
32
31
|
isReport,
|
|
33
32
|
isParted,
|
|
34
33
|
partedPrefix,
|
|
@@ -45,7 +44,9 @@ const RWSWebpackWrapper = async (appRoot, rwsFrontendConfig, _packageDir) => {
|
|
|
45
44
|
devRouteProxy,
|
|
46
45
|
tsConfig,
|
|
47
46
|
rwsPlugins,
|
|
48
|
-
BuildConfigurator
|
|
47
|
+
BuildConfigurator,
|
|
48
|
+
hotReload,
|
|
49
|
+
hotReloadPort
|
|
49
50
|
} = await getBuildConfig(rwsFrontendConfig, _packageDir);
|
|
50
51
|
|
|
51
52
|
timeLog({ devDebug });
|
|
@@ -58,7 +59,7 @@ const RWSWebpackWrapper = async (appRoot, rwsFrontendConfig, _packageDir) => {
|
|
|
58
59
|
buildInfo.start(executionDir, tsConfig, outputDir, isDev, publicDir, isParted, partedPrefix, partedDirUrlPrefix, devTools, rwsFrontendConfig.rwsPlugins);
|
|
59
60
|
|
|
60
61
|
// #SECTION INIT PLUGINS && ENV VARS DEFINES
|
|
61
|
-
addStartPlugins(rwsFrontendConfig, BuildConfigurator, devDebug,
|
|
62
|
+
addStartPlugins(rwsFrontendConfig, BuildConfigurator, devDebug, hotReload, isReport);
|
|
62
63
|
|
|
63
64
|
const WEBPACK_AFTER_ACTIONS = rwsFrontendConfig.actions || [];
|
|
64
65
|
const WEBPACK_AFTER_ERROR_ACTIONS = rwsFrontendConfig.error_actions || [];
|
|
@@ -66,7 +67,7 @@ const RWSWebpackWrapper = async (appRoot, rwsFrontendConfig, _packageDir) => {
|
|
|
66
67
|
const modules_setup = [path.join(_packageDir, 'node_modules'), path.join(executionDir, 'node_modules'), path.join(tools.findRootWorkspacePath(appRoot), 'node_modules')];
|
|
67
68
|
let optimConfig = null;
|
|
68
69
|
let aliases = rwsFrontendConfig.aliases || {};
|
|
69
|
-
aliases = { ...aliases, ...loadAliases(_packageDir, tsConfig,path.resolve(_MAIN_PACKAGE, 'node_modules'), executionDir)
|
|
70
|
+
aliases = { ...aliases, ...(await loadAliases(_packageDir, tsConfig,path.resolve(_MAIN_PACKAGE, 'node_modules'), executionDir))}
|
|
70
71
|
|
|
71
72
|
// #SECTION PLUGIN STARTING HOOKS
|
|
72
73
|
|
|
@@ -131,7 +132,9 @@ const RWSWebpackWrapper = async (appRoot, rwsFrontendConfig, _packageDir) => {
|
|
|
131
132
|
rwsExternals,
|
|
132
133
|
devExternalsVars,
|
|
133
134
|
appRootDir: appRoot,
|
|
134
|
-
entrypoint: rwsFrontendConfig.entrypoint
|
|
135
|
+
entrypoint: rwsFrontendConfig.entrypoint,
|
|
136
|
+
hotReload,
|
|
137
|
+
hotReloadPort
|
|
135
138
|
});
|
|
136
139
|
|
|
137
140
|
if (optimConfig) {
|
|
@@ -145,11 +148,6 @@ const RWSWebpackWrapper = async (appRoot, rwsFrontendConfig, _packageDir) => {
|
|
|
145
148
|
await plugin.onBuild(cfgExport);
|
|
146
149
|
}
|
|
147
150
|
|
|
148
|
-
if (isDev) {
|
|
149
|
-
// #SECTION RWS DEV SERVERS
|
|
150
|
-
webpackDevServer(BuildConfigurator, rwsFrontendConfig, cfgExport);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
151
|
return cfgExport;
|
|
154
152
|
}
|
|
155
153
|
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
|
+
const fs = require('fs');
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
const packageNames = [
|
|
5
|
+
'client',
|
|
6
|
+
'nest-interconnectors'
|
|
7
|
+
];
|
|
8
|
+
|
|
9
|
+
async function loadAliases(packageDir, tsConfig, nodeModulesPath, executionDir){
|
|
4
10
|
|
|
5
11
|
const tsPaths = {}
|
|
6
12
|
|
|
@@ -8,14 +14,26 @@ function loadAliases(packageDir, tsConfig, nodeModulesPath, executionDir){
|
|
|
8
14
|
const alias = tsConfig.config.compilerOptions.paths[aliasKey];
|
|
9
15
|
tsPaths[aliasKey] = path.resolve(executionDir, alias[0]);
|
|
10
16
|
}
|
|
11
|
-
|
|
17
|
+
|
|
18
|
+
for(const pkgName of packageNames){
|
|
19
|
+
const symlinkPath = path.join(nodeModulesPath, '@rws-framework', pkgName);
|
|
20
|
+
|
|
21
|
+
if(fs.existsSync(symlinkPath)){
|
|
22
|
+
const pkgDirStat = fs.lstatSync(symlinkPath);
|
|
23
|
+
|
|
24
|
+
if(pkgDirStat.isSymbolicLink()){
|
|
25
|
+
const targetPath = await fs.promises.realpath(symlinkPath);
|
|
26
|
+
|
|
27
|
+
tsPaths['@rws-framework/' + pkgName + '/*'] = targetPath + '/*';
|
|
28
|
+
tsPaths['@rws-framework/' + pkgName] = targetPath + '/src/index.ts';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
12
33
|
return {
|
|
13
34
|
...tsPaths,
|
|
14
35
|
'@rws-framework/foundation': path.resolve(packageDir, 'foundation', 'rws-foundation.js'),
|
|
15
|
-
'@rws-framework/foundation/*': path.resolve(packageDir, 'foundation', '*'),
|
|
16
|
-
// 'entities/lib/maps/entities.json': path.resolve(nodeModulesPath, 'entities/lib/maps/entities.json'),
|
|
17
|
-
// 'entities/lib/maps/legacy.json': path.resolve(nodeModulesPath, 'entities/lib/maps/legacy.json'),
|
|
18
|
-
// 'entities/lib/maps/xml.json': path.resolve(nodeModulesPath, 'entities/lib/maps/xml.json')
|
|
36
|
+
'@rws-framework/foundation/*': path.resolve(packageDir, 'foundation', '*'),
|
|
19
37
|
}
|
|
20
38
|
}
|
|
21
39
|
|
|
@@ -12,9 +12,10 @@ async function getBuildConfig(rwsFrontBuildConfig, _packageDir){
|
|
|
12
12
|
const isWatcher = process.argv.includes('--watch') || false;
|
|
13
13
|
|
|
14
14
|
const isDev = isWatcher ? true : (BuildConfigurator.get('dev', rwsFrontBuildConfig.dev) || false);
|
|
15
|
-
const isHotReload = BuildConfigurator.get('hotReload', rwsFrontBuildConfig.hotReload);
|
|
16
15
|
const isReport = BuildConfigurator.get('pkgReport', rwsFrontBuildConfig.pkgReport);
|
|
17
16
|
const isParted = BuildConfigurator.get('parted', rwsFrontBuildConfig.parted || false);
|
|
17
|
+
const hotReload = BuildConfigurator.get('hotReload', rwsFrontBuildConfig.hotReload || false);
|
|
18
|
+
const hotReloadPort = BuildConfigurator.get('hotReloadtPort', rwsFrontBuildConfig.hotReloadPort || 1030);
|
|
18
19
|
|
|
19
20
|
const partedPrefix = BuildConfigurator.get('partedPrefix', rwsFrontBuildConfig.partedPrefix);
|
|
20
21
|
const partedDirUrlPrefix = BuildConfigurator.get('partedDirUrlPrefix', rwsFrontBuildConfig.partedDirUrlPrefix);
|
|
@@ -53,7 +54,6 @@ async function getBuildConfig(rwsFrontBuildConfig, _packageDir){
|
|
|
53
54
|
executionDir,
|
|
54
55
|
isWatcher,
|
|
55
56
|
isDev,
|
|
56
|
-
isHotReload,
|
|
57
57
|
isReport,
|
|
58
58
|
isParted,
|
|
59
59
|
partedPrefix,
|
|
@@ -70,7 +70,9 @@ async function getBuildConfig(rwsFrontBuildConfig, _packageDir){
|
|
|
70
70
|
devRouteProxy,
|
|
71
71
|
tsConfig,
|
|
72
72
|
rwsPlugins,
|
|
73
|
-
BuildConfigurator
|
|
73
|
+
BuildConfigurator,
|
|
74
|
+
hotReload,
|
|
75
|
+
hotReloadPort
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
78
|
|
|
@@ -78,16 +78,6 @@ function addStartPlugins(rwsFrontendConfig, BuildConfigurator, devDebug, isHotRe
|
|
|
78
78
|
...getPackageModPlugins()
|
|
79
79
|
]);
|
|
80
80
|
|
|
81
|
-
if (isHotReload) {
|
|
82
|
-
if (!publicDir) {
|
|
83
|
-
throw new Error('No public dir set')
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
RWS_WEBPACK_PLUGINS_BAG.add(new HtmlWebpackPlugin({
|
|
87
|
-
template: path.join(publicDir, '/', publicIndex),
|
|
88
|
-
}));
|
|
89
|
-
}
|
|
90
|
-
|
|
91
81
|
const overridePlugins = rwsFrontendConfig.plugins || []
|
|
92
82
|
|
|
93
83
|
RWS_WEBPACK_PLUGINS_BAG.add(overridePlugins);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
const { getRWSHotReloadSetup } = require('./_hot_reload');
|
|
1
2
|
const { getRWSLoaders } = require('./_loaders');
|
|
2
|
-
const
|
|
3
|
+
const webpack = require('webpack');
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
async function createWebpackConfig({
|
|
@@ -20,9 +21,15 @@ async function createWebpackConfig({
|
|
|
20
21
|
rwsExternals,
|
|
21
22
|
devExternalsVars,
|
|
22
23
|
appRootDir,
|
|
23
|
-
entrypoint
|
|
24
|
+
entrypoint,
|
|
25
|
+
hotReload,
|
|
26
|
+
hotReloadPort
|
|
24
27
|
}) {
|
|
25
28
|
|
|
29
|
+
if(hotReload){
|
|
30
|
+
WEBPACK_PLUGINS.push(new webpack.HotModuleReplacementPlugin());
|
|
31
|
+
}
|
|
32
|
+
|
|
26
33
|
return {
|
|
27
34
|
context: executionDir,
|
|
28
35
|
entry: {
|
|
@@ -47,6 +54,7 @@ async function createWebpackConfig({
|
|
|
47
54
|
path: false
|
|
48
55
|
}
|
|
49
56
|
},
|
|
57
|
+
devServer: hotReload ? getRWSHotReloadSetup(hotReloadPort, outputDir) : null,
|
|
50
58
|
module: {
|
|
51
59
|
rules: getRWSLoaders(_packageDir, executionDir, tsConfig, appRootDir, entrypoint),
|
|
52
60
|
},
|
package/package.json
CHANGED
package/src/client/config.ts
CHANGED
|
@@ -6,7 +6,7 @@ import RWSWindow, {loadRWSRichWindow } from '../types/RWSWindow';
|
|
|
6
6
|
import deepmerge from 'deepmerge';
|
|
7
7
|
import { IPluginSpawnOption } from "../types/IRWSPlugin";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
import { _DEFAULT_HR_PORT } from './hotReload';
|
|
10
10
|
|
|
11
11
|
function getUser(this: RWSClientInstance): IRWSUser {
|
|
12
12
|
|
|
@@ -96,6 +96,12 @@ async function setup(this: RWSClientInstance, config: IRWSConfig = {}): Promise<
|
|
|
96
96
|
|
|
97
97
|
this.appConfig.mergeConfig(this.config);
|
|
98
98
|
|
|
99
|
+
if (this.appConfig.get('hotReload') === true) {
|
|
100
|
+
if(!this.appConfig.get('hotReloadPort')){
|
|
101
|
+
this.appConfig.set('hotReloadPort', _DEFAULT_HR_PORT)
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
99
105
|
if(this.config.plugins){
|
|
100
106
|
for (const pluginEntry of this.config.plugins){
|
|
101
107
|
addPlugin.bind(this)(pluginEntry);
|
|
@@ -146,6 +152,12 @@ async function start(this: RWSClientInstance, config: IRWSConfig = {}): Promise<
|
|
|
146
152
|
await plugin.onClientStart();
|
|
147
153
|
}
|
|
148
154
|
|
|
155
|
+
if(this.appConfig.get('hotReload')){
|
|
156
|
+
if (module.hot) {
|
|
157
|
+
module.hot.accept();
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
149
161
|
return this;
|
|
150
162
|
}
|
|
151
163
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { RWSClientInstance } from "../client";
|
|
2
|
+
import IRWSConfig from "../types/IRWSConfig";
|
|
3
|
+
|
|
4
|
+
export const _DEFAULT_HR_PORT = 1030;
|
|
5
|
+
|
|
6
|
+
export interface IHotReloadCfg {
|
|
7
|
+
enabled: boolean,
|
|
8
|
+
port: number
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async function hotReloadSetup(this: RWSClientInstance, config: IRWSConfig = {}): Promise<RWSClientInstance>
|
|
12
|
+
{
|
|
13
|
+
|
|
14
|
+
return this;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function getBinds(this: RWSClientInstance) {
|
|
18
|
+
return {
|
|
19
|
+
hotReloadSetup: hotReloadSetup.bind(this)
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default getBinds;
|
package/src/client.ts
CHANGED
|
@@ -15,13 +15,14 @@ import RWSWindow, { RWSWindowComponentRegister, loadRWSRichWindow } from './type
|
|
|
15
15
|
|
|
16
16
|
import { DI, Container, Registration } from './components/_container';
|
|
17
17
|
|
|
18
|
-
import
|
|
18
|
+
import { declareRWSComponents } from './components/index';
|
|
19
19
|
import RWSContainer from './components/_container';
|
|
20
20
|
import TheRWSService from './services/_service';
|
|
21
21
|
|
|
22
22
|
import ComponentHelper, { ComponentHelperStatic, RWSInfoType } from './client/components';
|
|
23
23
|
import ServicesHelper from './client/services';
|
|
24
24
|
import ConfigHelper from './client/config';
|
|
25
|
+
import HotReloadHelper, { IHotReloadCfg, _DEFAULT_HR_PORT } from './client/hotReload';
|
|
25
26
|
import { DefaultRWSPluginOptionsType, RWSPlugin } from './plugins/_plugin';
|
|
26
27
|
import { IStaticRWSPlugin } from './types/IRWSPlugin'
|
|
27
28
|
|
|
@@ -38,10 +39,13 @@ class RWSClient {
|
|
|
38
39
|
protected devStorage: { [key: string]: any } = {};
|
|
39
40
|
protected customServices: { [serviceName: string]: TheRWSService} = {};
|
|
40
41
|
protected defaultServices: { [serviceName: string]: TheRWSService} = {};
|
|
42
|
+
protected hrSetup: IHotReloadCfg = { enabled: false, port: _DEFAULT_HR_PORT }
|
|
41
43
|
|
|
42
44
|
private componentHelper = ComponentHelper.bind(this)();
|
|
43
45
|
private servicesHelper = ServicesHelper.bind(this)();
|
|
44
46
|
private configHelper = ConfigHelper.bind(this)();
|
|
47
|
+
private hotReloadHelper = HotReloadHelper.bind(this)();
|
|
48
|
+
|
|
45
49
|
|
|
46
50
|
protected initCallback: () => Promise<void> = async () => { };
|
|
47
51
|
|
|
@@ -202,4 +206,4 @@ class RWSClient {
|
|
|
202
206
|
}
|
|
203
207
|
|
|
204
208
|
export default DI.createInterface<RWSClient>(x => x.singleton(RWSClient));
|
|
205
|
-
export { RWSClient as RWSClientInstance };
|
|
209
|
+
export { RWSClient as RWSClientInstance, declareRWSComponents };
|
package/src/components/index.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { RWSUploader } from './uploader/component';
|
|
2
2
|
import { RWSProgress } from './progress/component';
|
|
3
3
|
import { RWSLoader } from './loader/component';
|
|
4
|
+
import { RWSApiResource } from './rws-api-resource/component';
|
|
5
|
+
import { ReFormer } from './reformer/component';
|
|
4
6
|
|
|
5
7
|
|
|
6
8
|
function declareRWSComponents(parted: boolean = false): void
|
|
@@ -9,6 +11,9 @@ function declareRWSComponents(parted: boolean = false): void
|
|
|
9
11
|
RWSUploader;
|
|
10
12
|
RWSProgress;
|
|
11
13
|
RWSLoader;
|
|
14
|
+
|
|
15
|
+
RWSApiResource;
|
|
16
|
+
ReFormer;
|
|
12
17
|
}
|
|
13
18
|
}
|
|
14
19
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { RWSView
|
|
1
|
+
import { RWSView } from '../_decorator';
|
|
2
|
+
import { RWSViewComponent } from '../_component';
|
|
2
3
|
|
|
3
4
|
@RWSView('the-loader')
|
|
4
5
|
class RWSLoader extends RWSViewComponent {
|
|
5
|
-
|
|
6
6
|
connectedCallback(): void {
|
|
7
7
|
super.connectedCallback();
|
|
8
8
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
} from '@microsoft/fast-element';
|
|
1
|
+
import { observable, attr, nullableNumberConverter } from '@microsoft/fast-element';
|
|
2
|
+
import { RWSView } from '../_decorator';
|
|
3
|
+
import { RWSViewComponent } from '../_component';
|
|
5
4
|
|
|
6
5
|
@RWSView('rws-progress', { debugPackaging: false })
|
|
7
6
|
class RWSProgress extends RWSViewComponent {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { observable, attr } from '@microsoft/fast-element';
|
|
2
|
+
import { IKDBTypesResponse } from '../../types/IBackendCore';
|
|
3
|
+
import { RWSViewComponent} from '../_component';
|
|
4
|
+
import { RWSView} from '../_decorator';
|
|
5
|
+
import { ReFormerText } from './fields/text/component';
|
|
6
|
+
|
|
7
|
+
ReFormerText;
|
|
8
|
+
|
|
9
|
+
@RWSView('rws-reformer')
|
|
10
|
+
class ReFormer extends RWSViewComponent {
|
|
11
|
+
@attr resourceName: string;
|
|
12
|
+
|
|
13
|
+
@observable fields: string[] | null = null;
|
|
14
|
+
@observable modelTypes: IKDBTypesResponse;
|
|
15
|
+
|
|
16
|
+
async connectedCallback(): Promise<void>
|
|
17
|
+
{
|
|
18
|
+
this.modelTypes = await this.apiService.getResource(this.resourceName);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
setForm(key: string, val: any)
|
|
22
|
+
{
|
|
23
|
+
console.log('set reformer form', {key, val});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
ReFormer.defineComponent();
|
|
28
|
+
|
|
29
|
+
export { ReFormer };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { observable, attr } from "@microsoft/fast-element";
|
|
2
|
+
import RWSViewComponent from "../../_component";
|
|
3
|
+
import { IReFormerField } from "../../../types/IReFormerField";
|
|
4
|
+
|
|
5
|
+
export abstract class ReFormerFieldComponent extends RWSViewComponent implements IReFormerField {
|
|
6
|
+
@attr name: string;
|
|
7
|
+
@observable defaultValue: any;
|
|
8
|
+
@observable setForm: (field: string, value: any) => Promise<void>;
|
|
9
|
+
|
|
10
|
+
changeField(key: string, value: any)
|
|
11
|
+
{
|
|
12
|
+
this.setForm(key, value);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<div class="re-former-container">
|
|
2
|
+
${T.repeat(x => x.modelTypes.data.types, T.html`<div class="form-field">
|
|
3
|
+
${T.when(x => x.type === 'String', T.html`
|
|
4
|
+
<re-former-text :setForm="${x => x.setForm.bind(x)}" name="${x => x.fieldName}"></re-former-text>
|
|
5
|
+
`)}
|
|
6
|
+
</div>`)}
|
|
7
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IKDBTypeInfo, IKDBTypesResponse } from '../../types/IBackendCore';
|
|
2
|
+
import { observable, attr } from '@microsoft/fast-element';
|
|
3
|
+
import { RWSView } from '../_decorator';
|
|
4
|
+
import { RWSViewComponent } from '../_component';
|
|
5
|
+
import { RWSResourceListComponent } from './variants/list/component';
|
|
6
|
+
import { RWSResourceFormComponent } from './variants/form/component';
|
|
7
|
+
import { IRWSResourceQuery } from '../../types/IRWSResource';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
RWSResourceListComponent;
|
|
11
|
+
RWSResourceFormComponent;
|
|
12
|
+
|
|
13
|
+
@RWSView('rws-resource')
|
|
14
|
+
class RWSApiResource extends RWSViewComponent {
|
|
15
|
+
@observable dbModelData: IKDBTypesResponse;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
RWSApiResource.defineComponent();
|
|
19
|
+
|
|
20
|
+
export { RWSApiResource };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RWSViewComponent} from '../../../_component';
|
|
2
|
+
import { RWSView} from '../../../_decorator';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
@RWSView('rws-resource-form')
|
|
6
|
+
class RWSResourceFormComponent extends RWSViewComponent {
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
RWSResourceFormComponent.defineComponent();
|
|
10
|
+
|
|
11
|
+
export { RWSResourceFormComponent };
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RWSViewComponent} from '../../../_component';
|
|
2
|
+
import { RWSView} from '../../../_decorator';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
@RWSView('rws-resource-list')
|
|
6
|
+
class RWSResourceListComponent extends RWSViewComponent {
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
RWSResourceListComponent.defineComponent();
|
|
10
|
+
|
|
11
|
+
export { RWSResourceListComponent };
|
|
File without changes
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { observable, attr } from '@microsoft/fast-element';
|
|
2
|
+
import { RWSView } from '../_decorator';
|
|
3
|
+
import { RWSViewComponent } from '../_component';
|
|
2
4
|
|
|
3
5
|
@RWSView('rws-uploader')
|
|
4
6
|
class RWSUploader extends RWSViewComponent {
|
package/src/index.ts
CHANGED
|
@@ -1,60 +1,38 @@
|
|
|
1
1
|
import { Transformer as HTMLTagTransformerType, Tag as HTMLTag, Attributes as HTMLAttributes } from 'sanitize-html';
|
|
2
2
|
import { observable, attr } from '@microsoft/fast-element';
|
|
3
|
-
|
|
4
|
-
import type RWSNotify from './types/RWSNotify';
|
|
5
|
-
import type { NotifyUiType, NotifyLogType } from './types/RWSNotify';
|
|
3
|
+
|
|
6
4
|
import RWSService from './services/_service';
|
|
7
5
|
import ConfigService, { ConfigServiceInstance } from './services/ConfigService';
|
|
8
6
|
import NotifyService, {NotifyServiceInstance} from './services/NotifyService';
|
|
9
7
|
import DOMService, { DOMServiceInstance } from './services/DOMService';
|
|
10
|
-
import type { DOMOutputType, TagsProcessorType } from './services/DOMService';
|
|
11
8
|
import ApiService, { ApiServiceInstance } from './services/ApiService';
|
|
12
|
-
import type { IBackendRoute, IHTTProute, IPrefixedHTTProutes } from './services/ApiService';
|
|
13
|
-
|
|
14
9
|
import UtilsService, {UtilsServiceInstance} from './services/UtilsService';
|
|
15
10
|
import ServiceWorkerService, { ServiceWorkerServiceInstance } from './services/ServiceWorkerService';
|
|
16
|
-
// import { sanitizedAttr } from './components/_attrs/sanitize-html';
|
|
17
11
|
import { ngAttr } from './components/_attrs/angular-attr';
|
|
18
12
|
import { externalObservable } from './components/_attrs/external-observable';
|
|
19
13
|
import { externalAttr } from './components/_attrs/external-attr';
|
|
20
14
|
import { RWSPlugin } from './plugins/_plugin';
|
|
15
|
+
import RWSClient, { RWSClientInstance } from './client';
|
|
16
|
+
import RWSViewComponent from './components/_component';
|
|
17
|
+
import RWSContainer from './components/_container';
|
|
21
18
|
|
|
22
|
-
import
|
|
19
|
+
import { RWSIgnore, RWSInject, RWSView } from './components/_decorator';
|
|
20
|
+
import { declareRWSComponents } from './components';
|
|
23
21
|
|
|
22
|
+
import type { DefaultRWSPluginOptionsType } from './plugins/_plugin';
|
|
24
23
|
import type { IRWSPlugin, IStaticRWSPlugin, IPluginSpawnOption } from './types/IRWSPlugin';
|
|
25
|
-
import RWSClient, { RWSClientInstance } from './client';
|
|
26
24
|
import type IRWSUser from './types/IRWSUser';
|
|
27
|
-
import RWSViewComponent from './components/_component';
|
|
28
25
|
import type { IAssetShowOptions } from './components/_component';
|
|
29
|
-
|
|
30
|
-
import RWSContainer from './components/_container';
|
|
31
|
-
|
|
32
26
|
import type { RWSDecoratorOptions } from './components/_decorator';
|
|
33
27
|
import type { IKDBTypeInfo, IKDBTypesResponse } from './types/IBackendCore';
|
|
34
|
-
|
|
35
|
-
import {
|
|
36
|
-
|
|
37
|
-
import
|
|
28
|
+
import type { DOMOutputType, TagsProcessorType } from './services/DOMService';
|
|
29
|
+
import type { IBackendRoute, IHTTProute, IPrefixedHTTProutes } from './services/ApiService';
|
|
30
|
+
import type IRWSConfig from './types/IRWSConfig';
|
|
31
|
+
import type RWSNotify from './types/RWSNotify';
|
|
32
|
+
import type { NotifyUiType, NotifyLogType } from './types/RWSNotify';
|
|
38
33
|
|
|
39
34
|
export default RWSClient;
|
|
40
35
|
|
|
41
|
-
export type {
|
|
42
|
-
IKDBTypeInfo, IKDBTypesResponse,
|
|
43
|
-
NotifyUiType,
|
|
44
|
-
NotifyLogType,
|
|
45
|
-
IBackendRoute as IRWSBackendRoute,
|
|
46
|
-
RWSDecoratorOptions as IRWSDecoratorOptions,
|
|
47
|
-
IHTTProute as IRWSHttpRoute,
|
|
48
|
-
IPrefixedHTTProutes as IRWSPrefixedHTTProutes,
|
|
49
|
-
IAssetShowOptions as IRWSAssetShowOptions,
|
|
50
|
-
IRWSConfig,
|
|
51
|
-
IRWSUser,
|
|
52
|
-
TagsProcessorType,
|
|
53
|
-
HTMLTagTransformerType,
|
|
54
|
-
HTMLTag,
|
|
55
|
-
HTMLAttributes
|
|
56
|
-
}
|
|
57
|
-
|
|
58
36
|
export {
|
|
59
37
|
RWSClient,
|
|
60
38
|
RWSClientInstance,
|
|
@@ -79,8 +57,7 @@ export {
|
|
|
79
57
|
|
|
80
58
|
RWSNotify,
|
|
81
59
|
|
|
82
|
-
RWSView,
|
|
83
|
-
// sanitizedAttr,
|
|
60
|
+
RWSView,
|
|
84
61
|
RWSIgnore,
|
|
85
62
|
RWSInject,
|
|
86
63
|
observable,
|
|
@@ -94,4 +71,21 @@ export {
|
|
|
94
71
|
declareRWSComponents,
|
|
95
72
|
|
|
96
73
|
RWSContainer
|
|
97
|
-
};
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export type {
|
|
77
|
+
IKDBTypeInfo, IKDBTypesResponse,
|
|
78
|
+
NotifyUiType,
|
|
79
|
+
NotifyLogType,
|
|
80
|
+
IBackendRoute as IRWSBackendRoute,
|
|
81
|
+
RWSDecoratorOptions as IRWSDecoratorOptions,
|
|
82
|
+
IHTTProute as IRWSHttpRoute,
|
|
83
|
+
IPrefixedHTTProutes as IRWSPrefixedHTTProutes,
|
|
84
|
+
IAssetShowOptions as IRWSAssetShowOptions,
|
|
85
|
+
IRWSConfig,
|
|
86
|
+
IRWSUser,
|
|
87
|
+
TagsProcessorType,
|
|
88
|
+
HTMLTagTransformerType,
|
|
89
|
+
HTMLTag,
|
|
90
|
+
HTMLAttributes
|
|
91
|
+
}
|
package/src/types/IRWSConfig.ts
CHANGED
|
@@ -22,6 +22,8 @@ export default interface IRWSConfig {
|
|
|
22
22
|
rwsDefines?: {[key: string]: any}
|
|
23
23
|
partedFileDir?: string
|
|
24
24
|
partedPrefix?: string
|
|
25
|
+
hotReload?: boolean,
|
|
26
|
+
hotReloadPort?: number,
|
|
25
27
|
plugins?: IPluginSpawnOption<any>[]
|
|
26
28
|
routing_enabled?: boolean
|
|
27
29
|
_noLoad?: boolean
|