@rws-framework/client 2.10.8 → 2.10.10

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.
@@ -1,46 +1,224 @@
1
1
  const path = require('path');
2
+ const fs = require('fs');
3
+ const os = require('os');
2
4
 
3
- function getRWSLoaders(packageDir, nodeModulesPath, tsConfigPath){
5
+ const RWSCssPlugin = require("../../../webpack/rws_scss_plugin");
6
+ const plugin = new RWSCssPlugin();
7
+ const JSON5 = require('json5');
8
+ const chalk = require('chalk');
9
+ const { timingCounterStart, timingCounterStop } = require('./_timing');
10
+ const { rwsRuntimeHelper } = require('@rws-framework/console');
11
+
12
+ function getRWSLoaders(packageDir, nodeModulesPath, tsConfigPath, devDebug) {
4
13
  const scssLoader = packageDir + '/webpack/loaders/rws_fast_scss_loader.js';
5
14
  const tsLoader = packageDir + '/webpack/loaders/rws_fast_ts_loader.js';
6
15
  const htmlLoader = packageDir + '/webpack/loaders/rws_fast_html_loader.js';
7
16
 
8
- return [
9
- {
10
- test: /\.html$/,
11
- use: [
12
- {
13
- loader: htmlLoader,
14
- },
15
- ],
16
- },
17
- {
18
- test: /\.(ts)$/,
19
- use: [
20
- {
21
- loader: 'ts-loader',
22
- options: {
23
- allowTsInNodeModules: true,
24
- configFile: path.resolve(tsConfigPath)
25
- }
26
- },
27
- {
28
- loader: tsLoader,
29
- }
30
- ],
31
- exclude: [
32
- /node_modules\/(?!\@rws-framework\/[A-Z0-9a-z])/,
33
- /\.debug\.ts$/,
34
- /\.d\.ts$/,
35
- ],
36
- },
37
- {
38
- test: /\.scss$/i,
39
- use: [
40
- scssLoader,
41
- ],
42
- },
17
+
18
+ return [
19
+ {
20
+ test: /\.html$/,
21
+ use: [
22
+ {
23
+ loader: htmlLoader,
24
+ },
25
+ ],
26
+ },
27
+ {
28
+ test: /\.(ts)$/,
29
+ use: [
30
+ {
31
+ loader: 'ts-loader',
32
+ options: {
33
+ transpileOnly: true,
34
+ allowTsInNodeModules: true,
35
+ configFile: path.resolve(tsConfigPath)
36
+ }
37
+ },
38
+ {
39
+ loader: tsLoader,
40
+ }
41
+ ],
42
+ exclude: [
43
+ /node_modules\/(?!\@rws-framework\/[A-Z0-9a-z])/,
44
+ /\.debug\.ts$/,
45
+ /\.d\.ts$/,
46
+ ],
47
+ },
48
+ {
49
+ test: /\.scss$/i,
50
+ use: [
51
+ scssLoader,
52
+ ],
53
+ },
43
54
  ]
44
55
  }
45
56
 
46
- module.exports = { getRWSLoaders }
57
+ function _extractRWSViewDefs(fastOptions = {}, decoratorArgs = {})
58
+ {
59
+ const addedParamDefs = [];
60
+ const addedParams = [];
61
+
62
+ for (const key in fastOptions){
63
+ addedParamDefs.push(`const ${key} = ${JSON.stringify(fastOptions[key])};`);
64
+ addedParams.push(key);
65
+ }
66
+
67
+ return [addedParamDefs, addedParams];
68
+ }
69
+
70
+ function extractRWSViewArgs(content, noReplace = false) {
71
+ const viewReg = /@RWSView\(\s*["']([^"']+)["'](?:\s*,\s*([\s\S]*?))?\s*\)\s*(.*?\s+)?class\s+([a-zA-Z0-9_-]+)\s+extends\s+RWSViewComponent/gm;
72
+
73
+ let m;
74
+ let tagName = null;
75
+ let className = null;
76
+ let classNamePrefix = null;
77
+ let decoratorArgs = null;
78
+
79
+ const _defaultRWSLoaderOptions = {
80
+ templatePath: 'template.html',
81
+ stylesPath: 'styles.scss',
82
+ fastOptions: { shadowOptions: { mode: 'open' } }
83
+ }
84
+
85
+
86
+ while ((m = viewReg.exec(content)) !== null) {
87
+ // This is necessary to avoid infinite loops with zero-width matches
88
+ if (m.index === viewReg.lastIndex) {
89
+ viewReg.lastIndex++;
90
+ }
91
+
92
+ // The result can be accessed through the `m`-variable.
93
+ m.forEach((match, groupIndex) => {
94
+ if (groupIndex === 1) {
95
+ tagName = match;
96
+ }
97
+
98
+ if (groupIndex === 2) {
99
+ if (match) {
100
+ try {
101
+ decoratorArgs = JSON5.parse(match);
102
+ } catch(e){
103
+ console.log(chalk.red('Decorator options parse error: ') + e.message + '\n Problematic line:');
104
+ console.log(`
105
+ @RWSView(${tagName}, ${match})
106
+ `);
107
+ console.log(chalk.yellowBright(`Decorator options failed to parse for "${tagName}" component.`) + ' { decoratorArgs } defaulting to null.');
108
+ console.log(match);
109
+
110
+ throw new Error('Failed parsing @RWSView')
111
+ }
112
+ }
113
+ }
114
+
115
+ if (groupIndex === 3) {
116
+ if(match){
117
+ classNamePrefix = match;
118
+ }
119
+ }
120
+
121
+ if (groupIndex === 4) {
122
+ className = match;
123
+ }
124
+ });
125
+ }
126
+
127
+ if(!tagName){
128
+ return null;
129
+ }
130
+
131
+ let processedContent = content;
132
+
133
+ let fastOptions = _defaultRWSLoaderOptions.fastOptions;
134
+
135
+ if (decoratorArgs && decoratorArgs.fastElementOptions) {
136
+ fastOptions = decoratorArgs.fastElementOptions;
137
+ }
138
+
139
+ let replacedDecorator = null;
140
+
141
+ if(!noReplace){
142
+ const [addedParamDefs, addedParams] = _extractRWSViewDefs(fastOptions, decoratorArgs);
143
+ const replacedViewDecoratorContent = processedContent.replace(
144
+ viewReg,
145
+ `@RWSView('$1', null, { template: rwsTemplate, styles${addedParams.length ? ', options: {' + (addedParams.join(', ')) + '}' : ''} })\n$3class $4 extends RWSViewComponent `
146
+ );
147
+
148
+ // console.log({replacedViewDecoratorContent});
149
+
150
+ replacedDecorator = `${addedParamDefs.join('\n')}\n${replacedViewDecoratorContent}`;
151
+ }
152
+
153
+ return {
154
+ viewDecoratorData: {
155
+ tagName,
156
+ className,
157
+ classNamePrefix,
158
+ decoratorArgs
159
+ },
160
+ replacedDecorator
161
+ }
162
+ }
163
+
164
+ async function getStyles(filePath, addDependency, templateExists, stylesPath = null, isDev = false) {
165
+ if(!stylesPath){
166
+ stylesPath = 'styles/layout.scss';
167
+ }
168
+
169
+ let styles = 'const styles: null = null;'
170
+ const stylesFilePath = path.dirname(filePath) + '/' + stylesPath;
171
+
172
+ if (fs.existsSync(stylesFilePath)) {
173
+ const scsscontent = fs.readFileSync(stylesFilePath, 'utf-8');
174
+ timingCounterStart();
175
+ const codeData = await plugin.compileScssCode(scsscontent, path.dirname(filePath) + '/styles', null, filePath, !isDev);
176
+ const elapsed = timingCounterStop();
177
+ let currentTimingList = rwsRuntimeHelper.getRWSVar('_timer_css');
178
+
179
+ if(currentTimingList){
180
+ currentTimingList += `\n${filePath}|${elapsed}`;
181
+ }else{
182
+ currentTimingList = `${filePath}|${elapsed}`;
183
+ }
184
+
185
+ rwsRuntimeHelper.setRWSVar('_timer_css', currentTimingList);
186
+
187
+ const cssCode = codeData.code;
188
+
189
+ styles = isDev ? `import './${stylesPath}';\n` : '';
190
+
191
+ if (!templateExists) {
192
+ styles += `import { css } from '@microsoft/fast-element';\n`;
193
+ }
194
+ styles += `const styles = ${templateExists ? 'T.' : ''}css\`${cssCode}\`;\n`;
195
+
196
+ addDependency(path.dirname(filePath) + '/' + stylesPath);
197
+ }
198
+
199
+ return styles;
200
+ }
201
+
202
+ async function getTemplate(filePath, addDependency, templateName = null, isDev = false) {
203
+ if(!templateName){
204
+ templateName = 'template';
205
+ }
206
+ const templatePath = path.dirname(filePath) + `/${templateName}.html`;
207
+ let htmlFastImports = null;
208
+ const templateExists = fs.existsSync(templatePath);
209
+
210
+ let template = 'const rwsTemplate: null = null;';
211
+
212
+ if (templateExists) {
213
+ const templateContent = fs.readFileSync(templatePath, 'utf-8').replace(/<!--[\s\S]*?-->/g, '');
214
+ htmlFastImports = `import * as T from '@microsoft/fast-element';\nimport './${templateName}.html';\n`;
215
+ template = `
216
+ //@ts-ignore
217
+ let rwsTemplate: any = T.html\`${templateContent}\`;
218
+ `; addDependency(templatePath);
219
+ }
220
+
221
+ return [template, htmlFastImports, templateExists];
222
+ }
223
+
224
+ module.exports = { getRWSLoaders, extractRWSViewArgs, getTemplate, getStyles }
@@ -0,0 +1,104 @@
1
+ const webpack = require('webpack')
2
+ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
3
+ const HtmlWebpackPlugin = require('html-webpack-plugin');
4
+ const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
5
+ const { processEnvDefines } = require('./_env_defines');
6
+ const path = require('path');
7
+
8
+ const RWS_WEBPACK_PLUGINS_BAG = {
9
+ _plugins: [],
10
+ add(plugin) {
11
+ if (Array.isArray(plugin)) {
12
+ if (!plugin.length) {
13
+ return;
14
+ }
15
+
16
+ plugin.forEach((item) => {
17
+ RWS_WEBPACK_PLUGINS_BAG.add(item);
18
+ })
19
+ } else {
20
+ if (!plugin) {
21
+ return;
22
+ }
23
+
24
+ if (!this._plugins.includes(plugin)) {
25
+ this._plugins.push(plugin);
26
+ }
27
+ }
28
+ },
29
+ getPlugins() {
30
+ return this._plugins
31
+ }
32
+ }
33
+
34
+ function getPackageModPlugins() {
35
+ return [
36
+ new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /en-gb/),
37
+ new webpack.IgnorePlugin({
38
+ resourceRegExp: /.*\.es6\.js$/,
39
+ contextRegExp: /node_modules/
40
+ }),
41
+ ]
42
+ }
43
+
44
+ function getDefinesPlugins(BuildConfigurator, rwsFrontendConfig, devDebug) {
45
+ const _rws_defines = processEnvDefines(BuildConfigurator, rwsFrontendConfig, devDebug);
46
+
47
+ return [
48
+ new webpack.DefinePlugin(_rws_defines)
49
+ ]
50
+ }
51
+
52
+ function getBuilderDevPlugins(BuildConfigurator, rwsFrontendConfig, tsConfigPath, devDebug) {
53
+ if(!devDebug?.profiling){
54
+ return [];
55
+ }
56
+
57
+ const profiling = new webpack.debug.ProfilingPlugin({
58
+ outputPath: path.join(BuildConfigurator.get('outputDir') || rwsFrontendConfig.outputDir, '.profiling/profileEvents.json'),
59
+ });
60
+
61
+
62
+ return [
63
+ profiling
64
+ ]
65
+ }
66
+
67
+ function getBuilderOptimPlugins(BuildConfigurator, rwsFrontendConfig, tsConfigPath) {
68
+ return [
69
+
70
+ ]
71
+ }
72
+
73
+ function addStartPlugins(rwsFrontendConfig, BuildConfigurator, devDebug, isHotReload, isReport, tsConfigPath) {
74
+
75
+ RWS_WEBPACK_PLUGINS_BAG.add([
76
+ ...getDefinesPlugins(BuildConfigurator, rwsFrontendConfig, devDebug),
77
+ ...getBuilderDevPlugins(BuildConfigurator, rwsFrontendConfig, tsConfigPath, devDebug),
78
+ ...getBuilderOptimPlugins(BuildConfigurator, rwsFrontendConfig, tsConfigPath),
79
+ ...getPackageModPlugins()
80
+ ]);
81
+
82
+ if (isHotReload) {
83
+ if (!publicDir) {
84
+ throw new Error('No public dir set')
85
+ }
86
+
87
+ RWS_WEBPACK_PLUGINS_BAG.add(new HtmlWebpackPlugin({
88
+ template: publicDir + '/' + publicIndex,
89
+ }));
90
+ }
91
+
92
+ const overridePlugins = rwsFrontendConfig.plugins || []
93
+
94
+ RWS_WEBPACK_PLUGINS_BAG.add(overridePlugins);
95
+
96
+ if (isReport) {
97
+ RWS_WEBPACK_PLUGINS_BAG.add(new BundleAnalyzerPlugin({
98
+ analyzerMode: 'static',
99
+ openAnalyzer: false,
100
+ }));
101
+ }
102
+ }
103
+
104
+ module.exports = { RWS_WEBPACK_PLUGINS_BAG, addStartPlugins };
@@ -0,0 +1,53 @@
1
+ const TimingUtils = {
2
+ LOGGING: true,
3
+ TIMER_ON: true,
4
+
5
+ timeLog(...obj) {
6
+ if (!this.LOGGING || !this.TIMER_ON) {
7
+ return;
8
+ }
9
+ obj = [chalk.blueBright('[TIMING]'), ...obj];
10
+ console.log(...obj);
11
+ },
12
+
13
+ timingCounterStart() {
14
+ if (!this.TIMER_ON) {
15
+ return;
16
+ }
17
+ rwsRuntimeHelper.startExecTimeRecord();
18
+ },
19
+
20
+ timingCounterStop() {
21
+ if (!this.TIMER_ON) {
22
+ return 0;
23
+ }
24
+ return rwsRuntimeHelper.startExecTimeRecord() || 0;
25
+ },
26
+
27
+ timingStart(section) {
28
+ if (!this.TIMER_ON) {
29
+ return;
30
+ }
31
+ this.timingCounterStart();
32
+ this.timeLog(`Started timing "${chalk.yellow(section)}"`);
33
+ },
34
+
35
+ timingStop(section) {
36
+ if (!this.TIMER_ON) {
37
+ return 0;
38
+ }
39
+ const endTime = this.timingCounterStop();
40
+ this.timeLog(`Stopped timing "${chalk.yellow(section)}" @${endTime}ms`);
41
+ return endTime;
42
+ },
43
+
44
+ toggleLogging(val) {
45
+ this.LOGGING = val;
46
+ },
47
+
48
+ toggleTimer(val) {
49
+ this.TIMER_ON = val;
50
+ }
51
+ };
52
+
53
+ module.exports = TimingUtils;
@@ -0,0 +1,59 @@
1
+ const { getRWSLoaders } = require('./_loaders');
2
+ const path = require('path');
3
+
4
+ function createWebpackConfig(
5
+ executionDir,
6
+ clientPkgPath,
7
+ _packageDir,
8
+ isDev,
9
+ devTools,
10
+ devDebug,
11
+ isParted,
12
+ partedPrefix,
13
+ outputDir,
14
+ outputFileName,
15
+ automatedChunks,
16
+ modules_setup,
17
+ aliases,
18
+ tsConfigPath,
19
+ WEBPACK_PLUGINS,
20
+ rwsExternals,
21
+ devExternalsVars
22
+ ) {
23
+ return {
24
+ context: executionDir,
25
+ entry: {
26
+ ...automatedChunks
27
+ },
28
+ mode: isDev ? 'development' : 'production',
29
+ target: 'web',
30
+ devtool: devTools,
31
+ output: {
32
+ path: outputDir,
33
+ filename: isParted ? (partedPrefix || 'rws') + '.[name].js' : outputFileName,
34
+ sourceMapFilename: '[file].map',
35
+ },
36
+ resolve: {
37
+ extensions: ['.ts', '.js', '.scss', '.css'],
38
+ modules: modules_setup,
39
+ alias: {
40
+ ...aliases
41
+ }
42
+ },
43
+ module: {
44
+ rules: getRWSLoaders(clientPkgPath, path.resolve(_packageDir, 'node_modules'), tsConfigPath, devDebug),
45
+ },
46
+ plugins: WEBPACK_PLUGINS,
47
+ externals: rwsExternals(executionDir, modules_setup, automatedChunks, {
48
+ _vars: devExternalsVars
49
+ }),
50
+ cache: {
51
+ type: 'filesystem',
52
+ buildDependencies: {
53
+ config: [__filename],
54
+ },
55
+ }
56
+ }
57
+ }
58
+
59
+ module.exports = { createWebpackConfig }
@@ -5,7 +5,7 @@ const { rwsPath } = require('@rws-framework/console');
5
5
  const path = require('path');
6
6
  const fs = require('fs');
7
7
 
8
- function setupTsConfig(tsConfigPath, executionDir) {
8
+ function setupTsConfig(tsConfigPath, executionDir, userAliases = {}) {
9
9
 
10
10
  if (!fs.existsSync(tsConfigPath)) {
11
11
  throw new Error(`Typescript config file "${tsConfigPath}" does not exist`);
@@ -19,8 +19,7 @@ function setupTsConfig(tsConfigPath, executionDir) {
19
19
  const declarationsPath = path.resolve(__dirname, '..', 'types') + '/declarations.d.ts';
20
20
  const foundationPath = path.resolve(__dirname, '..', 'foundation');
21
21
  const testsPath = path.resolve(__dirname, '..', 'tests');
22
- const declarationsPathMD5 = md5(fs.readFileSync(declarationsPath, 'utf-8'));
23
- const testsPathMD5 = fs.existsSync(testsPath) ? md5(fs.readFileSync(testsPath, 'utf-8')) : null;
22
+
24
23
 
25
24
  const relativeDeclarationsPath = path.relative(path.dirname(tsConfigPath), declarationsPath);
26
25
  const relativeTestsPath = path.relative(path.dirname(tsConfigPath), testsPath);
@@ -28,36 +27,37 @@ function setupTsConfig(tsConfigPath, executionDir) {
28
27
 
29
28
 
30
29
  const includedMD5 = [];
30
+ const srcPath = 'src/index.ts';
31
31
 
32
- let changed = false;
32
+ let changed = false;
33
33
 
34
34
  if (!Object.keys(tsConfig).includes('include')) {
35
35
  tsConfig['include'] = [];
36
36
  } else {
37
37
  tsConfig['include'] = tsConfig['include'].filter((inc) => {
38
- if(inc === 'src/index.ts'){
38
+ if (inc === srcPath) {
39
39
  return true;
40
- }
40
+ }
41
41
 
42
- return fs.existsSync(rwsPath.relativize(inc, executionDir))
42
+ return fs.existsSync(rwsPath.relativize(inc, executionDir));
43
43
  })
44
- }
45
-
46
-
47
- if (!tsConfig['include'].includes('src/index.ts')) {
44
+ }
45
+
46
+
47
+ if (!tsConfig['include'].includes(srcPath)) {
48
48
  console.log(chalk.blueBright('[RWS TS CONFIG]'), 'adding RWS project typescript code to project tsconfig.json');
49
- tsConfig['include'].unshift('src/index.ts');
49
+ tsConfig['include'].unshift(srcPath);
50
50
  changed = true;
51
- }
51
+ }
52
52
 
53
53
  if (!Object.keys(tsConfig).includes('exclude')) {
54
- tsConfig['exclude'] = [];
54
+ tsConfig['exclude'] = [];
55
55
  changed = true;
56
- }
57
-
56
+ }
57
+
58
58
  const excludeString = '**/*.debug.ts';
59
59
 
60
- if(!tsConfig['exclude'].includes(excludeString)){
60
+ if (!tsConfig['exclude'].includes(excludeString)) {
61
61
  tsConfig['exclude'].push(excludeString);
62
62
  changed = true;
63
63
  }
@@ -65,28 +65,49 @@ function setupTsConfig(tsConfigPath, executionDir) {
65
65
  let probablyLinked = false;
66
66
 
67
67
  tsConfig['include'].forEach(element => {
68
- if(element !== 'src' && element.indexOf('declarations.d.ts') > -1 && md5(fs.readFileSync(rwsPath.relativize(element, executionDir), 'utf-8')) === md5(fs.readFileSync(declarationsPath, 'utf-8'))){
68
+ if (element !== 'src' && element.indexOf('declarations.d.ts') > -1 && md5(fs.readFileSync(rwsPath.relativize(element, executionDir), 'utf-8')) === md5(fs.readFileSync(declarationsPath, 'utf-8'))) {
69
69
  probablyLinked = true;
70
- }
71
- });
70
+ }
71
+ });
72
72
 
73
73
  if (!tsConfig['include'].includes(relativeDeclarationsPath) && !probablyLinked) {
74
74
  console.log(chalk.blueBright('[RWS TS CONFIG]'), 'adding RWS typescript declarations to project tsconfig.json');
75
75
  tsConfig['include'].push(relativeDeclarationsPath);
76
76
  includedMD5.push(md5(fs.readFileSync(declarationsPath, 'utf-8')));
77
77
  changed = true;
78
- }
78
+ }
79
+
80
+ if(!tsConfig.compilerOptions){
81
+ throw new Error(`${tsConfigPath} needs "compilerOptions" section`)
82
+ }
83
+
84
+ if (Object.keys(userAliases).length) {
85
+ const tsPaths = tsConfig.compilerOptions?.paths || {};
86
+
87
+ // console.log({tsPaths})
88
+ let changedPaths = false;
79
89
 
90
+ Object.keys(userAliases).forEach((alias) => {
91
+ const aliasPath = userAliases[alias];
92
+ if(!tsPaths[alias]){
93
+
94
+ tsPaths[alias] = [path.relative(executionDir, aliasPath)];
95
+
96
+ console.log({alias, x: tsPaths[alias]});
97
+
98
+ changedPaths = true;
99
+ }
100
+ });
80
101
 
81
- // if(!Object.keys(tsConfig['compilerOptions']).includes('paths')){
82
- // tsConfig['compilerOptions']['paths'] = {};
83
- // changed = true;
84
- // }
102
+ if(changedPaths){
103
+ console.log('tspaths', tsPaths);
104
+ console.log(chalk.blueBright('[RWS TS CONFIG]'), 'adding user aliases as paths to project tsconfig.json');
105
+
106
+ tsConfig.compilerOptions.paths = tsPaths;
107
+ changed = true;
108
+ }
109
+ }
85
110
 
86
- // if(!Object.keys(tsConfig['compilerOptions']['paths']).includes('@rws-framework/foundation')){
87
- // tsConfig['compilerOptions']['paths']['@rws-framework/foundation'] = [relativeFoundationPath];
88
- // }
89
-
90
111
 
91
112
  if (changed) {
92
113
  fs.writeFileSync(tsConfigPath, JSON.stringify(tsConfig, null, 2));
@@ -96,13 +117,13 @@ function setupTsConfig(tsConfigPath, executionDir) {
96
117
  return true;
97
118
  } catch (e) {
98
119
  const tsConfigFileContent = fs.readFileSync(tsConfigPath, 'utf-8');
99
- try{
120
+ try {
100
121
  console.log(chalk.blueBright('TSConfig (parsed)'), JSON.parse(tsConfigFileContent));
101
- } catch (e){
122
+ } catch (e) {
102
123
  console.log(chalk.yellow('TSConfig (unparsed)'), tsConfigFileContent);
103
124
 
104
125
  }
105
- console.log(chalk.redBright('Error in tsconfig.json:'));
126
+ console.log(chalk.redBright('Error in tsconfig.json:'));
106
127
  console.error(chalk.red(e.stack));
107
128
 
108
129
  return false;
package/console.js CHANGED
@@ -56,18 +56,18 @@ async function initCmd(){
56
56
  if(workspaced){
57
57
  if(!fs.existsSync(`${executionDir}/.eslintrc.json`)){
58
58
  const rcjs = fs.readFileSync(`${moduleDir}/.setup/.eslintrc.json`, 'utf-8');
59
- fs.writeFileSync(`${executionDir}/.eslintrc.json`, rcjs.replace('{{frontend_dir}}', executionDir));
59
+ fs.writeFile(`${executionDir}/.eslintrc.json`, rcjs.replace('{{frontend_dir}}', executionDir));
60
60
  console.log(chalk.green('RWS CLI'), 'Installed eslint base workspace config file.');
61
61
  }
62
62
  }else{
63
63
  if(!fs.existsSync(`${executionDir}/.eslintrc.json`)){
64
- fs.copyFileSync(`${moduleDir}/.eslintrc.json`, `${executionDir}/.eslintrc.json`);
64
+ fs.copyFile(`${moduleDir}/.eslintrc.json`, `${executionDir}/.eslintrc.json`);
65
65
  console.log(chalk.green('[RWS Client]'), 'Installed eslint config file.');
66
66
  }
67
67
  }
68
68
 
69
69
  if(!fs.existsSync(`${executionDir}/tsconfig.json`)){
70
- fs.copyFileSync(`${moduleDir}/.setup/tsconfig.json`, `${executionDir}/tsconfig.json`);
70
+ fs.copyFile(`${moduleDir}/.setup/tsconfig.json`, `${executionDir}/tsconfig.json`);
71
71
  console.log(chalk.green('[RWS Client]'), 'Installed tsconfig.');
72
72
  }
73
73
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rws-framework/client",
3
3
  "private": false,
4
- "version": "2.10.8",
4
+ "version": "2.10.10",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
7
7
  "docs": "typedoc --tsconfig ./tsconfig.json"
@@ -28,7 +28,7 @@
28
28
  "dependencies": {
29
29
  "@microsoft/fast-element": "^1.12.0",
30
30
  "@microsoft/fast-foundation": "^2.46.2",
31
- "@rws-framework/console": "*",
31
+ "@rws-framework/console": "^0.3.15",
32
32
  "@types/moment": "^2.13.0",
33
33
  "deepmerge": "^4.3.1",
34
34
  "dragula": "^3.7.3",
@@ -61,13 +61,14 @@
61
61
  "@types/he": "^1.2.3",
62
62
  "@types/sanitize-html": "^2.11.0",
63
63
  "@types/uuid": "^9.0.7",
64
- "@typescript-eslint/parser": "^5.0.0",
64
+ "@typescript-eslint/parser": "^5.0.0",
65
65
  "browser-sync": "^2.29.3",
66
66
  "clean-webpack-plugin": "^4.0.0",
67
67
  "css-loader": "^6.8.1",
68
68
  "css-minimizer-webpack-plugin": "^5.0.1",
69
69
  "eslint": "^6.0.0",
70
70
  "file-loader": "^6.2.0",
71
+ "fork-ts-checker-webpack-plugin": "^9.0.2",
71
72
  "html-webpack-plugin": "^5.5.3",
72
73
  "loader-utils": "^3.2.1",
73
74
  "mini-css-extract-plugin": "^2.7.6",
@@ -76,6 +77,7 @@
76
77
  "raw-loader": "^4.0.2",
77
78
  "sass-loader": "^13.3.2",
78
79
  "source-map": "^0.7.4",
80
+ "speed-measure-webpack-plugin": "^1.5.0",
79
81
  "style-loader": "^3.3.3",
80
82
  "terser-webpack-plugin": "^5.3.9",
81
83
  "ts-loader": "^9.4.4",