tnp-core 19.0.47 → 19.0.49

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.
Files changed (67) hide show
  1. package/README.md +20 -20
  2. package/browser/README.md +24 -24
  3. package/browser/fesm2022/tnp-core.mjs +229 -44
  4. package/browser/fesm2022/tnp-core.mjs.map +1 -1
  5. package/browser/lib/helpers.d.ts +7 -2
  6. package/browser/lib/utils.d.ts +20 -0
  7. package/browser/package.json +1 -1
  8. package/cli.backend.js +2 -2
  9. package/cli.backend.js.map +1 -1
  10. package/index.js.map +1 -1
  11. package/lib/build-info._auto-generated_.d.ts +1 -1
  12. package/lib/build-info._auto-generated_.js +1 -1
  13. package/lib/build-info._auto-generated_.js.map +1 -1
  14. package/lib/command-exists.js.map +1 -1
  15. package/lib/core-cli.js.map +1 -1
  16. package/lib/core-config.js.map +1 -1
  17. package/lib/core-imports.js +2 -1
  18. package/lib/core-imports.js.map +1 -1
  19. package/lib/core-models.js.map +1 -1
  20. package/lib/env/env.angular-node-app.d.ts +6 -0
  21. package/lib/env/env.angular-node-app.js +8 -2
  22. package/lib/env/env.angular-node-app.js.map +1 -1
  23. package/lib/env/env.docs-webapp.d.ts +6 -0
  24. package/lib/env/env.docs-webapp.js +8 -2
  25. package/lib/env/env.docs-webapp.js.map +1 -1
  26. package/lib/env/env.electron-app.d.ts +6 -0
  27. package/lib/env/env.electron-app.js +8 -2
  28. package/lib/env/env.electron-app.js.map +1 -1
  29. package/lib/env/env.mobile-app.d.ts +6 -0
  30. package/lib/env/env.mobile-app.js +8 -2
  31. package/lib/env/env.mobile-app.js.map +1 -1
  32. package/lib/env/env.npm-lib-and-cli-tool.d.ts +6 -0
  33. package/lib/env/env.npm-lib-and-cli-tool.js +8 -2
  34. package/lib/env/env.npm-lib-and-cli-tool.js.map +1 -1
  35. package/lib/env/env.vscode-plugin.d.ts +6 -0
  36. package/lib/env/env.vscode-plugin.js +8 -2
  37. package/lib/env/env.vscode-plugin.js.map +1 -1
  38. package/lib/env/index.js.map +1 -1
  39. package/lib/framework-name.d.ts +2 -2
  40. package/lib/framework-name.js.map +1 -1
  41. package/lib/helpers-isomorphic.js.map +1 -1
  42. package/lib/helpers-messages.js.map +1 -1
  43. package/lib/helpers.d.ts +14 -3
  44. package/lib/helpers.js +31 -47
  45. package/lib/helpers.js.map +1 -1
  46. package/lib/index._auto-generated_.js.map +1 -1
  47. package/lib/index.js.map +1 -1
  48. package/lib/node-chalk-mock.js +2 -2
  49. package/lib/node-chalk-mock.js.map +1 -1
  50. package/lib/node-path-mock.js +2 -2
  51. package/lib/node-path-mock.js.map +1 -1
  52. package/lib/progress-data.js.map +1 -1
  53. package/lib/public-api.js.map +1 -1
  54. package/lib/required-global-npm-packages.js.map +1 -1
  55. package/lib/utils.d.ts +20 -0
  56. package/lib/utils.js +190 -5
  57. package/lib/utils.js.map +1 -1
  58. package/migrations/index.js.map +1 -1
  59. package/migrations/migrations_index._auto-generated_.js.map +1 -1
  60. package/package.json +1 -1
  61. package/websql/README.md +24 -24
  62. package/websql/fesm2022/tnp-core.mjs +229 -44
  63. package/websql/fesm2022/tnp-core.mjs.map +1 -1
  64. package/websql/lib/helpers.d.ts +7 -2
  65. package/websql/lib/utils.d.ts +20 -0
  66. package/websql/package.json +1 -1
  67. package/tmp-environment.json +0 -33
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.
@@ -729,7 +729,8 @@ const crossPlatformPath = (pathStringOrPathParts) => {
729
729
  }
730
730
  if (hasNonAscii) {
731
731
  const allNonAscii = pathStringOrPathParts.match(/[^\u0000-\u0080]+/g) || '';
732
- Helpers.logWarn(`[taon-core][crossPlatformPath]: Path contains non-ascii characters: ${allNonAscii}`);
732
+ Helpers.logWarn(`[taon-core][crossPlatformPath]: path below contains non-ascii characters (${allNonAscii}):
733
+ "${pathStringOrPathParts}"`);
733
734
  Helpers.logWarn(pathStringOrPathParts);
734
735
  }
735
736
  pathStringOrPathParts = (pathStringOrPathParts || '')
@@ -2292,12 +2293,18 @@ var UtilsOs;
2292
2293
  return false;
2293
2294
  };
2294
2295
  //#endregion
2296
+ UtilsOs.isRunningInSSRMode = () => {
2297
+ return typeof globalThis.window === 'undefined';
2298
+ };
2295
2299
  //#region utils os / is running in electron
2296
2300
  /**
2297
2301
  * check whether the current process is running inside
2298
2302
  * Electron backend or browser.
2299
2303
  */
2300
2304
  UtilsOs.isRunningInElectron = () => {
2305
+ if (UtilsOs.isRunningInSSRMode()) {
2306
+ return false; // no ssr for electron
2307
+ }
2301
2308
  // Renderer process
2302
2309
  // @ts-ignore
2303
2310
  if (typeof window !== 'undefined' &&
@@ -2441,6 +2448,44 @@ var UtilsOs;
2441
2448
  /* */
2442
2449
  /* */
2443
2450
  /* */
2451
+ /* */
2452
+ /* */
2453
+ /* */
2454
+ /* */
2455
+ /* */
2456
+ /* */
2457
+ /* */
2458
+ /* */
2459
+ /* */
2460
+ /* */
2461
+ /* */
2462
+ /* */
2463
+ /* */
2464
+ /* */
2465
+ /* */
2466
+ /* */
2467
+ /* */
2468
+ /* */
2469
+ /* */
2470
+ /* */
2471
+ /* */
2472
+ /* */
2473
+ /* */
2474
+ /* */
2475
+ /* */
2476
+ /* */
2477
+ /* */
2478
+ /* */
2479
+ /* */
2480
+ /* */
2481
+ /* */
2482
+ /* */
2483
+ /* */
2484
+ /* */
2485
+ /* */
2486
+ /* */
2487
+ /* */
2488
+ /* */
2444
2489
  return (void 0);
2445
2490
  };
2446
2491
  //#endregion
@@ -2534,11 +2579,64 @@ var UtilsOs;
2534
2579
  return (void 0);
2535
2580
  };
2536
2581
  //#endregion
2582
+ UtilsOs.openFolderInVSCode = (folderPath) => {
2583
+ /* */
2584
+ /* */
2585
+ /* */
2586
+ /* */
2587
+ /* */
2588
+ /* */
2589
+ /* */
2590
+ /* */
2591
+ /* */
2592
+ /* */
2593
+ /* */
2594
+ /* */
2595
+ /* */
2596
+ return (void 0);
2597
+ };
2598
+ UtilsOs.openFolderInFileExplorer = (folderPath) => {
2599
+ /* */
2600
+ /* */
2601
+ /* */
2602
+ /* */
2603
+ /* */
2604
+ /* */
2605
+ /* */
2606
+ /* */
2607
+ /* */
2608
+ /* */
2609
+ /* */
2610
+ /* */
2611
+ /* */
2612
+ /* */
2613
+ /* */
2614
+ /* */
2615
+ /* */
2616
+ /* */
2617
+ /* */
2618
+ /* */
2619
+ /* */
2620
+ /* */
2621
+ /* */
2622
+ /* */
2623
+ /* */
2624
+ /* */
2625
+ /* */
2626
+ /* */
2627
+ /* */
2628
+ /* */
2629
+ return (void 0);
2630
+ //#region @browser
2631
+ console.warn(`UtilsOs.openFolderInFileExplorer is not supported in browser mode`);
2632
+ //#endregion
2633
+ };
2537
2634
  UtilsOs.isElectron = UtilsOs.isRunningInElectron();
2538
2635
  UtilsOs.isBrowser = UtilsOs.isRunningInBrowser();
2539
2636
  UtilsOs.isNode = UtilsOs.isRunningInNode();
2540
2637
  UtilsOs.isWebSQL = UtilsOs.isRunningInWebSQL();
2541
2638
  UtilsOs.isVscodeExtension = UtilsOs.isRunningInVscodeExtension();
2639
+ UtilsOs.isSSRMode = UtilsOs.isRunningInSSRMode();
2542
2640
  })(UtilsOs || (UtilsOs = {}));
2543
2641
  //#endregion
2544
2642
  //#region utils string
@@ -2580,6 +2678,7 @@ var UtilsMigrations;
2580
2678
  };
2581
2679
  UtilsMigrations.formatTimestamp = (timestamp) => {
2582
2680
  const dateFromTimestamp = new Date(timestamp);
2681
+ // @ts-ignore
2583
2682
  return `${dateformat(dateFromTimestamp, 'dd-mm-yyyy HH:MM:ss')}`;
2584
2683
  };
2585
2684
  UtilsMigrations.isValidTimestamp = (value) => {
@@ -3151,6 +3250,103 @@ var UtilsTerminal;
3151
3250
  //#endregion
3152
3251
  })(UtilsTerminal || (UtilsTerminal = {}));
3153
3252
  //#endregion
3253
+ //#region utils json
3254
+ var UtilsJson;
3255
+ (function (UtilsJson) {
3256
+ //#region read json
3257
+ /**
3258
+ * read json from absolute path
3259
+ * @returns json object
3260
+ */
3261
+ UtilsJson.readJson = (absoluteFilePath, defaultValue = {}, useJson5 = false) => {
3262
+ /* */
3263
+ /* */
3264
+ /* */
3265
+ /* */
3266
+ /* */
3267
+ /* */
3268
+ /* */
3269
+ /* */
3270
+ /* */
3271
+ /* */
3272
+ /* */
3273
+ /* */
3274
+ /* */
3275
+ /* */
3276
+ /* */
3277
+ /* */
3278
+ /* */
3279
+ /* */
3280
+ /* */
3281
+ return (void 0);
3282
+ };
3283
+ //#endregion
3284
+ //#region read json with comments
3285
+ UtilsJson.readJsonWithComments = (absoluteFilePath, defaultValue = {}) => {
3286
+ /* */
3287
+ /* */
3288
+ return (void 0);
3289
+ };
3290
+ //#endregion
3291
+ })(UtilsJson || (UtilsJson = {}));
3292
+ //#endregion
3293
+ var UtilsYaml;
3294
+ (function (UtilsYaml) {
3295
+ UtilsYaml.yamlToJson = (yamlString) => {
3296
+ /* */
3297
+ /* */
3298
+ /* */
3299
+ /* */
3300
+ /* */
3301
+ /* */
3302
+ /* */
3303
+ /* */
3304
+ /* */
3305
+ return (void 0);
3306
+ };
3307
+ UtilsYaml.jsonToYaml = (json) => {
3308
+ /* */
3309
+ /* */
3310
+ /* */
3311
+ /* */
3312
+ /* */
3313
+ /* */
3314
+ /* */
3315
+ /* */
3316
+ /* */
3317
+ /* */
3318
+ /* */
3319
+ /* */
3320
+ return (void 0);
3321
+ };
3322
+ //#region read yaml as json
3323
+ UtilsYaml.readYamlAsJson = (absFilePathToYamlOrYmlFile, options) => {
3324
+ /* */
3325
+ /* */
3326
+ /* */
3327
+ /* */
3328
+ /* */
3329
+ /* */
3330
+ /* */
3331
+ /* */
3332
+ /* */
3333
+ /* */
3334
+ /* */
3335
+ return (void 0);
3336
+ };
3337
+ //#endregion
3338
+ //#region write json to yaml
3339
+ UtilsYaml.writeJsonToYaml = (destinationYamlfileAbsPath, json) => {
3340
+ /* */
3341
+ /* */
3342
+ /* */
3343
+ /* */
3344
+ /* */
3345
+ /* */
3346
+ return (void 0);
3347
+ };
3348
+ //#endregion
3349
+ })(UtilsYaml || (UtilsYaml = {}));
3154
3350
 
3155
3351
  class HelpersIsomorphic {
3156
3352
  /**
@@ -5772,42 +5968,22 @@ class HelpersCore extends HelpersMessages {
5772
5968
  //#endregion
5773
5969
  //#region methods / read json
5774
5970
  /**
5775
- * read json from absolute path
5776
- * @returns json object
5971
+ * @deprecated use UtilsJson.readJson or UtilsJson.readJson5
5777
5972
  */
5778
5973
  readJson(absoluteFilePath, defaultValue = {}, useJson5 = false) {
5779
- /* */
5780
- /* */
5781
- /* */
5782
- /* */
5783
- /* */
5784
- /* */
5785
- /* */
5786
- /* */
5787
- /* */
5788
- /* */
5789
- /* */
5790
- /* */
5791
- /* */
5792
- /* */
5793
- /* */
5794
- /* */
5795
- /* */
5796
- /* */
5797
- /* */
5798
- /* */
5799
- /* */
5800
- return (void 0);
5974
+ return UtilsJson.readJson(absoluteFilePath, defaultValue, useJson5);
5801
5975
  }
5976
+ /**
5977
+ * @deprecated use UtilsJson.readJsonWithComments
5978
+ */
5802
5979
  readJson5(absoluteFilePath, defaultValue = {}) {
5803
- /* */
5804
- /* */
5805
- return (void 0);
5980
+ return UtilsJson.readJsonWithComments(absoluteFilePath, defaultValue);
5806
5981
  }
5982
+ /**
5983
+ * @deprecated use UtilsJson.readJsonWithComments
5984
+ */
5807
5985
  readJsonC(absoluteFilePath, defaultValue = {}) {
5808
- /* */
5809
- /* */
5810
- return (void 0);
5986
+ return UtilsJson.readJsonWithComments(absoluteFilePath, defaultValue);
5811
5987
  }
5812
5988
  //#endregion
5813
5989
  //#region methods / parse
@@ -5953,6 +6129,8 @@ class HelpersCore extends HelpersMessages {
5953
6129
  /* */
5954
6130
  /* */
5955
6131
  /* */
6132
+ /* */
6133
+ /* */
5956
6134
  //#endregion
5957
6135
  //#region methods / write json
5958
6136
  /* */
@@ -6073,6 +6251,25 @@ class HelpersCore extends HelpersMessages {
6073
6251
  /* */
6074
6252
  /* */
6075
6253
  /* */
6254
+ /* */
6255
+ /* */
6256
+ /* */
6257
+ /* */
6258
+ /* */
6259
+ /* */
6260
+ /* */
6261
+ /* */
6262
+ /* */
6263
+ /* */
6264
+ /* */
6265
+ /* */
6266
+ /* */
6267
+ /* */
6268
+ /* */
6269
+ /* */
6270
+ /* */
6271
+ /* */
6272
+ /* */
6076
6273
  //#endregion
6077
6274
  //#region methods / links from
6078
6275
  /* */
@@ -6261,18 +6458,6 @@ class HelpersCore extends HelpersMessages {
6261
6458
  /* */
6262
6459
  /* */
6263
6460
  /* */
6264
- /* */
6265
- /* */
6266
- /* */
6267
- /* */
6268
- /* */
6269
- /* */
6270
- /* */
6271
- /* */
6272
- /* */
6273
- /* */
6274
- /* */
6275
- /* */
6276
6461
  //#endregion
6277
6462
  //#region methods / hide node warnings
6278
6463
  hideNodeWarnings() {
@@ -6422,5 +6607,5 @@ let Helpers = HelpersCore.InstanceCore;
6422
6607
  * Generated bundle index. Do not edit.
6423
6608
  */
6424
6609
 
6425
- export { $, CLI, CoreConfig, HelpersCore as CoreHelpers, CoreModels, Helpers, PROGRESS_DATA, Utils, UtilsMigrations, UtilsOs, UtilsProcess, UtilsString, UtilsTerminal, chalk, child_process, chokidar, crossPlatformPath, fg, fkill, frameworkName, frameworkNameBe, fse, glob, http, https, isElevated, mkdirp, ncp, net, os, path, ps, psList, requiredForDev, rimraf, spawn, win32Path };
6610
+ export { $, CLI, CoreConfig, HelpersCore as CoreHelpers, CoreModels, Helpers, PROGRESS_DATA, Utils, UtilsJson, UtilsMigrations, UtilsOs, UtilsProcess, UtilsString, UtilsTerminal, UtilsYaml, chalk, child_process, chokidar, crossPlatformPath, fg, fkill, frameworkName, frameworkNameBe, fse, glob, http, https, isElevated, mkdirp, ncp, net, os, path, ps, psList, requiredForDev, rimraf, spawn, win32Path };
6426
6611
  //# sourceMappingURL=tnp-core.mjs.map