@rws-framework/client 2.20.1 → 2.20.3

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.
Files changed (84) hide show
  1. package/.bin/emerge.sh +15 -15
  2. package/builder/vite/index.ts +4 -4
  3. package/builder/vite/rws.vite.config.ts +132 -132
  4. package/builder/vite/rws_scss_plugin.ts +61 -61
  5. package/builder/webpack/index.js +10 -10
  6. package/builder/webpack/rws.webpack.config.js +161 -161
  7. package/builder/webpack/rws_scss_plugin.js +90 -90
  8. package/builder/webpack/rws_webpack_plugin.js +137 -137
  9. package/cfg/_default.cfg.js +26 -26
  10. package/cfg/_storage.d.ts +22 -22
  11. package/cfg/_storage.js +42 -42
  12. package/cfg/tsconfigSetup.js +146 -146
  13. package/docs/assets/26e93147f10415a0ed4a.svg +6 -6
  14. package/docs/assets/75c9471662e97ee24f29.svg +7 -7
  15. package/docs/assets/db90e4df2373980c497d.svg +9 -9
  16. package/docs/assets/highlight.css +127 -127
  17. package/docs/assets/main.js +59 -59
  18. package/docs/assets/style.css +1414 -1414
  19. package/docs/classes/ApiServiceInstance.html +25 -25
  20. package/docs/classes/ConfigServiceInstance.html +21 -21
  21. package/docs/classes/DOMServiceInstance.html +17 -17
  22. package/docs/classes/NotifyServiceInstance.html +15 -15
  23. package/docs/classes/RWSClientInstance.html +45 -45
  24. package/docs/classes/RWSPlugin.html +13 -13
  25. package/docs/classes/RWSService.html +10 -10
  26. package/docs/classes/RWSViewComponent.html +1022 -1022
  27. package/docs/classes/ServiceWorkerServiceInstance.html +13 -13
  28. package/docs/classes/UtilsServiceInstance.html +13 -13
  29. package/docs/functions/attr.html +5 -5
  30. package/docs/functions/observable.html +3 -3
  31. package/docs/index.html +179 -179
  32. package/docs/interfaces/HTMLTag.html +3 -3
  33. package/docs/interfaces/IRWSConfig.html +20 -20
  34. package/docs/interfaces/IRWSDecoratorOptions.html +5 -5
  35. package/docs/interfaces/IRWSHttpRoute.html +2 -2
  36. package/docs/interfaces/IRWSPrefixedHTTProutes.html +2 -2
  37. package/docs/interfaces/IRWSUser.html +5 -5
  38. package/docs/modules.html +45 -45
  39. package/foundation/index.js +1 -1
  40. package/foundation/rws-foundation.d.ts +7 -7
  41. package/foundation/rws-foundation.js +7 -7
  42. package/package.json +1 -1
  43. package/service_worker/src/_service_worker.ts +83 -83
  44. package/service_worker/tsconfig.json +20 -20
  45. package/service_worker/webpack.config.js +66 -66
  46. package/src/client/components.ts +67 -67
  47. package/src/client/config.ts +175 -175
  48. package/src/client/hotReload.ts +22 -22
  49. package/src/client/services.ts +27 -27
  50. package/src/client.ts +208 -208
  51. package/src/components/_component.ts +247 -247
  52. package/src/components/_container.ts +15 -15
  53. package/src/components/_decorator.ts +122 -122
  54. package/src/components/_definitions.ts +64 -64
  55. package/src/components/_event_handling.ts +40 -40
  56. package/src/components/index.ts +25 -25
  57. package/src/index.ts +86 -86
  58. package/src/plugins/_builder.js +31 -31
  59. package/src/plugins/_plugin.ts +60 -60
  60. package/src/services/ApiService.ts +105 -105
  61. package/src/services/ConfigService.ts +125 -125
  62. package/src/services/DOMService.ts +93 -93
  63. package/src/services/NotifyService.ts +47 -47
  64. package/src/services/ServiceWorkerService.ts +60 -60
  65. package/src/services/UtilsService.ts +60 -60
  66. package/src/services/_service.ts +64 -64
  67. package/src/styles/README.md +157 -157
  68. package/src/styles/_darkreader.scss +30 -30
  69. package/src/styles/_grid.scss +75 -75
  70. package/src/styles/_grid_legacy.scss +49 -49
  71. package/src/styles/_misc.scss +8 -8
  72. package/src/styles/_scrollbars.scss +40 -40
  73. package/src/styles/includes.scss +6 -6
  74. package/src/types/IBackendCore.ts +11 -11
  75. package/src/types/IRWSConfig.ts +29 -29
  76. package/src/types/IRWSPlugin.ts +23 -23
  77. package/src/types/IRWSResource.ts +4 -4
  78. package/src/types/IRWSUser.ts +6 -6
  79. package/src/types/IRWSViewComponent.ts +36 -36
  80. package/src/types/IReFormerField.ts +4 -4
  81. package/src/types/RWSNotify.ts +6 -6
  82. package/src/types/RWSWindow.ts +41 -41
  83. package/types/declarations.d.ts +8 -8
  84. package/types/docs-typings.d.ts +15 -15
package/.bin/emerge.sh CHANGED
@@ -1,16 +1,16 @@
1
- #!/bin/bash
2
-
3
- if ! command -v emerge >/dev/null 2>&1; then
4
- echo "emerge command does not exist. Installing."
5
- apt-get install graphviz graphviz-dev
6
- pip install emerge-viz
7
- fi
8
-
9
- mkdir -p ./.emerge-vis-output/rws-client
10
- mkdir -p ./.emerge-vis-output/fast-element
11
- mkdir -p ./.emerge-vis-output/fast-foundation
12
-
13
- npm install
14
-
15
- emerge -c ./.emerge-typescript-template.yaml
1
+ #!/bin/bash
2
+
3
+ if ! command -v emerge >/dev/null 2>&1; then
4
+ echo "emerge command does not exist. Installing."
5
+ apt-get install graphviz graphviz-dev
6
+ pip install emerge-viz
7
+ fi
8
+
9
+ mkdir -p ./.emerge-vis-output/rws-client
10
+ mkdir -p ./.emerge-vis-output/fast-element
11
+ mkdir -p ./.emerge-vis-output/fast-foundation
12
+
13
+ npm install
14
+
15
+ emerge -c ./.emerge-typescript-template.yaml
16
16
  emerge -c ./.emerge-fast.yaml
@@ -1,5 +1,5 @@
1
- import { rwsViteBuilder } from './rws.vite.config';
2
-
3
- export {
4
- rwsViteBuilder
1
+ import { rwsViteBuilder } from './rws.vite.config';
2
+
3
+ export {
4
+ rwsViteBuilder
5
5
  };
@@ -1,133 +1,133 @@
1
- import path from 'path';
2
- import fs from 'fs';
3
- import { processEnvDefines } from '../../cfg/build_steps/vite/_env_defines';
4
- import { getRWSVitePlugins } from '../../cfg/build_steps/vite/_loaders';
5
- import { rwsPath } from '@rws-framework/console';
6
- import type { RWSViteConfig } from '../../cfg/build_steps/vite/types';
7
- import type { UserConfig } from 'vite'; // Add this import
8
- import { RWSScssPlugin } from './rws_scss_plugin';
9
-
10
- import { ScriptTarget } from 'typescript';
11
-
12
- interface CompilerOptionsConfig {
13
- baseUrl: string;
14
- experimentalDecorators: boolean;
15
- emitDecoratorMetadata: boolean;
16
- target: 'ES2018' | 'ES2020' | 'ESNext';
17
- module: 'es2022' | 'ESNext' | 'commonjs';
18
- moduleResolution: 'node' | 'bundler';
19
- strict: boolean;
20
- esModuleInterop: boolean;
21
- resolveJsonModule: boolean;
22
- outDir: string;
23
- strictNullChecks: boolean;
24
- skipLibCheck: boolean;
25
- allowSyntheticDefaultImports: boolean;
26
- sourceMap: boolean;
27
- declaration: boolean;
28
- lib: Array<'DOM' | 'ESNext' | 'ES2018' | 'ES2020'>; // add other lib options as needed
29
- }
30
-
31
- interface TSConfig {
32
- compilerOptions: CompilerOptionsConfig;
33
- paths?: {[key: string]: string[] };
34
- include?: string[];
35
- exclude?: string[];
36
- }
37
-
38
- function logError(error: any) {
39
- console.error('Vite config error:', {
40
- message: error.message,
41
- stack: error.stack,
42
- cause: error.cause
43
- });
44
- throw error;
45
- }
46
-
47
- function loadTsConfig(tsPath: string): TSConfig | null
48
- {
49
- if(!fs.existsSync(tsPath)){
50
- return null;
51
- }
52
-
53
- try {
54
- const tsConfig = JSON.parse(fs.readFileSync(tsPath, 'utf-8'));
55
- return tsConfig;
56
- } catch (error) {
57
- logError(error);
58
- return null;
59
- }
60
- }
61
-
62
- export const _DEFAULT_CFG: RWSViteConfig = {
63
- dev: true,
64
- entry: path.resolve(rwsPath.findPackageDir(process.cwd()), 'src', 'index.ts'),
65
- outDir: path.resolve(rwsPath.findPackageDir(process.cwd()), 'dist'),
66
- tsConfigPath: path.resolve(rwsPath.findPackageDir(process.cwd()), 'tsconfig.json'),
67
- cssOutputPath: path.resolve(rwsPath.findPackageDir(process.cwd()), 'public', 'css'),
68
- };
69
-
70
- export function rwsViteBuilder(config: Partial<RWSViteConfig> = _DEFAULT_CFG, devDebug = false): UserConfig {
71
- if(!config.tsConfigPath){
72
- config.tsConfigPath = _DEFAULT_CFG.tsConfigPath;
73
- }
74
-
75
- if(!config.cssOutputPath){
76
- config.cssOutputPath = _DEFAULT_CFG.cssOutputPath;
77
- }
78
-
79
- if(!config.outDir){
80
- config.outDir = _DEFAULT_CFG.outDir;
81
- }
82
-
83
- const scssPlugin = new RWSScssPlugin({ autoCompile: [], dev: config.dev as boolean });
84
-
85
-
86
- const theConfig: RWSViteConfig = {..._DEFAULT_CFG, ...config};
87
-
88
- const tsConfig: TSConfig | null = loadTsConfig(theConfig.tsConfigPath);
89
-
90
- if(!tsConfig){
91
- throw new Error(`File "${theConfig.tsConfigPath}" was not found!`)
92
- }
93
-
94
- const pkgDir: string = rwsPath.findPackageDir(process.cwd());
95
-
96
- const outFileName = theConfig.outFileName || 'client.rws.js';
97
-
98
- return {
99
- define: processEnvDefines(theConfig, _DEFAULT_CFG, devDebug),
100
- plugins: getRWSVitePlugins({
101
- scssPlugin,
102
- packageDir: pkgDir,
103
- nodeModulesPath: `${rwsPath.findRootWorkspacePath(process.cwd())}/node_modules`,
104
- tsConfigPath: theConfig.tsConfigPath,
105
- cssOutputPath: theConfig.cssOutputPath as string,
106
- dev: config.dev as boolean
107
- }),
108
- build: {
109
- minify: !config.dev,
110
- sourcemap: config.dev,
111
- outDir: theConfig.outDir,
112
- emptyOutDir: true,
113
- copyPublicDir: false,
114
- rollupOptions: {
115
- output: {
116
- entryFileNames: outFileName,
117
- chunkFileNames: [...outFileName.split('.').slice(0, -1), 'chunk', outFileName.split('.').at(-1)].join('.'),
118
- }
119
- },
120
- lib: {
121
- entry: theConfig.entry,
122
- formats: ['es'],
123
- fileName: () => outFileName
124
- }
125
- },
126
- esbuild: {
127
- target: tsConfig?.compilerOptions?.target?.toString().toLowerCase() || ScriptTarget.ES2022.toString().toLowerCase(),
128
- tsconfigRaw: {
129
- compilerOptions: tsConfig.compilerOptions
130
- }
131
- }
132
- };
1
+ import path from 'path';
2
+ import fs from 'fs';
3
+ import { processEnvDefines } from '../../cfg/build_steps/vite/_env_defines';
4
+ import { getRWSVitePlugins } from '../../cfg/build_steps/vite/_loaders';
5
+ import { rwsPath } from '@rws-framework/console';
6
+ import type { RWSViteConfig } from '../../cfg/build_steps/vite/types';
7
+ import type { UserConfig } from 'vite'; // Add this import
8
+ import { RWSScssPlugin } from './rws_scss_plugin';
9
+
10
+ import { ScriptTarget } from 'typescript';
11
+
12
+ interface CompilerOptionsConfig {
13
+ baseUrl: string;
14
+ experimentalDecorators: boolean;
15
+ emitDecoratorMetadata: boolean;
16
+ target: 'ES2018' | 'ES2020' | 'ESNext';
17
+ module: 'es2022' | 'ESNext' | 'commonjs';
18
+ moduleResolution: 'node' | 'bundler';
19
+ strict: boolean;
20
+ esModuleInterop: boolean;
21
+ resolveJsonModule: boolean;
22
+ outDir: string;
23
+ strictNullChecks: boolean;
24
+ skipLibCheck: boolean;
25
+ allowSyntheticDefaultImports: boolean;
26
+ sourceMap: boolean;
27
+ declaration: boolean;
28
+ lib: Array<'DOM' | 'ESNext' | 'ES2018' | 'ES2020'>; // add other lib options as needed
29
+ }
30
+
31
+ interface TSConfig {
32
+ compilerOptions: CompilerOptionsConfig;
33
+ paths?: {[key: string]: string[] };
34
+ include?: string[];
35
+ exclude?: string[];
36
+ }
37
+
38
+ function logError(error: any) {
39
+ console.error('Vite config error:', {
40
+ message: error.message,
41
+ stack: error.stack,
42
+ cause: error.cause
43
+ });
44
+ throw error;
45
+ }
46
+
47
+ function loadTsConfig(tsPath: string): TSConfig | null
48
+ {
49
+ if(!fs.existsSync(tsPath)){
50
+ return null;
51
+ }
52
+
53
+ try {
54
+ const tsConfig = JSON.parse(fs.readFileSync(tsPath, 'utf-8'));
55
+ return tsConfig;
56
+ } catch (error) {
57
+ logError(error);
58
+ return null;
59
+ }
60
+ }
61
+
62
+ export const _DEFAULT_CFG: RWSViteConfig = {
63
+ dev: true,
64
+ entry: path.resolve(rwsPath.findPackageDir(process.cwd()), 'src', 'index.ts'),
65
+ outDir: path.resolve(rwsPath.findPackageDir(process.cwd()), 'dist'),
66
+ tsConfigPath: path.resolve(rwsPath.findPackageDir(process.cwd()), 'tsconfig.json'),
67
+ cssOutputPath: path.resolve(rwsPath.findPackageDir(process.cwd()), 'public', 'css'),
68
+ };
69
+
70
+ export function rwsViteBuilder(config: Partial<RWSViteConfig> = _DEFAULT_CFG, devDebug = false): UserConfig {
71
+ if(!config.tsConfigPath){
72
+ config.tsConfigPath = _DEFAULT_CFG.tsConfigPath;
73
+ }
74
+
75
+ if(!config.cssOutputPath){
76
+ config.cssOutputPath = _DEFAULT_CFG.cssOutputPath;
77
+ }
78
+
79
+ if(!config.outDir){
80
+ config.outDir = _DEFAULT_CFG.outDir;
81
+ }
82
+
83
+ const scssPlugin = new RWSScssPlugin({ autoCompile: [], dev: config.dev as boolean });
84
+
85
+
86
+ const theConfig: RWSViteConfig = {..._DEFAULT_CFG, ...config};
87
+
88
+ const tsConfig: TSConfig | null = loadTsConfig(theConfig.tsConfigPath);
89
+
90
+ if(!tsConfig){
91
+ throw new Error(`File "${theConfig.tsConfigPath}" was not found!`)
92
+ }
93
+
94
+ const pkgDir: string = rwsPath.findPackageDir(process.cwd());
95
+
96
+ const outFileName = theConfig.outFileName || 'client.rws.js';
97
+
98
+ return {
99
+ define: processEnvDefines(theConfig, _DEFAULT_CFG, devDebug),
100
+ plugins: getRWSVitePlugins({
101
+ scssPlugin,
102
+ packageDir: pkgDir,
103
+ nodeModulesPath: `${rwsPath.findRootWorkspacePath(process.cwd())}/node_modules`,
104
+ tsConfigPath: theConfig.tsConfigPath,
105
+ cssOutputPath: theConfig.cssOutputPath as string,
106
+ dev: config.dev as boolean
107
+ }),
108
+ build: {
109
+ minify: !config.dev,
110
+ sourcemap: config.dev,
111
+ outDir: theConfig.outDir,
112
+ emptyOutDir: true,
113
+ copyPublicDir: false,
114
+ rollupOptions: {
115
+ output: {
116
+ entryFileNames: outFileName,
117
+ chunkFileNames: [...outFileName.split('.').slice(0, -1), 'chunk', outFileName.split('.').at(-1)].join('.'),
118
+ }
119
+ },
120
+ lib: {
121
+ entry: theConfig.entry,
122
+ formats: ['es'],
123
+ fileName: () => outFileName
124
+ }
125
+ },
126
+ esbuild: {
127
+ target: tsConfig?.compilerOptions?.target?.toString().toLowerCase() || ScriptTarget.ES2022.toString().toLowerCase(),
128
+ tsconfigRaw: {
129
+ compilerOptions: tsConfig.compilerOptions
130
+ }
131
+ }
132
+ };
133
133
  }
@@ -1,61 +1,61 @@
1
- import path from 'path';
2
- import { rwsPath } from '@rws-framework/console';
3
-
4
- import _scss_compiler_builder from './scss/_compiler';
5
- import _scss_import_builder from './scss/_import';
6
-
7
- import _scss_fs_builder from './scss/_fs';
8
-
9
- type PluginParams = { autoCompile: string[], dev: boolean };
10
-
11
- class RWSScssPlugin {
12
- protected autoCompile: string[] = [];
13
- protected node_modules_dir: (fileDir: string) => void;
14
-
15
- private _scss_import: any;
16
- private _scss_fs: any;
17
- private _scss_compiler: any;
18
- private dev
19
-
20
- constructor(params: PluginParams = { autoCompile: [], dev: true }) {
21
- this.node_modules_dir = (fileDir) => path.relative(fileDir, rwsPath.findRootWorkspacePath(process.cwd())) + '/node_modules/'
22
- this._scss_import = _scss_import_builder(this);
23
- this._scss_fs = _scss_fs_builder(this);
24
- this._scss_compiler = _scss_compiler_builder(this);
25
-
26
- if (!!params.autoCompile && params.autoCompile.length > 0) {
27
- this.autoCompile = params.autoCompile;
28
- }
29
-
30
- for (let index in this.autoCompile) {
31
- const sassFile = this.autoCompile[index];
32
- this.compileFile(sassFile);
33
- }
34
- }
35
-
36
-
37
- apply(compiler) {
38
- const _self = this;
39
-
40
- return;
41
- }
42
-
43
- async compileFile(scssPath): Promise<{ code: string, dependencies: string[]}>
44
- {
45
- scssPath = this._scss_import.processImportPath(scssPath, path.dirname(scssPath))
46
- let scssCode = this._scss_fs.getCodeFromFile(scssPath);
47
- return await this._scss_compiler.compileScssCode(scssCode, path.dirname(scssPath), null, scssPath);
48
- }
49
-
50
- async compileScssCode(scssCode: string, scssPath: string): Promise<{ code: string, dependencies: string[]}>
51
- {
52
- return await this._scss_compiler.compileScssCode(scssCode, scssPath, this.dev);
53
- }
54
-
55
- writeCssFile(scssFilePath: string, cssContent: string): string
56
- {
57
- return this._scss_fs.writeCssFile(scssFilePath, cssContent);
58
- }
59
- }
60
-
61
- export {RWSScssPlugin};
1
+ import path from 'path';
2
+ import { rwsPath } from '@rws-framework/console';
3
+
4
+ import _scss_compiler_builder from './scss/_compiler';
5
+ import _scss_import_builder from './scss/_import';
6
+
7
+ import _scss_fs_builder from './scss/_fs';
8
+
9
+ type PluginParams = { autoCompile: string[], dev: boolean };
10
+
11
+ class RWSScssPlugin {
12
+ protected autoCompile: string[] = [];
13
+ protected node_modules_dir: (fileDir: string) => void;
14
+
15
+ private _scss_import: any;
16
+ private _scss_fs: any;
17
+ private _scss_compiler: any;
18
+ private dev
19
+
20
+ constructor(params: PluginParams = { autoCompile: [], dev: true }) {
21
+ this.node_modules_dir = (fileDir) => path.relative(fileDir, rwsPath.findRootWorkspacePath(process.cwd())) + '/node_modules/'
22
+ this._scss_import = _scss_import_builder(this);
23
+ this._scss_fs = _scss_fs_builder(this);
24
+ this._scss_compiler = _scss_compiler_builder(this);
25
+
26
+ if (!!params.autoCompile && params.autoCompile.length > 0) {
27
+ this.autoCompile = params.autoCompile;
28
+ }
29
+
30
+ for (let index in this.autoCompile) {
31
+ const sassFile = this.autoCompile[index];
32
+ this.compileFile(sassFile);
33
+ }
34
+ }
35
+
36
+
37
+ apply(compiler) {
38
+ const _self = this;
39
+
40
+ return;
41
+ }
42
+
43
+ async compileFile(scssPath): Promise<{ code: string, dependencies: string[]}>
44
+ {
45
+ scssPath = this._scss_import.processImportPath(scssPath, path.dirname(scssPath))
46
+ let scssCode = this._scss_fs.getCodeFromFile(scssPath);
47
+ return await this._scss_compiler.compileScssCode(scssCode, path.dirname(scssPath), null, scssPath);
48
+ }
49
+
50
+ async compileScssCode(scssCode: string, scssPath: string): Promise<{ code: string, dependencies: string[]}>
51
+ {
52
+ return await this._scss_compiler.compileScssCode(scssCode, scssPath, this.dev);
53
+ }
54
+
55
+ writeCssFile(scssFilePath: string, cssContent: string): string
56
+ {
57
+ return this._scss_fs.writeCssFile(scssFilePath, cssContent);
58
+ }
59
+ }
60
+
61
+ export {RWSScssPlugin};
@@ -1,11 +1,11 @@
1
- const scssLoader = require('./loaders/rws_fast_scss_loader');
2
- const htmlLoader = require('./loaders/rws_fast_html_loader');
3
- const tsLoader = require('./loaders/rws_fast_ts_loader');
4
- const { RWSWebpackWrapper } = require('./rws.webpack.config');
5
-
6
- module.exports = {
7
- RWSWebpackWrapper,
8
- scssLoader,
9
- htmlLoader,
10
- tsLoader
1
+ const scssLoader = require('./loaders/rws_fast_scss_loader');
2
+ const htmlLoader = require('./loaders/rws_fast_html_loader');
3
+ const tsLoader = require('./loaders/rws_fast_ts_loader');
4
+ const { RWSWebpackWrapper } = require('./rws.webpack.config');
5
+
6
+ module.exports = {
7
+ RWSWebpackWrapper,
8
+ scssLoader,
9
+ htmlLoader,
10
+ tsLoader
11
11
  }