incremental-compiler 20.0.0 → 21.0.3
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 +45 -4
- package/assets/shared/shared_folder_info.txt +3 -3
- package/browser/fesm2022/incremental-compiler.mjs +56 -108
- package/browser/fesm2022/incremental-compiler.mjs.map +1 -1
- package/browser/lib/base-client-compiler.d.ts +15 -18
- package/browser/lib/compiler-manager.d.ts +3 -5
- package/browser/lib/constants.d.ts +0 -2
- package/browser/lib/helpers.d.ts +13 -0
- package/browser/lib/incremental-watcher.d.ts +4 -0
- package/browser/lib/index.d.ts +2 -22
- package/browser/lib/models.d.ts +65 -36
- package/browser/lib/parcel-watcher-adapter.d.ts +31 -0
- package/browser/package.json +13 -0
- package/index.js.map +1 -1
- package/lib/base-client-compiler.backend.js.map +1 -1
- package/lib/base-client-compiler.d.ts +17 -21
- package/lib/base-client-compiler.js +90 -108
- package/lib/base-client-compiler.js.map +1 -1
- package/lib/build-info._auto-generated_.d.ts +19 -0
- package/lib/build-info._auto-generated_.js +22 -1
- package/lib/build-info._auto-generated_.js.map +1 -1
- package/lib/change-of-file.backend.js.map +1 -1
- package/lib/change-of-file.d.ts +1 -1
- package/lib/change-of-file.js +2 -2
- package/lib/change-of-file.js.map +1 -1
- package/lib/compiler-manager.backend.js.map +1 -1
- package/lib/compiler-manager.d.ts +0 -2
- package/lib/compiler-manager.js +38 -64
- package/lib/compiler-manager.js.map +1 -1
- package/lib/constants.d.ts +0 -2
- package/lib/constants.js +1 -12
- package/lib/constants.js.map +1 -1
- package/lib/decorators.backend.js.map +1 -1
- package/lib/env/env.angular-node-app.d.ts +63 -0
- package/lib/env/env.angular-node-app.js +70 -0
- package/lib/env/env.angular-node-app.js.map +1 -0
- package/lib/env/env.docs-webapp.d.ts +63 -0
- package/lib/env/env.docs-webapp.js +70 -0
- package/lib/env/env.docs-webapp.js.map +1 -0
- package/lib/env/env.electron-app.d.ts +63 -0
- package/lib/env/env.electron-app.js +70 -0
- package/lib/env/env.electron-app.js.map +1 -0
- package/lib/env/env.mobile-app.d.ts +63 -0
- package/lib/env/env.mobile-app.js +70 -0
- package/lib/env/env.mobile-app.js.map +1 -0
- package/lib/env/env.npm-lib-and-cli-tool.d.ts +63 -0
- package/lib/env/env.npm-lib-and-cli-tool.js +70 -0
- package/lib/env/env.npm-lib-and-cli-tool.js.map +1 -0
- package/lib/env/env.vscode-plugin.d.ts +63 -0
- package/lib/env/env.vscode-plugin.js +70 -0
- package/lib/env/env.vscode-plugin.js.map +1 -0
- package/lib/env/index.d.ts +6 -0
- package/lib/env/index.js +23 -0
- package/lib/env/index.js.map +1 -0
- package/lib/helpers.backend.js.map +1 -1
- package/lib/helpers.d.ts +12 -0
- package/lib/helpers.js +108 -0
- package/lib/helpers.js.map +1 -0
- package/lib/incremental-watcher/incremental-watcher-events.d.ts +5 -0
- package/lib/incremental-watcher/incremental-watcher-events.js.map +1 -1
- package/lib/incremental-watcher/incremental-watcher-instance.js.map +1 -1
- package/lib/incremental-watcher/incremental-watcher-options.js.map +1 -1
- package/lib/incremental-watcher/incremental-watcher.js +8 -21
- package/lib/incremental-watcher/incremental-watcher.js.map +1 -1
- package/lib/incremental-watcher/index.js.map +1 -1
- package/lib/incremental-watcher/parcel-watcher-adapter.backend.d.ts +7 -5
- package/lib/incremental-watcher/parcel-watcher-adapter.backend.js +125 -55
- package/lib/incremental-watcher/parcel-watcher-adapter.backend.js.map +1 -1
- package/lib/incremental-watcher.d.ts +3 -0
- package/lib/incremental-watcher.js +30 -0
- package/lib/incremental-watcher.js.map +1 -0
- package/lib/index._auto-generated_.js +2 -2
- package/lib/index._auto-generated_.js.map +1 -1
- package/lib/index.d.ts +1 -21
- package/lib/index.js +2 -23
- package/lib/index.js.map +1 -1
- package/lib/models.d.ts +65 -36
- package/lib/models.js.map +1 -1
- package/lib/parcel-watcher-adapter.d.ts +30 -0
- package/lib/parcel-watcher-adapter.js +300 -0
- package/lib/parcel-watcher-adapter.js.map +1 -0
- package/migrations/index.js.map +1 -1
- package/migrations/migrations_index._auto-generated_.js.map +1 -1
- package/package.json +30 -6
- package/package.json_devDependencies.json +216 -0
- package/package.json_tnp.json5 +58 -0
- package/scss/global.scss +44 -0
- package/scss/index.scss +2 -0
- package/scss/lib/index.scss +1 -0
- package/scss/vars.scss +7 -0
- package/src.d.ts +3 -3
- package/tmp-environment.json +15 -7
- package/websql/fesm2022/incremental-compiler.mjs +56 -108
- package/websql/fesm2022/incremental-compiler.mjs.map +1 -1
- package/websql/lib/base-client-compiler.d.ts +15 -18
- package/websql/lib/compiler-manager.d.ts +3 -5
- package/websql/lib/constants.d.ts +0 -2
- package/websql/lib/helpers.d.ts +13 -0
- package/websql/lib/incremental-watcher.d.ts +4 -0
- package/websql/lib/index.d.ts +2 -22
- package/websql/lib/models.d.ts +65 -36
- package/websql/lib/parcel-watcher-adapter.d.ts +31 -0
- package/websql/package.json +13 -0
- package/browser/esm2022/incremental-compiler.mjs +0 -5
- package/browser/esm2022/lib/base-client-compiler.mjs +0 -269
- package/browser/esm2022/lib/change-of-file.mjs +0 -16
- package/browser/esm2022/lib/compiler-manager.mjs +0 -197
- package/browser/esm2022/lib/constants.mjs +0 -20
- package/browser/esm2022/lib/incremental-watcher/incremental-watcher-events.mjs +0 -4
- package/browser/esm2022/lib/incremental-watcher/incremental-watcher-instance.mjs +0 -4
- package/browser/esm2022/lib/incremental-watcher/incremental-watcher-options.mjs +0 -4
- package/browser/esm2022/lib/incremental-watcher/incremental-watcher.mjs +0 -49
- package/browser/esm2022/lib/incremental-watcher/index.mjs +0 -6
- package/browser/esm2022/lib/index.mjs +0 -26
- package/browser/esm2022/lib/models.mjs +0 -4
- package/browser/esm2022/public-api.mjs +0 -2
- package/browser/lib/change-of-file.d.ts +0 -9
- package/browser/lib/incremental-watcher/incremental-watcher-events.d.ts +0 -6
- package/browser/lib/incremental-watcher/incremental-watcher-instance.d.ts +0 -7
- package/browser/lib/incremental-watcher/incremental-watcher-options.d.ts +0 -10
- package/browser/lib/incremental-watcher/incremental-watcher.d.ts +0 -4
- package/browser/lib/incremental-watcher/index.d.ts +0 -4
- package/client/README.md +0 -24
- package/client/esm2022/incremental-compiler.mjs +0 -5
- package/client/esm2022/lib/base-client-compiler.mjs +0 -269
- package/client/esm2022/lib/change-of-file.mjs +0 -16
- package/client/esm2022/lib/compiler-manager.mjs +0 -197
- package/client/esm2022/lib/constants.mjs +0 -20
- package/client/esm2022/lib/incremental-watcher/incremental-watcher-events.mjs +0 -4
- package/client/esm2022/lib/incremental-watcher/incremental-watcher-instance.mjs +0 -4
- package/client/esm2022/lib/incremental-watcher/incremental-watcher-options.mjs +0 -4
- package/client/esm2022/lib/incremental-watcher/incremental-watcher.mjs +0 -49
- package/client/esm2022/lib/incremental-watcher/index.mjs +0 -6
- package/client/esm2022/lib/index.mjs +0 -26
- package/client/esm2022/lib/models.mjs +0 -4
- package/client/esm2022/public-api.mjs +0 -2
- package/client/fesm2022/incremental-compiler.mjs +0 -379
- package/client/fesm2022/incremental-compiler.mjs.map +0 -1
- package/client/index.d.ts +0 -6
- package/client/lib/base-client-compiler.d.ts +0 -56
- package/client/lib/change-of-file.d.ts +0 -9
- package/client/lib/compiler-manager.d.ts +0 -17
- package/client/lib/constants.d.ts +0 -4
- package/client/lib/incremental-watcher/incremental-watcher-events.d.ts +0 -6
- package/client/lib/incremental-watcher/incremental-watcher-instance.d.ts +0 -7
- package/client/lib/incremental-watcher/incremental-watcher-options.d.ts +0 -10
- package/client/lib/incremental-watcher/incremental-watcher.d.ts +0 -4
- package/client/lib/incremental-watcher/index.d.ts +0 -4
- package/client/lib/index.d.ts +0 -25
- package/client/lib/models.d.ts +0 -39
- package/client/public-api.d.ts +0 -2
- package/taon.jsonc +0 -26
- package/websql/esm2022/incremental-compiler.mjs +0 -5
- package/websql/esm2022/lib/base-client-compiler.mjs +0 -269
- package/websql/esm2022/lib/change-of-file.mjs +0 -16
- package/websql/esm2022/lib/compiler-manager.mjs +0 -197
- package/websql/esm2022/lib/constants.mjs +0 -20
- package/websql/esm2022/lib/incremental-watcher/incremental-watcher-events.mjs +0 -4
- package/websql/esm2022/lib/incremental-watcher/incremental-watcher-instance.mjs +0 -4
- package/websql/esm2022/lib/incremental-watcher/incremental-watcher-options.mjs +0 -4
- package/websql/esm2022/lib/incremental-watcher/incremental-watcher.mjs +0 -49
- package/websql/esm2022/lib/incremental-watcher/index.mjs +0 -6
- package/websql/esm2022/lib/index.mjs +0 -26
- package/websql/esm2022/lib/models.mjs +0 -4
- package/websql/esm2022/public-api.mjs +0 -2
- package/websql/lib/change-of-file.d.ts +0 -9
- package/websql/lib/incremental-watcher/incremental-watcher-events.d.ts +0 -6
- package/websql/lib/incremental-watcher/incremental-watcher-instance.d.ts +0 -7
- package/websql/lib/incremental-watcher/incremental-watcher-options.d.ts +0 -10
- package/websql/lib/incremental-watcher/incremental-watcher.d.ts +0 -4
- package/websql/lib/incremental-watcher/index.d.ts +0 -4
package/README.md
CHANGED
|
@@ -1,9 +1,50 @@
|
|
|
1
1
|
# INCREMENTAL COMPILER
|
|
2
2
|
|
|
3
|
-
A library for any kind of incremental compilers and file watchers, based on
|
|
3
|
+
A library for any kind of incremental compilers and file watchers, based on @parcel/watcher and chokidar.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## API
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
After calling this function for each file, you set up watchers on those files. For each change in a file in "src," the function is called again for that particular file.
|
|
7
|
+
1. Incremental Compiler class **"IncCompiler"**
|
|
9
8
|
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { BaseClientCompiler, BaseClientCompilerOptions } from 'incremental-compiler/src';
|
|
12
|
+
|
|
13
|
+
export abstract class BaseCompilerForProject<
|
|
14
|
+
ADDITIONAL_DATA = any,
|
|
15
|
+
PROJECT extends BaseProject = BaseProject,
|
|
16
|
+
> extends BaseClientCompiler<ADDITIONAL_DATA> {
|
|
17
|
+
|
|
18
|
+
constructor(
|
|
19
|
+
public project: PROJECT,
|
|
20
|
+
options: BaseClientCompilerOptions,
|
|
21
|
+
) {
|
|
22
|
+
super();
|
|
23
|
+
this.initOptions(options);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
2. Incremental watcher object **"incrementalWatcher"**
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import { incrementalWatcher } from 'incremental-compiler/src';
|
|
31
|
+
const watcher = await incrementalWatcher(
|
|
32
|
+
[
|
|
33
|
+
this.project.pathFor(`environments/**/*.ts`),
|
|
34
|
+
this.project.pathFor(`env.ts`),
|
|
35
|
+
],
|
|
36
|
+
{
|
|
37
|
+
name: 'Environment Config Watcher',
|
|
38
|
+
ignoreInitial: true,
|
|
39
|
+
followSymlinks: false,
|
|
40
|
+
},
|
|
41
|
+
);
|
|
42
|
+
watcher.on('all', async (event, filePath) => {
|
|
43
|
+
onChange();
|
|
44
|
+
});
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Folders ALWAYS ignored
|
|
48
|
+
|
|
49
|
+
- node_modules/
|
|
50
|
+
- .git/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
THIS FILE IS GENERATED
|
|
1
|
+
THIS FILE IS GENERATED - DO NOT MODIFY
|
|
2
2
|
|
|
3
|
-
Assets from this folder are being shipped with this npm package (incremental-compiler
|
|
3
|
+
Assets from this folder are being shipped with this npm package (incremental-compiler)
|
|
4
4
|
created from this project.
|
|
5
5
|
|
|
6
|
-
THIS FILE IS GENERATED
|
|
6
|
+
THIS FILE IS GENERATED - DO NOT MODIFY
|
|
7
7
|
|
|
@@ -1,54 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ } from 'tnp-core/browser';
|
|
2
2
|
|
|
3
|
-
class ChangeOfFile {
|
|
4
|
-
constructor(fileAbsolutePath = void 0, eventName = void 0) {
|
|
5
|
-
this.fileAbsolutePath = fileAbsolutePath;
|
|
6
|
-
this.eventName = eventName;
|
|
7
|
-
this.datetime = new Date();
|
|
8
|
-
}
|
|
9
|
-
get fileExt() {
|
|
10
|
-
return path
|
|
11
|
-
.extname(this.fileAbsolutePath)
|
|
12
|
-
.replace('.', '');
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
;
|
|
16
|
-
({}); // @--end-of-file-for-module=incremental-compiler lib/change-of-file.ts
|
|
17
|
-
|
|
18
|
-
let COMPILER_POOLING = {};
|
|
19
3
|
const IGNORE_BY_DEFAULT = [
|
|
20
4
|
'**/node_modules/**/*.*',
|
|
21
5
|
'**/node_modules',
|
|
22
6
|
'**/.git/**/*.*',
|
|
23
7
|
'**/.git',
|
|
24
8
|
];
|
|
25
|
-
;
|
|
26
|
-
({}); // @--end-of-file-for-module=incremental-compiler lib/constants.ts
|
|
27
|
-
|
|
28
|
-
;
|
|
29
|
-
({}); // @--end-of-file-for-module=incremental-compiler lib/incremental-watcher/incremental-watcher-instance.ts
|
|
30
9
|
|
|
31
|
-
|
|
32
|
-
(
|
|
33
|
-
|
|
34
|
-
/* */
|
|
35
|
-
/* */
|
|
36
|
-
/* */
|
|
37
|
-
/* */
|
|
38
|
-
async function incrementalWatcher(filePath, watchOptions) {
|
|
39
|
-
/* */
|
|
40
|
-
/* */
|
|
41
|
-
/* */
|
|
42
|
-
/* */
|
|
43
|
-
/* */
|
|
44
|
-
/* */
|
|
45
|
-
/* */
|
|
46
|
-
/* */
|
|
47
|
-
/* */
|
|
48
|
-
/* */
|
|
49
|
-
/* */
|
|
50
|
-
/* */
|
|
51
|
-
/* */
|
|
10
|
+
//#endregion
|
|
11
|
+
function incrementalWatcher(filesFolderPathOrPatternsToWatch, watchOptions) {
|
|
52
12
|
/* */
|
|
53
13
|
/* */
|
|
54
14
|
/* */
|
|
@@ -77,41 +37,29 @@ async function incrementalWatcher(filePath, watchOptions) {
|
|
|
77
37
|
/* */
|
|
78
38
|
return (void 0);
|
|
79
39
|
}
|
|
80
|
-
;
|
|
81
|
-
({}); // @--end-of-file-for-module=incremental-compiler lib/incremental-watcher/incremental-watcher.ts
|
|
82
40
|
|
|
83
|
-
|
|
84
|
-
({}); // @--end-of-file-for-module=incremental-compiler lib/incremental-watcher/index.ts
|
|
85
|
-
|
|
86
|
-
/* */
|
|
41
|
+
//#region imports
|
|
87
42
|
/* */
|
|
43
|
+
//#endregion
|
|
88
44
|
class BaseClientCompiler {
|
|
89
45
|
constructor() {
|
|
90
46
|
this.subscribeOnlyFor = [];
|
|
91
|
-
|
|
92
|
-
/* */
|
|
47
|
+
this.onlySingleRun = true;
|
|
93
48
|
this.pathResolve = false;
|
|
94
|
-
this.
|
|
49
|
+
this.isInitedWithOptions = false;
|
|
95
50
|
this.__folderPath = [];
|
|
96
51
|
this.lastAsyncFiles = [];
|
|
97
|
-
this._folderPathContentCheck = [];
|
|
98
52
|
this.isWatchCompilation = false;
|
|
99
|
-
this.
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return this.initedWithOptions;
|
|
103
|
-
}
|
|
104
|
-
get folderPathContentCheck() {
|
|
105
|
-
return this._folderPathContentCheck;
|
|
106
|
-
}
|
|
107
|
-
set folderPathContentCheck(v) {
|
|
108
|
-
this._folderPathContentCheck = v;
|
|
53
|
+
this.folderPathContentCheck = [];
|
|
54
|
+
//#endregion
|
|
55
|
+
//#endregion
|
|
109
56
|
}
|
|
110
57
|
set folderPath(v) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
58
|
+
/* */
|
|
59
|
+
/* */
|
|
60
|
+
/* */
|
|
61
|
+
/* */
|
|
62
|
+
/* */
|
|
115
63
|
}
|
|
116
64
|
get folderPath() {
|
|
117
65
|
/* */
|
|
@@ -133,6 +81,11 @@ class BaseClientCompiler {
|
|
|
133
81
|
/* */
|
|
134
82
|
return (void 0);
|
|
135
83
|
}
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region constructor
|
|
86
|
+
/* */
|
|
87
|
+
/* */
|
|
88
|
+
/* */
|
|
136
89
|
/* */
|
|
137
90
|
/* */
|
|
138
91
|
/* */
|
|
@@ -145,6 +98,10 @@ class BaseClientCompiler {
|
|
|
145
98
|
/* */
|
|
146
99
|
/* */
|
|
147
100
|
/* */
|
|
101
|
+
/* */
|
|
102
|
+
/* */
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region init options
|
|
148
105
|
/**
|
|
149
106
|
* manually init options (when no passing object to constructor super() )
|
|
150
107
|
*/
|
|
@@ -164,10 +121,10 @@ class BaseClientCompiler {
|
|
|
164
121
|
/* */
|
|
165
122
|
/* */
|
|
166
123
|
/* */
|
|
167
|
-
/* */
|
|
168
|
-
/* */
|
|
169
124
|
return (void 0);
|
|
170
125
|
}
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region run task
|
|
171
128
|
/**
|
|
172
129
|
* do not override this
|
|
173
130
|
*/
|
|
@@ -180,8 +137,11 @@ class BaseClientCompiler {
|
|
|
180
137
|
/* */
|
|
181
138
|
/* */
|
|
182
139
|
/* */
|
|
140
|
+
/* */
|
|
183
141
|
return (void 0);
|
|
184
142
|
}
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region start
|
|
185
145
|
/**
|
|
186
146
|
* @deprecated use runTask instead
|
|
187
147
|
* Do not override this
|
|
@@ -219,6 +179,8 @@ class BaseClientCompiler {
|
|
|
219
179
|
/* */
|
|
220
180
|
return (void 0);
|
|
221
181
|
}
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region start and watch
|
|
222
184
|
/**
|
|
223
185
|
* @deprecated use runTask instead
|
|
224
186
|
* Do not override this
|
|
@@ -265,6 +227,8 @@ class BaseClientCompiler {
|
|
|
265
227
|
/* */
|
|
266
228
|
return (void 0);
|
|
267
229
|
}
|
|
230
|
+
//#endregion
|
|
231
|
+
//#region sync action
|
|
268
232
|
/**
|
|
269
233
|
*
|
|
270
234
|
* @param absolteFilesPathes for each watched file
|
|
@@ -273,11 +237,17 @@ class BaseClientCompiler {
|
|
|
273
237
|
syncAction(absolteFilesPathes, initialParams) {
|
|
274
238
|
return void 0;
|
|
275
239
|
}
|
|
240
|
+
//#endregion
|
|
241
|
+
//#region pre async action
|
|
276
242
|
async preAsyncAction(initialParams) { }
|
|
243
|
+
//#endregion
|
|
244
|
+
//#region async action
|
|
277
245
|
asyncAction(asyncEvents, initialParams) {
|
|
278
246
|
return void 0;
|
|
279
247
|
}
|
|
280
|
-
|
|
248
|
+
//#endregion
|
|
249
|
+
//#region get files to watch
|
|
250
|
+
getFilesFolderPatternsToWatch() {
|
|
281
251
|
/* */
|
|
282
252
|
/* */
|
|
283
253
|
/* */
|
|
@@ -293,6 +263,12 @@ class BaseClientCompiler {
|
|
|
293
263
|
/* */
|
|
294
264
|
/* */
|
|
295
265
|
/* */
|
|
266
|
+
return (void 0);
|
|
267
|
+
}
|
|
268
|
+
//#endregion
|
|
269
|
+
//#region private methods
|
|
270
|
+
//#region private methods / fix and assign options
|
|
271
|
+
fixAndAssignOptions(options) {
|
|
296
272
|
/* */
|
|
297
273
|
/* */
|
|
298
274
|
/* */
|
|
@@ -313,16 +289,6 @@ class BaseClientCompiler {
|
|
|
313
289
|
/* */
|
|
314
290
|
/* */
|
|
315
291
|
/* */
|
|
316
|
-
/* */
|
|
317
|
-
return (void 0);
|
|
318
|
-
}
|
|
319
|
-
fixTaskName(taskName) {
|
|
320
|
-
if (!_.isString(taskName)) {
|
|
321
|
-
taskName = `task "${this.taskName}"`;
|
|
322
|
-
}
|
|
323
|
-
return taskName;
|
|
324
|
-
}
|
|
325
|
-
filesToWatch() {
|
|
326
292
|
/* */
|
|
327
293
|
/* */
|
|
328
294
|
/* */
|
|
@@ -334,12 +300,6 @@ class BaseClientCompiler {
|
|
|
334
300
|
/* */
|
|
335
301
|
/* */
|
|
336
302
|
/* */
|
|
337
|
-
/* */
|
|
338
|
-
/* */
|
|
339
|
-
/* */
|
|
340
|
-
return (void 0);
|
|
341
|
-
}
|
|
342
|
-
mapForWatching(c) {
|
|
343
303
|
/* */
|
|
344
304
|
/* */
|
|
345
305
|
/* */
|
|
@@ -347,33 +307,21 @@ class BaseClientCompiler {
|
|
|
347
307
|
/* */
|
|
348
308
|
return (void 0);
|
|
349
309
|
}
|
|
310
|
+
//#endregion
|
|
311
|
+
//#region private methods / fix task name
|
|
312
|
+
fixTaskName(taskName) {
|
|
313
|
+
if (!_.isString(taskName)) {
|
|
314
|
+
taskName = `task "${this.taskName}"`;
|
|
315
|
+
}
|
|
316
|
+
return taskName;
|
|
317
|
+
}
|
|
350
318
|
}
|
|
351
|
-
;
|
|
352
|
-
({}); // @--end-of-file-for-module=incremental-compiler lib/base-client-compiler.ts
|
|
353
319
|
|
|
354
|
-
|
|
355
|
-
* Template for watcher client:
|
|
356
|
-
* // @ts-ignore
|
|
357
|
-
* import { IncCompiler } from '../lib';
|
|
358
|
-
*
|
|
359
|
-
* export class TestWatcher extends IncCompiler.Base {
|
|
360
|
-
*
|
|
361
|
-
* syncAction(files = []) { }
|
|
362
|
-
* preAsyncAction() { }
|
|
363
|
-
* asyncAction(change: IncCompiler.Change, additionalData:any ) { }
|
|
364
|
-
* }
|
|
365
|
-
*/
|
|
366
|
-
var IncCompiler;
|
|
367
|
-
(function (IncCompiler) {
|
|
368
|
-
IncCompiler.Base = BaseClientCompiler;
|
|
369
|
-
IncCompiler.Change = ChangeOfFile;
|
|
370
|
-
})(IncCompiler || (IncCompiler = {}));
|
|
371
|
-
;
|
|
372
|
-
({}); // @--end-of-file-for-module=incremental-compiler lib/index.ts
|
|
320
|
+
/* */
|
|
373
321
|
|
|
374
322
|
/**
|
|
375
323
|
* Generated bundle index. Do not edit.
|
|
376
324
|
*/
|
|
377
325
|
|
|
378
|
-
export { BaseClientCompiler,
|
|
326
|
+
export { BaseClientCompiler, IGNORE_BY_DEFAULT, incrementalWatcher };
|
|
379
327
|
//# sourceMappingURL=incremental-compiler.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"incremental-compiler.mjs","sources":["../../../tmp-libs-for-dist/incremental-compiler/projects/incremental-compiler/src/lib/change-of-file.ts","../../../tmp-libs-for-dist/incremental-compiler/projects/incremental-compiler/src/lib/constants.ts","../../../tmp-libs-for-dist/incremental-compiler/projects/incremental-compiler/src/lib/incremental-watcher/incremental-watcher-instance.ts","../../../tmp-libs-for-dist/incremental-compiler/projects/incremental-compiler/src/lib/incremental-watcher/incremental-watcher-options.ts","../../../tmp-libs-for-dist/incremental-compiler/projects/incremental-compiler/src/lib/incremental-watcher/incremental-watcher.ts","../../../tmp-libs-for-dist/incremental-compiler/projects/incremental-compiler/src/lib/incremental-watcher/index.ts","../../../tmp-libs-for-dist/incremental-compiler/projects/incremental-compiler/src/lib/base-client-compiler.ts","../../../tmp-libs-for-dist/incremental-compiler/projects/incremental-compiler/src/lib/index.ts","../../../tmp-libs-for-dist/incremental-compiler/projects/incremental-compiler/src/incremental-compiler.ts"],"sourcesContent":["\n\n\nimport { path, _ } from 'tnp-core/browser';\nimport { CoreModels } from 'tnp-core/browser';\n\n\nexport class ChangeOfFile {\n public readonly datetime: Date;\n\n constructor(\n public fileAbsolutePath: string = void 0,\n public readonly eventName:\n | 'add'\n | 'change'\n | 'unlink'\n | 'unlinkDir' = void 0,\n ) {\n this.datetime = new Date();\n }\n\n public get fileExt(): CoreModels.FileExtension {\n return path\n .extname(this.fileAbsolutePath)\n .replace('.', '') as CoreModels.FileExtension;\n }\n}\n\n ;({}); // @--end-of-file-for-module=incremental-compiler lib/change-of-file.ts","\n\n\n\n let COMPILER_POOLING = {};\n\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n \n\nexport {COMPILER_POOLING};\n\n\nexport const IGNORE_BY_DEFAULT = [\n '**/node_modules/**/*.*',\n '**/node_modules',\n '**/.git/**/*.*',\n '**/.git',\n];\n\n ;({}); // @--end-of-file-for-module=incremental-compiler lib/constants.ts","\n\nimport { IncrementalWatcherAllEvents, ListenerForAll, ListenerForSingleEvent } from \"./incremental-watcher-events\";/* */\n/* */\n/* */\n\n\n\nexport interface IncrementalWatcherInstance {\n add(paths: string | ReadonlyArray<string>): void;\n on(event: 'all', listener: ListenerForAll): this;\n\n on(event: IncrementalWatcherAllEvents, listener: ListenerForSingleEvent): this;\n}\n\n ;({}); // @--end-of-file-for-module=incremental-compiler lib/incremental-watcher/incremental-watcher-instance.ts","\n\nimport { WatchOptions } from 'chokidar';\nimport { Matcher } from 'anymatch';\n\nexport interface IncrementalWatcherOptions {\n cwd?: string;\n ignored?: Matcher;\n ignoreInitial?: boolean;\n followSymlinks?: boolean;\n name: string;\n engine?: 'chokidar' | '@parcel/watcher'\n}\n\n ;({}); // @--end-of-file-for-module=incremental-compiler lib/incremental-watcher/incremental-watcher-options.ts","\n\nimport { _, path, frameworkName, Helpers } from 'tnp-core/browser';\nimport { IncrementalWatcherInstance } from './incremental-watcher-instance';\nimport { IncrementalWatcherOptions } from './incremental-watcher-options';\n/* */\n/* */\n/* */\n/* */\n \n\nexport async function incrementalWatcher(\n filePath: string | string[],\n watchOptions: IncrementalWatcherOptions,\n): Promise<IncrementalWatcherInstance> {\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n return (void 0);\n}\n\n ;({}); // @--end-of-file-for-module=incremental-compiler lib/incremental-watcher/incremental-watcher.ts","\n\nexport * from './incremental-watcher-instance';\nexport * from './incremental-watcher-options';\nexport * from './incremental-watcher';\n\n ;({}); // @--end-of-file-for-module=incremental-compiler lib/incremental-watcher/index.ts","\n\n\n/* */\n/* */\n \nimport { path, _, crossPlatformPath } from 'tnp-core/browser';\nimport { ChangeOfFile } from './change-of-file';\nimport { CompilerManager } from './compiler-manager';\nimport { Models } from './models';\nimport { Helpers } from 'tnp-core/browser';\nimport { CLI } from 'tnp-core/browser';\nimport { CoreModels } from 'tnp-core/browser';\n\n\nexport class BaseClientCompiler<INITIAL_PARAMS = any>\n implements Models.BaseClientCompilerOptions\n{\n\n public readonly followSymlinks: boolean;\n public readonly subscribeOnlyFor: CoreModels.FileExtension[] = [];\n public readonly executeOutsideScenario: boolean;\n public readonly taskName: string;\n public ignoreFolderPatter?: string[];\n public readonly notifyOnFileUnlink: boolean;\n/* */\n/* */\n \n private pathResolve: boolean = false;\n private initedWithOptions = false;\n private __folderPath: string[] = [];\n public lastAsyncFiles: string[] = [];\n private _folderPathContentCheck: string[] = [];\n isWatchCompilation: boolean = false;\n\n\n\n\n\n\n get isInited() {\n return this.initedWithOptions;\n }\n\n\n\n get folderPathContentCheck() {\n return this._folderPathContentCheck;\n }\n private set folderPathContentCheck(v) {\n this._folderPathContentCheck = v;\n }\n\n\n\n public set folderPath(v) {\n if (_.isString(v)) {\n v = [v];\n }\n this.__folderPath = v;\n }\n public get folderPath(): string[] {\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n return (void 0);\n }\n\n\n\n\n\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n \n\n\n\n /**\n * manually init options (when no passing object to constructor super() )\n */\n protected initOptions(options?: Models.BaseClientCompilerOptions) {\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n return (void 0);\n }\n\n\n protected onlySingleRun = true;\n\n\n /**\n * do not override this\n */\n async runTask(\n options?: { watch?: boolean } & Models.StartAndWatchOptions<INITIAL_PARAMS>,\n ): Promise<BaseClientCompiler<INITIAL_PARAMS>> {\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n return (void 0);\n }\n\n\n /**\n * @deprecated use runTask instead\n * Do not override this\n */\n public async start(\n options?: Models.StartOptions<INITIAL_PARAMS>,\n ): Promise<BaseClientCompiler<INITIAL_PARAMS>> {\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n return (void 0);\n }\n\n\n\n /**\n * @deprecated use runTask instead\n * Do not override this\n */\n public async startAndWatch(\n options?: Models.StartAndWatchOptions<INITIAL_PARAMS>,\n ): Promise<BaseClientCompiler<INITIAL_PARAMS>> {\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n return (void 0);\n }\n\n\n\n /**\n *\n * @param absolteFilesPathes for each watched file\n * @returns\n */\n public syncAction(\n absolteFilesPathes?: string[],\n initialParams?: INITIAL_PARAMS,\n ): Promise<void> {\n return void 0;\n }\n\n\n\n public async preAsyncAction(initialParams?: INITIAL_PARAMS): Promise<void> {}\n\n\n\n public asyncAction(\n asyncEvents: ChangeOfFile,\n initialParams?: INITIAL_PARAMS,\n ): Promise<void> {\n return void 0;\n }\n\n\n\n\n\n\n\n private _init(options?: Models.BaseClientCompilerOptions) {\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n return (void 0);\n }\n\n\n\n private fixTaskName(taskName: string) {\n if (!_.isString(taskName)) {\n taskName = `task \"${this.taskName}\"`;\n }\n return taskName;\n }\n\n\n filesToWatch() {\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n return (void 0);\n }\n\n private mapForWatching(c: string): string[] {\n/* */\n/* */\n/* */\n/* */\n/* */\n return (void 0);\n }\n\n\n}\n\n ;({}); // @--end-of-file-for-module=incremental-compiler lib/base-client-compiler.ts","\n\nimport * as models from './models';\nexport * from './change-of-file';\nexport * from './constants';\nexport * from './incremental-watcher';\nimport * as change from './change-of-file';\nexport * from './base-client-compiler';\nimport * as incBase from './base-client-compiler';\n/* */\n/* */\n \n\nimport { _ } from 'tnp-core/browser';\n/**\n * Template for watcher client:\n * // @ts-ignore\n * import { IncCompiler } from '../lib';\n *\n * export class TestWatcher extends IncCompiler.Base {\n *\n * syncAction(files = []) { }\n * preAsyncAction() { }\n * asyncAction(change: IncCompiler.Change, additionalData:any ) { }\n * }\n */\nexport namespace IncCompiler {\n export import Models = models.Models;\n export import Base = incBase.BaseClientCompiler;\n export import Change = change.ChangeOfFile;\n}\n\n ;({}); // @--end-of-file-for-module=incremental-compiler lib/index.ts","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["incBase.BaseClientCompiler","change.ChangeOfFile"],"mappings":";;MAOa,YAAY,CAAA;AAGvB,IAAA,WAAA,CACS,mBAA2B,KAAK,CAAC,EACxB,SAAA,GAIE,KAAK,CAAC,EAAA;QALjB,IAAgB,CAAA,gBAAA,GAAhB,gBAAgB;QACP,IAAS,CAAA,SAAA,GAAT,SAAS;AAMzB,QAAA,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,EAAE;;AAG5B,IAAA,IAAW,OAAO,GAAA;AAChB,QAAA,OAAO;AACJ,aAAA,OAAO,CAAC,IAAI,CAAC,gBAAgB;AAC7B,aAAA,OAAO,CAAC,GAAG,EAAE,EAAE,CAA6B;;AAElD;AAEA;AAA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,EAAE;;AClVP;;;;;;;;;;;AAWG;AACG,IAAW;AAAjB,CAAA,UAAiB,WAAW,EAAA;AAEZ,IAAA,WAAA,CAAA,IAAI,GAAGA,kBAA0B;AACjC,IAAA,WAAA,CAAA,MAAM,GAAGC,YAAmB;AAC5C,CAAC,EAJgB,WAAW,KAAX,WAAW,GAI3B,EAAA,CAAA,CAAA;AAEA;AAAC,CAAC,EAAE,EAAE;;AChCP;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"incremental-compiler.mjs","sources":["../../../tmp-libs-for-dist/incremental-compiler/projects/incremental-compiler/src/lib/constants.ts","../../../tmp-libs-for-dist/incremental-compiler/projects/incremental-compiler/src/lib/incremental-watcher.ts","../../../tmp-libs-for-dist/incremental-compiler/projects/incremental-compiler/src/lib/base-client-compiler.ts","../../../tmp-libs-for-dist/incremental-compiler/projects/incremental-compiler/src/lib/index.ts","../../../tmp-libs-for-dist/incremental-compiler/projects/incremental-compiler/src/incremental-compiler.ts"],"sourcesContent":["export const IGNORE_BY_DEFAULT = [\n '**/node_modules/**/*.*',\n '**/node_modules',\n '**/.git/**/*.*',\n '**/.git',\n];","//#region imports\nimport { _, path, frameworkName, Helpers } from 'tnp-core/browser';\nimport { chokidar } from 'tnp-core/browser';\n\nimport { IncrementalWatcherInstance } from './models';\nimport { IncrementalWatcherOptions } from './models';\nimport { ParcelWatcherAdapter } from './parcel-watcher-adapter';\n//#endregion\n\nexport function incrementalWatcher(\n filesFolderPathOrPatternsToWatch: string[],\n watchOptions: IncrementalWatcherOptions,\n): IncrementalWatcherInstance {\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n return (void 0);\n}","//#region imports\n/* */ \nimport { path, _, crossPlatformPath, UtilsMessages } from 'tnp-core/browser';\nimport { Helpers } from 'tnp-core/browser';\nimport { CLI } from 'tnp-core/browser';\nimport { CoreModels } from 'tnp-core/browser';\n\nimport { CompilerManager } from './compiler-manager';\nimport { mapForWatching } from './helpers';\nimport { ChangeOfFile, IncrementalWatcherOptions } from './models';\nimport {\n BaseClientCompilerOptions,\n StartAndWatchOptions,\n StartOptions,\n} from './models';\n//#endregion\n\nexport class BaseClientCompiler<INITIAL_PARAMS = any>\n implements BaseClientCompilerOptions\n{\n //#region fields & getters\n public readonly followSymlinks: boolean;\n\n public readonly subscribeOnlyFor: CoreModels.FileExtension[] = [];\n\n public readonly executeOutsideScenario: boolean;\n\n public readonly taskName: string;\n\n public readonly engine: IncrementalWatcherOptions['engine'];\n\n public readonly notifyOnFileUnlink: boolean;\n\n protected onlySingleRun = true;\n\n public ignoreFolderPatter?: string[];\n\n private pathResolve: boolean = false;\n\n private isInitedWithOptions: boolean = false;\n\n private __folderPath: string[] = [];\n\n public lastAsyncFiles: string[] = [];\n\n public readonly isWatchCompilation: boolean = false;\n\n public readonly folderPathContentCheck: string[] = [];\n\n public set folderPath(v) {\n/* */\n/* */\n/* */\n/* */\n/* */\n \n }\n\n public get folderPath(): string[] {\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n return (void 0);\n }\n //#endregion\n\n //#region constructor\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n \n //#endregion\n\n //#region init options\n /**\n * manually init options (when no passing object to constructor super() )\n */\n protected initOptions(options?: BaseClientCompilerOptions): void {\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n return (void 0);\n }\n //#endregion\n\n //#region run task\n /**\n * do not override this\n */\n async runTask(\n options?: { watch?: boolean } & StartAndWatchOptions<INITIAL_PARAMS>,\n ): Promise<BaseClientCompiler<INITIAL_PARAMS>> {\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n return (void 0);\n }\n //#endregion\n\n //#region start\n /**\n * @deprecated use runTask instead\n * Do not override this\n */\n public async start(\n options?: StartOptions<INITIAL_PARAMS>,\n ): Promise<BaseClientCompiler<INITIAL_PARAMS>> {\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n return (void 0);\n }\n //#endregion\n\n //#region start and watch\n /**\n * @deprecated use runTask instead\n * Do not override this\n */\n public async startAndWatch(\n options?: StartAndWatchOptions<INITIAL_PARAMS>,\n ): Promise<BaseClientCompiler<INITIAL_PARAMS>> {\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n return (void 0);\n }\n //#endregion\n\n //#region sync action\n /**\n *\n * @param absolteFilesPathes for each watched file\n * @returns\n */\n public syncAction(\n absolteFilesPathes?: string[],\n initialParams?: INITIAL_PARAMS,\n ): Promise<void> {\n return void 0;\n }\n //#endregion\n\n //#region pre async action\n public async preAsyncAction(initialParams?: INITIAL_PARAMS): Promise<void> {}\n //#endregion\n\n //#region async action\n public asyncAction(\n asyncEvents: ChangeOfFile,\n initialParams?: INITIAL_PARAMS,\n ): Promise<void> {\n return void 0;\n }\n //#endregion\n\n //#region get files to watch\n public getFilesFolderPatternsToWatch(): string[] {\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n return (void 0);\n }\n //#endregion\n\n //#region private methods\n\n //#region private methods / fix and assign options\n private fixAndAssignOptions(options?: BaseClientCompilerOptions): void {\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n return (void 0);\n }\n //#endregion\n\n //#region private methods / fix task name\n private fixTaskName(taskName: string): string {\n if (!_.isString(taskName)) {\n taskName = `task \"${this.taskName}\"`;\n }\n return taskName;\n }\n //#endregion\n\n //#endregion\n}","export * from './constants';\nexport * from './models';\nexport * from './incremental-watcher';\nexport * from './base-client-compiler';\n/* */ ","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAa,MAAA,iBAAiB,GAAG;IAC/B,wBAAwB;IACxB,iBAAiB;IACjB,gBAAgB;IAChB,SAAS;;;ACGX;AAEgB,SAAA,kBAAkB,CAChC,gCAA0C,EAC1C,YAAuC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BvC,IAAA,QAAQ,KAAK,CAAC;AAChB;;ACxCA;AACA;AAcA;MAEa,kBAAkB,CAAA;AAA/B,IAAA,WAAA,GAAA;QAMkB,IAAgB,CAAA,gBAAA,GAA+B,EAAE;QAUvD,IAAa,CAAA,aAAA,GAAG,IAAI;QAItB,IAAW,CAAA,WAAA,GAAY,KAAK;QAE5B,IAAmB,CAAA,mBAAA,GAAY,KAAK;QAEpC,IAAY,CAAA,YAAA,GAAa,EAAE;QAE5B,IAAc,CAAA,cAAA,GAAa,EAAE;QAEpB,IAAkB,CAAA,kBAAA,GAAY,KAAK;QAEnC,IAAsB,CAAA,sBAAA,GAAa,EAAE;;;;IAErD,IAAW,UAAU,CAAC,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
@@ -1,46 +1,44 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import { ChangeOfFile } from './change-of-file';
|
|
3
|
-
import { Models } from './models';
|
|
4
2
|
import { CoreModels } from 'tnp-core/browser';
|
|
5
|
-
|
|
3
|
+
import { ChangeOfFile, IncrementalWatcherOptions } from './models';
|
|
4
|
+
import { BaseClientCompilerOptions, StartAndWatchOptions, StartOptions } from './models';
|
|
5
|
+
export declare class BaseClientCompiler<INITIAL_PARAMS = any> implements BaseClientCompilerOptions {
|
|
6
6
|
readonly followSymlinks: boolean;
|
|
7
7
|
readonly subscribeOnlyFor: CoreModels.FileExtension[];
|
|
8
8
|
readonly executeOutsideScenario: boolean;
|
|
9
9
|
readonly taskName: string;
|
|
10
|
-
|
|
10
|
+
readonly engine: IncrementalWatcherOptions['engine'];
|
|
11
11
|
readonly notifyOnFileUnlink: boolean;
|
|
12
|
+
protected onlySingleRun: boolean;
|
|
13
|
+
ignoreFolderPatter?: string[];
|
|
12
14
|
private pathResolve;
|
|
13
|
-
private
|
|
15
|
+
private isInitedWithOptions;
|
|
14
16
|
private __folderPath;
|
|
15
17
|
lastAsyncFiles: string[];
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
get isInited(): boolean;
|
|
19
|
-
get folderPathContentCheck(): string[];
|
|
20
|
-
private set folderPathContentCheck(value);
|
|
18
|
+
readonly isWatchCompilation: boolean;
|
|
19
|
+
readonly folderPathContentCheck: string[];
|
|
21
20
|
set folderPath(v: string[]);
|
|
22
21
|
get folderPath(): string[];
|
|
23
22
|
/**
|
|
24
23
|
* manually init options (when no passing object to constructor super() )
|
|
25
24
|
*/
|
|
26
|
-
protected initOptions(options?:
|
|
27
|
-
protected onlySingleRun: boolean;
|
|
25
|
+
protected initOptions(options?: BaseClientCompilerOptions): void;
|
|
28
26
|
/**
|
|
29
27
|
* do not override this
|
|
30
28
|
*/
|
|
31
29
|
runTask(options?: {
|
|
32
30
|
watch?: boolean;
|
|
33
|
-
} &
|
|
31
|
+
} & StartAndWatchOptions<INITIAL_PARAMS>): Promise<BaseClientCompiler<INITIAL_PARAMS>>;
|
|
34
32
|
/**
|
|
35
33
|
* @deprecated use runTask instead
|
|
36
34
|
* Do not override this
|
|
37
35
|
*/
|
|
38
|
-
start(options?:
|
|
36
|
+
start(options?: StartOptions<INITIAL_PARAMS>): Promise<BaseClientCompiler<INITIAL_PARAMS>>;
|
|
39
37
|
/**
|
|
40
38
|
* @deprecated use runTask instead
|
|
41
39
|
* Do not override this
|
|
42
40
|
*/
|
|
43
|
-
startAndWatch(options?:
|
|
41
|
+
startAndWatch(options?: StartAndWatchOptions<INITIAL_PARAMS>): Promise<BaseClientCompiler<INITIAL_PARAMS>>;
|
|
44
42
|
/**
|
|
45
43
|
*
|
|
46
44
|
* @param absolteFilesPathes for each watched file
|
|
@@ -49,8 +47,7 @@ export declare class BaseClientCompiler<INITIAL_PARAMS = any> implements Models.
|
|
|
49
47
|
syncAction(absolteFilesPathes?: string[], initialParams?: INITIAL_PARAMS): Promise<void>;
|
|
50
48
|
preAsyncAction(initialParams?: INITIAL_PARAMS): Promise<void>;
|
|
51
49
|
asyncAction(asyncEvents: ChangeOfFile, initialParams?: INITIAL_PARAMS): Promise<void>;
|
|
52
|
-
|
|
50
|
+
getFilesFolderPatternsToWatch(): string[];
|
|
51
|
+
private fixAndAssignOptions;
|
|
53
52
|
private fixTaskName;
|
|
54
|
-
filesToWatch(): any;
|
|
55
|
-
private mapForWatching;
|
|
56
53
|
}
|
|
@@ -5,13 +5,11 @@ export declare class CompilerManager {
|
|
|
5
5
|
static get Instance(): CompilerManager;
|
|
6
6
|
private clients;
|
|
7
7
|
private asyncEventScenario;
|
|
8
|
-
private inited;
|
|
9
8
|
private filesContentCache;
|
|
10
9
|
private constructor();
|
|
11
|
-
syncInit(client: BaseClientCompiler<any>, initialParams: any): Promise<
|
|
12
|
-
asyncInit(client: BaseClientCompiler<any>, initialParams: any): Promise<
|
|
10
|
+
syncInit(client: BaseClientCompiler<any>, initialParams: any): Promise<void>;
|
|
11
|
+
asyncInit(client: BaseClientCompiler<any>, initialParams: any): Promise<void>;
|
|
13
12
|
private actionForAsyncEvent;
|
|
14
|
-
addClient(client: BaseClientCompiler<any>):
|
|
15
|
-
private preventAlreadyInited;
|
|
13
|
+
addClient(client: BaseClientCompiler<any>): void;
|
|
16
14
|
private fileShouldBeChecked;
|
|
17
15
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/**
|
|
3
|
+
* @returns Absolute paths of files/folders matching the given pattern
|
|
4
|
+
*/
|
|
5
|
+
export declare const getFilesByPattern: ({ globPath, ignorePatterns, followSymlinks, searchStrategy, taskName, }: {
|
|
6
|
+
globPath: string;
|
|
7
|
+
ignorePatterns: string[];
|
|
8
|
+
followSymlinks: boolean;
|
|
9
|
+
searchStrategy: "files-only" | "folders-and-files" | "folders-only";
|
|
10
|
+
taskName?: string;
|
|
11
|
+
}) => string[];
|
|
12
|
+
export declare const mapForWatching: (c: string) => string[];
|
|
13
|
+
export declare const stripGlobToDir: (globPath: string) => string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { IncrementalWatcherInstance } from './models';
|
|
3
|
+
import { IncrementalWatcherOptions } from './models';
|
|
4
|
+
export declare function incrementalWatcher(filesFolderPathOrPatternsToWatch: string[], watchOptions: IncrementalWatcherOptions): IncrementalWatcherInstance;
|
package/browser/lib/index.d.ts
CHANGED
|
@@ -1,25 +1,5 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import * as models from './models';
|
|
3
|
-
export * from './change-of-file';
|
|
4
2
|
export * from './constants';
|
|
3
|
+
export * from './models';
|
|
5
4
|
export * from './incremental-watcher';
|
|
6
|
-
|
|
7
|
-
export * from './base-client-compiler';
|
|
8
|
-
import * as incBase from './base-client-compiler';
|
|
9
|
-
/**
|
|
10
|
-
* Template for watcher client:
|
|
11
|
-
* // @ts-ignore
|
|
12
|
-
* import { IncCompiler } from '../lib';
|
|
13
|
-
*
|
|
14
|
-
* export class TestWatcher extends IncCompiler.Base {
|
|
15
|
-
*
|
|
16
|
-
* syncAction(files = []) { }
|
|
17
|
-
* preAsyncAction() { }
|
|
18
|
-
* asyncAction(change: IncCompiler.Change, additionalData:any ) { }
|
|
19
|
-
* }
|
|
20
|
-
*/
|
|
21
|
-
export declare namespace IncCompiler {
|
|
22
|
-
export import Models = models.Models;
|
|
23
|
-
export import Base = incBase.BaseClientCompiler;
|
|
24
|
-
export import Change = change.ChangeOfFile;
|
|
25
|
-
}
|
|
5
|
+
export * from './base-client-compiler';
|
package/browser/lib/models.d.ts
CHANGED
|
@@ -1,39 +1,68 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import { CoreModels } from 'tnp-core/browser';
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
3
|
+
export interface StartAndWatchOptions<INIT_PARAMS = any> {
|
|
4
|
+
afterInitCallBack?: (initialParams?: INIT_PARAMS) => void;
|
|
5
|
+
watchOnly?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* override task name
|
|
8
|
+
*/
|
|
9
|
+
taskName?: string;
|
|
10
|
+
initialParams?: INIT_PARAMS;
|
|
11
|
+
}
|
|
12
|
+
export type StartOptions<T = any> = Omit<StartAndWatchOptions<T>, 'watchOnly'>;
|
|
13
|
+
export interface BaseClientCompilerOptions {
|
|
14
|
+
taskName: string;
|
|
15
|
+
folderPath?: string | string[];
|
|
16
|
+
/**
|
|
17
|
+
* It will cache in memory previouse files
|
|
18
|
+
* to limit async actions calls
|
|
19
|
+
* and prevent not changed files emiting change event
|
|
20
|
+
*/
|
|
21
|
+
folderPathContentCheck?: string | string[];
|
|
22
|
+
/**
|
|
23
|
+
* default true
|
|
24
|
+
*/
|
|
25
|
+
followSymlinks?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Notify compiler if file is unlinked
|
|
28
|
+
* default: false
|
|
29
|
+
*/
|
|
30
|
+
notifyOnFileUnlink?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* ignore glob folder pattern
|
|
33
|
+
* node_modules is always ignored
|
|
34
|
+
*/
|
|
35
|
+
ignoreFolderPatter?: string[];
|
|
36
|
+
subscribeOnlyFor?: CoreModels.FileExtension[];
|
|
37
|
+
engine?: IncrementalWatcherOptions['engine'];
|
|
38
|
+
}
|
|
39
|
+
export interface ParcelEvent {
|
|
40
|
+
path: string;
|
|
41
|
+
type: ParcelEventType;
|
|
42
|
+
}
|
|
43
|
+
export type IncrementalWatcherAllEvents = 'all' | IncrementalWatcherEvents;
|
|
44
|
+
export type ListenerForAll = (eventName: IncrementalWatcherEvents, path: string) => void;
|
|
45
|
+
export type ListenerForSingleEvent = (path: string) => void;
|
|
46
|
+
export type Listener = ListenerForAll | ListenerForSingleEvent;
|
|
47
|
+
export interface IncrementalWatcherInstance {
|
|
48
|
+
add(paths: string | ReadonlyArray<string>): void;
|
|
49
|
+
on(event: 'all', listener: ListenerForAll): this;
|
|
50
|
+
on(event: IncrementalWatcherAllEvents, listener: ListenerForSingleEvent): this;
|
|
51
|
+
}
|
|
52
|
+
export interface IncrementalWatcherOptions {
|
|
53
|
+
ignored?: string[];
|
|
54
|
+
ignoreInitial?: boolean;
|
|
55
|
+
followSymlinks?: boolean;
|
|
56
|
+
name: string;
|
|
57
|
+
/**
|
|
58
|
+
* Default is @parcel/watcher
|
|
59
|
+
*/
|
|
60
|
+
engine?: 'chokidar' | '@parcel/watcher';
|
|
61
|
+
}
|
|
62
|
+
export type IncrementalWatcherEvents = 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir';
|
|
63
|
+
export type ParcelEventType = 'create' | 'update' | 'delete';
|
|
64
|
+
export interface ChangeOfFile {
|
|
65
|
+
datetime: Date;
|
|
66
|
+
fileAbsolutePath: string;
|
|
67
|
+
eventName: 'add' | 'change' | 'unlink' | 'unlinkDir';
|
|
39
68
|
}
|