@rws-framework/client 2.12.0 → 2.13.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/vite/index.ts +5 -0
- package/builder/vite/rws.vite.config.ts +50 -0
- package/{webpack → builder/webpack}/index.js +3 -1
- package/{webpack → builder/webpack}/loaders/rws_fast_html_loader.js +8 -0
- package/{webpack → builder/webpack}/loaders/rws_fast_scss_loader.js +8 -1
- package/{webpack → builder/webpack}/loaders/rws_fast_ts_loader.js +1 -1
- package/{rws.webpack.config.js → builder/webpack/rws.webpack.config.js} +18 -13
- package/bun.lockb +0 -0
- package/cfg/build_steps/vite/_build_config.ts +106 -0
- package/cfg/build_steps/vite/_env_defines.ts +17 -0
- package/cfg/build_steps/vite/_loaders.ts +185 -0
- package/cfg/build_steps/vite/index.ts +3 -0
- package/cfg/build_steps/vite/loaders/html.ts +12 -0
- package/cfg/build_steps/vite/loaders/index.ts +9 -0
- package/cfg/build_steps/vite/loaders/loader.type.ts +28 -0
- package/cfg/build_steps/vite/loaders/scss.ts +33 -0
- package/cfg/build_steps/vite/loaders/ts.ts +313 -0
- package/cfg/build_steps/vite/rws_scss_plugin.ts +60 -0
- package/cfg/build_steps/vite/scss/_compiler.ts +95 -0
- package/cfg/build_steps/vite/scss/_fonts.ts +81 -0
- package/cfg/build_steps/vite/scss/_fs.ts +82 -0
- package/cfg/build_steps/vite/scss/_import.ts +185 -0
- package/cfg/build_steps/vite/types.ts +8 -0
- package/cfg/build_steps/webpack/_actions.js +0 -0
- package/cfg/build_steps/webpack/_build_config.js +0 -0
- package/cfg/build_steps/webpack/_component_handling.js +0 -0
- package/cfg/build_steps/webpack/_dev_servers.js +0 -0
- package/cfg/build_steps/webpack/_env_defines.js +2 -7
- package/cfg/build_steps/webpack/_loaders.js +0 -6
- package/cfg/build_steps/webpack/_plugins.js +0 -0
- package/cfg/build_steps/webpack/_webpack_config.js +6 -1
- package/package.json +11 -9
- package/src/client/config.ts +2 -2
- package/src/client.ts +1 -1
- package/src/components/_component.ts +4 -2
- package/src/components/_container.ts +2 -6
- package/src/components/_decorator.ts +1 -1
- package/src/components/_definitions.ts +0 -1
- package/src/components/_event_handling.ts +1 -1
- package/src/index.ts +60 -70
- package/src/services/ApiService.ts +1 -8
- package/src/services/_service.ts +2 -2
- package/src/styles/_grid.scss +16 -8
- package/src/styles/_scrollbars.scss +1 -0
- package/src/styles/includes.scss +0 -1
- package/src/types/IRWSConfig.ts +2 -2
- package/src/types/IRWSPlugin.ts +3 -5
- /package/{webpack → builder/webpack}/after/copy.js +0 -0
- /package/{webpack → builder/webpack}/after/sw.js +0 -0
- /package/{webpack → builder/webpack}/loaders/ts/html_error.js +0 -0
- /package/{webpack → builder/webpack}/rws_scss_plugin.js +0 -0
- /package/{webpack → builder/webpack}/rws_webpack_plugin.js +0 -0
- /package/{webpack → builder/webpack}/scss/_compiler.js +0 -0
- /package/{webpack → builder/webpack}/scss/_fonts.js +0 -0
- /package/{webpack → builder/webpack}/scss/_fs.js +0 -0
- /package/{webpack → builder/webpack}/scss/_import.js +0 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
const { rwsPath } = require('@rws-framework/console');
|
|
2
|
+
|
|
3
|
+
import _scss_fs_builder from './_fs';
|
|
4
|
+
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
const path = require('path');
|
|
7
|
+
const CSS_IMPORT_REGEX = /^(?!.*\/\/)(?!.*\/\*).*@import\s+['"]((?![^'"]*:[^'"]*).+?)['"];?/gm;
|
|
8
|
+
const SCSS_USE_REGEX = /^(?!.*\/\/)(?!.*\/\*).*@use\s+['"]?([^'"\s]+)['"]?;?/gm;
|
|
9
|
+
|
|
10
|
+
const WORKSPACE = rwsPath.findRootWorkspacePath(process.cwd());
|
|
11
|
+
|
|
12
|
+
function processImportPath(importPath, fileRootDir = null, noext = false): string
|
|
13
|
+
{
|
|
14
|
+
if (importPath.split('')[0] === '~') {
|
|
15
|
+
return fillSCSSExt(replaceWithNodeModules(importPath, null, true), noext);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (importPath.indexOf('@rws-mixins') === 0) {
|
|
19
|
+
return path.resolve(rwsPath.findPackageDir(__dirname), 'src', 'styles', 'includes.scss');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (importPath.indexOf('@cwd') === 0) {
|
|
23
|
+
return fillSCSSExt(process.cwd() + '/' + importPath.slice(4), noext);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (importPath.split('')[0] === '/') {
|
|
27
|
+
|
|
28
|
+
return fillSCSSExt(importPath, noext);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (fileRootDir) {
|
|
32
|
+
const relativized = path.resolve(fileRootDir) + '/' + importPath;
|
|
33
|
+
|
|
34
|
+
if (importPath.split('')[0] === '.') {
|
|
35
|
+
return fillSCSSExt(relativized, noext);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (!fs.existsSync(relativized)) {
|
|
39
|
+
const partSplit = relativized.split('/');
|
|
40
|
+
partSplit[partSplit.length - 1] = '_' + partSplit[partSplit.length - 1] + '.scss';
|
|
41
|
+
|
|
42
|
+
const newPath = underscorePath(relativized);
|
|
43
|
+
|
|
44
|
+
if (fs.existsSync(newPath)) {
|
|
45
|
+
return newPath;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return fillSCSSExt(relativized, noext);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return importPath;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function underscorePath(path, noext = false) {
|
|
55
|
+
const partSplit = path.split('/');
|
|
56
|
+
partSplit[partSplit.length - 1] = '_' + partSplit[partSplit.length - 1] + (path.indexOf('.scss') > - 1 || noext ? '' : '.scss');
|
|
57
|
+
return partSplit.join('/');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function fillSCSSExt(scssPath, noext = false) {
|
|
61
|
+
const underscoredPath = underscorePath(scssPath, noext);
|
|
62
|
+
if (!fs.existsSync(scssPath) && fs.existsSync(underscoredPath)) {
|
|
63
|
+
return underscoredPath;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (noext) {
|
|
67
|
+
return scssPath;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if ((!fs.existsSync(scssPath) || (fs.existsSync(scssPath) && fs.statSync(scssPath).isDirectory())) && fs.existsSync(`${scssPath}.scss`)) {
|
|
71
|
+
return `${scssPath}.scss`;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (fs.existsSync(`_${scssPath}.scss`)) {
|
|
75
|
+
return `${scssPath}.scss`;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return scssPath;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function extractScssImports(fileContent, importRootPath) {
|
|
82
|
+
let match;
|
|
83
|
+
const imports: string[][] = [];
|
|
84
|
+
|
|
85
|
+
while ((match = CSS_IMPORT_REGEX.exec(fileContent)) !== null) {
|
|
86
|
+
const importPath = match[1];
|
|
87
|
+
const importLine = match[0];
|
|
88
|
+
|
|
89
|
+
if (fs.statSync(importRootPath).isFile()) {
|
|
90
|
+
importRootPath = path.dirname(importRootPath);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const processedImportPath = processImportPath(importPath, importRootPath);
|
|
94
|
+
|
|
95
|
+
imports.push([processedImportPath, importLine, path.resolve(processedImportPath)]);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return [imports, fileContent];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function extractScssUses(fileContent) {
|
|
102
|
+
let match;
|
|
103
|
+
const uses: string[][] = [];
|
|
104
|
+
|
|
105
|
+
while ((match = SCSS_USE_REGEX.exec(fileContent)) !== null) {
|
|
106
|
+
const usesPath: string = match[1];
|
|
107
|
+
const usesLine: string = match[0];
|
|
108
|
+
|
|
109
|
+
if (!uses.find((item) => {
|
|
110
|
+
return item[0] == usesPath
|
|
111
|
+
}) && !(usesPath !== 'sass:math')) {
|
|
112
|
+
uses.push([usesPath, usesLine]);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return [uses];
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function detectImports(code) {
|
|
120
|
+
return CSS_IMPORT_REGEX.test(code);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function replaceWithNodeModules(input, fileDir = null, absolute = false, token = '~') {
|
|
124
|
+
return input.replace(token, absolute ? `${path.resolve(WORKSPACE, 'node_modules')}/` : this.node_modules_dir(fileDir ? fileDir : process.cwd()));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function processImports(imports, fileRootDir, importStorage = {}, sub = false) {
|
|
128
|
+
const _scss_fs = _scss_fs_builder(this);
|
|
129
|
+
const importResults: {
|
|
130
|
+
line: number,
|
|
131
|
+
code: string
|
|
132
|
+
}[] = [];
|
|
133
|
+
|
|
134
|
+
const getStorage = (sourceComponentPath, importedFileContent) => {
|
|
135
|
+
const sourceComponentPathFormatted = sourceComponentPath.replace('/', '_');
|
|
136
|
+
|
|
137
|
+
if (!(sourceComponentPathFormatted in importStorage)) {
|
|
138
|
+
importStorage[sourceComponentPathFormatted] = importedFileContent;
|
|
139
|
+
|
|
140
|
+
return importedFileContent;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return '';
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
imports.forEach(importData => {
|
|
147
|
+
const originalImportPath = importData[0];
|
|
148
|
+
let importPath = processImportPath(originalImportPath, fileRootDir);
|
|
149
|
+
let replacedScssContent = getStorage(importPath, _scss_fs.getCodeFromFile(importPath).replace(/\/\*[\s\S]*?\*\//g, ''));
|
|
150
|
+
|
|
151
|
+
const recursiveImports = extractScssImports(replacedScssContent, importPath)[0];
|
|
152
|
+
|
|
153
|
+
if (recursiveImports.length) {
|
|
154
|
+
|
|
155
|
+
replacedScssContent = replaceImports(processImports(recursiveImports, path.dirname(importPath), importStorage, true), replacedScssContent);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
importResults.push({
|
|
159
|
+
line: importData[1],
|
|
160
|
+
code: replacedScssContent
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
return importResults;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function replaceImports(processedImports, code) {
|
|
168
|
+
processedImports.forEach(importObj => {
|
|
169
|
+
code = code.replace(importObj.line, importObj.code);
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
return code;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export default (element) => ({
|
|
176
|
+
processImportPath: processImportPath.bind(element),
|
|
177
|
+
fillSCSSExt: fillSCSSExt.bind(element),
|
|
178
|
+
underscorePath: underscorePath.bind(element),
|
|
179
|
+
detectImports: detectImports.bind(element),
|
|
180
|
+
extractScssUses: extractScssUses.bind(element),
|
|
181
|
+
extractScssImports: extractScssImports.bind(element),
|
|
182
|
+
replaceImports: replaceImports.bind(element),
|
|
183
|
+
processImports: processImports.bind(element),
|
|
184
|
+
replaceWithNodeModules: replaceWithNodeModules.bind(element)
|
|
185
|
+
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -10,13 +10,8 @@ function processEnvDefines(BuildConfigurator, config, devDebug) {
|
|
|
10
10
|
const rwsDefines = BuildConfigurator.get('rwsDefines') || config.rwsDefines || null;
|
|
11
11
|
|
|
12
12
|
if (rwsDefines) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
..._rws_defines,
|
|
16
|
-
['process.env.' + defineKey]: JSON.stringify(rwsDefines[defineKey])
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
13
|
+
_rws_defines = { ..._rws_defines, ...rwsDefines }
|
|
14
|
+
}
|
|
20
15
|
|
|
21
16
|
return _rws_defines;
|
|
22
17
|
}
|
|
File without changes
|
|
@@ -47,7 +47,12 @@ function createWebpackConfig(
|
|
|
47
47
|
externals: rwsExternals(executionDir, modules_setup, automatedChunks, {
|
|
48
48
|
_vars: devExternalsVars
|
|
49
49
|
}),
|
|
50
|
-
cache:
|
|
50
|
+
cache: {
|
|
51
|
+
type: 'filesystem',
|
|
52
|
+
buildDependencies: {
|
|
53
|
+
config: [__filename],
|
|
54
|
+
},
|
|
55
|
+
}
|
|
51
56
|
}
|
|
52
57
|
}
|
|
53
58
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rws-framework/client",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.13.1",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"docs": "typedoc --tsconfig ./tsconfig.json"
|
|
@@ -28,18 +28,18 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@microsoft/fast-element": "^1.12.0",
|
|
30
30
|
"@microsoft/fast-foundation": "^2.46.2",
|
|
31
|
-
"@rws-framework/console": "^0.3.
|
|
31
|
+
"@rws-framework/console": "^0.3.15",
|
|
32
32
|
"@types/moment": "^2.13.0",
|
|
33
33
|
"deepmerge": "^4.3.1",
|
|
34
34
|
"dragula": "^3.7.3",
|
|
35
35
|
"he": "^1.2.0",
|
|
36
36
|
"json5": "^2.2.3",
|
|
37
37
|
"lodash": "^4.17.21",
|
|
38
|
-
"moment": "^2.29.4",
|
|
38
|
+
"moment": "^2.29.4",
|
|
39
39
|
"partial-json-parser": "^1.0.0",
|
|
40
40
|
"reflect-metadata": "^0.1.13",
|
|
41
41
|
"resolve-url-loader": "^5.0.0",
|
|
42
|
-
"sanitize-html": "^2.12.1",
|
|
42
|
+
"sanitize-html": "^2.12.1",
|
|
43
43
|
"socket.io-client": "^4.7.2",
|
|
44
44
|
"upload": "^1.3.2",
|
|
45
45
|
"url-router": "^13.0.0",
|
|
@@ -54,25 +54,26 @@
|
|
|
54
54
|
"@types/he": "^1.2.3",
|
|
55
55
|
"@types/sanitize-html": "^2.11.0",
|
|
56
56
|
"@types/uuid": "^9.0.7",
|
|
57
|
-
"@typescript-eslint/parser": "^5.0.0",
|
|
57
|
+
"@typescript-eslint/parser": "^5.0.0",
|
|
58
58
|
"browser-sync": "^2.29.3",
|
|
59
59
|
"clean-webpack-plugin": "^4.0.0",
|
|
60
60
|
"css-loader": "^6.8.1",
|
|
61
61
|
"css-minimizer-webpack-plugin": "^5.0.1",
|
|
62
62
|
"eslint": "^6.0.0",
|
|
63
|
-
"file-loader": "^6.2.0",
|
|
63
|
+
"file-loader": "^6.2.0",
|
|
64
64
|
"html-webpack-plugin": "^5.5.3",
|
|
65
65
|
"loader-utils": "^3.2.1",
|
|
66
66
|
"mini-css-extract-plugin": "^2.7.6",
|
|
67
67
|
"minimatch": "^9.0.4",
|
|
68
68
|
"node-sass": "^9.0.0",
|
|
69
|
-
"raw-loader": "^4.0.2",
|
|
70
|
-
"source-map": "^0.7.4",
|
|
69
|
+
"raw-loader": "^4.0.2",
|
|
70
|
+
"source-map": "^0.7.4",
|
|
71
71
|
"source-map-support": "^0.5.21",
|
|
72
|
-
"stacktrace-gps": "^3.1.2",
|
|
72
|
+
"stacktrace-gps": "^3.1.2",
|
|
73
73
|
"sass": "1.69.7",
|
|
74
74
|
"sass-loader": "^13.3.2",
|
|
75
75
|
"scss-loading-animations": "^1.0.1",
|
|
76
|
+
"sass-embedded": "^1.83.4",
|
|
76
77
|
"speed-measure-webpack-plugin": "^1.5.0",
|
|
77
78
|
"style-loader": "^3.3.3",
|
|
78
79
|
"terser-webpack-plugin": "^5.3.9",
|
|
@@ -92,6 +93,7 @@
|
|
|
92
93
|
"tsc-watch": "^6.0.4",
|
|
93
94
|
"tslib": "^2.6.2",
|
|
94
95
|
"uglify-js": "^3.17.4",
|
|
96
|
+
"vite": "^6.0.11",
|
|
95
97
|
"webpack": "^5.86.0",
|
|
96
98
|
"webpack-bundle-analyzer": "^4.10.1",
|
|
97
99
|
"webpack-cli": "^5.1.4",
|
package/src/client/config.ts
CHANGED
|
@@ -73,11 +73,11 @@ function get(this: RWSClientInstance, key: string): any | null
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
type PluginConstructor<T extends DefaultRWSPluginOptionsType> = new (options: T) => RWSPlugin<T>;
|
|
76
|
-
type RWSPluginEntry = IStaticRWSPlugin
|
|
76
|
+
type RWSPluginEntry<T extends DefaultRWSPluginOptionsType = DefaultRWSPluginOptionsType> = IStaticRWSPlugin<T>;
|
|
77
77
|
|
|
78
78
|
function addPlugin<T extends DefaultRWSPluginOptionsType>(this: RWSClientInstance, pluginEntry: RWSPluginEntry){
|
|
79
79
|
const rwsWindow: RWSWindow = loadRWSRichWindow();
|
|
80
|
-
const pluginClass: PluginConstructor<T> = (Array.isArray(pluginEntry) ? pluginEntry[0] : pluginEntry) as PluginConstructor<T>;
|
|
80
|
+
const pluginClass: PluginConstructor<T> = (Array.isArray(pluginEntry) ? pluginEntry[0] : pluginEntry) as unknown as PluginConstructor<T>;
|
|
81
81
|
const pluginOptions: T = (Array.isArray(pluginEntry) ? pluginEntry[1] : { enabled: true }) as T;
|
|
82
82
|
|
|
83
83
|
if(!Object.keys(rwsWindow.RWS.plugins).includes(pluginClass.name)){
|
package/src/client.ts
CHANGED
|
@@ -6,6 +6,7 @@ import DOMService, { DOMServiceInstance, DOMOutputType } from '../services/DOMSe
|
|
|
6
6
|
import ApiService, { ApiServiceInstance } from '../services/ApiService';
|
|
7
7
|
import NotifyService, { NotifyServiceInstance } from '../services/NotifyService';
|
|
8
8
|
import { IRWSViewComponent, IAssetShowOptions } from '../types/IRWSViewComponent';
|
|
9
|
+
import RWSWindow, { RWSWindowComponentInterface, loadRWSRichWindow } from '../types/RWSWindow';
|
|
9
10
|
import { applyConstructor, RWSInject } from './_decorator';
|
|
10
11
|
import TheRWSService from '../services/_service';
|
|
11
12
|
import { handleExternalChange } from './_attrs/_external_handler';
|
|
@@ -70,7 +71,7 @@ abstract class RWSViewComponent extends FoundationElement implements IRWSViewCom
|
|
|
70
71
|
|
|
71
72
|
constructor() {
|
|
72
73
|
super();
|
|
73
|
-
applyConstructor(this);
|
|
74
|
+
applyConstructor(this);
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
connectedCallback() {
|
|
@@ -240,5 +241,6 @@ abstract class RWSViewComponent extends FoundationElement implements IRWSViewCom
|
|
|
240
241
|
export default RWSViewComponent;
|
|
241
242
|
|
|
242
243
|
export type {
|
|
243
|
-
IAssetShowOptions,
|
|
244
|
+
IAssetShowOptions,
|
|
245
|
+
IRWSViewComponent
|
|
244
246
|
} from '../types/IRWSViewComponent';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {DI, Container, Registration } from '../../foundation/rws-foundation';
|
|
2
2
|
import {loadRWSRichWindow} from '../types/RWSWindow';
|
|
3
3
|
|
|
4
4
|
export default () => {
|
|
@@ -13,8 +13,4 @@ export default () => {
|
|
|
13
13
|
return richWindow.RWS.container;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
export { DI, Container }
|
|
17
|
-
|
|
18
|
-
export type {
|
|
19
|
-
Key, Registration, InterfaceSymbol
|
|
20
|
-
} from '../../foundation/rws-foundation';
|
|
16
|
+
export { DI, Container, Registration }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import RWSViewComponent from
|
|
1
|
+
import RWSViewComponent from './_component';
|
|
2
2
|
|
|
3
3
|
export function on<T>(this: RWSViewComponent, type: string, listener: (event: CustomEvent<any>) => any) {
|
|
4
4
|
this.addEventListener(type, (baseEvent: Event) => {
|
package/src/index.ts
CHANGED
|
@@ -1,104 +1,94 @@
|
|
|
1
|
-
// Regular imports for classes and functions
|
|
2
|
-
import { observable, attr } from '@microsoft/fast-element';
|
|
3
1
|
import { Transformer as HTMLTagTransformerType, Tag as HTMLTag, Attributes as HTMLAttributes } from 'sanitize-html';
|
|
2
|
+
import { observable, attr } from '@microsoft/fast-element';
|
|
3
|
+
import type IRWSConfig from './types/IRWSConfig';
|
|
4
|
+
import type RWSNotify from './types/RWSNotify';
|
|
5
|
+
import type { NotifyUiType, NotifyLogType } from './types/RWSNotify';
|
|
4
6
|
import RWSService from './services/_service';
|
|
5
7
|
import ConfigService, { ConfigServiceInstance } from './services/ConfigService';
|
|
6
|
-
import NotifyService, {
|
|
8
|
+
import NotifyService, {NotifyServiceInstance} from './services/NotifyService';
|
|
7
9
|
import DOMService, { DOMServiceInstance } from './services/DOMService';
|
|
10
|
+
import type { DOMOutputType, TagsProcessorType } from './services/DOMService';
|
|
8
11
|
import ApiService, { ApiServiceInstance } from './services/ApiService';
|
|
9
|
-
import
|
|
12
|
+
import type { IBackendRoute, IHTTProute, IPrefixedHTTProutes } from './services/ApiService';
|
|
13
|
+
|
|
14
|
+
import UtilsService, {UtilsServiceInstance} from './services/UtilsService';
|
|
10
15
|
import ServiceWorkerService, { ServiceWorkerServiceInstance } from './services/ServiceWorkerService';
|
|
11
16
|
import { sanitizedAttr } from './components/_attrs/sanitize-html';
|
|
12
17
|
import { ngAttr } from './components/_attrs/angular-attr';
|
|
13
18
|
import { externalObservable } from './components/_attrs/external-observable';
|
|
14
19
|
import { externalAttr } from './components/_attrs/external-attr';
|
|
15
20
|
import { RWSPlugin } from './plugins/_plugin';
|
|
21
|
+
|
|
22
|
+
import type { DefaultRWSPluginOptionsType } from './plugins/_plugin';
|
|
23
|
+
|
|
24
|
+
import type { IRWSPlugin, IStaticRWSPlugin } from './types/IRWSPlugin';
|
|
16
25
|
import RWSClient, { RWSClientInstance } from './client';
|
|
26
|
+
import type { RWSPluginEntry } from './types/IRWSConfig';
|
|
27
|
+
import type IRWSUser from './types/IRWSUser';
|
|
17
28
|
import RWSViewComponent from './components/_component';
|
|
29
|
+
import type { IAssetShowOptions } from './components/_component';
|
|
30
|
+
|
|
18
31
|
import RWSContainer from './components/_container';
|
|
19
|
-
import { RWSIgnore, RWSInject, RWSView } from './components/_decorator';
|
|
20
|
-
import { declareRWSComponents } from './components';
|
|
21
32
|
|
|
22
|
-
// Type imports
|
|
23
|
-
import type { DOMOutputType, TagsProcessorType } from './services/DOMService';
|
|
24
|
-
import type { IBackendRoute, IHTTProute, IPrefixedHTTProutes } from './services/ApiService';
|
|
25
|
-
import type { DefaultRWSPluginOptionsType } from './plugins/_plugin';
|
|
26
|
-
import type { IRWSPlugin, IStaticRWSPlugin } from './types/IRWSPlugin';
|
|
27
|
-
import type { RWSPluginEntry } from './types/IRWSConfig';
|
|
28
|
-
import type { NotifyUiType, NotifyLogType } from './types/RWSNotify';
|
|
29
33
|
import type { RWSDecoratorOptions } from './components/_decorator';
|
|
30
|
-
import type { IAssetShowOptions } from './components/_component';
|
|
31
|
-
import type IRWSConfig from './types/IRWSConfig';
|
|
32
|
-
import type IRWSUser from './types/IRWSUser';
|
|
33
|
-
import type RWSNotify from './types/RWSNotify';
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
import { RWSIgnore, RWSInject, RWSView } from './components/_decorator';
|
|
36
|
+
|
|
37
|
+
import { declareRWSComponents } from './components';
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
export {
|
|
39
|
+
export default RWSClient;
|
|
40
|
+
export {
|
|
40
41
|
RWSClient,
|
|
41
42
|
RWSClientInstance,
|
|
43
|
+
|
|
42
44
|
RWSPlugin,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
NotifyService,
|
|
47
|
-
ConfigService,
|
|
48
|
-
ServiceWorkerService,
|
|
49
|
-
RWSService,
|
|
50
|
-
RWSViewComponent,
|
|
51
|
-
RWSContainer,
|
|
52
|
-
RWSView,
|
|
53
|
-
RWSIgnore,
|
|
54
|
-
RWSInject,
|
|
55
|
-
sanitizedAttr,
|
|
56
|
-
externalObservable,
|
|
57
|
-
externalAttr,
|
|
58
|
-
observable,
|
|
59
|
-
attr,
|
|
60
|
-
ngAttr,
|
|
61
|
-
declareRWSComponents,
|
|
45
|
+
RWSPluginEntry,
|
|
46
|
+
IRWSPlugin, IStaticRWSPlugin,
|
|
47
|
+
DefaultRWSPluginOptionsType,
|
|
62
48
|
|
|
63
|
-
|
|
49
|
+
NotifyUiType,
|
|
50
|
+
NotifyLogType,
|
|
51
|
+
|
|
64
52
|
ApiServiceInstance,
|
|
65
|
-
|
|
53
|
+
ApiService,
|
|
54
|
+
UtilsServiceInstance,
|
|
55
|
+
UtilsService,
|
|
66
56
|
DOMServiceInstance,
|
|
57
|
+
DOMService,
|
|
58
|
+
DOMOutputType,
|
|
67
59
|
NotifyServiceInstance,
|
|
60
|
+
NotifyService,
|
|
68
61
|
ConfigServiceInstance,
|
|
62
|
+
ConfigService,
|
|
69
63
|
ServiceWorkerServiceInstance,
|
|
70
|
-
|
|
71
|
-
// External types
|
|
72
|
-
HTMLTagTransformerType,
|
|
73
|
-
HTMLTag,
|
|
74
|
-
HTMLAttributes
|
|
75
|
-
};
|
|
64
|
+
ServiceWorkerService,
|
|
76
65
|
|
|
77
|
-
// Type exports
|
|
78
|
-
export type {
|
|
79
|
-
// Plugin types
|
|
80
|
-
RWSPluginEntry,
|
|
81
|
-
IRWSPlugin,
|
|
82
|
-
IStaticRWSPlugin,
|
|
83
|
-
DefaultRWSPluginOptionsType,
|
|
84
|
-
|
|
85
|
-
// Notification types
|
|
86
|
-
NotifyUiType,
|
|
87
|
-
NotifyLogType,
|
|
88
66
|
RWSNotify,
|
|
89
|
-
|
|
90
|
-
// Service and API types
|
|
91
|
-
DOMOutputType,
|
|
92
|
-
TagsProcessorType,
|
|
93
67
|
IBackendRoute as IRWSBackendRoute,
|
|
94
|
-
IHTTProute as IRWSHttpRoute,
|
|
95
|
-
IPrefixedHTTProutes as IRWSPrefixedHTTProutes,
|
|
96
|
-
|
|
97
|
-
// Component and decorator types
|
|
98
68
|
RWSDecoratorOptions as IRWSDecoratorOptions,
|
|
69
|
+
IHTTProute as IRWSHttpRoute,
|
|
70
|
+
IPrefixedHTTProutes as IRWSPrefixedHTTProutes,
|
|
99
71
|
IAssetShowOptions as IRWSAssetShowOptions,
|
|
100
|
-
|
|
101
|
-
// Config and user types
|
|
102
72
|
IRWSConfig,
|
|
103
|
-
IRWSUser
|
|
73
|
+
IRWSUser,
|
|
74
|
+
TagsProcessorType,
|
|
75
|
+
HTMLTagTransformerType,
|
|
76
|
+
HTMLTag,
|
|
77
|
+
HTMLAttributes,
|
|
78
|
+
|
|
79
|
+
RWSView,
|
|
80
|
+
sanitizedAttr,
|
|
81
|
+
RWSIgnore,
|
|
82
|
+
RWSInject,
|
|
83
|
+
observable,
|
|
84
|
+
externalObservable,
|
|
85
|
+
externalAttr,
|
|
86
|
+
attr,
|
|
87
|
+
ngAttr,
|
|
88
|
+
|
|
89
|
+
RWSService,
|
|
90
|
+
RWSViewComponent,
|
|
91
|
+
declareRWSComponents,
|
|
92
|
+
|
|
93
|
+
RWSContainer
|
|
104
94
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import TheService from './_service';
|
|
2
2
|
|
|
3
3
|
//@4DI
|
|
4
|
-
import ConfigService, { ConfigServiceInstance } from '
|
|
4
|
+
import ConfigService, { ConfigServiceInstance } from './ConfigService';
|
|
5
5
|
|
|
6
6
|
import { upload, UploadResponse } from 'upload';
|
|
7
7
|
|
|
@@ -80,11 +80,6 @@ class ApiService extends TheService {
|
|
|
80
80
|
this.token = token;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
getToken(): string
|
|
84
|
-
{
|
|
85
|
-
return this.token;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
83
|
public async pureGet(url: string, options: IAPIOptions = {}): Promise<string> {
|
|
89
84
|
try {
|
|
90
85
|
const response = await fetch(url, {
|
|
@@ -198,8 +193,6 @@ class ApiService extends TheService {
|
|
|
198
193
|
apiPath = apiPath.replace(`:${paramKey}`, paramValue);
|
|
199
194
|
});
|
|
200
195
|
|
|
201
|
-
console.log('bck', this.config.get('backendUrl'));
|
|
202
|
-
|
|
203
196
|
return `${this.config.get('backendUrl')}${this.config.get('apiPrefix') || ''}${apiPath}`;
|
|
204
197
|
}
|
|
205
198
|
|
package/src/services/_service.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import RWSContainer from '../components/_container';
|
|
1
|
+
import RWSContainer, { DI, InterfaceSymbol, Key, Registration } from '../components/_container';
|
|
2
2
|
import { loadRWSRichWindow } from '../types/RWSWindow';
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
export interface IWithDI<T> {
|
|
5
5
|
new (...args: any[]): T;
|
|
6
6
|
getSingleton: <T extends Key>(this: IWithDI<T>) => InterfaceSymbol<T>;
|