incremental-compiler 18.0.9 → 18.0.12
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/README.md +13 -13
- package/assets/shared/shared_folder_info.txt +1 -1
- package/browser/README.md +24 -24
- package/browser/esm2022/lib/base-client-compiler.mjs +269 -0
- package/browser/esm2022/lib/change-of-file.mjs +16 -0
- package/browser/esm2022/lib/compiler-manager.mjs +198 -0
- package/browser/esm2022/lib/constants.mjs +4 -0
- package/browser/esm2022/lib/incremental-watcher/incremental-watcher-events.mjs +4 -0
- package/browser/esm2022/lib/incremental-watcher/incremental-watcher-instance.mjs +4 -0
- package/browser/esm2022/lib/incremental-watcher/incremental-watcher-options.mjs +4 -0
- package/browser/esm2022/lib/incremental-watcher/incremental-watcher.mjs +49 -0
- package/browser/esm2022/lib/incremental-watcher/index.mjs +6 -0
- package/browser/esm2022/lib/index.mjs +24 -75
- package/browser/esm2022/lib/models.mjs +1 -3
- package/browser/fesm2022/incremental-compiler.mjs +360 -68
- package/browser/fesm2022/incremental-compiler.mjs.map +1 -1
- package/browser/lib/base-client-compiler.d.ts +56 -0
- package/browser/lib/change-of-file.d.ts +9 -0
- package/browser/lib/compiler-manager.d.ts +17 -0
- package/browser/lib/constants.d.ts +2 -0
- package/browser/lib/incremental-watcher/incremental-watcher-events.d.ts +6 -0
- package/browser/lib/incremental-watcher/incremental-watcher-instance.d.ts +7 -0
- package/browser/lib/incremental-watcher/incremental-watcher-options.d.ts +10 -0
- package/browser/lib/incremental-watcher/incremental-watcher.d.ts +4 -0
- package/browser/lib/incremental-watcher/index.d.ts +4 -0
- package/browser/lib/index.d.ts +24 -1
- package/browser/lib/models.d.ts +7 -6
- package/client/README.md +24 -24
- package/client/esm2022/lib/base-client-compiler.mjs +269 -0
- package/client/esm2022/lib/change-of-file.mjs +16 -0
- package/client/esm2022/lib/compiler-manager.mjs +198 -0
- package/client/esm2022/lib/constants.mjs +4 -0
- package/client/esm2022/lib/incremental-watcher/incremental-watcher-events.mjs +4 -0
- package/client/esm2022/lib/incremental-watcher/incremental-watcher-instance.mjs +4 -0
- package/client/esm2022/lib/incremental-watcher/incremental-watcher-options.mjs +4 -0
- package/client/esm2022/lib/incremental-watcher/incremental-watcher.mjs +49 -0
- package/client/esm2022/lib/incremental-watcher/index.mjs +6 -0
- package/client/esm2022/lib/index.mjs +24 -75
- package/client/esm2022/lib/models.mjs +1 -3
- package/client/fesm2022/incremental-compiler.mjs +360 -68
- package/client/fesm2022/incremental-compiler.mjs.map +1 -1
- package/client/lib/base-client-compiler.d.ts +56 -0
- package/client/lib/change-of-file.d.ts +9 -0
- package/client/lib/compiler-manager.d.ts +17 -0
- package/client/lib/constants.d.ts +2 -0
- package/client/lib/incremental-watcher/incremental-watcher-events.d.ts +6 -0
- package/client/lib/incremental-watcher/incremental-watcher-instance.d.ts +7 -0
- package/client/lib/incremental-watcher/incremental-watcher-options.d.ts +10 -0
- package/client/lib/incremental-watcher/incremental-watcher.d.ts +4 -0
- package/client/lib/incremental-watcher/index.d.ts +4 -0
- package/client/lib/index.d.ts +24 -1
- package/client/lib/models.d.ts +7 -6
- package/lib/{base-client-compiler.backend.d.ts → base-client-compiler.d.ts} +11 -11
- package/lib/{base-client-compiler.backend.js → base-client-compiler.js} +109 -84
- package/lib/base-client-compiler.js.map +1 -0
- package/lib/change-of-file.d.ts +8 -0
- package/lib/change-of-file.js +27 -0
- package/lib/change-of-file.js.map +1 -0
- package/lib/{compiler-manager.backend.d.ts → compiler-manager.d.ts} +1 -11
- package/lib/compiler-manager.js +220 -0
- package/lib/compiler-manager.js.map +1 -0
- package/lib/incremental-watcher/incremental-watcher.js +14 -10
- package/lib/incremental-watcher/incremental-watcher.js.map +1 -1
- package/lib/incremental-watcher/parcel-watcher-adapter.backend.js +10 -10
- package/lib/incremental-watcher/parcel-watcher-adapter.backend.js.map +1 -1
- package/lib/index._auto-generated_.d.ts +0 -0
- package/lib/index._auto-generated_.js +6 -0
- package/lib/index._auto-generated_.js.map +1 -0
- package/lib/index.d.ts +8 -25
- package/lib/index.js +8 -55
- package/lib/index.js.map +1 -1
- package/lib/models.d.ts +7 -6
- package/package.json +5 -7
- package/taon.jsonc +50 -51
- package/tmp-environment.json +32 -32
- package/websql/README.md +24 -24
- package/websql/esm2022/lib/base-client-compiler.mjs +269 -0
- package/websql/esm2022/lib/change-of-file.mjs +16 -0
- package/websql/esm2022/lib/compiler-manager.mjs +198 -0
- package/websql/esm2022/lib/constants.mjs +4 -0
- package/websql/esm2022/lib/incremental-watcher/incremental-watcher-events.mjs +4 -0
- package/websql/esm2022/lib/incremental-watcher/incremental-watcher-instance.mjs +4 -0
- package/websql/esm2022/lib/incremental-watcher/incremental-watcher-options.mjs +4 -0
- package/websql/esm2022/lib/incremental-watcher/incremental-watcher.mjs +49 -0
- package/websql/esm2022/lib/incremental-watcher/index.mjs +6 -0
- package/websql/esm2022/lib/index.mjs +24 -75
- package/websql/esm2022/lib/models.mjs +1 -3
- package/websql/fesm2022/incremental-compiler.mjs +360 -68
- package/websql/fesm2022/incremental-compiler.mjs.map +1 -1
- package/websql/lib/base-client-compiler.d.ts +56 -0
- package/websql/lib/change-of-file.d.ts +9 -0
- package/websql/lib/compiler-manager.d.ts +17 -0
- package/websql/lib/constants.d.ts +2 -0
- package/websql/lib/incremental-watcher/incremental-watcher-events.d.ts +6 -0
- package/websql/lib/incremental-watcher/incremental-watcher-instance.d.ts +7 -0
- package/websql/lib/incremental-watcher/incremental-watcher-options.d.ts +10 -0
- package/websql/lib/incremental-watcher/incremental-watcher.d.ts +4 -0
- package/websql/lib/incremental-watcher/index.d.ts +4 -0
- package/websql/lib/index.d.ts +24 -1
- package/websql/lib/models.d.ts +7 -6
- package/lib/base-client-compiler.backend.js.map +0 -1
- package/lib/change-of-file.backend.d.ts +0 -14
- package/lib/change-of-file.backend.js +0 -54
- package/lib/change-of-file.backend.js.map +0 -1
- package/lib/compiler-manager.backend.js +0 -307
- package/lib/compiler-manager.backend.js.map +0 -1
- package/lib/decorators.backend.d.ts +0 -5
- package/lib/decorators.backend.js +0 -56
- package/lib/decorators.backend.js.map +0 -1
- package/lib/helpers.backend.d.ts +0 -3
- package/lib/helpers.backend.js +0 -31
- package/lib/helpers.backend.js.map +0 -1
package/client/lib/models.d.ts
CHANGED
@@ -4,11 +4,15 @@ export declare namespace Models {
|
|
4
4
|
interface StartAndWatchOptions<INIT_PARAMS = any> {
|
5
5
|
afterInitCallBack?: (initalParams?: INIT_PARAMS) => void;
|
6
6
|
watchOnly?: boolean;
|
7
|
+
/**
|
8
|
+
* override task name
|
9
|
+
*/
|
7
10
|
taskName?: string;
|
8
11
|
initalParams?: INIT_PARAMS;
|
9
12
|
}
|
10
13
|
type StartOptions<T = any> = Omit<StartAndWatchOptions<T>, 'watchOnly'>;
|
11
14
|
interface BaseClientCompilerOptions {
|
15
|
+
taskName: string;
|
12
16
|
folderPath?: string | string[];
|
13
17
|
/**
|
14
18
|
* It will cache in memory previouse files
|
@@ -16,7 +20,6 @@ export declare namespace Models {
|
|
16
20
|
* and prevent not changed files emiting change event
|
17
21
|
*/
|
18
22
|
folderPathContentCheck?: string | string[];
|
19
|
-
watchDepth?: Number;
|
20
23
|
/**
|
21
24
|
* default true
|
22
25
|
*/
|
@@ -26,13 +29,11 @@ export declare namespace Models {
|
|
26
29
|
* default: false
|
27
30
|
*/
|
28
31
|
notifyOnFileUnlink?: boolean;
|
29
|
-
ignoreFolderPatter?: string[];
|
30
|
-
allowedOnlyFileExt?: string[];
|
31
32
|
/**
|
32
|
-
*
|
33
|
+
* ignore glob folder pattern
|
34
|
+
* node_modules is always ignored
|
33
35
|
*/
|
34
|
-
|
35
|
-
executeOutsideScenario?: boolean;
|
36
|
+
ignoreFolderPatter?: string[];
|
36
37
|
subscribeOnlyFor?: CoreModels.FileExtension[];
|
37
38
|
}
|
38
39
|
}
|
@@ -1,15 +1,12 @@
|
|
1
|
-
import { ChangeOfFile } from './change-of-file
|
1
|
+
import { ChangeOfFile } from './change-of-file';
|
2
2
|
import { Models } from './models';
|
3
3
|
import { CoreModels } from 'tnp-core/src';
|
4
4
|
export declare class BaseClientCompiler<INITAL_PARAMS = any> implements Models.BaseClientCompilerOptions {
|
5
5
|
readonly followSymlinks: boolean;
|
6
6
|
readonly subscribeOnlyFor: CoreModels.FileExtension[];
|
7
7
|
readonly executeOutsideScenario: boolean;
|
8
|
-
readonly watchDepth: Number;
|
9
8
|
readonly taskName: string;
|
10
9
|
ignoreFolderPatter?: string[];
|
11
|
-
allowedOnlyFileExt?: string[];
|
12
|
-
additionallyAllowedFilesWithNames?: string[];
|
13
10
|
readonly notifyOnFileUnlink: boolean;
|
14
11
|
compilationWrapper: (fn: () => void, taskName?: string, executionType?: "Compilation of" | "Code execution of" | "Event:") => Promise<void>;
|
15
12
|
private pathResolve;
|
@@ -17,7 +14,7 @@ export declare class BaseClientCompiler<INITAL_PARAMS = any> implements Models.B
|
|
17
14
|
private __folderPath;
|
18
15
|
lastAsyncFiles: string[];
|
19
16
|
private _folderPathContentCheck;
|
20
|
-
|
17
|
+
isWatchCompilation: boolean;
|
21
18
|
get isInited(): boolean;
|
22
19
|
get folderPathContentCheck(): string[];
|
23
20
|
private set folderPathContentCheck(value);
|
@@ -30,10 +27,18 @@ export declare class BaseClientCompiler<INITAL_PARAMS = any> implements Models.B
|
|
30
27
|
protected initOptions(options?: Models.BaseClientCompilerOptions): void;
|
31
28
|
protected onlySingleRun: boolean;
|
32
29
|
/**
|
30
|
+
* do not override this
|
31
|
+
*/
|
32
|
+
runTask(options?: {
|
33
|
+
watch?: boolean;
|
34
|
+
} & Models.StartAndWatchOptions<INITAL_PARAMS>): Promise<BaseClientCompiler<INITAL_PARAMS>>;
|
35
|
+
/**
|
36
|
+
* @deprecated use runTask instead
|
33
37
|
* Do not override this
|
34
38
|
*/
|
35
39
|
start(options?: Models.StartOptions<INITAL_PARAMS>): Promise<BaseClientCompiler<INITAL_PARAMS>>;
|
36
40
|
/**
|
41
|
+
* @deprecated use runTask instead
|
37
42
|
* Do not override this
|
38
43
|
*/
|
39
44
|
startAndWatch(options?: Models.StartAndWatchOptions<INITAL_PARAMS>): Promise<BaseClientCompiler<INITAL_PARAMS>>;
|
@@ -45,13 +50,8 @@ export declare class BaseClientCompiler<INITAL_PARAMS = any> implements Models.B
|
|
45
50
|
syncAction(absolteFilesPathes?: string[], initalParams?: INITAL_PARAMS): Promise<void>;
|
46
51
|
preAsyncAction(initalParams?: INITAL_PARAMS): Promise<void>;
|
47
52
|
asyncAction(asyncEvents: ChangeOfFile, initalParams?: INITAL_PARAMS): Promise<void>;
|
48
|
-
watchOptions: {
|
49
|
-
allowedExt?: string[];
|
50
|
-
addionalAllowed: string[];
|
51
|
-
allowedExtEnable: boolean;
|
52
|
-
addionalAllowedEnable: boolean;
|
53
|
-
};
|
54
53
|
private _init;
|
55
54
|
private fixTaskName;
|
56
55
|
filesToWatch(): string[];
|
56
|
+
private mapForWatching;
|
57
57
|
}
|
@@ -3,52 +3,44 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BaseClientCompiler = void 0;
|
4
4
|
var tslib_1 = require("tslib");
|
5
5
|
//#region imports
|
6
|
+
//#region @backend
|
6
7
|
var tnp_core_1 = require("tnp-core");
|
7
|
-
|
8
|
-
var compiler_manager_backend_1 = require("./compiler-manager.backend");
|
9
|
-
var helpers_backend_1 = require("./helpers.backend");
|
8
|
+
//#endregion
|
10
9
|
var tnp_core_2 = require("tnp-core");
|
11
|
-
var
|
10
|
+
var compiler_manager_1 = require("./compiler-manager");
|
11
|
+
var tnp_core_3 = require("tnp-core");
|
12
|
+
var tnp_core_4 = require("tnp-core");
|
12
13
|
//#endregion
|
13
14
|
var BaseClientCompiler = /** @class */ (function () {
|
14
15
|
//#endregion
|
15
16
|
//#endregion
|
16
17
|
//#region constructor
|
18
|
+
//#region @backend
|
17
19
|
function BaseClientCompiler(options) {
|
18
20
|
this.subscribeOnlyFor = [];
|
19
|
-
|
21
|
+
//#region @backend
|
22
|
+
this.compilationWrapper = tnp_core_3.Helpers.compilationWrapper;
|
23
|
+
//#endregion
|
20
24
|
this.pathResolve = false;
|
21
25
|
this.initedWithOptions = false;
|
22
26
|
this.__folderPath = [];
|
23
27
|
this.lastAsyncFiles = [];
|
24
28
|
this._folderPathContentCheck = [];
|
29
|
+
this.isWatchCompilation = false;
|
25
30
|
//#endregion
|
26
31
|
this.onlySingleRun = true;
|
27
|
-
|
28
|
-
//#endregion
|
29
|
-
//#region private methods
|
30
|
-
this.watchOptions = {};
|
31
|
-
if (tnp_core_1._.isUndefined(options)) {
|
32
|
+
if (tnp_core_2._.isUndefined(options)) {
|
32
33
|
this.initedWithOptions = false;
|
33
|
-
|
34
|
+
tnp_core_3.Helpers.log('[incremental-compiler] Compiler class instace without init options');
|
34
35
|
}
|
35
36
|
else {
|
36
37
|
this.initedWithOptions = true;
|
37
38
|
this._init(options);
|
38
39
|
}
|
39
40
|
}
|
40
|
-
Object.defineProperty(BaseClientCompiler.prototype, "key", {
|
41
|
-
//#endregion
|
42
|
-
//#region getters & setteres
|
43
|
-
//#region getters & setteres / key
|
44
|
-
get: function () {
|
45
|
-
return "".concat(typescript_class_helpers_1.CLASS.getNameFromObject(this), "__").concat(tnp_core_1._.kebabCase(this.taskName));
|
46
|
-
},
|
47
|
-
enumerable: false,
|
48
|
-
configurable: true
|
49
|
-
});
|
50
41
|
Object.defineProperty(BaseClientCompiler.prototype, "isInited", {
|
51
42
|
//#endregion
|
43
|
+
//#region getters & setteres
|
52
44
|
//#region getters & setteres / is inited
|
53
45
|
get: function () {
|
54
46
|
return this.initedWithOptions;
|
@@ -71,47 +63,82 @@ var BaseClientCompiler = /** @class */ (function () {
|
|
71
63
|
Object.defineProperty(BaseClientCompiler.prototype, "folderPath", {
|
72
64
|
get: function () {
|
73
65
|
var _this = this;
|
66
|
+
//#region @backendFunc
|
74
67
|
if (!this.pathResolve) {
|
75
68
|
this.pathResolve = true;
|
76
|
-
this.__folderPath
|
69
|
+
this.__folderPath
|
70
|
+
.map(function (p) {
|
77
71
|
if (tnp_core_1.fse.existsSync(p)) {
|
78
|
-
return (0,
|
72
|
+
return (0, tnp_core_2.crossPlatformPath)(tnp_core_2.path.resolve(p));
|
79
73
|
}
|
80
74
|
else {
|
81
|
-
|
75
|
+
tnp_core_3.Helpers.warn("[BaseClientCompiler] Task \"".concat(_this.taskName, "\" folderPath doesn't not exist ").concat(_this.folderPath));
|
82
76
|
return void 0;
|
83
77
|
}
|
84
|
-
})
|
78
|
+
})
|
79
|
+
.filter(function (f) { return !!f; });
|
85
80
|
}
|
86
81
|
return this.__folderPath;
|
82
|
+
//#endregion
|
87
83
|
},
|
88
84
|
//#endregion
|
89
85
|
//#region getters & setteres / folder path
|
90
86
|
set: function (v) {
|
87
|
+
if (tnp_core_2._.isString(v)) {
|
88
|
+
v = [v];
|
89
|
+
}
|
91
90
|
this.__folderPath = v;
|
92
91
|
},
|
93
92
|
enumerable: false,
|
94
93
|
configurable: true
|
95
94
|
});
|
96
95
|
//#endregion
|
97
|
-
//#
|
98
|
-
//#region
|
96
|
+
//#endregion
|
97
|
+
//#region / init options
|
99
98
|
/**
|
100
99
|
* manually init options (when no passing object to constructor super() )
|
101
100
|
*/
|
102
101
|
BaseClientCompiler.prototype.initOptions = function (options) {
|
102
|
+
//#region @backendFunc
|
103
103
|
if (this.initedWithOptions === true) {
|
104
|
-
|
105
|
-
|
104
|
+
tnp_core_3.Helpers.warn("[incremental-compiler] You can't reinit instance class again..." +
|
105
|
+
" (after reiniting in constructor super(....))", true);
|
106
106
|
}
|
107
107
|
if (!options) {
|
108
|
-
|
108
|
+
tnp_core_3.Helpers.error("[incremental-compiler] Please init instance with options config", false, true);
|
109
109
|
}
|
110
110
|
this.initedWithOptions = true;
|
111
111
|
this._init(options);
|
112
|
+
//#endregion
|
113
|
+
};
|
114
|
+
//#region api methods / start
|
115
|
+
/**
|
116
|
+
* do not override this
|
117
|
+
*/
|
118
|
+
BaseClientCompiler.prototype.runTask = function (options) {
|
119
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
120
|
+
return tslib_1.__generator(this, function (_a) {
|
121
|
+
switch (_a.label) {
|
122
|
+
case 0:
|
123
|
+
//#region @backendFunc
|
124
|
+
this.isWatchCompilation = options === null || options === void 0 ? void 0 : options.watch;
|
125
|
+
if (!(options === null || options === void 0 ? void 0 : options.watch)) return [3 /*break*/, 2];
|
126
|
+
return [4 /*yield*/, this.startAndWatch(options)];
|
127
|
+
case 1:
|
128
|
+
_a.sent();
|
129
|
+
return [3 /*break*/, 4];
|
130
|
+
case 2: return [4 /*yield*/, this.start(options)];
|
131
|
+
case 3:
|
132
|
+
_a.sent();
|
133
|
+
_a.label = 4;
|
134
|
+
case 4: return [2 /*return*/, this];
|
135
|
+
}
|
136
|
+
});
|
137
|
+
});
|
112
138
|
};
|
113
139
|
//#region api methods / start
|
114
140
|
/**
|
141
|
+
* @deprecated use runTask instead
|
115
142
|
* Do not override this
|
116
143
|
*/
|
117
144
|
BaseClientCompiler.prototype.start = function (options) {
|
@@ -122,9 +149,9 @@ var BaseClientCompiler = /** @class */ (function () {
|
|
122
149
|
switch (_b.label) {
|
123
150
|
case 0:
|
124
151
|
_a = options || {}, taskName = _a.taskName, afterInitCallBack = _a.afterInitCallBack, initalParams = _a.initalParams;
|
125
|
-
|
152
|
+
compiler_manager_1.CompilerManager.Instance.addClient(this);
|
126
153
|
if (!this.initedWithOptions) {
|
127
|
-
|
154
|
+
tnp_core_3.Helpers.error("[BaseClientCompiler] Please init client class intance with options", false, true);
|
128
155
|
}
|
129
156
|
taskName = this.fixTaskName(taskName);
|
130
157
|
// @ts-ignore
|
@@ -132,17 +159,20 @@ var BaseClientCompiler = /** @class */ (function () {
|
|
132
159
|
return [4 /*yield*/, this.compilationWrapper(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
133
160
|
return tslib_1.__generator(this, function (_a) {
|
134
161
|
switch (_a.label) {
|
135
|
-
case 0: return [4 /*yield*/,
|
162
|
+
case 0: return [4 /*yield*/, compiler_manager_1.CompilerManager.Instance.syncInit(this, initalParams)];
|
136
163
|
case 1:
|
137
164
|
_a.sent();
|
138
165
|
return [2 /*return*/];
|
139
166
|
}
|
140
167
|
});
|
141
|
-
}); }, "".concat(
|
168
|
+
}); }, "".concat(tnp_core_4.CLI.chalk.green('sync action'), " for ").concat(taskName), 'Event:')];
|
142
169
|
case 1:
|
143
170
|
_b.sent();
|
144
|
-
if (!
|
145
|
-
return [4 /*yield*/,
|
171
|
+
if (!tnp_core_2._.isFunction(afterInitCallBack)) return [3 /*break*/, 3];
|
172
|
+
return [4 /*yield*/, tnp_core_3.Helpers.runSyncOrAsync({
|
173
|
+
functionFn: afterInitCallBack,
|
174
|
+
arrayOfParams: [initalParams],
|
175
|
+
})];
|
146
176
|
case 2:
|
147
177
|
_b.sent();
|
148
178
|
_b.label = 3;
|
@@ -154,6 +184,7 @@ var BaseClientCompiler = /** @class */ (function () {
|
|
154
184
|
//#endregion
|
155
185
|
//#region api methods / start and watch
|
156
186
|
/**
|
187
|
+
* @deprecated use runTask instead
|
157
188
|
* Do not override this
|
158
189
|
*/
|
159
190
|
BaseClientCompiler.prototype.startAndWatch = function (options) {
|
@@ -166,21 +197,21 @@ var BaseClientCompiler = /** @class */ (function () {
|
|
166
197
|
_a = options || {}, taskName = _a.taskName, watchOnly = _a.watchOnly, initalParams = _a.initalParams;
|
167
198
|
this.onlySingleRun = false;
|
168
199
|
if (!this.initedWithOptions) {
|
169
|
-
|
200
|
+
tnp_core_3.Helpers.error("[BaseClientCompiler] Please init client class intance with options", false, true);
|
170
201
|
}
|
171
202
|
taskName = this.fixTaskName(taskName);
|
172
203
|
// @ts-ignore
|
173
204
|
this.taskName = taskName;
|
174
205
|
if (!(this.folderPath.length > 0)) return [3 /*break*/, 7];
|
175
206
|
if (!watchOnly) return [3 /*break*/, 1];
|
176
|
-
console.log(
|
207
|
+
console.log(tnp_core_4.CLI.chalk.gray("[incremental-compiler] Watch mode only for \"".concat(taskName, "\"")));
|
177
208
|
return [3 /*break*/, 3];
|
178
209
|
case 1: return [4 /*yield*/, this.start(options)];
|
179
210
|
case 2:
|
180
211
|
_b.sent();
|
181
212
|
_b.label = 3;
|
182
213
|
case 3:
|
183
|
-
if (!
|
214
|
+
if (!tnp_core_2._.isFunction(this.preAsyncAction)) return [3 /*break*/, 5];
|
184
215
|
return [4 /*yield*/, this.compilationWrapper(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
185
216
|
return tslib_1.__generator(this, function (_a) {
|
186
217
|
switch (_a.label) {
|
@@ -190,16 +221,16 @@ var BaseClientCompiler = /** @class */ (function () {
|
|
190
221
|
return [2 /*return*/];
|
191
222
|
}
|
192
223
|
});
|
193
|
-
}); }, "".concat(
|
224
|
+
}); }, "".concat(tnp_core_4.CLI.chalk.green('pre-async action'), " for ").concat(taskName), 'Event:')];
|
194
225
|
case 4:
|
195
226
|
_b.sent();
|
196
227
|
_b.label = 5;
|
197
|
-
case 5: return [4 /*yield*/,
|
228
|
+
case 5: return [4 /*yield*/, compiler_manager_1.CompilerManager.Instance.asyncInit(this, initalParams || {})];
|
198
229
|
case 6:
|
199
230
|
_b.sent();
|
200
231
|
return [3 /*break*/, 9];
|
201
232
|
case 7:
|
202
|
-
|
233
|
+
tnp_core_3.Helpers.log("No action for task: ".concat(taskName, ".. starting task"));
|
203
234
|
return [4 /*yield*/, this.start(options)];
|
204
235
|
case 8:
|
205
236
|
_b.sent();
|
@@ -231,89 +262,83 @@ var BaseClientCompiler = /** @class */ (function () {
|
|
231
262
|
BaseClientCompiler.prototype.asyncAction = function (asyncEvents, initalParams) {
|
232
263
|
return void 0;
|
233
264
|
};
|
265
|
+
//#endregion
|
266
|
+
//#endregion
|
267
|
+
//#region private methods
|
234
268
|
//#region private methods / _init
|
235
269
|
BaseClientCompiler.prototype._init = function (options) {
|
236
|
-
|
237
|
-
|
238
|
-
}
|
239
|
-
if (!tnp_core_1._.isArray(options.subscribeOnlyFor)) {
|
270
|
+
//#region @backendFunc
|
271
|
+
if (!tnp_core_2._.isArray(options.subscribeOnlyFor)) {
|
240
272
|
options.subscribeOnlyFor = [];
|
241
273
|
}
|
242
|
-
if (
|
274
|
+
if (tnp_core_2._.isUndefined(options.folderPath)) {
|
243
275
|
options.folderPath = [];
|
244
276
|
}
|
245
|
-
if (
|
277
|
+
if (tnp_core_2._.isUndefined(options.folderPathContentCheck)) {
|
246
278
|
options.folderPathContentCheck = [];
|
247
279
|
}
|
248
|
-
if (
|
280
|
+
if (tnp_core_2._.isUndefined(options.ignoreFolderPatter)) {
|
249
281
|
options.ignoreFolderPatter = [];
|
250
282
|
}
|
251
|
-
if (
|
283
|
+
if (tnp_core_2._.isString(options.folderPath)) {
|
252
284
|
options.folderPath = [options.folderPath];
|
253
285
|
}
|
254
|
-
if (
|
286
|
+
if (tnp_core_2._.isString(options.folderPathContentCheck)) {
|
255
287
|
options.folderPathContentCheck = [options.folderPathContentCheck];
|
256
288
|
}
|
257
|
-
if (!
|
258
|
-
|
289
|
+
if (!tnp_core_2._.isString(options.folderPath) && !tnp_core_2._.isArray(options.folderPath)) {
|
290
|
+
tnp_core_3.Helpers.error("Folder path shoudl be string or array", false, true);
|
259
291
|
}
|
260
|
-
if (!
|
261
|
-
tnp_core_2.
|
292
|
+
if (!tnp_core_2._.isString(options.folderPathContentCheck) &&
|
293
|
+
!tnp_core_2._.isArray(options.folderPathContentCheck)) {
|
294
|
+
tnp_core_3.Helpers.error("Folder path shoudl be string or array", false, true);
|
262
295
|
}
|
263
|
-
if (
|
264
|
-
options.watchDepth = Number.POSITIVE_INFINITY;
|
265
|
-
}
|
266
|
-
if (tnp_core_1._.isNumber(options.watchDepth)) {
|
267
|
-
options.watchDepth = Math.abs(options.watchDepth);
|
268
|
-
}
|
269
|
-
if (tnp_core_1._.isUndefined(options.followSymlinks)) {
|
296
|
+
if (tnp_core_2._.isUndefined(options.followSymlinks)) {
|
270
297
|
options.followSymlinks = false;
|
271
298
|
}
|
272
|
-
if (
|
299
|
+
if (tnp_core_2._.isUndefined(options.notifyOnFileUnlink)) {
|
273
300
|
options.notifyOnFileUnlink = false;
|
274
301
|
}
|
275
302
|
// console.log('ASSIGNE', options)
|
276
303
|
Object.assign(this, options);
|
277
|
-
|
278
|
-
this.watchOptions.allowedExtEnable = allowedExtEnable;
|
279
|
-
var allowedExt = !allowedExtEnable ? [] : (this.allowedOnlyFileExt || []).map(function (ext) {
|
280
|
-
if (ext.startsWith('.')) {
|
281
|
-
return ext;
|
282
|
-
}
|
283
|
-
return ".".concat(ext);
|
284
|
-
});
|
285
|
-
this.watchOptions.allowedExt = allowedExt;
|
286
|
-
var addionalAllowedEnable = Array.isArray(this.additionallyAllowedFilesWithNames)
|
287
|
-
&& this.additionallyAllowedFilesWithNames.length > 0;
|
288
|
-
this.watchOptions.addionalAllowedEnable = addionalAllowedEnable;
|
289
|
-
var addionalAllowed = !addionalAllowedEnable ? [] : (this.additionallyAllowedFilesWithNames || []);
|
290
|
-
this.watchOptions.addionalAllowed = addionalAllowed;
|
304
|
+
//#endregion
|
291
305
|
};
|
292
306
|
//#endregion
|
293
307
|
//#region private methods / fix task name
|
294
308
|
BaseClientCompiler.prototype.fixTaskName = function (taskName) {
|
295
|
-
if (!
|
296
|
-
taskName = "task
|
309
|
+
if (!tnp_core_2._.isString(taskName)) {
|
310
|
+
taskName = "task \"".concat(this.taskName, "\"");
|
297
311
|
}
|
298
312
|
return taskName;
|
299
313
|
};
|
300
314
|
//#endregion
|
301
315
|
BaseClientCompiler.prototype.filesToWatch = function () {
|
316
|
+
var _this = this;
|
317
|
+
//#region @backendFunc
|
302
318
|
var folders = [];
|
303
319
|
// this.clients.forEach(c => {
|
304
320
|
[this].forEach(function (c) {
|
305
321
|
// console.log("c.folderPath", c.folderPath)
|
306
|
-
c.folderPath.forEach(function (
|
322
|
+
c.folderPath.forEach(function (folderPath) {
|
307
323
|
// console.log(`fp`, fp)
|
308
|
-
if (
|
309
|
-
var mapped =
|
324
|
+
if (tnp_core_2._.isString(folderPath) && !folders.includes(folderPath)) {
|
325
|
+
var mapped = _this.mapForWatching(folderPath);
|
310
326
|
folders.push.apply(folders, tslib_1.__spreadArray([], tslib_1.__read(mapped), false));
|
311
327
|
}
|
312
328
|
});
|
313
329
|
});
|
314
|
-
return
|
330
|
+
return tnp_core_2._.cloneDeep(folders);
|
331
|
+
//#endregion
|
332
|
+
};
|
333
|
+
BaseClientCompiler.prototype.mapForWatching = function (c) {
|
334
|
+
//#region @backendFunc
|
335
|
+
if (tnp_core_1.fse.existsSync(c) && tnp_core_1.fse.lstatSync(c).isDirectory()) {
|
336
|
+
return [c, "".concat(c, "/**/*.*")];
|
337
|
+
}
|
338
|
+
return [c];
|
339
|
+
//#endregion
|
315
340
|
};
|
316
341
|
return BaseClientCompiler;
|
317
342
|
}());
|
318
343
|
exports.BaseClientCompiler = BaseClientCompiler;
|
319
|
-
//# sourceMappingURL=base-client-compiler.
|
344
|
+
//# sourceMappingURL=base-client-compiler.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"base-client-compiler.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;;AAAA,iBAAiB;AACjB,kBAAkB;AAClB,qCAA+B;AAC/B,YAAY;AACZ,qCAAsD;AAEtD,uDAAqD;AAErD,qCAAmC;AACnC,qCAA+B;AAE/B,YAAY;AAEZ;IAkEE,YAAY;IAEZ,YAAY;IAEZ,qBAAqB;IACrB,kBAAkB;IAClB,4BAAY,OAA0C;QAnEtC,qBAAgB,GAA+B,EAAE,CAAC;QAKlE,kBAAkB;QACX,uBAAkB,GAAG,kBAAO,CAAC,kBAAkB,CAAC;QACvD,YAAY;QACJ,gBAAW,GAAY,KAAK,CAAC;QAC7B,sBAAiB,GAAG,KAAK,CAAC;QAC1B,iBAAY,GAAa,EAAE,CAAC;QAC7B,mBAAc,GAAa,EAAE,CAAC;QAC7B,4BAAuB,GAAa,EAAE,CAAC;QAC/C,uBAAkB,GAAY,KAAK,CAAC;QA4FpC,YAAY;QA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,IAAI,CAAC,CAAC,OAAO,CAAC,UAAA,CAAC;YACd,4CAA4C;YAC5C,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,UAAA,UAAU;gBAC7B,wBAAwB;gBACxB,IAAI,YAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;oBAC5D,IAAM,MAAM,GAAG,KAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;oBAC/C,OAAO,CAAC,IAAI,OAAZ,OAAO,2CAAS,MAAM,WAAE;gBAC1B,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,OAAO,YAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAC5B,YAAY;IACd,CAAC;IAEO,2CAAc,GAAtB,UAAuB,CAAS;QAC9B,sBAAsB;QACtB,IAAI,cAAG,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,cAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;YACxD,OAAO,CAAC,CAAC,EAAE,UAAG,CAAC,YAAS,CAAC,CAAC;QAC5B,CAAC;QACD,OAAO,CAAC,CAAC,CAAC,CAAC;QACX,YAAY;IACd,CAAC;IAGH,yBAAC;AAAD,CAAC,AA/UD,IA+UC;AA/UY,gDAAkB"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { CoreModels } from 'tnp-core/src';
|
2
|
+
export declare class ChangeOfFile {
|
3
|
+
fileAbsolutePath: string;
|
4
|
+
readonly eventName: 'add' | 'change' | 'unlink' | 'unlinkDir';
|
5
|
+
readonly datetime: Date;
|
6
|
+
constructor(fileAbsolutePath?: string, eventName?: 'add' | 'change' | 'unlink' | 'unlinkDir');
|
7
|
+
get fileExt(): CoreModels.FileExtension;
|
8
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ChangeOfFile = void 0;
|
4
|
+
//#region imports
|
5
|
+
var tnp_core_1 = require("tnp-core");
|
6
|
+
//#endregion
|
7
|
+
var ChangeOfFile = /** @class */ (function () {
|
8
|
+
function ChangeOfFile(fileAbsolutePath, eventName) {
|
9
|
+
if (fileAbsolutePath === void 0) { fileAbsolutePath = void 0; }
|
10
|
+
if (eventName === void 0) { eventName = void 0; }
|
11
|
+
this.fileAbsolutePath = fileAbsolutePath;
|
12
|
+
this.eventName = eventName;
|
13
|
+
this.datetime = new Date();
|
14
|
+
}
|
15
|
+
Object.defineProperty(ChangeOfFile.prototype, "fileExt", {
|
16
|
+
get: function () {
|
17
|
+
return tnp_core_1.path
|
18
|
+
.extname(this.fileAbsolutePath)
|
19
|
+
.replace('.', '');
|
20
|
+
},
|
21
|
+
enumerable: false,
|
22
|
+
configurable: true
|
23
|
+
});
|
24
|
+
return ChangeOfFile;
|
25
|
+
}());
|
26
|
+
exports.ChangeOfFile = ChangeOfFile;
|
27
|
+
//# sourceMappingURL=change-of-file.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"change-of-file.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAAA,iBAAiB;AACjB,qCAAmC;AAEnC,YAAY;AAEZ;IAGE,sBACS,gBAAiC,EACxB,SAIQ;QALjB,iCAAA,EAAA,wBAAgC,CAAC;QACxB,0BAAA,EAAA,iBAIO,CAAC;QALjB,qBAAgB,GAAhB,gBAAgB,CAAiB;QACxB,cAAS,GAAT,SAAS,CAID;QAExB,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC;IAC7B,CAAC;IAED,sBAAW,iCAAO;aAAlB;YACE,OAAO,eAAI;iBACR,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC;iBAC9B,OAAO,CAAC,GAAG,EAAE,EAAE,CAA6B,CAAC;QAClD,CAAC;;;OAAA;IACH,mBAAC;AAAD,CAAC,AAnBD,IAmBC;AAnBY,oCAAY"}
|
@@ -1,26 +1,16 @@
|
|
1
|
-
import {
|
2
|
-
import { BaseClientCompiler } from './base-client-compiler.backend';
|
1
|
+
import { BaseClientCompiler } from './base-client-compiler';
|
3
2
|
export declare class CompilerManager {
|
4
3
|
private static _instance;
|
5
4
|
static get Instance(): CompilerManager;
|
6
|
-
private watchers;
|
7
|
-
private currentObservedFolder;
|
8
5
|
private clients;
|
9
6
|
private asyncEventScenario;
|
10
7
|
private inited;
|
11
8
|
private filesContentCache;
|
12
|
-
get allClients(): {
|
13
|
-
get<T = BaseClientCompiler<any>>(clientNameOrClass: string | Function, condition: (c: T) => boolean): BaseClientCompiler<any>[] | T[];
|
14
|
-
};
|
15
9
|
private constructor();
|
16
10
|
syncInit(client: BaseClientCompiler<any>, initalParams: any): Promise<void>;
|
17
11
|
asyncInit(client: BaseClientCompiler<any>, initialParams: any): Promise<void>;
|
18
12
|
private actionForAsyncEvent;
|
19
13
|
addClient(client: BaseClientCompiler<any>): void;
|
20
|
-
/**
|
21
|
-
* @deprecated
|
22
|
-
*/
|
23
|
-
initScenario(onAsyncFileChange?: (event: ChangeOfFile) => Promise<any>): Promise<void>;
|
24
14
|
private preventAlreadyInited;
|
25
15
|
private fileShouldBeChecked;
|
26
16
|
}
|