@rws-framework/client 2.13.2 → 2.13.4
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/.bin/add-v.sh +9 -9
- package/.bin/emerge.sh +15 -15
- package/.emerge-fast.yaml +46 -46
- package/.emerge-typescript-template.yaml +23 -23
- package/.emerge-vis-output/fast-element/emerge-file_result_dependency_graph.graphml +693 -693
- package/.emerge-vis-output/fast-element/emerge-filesystem_graph.graphml +705 -705
- package/.emerge-vis-output/fast-element/emerge-statistics-metrics.txt +440 -440
- package/.emerge-vis-output/fast-element/html/emerge.html +500 -500
- package/.emerge-vis-output/fast-element/html/jsconfig.json +8 -8
- package/.emerge-vis-output/fast-element/html/resources/css/custom.css +211 -211
- package/.emerge-vis-output/fast-element/html/resources/js/emerge_common.js +44 -44
- package/.emerge-vis-output/fast-element/html/resources/js/emerge_data.js +13 -13
- package/.emerge-vis-output/fast-element/html/resources/js/emerge_git.js +1413 -1413
- package/.emerge-vis-output/fast-element/html/resources/js/emerge_graph.js +539 -539
- package/.emerge-vis-output/fast-element/html/resources/js/emerge_heatmap.js +219 -219
- package/.emerge-vis-output/fast-element/html/resources/js/emerge_hull.js +179 -179
- package/.emerge-vis-output/fast-element/html/resources/js/emerge_main.js +1002 -1002
- package/.emerge-vis-output/fast-element/html/resources/js/emerge_search.js +71 -71
- package/.emerge-vis-output/fast-element/html/resources/js/emerge_ui.js +199 -199
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap-grid.css +4123 -4123
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap-grid.min.css +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap-grid.rtl.css +4122 -4122
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap-grid.rtl.min.css +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap-reboot.css +487 -487
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap-reboot.min.css +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap-reboot.rtl.css +484 -484
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap-reboot.rtl.min.css +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap-utilities.css +4265 -4265
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap-utilities.min.css +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap-utilities.rtl.css +4256 -4256
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap-utilities.rtl.min.css +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap.css +10877 -10877
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap.min.css +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap.rtl.css +10841 -10841
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap.rtl.min.css +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/js/bootstrap.bundle.js +7075 -7075
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/js/bootstrap.bundle.min.js +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/js/bootstrap.esm.js +5202 -5202
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/js/bootstrap.esm.min.js +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/js/bootstrap.js +5249 -5249
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/js/bootstrap.min.js +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/d3/d3.v7.8.4.min.js +2 -2
- package/.emerge-vis-output/fast-element/html/vendors/d3/d3.v7.min.js +2 -2
- package/.emerge-vis-output/fast-element/html/vendors/dark-mode-switch/css/dark-mode.css +148 -148
- package/.emerge-vis-output/fast-element/html/vendors/daterangepicker/daterangepicker.min.js +7 -7
- package/.emerge-vis-output/fast-element/html/vendors/daterangepicker/moment.min.js +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/hull/hull.js +373 -373
- package/.emerge-vis-output/fast-element/html/vendors/jquery/jquery-3.6.0.min.js +2 -2
- package/.emerge-vis-output/fast-element/html/vendors/popper/popper.min.js +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/simpleheat/simpleheat.js +141 -141
- package/.emerge-vis-output/fast-foundation/emerge-file_result_dependency_graph.graphml +4043 -4043
- package/.emerge-vis-output/fast-foundation/emerge-filesystem_graph.graphml +4538 -4538
- package/.emerge-vis-output/fast-foundation/emerge-statistics-metrics.txt +2510 -2510
- package/.emerge-vis-output/fast-foundation/html/emerge.html +500 -500
- package/.emerge-vis-output/fast-foundation/html/jsconfig.json +8 -8
- package/.emerge-vis-output/fast-foundation/html/resources/css/custom.css +211 -211
- package/.emerge-vis-output/fast-foundation/html/resources/js/emerge_common.js +44 -44
- package/.emerge-vis-output/fast-foundation/html/resources/js/emerge_data.js +13 -13
- package/.emerge-vis-output/fast-foundation/html/resources/js/emerge_git.js +1413 -1413
- package/.emerge-vis-output/fast-foundation/html/resources/js/emerge_graph.js +539 -539
- package/.emerge-vis-output/fast-foundation/html/resources/js/emerge_heatmap.js +219 -219
- package/.emerge-vis-output/fast-foundation/html/resources/js/emerge_hull.js +179 -179
- package/.emerge-vis-output/fast-foundation/html/resources/js/emerge_main.js +1002 -1002
- package/.emerge-vis-output/fast-foundation/html/resources/js/emerge_search.js +71 -71
- package/.emerge-vis-output/fast-foundation/html/resources/js/emerge_ui.js +199 -199
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap-grid.css +4123 -4123
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap-grid.min.css +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap-grid.rtl.css +4122 -4122
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap-grid.rtl.min.css +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap-reboot.css +487 -487
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap-reboot.min.css +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap-reboot.rtl.css +484 -484
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap-reboot.rtl.min.css +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap-utilities.css +4265 -4265
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap-utilities.min.css +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap-utilities.rtl.css +4256 -4256
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap-utilities.rtl.min.css +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap.css +10877 -10877
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap.min.css +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap.rtl.css +10841 -10841
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap.rtl.min.css +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/js/bootstrap.bundle.js +7075 -7075
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/js/bootstrap.bundle.min.js +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/js/bootstrap.esm.js +5202 -5202
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/js/bootstrap.esm.min.js +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/js/bootstrap.js +5249 -5249
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/js/bootstrap.min.js +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/d3/d3.v7.8.4.min.js +2 -2
- package/.emerge-vis-output/fast-foundation/html/vendors/d3/d3.v7.min.js +2 -2
- package/.emerge-vis-output/fast-foundation/html/vendors/dark-mode-switch/css/dark-mode.css +148 -148
- package/.emerge-vis-output/fast-foundation/html/vendors/daterangepicker/daterangepicker.min.js +7 -7
- package/.emerge-vis-output/fast-foundation/html/vendors/daterangepicker/moment.min.js +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/hull/hull.js +373 -373
- package/.emerge-vis-output/fast-foundation/html/vendors/jquery/jquery-3.6.0.min.js +2 -2
- package/.emerge-vis-output/fast-foundation/html/vendors/popper/popper.min.js +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/simpleheat/simpleheat.js +141 -141
- package/.emerge-vis-output/rws-client/emerge-file_result_dependency_graph.graphml +1143 -1143
- package/.emerge-vis-output/rws-client/emerge-filesystem_graph.graphml +1003 -1003
- package/.emerge-vis-output/rws-client/emerge-statistics-metrics.txt +655 -655
- package/.emerge-vis-output/rws-client/html/emerge.html +500 -500
- package/.emerge-vis-output/rws-client/html/jsconfig.json +8 -8
- package/.emerge-vis-output/rws-client/html/resources/css/custom.css +211 -211
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_common.js +44 -44
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_data.js +13 -13
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_git.js +1413 -1413
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_graph.js +539 -539
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_heatmap.js +219 -219
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_hull.js +179 -179
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_main.js +1002 -1002
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_search.js +71 -71
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_ui.js +199 -199
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-grid.css +4123 -4123
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-grid.min.css +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-grid.rtl.css +4122 -4122
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-grid.rtl.min.css +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-reboot.css +487 -487
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-reboot.min.css +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-reboot.rtl.css +484 -484
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-reboot.rtl.min.css +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-utilities.css +4265 -4265
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-utilities.min.css +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-utilities.rtl.css +4256 -4256
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-utilities.rtl.min.css +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap.css +10877 -10877
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap.min.css +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap.rtl.css +10841 -10841
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap.rtl.min.css +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/js/bootstrap.bundle.js +7075 -7075
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/js/bootstrap.bundle.min.js +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/js/bootstrap.esm.js +5202 -5202
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/js/bootstrap.esm.min.js +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/js/bootstrap.js +5249 -5249
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/js/bootstrap.min.js +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/d3/d3.v7.8.4.min.js +2 -2
- package/.emerge-vis-output/rws-client/html/vendors/d3/d3.v7.min.js +2 -2
- package/.emerge-vis-output/rws-client/html/vendors/dark-mode-switch/css/dark-mode.css +148 -148
- package/.emerge-vis-output/rws-client/html/vendors/daterangepicker/daterangepicker.min.js +7 -7
- package/.emerge-vis-output/rws-client/html/vendors/daterangepicker/moment.min.js +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/hull/hull.js +373 -373
- package/.emerge-vis-output/rws-client/html/vendors/jquery/jquery-3.6.0.min.js +2 -2
- package/.emerge-vis-output/rws-client/html/vendors/popper/popper.min.js +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/simpleheat/simpleheat.js +141 -141
- package/.eslintrc.json +51 -51
- package/.gitmodules +2 -2
- package/.setup/.eslintrc.json +11 -11
- package/.setup/_base.eslintrc.json +48 -48
- package/.setup/tsconfig.json +28 -28
- package/PLUGINS.MD +188 -188
- package/README.md +1023 -1023
- package/_tools.js +396 -396
- package/builder/vite/index.ts +4 -4
- package/{cfg/build_steps → builder}/vite/loaders/html.ts +11 -11
- package/{cfg/build_steps → builder}/vite/loaders/index.ts +8 -8
- package/{cfg/build_steps → builder}/vite/loaders/loader.type.ts +27 -27
- package/{cfg/build_steps → builder}/vite/loaders/scss.ts +32 -32
- package/{cfg/build_steps → builder}/vite/loaders/ts.ts +309 -309
- package/builder/vite/rws.vite.config.ts +56 -49
- package/{cfg/build_steps → builder}/vite/rws_scss_plugin.ts +61 -60
- package/{cfg/build_steps → builder}/vite/scss/_compiler.ts +95 -94
- package/{cfg/build_steps → builder}/vite/scss/_fonts.ts +80 -80
- package/{cfg/build_steps → builder}/vite/scss/_fs.ts +83 -81
- package/{cfg/build_steps → builder}/vite/scss/_import.ts +191 -184
- package/builder/webpack/after/copy.js +78 -78
- package/builder/webpack/after/sw.js +13 -13
- package/builder/webpack/index.js +10 -10
- package/builder/webpack/loaders/rws_fast_html_loader.js +17 -17
- package/builder/webpack/loaders/rws_fast_scss_loader.js +43 -43
- package/builder/webpack/loaders/rws_fast_ts_loader.js +96 -96
- package/builder/webpack/loaders/ts/html_error.js +19 -19
- package/builder/webpack/rws.webpack.config.js +169 -169
- package/builder/webpack/rws_scss_plugin.js +62 -62
- package/builder/webpack/rws_webpack_plugin.js +137 -137
- package/builder/webpack/scss/_compiler.js +97 -97
- package/builder/webpack/scss/_fonts.js +80 -80
- package/builder/webpack/scss/_fs.js +84 -84
- package/builder/webpack/scss/_import.js +186 -186
- package/cfg/_default.cfg.js +26 -26
- package/cfg/_storage.d.ts +22 -22
- package/cfg/_storage.js +42 -42
- package/cfg/build_steps/vite/_build_config.ts +105 -105
- package/cfg/build_steps/vite/_env_defines.ts +17 -17
- package/cfg/build_steps/vite/_loaders.ts +187 -186
- package/cfg/build_steps/vite/index.ts +2 -2
- package/cfg/build_steps/vite/types.ts +7 -7
- package/cfg/build_steps/webpack/_actions.js +85 -85
- package/cfg/build_steps/webpack/_aliases.js +9 -9
- package/cfg/build_steps/webpack/_build_config.js +76 -76
- package/cfg/build_steps/webpack/_cache.js +98 -98
- package/cfg/build_steps/webpack/_component_handling.js +60 -60
- package/cfg/build_steps/webpack/_dev_servers.js +14 -14
- package/cfg/build_steps/webpack/_env_defines.js +18 -18
- package/cfg/build_steps/webpack/_info.js +18 -18
- package/cfg/build_steps/webpack/_loaders.js +223 -223
- package/cfg/build_steps/webpack/_plugins.js +102 -102
- package/cfg/build_steps/webpack/_production.js +37 -37
- package/cfg/build_steps/webpack/_rws_externals.js +68 -68
- package/cfg/build_steps/webpack/_timing.js +52 -52
- package/cfg/build_steps/webpack/_webpack_config.js +58 -58
- package/cfg/tsconfigSetup.js +150 -150
- package/console.js +86 -86
- package/docs/assets/26e93147f10415a0ed4a.svg +6 -6
- package/docs/assets/75c9471662e97ee24f29.svg +7 -7
- package/docs/assets/db90e4df2373980c497d.svg +9 -9
- package/docs/assets/highlight.css +127 -127
- package/docs/assets/main.js +59 -59
- package/docs/assets/style.css +1414 -1414
- package/docs/classes/ApiServiceInstance.html +25 -25
- package/docs/classes/ConfigServiceInstance.html +21 -21
- package/docs/classes/DOMServiceInstance.html +17 -17
- package/docs/classes/NotifyServiceInstance.html +15 -15
- package/docs/classes/RWSClientInstance.html +45 -45
- package/docs/classes/RWSPlugin.html +13 -13
- package/docs/classes/RWSService.html +10 -10
- package/docs/classes/RWSViewComponent.html +1022 -1022
- package/docs/classes/ServiceWorkerServiceInstance.html +13 -13
- package/docs/classes/UtilsServiceInstance.html +13 -13
- package/docs/functions/attr.html +5 -5
- package/docs/functions/observable.html +3 -3
- package/docs/index.html +179 -179
- package/docs/interfaces/HTMLTag.html +3 -3
- package/docs/interfaces/IRWSConfig.html +20 -20
- package/docs/interfaces/IRWSDecoratorOptions.html +5 -5
- package/docs/interfaces/IRWSHttpRoute.html +2 -2
- package/docs/interfaces/IRWSPrefixedHTTProutes.html +2 -2
- package/docs/interfaces/IRWSUser.html +5 -5
- package/docs/modules.html +45 -45
- package/foundation/index.js +1 -1
- package/foundation/rws-foundation.d.ts +7 -7
- package/foundation/rws-foundation.js +7 -7
- package/package.json +108 -108
- package/service_worker/src/_service_worker.ts +83 -83
- package/service_worker/tsconfig.json +20 -20
- package/service_worker/webpack.config.js +66 -66
- package/src/client/components.ts +67 -67
- package/src/client/config.ts +165 -165
- package/src/client/services.ts +27 -27
- package/src/client.ts +212 -212
- package/src/components/_attrs/_default_observable_accessor.ts +8 -8
- package/src/components/_attrs/_extended_accessor.ts +40 -40
- package/src/components/_attrs/_external_handler.ts +7 -7
- package/src/components/_attrs/_external_observable_accessor.ts +8 -8
- package/src/components/_attrs/angular-attr.ts +34 -34
- package/src/components/_attrs/external-attr.ts +59 -59
- package/src/components/_attrs/external-observable.ts +52 -52
- package/src/components/_attrs/sanitize-html.ts +80 -80
- package/src/components/_component.ts +245 -245
- package/src/components/_container.ts +15 -15
- package/src/components/_decorator.ts +122 -122
- package/src/components/_decorators/RWSFillBuild.ts +54 -54
- package/src/components/_decorators/RWSInject.ts +49 -49
- package/src/components/_decorators/RWSService.ts +11 -11
- package/src/components/_decorators/_di.ts +15 -15
- package/src/components/_definitions.ts +64 -64
- package/src/components/_event_handling.ts +40 -40
- package/src/components/index.ts +14 -14
- package/src/components/loader/component.ts +12 -12
- package/src/components/loader/styles/layout.scss +13 -13
- package/src/components/progress/component.ts +54 -54
- package/src/components/progress/styles/layout.scss +90 -90
- package/src/components/progress/template.html +24 -24
- package/src/components/uploader/component.ts +83 -83
- package/src/components/uploader/styles/layout.scss +130 -130
- package/src/components/uploader/template.html +16 -16
- package/src/index.ts +93 -93
- package/src/plugins/_builder.js +31 -31
- package/src/plugins/_plugin.ts +63 -63
- package/src/services/ApiService.ts +242 -242
- package/src/services/ConfigService.ts +134 -134
- package/src/services/DOMService.ts +100 -100
- package/src/services/NotifyService.ts +47 -47
- package/src/services/ServiceWorkerService.ts +60 -60
- package/src/services/UtilsService.ts +60 -60
- package/src/services/_service.ts +64 -64
- package/src/styles/_darkreader.scss +30 -30
- package/src/styles/_grid.scss +75 -75
- package/src/styles/_misc.scss +8 -8
- package/src/styles/_scrollbars.scss +40 -40
- package/src/styles/includes.scss +4 -4
- package/src/types/IRWSConfig.ts +30 -30
- package/src/types/IRWSPlugin.ts +18 -18
- package/src/types/IRWSUser.ts +6 -6
- package/src/types/IRWSViewComponent.ts +36 -36
- package/src/types/RWSNotify.ts +6 -6
- package/src/types/RWSWindow.ts +41 -41
- package/tsconfig.json +30 -30
- package/typedoc.json +13 -13
- package/types/declarations.d.ts +8 -8
- package/types/docs-typings.d.ts +15 -15
|
@@ -1,82 +1,84 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
import _scss_import from './_import';
|
|
5
|
-
const _COMPILE_DIR_NAME = 'compiled';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function writeCssFile(scssFilePath, cssContent) {
|
|
9
|
-
const cssFilePath = scssFilePath.replace('.scss', '.css');
|
|
10
|
-
let endCssFilePath = cssFilePath.split('/');
|
|
11
|
-
let endCssDirVars: string[] = [...endCssFilePath];
|
|
12
|
-
endCssDirVars[endCssDirVars.length - 1] = `${_COMPILE_DIR_NAME}`;
|
|
13
|
-
const endCssDir: string = endCssDirVars.join('/');
|
|
14
|
-
|
|
15
|
-
if (!fs.existsSync(endCssDir)) {
|
|
16
|
-
fs.mkdirSync(endCssDir);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
endCssFilePath[endCssFilePath.length - 1] = `${_COMPILE_DIR_NAME}/` + endCssFilePath[endCssFilePath.length - 1];
|
|
20
|
-
endCssFilePath = endCssFilePath.join('/');
|
|
21
|
-
|
|
22
|
-
fs.writeFile(endCssFilePath, cssContent, () => {});
|
|
23
|
-
console.log('Saved external CSS file in: ' + endCssFilePath);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function readSCSSFilesFromDirectory(dirPath) {
|
|
27
|
-
let scssFiles: string[] = [];
|
|
28
|
-
|
|
29
|
-
try {
|
|
30
|
-
const files = fs.readdirSync(dirPath);
|
|
31
|
-
|
|
32
|
-
files.forEach(file => {
|
|
33
|
-
const filePath: string = path.join(dirPath, file);
|
|
34
|
-
const stat = fs.statSync(filePath);
|
|
35
|
-
|
|
36
|
-
if (stat.isFile() && path.extname(file) === '.scss') {
|
|
37
|
-
scssFiles.push(filePath);
|
|
38
|
-
} else if (stat.isDirectory()) {
|
|
39
|
-
scssFiles = scssFiles.concat(readSCSSFilesFromDirectory(filePath));
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
} catch (e) {
|
|
43
|
-
console.error(`Failed to read directory ${dirPath}:`, e);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return scssFiles;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
function getCodeFromFile(filePath) {
|
|
51
|
-
filePath = filePath.replace(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
import _scss_import from './_import';
|
|
5
|
+
const _COMPILE_DIR_NAME = 'compiled';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
function writeCssFile(scssFilePath, cssContent) {
|
|
9
|
+
const cssFilePath = scssFilePath.replace('.scss', '.css');
|
|
10
|
+
let endCssFilePath = cssFilePath.split('/');
|
|
11
|
+
let endCssDirVars: string[] = [...endCssFilePath];
|
|
12
|
+
endCssDirVars[endCssDirVars.length - 1] = `${_COMPILE_DIR_NAME}`;
|
|
13
|
+
const endCssDir: string = endCssDirVars.join('/');
|
|
14
|
+
|
|
15
|
+
if (!fs.existsSync(endCssDir)) {
|
|
16
|
+
fs.mkdirSync(endCssDir);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
endCssFilePath[endCssFilePath.length - 1] = `${_COMPILE_DIR_NAME}/` + endCssFilePath[endCssFilePath.length - 1];
|
|
20
|
+
endCssFilePath = endCssFilePath.join('/');
|
|
21
|
+
|
|
22
|
+
fs.writeFile(endCssFilePath, cssContent, () => {});
|
|
23
|
+
console.log('Saved external CSS file in: ' + endCssFilePath);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function readSCSSFilesFromDirectory(dirPath) {
|
|
27
|
+
let scssFiles: string[] = [];
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
const files = fs.readdirSync(dirPath);
|
|
31
|
+
|
|
32
|
+
files.forEach(file => {
|
|
33
|
+
const filePath: string = path.join(dirPath, file);
|
|
34
|
+
const stat = fs.statSync(filePath);
|
|
35
|
+
|
|
36
|
+
if (stat.isFile() && path.extname(file) === '.scss') {
|
|
37
|
+
scssFiles.push(filePath);
|
|
38
|
+
} else if (stat.isDirectory()) {
|
|
39
|
+
scssFiles = scssFiles.concat(readSCSSFilesFromDirectory(filePath));
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
} catch (e) {
|
|
43
|
+
console.error(`Failed to read directory ${dirPath}:`, e);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return scssFiles;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
function getCodeFromFile(filePath) {
|
|
51
|
+
filePath = filePath.replace(/\/\//g, path.sep);
|
|
52
|
+
filePath = filePath.replace(/\\/g, path.sep);
|
|
53
|
+
|
|
54
|
+
if (!fs.existsSync(filePath)) {
|
|
55
|
+
const processedImportPath = _scss_import(this).processImportPath(filePath, path.dirname(filePath));
|
|
56
|
+
if (!fs.existsSync(processedImportPath)) {
|
|
57
|
+
throw new Error(`SCSS loader: File path "${filePath}" was not found.`);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
filePath = processedImportPath;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (filePath[filePath.length - 1] === path.sep && fs.statSync(filePath).isDirectory()) {
|
|
64
|
+
let collectedCode = '';
|
|
65
|
+
|
|
66
|
+
readSCSSFilesFromDirectory(filePath).forEach(scssPath => {
|
|
67
|
+
collectedCode += fs.readFileSync(scssPath, 'utf-8');
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
return collectedCode;
|
|
71
|
+
} else if (fs.statSync(filePath).isDirectory()) {
|
|
72
|
+
throw new Error(`Non-directory path (not ending with "${path.sep}") "${filePath}" is and should not be a directory`)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return fs.readFileSync(filePath, 'utf-8');
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export default function(element) {
|
|
79
|
+
return {
|
|
80
|
+
writeCssFile: writeCssFile.bind(element),
|
|
81
|
+
readSCSSFilesFromDirectory: readSCSSFilesFromDirectory.bind(element),
|
|
82
|
+
getCodeFromFile: getCodeFromFile.bind(element)
|
|
83
|
+
};
|
|
82
84
|
};
|
|
@@ -1,185 +1,192 @@
|
|
|
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
|
|
15
|
-
return
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
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: string, fileRootDir: string | null = null, noext: boolean = false): string
|
|
13
|
+
{
|
|
14
|
+
if(!importPath){
|
|
15
|
+
return '';
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Windows || Unix
|
|
19
|
+
const isRootPath = /[A-Z]\:/.test(importPath.substring(0, 2)) || [...importPath][0] === '/'
|
|
20
|
+
|
|
21
|
+
if (importPath.split('')[0] === '~') {
|
|
22
|
+
return fillSCSSExt(replaceWithNodeModules(importPath, null, true), noext);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (importPath.indexOf('@rws-mixins') === 0) {
|
|
26
|
+
return path.resolve(rwsPath.findPackageDir(__dirname), 'src', 'styles', 'includes.scss');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (importPath.indexOf('@cwd') === 0) {
|
|
30
|
+
return fillSCSSExt(path.join(process.cwd(), importPath.slice(4)), noext);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (isRootPath) {
|
|
34
|
+
return fillSCSSExt(importPath, noext);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (fileRootDir) {
|
|
38
|
+
const relativized = path.join(path.resolve(fileRootDir), importPath);
|
|
39
|
+
|
|
40
|
+
if (importPath.split('')[0] === '.') {
|
|
41
|
+
return fillSCSSExt(relativized, noext);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (!fs.existsSync(relativized)) {
|
|
45
|
+
const partSplit = relativized.split(path.sep);
|
|
46
|
+
partSplit[partSplit.length - 1] = '_' + partSplit[partSplit.length - 1] + '.scss';
|
|
47
|
+
|
|
48
|
+
const newPath = underscorePath(relativized);
|
|
49
|
+
|
|
50
|
+
if (fs.existsSync(newPath)) {
|
|
51
|
+
return newPath;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return fillSCSSExt(relativized, noext);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return importPath;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function underscorePath(path, noext = false) {
|
|
61
|
+
const partSplit = path.split(path.sep);
|
|
62
|
+
partSplit[partSplit.length - 1] = '_' + partSplit[partSplit.length - 1] + (path.indexOf('.scss') > - 1 || noext ? '' : '.scss');
|
|
63
|
+
return partSplit.join(path.sep);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function fillSCSSExt(scssPath, noext = false) {
|
|
67
|
+
const underscoredPath = underscorePath(scssPath, noext);
|
|
68
|
+
if (!fs.existsSync(scssPath) && fs.existsSync(underscoredPath)) {
|
|
69
|
+
return underscoredPath;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (noext) {
|
|
73
|
+
return scssPath;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if ((!fs.existsSync(scssPath) || (fs.existsSync(scssPath) && fs.statSync(scssPath).isDirectory())) && fs.existsSync(`${scssPath}.scss`)) {
|
|
77
|
+
return `${scssPath}.scss`;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (fs.existsSync(`_${scssPath}.scss`)) {
|
|
81
|
+
return `${scssPath}.scss`;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return scssPath;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function extractScssImports(fileContent, importRootPath) {
|
|
88
|
+
let match;
|
|
89
|
+
const imports: string[][] = [];
|
|
90
|
+
|
|
91
|
+
while ((match = CSS_IMPORT_REGEX.exec(fileContent)) !== null) {
|
|
92
|
+
const importPath = match[1];
|
|
93
|
+
const importLine = match[0];
|
|
94
|
+
|
|
95
|
+
if (fs.statSync(importRootPath).isFile()) {
|
|
96
|
+
importRootPath = path.dirname(importRootPath);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const processedImportPath = processImportPath(importPath, importRootPath);
|
|
100
|
+
|
|
101
|
+
imports.push([processedImportPath, importLine, path.resolve(processedImportPath)]);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return [imports, fileContent];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function extractScssUses(fileContent) {
|
|
108
|
+
let match;
|
|
109
|
+
const uses: string[][] = [];
|
|
110
|
+
|
|
111
|
+
while ((match = SCSS_USE_REGEX.exec(fileContent)) !== null) {
|
|
112
|
+
const usesPath: string = match[1];
|
|
113
|
+
const usesLine: string = match[0];
|
|
114
|
+
|
|
115
|
+
if (!uses.find((item) => {
|
|
116
|
+
return item[0] == usesPath
|
|
117
|
+
}) && !(usesPath !== 'sass:math')) {
|
|
118
|
+
uses.push([usesPath, usesLine]);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return [uses];
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function detectImports(code) {
|
|
126
|
+
return CSS_IMPORT_REGEX.test(code);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function replaceWithNodeModules(input, fileDir = null, absolute = false, token = '~') {
|
|
130
|
+
return input.replace(token, absolute ? `${path.resolve(WORKSPACE, 'node_modules')}${path.sep}` : this.node_modules_dir(fileDir ? fileDir : process.cwd()));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function processImports(imports, fileRootDir, importStorage = {}, sub = false) {
|
|
134
|
+
const _scss_fs = _scss_fs_builder(this);
|
|
135
|
+
const importResults: {
|
|
136
|
+
line: number,
|
|
137
|
+
code: string
|
|
138
|
+
}[] = [];
|
|
139
|
+
|
|
140
|
+
const getStorage = (sourceComponentPath, importedFileContent) => {
|
|
141
|
+
const sourceComponentPathFormatted = sourceComponentPath.replace(path.sep, '_');
|
|
142
|
+
|
|
143
|
+
if (!(sourceComponentPathFormatted in importStorage)) {
|
|
144
|
+
importStorage[sourceComponentPathFormatted] = importedFileContent;
|
|
145
|
+
|
|
146
|
+
return importedFileContent;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return '';
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
imports.forEach(importData => {
|
|
153
|
+
const originalImportPath = importData[0];
|
|
154
|
+
let importPath = processImportPath(originalImportPath, fileRootDir);
|
|
155
|
+
|
|
156
|
+
let replacedScssContent = getStorage(importPath, _scss_fs.getCodeFromFile(importPath).replace(/\/\*[\s\S]*?\*\//g, ''));
|
|
157
|
+
|
|
158
|
+
const recursiveImports = extractScssImports(replacedScssContent, importPath)[0];
|
|
159
|
+
|
|
160
|
+
if (recursiveImports.length) {
|
|
161
|
+
|
|
162
|
+
replacedScssContent = replaceImports(processImports(recursiveImports, path.dirname(importPath), importStorage, true), replacedScssContent);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
importResults.push({
|
|
166
|
+
line: importData[1],
|
|
167
|
+
code: replacedScssContent
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
return importResults;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function replaceImports(processedImports, code) {
|
|
175
|
+
processedImports.forEach(importObj => {
|
|
176
|
+
code = code.replace(importObj.line, importObj.code);
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
return code;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export default (element) => ({
|
|
183
|
+
processImportPath: processImportPath.bind(element),
|
|
184
|
+
fillSCSSExt: fillSCSSExt.bind(element),
|
|
185
|
+
underscorePath: underscorePath.bind(element),
|
|
186
|
+
detectImports: detectImports.bind(element),
|
|
187
|
+
extractScssUses: extractScssUses.bind(element),
|
|
188
|
+
extractScssImports: extractScssImports.bind(element),
|
|
189
|
+
replaceImports: replaceImports.bind(element),
|
|
190
|
+
processImports: processImports.bind(element),
|
|
191
|
+
replaceWithNodeModules: replaceWithNodeModules.bind(element)
|
|
185
192
|
});
|