incremental-compiler 18.0.21 → 18.0.23
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 +9 -9
- package/assets/shared/shared_folder_info.txt +1 -1
- package/browser/README.md +24 -24
- package/browser/esm2022/lib/base-client-compiler.mjs +4 -4
- package/browser/esm2022/lib/compiler-manager.mjs +3 -3
- package/browser/esm2022/lib/constants.mjs +12 -2
- package/browser/esm2022/lib/models.mjs +1 -1
- package/browser/fesm2022/incremental-compiler.mjs +4 -4
- package/browser/fesm2022/incremental-compiler.mjs.map +1 -1
- package/browser/lib/base-client-compiler.d.ts +7 -7
- package/browser/lib/compiler-manager.d.ts +1 -1
- package/browser/lib/constants.d.ts +2 -1
- package/browser/lib/models.d.ts +2 -2
- package/client/README.md +24 -24
- package/client/esm2022/lib/base-client-compiler.mjs +4 -4
- package/client/esm2022/lib/compiler-manager.mjs +3 -3
- package/client/esm2022/lib/constants.mjs +12 -2
- package/client/esm2022/lib/models.mjs +1 -1
- package/client/fesm2022/incremental-compiler.mjs +4 -4
- package/client/fesm2022/incremental-compiler.mjs.map +1 -1
- package/client/lib/base-client-compiler.d.ts +7 -7
- package/client/lib/compiler-manager.d.ts +1 -1
- package/client/lib/constants.d.ts +2 -1
- package/client/lib/models.d.ts +2 -2
- package/index.js +15 -2
- package/index.js.map +1 -1
- package/lib/base-client-compiler.d.ts +7 -7
- package/lib/base-client-compiler.js +158 -221
- package/lib/base-client-compiler.js.map +1 -1
- package/lib/build-info._auto-generated_.js.map +1 -1
- package/lib/change-of-file.js +12 -16
- package/lib/change-of-file.js.map +1 -1
- package/lib/compiler-manager.d.ts +1 -1
- package/lib/compiler-manager.js +147 -176
- package/lib/compiler-manager.js.map +1 -1
- package/lib/constants.d.ts +2 -1
- package/lib/constants.js +11 -9
- package/lib/constants.js.map +1 -1
- 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 +36 -42
- package/lib/incremental-watcher/incremental-watcher.js.map +1 -1
- package/lib/incremental-watcher/index.js +17 -4
- package/lib/incremental-watcher/index.js.map +1 -1
- package/lib/incremental-watcher/parcel-watcher-adapter.backend.js +112 -262
- package/lib/incremental-watcher/parcel-watcher-adapter.backend.js.map +1 -1
- package/lib/index._auto-generated_.js.map +1 -1
- package/lib/index.js +21 -8
- package/lib/index.js.map +1 -1
- package/lib/models.d.ts +2 -2
- package/lib/models.js.map +1 -1
- package/migrations/index.js +15 -2
- package/migrations/index.js.map +1 -1
- package/migrations/migrations_index._auto-generated_.js.map +1 -1
- package/package.json +13 -61
- package/src.d.ts +1 -1
- package/taon.jsonc +26 -50
- package/tmp-environment.json +8 -384
- package/websql/README.md +24 -24
- package/websql/esm2022/lib/base-client-compiler.mjs +4 -4
- package/websql/esm2022/lib/compiler-manager.mjs +3 -3
- package/websql/esm2022/lib/constants.mjs +12 -2
- package/websql/esm2022/lib/models.mjs +1 -1
- package/websql/fesm2022/incremental-compiler.mjs +4 -4
- package/websql/fesm2022/incremental-compiler.mjs.map +1 -1
- package/websql/lib/base-client-compiler.d.ts +7 -7
- package/websql/lib/compiler-manager.d.ts +1 -1
- package/websql/lib/constants.d.ts +2 -1
- package/websql/lib/models.d.ts +2 -2
- package/browser/package.json +0 -25
- package/websql/package.json +0 -25
package/lib/compiler-manager.js
CHANGED
@@ -1,219 +1,190 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.CompilerManager = void 0;
|
4
|
-
var tslib_1 = require("tslib");
|
5
4
|
//#region imports
|
6
5
|
//#region @backend
|
7
|
-
|
6
|
+
const tnp_core_1 = require("tnp-core");
|
8
7
|
//#endregion
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
const tnp_core_2 = require("tnp-core");
|
9
|
+
const tnp_core_3 = require("tnp-core");
|
10
|
+
const change_of_file_1 = require("./change-of-file");
|
11
|
+
const constants_1 = require("./constants");
|
12
|
+
const incremental_watcher_1 = require("./incremental-watcher");
|
14
13
|
//#region for debugging purpose...
|
15
14
|
// require('colors');
|
16
15
|
// const Diff = require('diff');
|
17
16
|
//#endregion
|
18
17
|
//#endregion
|
19
|
-
|
18
|
+
class CompilerManager {
|
19
|
+
//#region static
|
20
|
+
//#region singleton
|
21
|
+
static _instance;
|
22
|
+
static get Instance() {
|
23
|
+
if (!this._instance) {
|
24
|
+
this._instance = new CompilerManager();
|
25
|
+
}
|
26
|
+
return this._instance;
|
27
|
+
}
|
28
|
+
//#endregion
|
29
|
+
//#endregion
|
30
|
+
//#region fields & getters
|
31
|
+
clients = [];
|
32
|
+
asyncEventScenario;
|
33
|
+
inited = false;
|
34
|
+
filesContentCache = {};
|
20
35
|
//#endregion
|
21
36
|
//#region constructor
|
22
|
-
|
23
|
-
//#endregion
|
24
|
-
//#endregion
|
25
|
-
//#region fields & getters
|
26
|
-
this.clients = [];
|
27
|
-
this.inited = false;
|
28
|
-
this.filesContentCache = {};
|
29
|
-
}
|
30
|
-
Object.defineProperty(CompilerManager, "Instance", {
|
31
|
-
get: function () {
|
32
|
-
if (!this._instance) {
|
33
|
-
this._instance = new CompilerManager();
|
34
|
-
}
|
35
|
-
return this._instance;
|
36
|
-
},
|
37
|
-
enumerable: false,
|
38
|
-
configurable: true
|
39
|
-
});
|
37
|
+
constructor() { }
|
40
38
|
//#endregion
|
41
39
|
//#region methods / sync init
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
}, [])
|
75
|
-
.filter(function (f) {
|
76
|
-
if (client.subscribeOnlyFor.length > 0) {
|
77
|
-
return client.subscribeOnlyFor.includes(tnp_core_2.path.extname(f).replace('.', ''));
|
78
|
-
}
|
79
|
-
return true;
|
80
|
-
});
|
81
|
-
}
|
82
|
-
// console.log(`Files for client.folderPath: ${client.folderPath} client.followSymlinks: ${client.followSymlinks}`)
|
83
|
-
for (index = 0; index < files.length; index++) {
|
84
|
-
absFilePath = files[index];
|
85
|
-
fileShouldBeCached = this.fileShouldBeChecked(absFilePath, client);
|
86
|
-
if (fileShouldBeCached) {
|
87
|
-
this.filesContentCache[absFilePath] = (tnp_core_3.Helpers.readFile(absFilePath) || '').trim();
|
88
|
-
}
|
89
|
-
}
|
90
|
-
return [4 /*yield*/, client.syncAction(files, initalParams)];
|
91
|
-
case 1:
|
92
|
-
_a.sent();
|
93
|
-
return [2 /*return*/];
|
40
|
+
async syncInit(client, initialParams) {
|
41
|
+
//#region @backendFunc
|
42
|
+
let files = [];
|
43
|
+
if (tnp_core_2._.isArray(client.folderPath) && client.folderPath.length > 0) {
|
44
|
+
files = client.folderPath
|
45
|
+
.reduce((folderOrFileA, folderOrFileB) => {
|
46
|
+
folderOrFileB = (0, tnp_core_2.crossPlatformPath)(folderOrFileB);
|
47
|
+
let filesFromB = [folderOrFileB];
|
48
|
+
if (tnp_core_1.fse.existsSync(folderOrFileB) &&
|
49
|
+
tnp_core_1.fse.lstatSync(folderOrFileB).isDirectory()) {
|
50
|
+
// debugger;
|
51
|
+
const globPath = `${folderOrFileB}/**/*.*`;
|
52
|
+
const ignore = [...constants_1.IGNORE_BY_DEFAULT, ...client.ignoreFolderPatter];
|
53
|
+
// console.log({ ignore });
|
54
|
+
filesFromB = tnp_core_1.fg.sync(globPath, {
|
55
|
+
// ! TODO QUICK_FIX for v18 @LAST
|
56
|
+
// symlinks: client.followSymlinks as any,
|
57
|
+
followSymbolicLinks: client.followSymlinks,
|
58
|
+
ignore,
|
59
|
+
dot: true,
|
60
|
+
});
|
61
|
+
// console.log({
|
62
|
+
// globPath,
|
63
|
+
// globIgnore,
|
64
|
+
// GENERATEDFILES: filesFromB.length
|
65
|
+
// })
|
66
|
+
}
|
67
|
+
return folderOrFileA.concat(filesFromB);
|
68
|
+
}, [])
|
69
|
+
.filter(f => {
|
70
|
+
if (client.subscribeOnlyFor.length > 0) {
|
71
|
+
return client.subscribeOnlyFor.includes(tnp_core_2.path.extname(f).replace('.', ''));
|
94
72
|
}
|
73
|
+
return true;
|
95
74
|
});
|
96
|
-
}
|
97
|
-
|
75
|
+
}
|
76
|
+
// console.log(`Files for client.folderPath: ${client.folderPath} client.followSymlinks: ${client.followSymlinks}`)
|
77
|
+
for (let index = 0; index < files.length; index++) {
|
78
|
+
const absFilePath = files[index];
|
79
|
+
const fileShouldBeCached = this.fileShouldBeChecked(absFilePath, client);
|
80
|
+
if (fileShouldBeCached) {
|
81
|
+
this.filesContentCache[absFilePath] = (tnp_core_3.Helpers.readFile(absFilePath) || '').trim();
|
82
|
+
}
|
83
|
+
}
|
84
|
+
await client.syncAction(files, initialParams);
|
85
|
+
//#endregion
|
86
|
+
}
|
98
87
|
//#endregion
|
99
88
|
//#region methods / async init
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
case 1:
|
118
|
-
// console.log(`[ic] event ${event}, path: ${absoluteFilePath}`);
|
119
|
-
_a.sent();
|
120
|
-
return [2 /*return*/];
|
121
|
-
}
|
122
|
-
});
|
123
|
-
}); });
|
124
|
-
watchers.push(watcher);
|
125
|
-
return [2 /*return*/];
|
126
|
-
}
|
127
|
-
});
|
128
|
-
});
|
129
|
-
};
|
130
|
-
CompilerManager.prototype.actionForAsyncEvent = function (event, absoluteFilePath, client, initalParams) {
|
131
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
132
|
-
var proceeedWithAsyncChange, fileShouldBeCached, currentContent, change;
|
133
|
-
return tslib_1.__generator(this, function (_a) {
|
134
|
-
switch (_a.label) {
|
135
|
-
case 0:
|
136
|
-
//#region @backendFunc
|
137
|
-
absoluteFilePath = (0, tnp_core_2.crossPlatformPath)(absoluteFilePath);
|
138
|
-
if (event === 'addDir') {
|
139
|
-
return [2 /*return*/];
|
140
|
-
}
|
141
|
-
if (client.lastAsyncFiles.includes(absoluteFilePath)) {
|
142
|
-
return [2 /*return*/];
|
143
|
-
}
|
144
|
-
else {
|
145
|
-
client.lastAsyncFiles.push(absoluteFilePath);
|
146
|
-
}
|
147
|
-
// console.log(`[ic] final event ${event}, path: ${absoluteFilePath}`, 1);
|
148
|
-
// console.log('this.clients', this.clients.map(c => c.key))
|
149
|
-
if (event === 'unlink' && !client.notifyOnFileUnlink) {
|
150
|
-
return [2 /*return*/];
|
151
|
-
}
|
152
|
-
proceeedWithAsyncChange = true;
|
153
|
-
fileShouldBeCached = this.fileShouldBeChecked(absoluteFilePath, client);
|
154
|
-
if (!(fileShouldBeCached && event === 'change')) return [3 /*break*/, 2];
|
155
|
-
return [4 /*yield*/, tnp_core_3.Helpers.tryReadFile(absoluteFilePath)];
|
156
|
-
case 1:
|
157
|
-
currentContent = ((_a.sent()) || '').trim();
|
158
|
-
if (currentContent === this.filesContentCache[absoluteFilePath]) {
|
159
|
-
// console.log('FILE THE SAME ' + absoluteFilePath)
|
160
|
-
proceeedWithAsyncChange = false;
|
161
|
-
}
|
162
|
-
else {
|
163
|
-
this.filesContentCache[absoluteFilePath] = currentContent;
|
164
|
-
}
|
165
|
-
_a.label = 2;
|
166
|
-
case 2:
|
167
|
-
if (!proceeedWithAsyncChange) return [3 /*break*/, 6];
|
168
|
-
change = new change_of_file_1.ChangeOfFile(absoluteFilePath, event);
|
169
|
-
if (!this.asyncEventScenario) return [3 /*break*/, 4];
|
170
|
-
return [4 /*yield*/, this.asyncEventScenario(change)];
|
171
|
-
case 3:
|
172
|
-
_a.sent();
|
173
|
-
_a.label = 4;
|
174
|
-
case 4: return [4 /*yield*/, client.asyncAction(change, initalParams)];
|
175
|
-
case 5:
|
176
|
-
_a.sent();
|
177
|
-
_a.label = 6;
|
178
|
-
case 6:
|
179
|
-
client.lastAsyncFiles = client.lastAsyncFiles.filter(function (ef) { return ef !== absoluteFilePath; });
|
180
|
-
return [2 /*return*/];
|
181
|
-
}
|
182
|
-
});
|
89
|
+
async asyncInit(client, initialParams) {
|
90
|
+
//#region @backendFunc
|
91
|
+
// Helpers.log(`this.clients: ${this.clients.map(c => c.key).join(',')} `)
|
92
|
+
// Helpers.log(`this.firstFoldersToWatch: ${this.firstFoldersToWatch}`);
|
93
|
+
const watchers = [];
|
94
|
+
// console.info('FILEESS ADDED TO WATCHER INITT', this.currentObservedFolder)
|
95
|
+
const ignored = [...constants_1.IGNORE_BY_DEFAULT, ...client.ignoreFolderPatter];
|
96
|
+
// console.log('ignored async ', ignored);
|
97
|
+
const watcher = (await (0, incremental_watcher_1.incrementalWatcher)(client.filesToWatch(), {
|
98
|
+
name: `[incremental-compiler watcher for ${client.taskName}]`,
|
99
|
+
ignoreInitial: true,
|
100
|
+
followSymlinks: client.followSymlinks,
|
101
|
+
ignored,
|
102
|
+
...constants_1.COMPILER_POOLING,
|
103
|
+
})).on('all', async (event, absoluteFilePath) => {
|
104
|
+
// console.log(`[ic] event ${event}, path: ${absoluteFilePath}`);
|
105
|
+
await this.actionForAsyncEvent(event, absoluteFilePath, client, initialParams);
|
183
106
|
});
|
184
|
-
|
107
|
+
watchers.push(watcher);
|
108
|
+
//#endregion
|
109
|
+
}
|
110
|
+
async actionForAsyncEvent(event, absoluteFilePath, client, initialParams) {
|
111
|
+
//#region @backendFunc
|
112
|
+
absoluteFilePath = (0, tnp_core_2.crossPlatformPath)(absoluteFilePath);
|
113
|
+
if (event === 'addDir') {
|
114
|
+
return;
|
115
|
+
}
|
116
|
+
if (client.lastAsyncFiles.includes(absoluteFilePath)) {
|
117
|
+
return;
|
118
|
+
}
|
119
|
+
else {
|
120
|
+
client.lastAsyncFiles.push(absoluteFilePath);
|
121
|
+
}
|
122
|
+
// console.log(`[ic] final event ${event}, path: ${absoluteFilePath}`, 1);
|
123
|
+
// console.log('this.clients', this.clients.map(c => c.key))
|
124
|
+
if (event === 'unlink' && !client.notifyOnFileUnlink) {
|
125
|
+
return;
|
126
|
+
}
|
127
|
+
// console.log('toNotify', toNotify.map(c => c.key))
|
128
|
+
let proceeedWithAsyncChange = true;
|
129
|
+
const fileShouldBeCached = this.fileShouldBeChecked(absoluteFilePath, client);
|
130
|
+
// console.log(`fileShouldBeCached ${fileShouldBeCached}: ${absoluteFilePath}`)
|
131
|
+
if (fileShouldBeCached && event === 'change') {
|
132
|
+
var currentContent = ((await tnp_core_3.Helpers.tryReadFile(absoluteFilePath)) || '').trim();
|
133
|
+
if (currentContent === this.filesContentCache[absoluteFilePath]) {
|
134
|
+
// console.log('FILE THE SAME ' + absoluteFilePath)
|
135
|
+
proceeedWithAsyncChange = false;
|
136
|
+
}
|
137
|
+
else {
|
138
|
+
this.filesContentCache[absoluteFilePath] = currentContent;
|
139
|
+
}
|
140
|
+
}
|
141
|
+
// console.log({
|
142
|
+
// proceeedWithAsyncChange
|
143
|
+
// })
|
144
|
+
if (proceeedWithAsyncChange) {
|
145
|
+
const change = new change_of_file_1.ChangeOfFile(absoluteFilePath, event);
|
146
|
+
if (this.asyncEventScenario) {
|
147
|
+
await this.asyncEventScenario(change);
|
148
|
+
}
|
149
|
+
await client.asyncAction(change, initialParams);
|
150
|
+
}
|
151
|
+
client.lastAsyncFiles = client.lastAsyncFiles.filter(ef => ef !== absoluteFilePath);
|
152
|
+
// console.log('this.clients', this.clients.map(c => c.key))
|
153
|
+
//#endregion
|
154
|
+
}
|
185
155
|
//#endregion
|
186
156
|
//#region methods / add client
|
187
|
-
|
157
|
+
addClient(client) {
|
188
158
|
//#region @backendFunc
|
189
159
|
// console.log(`Cilent added "${client.key}" folders`, client.folderPath)
|
190
|
-
|
160
|
+
const existed = this.clients.find(c => c === client);
|
191
161
|
if (existed) {
|
192
|
-
tnp_core_3.Helpers.log(
|
162
|
+
tnp_core_3.Helpers.log(`Task "${client.taskName}" alread added`); // TODO @LAST
|
193
163
|
}
|
194
164
|
this.clients.push(client);
|
195
165
|
//#endregion
|
196
|
-
}
|
166
|
+
}
|
197
167
|
//#endregion
|
198
168
|
//#region private methods / prevent already inited
|
199
|
-
|
169
|
+
preventAlreadyInited() {
|
200
170
|
//#region @backendFunc
|
201
171
|
if (this.inited) {
|
202
|
-
tnp_core_3.Helpers.error(
|
172
|
+
tnp_core_3.Helpers.error(`Please init Compiler Manager only once:
|
173
|
+
CompilerManager.Instance.initScenario( ... async scenario ... );
|
174
|
+
`, false, true);
|
203
175
|
}
|
204
176
|
//#endregion
|
205
|
-
}
|
177
|
+
}
|
206
178
|
//#endregion
|
207
179
|
//#region private methods / file should be checked
|
208
|
-
|
180
|
+
fileShouldBeChecked(absFilePath, client) {
|
209
181
|
//#region @backendFunc
|
210
|
-
|
182
|
+
const fileShouldBeCached = !tnp_core_2._.isUndefined(client.folderPathContentCheck.find(patterFolder => {
|
211
183
|
return (0, tnp_core_2.crossPlatformPath)(absFilePath).startsWith((0, tnp_core_2.crossPlatformPath)(patterFolder));
|
212
184
|
}));
|
213
185
|
return fileShouldBeCached;
|
214
186
|
//#endregion
|
215
|
-
}
|
216
|
-
|
217
|
-
}());
|
187
|
+
}
|
188
|
+
}
|
218
189
|
exports.CompilerManager = CompilerManager;
|
219
190
|
//# sourceMappingURL=compiler-manager.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"compiler-manager.js","sourceRoot":"","sources":[""],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"compiler-manager.js","sourceRoot":"","sources":["c:/Users/darek/projects/npm/taon-dev/incremental-compiler/src/lib/comp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+1,17 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.IGNORE_BY_DEFAULT = exports.COMPILER_POOLING = void 0;
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
//
|
11
|
-
//
|
12
|
-
//
|
4
|
+
let COMPILER_POOLING = {};
|
5
|
+
exports.COMPILER_POOLING = COMPILER_POOLING;
|
6
|
+
//#region @backend
|
7
|
+
if (process.platform === 'win32') {
|
8
|
+
exports.COMPILER_POOLING = COMPILER_POOLING = {
|
9
|
+
// TODO when not in admin mode vscode on windows -> problem with moving/deleting files inside vscode
|
10
|
+
// usePolling: true,
|
11
|
+
// interval: 1000,
|
12
|
+
// binaryInterval: 2000,
|
13
|
+
};
|
14
|
+
}
|
13
15
|
exports.IGNORE_BY_DEFAULT = [
|
14
16
|
'**/node_modules/**/*.*',
|
15
17
|
'**/node_modules',
|
package/lib/constants.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["c:/Users/darek/projects/npm/taon-dev/incremental-compiler/src/lib/constants.ts"],"names":[],"mappings":";;;AAEC,IAAI,gBAAgB,GAAG,EAAE,CAAC;AAanB,4CAAgB;AAXvB,kBAAkB;AACnB,IAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;IACjC,2BAAA,gBAAgB,GAAG;IACjB,oGAAoG;IACrG,oBAAoB;IACpB,kBAAkB;IAClB,wBAAwB;KACxB,CAAA;AACF,CAAC;AAMY,QAAA,iBAAiB,GAAG;IAC/B,wBAAwB;IACxB,iBAAiB;IACjB,gBAAgB;IAChB,SAAS;CACV,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"incremental-watcher-events.js","sourceRoot":"","sources":[""],"names":[],"mappings":""}
|
1
|
+
{"version":3,"file":"incremental-watcher-events.js","sourceRoot":"","sources":["c:/Users/darek/projects/npm/taon-dev/incremental-compiler/src/lib/incremental-watcher/incremental-watcher-events.ts"],"names":[],"mappings":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"incremental-watcher-instance.js","sourceRoot":"","sources":[""],"names":[],"mappings":""}
|
1
|
+
{"version":3,"file":"incremental-watcher-instance.js","sourceRoot":"","sources":["c:/Users/darek/projects/npm/taon-dev/incremental-compiler/src/lib/incremental-watcher/incremental-watcher-instance.ts"],"names":[],"mappings":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"incremental-watcher-options.js","sourceRoot":"","sources":[""],"names":[],"mappings":""}
|
1
|
+
{"version":3,"file":"incremental-watcher-options.js","sourceRoot":"","sources":["c:/Users/darek/projects/npm/taon-dev/incremental-compiler/src/lib/incremental-watcher/incremental-watcher-options.ts"],"names":[],"mappings":""}
|
@@ -1,49 +1,43 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.incrementalWatcher = incrementalWatcher;
|
4
|
-
|
5
|
-
var tnp_core_1 = require("tnp-core");
|
4
|
+
const tnp_core_1 = require("tnp-core");
|
6
5
|
//#region @backend
|
7
|
-
|
8
|
-
|
6
|
+
const tnp_core_2 = require("tnp-core");
|
7
|
+
const parcel_watcher_adapter_backend_1 = require("./parcel-watcher-adapter.backend");
|
9
8
|
//#endregion
|
10
|
-
function incrementalWatcher(filePath, watchOptions) {
|
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
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
return [2 /*return*/, tnp_core_2.chokidar.watch(filePath, watchOptions)];
|
44
|
-
}
|
45
|
-
return [2 /*return*/];
|
46
|
-
});
|
47
|
-
});
|
9
|
+
async function incrementalWatcher(filePath, watchOptions) {
|
10
|
+
//#region @backendFunc
|
11
|
+
if (!watchOptions) {
|
12
|
+
watchOptions = {};
|
13
|
+
}
|
14
|
+
if (!watchOptions?.engine ||
|
15
|
+
(tnp_core_1._.isString(watchOptions?.engine) && watchOptions?.engine.trim() === '')) {
|
16
|
+
// engine = 'chokidar';
|
17
|
+
// @ts-ignore
|
18
|
+
watchOptions.engine = '@parcel/watcher';
|
19
|
+
}
|
20
|
+
// if (frameworkName === 'taon') {
|
21
|
+
// // @ts-ignore
|
22
|
+
// watchOptions.engine = 'chokidar';
|
23
|
+
// } else {
|
24
|
+
// // @ts-ignore
|
25
|
+
// watchOptions.engine = '@parcel/watcher';
|
26
|
+
// }
|
27
|
+
// @LAST @parcel/watcher sometime does not work :/
|
28
|
+
watchOptions.engine = 'chokidar';
|
29
|
+
// Helpers.logInfo(`Using watcher: ${watchOptions.engine}`)
|
30
|
+
// @ts-ignore
|
31
|
+
if (watchOptions?.engine === '@parcel/watcher') {
|
32
|
+
const instance = new parcel_watcher_adapter_backend_1.ParcelWatcherAdapter(filePath, watchOptions);
|
33
|
+
return instance;
|
34
|
+
}
|
35
|
+
else {
|
36
|
+
const opt = tnp_core_1._.cloneDeep(watchOptions);
|
37
|
+
// @ts-ignore
|
38
|
+
opt['ignorePermissionErrors'] = true;
|
39
|
+
return tnp_core_2.chokidar.watch(filePath, watchOptions);
|
40
|
+
}
|
41
|
+
//#endregion
|
48
42
|
}
|
49
43
|
//# sourceMappingURL=incremental-watcher.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"incremental-watcher.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;AASA,gDA4CC
|
1
|
+
{"version":3,"file":"incremental-watcher.js","sourceRoot":"","sources":["c:/Users/darek/projects/npm/taon-dev/incremental-compiler/src/lib/incremental-watcher/incremental-watcher.ts"],"names":[],"mappings":";;AASA,gDA4CC;AArDD,uCAA2D;AAG3D,kBAAkB;AAClB,uCAAoC;AACpC,qFAAwE;AAExE,YAAY;AAEL,KAAK,UAAU,kBAAkB,CACtC,QAA2B,EAC3B,YAAuC;IAEvC,sBAAsB;IACtB,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,YAAY,GAAG,EAAS,CAAC;IAC3B,CAAC;IAED,IACE,CAAC,YAAY,EAAE,MAAM;QACrB,CAAC,YAAC,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,YAAY,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EACxE,CAAC;QACD,uBAAuB;QACvB,aAAa;QACb,YAAY,CAAC,MAAM,GAAG,iBAAiB,CAAC;IAC1C,CAAC;IAED,kCAAkC;IAClC,kBAAkB;IAClB,sCAAsC;IACtC,WAAW;IACX,kBAAkB;IAClB,6CAA6C;IAC7C,IAAI;IAEJ,kDAAkD;IAClD,YAAY,CAAC,MAAM,GAAG,UAAU,CAAC;IAEjC,2DAA2D;IAE3D,aAAa;IACb,IAAI,YAAY,EAAE,MAAM,KAAK,iBAAiB,EAAE,CAAC;QAE/C,MAAM,QAAQ,GAAG,IAAI,qDAAoB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAClE,OAAO,QAAe,CAAC;IAEzB,CAAC;SAAM,CAAC;QACN,MAAM,GAAG,GAAG,YAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QACtC,aAAa;QACb,GAAG,CAAC,wBAAwB,CAAC,GAAG,IAAI,CAAC;QACrC,OAAO,mBAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAChD,CAAC;IACD,YAAY;AACd,CAAC"}
|
@@ -1,7 +1,20 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
tslib_1.__exportStar(require("./incremental-watcher"), exports);
|
17
|
+
__exportStar(require("./incremental-watcher-instance"), exports);
|
18
|
+
__exportStar(require("./incremental-watcher-options"), exports);
|
19
|
+
__exportStar(require("./incremental-watcher"), exports);
|
7
20
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":[""],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["c:/Users/darek/projects/npm/taon-dev/incremental-compiler/src/lib/incremental-watcher/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iEAA+C;AAC/C,gEAA8C;AAC9C,wDAAsC"}
|