@rws-framework/client 2.18.8 → 2.18.9

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.
@@ -4,7 +4,7 @@ const chalk = require('chalk');
4
4
  const _scss_cache = require('../../../cfg/build_steps/webpack/_cache');
5
5
  const LoadersHelper = require('../../../cfg/build_steps/webpack/_loaders');
6
6
  const md5 = require('md5');
7
-
7
+ const json5 = require('json5');
8
8
 
9
9
  module.exports = async function(content) {
10
10
 
@@ -28,6 +28,8 @@ module.exports = async function(content) {
28
28
  return cachedTS;
29
29
  }
30
30
 
31
+
32
+
31
33
  if(!decoratorData){
32
34
  return content;
33
35
  }
@@ -35,20 +37,22 @@ module.exports = async function(content) {
35
37
  let templateName = null;
36
38
  let stylesPath = null;
37
39
 
38
- if(decoratorData.decoratorArgs){
39
- if(decoratorData.decoratorArgs.template){
40
+ if(decoratorData.decoratorArgs){
41
+ const decoratorArgs = json5.parse(decoratorData.decoratorArgs)
42
+
43
+ if(decoratorArgs.template){
40
44
  templateName = decoratorData.decoratorArgs.template || null;
41
45
  }
42
46
 
43
- if(decoratorData.decoratorArgs.styles){
47
+ if(decoratorArgs.styles){
44
48
  stylesPath = decoratorData.decoratorArgs.styles || null;
45
49
  }
46
50
 
47
- if(decoratorData.decoratorArgs.ignorePackaging){
51
+ if(decoratorArgs.ignorePackaging){
48
52
  isIgnored = true;
49
53
  }
50
54
 
51
- if(decoratorData.decoratorArgs.debugPackaging){
55
+ if(decoratorArgs.debugPackaging){
52
56
  isDebugged = true;
53
57
  }
54
58
  }
@@ -60,7 +64,7 @@ module.exports = async function(content) {
60
64
 
61
65
  try {
62
66
  if(tagName){
63
- const [template, htmlFastImports, templateExists] = await LoadersHelper.getTemplate(filePath, this.addDependency, templateName, isDev);
67
+ const [template, htmlFastImports, templateExists] = await LoadersHelper.getTemplate(filePath, this.addDependency, className, templateName, isDev);
64
68
 
65
69
  const styles = await LoadersHelper.getStyles(filePath, this.query?.rwsWorkspaceDir, this.query?.appRootDir,this.addDependency, templateExists, stylesPath, isDev);
66
70
 
@@ -241,7 +241,7 @@ async function getStyles(filePath, rwsWorkspaceDir, appRootDir, addDependency, t
241
241
  return styles;
242
242
  }
243
243
 
244
- async function getTemplate(filePath, addDependency, templateName = null, isDev = false) {
244
+ async function getTemplate(filePath, addDependency, className, templateName = null, isDev = false) {
245
245
  if(!templateName){
246
246
  templateName = 'template';
247
247
  }
@@ -256,7 +256,7 @@ async function getTemplate(filePath, addDependency, templateName = null, isDev =
256
256
  htmlFastImports = `import * as T from '@microsoft/fast-element';\nimport { html, css, ref, when, repeat, slotted, children } from '@microsoft/fast-element'; \nimport './${templateName}.html';\n`;
257
257
  template = `
258
258
  //@ts-ignore
259
- let rwsTemplate: any = T.html\`${templateContent}\`;
259
+ let rwsTemplate: any = T.html<${className}>\`${templateContent}\`;
260
260
  `; addDependency(templatePath);
261
261
  }
262
262
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rws-framework/client",
3
3
  "private": false,
4
- "version": "2.18.8",
4
+ "version": "2.18.9",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
7
7
  "docs": "typedoc --tsconfig ./tsconfig.json"