@rws-framework/client 2.10.3 → 2.10.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rws-framework/client",
3
3
  "private": false,
4
- "version": "2.10.3",
4
+ "version": "2.10.5",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
7
7
  "docs": "typedoc --tsconfig ./tsconfig.json"
@@ -22,6 +22,8 @@ module.exports = async function(content) {
22
22
 
23
23
  const htmlMinify = this._compiler.options.htmlMinify || true;
24
24
 
25
+
26
+
25
27
  const RWSViewRegex = /(@RWSView\([^)]*)\)/;
26
28
  const tsSourceFile = ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
27
29
 
@@ -36,10 +38,13 @@ module.exports = async function(content) {
36
38
 
37
39
  const decoratorData = tools.extractRWSViewArguments(tsSourceFile);
38
40
 
41
+
39
42
  if(!decoratorData){
40
43
  return content;
41
44
  }
42
45
 
46
+
47
+
43
48
  if(decoratorData.options){
44
49
  if(decoratorData.options.template){
45
50
  templatePath = decoratorData.options.template;
@@ -74,7 +79,7 @@ module.exports = async function(content) {
74
79
  if(tagName){
75
80
  const templateName = 'template';
76
81
  const templatePath = path.dirname(filePath) + `/${templateName}.html`;
77
-
82
+
78
83
  const templateExists = fs.existsSync(templatePath);
79
84
 
80
85
  let template = 'const rwsTemplate: null = null;';
@@ -104,11 +109,12 @@ let rwsTemplate: any = T.html\`${templateContent}\`;
104
109
  this.addDependency(templatePath);
105
110
  }
106
111
 
107
- const viewReg = /@RWSView\(['"]([a-zA-Z0-9_-]+)['"],?.*\)\sclass\s([a-zA-Z0-9_-]+) extends RWSViewComponent/gs
112
+ const viewReg = /@RWSView\(["']([^"']+)["'].*\)\s*export\s+class\s+([a-zA-Z0-9_-]+)\s+extends\s+RWSViewComponent/gm
108
113
 
109
114
  let m;
110
115
  let className = null;
111
116
 
117
+
112
118
  while ((m = viewReg.exec(processedContent)) !== null) {
113
119
  // This is necessary to avoid infinite loops with zero-width matches
114
120
  if (m.index === viewReg.lastIndex) {
@@ -121,7 +127,7 @@ let rwsTemplate: any = T.html\`${templateContent}\`;
121
127
  className = match;
122
128
  }
123
129
  });
124
- }
130
+ }
125
131
 
126
132
  if(className){
127
133
  const replacedViewDecoratorContent = processedContent.replace(
@@ -129,7 +135,10 @@ let rwsTemplate: any = T.html\`${templateContent}\`;
129
135
  `@RWSView('$1', null, { template: rwsTemplate, styles${addedParams.length? ', options: {' + (addedParams.join(', ')) + '}': ''} })\nclass $2 extends RWSViewComponent `
130
136
  );
131
137
  processedContent = `${template}\n${styles}\n${addedParamDefs.join('\n')}\n` + replacedViewDecoratorContent;
132
- }
138
+ }
139
+
140
+
141
+
133
142
 
134
143
  processedContent = `${htmlFastImports ? htmlFastImports + '\n' : ''}${processedContent}`;
135
144
  }