incremental-compiler 21.0.30 → 21.0.32

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incremental-compiler/browser",
3
- "version": "21.0.30",
3
+ "version": "21.0.32",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.0.0",
6
6
  "@angular/core": "^21.0.0"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incremental-compiler/browser-prod",
3
- "version": "21.0.30",
3
+ "version": "21.0.32",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.0.0",
6
6
  "@angular/core": "^21.0.0"
@@ -21,4 +21,4 @@ export declare const CURRENT_PACKAGE_TAON_VERSION = "v21";
21
21
  /**
22
22
  * Autogenerated by current cli tool. Use *tnp release* to bump version.
23
23
  */
24
- export declare const CURRENT_PACKAGE_VERSION = "21.0.30";
24
+ export declare const CURRENT_PACKAGE_VERSION = "21.0.32";
@@ -25,6 +25,6 @@ exports.CURRENT_PACKAGE_TAON_VERSION = 'v21';
25
25
  /**
26
26
  * Autogenerated by current cli tool. Use *tnp release* to bump version.
27
27
  */
28
- exports.CURRENT_PACKAGE_VERSION = '21.0.30';
28
+ exports.CURRENT_PACKAGE_VERSION = '21.0.32';
29
29
  // THIS FILE IS GENERATED - DO NOT MODIFY
30
30
  //# sourceMappingURL=build-info._auto-generated_.js.map
package/lib/package.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "incremental-compiler/lib",
3
- "version": "21.0.30"
3
+ "version": "21.0.32"
4
4
  }
@@ -1,251 +1,251 @@
1
- import { fse } from "tnp-core/lib-prod";
2
- import { path, crossPlatformPath, ___NS__cloneDeep, ___NS__isArray, ___NS__isFunction, ___NS__isString, ___NS__isUndefined, UtilsMessages__NS__compilationWrapper } from "tnp-core/lib-prod";
3
- import { Helpers__NS__error, Helpers__NS__log, Helpers__NS__logWarn, Helpers__NS__runSyncOrAsync } from "tnp-core/lib-prod";
4
- import { CLI } from "tnp-core/lib-prod";
5
- import { CompilerManager } from "./compiler-manager";
6
- import { mapForWatching } from "./helpers";
7
- class BaseClientCompiler {
8
- //#region fields & getters
9
- followSymlinks;
10
- subscribeOnlyFor = [];
11
- executeOutsideScenario;
12
- taskName;
13
- engine;
14
- notifyOnFileUnlink;
15
- onlySingleRun = true;
16
- ignoreFolderPatter;
17
- pathResolve = false;
18
- isInitedWithOptions = false;
19
- __folderPath = [];
20
- lastAsyncFiles = [];
21
- isWatchCompilation = false;
22
- folderPathContentCheck = [];
23
- set folderPath(v) {
24
- if (___NS__isString(v)) {
25
- v = [v];
26
- }
27
- this.__folderPath = v;
28
- }
29
- get folderPath() {
30
- if (!this.pathResolve) {
31
- this.pathResolve = true;
32
- this.__folderPath.map((p) => {
33
- if (fse.existsSync(p)) {
34
- return crossPlatformPath(path.resolve(p));
35
- } else {
36
- Helpers__NS__logWarn(
37
- `[BaseClientCompiler] Task "${this.taskName}" folderPath doesn't not exist ${this.folderPath}`
38
- );
39
- return void 0;
40
- }
41
- }).filter((f) => !!f);
42
- }
43
- return this.__folderPath;
44
- }
45
- //#endregion
46
- //#region constructor
47
- //#region @backend
48
- constructor(options) {
49
- if (___NS__isUndefined(options)) {
50
- this.isInitedWithOptions = false;
51
- } else {
52
- this.isInitedWithOptions = true;
53
- this.fixAndAssignOptions(options);
54
- }
55
- }
56
- //#endregion
57
- //#endregion
58
- //#region init options
59
- /**
60
- * manually init options (when no passing object to constructor super() )
61
- */
62
- initOptions(options) {
63
- if (this.isInitedWithOptions === true) {
64
- Helpers__NS__logWarn(
65
- `[incremental-compiler] You are reinit instance class again [task name: "${options?.taskName}"]`
66
- );
67
- }
68
- if (!options) {
69
- Helpers__NS__error(
70
- `[incremental-compiler] Please init instance with options config`,
71
- false,
72
- true
73
- );
74
- }
75
- this.isInitedWithOptions = true;
76
- this.fixAndAssignOptions(options);
77
- }
78
- //#endregion
79
- //#region run task
80
- /**
81
- * do not override this
82
- */
83
- async runTask(options) {
84
- this.isWatchCompilation = options?.watch;
85
- if (options?.watch) {
86
- await this.startAndWatch(options);
87
- } else {
88
- await this.start(options);
89
- }
90
- return this;
91
- }
92
- //#endregion
93
- //#region start
94
- /**
95
- * @deprecated use runTask instead
96
- * Do not override this
97
- */
98
- async start(options) {
99
- let { taskName, afterInitCallBack, initialParams } = options || {};
100
- CompilerManager.Instance.addClient(this);
101
- if (!this.isInitedWithOptions) {
102
- Helpers__NS__error(
103
- `[BaseClientCompiler] Please init client class intance with options`,
104
- false,
105
- true
106
- );
107
- }
108
- taskName = this.fixTaskName(taskName);
109
- this.taskName = taskName;
110
- await UtilsMessages__NS__compilationWrapper(
111
- async () => {
112
- await CompilerManager.Instance.syncInit(this, initialParams);
113
- },
114
- `${CLI.chalk.green("sync action")} for ${taskName}`,
115
- "Event:"
116
- );
117
- if (___NS__isFunction(afterInitCallBack)) {
118
- await Helpers__NS__runSyncOrAsync({
119
- functionFn: afterInitCallBack,
120
- arrayOfParams: [initialParams]
121
- });
122
- }
123
- return this;
124
- }
125
- //#endregion
126
- //#region start and watch
127
- /**
128
- * @deprecated use runTask instead
129
- * Do not override this
130
- */
131
- async startAndWatch(options) {
132
- let { taskName, watchOnly, initialParams } = options || {};
133
- this.onlySingleRun = false;
134
- if (!this.isInitedWithOptions) {
135
- Helpers__NS__error(
136
- `[BaseClientCompiler] Please init client class intance with options`,
137
- false,
138
- true
139
- );
140
- }
141
- taskName = this.fixTaskName(taskName);
142
- this.taskName = taskName;
143
- if (this.folderPath.length > 0) {
144
- if (watchOnly) {
145
- console.log(
146
- CLI.chalk.gray(
147
- `[incremental-compiler] Watch mode only for "${taskName}"`
148
- )
149
- );
150
- } else {
151
- await this.start(options);
152
- }
153
- if (___NS__isFunction(this.preAsyncAction)) {
154
- await UtilsMessages__NS__compilationWrapper(
155
- async () => {
156
- await this.preAsyncAction(initialParams || {});
157
- },
158
- `${CLI.chalk.green("pre-async action")} for ${taskName}`,
159
- "Event:"
160
- );
161
- }
162
- await CompilerManager.Instance.asyncInit(this, initialParams || {});
163
- } else {
164
- Helpers__NS__log(`No action for task: ${taskName}.. starting task`);
165
- await this.start(options);
166
- }
167
- return this;
168
- }
169
- //#endregion
170
- //#region sync action
171
- /**
172
- *
173
- * @param absolteFilesPathes for each watched file
174
- * @returns
175
- */
176
- syncAction(absolteFilesPathes, initialParams) {
177
- return void 0;
178
- }
179
- //#endregion
180
- //#region pre async action
181
- async preAsyncAction(initialParams) {
182
- }
183
- //#endregion
184
- //#region async action
185
- asyncAction(asyncEvents, initialParams) {
186
- return void 0;
187
- }
188
- //#endregion
189
- //#region get files to watch
190
- getFilesFolderPatternsToWatch() {
191
- const folders = [];
192
- [this].forEach((c) => {
193
- c.folderPath.forEach((folderPath) => {
194
- if (___NS__isString(folderPath) && !folders.includes(folderPath)) {
195
- const mapped = mapForWatching(folderPath);
196
- folders.push(...mapped);
197
- }
198
- });
199
- });
200
- return ___NS__cloneDeep(folders);
201
- }
202
- //#endregion
203
- //#region private methods
204
- //#region private methods / fix and assign options
205
- fixAndAssignOptions(options) {
206
- if (!___NS__isArray(options.subscribeOnlyFor)) {
207
- options.subscribeOnlyFor = [];
208
- }
209
- if (___NS__isUndefined(options.folderPath)) {
210
- options.folderPath = [];
211
- }
212
- if (___NS__isUndefined(options.folderPathContentCheck)) {
213
- options.folderPathContentCheck = [];
214
- }
215
- if (___NS__isUndefined(options.ignoreFolderPatter)) {
216
- options.ignoreFolderPatter = [];
217
- }
218
- if (___NS__isString(options.folderPath)) {
219
- options.folderPath = [options.folderPath];
220
- }
221
- if (___NS__isString(options.folderPathContentCheck)) {
222
- options.folderPathContentCheck = [options.folderPathContentCheck];
223
- }
224
- if (!___NS__isString(options.folderPath) && !___NS__isArray(options.folderPath)) {
225
- Helpers__NS__error(`Folder path shoudl be string or array`, false, true);
226
- }
227
- if (!___NS__isString(options.folderPathContentCheck) && !___NS__isArray(options.folderPathContentCheck)) {
228
- Helpers__NS__error(`Folder path shoudl be string or array`, false, true);
229
- }
230
- if (___NS__isUndefined(options.followSymlinks)) {
231
- options.followSymlinks = false;
232
- }
233
- if (___NS__isUndefined(options.notifyOnFileUnlink)) {
234
- options.notifyOnFileUnlink = false;
1
+ //#region imports
2
+ import { fse } from 'tnp-core/lib-prod'; // @backend
3
+ import { path, crossPlatformPath, ___NS__cloneDeep, ___NS__isArray, ___NS__isFunction, ___NS__isString, ___NS__isUndefined, UtilsMessages__NS__compilationWrapper } from 'tnp-core/lib-prod';
4
+ import { Helpers__NS__error, Helpers__NS__log, Helpers__NS__logWarn, Helpers__NS__runSyncOrAsync } from 'tnp-core/lib-prod';
5
+ import { CLI } from 'tnp-core/lib-prod';
6
+ import { CompilerManager } from './compiler-manager';
7
+ import { mapForWatching } from './helpers';
8
+ //#endregion
9
+ export class BaseClientCompiler {
10
+ set folderPath(v) {
11
+ //#region @backend
12
+ if (___NS__isString(v)) {
13
+ v = [v];
14
+ }
15
+ this.__folderPath = v;
16
+ //#endregion
17
+ }
18
+ get folderPath() {
19
+ //#region @backendFunc
20
+ if (!this.pathResolve) {
21
+ this.pathResolve = true;
22
+ this.__folderPath
23
+ .map(p => {
24
+ if (fse.existsSync(p)) {
25
+ return crossPlatformPath(path.resolve(p));
26
+ }
27
+ else {
28
+ Helpers__NS__logWarn(`[BaseClientCompiler] Task "${this.taskName}" folderPath doesn't not exist ${this.folderPath}`);
29
+ return void 0;
30
+ }
31
+ })
32
+ .filter(f => !!f);
33
+ }
34
+ return this.__folderPath;
35
+ //#endregion
36
+ }
37
+ //#endregion
38
+ //#region constructor
39
+ //#region @backend
40
+ constructor(options) {
41
+ this.subscribeOnlyFor = [];
42
+ this.onlySingleRun = true;
43
+ this.pathResolve = false;
44
+ this.isInitedWithOptions = false;
45
+ this.__folderPath = [];
46
+ this.lastAsyncFiles = [];
47
+ this.isWatchCompilation = false;
48
+ this.folderPathContentCheck = [];
49
+ if (___NS__isUndefined(options)) {
50
+ this.isInitedWithOptions = false;
51
+ // setTimeout(() => {
52
+ // if (!this.isInitedWithOptions) {
53
+ // Helpers__NS__logInfo(
54
+ // `[incremental-compiler] Compiler class instace without init option, task name: "${this.taskName}"
55
+ // `,
56
+ // );
57
+ // }
58
+ // }, 1000);
59
+ }
60
+ else {
61
+ this.isInitedWithOptions = true;
62
+ this.fixAndAssignOptions(options);
63
+ }
235
64
  }
236
- Object.assign(this, options);
237
- }
238
- //#endregion
239
- //#region private methods / fix task name
240
- fixTaskName(taskName) {
241
- if (!___NS__isString(taskName)) {
242
- taskName = `task "${this.taskName}"`;
65
+ //#endregion
66
+ //#endregion
67
+ //#region init options
68
+ /**
69
+ * manually init options (when no passing object to constructor super() )
70
+ */
71
+ initOptions(options) {
72
+ //#region @backendFunc
73
+ if (this.isInitedWithOptions === true) {
74
+ Helpers__NS__logWarn(`[incremental-compiler] You are reinit instance class again [task name: "${options?.taskName}"]`);
75
+ }
76
+ if (!options) {
77
+ Helpers__NS__error(`[incremental-compiler] Please init instance with options config`, false, true);
78
+ }
79
+ this.isInitedWithOptions = true;
80
+ this.fixAndAssignOptions(options);
81
+ //#endregion
82
+ }
83
+ //#endregion
84
+ //#region run task
85
+ /**
86
+ * do not override this
87
+ */
88
+ async runTask(options) {
89
+ //#region @backendFunc
90
+ // @ts-ignore
91
+ this.isWatchCompilation = options?.watch;
92
+ if (options?.watch) {
93
+ await this.startAndWatch(options);
94
+ }
95
+ else {
96
+ await this.start(options);
97
+ }
98
+ return this;
99
+ //#endregion
100
+ }
101
+ //#endregion
102
+ //#region start
103
+ /**
104
+ * @deprecated use runTask instead
105
+ * Do not override this
106
+ */
107
+ async start(options) {
108
+ //#region @backendFunc
109
+ let { taskName, afterInitCallBack, initialParams } = options || {};
110
+ CompilerManager.Instance.addClient(this);
111
+ if (!this.isInitedWithOptions) {
112
+ Helpers__NS__error(`[BaseClientCompiler] Please init client class intance with options`, false, true);
113
+ }
114
+ taskName = this.fixTaskName(taskName);
115
+ // @ts-ignore
116
+ this.taskName = taskName;
117
+ await UtilsMessages__NS__compilationWrapper(async () => {
118
+ await CompilerManager.Instance.syncInit(this, initialParams);
119
+ }, `${CLI.chalk.green('sync action')} for ${taskName}`, 'Event:');
120
+ if (___NS__isFunction(afterInitCallBack)) {
121
+ await Helpers__NS__runSyncOrAsync({
122
+ functionFn: afterInitCallBack,
123
+ arrayOfParams: [initialParams],
124
+ });
125
+ }
126
+ return this;
127
+ //#endregion
128
+ }
129
+ //#endregion
130
+ //#region start and watch
131
+ /**
132
+ * @deprecated use runTask instead
133
+ * Do not override this
134
+ */
135
+ async startAndWatch(options) {
136
+ //#region @backendFunc
137
+ let { taskName, watchOnly, initialParams } = options || {};
138
+ this.onlySingleRun = false;
139
+ if (!this.isInitedWithOptions) {
140
+ Helpers__NS__error(`[BaseClientCompiler] Please init client class intance with options`, false, true);
141
+ }
142
+ taskName = this.fixTaskName(taskName);
143
+ // @ts-ignore
144
+ this.taskName = taskName;
145
+ if (this.folderPath.length > 0) {
146
+ if (watchOnly) {
147
+ console.log(CLI.chalk.gray(`[incremental-compiler] Watch mode only for "${taskName}"`));
148
+ }
149
+ else {
150
+ await this.start(options);
151
+ }
152
+ if (___NS__isFunction(this.preAsyncAction)) {
153
+ await UtilsMessages__NS__compilationWrapper(async () => {
154
+ await this.preAsyncAction((initialParams || {}));
155
+ }, `${CLI.chalk.green('pre-async action')} for ${taskName}`, 'Event:');
156
+ }
157
+ await CompilerManager.Instance.asyncInit(this, initialParams || {});
158
+ }
159
+ else {
160
+ Helpers__NS__log(`No action for task: ${taskName}.. starting task`);
161
+ await this.start(options);
162
+ }
163
+ return this;
164
+ //#endregion
165
+ }
166
+ //#endregion
167
+ //#region sync action
168
+ /**
169
+ *
170
+ * @param absolteFilesPathes for each watched file
171
+ * @returns
172
+ */
173
+ syncAction(absolteFilesPathes, initialParams) {
174
+ return void 0;
175
+ }
176
+ //#endregion
177
+ //#region pre async action
178
+ async preAsyncAction(initialParams) { }
179
+ //#endregion
180
+ //#region async action
181
+ asyncAction(asyncEvents, initialParams) {
182
+ return void 0;
183
+ }
184
+ //#endregion
185
+ //#region get files to watch
186
+ getFilesFolderPatternsToWatch() {
187
+ //#region @backendFunc
188
+ const folders = [];
189
+ // this.clients.forEach(c => {
190
+ [this].forEach(c => {
191
+ // console.log("c.folderPath", c.folderPath)
192
+ c.folderPath.forEach(folderPath => {
193
+ // console.log(`fp`, fp)
194
+ if (___NS__isString(folderPath) && !folders.includes(folderPath)) {
195
+ const mapped = mapForWatching(folderPath);
196
+ folders.push(...mapped);
197
+ }
198
+ });
199
+ });
200
+ return ___NS__cloneDeep(folders);
201
+ //#endregion
202
+ }
203
+ //#endregion
204
+ //#region private methods
205
+ //#region private methods / fix and assign options
206
+ fixAndAssignOptions(options) {
207
+ //#region @backendFunc
208
+ if (!___NS__isArray(options.subscribeOnlyFor)) {
209
+ options.subscribeOnlyFor = [];
210
+ }
211
+ if (___NS__isUndefined(options.folderPath)) {
212
+ options.folderPath = [];
213
+ }
214
+ if (___NS__isUndefined(options.folderPathContentCheck)) {
215
+ options.folderPathContentCheck = [];
216
+ }
217
+ if (___NS__isUndefined(options.ignoreFolderPatter)) {
218
+ options.ignoreFolderPatter = [];
219
+ }
220
+ if (___NS__isString(options.folderPath)) {
221
+ options.folderPath = [options.folderPath];
222
+ }
223
+ if (___NS__isString(options.folderPathContentCheck)) {
224
+ options.folderPathContentCheck = [options.folderPathContentCheck];
225
+ }
226
+ if (!___NS__isString(options.folderPath) && !___NS__isArray(options.folderPath)) {
227
+ Helpers__NS__error(`Folder path shoudl be string or array`, false, true);
228
+ }
229
+ if (!___NS__isString(options.folderPathContentCheck) &&
230
+ !___NS__isArray(options.folderPathContentCheck)) {
231
+ Helpers__NS__error(`Folder path shoudl be string or array`, false, true);
232
+ }
233
+ if (___NS__isUndefined(options.followSymlinks)) {
234
+ options.followSymlinks = false;
235
+ }
236
+ if (___NS__isUndefined(options.notifyOnFileUnlink)) {
237
+ options.notifyOnFileUnlink = false;
238
+ }
239
+ // console.log('ASSIGNE', options)
240
+ Object.assign(this, options);
241
+ //#endregion
242
+ }
243
+ //#endregion
244
+ //#region private methods / fix task name
245
+ fixTaskName(taskName) {
246
+ if (!___NS__isString(taskName)) {
247
+ taskName = `task "${this.taskName}"`;
248
+ }
249
+ return taskName;
243
250
  }
244
- return taskName;
245
- }
246
- //#endregion
247
- //#endregion
248
251
  }
249
- export {
250
- BaseClientCompiler
251
- };
@@ -1,14 +1,26 @@
1
- const BUILD_FRAMEWORK_CLI_NAME = "tnp";
2
- const APP_ID = "com.domain.example.incremental-compiler";
3
- const BUILD_BASE_HREF = "";
4
- const PROJECT_NPM_NAME = "incremental-compiler";
5
- const CURRENT_PACKAGE_TAON_VERSION = "v21";
6
- const CURRENT_PACKAGE_VERSION = "21.0.30";
7
- export {
8
- APP_ID,
9
- BUILD_BASE_HREF,
10
- BUILD_FRAMEWORK_CLI_NAME,
11
- CURRENT_PACKAGE_TAON_VERSION,
12
- CURRENT_PACKAGE_VERSION,
13
- PROJECT_NPM_NAME
14
- };
1
+ // THIS FILE IS GENERATED - DO NOT MODIFY
2
+ /**
3
+ * Autogenerated by current cli tool
4
+ */
5
+ export const BUILD_FRAMEWORK_CLI_NAME = 'tnp';
6
+ /**
7
+ * This value can be change in taon.jsonc (appId)
8
+ */
9
+ export const APP_ID = 'com.domain.example.incremental-compiler';
10
+ /**
11
+ * Autogenerated by current cli tool
12
+ */
13
+ export const BUILD_BASE_HREF = '';
14
+ /**
15
+ * This value can be change in taon.jsonc (overrideNpmName)
16
+ */
17
+ export const PROJECT_NPM_NAME = 'incremental-compiler';
18
+ /**
19
+ * Taon version from you project taon.json
20
+ */
21
+ export const CURRENT_PACKAGE_TAON_VERSION = 'v21';
22
+ /**
23
+ * Autogenerated by current cli tool. Use *tnp release* to bump version.
24
+ */
25
+ export const CURRENT_PACKAGE_VERSION = '21.0.32';
26
+ // THIS FILE IS GENERATED - DO NOT MODIFY