@nestjs/cli 8.1.3 → 8.1.4
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.
|
@@ -2,8 +2,12 @@ import { Configuration } from '../configuration';
|
|
|
2
2
|
export declare class AssetsManager {
|
|
3
3
|
private watchAssetsKeyValue;
|
|
4
4
|
private watchers;
|
|
5
|
+
private actionInProgress;
|
|
5
6
|
/**
|
|
6
7
|
* Using on `nest build` to close file watch or the build process will not end
|
|
8
|
+
* Interval like process
|
|
9
|
+
* If no action has been taken recently close watchers
|
|
10
|
+
* If action has been taken recently flag and try again
|
|
7
11
|
*/
|
|
8
12
|
closeWatchers(): void;
|
|
9
13
|
copyAssets(configuration: Required<Configuration>, appName: string, outDir: string, watchAssetsMode: boolean): void;
|
|
@@ -10,13 +10,26 @@ class AssetsManager {
|
|
|
10
10
|
constructor() {
|
|
11
11
|
this.watchAssetsKeyValue = {};
|
|
12
12
|
this.watchers = [];
|
|
13
|
+
this.actionInProgress = false;
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
16
|
* Using on `nest build` to close file watch or the build process will not end
|
|
17
|
+
* Interval like process
|
|
18
|
+
* If no action has been taken recently close watchers
|
|
19
|
+
* If action has been taken recently flag and try again
|
|
16
20
|
*/
|
|
17
21
|
closeWatchers() {
|
|
18
|
-
|
|
19
|
-
const
|
|
22
|
+
// Consider adjusting this for larger files
|
|
23
|
+
const timeoutMs = 500;
|
|
24
|
+
const closeFn = () => {
|
|
25
|
+
if (this.actionInProgress) {
|
|
26
|
+
this.actionInProgress = false;
|
|
27
|
+
setTimeout(closeFn, timeoutMs);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
this.watchers.forEach((watcher) => watcher.close());
|
|
31
|
+
}
|
|
32
|
+
};
|
|
20
33
|
setTimeout(closeFn, timeoutMs);
|
|
21
34
|
}
|
|
22
35
|
copyAssets(configuration, appName, outDir, watchAssetsMode) {
|
|
@@ -73,6 +86,8 @@ class AssetsManager {
|
|
|
73
86
|
}
|
|
74
87
|
// Set path value to true for watching the first time
|
|
75
88
|
this.watchAssetsKeyValue[path] = true;
|
|
89
|
+
// Set action to true to avoid watches getting cutoff
|
|
90
|
+
this.actionInProgress = true;
|
|
76
91
|
const dest = copy_path_resolve_1.copyPathResolve(path, item.outDir, sourceRoot.split(path_1.sep).length);
|
|
77
92
|
// Copy to output dir if file is changed or added
|
|
78
93
|
if (action === 'change') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/cli",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.4",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@cli)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"gulp": "4.0.2",
|
|
89
89
|
"gulp-clean": "0.4.0",
|
|
90
90
|
"husky": "7.0.2",
|
|
91
|
-
"jest": "27.
|
|
91
|
+
"jest": "27.3.0",
|
|
92
92
|
"prettier": "2.4.1",
|
|
93
93
|
"release-it": "14.11.6",
|
|
94
94
|
"ts-jest": "27.0.7",
|