tnp-core 19.0.21 → 19.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 +20 -20
- package/browser/README.md +24 -24
- package/browser/fesm2022/tnp-core.mjs +134 -1
- package/browser/fesm2022/tnp-core.mjs.map +1 -1
- package/browser/lib/helpers.d.ts +6 -0
- package/browser/package.json +1 -1
- package/cli.backend.js +2 -2
- package/cli.backend.js.map +1 -1
- package/client/README.md +24 -24
- package/client/fesm2022/tnp-core.mjs +134 -1
- package/client/fesm2022/tnp-core.mjs.map +1 -1
- package/client/lib/helpers.d.ts +6 -0
- package/client/package.json +1 -1
- package/index.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/build-info._auto-generated_.js.map +1 -1
- package/lib/command-exists.js.map +1 -1
- package/lib/core-cli.js.map +1 -1
- package/lib/core-config.js.map +1 -1
- package/lib/core-imports.js.map +1 -1
- package/lib/core-models.js.map +1 -1
- package/lib/framework-name.js.map +1 -1
- package/lib/helpers-isomorphic.js.map +1 -1
- package/lib/helpers-messages.js.map +1 -1
- package/lib/helpers.d.ts +6 -0
- package/lib/helpers.js +89 -0
- package/lib/helpers.js.map +1 -1
- package/lib/index._auto-generated_.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/node-chalk-mock.js +2 -2
- package/lib/node-chalk-mock.js.map +1 -1
- package/lib/node-path-mock.js +2 -2
- package/lib/node-path-mock.js.map +1 -1
- package/lib/progress-data.js.map +1 -1
- package/lib/public-api.js.map +1 -1
- package/lib/required-global-npm-packages.js.map +1 -1
- package/lib/utils.js +33 -1
- package/lib/utils.js.map +1 -1
- package/migrations/index.js.map +1 -1
- package/migrations/migrations_index._auto-generated_.js.map +1 -1
- package/package.json +1 -1
- package/tmp-environment.json +3 -3
- package/websql/README.md +24 -24
- package/websql/fesm2022/tnp-core.mjs +134 -1
- package/websql/fesm2022/tnp-core.mjs.map +1 -1
- package/websql/lib/helpers.d.ts +6 -0
- package/websql/package.json +1 -1
package/README.md
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
# taon-core ( tnp-core )
|
2
|
-
|
3
|
-
- Part of [taon.dev](https://github.com/darekf77/taon)
|
4
|
-
- JavasScript/Typescript most essential helpers
|
5
|
-
- Basic taon releated helpers
|
6
|
-
- Purpose:
|
7
|
-
+ lightweight most essential helpers library
|
8
|
-
+ crossplatform helpers for NodeJs/Browser
|
9
|
-
|
10
|
-
|
11
|
-
## Usage
|
12
|
-
- in taon isomorphic libs/apps or any NodeJS apps/libs:
|
13
|
-
```ts
|
14
|
-
import { Helpers } from 'tnp-core';
|
15
|
-
```
|
16
|
-
|
17
|
-
- in any frontend browser apps (except taon libs/apps)
|
18
|
-
```ts
|
19
|
-
import { Helpers } from 'tnp-core/browser';
|
20
|
-
```
|
1
|
+
# taon-core ( tnp-core )
|
2
|
+
|
3
|
+
- Part of [taon.dev](https://github.com/darekf77/taon)
|
4
|
+
- JavasScript/Typescript most essential helpers
|
5
|
+
- Basic taon releated helpers
|
6
|
+
- Purpose:
|
7
|
+
+ lightweight most essential helpers library
|
8
|
+
+ crossplatform helpers for NodeJs/Browser
|
9
|
+
|
10
|
+
|
11
|
+
## Usage
|
12
|
+
- in taon isomorphic libs/apps or any NodeJS apps/libs:
|
13
|
+
```ts
|
14
|
+
import { Helpers } from 'tnp-core';
|
15
|
+
```
|
16
|
+
|
17
|
+
- in any frontend browser apps (except taon libs/apps)
|
18
|
+
```ts
|
19
|
+
import { Helpers } from 'tnp-core/browser';
|
20
|
+
```
|
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.
|
@@ -2609,6 +2609,9 @@ var UtilsTerminal;
|
|
2609
2609
|
/* */
|
2610
2610
|
/* */
|
2611
2611
|
/* */
|
2612
|
+
return (void 0);
|
2613
|
+
// TODO @LAST
|
2614
|
+
// let shouldClear = true;
|
2612
2615
|
/* */
|
2613
2616
|
/* */
|
2614
2617
|
/* */
|
@@ -2617,7 +2620,36 @@ var UtilsTerminal;
|
|
2617
2620
|
/* */
|
2618
2621
|
/* */
|
2619
2622
|
/* */
|
2620
|
-
|
2623
|
+
/* */
|
2624
|
+
/* */
|
2625
|
+
/* */
|
2626
|
+
/* */
|
2627
|
+
/* */
|
2628
|
+
/* */
|
2629
|
+
/* */
|
2630
|
+
//#region @browser
|
2631
|
+
// const isDevToolsOpen = (() => {
|
2632
|
+
// const threshold = 160; // devtools resizing causes this to be larger
|
2633
|
+
// return (
|
2634
|
+
// window.outerHeight - window.innerHeight > threshold ||
|
2635
|
+
// window.outerWidth - window.innerWidth > threshold
|
2636
|
+
// );
|
2637
|
+
// })();
|
2638
|
+
// if (isDevToolsOpen) {
|
2639
|
+
// shouldClear = false;
|
2640
|
+
// }
|
2641
|
+
//#endregion
|
2642
|
+
// if (shouldClear) {
|
2643
|
+
// Helpers.msgCacheClear?.();
|
2644
|
+
// console.clear?.();
|
2645
|
+
// }
|
2646
|
+
// console.log('\x1Bc');
|
2647
|
+
// process.stdout.write('\033c\033[3J');
|
2648
|
+
// try {
|
2649
|
+
// run('clear').sync()
|
2650
|
+
// } catch (error) {
|
2651
|
+
// console.log('clear console not succedd')
|
2652
|
+
// }
|
2621
2653
|
};
|
2622
2654
|
//#endregion
|
2623
2655
|
//#region transform choices
|
@@ -3754,6 +3786,7 @@ class HelpersMessages extends HelpersIsomorphic {
|
|
3754
3786
|
/* */
|
3755
3787
|
/* */
|
3756
3788
|
/* */
|
3789
|
+
/* */
|
3757
3790
|
//#region @browser
|
3758
3791
|
const encoding = 'utf8';
|
3759
3792
|
/* */
|
@@ -3844,6 +3877,7 @@ class HelpersCore extends HelpersMessages {
|
|
3844
3877
|
* get electron browser ipc renderer
|
3845
3878
|
*/
|
3846
3879
|
get ipcRenderer() {
|
3880
|
+
// typeof ipcRenderer
|
3847
3881
|
/* */
|
3848
3882
|
/* */
|
3849
3883
|
//#region @browser
|
@@ -3861,6 +3895,7 @@ class HelpersCore extends HelpersMessages {
|
|
3861
3895
|
* get electron web frame
|
3862
3896
|
*/
|
3863
3897
|
get webFrame() {
|
3898
|
+
// typeof webFrame
|
3864
3899
|
//typeof webFrame
|
3865
3900
|
/* */
|
3866
3901
|
/* */
|
@@ -4063,6 +4098,104 @@ class HelpersCore extends HelpersMessages {
|
|
4063
4098
|
}
|
4064
4099
|
//#endregion
|
4065
4100
|
//#region methods / remove file or folder
|
4101
|
+
removeSymlinks(dirPath, options) {
|
4102
|
+
/* */
|
4103
|
+
/* */
|
4104
|
+
/* */
|
4105
|
+
/* */
|
4106
|
+
/* */
|
4107
|
+
/* */
|
4108
|
+
/* */
|
4109
|
+
/* */
|
4110
|
+
/* */
|
4111
|
+
/* */
|
4112
|
+
/* */
|
4113
|
+
/* */
|
4114
|
+
/* */
|
4115
|
+
/* */
|
4116
|
+
/* */
|
4117
|
+
/* */
|
4118
|
+
/* */
|
4119
|
+
/* */
|
4120
|
+
/* */
|
4121
|
+
/* */
|
4122
|
+
/* */
|
4123
|
+
/* */
|
4124
|
+
/* */
|
4125
|
+
/* */
|
4126
|
+
/* */
|
4127
|
+
/* */
|
4128
|
+
/* */
|
4129
|
+
/* */
|
4130
|
+
/* */
|
4131
|
+
/* */
|
4132
|
+
/* */
|
4133
|
+
/* */
|
4134
|
+
/* */
|
4135
|
+
/* */
|
4136
|
+
/* */
|
4137
|
+
/* */
|
4138
|
+
/* */
|
4139
|
+
/* */
|
4140
|
+
/* */
|
4141
|
+
/* */
|
4142
|
+
/* */
|
4143
|
+
/* */
|
4144
|
+
/* */
|
4145
|
+
/* */
|
4146
|
+
/* */
|
4147
|
+
/* */
|
4148
|
+
/* */
|
4149
|
+
/* */
|
4150
|
+
/* */
|
4151
|
+
/* */
|
4152
|
+
/* */
|
4153
|
+
/* */
|
4154
|
+
/* */
|
4155
|
+
/* */
|
4156
|
+
/* */
|
4157
|
+
/* */
|
4158
|
+
/* */
|
4159
|
+
/* */
|
4160
|
+
/* */
|
4161
|
+
/* */
|
4162
|
+
/* */
|
4163
|
+
return (void 0);
|
4164
|
+
}
|
4165
|
+
// /**
|
4166
|
+
// * TODO replacement for remove/rimraf.sync
|
4167
|
+
// * save remove file or folder
|
4168
|
+
// */
|
4169
|
+
// safeRemove(
|
4170
|
+
// targetPath: string,
|
4171
|
+
// options?: {
|
4172
|
+
// // usePattern?: boolean;
|
4173
|
+
// },
|
4174
|
+
// ): void {
|
4175
|
+
// targetPath = crossPlatformPath(targetPath);
|
4176
|
+
// try {
|
4177
|
+
// const stats = fse.lstatSync(targetPath);
|
4178
|
+
// if (stats.isSymbolicLink()) {
|
4179
|
+
// // Remove the symlink without following it
|
4180
|
+
// fse.unlinkSync(targetPath);
|
4181
|
+
// } else if (stats.isDirectory()) {
|
4182
|
+
// // Recursively remove directory contents
|
4183
|
+
// const entries = fse.readdirSync(targetPath);
|
4184
|
+
// for (const entry of entries) {
|
4185
|
+
// this.safeRemove(crossPlatformPath([targetPath, entry]), options);
|
4186
|
+
// }
|
4187
|
+
// fse.rmdirSync(targetPath);
|
4188
|
+
// } else {
|
4189
|
+
// // Remove file
|
4190
|
+
// fse.unlinkSync(targetPath);
|
4191
|
+
// }
|
4192
|
+
// } catch (err) {
|
4193
|
+
// console.error(`Error removing ${targetPath}:`, err);
|
4194
|
+
// }
|
4195
|
+
// }
|
4196
|
+
/**
|
4197
|
+
* @deprecated use safeRemove
|
4198
|
+
*/
|
4066
4199
|
remove(fileOrFolderPathOrPatter, exactFolder = false) {
|
4067
4200
|
/* */
|
4068
4201
|
/* */
|