@rws-framework/client 2.8.4 → 2.8.5

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.
@@ -17,6 +17,7 @@ const _DEFAULT_CONFIG_VARS = {
17
17
  //Universal configs
18
18
  transports: ['websocket'],
19
19
  parted: false,
20
+ plugins: []
20
21
  }
21
22
 
22
23
  const _DEFAULT_CONFIG = Object.freeze(_DEFAULT_CONFIG_VARS);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rws-framework/client",
3
3
  "private": false,
4
- "version": "2.8.4",
4
+ "version": "2.8.5",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
7
7
  "docs": "typedoc --tsconfig ./tsconfig.json"
@@ -49,6 +49,7 @@
49
49
  "url-router": "^13.0.0",
50
50
  "uuid": "^9.0.1",
51
51
  "v4": "^0.0.1"
52
+
52
53
  },
53
54
  "devDependencies": {
54
55
  "@types/dragula": "^3.7.4",
@@ -134,17 +134,17 @@ const RWSWebpackWrapper = async (config) => {
134
134
 
135
135
  const optimConfig = {};
136
136
 
137
- if(!isDev){
138
- optimConfig.minimize = true;
139
- optimConfig.minimizer = [
137
+ // if(!isDev){
138
+ optimConfig.minimize = !isDev;
139
+ optimConfig.minimizer = !isDev ? [
140
140
  new TerserPlugin({
141
141
  terserOptions: {
142
142
  keep_classnames: true, // Prevent mangling of class names
143
143
  mangle: false, //@error breaks FAST view stuff if enabled for all assets
144
- compress: {
144
+ compress: !isDev ? {
145
145
  dead_code: true,
146
146
  pure_funcs: ['console.log', 'console.info', 'console.warn']
147
- },
147
+ } : null,
148
148
  output: {
149
149
  comments: false
150
150
  },
@@ -152,9 +152,21 @@ const RWSWebpackWrapper = async (config) => {
152
152
  extractComments: false,
153
153
  parallel: true,
154
154
  }),
155
- new CssMinimizerPlugin(),
156
- ];
157
- }
155
+ new CssMinimizerPlugin()
156
+ ] : [
157
+ new TerserPlugin({
158
+ terserOptions: {
159
+ keep_classnames: true, // Prevent mangling of class names
160
+ mangle: false, //@error breaks FAST view stuff if enabled for all assets
161
+ output: {
162
+ comments: false
163
+ },
164
+ },
165
+ extractComments: false,
166
+ parallel: false,
167
+ })
168
+ ]
169
+ // }
158
170
 
159
171
 
160
172
  if (isParted) {
@@ -258,7 +270,7 @@ const RWSWebpackWrapper = async (config) => {
258
270
  },
259
271
  {
260
272
  test: /\.scss$/,
261
- use: [
273
+ use: [
262
274
  path.resolve(__dirname, './webpack/loaders/rws_fast_scss_loader.js'),
263
275
  ],
264
276
  },
@@ -277,7 +289,7 @@ const RWSWebpackWrapper = async (config) => {
277
289
  }
278
290
  ],
279
291
  exclude: [
280
- /node_modules\/(?!\@rws-framework\/client)/,
292
+ /node_modules\/(?!\@rws-framework\/[A-Z0-9a-z])/,
281
293
  /\.debug\.ts$/,
282
294
  ],
283
295
  }
@@ -288,12 +300,12 @@ const RWSWebpackWrapper = async (config) => {
288
300
  }
289
301
 
290
302
  // if(isDev){
291
- cfgExport.module.rules.push({
292
- test: /\.js$/,
293
- use: [
294
- path.resolve(__dirname, './webpack/loaders/rws_uncomments_loader.js'),
295
- ],
296
- })
303
+ // cfgExport.module.rules.push({
304
+ // test: /\.js$/,
305
+ // use: [
306
+ // path.resolve(__dirname, './webpack/loaders/rws_uncomments_loader.js'),
307
+ // ],
308
+ // })
297
309
  // }
298
310
 
299
311
  if (isHotReload) {
package/src/client.ts CHANGED
@@ -65,6 +65,7 @@ class RWSClient {
65
65
 
66
66
  this.loadServices();
67
67
 
68
+ this.config.plugins = [];
68
69
  this.pushDataToServiceWorker('SET_WS_URL', { url: this.appConfig.get('wsUrl') }, 'ws_url');
69
70
 
70
71
  if (this.user) {
@@ -1,5 +1,5 @@
1
1
  //loader
2
-
2
+ //save
3
3
  $loader-color: var(--primary-color, #eb7b13);
4
4
  $loader-size: 56px;
5
5
  $loader-height: 20px;
@@ -7,8 +7,8 @@ $loader-border-size: 8px;
7
7
  $loader-gap: 12px;
8
8
  $loader-animation-duration: 1s;
9
9
 
10
- @import "~/scss-loading-animations/src/loaders";
10
+ // @import "~/scss-loading-animations/src/loaders";
11
11
 
12
- .loader {
13
- @include loader01;
14
- }
12
+ // .loader {
13
+ // @include loader01;
14
+ // }
@@ -117,9 +117,7 @@ class ConfigService extends TheService {
117
117
  mergeConfig(config: IRWSConfig) {
118
118
  const unloaded = ConfigService.isLoaded;
119
119
 
120
- if(!Object.keys(this.data).includes('plugins')){
121
- this.data.plugins = [];
122
- }
120
+ this.data.plugins = [];
123
121
 
124
122
  this.data = Object.assign(this.data, config);
125
123
 
@@ -1,5 +1,5 @@
1
1
  declare module '*.scss' {
2
- const content: import('@microsoft/fast-element').ElementStyles;
2
+ const content: string;
3
3
  export default content;
4
4
  }
5
5
 
@@ -21,34 +21,26 @@ module.exports = function(content) {
21
21
  try {
22
22
  const code = plugin.compileScssCode(content, path.dirname(filePath), null, filePath, !isDev);
23
23
 
24
- if (fromTs) {
25
- if (saveFile && code) {
26
- plugin.writeCssFile(filePath, code);
27
-
28
- const newContext = this;
29
-
30
- // Properly setup the context for css-loader
31
- const loaderContext = {
32
- ...newContext,
33
- query: { sourceMap: isDev },
34
- async: () => (err, output) => {
35
- if (err) {
36
- callback(err);
37
- return;
38
- }
39
- callback(null, output);
40
- }
41
- };
42
-
43
- // Execute css-loader
44
- cssLoader.call(loaderContext, code);
45
- } else {
46
- const tsCode = `import { css } from '@microsoft/fast-element';\nexport default css\`${code}\`;`;
47
- callback(null, tsCode);
48
- }
49
- } else {
50
- callback(null, code);
24
+ if (fromTs && saveFile && code) {
25
+ plugin.writeCssFile(filePath, code);
51
26
  }
27
+
28
+ // Properly setup the context for css-loader
29
+ const loaderContext = {
30
+ ...this,
31
+ query: { sourceMap: isDev },
32
+ async: () => (err, output) => {
33
+ if (err) {
34
+ callback(err);
35
+ return;
36
+ }
37
+ callback(null, output);
38
+ }
39
+ };
40
+
41
+ // Execute css-loader with the generated CSS code
42
+ cssLoader.call(loaderContext, code);
43
+
52
44
  } catch (e) {
53
45
  console.error(e);
54
46
  callback(e);
@@ -74,7 +74,8 @@ module.exports = async function(content) {
74
74
  let styles = 'const styles: null = null;'
75
75
 
76
76
  if(fs.existsSync(path.dirname(filePath) + '/styles')){
77
- styles = `import styles from './${stylesPath}';`;
77
+ styles = `import componentCSS from './${stylesPath}';\n`;
78
+ styles += `const styles = T.css\`\${componentCSS}\`;`;
78
79
  }
79
80
 
80
81
  const templateName = 'template';
@@ -62,9 +62,16 @@ class RWSScssPlugin {
62
62
  const usesPath = match[1];
63
63
  const usesLine = match[0];
64
64
 
65
- uses.push([usesPath, usesLine]);
65
+ if(!uses.find((item) => {
66
+ console.log(item);
67
+ return item[0] == usesPath
68
+ }) && !usesPath !== 'sass:math'){
69
+ uses.push([usesPath, usesLine]);
70
+ }
66
71
  }
67
72
 
73
+ // console.log(uses);
74
+
68
75
  return [uses];
69
76
  }
70
77
 
@@ -353,8 +360,13 @@ class RWSScssPlugin {
353
360
 
354
361
  uses.forEach(scssUse => {
355
362
  const useLine = scssUse[1];
356
- scssUses += useLine + '\n';
357
- scssCode = scssCode.replace(useLine, '');
363
+ if(scssCode.indexOf(useLine) === -1){
364
+ console.log(scssCode);
365
+ scssUses += useLine + '\n';
366
+ scssCode = scssCode.replace(useLine + '\n', '');
367
+ }else{
368
+ console.log('ommiting @use. detected in:', fileRootDir, scssUse)
369
+ }
358
370
  });
359
371
 
360
372
  scssCode = scssUses + scssCode;
@@ -362,7 +374,7 @@ class RWSScssPlugin {
362
374
  try {
363
375
 
364
376
  const result = sass.compileString(scssCode, { loadPaths: [fileRootDir], style: minify ? 'compressed' : 'expanded' });
365
- let finalCss = result.css;
377
+ let finalCss = result.css.toString();
366
378
 
367
379
  return this.replaceFontUrlWithBase64(finalCss);
368
380
  } catch (err) {