incremental-compiler 19.0.60 → 19.0.62
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 +50 -9
- package/browser/README.md +24 -24
- package/browser/fesm2022/incremental-compiler.mjs +41 -86
- package/browser/fesm2022/incremental-compiler.mjs.map +1 -1
- package/browser/lib/base-client-compiler.d.ts +12 -14
- 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 +1 -1
- package/lib/base-client-compiler.d.ts +13 -16
- package/lib/base-client-compiler.js +39 -56
- package/lib/base-client-compiler.js.map +1 -1
- package/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib/build-info._auto-generated_.js +1 -1
- package/lib/compiler-manager.d.ts +0 -2
- package/lib/compiler-manager.js +25 -51
- 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/helpers.d.ts +12 -0
- package/lib/helpers.js +108 -0
- package/lib/helpers.js.map +1 -0
- 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.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/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/package.json +1 -1
- package/tmp-environment.json +37 -0
- package/websql/README.md +24 -24
- package/websql/fesm2022/incremental-compiler.mjs +41 -86
- package/websql/fesm2022/incremental-compiler.mjs.map +1 -1
- package/websql/lib/base-client-compiler.d.ts +12 -14
- 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 +1 -1
- package/browser/lib/change-of-file.d.ts +0 -9
- package/browser/lib/incremental-watcher/incremental-watcher-events.d.ts +0 -11
- 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/websql/lib/change-of-file.d.ts +0 -9
- package/websql/lib/incremental-watcher/incremental-watcher-events.d.ts +0 -11
- 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
|
-
# INCREMENTAL COMPILER
|
|
2
|
-
|
|
3
|
-
A library for any kind of incremental compilers and file watchers, based on
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
# INCREMENTAL COMPILER
|
|
2
|
+
|
|
3
|
+
A library for any kind of incremental compilers and file watchers, based on @parcel/watcher and chokidar.
|
|
4
|
+
|
|
5
|
+
## API
|
|
6
|
+
|
|
7
|
+
1. Incremental Compiler class **"IncCompiler"**
|
|
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/
|
package/browser/README.md
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
# MyLib
|
|
2
|
-
|
|
3
|
-
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.2.0.
|
|
4
|
-
|
|
5
|
-
## Code scaffolding
|
|
6
|
-
|
|
7
|
-
Run `ng generate component component-name --project my-lib` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project my-lib`.
|
|
8
|
-
> Note: Don't forget to add `--project my-lib` or else it will be added to the default project in your `angular.json` file.
|
|
9
|
-
|
|
10
|
-
## Build
|
|
11
|
-
|
|
12
|
-
Run `ng build my-lib` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
13
|
-
|
|
14
|
-
## Publishing
|
|
15
|
-
|
|
16
|
-
After building your library with `ng build my-lib`, go to the dist folder `cd dist/my-lib` and run `npm publish`.
|
|
17
|
-
|
|
18
|
-
## Running unit tests
|
|
19
|
-
|
|
20
|
-
Run `ng test my-lib` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
21
|
-
|
|
22
|
-
## Further help
|
|
23
|
-
|
|
24
|
-
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|
|
1
|
+
# MyLib
|
|
2
|
+
|
|
3
|
+
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.2.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Run `ng generate component component-name --project my-lib` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project my-lib`.
|
|
8
|
+
> Note: Don't forget to add `--project my-lib` or else it will be added to the default project in your `angular.json` file.
|
|
9
|
+
|
|
10
|
+
## Build
|
|
11
|
+
|
|
12
|
+
Run `ng build my-lib` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
13
|
+
|
|
14
|
+
## Publishing
|
|
15
|
+
|
|
16
|
+
After building your library with `ng build my-lib`, go to the dist folder `cd dist/my-lib` and run `npm publish`.
|
|
17
|
+
|
|
18
|
+
## Running unit tests
|
|
19
|
+
|
|
20
|
+
Run `ng test my-lib` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
21
|
+
|
|
22
|
+
## Further help
|
|
23
|
+
|
|
24
|
+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ } from 'tnp-core/browser';
|
|
2
2
|
|
|
3
|
-
//#region imports
|
|
4
|
-
//#endregion
|
|
5
|
-
class ChangeOfFile {
|
|
6
|
-
constructor(fileAbsolutePath = void 0, eventName = void 0) {
|
|
7
|
-
this.fileAbsolutePath = fileAbsolutePath;
|
|
8
|
-
this.eventName = eventName;
|
|
9
|
-
this.datetime = new Date();
|
|
10
|
-
}
|
|
11
|
-
get fileExt() {
|
|
12
|
-
return path
|
|
13
|
-
.extname(this.fileAbsolutePath)
|
|
14
|
-
.replace('.', '');
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
let COMPILER_POOLING = {};
|
|
19
3
|
const IGNORE_BY_DEFAULT = [
|
|
20
4
|
'**/node_modules/**/*.*',
|
|
21
5
|
'**/node_modules',
|
|
@@ -23,9 +7,13 @@ const IGNORE_BY_DEFAULT = [
|
|
|
23
7
|
'**/.git',
|
|
24
8
|
];
|
|
25
9
|
|
|
26
|
-
/* */
|
|
27
10
|
//#endregion
|
|
28
|
-
|
|
11
|
+
function incrementalWatcher(filesFolderPathOrPatternsToWatch, watchOptions) {
|
|
12
|
+
/* */
|
|
13
|
+
/* */
|
|
14
|
+
/* */
|
|
15
|
+
/* */
|
|
16
|
+
/* */
|
|
29
17
|
/* */
|
|
30
18
|
/* */
|
|
31
19
|
/* */
|
|
@@ -57,32 +45,21 @@ class BaseClientCompiler {
|
|
|
57
45
|
constructor() {
|
|
58
46
|
this.subscribeOnlyFor = [];
|
|
59
47
|
this.onlySingleRun = true;
|
|
60
|
-
/* */
|
|
61
|
-
/* */
|
|
62
48
|
this.pathResolve = false;
|
|
63
49
|
this.isInitedWithOptions = false;
|
|
64
50
|
this.__folderPath = [];
|
|
65
51
|
this.lastAsyncFiles = [];
|
|
66
|
-
this._folderPathContentCheck = [];
|
|
67
52
|
this.isWatchCompilation = false;
|
|
53
|
+
this.folderPathContentCheck = [];
|
|
54
|
+
//#endregion
|
|
68
55
|
//#endregion
|
|
69
56
|
}
|
|
70
|
-
//#endregion
|
|
71
|
-
//#region getters & setteres
|
|
72
|
-
//#region getters & setteres / folder path content check
|
|
73
|
-
get folderPathContentCheck() {
|
|
74
|
-
return this._folderPathContentCheck;
|
|
75
|
-
}
|
|
76
|
-
set folderPathContentCheck(v) {
|
|
77
|
-
this._folderPathContentCheck = v;
|
|
78
|
-
}
|
|
79
|
-
//#endregion
|
|
80
|
-
//#region getters & setteres / folder path
|
|
81
57
|
set folderPath(v) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
58
|
+
/* */
|
|
59
|
+
/* */
|
|
60
|
+
/* */
|
|
61
|
+
/* */
|
|
62
|
+
/* */
|
|
86
63
|
}
|
|
87
64
|
get folderPath() {
|
|
88
65
|
/* */
|
|
@@ -105,7 +82,6 @@ class BaseClientCompiler {
|
|
|
105
82
|
return (void 0);
|
|
106
83
|
}
|
|
107
84
|
//#endregion
|
|
108
|
-
//#endregion
|
|
109
85
|
//#region constructor
|
|
110
86
|
/* */
|
|
111
87
|
/* */
|
|
@@ -125,7 +101,7 @@ class BaseClientCompiler {
|
|
|
125
101
|
/* */
|
|
126
102
|
/* */
|
|
127
103
|
//#endregion
|
|
128
|
-
//#region
|
|
104
|
+
//#region init options
|
|
129
105
|
/**
|
|
130
106
|
* manually init options (when no passing object to constructor super() )
|
|
131
107
|
*/
|
|
@@ -148,7 +124,7 @@ class BaseClientCompiler {
|
|
|
148
124
|
return (void 0);
|
|
149
125
|
}
|
|
150
126
|
//#endregion
|
|
151
|
-
//#region
|
|
127
|
+
//#region run task
|
|
152
128
|
/**
|
|
153
129
|
* do not override this
|
|
154
130
|
*/
|
|
@@ -161,9 +137,11 @@ class BaseClientCompiler {
|
|
|
161
137
|
/* */
|
|
162
138
|
/* */
|
|
163
139
|
/* */
|
|
140
|
+
/* */
|
|
164
141
|
return (void 0);
|
|
165
142
|
}
|
|
166
|
-
//#
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region start
|
|
167
145
|
/**
|
|
168
146
|
* @deprecated use runTask instead
|
|
169
147
|
* Do not override this
|
|
@@ -202,7 +180,7 @@ class BaseClientCompiler {
|
|
|
202
180
|
return (void 0);
|
|
203
181
|
}
|
|
204
182
|
//#endregion
|
|
205
|
-
//#region
|
|
183
|
+
//#region start and watch
|
|
206
184
|
/**
|
|
207
185
|
* @deprecated use runTask instead
|
|
208
186
|
* Do not override this
|
|
@@ -250,7 +228,7 @@ class BaseClientCompiler {
|
|
|
250
228
|
return (void 0);
|
|
251
229
|
}
|
|
252
230
|
//#endregion
|
|
253
|
-
//#region
|
|
231
|
+
//#region sync action
|
|
254
232
|
/**
|
|
255
233
|
*
|
|
256
234
|
* @param absolteFilesPathes for each watched file
|
|
@@ -260,19 +238,16 @@ class BaseClientCompiler {
|
|
|
260
238
|
return void 0;
|
|
261
239
|
}
|
|
262
240
|
//#endregion
|
|
263
|
-
//#region
|
|
241
|
+
//#region pre async action
|
|
264
242
|
async preAsyncAction(initialParams) { }
|
|
265
243
|
//#endregion
|
|
266
|
-
//#region
|
|
244
|
+
//#region async action
|
|
267
245
|
asyncAction(asyncEvents, initialParams) {
|
|
268
246
|
return void 0;
|
|
269
247
|
}
|
|
270
248
|
//#endregion
|
|
271
|
-
//#
|
|
272
|
-
|
|
273
|
-
//#region private methods / _init
|
|
274
|
-
_init(options) {
|
|
275
|
-
/* */
|
|
249
|
+
//#region get files to watch
|
|
250
|
+
getFilesFolderPatternsToWatch() {
|
|
276
251
|
/* */
|
|
277
252
|
/* */
|
|
278
253
|
/* */
|
|
@@ -288,6 +263,12 @@ class BaseClientCompiler {
|
|
|
288
263
|
/* */
|
|
289
264
|
/* */
|
|
290
265
|
/* */
|
|
266
|
+
return (void 0);
|
|
267
|
+
}
|
|
268
|
+
//#endregion
|
|
269
|
+
//#region private methods
|
|
270
|
+
//#region private methods / fix and assign options
|
|
271
|
+
fixAndAssignOptions(options) {
|
|
291
272
|
/* */
|
|
292
273
|
/* */
|
|
293
274
|
/* */
|
|
@@ -308,18 +289,6 @@ class BaseClientCompiler {
|
|
|
308
289
|
/* */
|
|
309
290
|
/* */
|
|
310
291
|
/* */
|
|
311
|
-
return (void 0);
|
|
312
|
-
}
|
|
313
|
-
//#endregion
|
|
314
|
-
//#region private methods / fix task name
|
|
315
|
-
fixTaskName(taskName) {
|
|
316
|
-
if (!_.isString(taskName)) {
|
|
317
|
-
taskName = `task "${this.taskName}"`;
|
|
318
|
-
}
|
|
319
|
-
return taskName;
|
|
320
|
-
}
|
|
321
|
-
//#endregion
|
|
322
|
-
filesToWatch() {
|
|
323
292
|
/* */
|
|
324
293
|
/* */
|
|
325
294
|
/* */
|
|
@@ -331,12 +300,6 @@ class BaseClientCompiler {
|
|
|
331
300
|
/* */
|
|
332
301
|
/* */
|
|
333
302
|
/* */
|
|
334
|
-
/* */
|
|
335
|
-
/* */
|
|
336
|
-
/* */
|
|
337
|
-
return (void 0);
|
|
338
|
-
}
|
|
339
|
-
mapForWatching(c) {
|
|
340
303
|
/* */
|
|
341
304
|
/* */
|
|
342
305
|
/* */
|
|
@@ -344,29 +307,21 @@ class BaseClientCompiler {
|
|
|
344
307
|
/* */
|
|
345
308
|
return (void 0);
|
|
346
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
|
+
}
|
|
347
318
|
}
|
|
348
319
|
|
|
349
|
-
|
|
350
|
-
* Template for watcher client:
|
|
351
|
-
*
|
|
352
|
-
* import { IncCompiler } from 'incremental-compiler';
|
|
353
|
-
*
|
|
354
|
-
* export class TestWatcher extends IncCompiler.Base {
|
|
355
|
-
*
|
|
356
|
-
* syncAction(files = []) { }
|
|
357
|
-
* preAsyncAction() { }
|
|
358
|
-
* asyncAction(change: IncCompiler.Change, additionalData:any ) { }
|
|
359
|
-
* }
|
|
360
|
-
*/
|
|
361
|
-
var IncCompiler;
|
|
362
|
-
(function (IncCompiler) {
|
|
363
|
-
IncCompiler.Base = BaseClientCompiler;
|
|
364
|
-
IncCompiler.Change = ChangeOfFile;
|
|
365
|
-
})(IncCompiler || (IncCompiler = {}));
|
|
320
|
+
/* */
|
|
366
321
|
|
|
367
322
|
/**
|
|
368
323
|
* Generated bundle index. Do not edit.
|
|
369
324
|
*/
|
|
370
325
|
|
|
371
|
-
export { BaseClientCompiler,
|
|
326
|
+
export { BaseClientCompiler, IGNORE_BY_DEFAULT, incrementalWatcher };
|
|
372
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.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":["//#region imports\nimport { path, _ } from 'tnp-core/browser';\nimport { CoreModels } from 'tnp-core/browser';\n//#endregion\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\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","//#region imports\nimport { _, path, frameworkName, Helpers } from 'tnp-core/browser';\nimport { chokidar } from 'tnp-core/browser';\n\nimport { IncrementalWatcherInstance } from './incremental-watcher-instance';\nimport { IncrementalWatcherOptions } from './incremental-watcher-options';\n/* */ \n//#endregion\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 return (void 0);\n}\n","//#region imports\n/* */ \nimport { path, _, crossPlatformPath } from 'tnp-core/browser';\nimport { Helpers } from 'tnp-core/browser';\nimport { CLI } from 'tnp-core/browser';\nimport { CoreModels } from 'tnp-core/browser';\n\nimport { ChangeOfFile } from './change-of-file';\nimport { CompilerManager } from './compiler-manager';\nimport { Models } from './models';\n//#endregion\n\nexport class BaseClientCompiler<INITIAL_PARAMS = any>\n implements Models.BaseClientCompilerOptions\n{\n //#region fields\n public readonly followSymlinks: boolean;\n public readonly subscribeOnlyFor: CoreModels.FileExtension[] = [];\n public readonly executeOutsideScenario: boolean;\n public readonly taskName: string;\n public readonly notifyOnFileUnlink: boolean;\n\n protected onlySingleRun = true;\n public ignoreFolderPatter?: string[];\n/* */\n/* */\n \n private pathResolve: boolean = false;\n private isInitedWithOptions: boolean = false;\n private __folderPath: string[] = [];\n public lastAsyncFiles: string[] = [];\n private _folderPathContentCheck: string[] = [];\n isWatchCompilation: boolean = false;\n\n //#endregion\n\n //#region getters & setteres\n\n //#region getters & setteres / folder path content check\n get folderPathContentCheck() {\n return this._folderPathContentCheck;\n }\n private set folderPathContentCheck(v) {\n this._folderPathContentCheck = v;\n }\n //#endregion\n\n //#region getters & setteres / folder path\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 //#endregion\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?: Models.BaseClientCompilerOptions) {\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 api methods / start\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 //#region api methods / start\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 //#endregion\n\n //#region api methods / start and watch\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 //#endregion\n\n //#region api methods / 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 api methods / pre async action\n public async preAsyncAction(initialParams?: INITIAL_PARAMS): Promise<void> {}\n //#endregion\n\n //#region api methods / async action\n public asyncAction(\n asyncEvents: ChangeOfFile,\n initialParams?: INITIAL_PARAMS,\n ): Promise<void> {\n return void 0;\n }\n //#endregion\n\n //#endregion\n\n //#region private methods\n\n //#region private methods / _init\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 //#endregion\n\n //#region private methods / fix task name\n private fixTaskName(taskName: string) {\n if (!_.isString(taskName)) {\n taskName = `task \"${this.taskName}\"`;\n }\n return taskName;\n }\n //#endregion\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 //#endregion\n}\n","import * 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 *\n * import { IncCompiler } from 'incremental-compiler';\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 * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["incBase.BaseClientCompiler","change.ChangeOfFile"],"mappings":"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"}
|
|
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,CAAC,EAAA;;;;;;;AASvB,IAAA,IAAW,UAAU,GAAA;;;;;;;;;;;;;;;;;;AAkBnB,QAAA,QAAQ,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;AA0BhB;;AAEG;AACO,IAAA,WAAW,CAAC,OAAmC,EAAA;;;;;;;;;;;;;;;;AAgBvD,QAAA,QAAQ,KAAK,CAAC;;;;AAKhB;;AAEG;IACH,MAAM,OAAO,CACX,OAAoE,EAAA;;;;;;;;;;AAWpE,QAAA,QAAQ,KAAK,CAAC;;;;AAKhB;;;AAGG;IACI,MAAM,KAAK,CAChB,OAAsC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCtC,QAAA,QAAQ,KAAK,CAAC;;;;AAKhB;;;AAGG;IACI,MAAM,aAAa,CACxB,OAA8C,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyC9C,QAAA,QAAQ,KAAK,CAAC;;;;AAKhB;;;;AAIG;IACI,UAAU,CACf,kBAA6B,EAC7B,aAA8B,EAAA;QAE9B,OAAO,KAAK,CAAC;;;;AAKR,IAAA,MAAM,cAAc,CAAC,aAA8B;;;IAInD,WAAW,CAChB,WAAyB,EACzB,aAA8B,EAAA;QAE9B,OAAO,KAAK,CAAC;;;;IAKR,6BAA6B,GAAA;;;;;;;;;;;;;;;;AAgBlC,QAAA,QAAQ,KAAK,CAAC;;;;;AAOR,IAAA,mBAAmB,CAAC,OAAmC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqC7D,QAAA,QAAQ,KAAK,CAAC;;;;AAKR,IAAA,WAAW,CAAC,QAAgB,EAAA;QAClC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;AACzB,YAAA,QAAQ,GAAG,CAAS,MAAA,EAAA,IAAI,CAAC,QAAQ,GAAG;;AAEtC,QAAA,OAAO,QAAQ;;AAKlB;;AChVD;;ACJA;;AAEG;;;;"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import { CoreModels } from 'tnp-core/browser';
|
|
3
|
-
import { ChangeOfFile } from './
|
|
4
|
-
import {
|
|
5
|
-
export declare class BaseClientCompiler<INITIAL_PARAMS = any> implements
|
|
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
|
+
readonly engine: IncrementalWatcherOptions['engine'];
|
|
10
11
|
readonly notifyOnFileUnlink: boolean;
|
|
11
12
|
protected onlySingleRun: boolean;
|
|
12
13
|
ignoreFolderPatter?: string[];
|
|
@@ -14,32 +15,30 @@ export declare class BaseClientCompiler<INITIAL_PARAMS = any> implements Models.
|
|
|
14
15
|
private isInitedWithOptions;
|
|
15
16
|
private __folderPath;
|
|
16
17
|
lastAsyncFiles: string[];
|
|
17
|
-
|
|
18
|
-
|
|
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?:
|
|
25
|
+
protected initOptions(options?: BaseClientCompilerOptions): void;
|
|
27
26
|
/**
|
|
28
27
|
* do not override this
|
|
29
28
|
*/
|
|
30
29
|
runTask(options?: {
|
|
31
30
|
watch?: boolean;
|
|
32
|
-
} &
|
|
31
|
+
} & StartAndWatchOptions<INITIAL_PARAMS>): Promise<BaseClientCompiler<INITIAL_PARAMS>>;
|
|
33
32
|
/**
|
|
34
33
|
* @deprecated use runTask instead
|
|
35
34
|
* Do not override this
|
|
36
35
|
*/
|
|
37
|
-
start(options?:
|
|
36
|
+
start(options?: StartOptions<INITIAL_PARAMS>): Promise<BaseClientCompiler<INITIAL_PARAMS>>;
|
|
38
37
|
/**
|
|
39
38
|
* @deprecated use runTask instead
|
|
40
39
|
* Do not override this
|
|
41
40
|
*/
|
|
42
|
-
startAndWatch(options?:
|
|
41
|
+
startAndWatch(options?: StartAndWatchOptions<INITIAL_PARAMS>): Promise<BaseClientCompiler<INITIAL_PARAMS>>;
|
|
43
42
|
/**
|
|
44
43
|
*
|
|
45
44
|
* @param absolteFilesPathes for each watched file
|
|
@@ -48,8 +47,7 @@ export declare class BaseClientCompiler<INITIAL_PARAMS = any> implements Models.
|
|
|
48
47
|
syncAction(absolteFilesPathes?: string[], initialParams?: INITIAL_PARAMS): Promise<void>;
|
|
49
48
|
preAsyncAction(initialParams?: INITIAL_PARAMS): Promise<void>;
|
|
50
49
|
asyncAction(asyncEvents: ChangeOfFile, initialParams?: INITIAL_PARAMS): Promise<void>;
|
|
51
|
-
|
|
50
|
+
getFilesFolderPatternsToWatch(): string[];
|
|
51
|
+
private fixAndAssignOptions;
|
|
52
52
|
private fixTaskName;
|
|
53
|
-
filesToWatch(): any;
|
|
54
|
-
private mapForWatching;
|
|
55
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
|
-
*
|
|
12
|
-
* import { IncCompiler } from 'incremental-compiler';
|
|
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
|
}
|