cob-cli 2.38.0 → 2.38.2

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,3 +1,4 @@
1
+ const chokidar = require('chokidar');
1
2
  const fs = require('fs-extra');
2
3
  const execa = require('execa');
3
4
  const git = require('simple-git');
@@ -56,8 +57,14 @@ async function otherFilesContiousReload(cmdEnv) {
56
57
  const changedFile = change.split(" ")[1];
57
58
  await addFileToCurrentTest(cmdEnv.server, changedFile, changedFiles, changeType, restoreChanges);
58
59
  }
59
-
60
- watcher.process = fs.watch('.', { recursive: true }, async (eventType, changedFile) => {
60
+ watcher.process = chokidar.watch('.', {
61
+ //ignored: /(^|[\/\\])\../, // ignore dotfiles
62
+ persistent: true,
63
+ usePolling: true,
64
+ ignoreInitial: true
65
+ });
66
+ watcher.process.on('all', async (eventType, changedFile) => {
67
+ console.log(eventType, changedFile);
61
68
  // Não é preciso fazer nada para directorias que só existem no servidor
62
69
  let product = changedFile.split("/")[0];
63
70
  let productDir = resolveCobPath(cmdEnv.server, "serverLive", product).split(":")[1];
@@ -72,7 +79,7 @@ async function otherFilesContiousReload(cmdEnv) {
72
79
 
73
80
  let isLocalFile = false;
74
81
  try {
75
- isFile = fs.lstatSync(changedFile).isFile()
82
+ isLocalFile = fs.lstatSync(changedFile).isFile()
76
83
  } catch {}
77
84
 
78
85
  if (
@@ -86,6 +93,7 @@ async function otherFilesContiousReload(cmdEnv) {
86
93
  && changedFile.indexOf(IN_PROGRESS_TEST_FILE) < 0
87
94
  && (isLocalFile || await isRemoteFile())
88
95
  ) {
96
+
89
97
  try {
90
98
  await addFileToCurrentTest(cmdEnv.server, changedFile, changedFiles, " Syncing ".bgRed.bold + " ", restoreChanges );
91
99
  changedFiles.add(changedFile);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cob-cli",
3
- "version": "2.38.0",
3
+ "version": "2.38.2",
4
4
  "description": "A command line utility to help Cult of Bits partners develop with higher speed and reusing common code and best practices.",
5
5
  "preferGlobal": true,
6
6
  "repository": {
@@ -33,7 +33,8 @@
33
33
  "webpack": "^5.75.0",
34
34
  "webpack-cli": "^5.0.1",
35
35
  "webpack-dev-server": "^4.11.1",
36
- "xdg-basedir": "^5.1.0"
36
+ "xdg-basedir": "^5.1.0",
37
+ "chokidar": "^3.5.3"
37
38
  },
38
39
  "keywords": [],
39
40
  "author": "mimes70",