@rws-framework/client 2.23.1 → 2.23.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.
@@ -47,8 +47,17 @@ const RWSWebpackWrapper = async (appRoot, rwsFrontendConfig, _packageDir) => {
47
47
  BuildConfigurator,
48
48
  hotReload,
49
49
  hotReloadPort,
50
- loaderIgnoreExceptions
50
+ loaderIgnoreExceptions,
51
+ extraNodeModules
51
52
  } = await getBuildConfig(rwsFrontendConfig, _packageDir);
53
+
54
+ console.verboseLog = console.log;
55
+
56
+ console.log = (...x) => {
57
+ if(process.argv.find(a => a.includes('--verbose'))){
58
+ console.verboseLog(...x);
59
+ }
60
+ }
52
61
 
53
62
  timeLog({ devDebug });
54
63
 
@@ -66,7 +75,8 @@ const RWSWebpackWrapper = async (appRoot, rwsFrontendConfig, _packageDir) => {
66
75
  const WEBPACK_AFTER_ACTIONS = rwsFrontendConfig.actions || [];
67
76
  const WEBPACK_AFTER_ERROR_ACTIONS = rwsFrontendConfig.error_actions || [];
68
77
 
69
- const modules_setup = [path.join(_packageDir, 'node_modules'), path.join(executionDir, 'node_modules'), path.join(tools.findRootWorkspacePath(appRoot), 'node_modules')];
78
+ const modules_setup = [path.join(_packageDir, 'node_modules'), path.join(executionDir, 'node_modules'), path.join(tools.findRootWorkspacePath(appRoot), 'node_modules'), ...(extraNodeModules || [])];
79
+
70
80
  let optimConfig = null;
71
81
  let aliases = rwsFrontendConfig.aliases || {};
72
82
  aliases = { ...aliases, ...(await loadAliases(_packageDir, tsConfig,path.resolve(_MAIN_PACKAGE, 'node_modules'), executionDir))}
@@ -82,12 +92,12 @@ const RWSWebpackWrapper = async (appRoot, rwsFrontendConfig, _packageDir) => {
82
92
 
83
93
  // #SECTION RWS COMPONENT SCAN && PARTED PROCESSING
84
94
  const RWSComponents = scanComponents(await partedComponentsEvents(partedComponentsLocations, rwsPlugins, isParted), executionDir, _packageDir);
85
- console.log(`${chalk.cyanBright('RWS Scanned')} ${chalk.yellowBright(RWSComponents.length)} components`);
95
+ console.verboseLog(`${chalk.cyanBright('RWS Scanned')} ${chalk.yellowBright(RWSComponents.length)} components`);
86
96
  const { automatedChunks, automatedEntries } = setComponentsChunks(rwsFrontendConfig.entrypoint, RWSComponents, isParted);
87
97
 
88
98
  // #SECTION RWS INFO FILE
89
99
  generateRWSInfoFile(outputDir, automatedEntries);
90
- console.log(chalk.greenBright(`RWSInfo file generated.`));
100
+ console.verboseLog(chalk.greenBright(`RWSInfo file generated.`));
91
101
 
92
102
 
93
103
  if (!isDev) {
@@ -142,17 +152,28 @@ const RWSWebpackWrapper = async (appRoot, rwsFrontendConfig, _packageDir) => {
142
152
  loaderIgnoreExceptions
143
153
  });
144
154
 
155
+ let optimization = {
156
+ // splitChunks: {
157
+ // chunks: 'all'
158
+ // }
159
+ }
145
160
 
146
161
  if (optimConfig) {
147
- // setup production config if it got created above
148
- cfgExport.optimization = optimConfig;
162
+ optimization = {...optimization, ...optimConfig}
149
163
  }
150
164
 
165
+ cfgExport.optimization = optimization;
166
+
167
+
151
168
  // #SECTION RWS PLUGINS onBuild EVENTS FIRE
152
169
  for (const pluginKey of Object.keys(rwsPlugins)) {
153
170
  const plugin = rwsPlugins[pluginKey];
154
171
  await plugin.onBuild(cfgExport);
155
- }
172
+ }
173
+
174
+ console.log('Aliases:', cfgExport.resolve.alias)
175
+
176
+ console.log('Optim:', optimization)
156
177
 
157
178
  return cfgExport;
158
179
  }
@@ -40,6 +40,7 @@ async function getBuildConfig(rwsFrontBuildConfig, _packageDir){
40
40
  devDebug = {..._DEFAULT_DEV_DEBUG, ...devDebug}
41
41
 
42
42
  const devRouteProxy = BuildConfigurator.get('devRouteProxy') || rwsFrontBuildConfig.devRouteProxy;
43
+ const extraNodeModules = BuildConfigurator.get('extraNodeModules') || rwsFrontBuildConfig.extraNodeModules;
43
44
 
44
45
  const tsConfig = await (BuildConfigurator.get('tsConfig') || rwsFrontBuildConfig.tsConfig)(_packageDir, true);
45
46
 
@@ -78,7 +79,8 @@ async function getBuildConfig(rwsFrontBuildConfig, _packageDir){
78
79
  BuildConfigurator,
79
80
  hotReload,
80
81
  hotReloadPort,
81
- loaderIgnoreExceptions
82
+ loaderIgnoreExceptions,
83
+ extraNodeModules
82
84
  }
83
85
  }
84
86
 
@@ -5,7 +5,7 @@ const util = require('util');
5
5
 
6
6
  module.exports = {
7
7
  start: (executionDir, tsConfig, outputDir, isDev, publicDir, isParted, partedPrefix, partedDirUrlPrefix, devTools, rwsPlugins) => {
8
- console.log(chalk.green('RWS Frontend build started with:'), {
8
+ console.verboseLog(chalk.green('RWS Frontend build started with:'), {
9
9
  executionDir,
10
10
  outputDir,
11
11
  dev: isDev,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rws-framework/client",
3
3
  "private": false,
4
- "version": "2.23.1",
4
+ "version": "2.23.3",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
7
7
  "docs": "typedoc --tsconfig ./tsconfig.json"
@@ -93,7 +93,7 @@ abstract class RWSViewComponent extends FoundationElement implements IRWSViewCom
93
93
 
94
94
  this.applyFileList();
95
95
 
96
- if (RWSViewComponent.FORCE_INJECT_STYLES) {
96
+ if (RWSViewComponent.FORCE_INJECT_STYLES && RWSViewComponent.FORCE_INJECT_STYLES.length > 0) {
97
97
  this.injectStyles(RWSViewComponent.FORCE_INJECT_STYLES, RWSViewComponent.FORCE_INJECT_MODE);
98
98
  }
99
99
 
@@ -50,7 +50,12 @@ export class CSSInjectionManager {
50
50
  throw new Error('Component must have a shadow root for CSS injection');
51
51
  }
52
52
 
53
- // Add initial transition styles to host element
53
+ // Only proceed if there are actually styles to inject
54
+ if (!styleLinks || styleLinks.length === 0) {
55
+ return;
56
+ }
57
+
58
+ // Add initial transition styles to host element only when injecting styles
54
59
  const transitionSheet = new CSSStyleSheet();
55
60
  await transitionSheet.replace(`
56
61
  :host {