esoftplay 0.0.133-c → 0.0.133-e

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.
Files changed (2) hide show
  1. package/bin/perf.js +4 -4
  2. package/package.json +1 -1
package/bin/perf.js CHANGED
@@ -4,15 +4,16 @@ const fs = require('fs');
4
4
  const param = process.argv[2]
5
5
 
6
6
  if (param == 'clear') {
7
+ console.log("DEACTIVATING FAST REFRESH...")
7
8
  fs.readdirSync('./modules/').forEach((module) => {
8
9
  if (fs.statSync('./modules/' + module).isDirectory()) {
9
10
  fs.readdirSync('./modules/' + module).forEach((task) => {
10
11
  let text = fs.readFileSync('./modules/' + module + '/' + task, { encoding: 'utf8' })
11
12
  const isHooks = (/\/\/\s{0,}withHooks/g).exec(text)
12
13
  const memoiz = (/\nexport default memo\(([a-zA-Z0-9]+)\)\;/g).exec(text)
14
+ text = text.replace("\nimport { memo } from 'react';", "")
13
15
  if (isHooks && memoiz && memoiz.length > 1) {
14
16
  const [exdefCurrent, currentNameFunction] = memoiz
15
- text = text.replace("\nimport {memo} from 'react';", "")
16
17
  text = text.replace(exdefCurrent, '')
17
18
  text = text.replace("function " + currentNameFunction + "(", "export default function " + currentNameFunction + "(")
18
19
  fs.writeFileSync('./modules/' + module + '/' + task, text, { encoding: 'utf8' })
@@ -21,6 +22,7 @@ if (param == 'clear') {
21
22
  }
22
23
  })
23
24
  } else {
25
+ console.log("ACTIVATING FAST REFRESH...")
24
26
  fs.readdirSync('./modules/').forEach((module) => {
25
27
  if (fs.statSync('./modules/' + module).isDirectory()) {
26
28
  fs.readdirSync('./modules/' + module).forEach((task) => {
@@ -30,13 +32,11 @@ if (param == 'clear') {
30
32
  const exdef = (/\nexport default function ([a-zA-Z0-9]+)\(/g).exec(text)
31
33
  if (exdef && exdef.length > 1) {
32
34
  const [exdefCurrent, currentNameFunction] = exdef
33
- text = text.replace('withHooks', "withHooks\nimport {memo} from 'react';")
35
+ text = text.replace('withHooks', "withHooks\nimport { memo } from 'react';")
34
36
  text = text.replace(exdefCurrent, "\nfunction " + currentNameFunction + '(')
35
37
  text = text + '\nexport default memo(' + currentNameFunction + ');'
36
38
  fs.writeFileSync('./modules/' + module + '/' + task, text, { encoding: 'utf8' })
37
39
  }
38
- } else {
39
- console.log('SKIP => ' + module + '/' + task)
40
40
  }
41
41
  })
42
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay",
3
- "version": "0.0.133-c",
3
+ "version": "0.0.133-e",
4
4
  "description": "embedding data from esoftplay framework (web based) into mobile app",
5
5
  "main": "cache/index.js",
6
6
  "types": "../../index.d.ts",