tnp 21.0.281 → 21.0.285

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 (132) hide show
  1. package/VERIFIED-BUILD-DATA.jsonc +3 -3
  2. package/browser/fesm2022/tnp-browser.mjs +923 -3
  3. package/browser/fesm2022/tnp-browser.mjs.map +1 -1
  4. package/browser/package.json +1 -1
  5. package/browser-prod/fesm2022/tnp-browser-prod.mjs +923 -3
  6. package/browser-prod/fesm2022/tnp-browser-prod.mjs.map +1 -1
  7. package/browser-prod/package.json +1 -1
  8. package/browser-prod/types/tnp-browser-prod.d.ts.map +1 -1
  9. package/cli.js +211 -106
  10. package/full-dts/app-utils.d.ts +1 -0
  11. package/full-dts/build-info._auto-generated_.d.ts +1 -1
  12. package/full-dts/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/browser-code-cut.d.ts +0 -1
  13. package/full-dts/project/cli/cli-GENERATE.d.ts +1 -0
  14. package/lib/app-utils.d.ts +1 -0
  15. package/lib/app-utils.js +54 -1
  16. package/lib/app-utils.js.map +1 -1
  17. package/lib/build-info._auto-generated_.d.ts +1 -1
  18. package/lib/build-info._auto-generated_.js +1 -1
  19. package/lib/package.json +1 -1
  20. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/artifact-npm-lib-and-cli-tool.js +2 -0
  21. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/artifact-npm-lib-and-cli-tool.js.map +1 -1
  22. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/browser-code-cut.d.ts +0 -1
  23. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/browser-code-cut.js +2 -8
  24. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/browser-code-cut.js.map +1 -1
  25. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/copy-manager/copy-manager-standalone.js +3 -1
  26. package/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/copy-manager/copy-manager-standalone.js.map +1 -1
  27. package/lib/project/cli/cli-GENERATE.d.ts +1 -0
  28. package/lib/project/cli/cli-GENERATE.js +8 -0
  29. package/lib/project/cli/cli-GENERATE.js.map +1 -1
  30. package/lib/vscode-plugin/vscode-menu-items.js +22 -0
  31. package/lib/vscode-plugin/vscode-menu-items.js.map +1 -1
  32. package/lib-esm/lib/app-utils.d.ts +1 -0
  33. package/lib-esm/lib/app-utils.js +53 -1
  34. package/lib-esm/lib/app-utils.js.map +1 -1
  35. package/lib-esm/lib/build-info._auto-generated_.d.ts +1 -1
  36. package/lib-esm/lib/build-info._auto-generated_.js +1 -1
  37. package/lib-esm/lib/project/abstract/artifacts/npm-lib-and-cli-tool/artifact-npm-lib-and-cli-tool.js +2 -0
  38. package/lib-esm/lib/project/abstract/artifacts/npm-lib-and-cli-tool/artifact-npm-lib-and-cli-tool.js.map +1 -1
  39. package/lib-esm/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/browser-code-cut.d.ts +0 -1
  40. package/lib-esm/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/browser-code-cut.js +2 -8
  41. package/lib-esm/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/browser-code-cut.js.map +1 -1
  42. package/lib-esm/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/utils-code-cut.test.d.ts +1 -0
  43. package/lib-esm/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/copy-manager/copy-manager-standalone.js +3 -1
  44. package/lib-esm/lib/project/abstract/artifacts/npm-lib-and-cli-tool/tools/copy-manager/copy-manager-standalone.js.map +1 -1
  45. package/lib-esm/lib/project/cli/cli-GENERATE.d.ts +1 -0
  46. package/lib-esm/lib/project/cli/cli-GENERATE.js +10 -2
  47. package/lib-esm/lib/project/cli/cli-GENERATE.js.map +1 -1
  48. package/lib-esm/lib/vscode-plugin/vscode-menu-items.js +22 -0
  49. package/lib-esm/lib/vscode-plugin/vscode-menu-items.js.map +1 -1
  50. package/lib-prod/app-utils.d.ts +1 -0
  51. package/lib-prod/app-utils.js +53 -1
  52. package/lib-prod/app-utils.js.map +1 -1
  53. package/lib-prod/build-info._auto-generated_.d.ts +1 -1
  54. package/lib-prod/build-info._auto-generated_.js +1 -1
  55. package/lib-prod/package.json +1 -1
  56. package/lib-prod/project/abstract/artifacts/npm-lib-and-cli-tool/artifact-npm-lib-and-cli-tool.js +2 -0
  57. package/lib-prod/project/abstract/artifacts/npm-lib-and-cli-tool/artifact-npm-lib-and-cli-tool.js.map +1 -1
  58. package/lib-prod/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/browser-code-cut.d.ts +0 -1
  59. package/lib-prod/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/browser-code-cut.js +2 -8
  60. package/lib-prod/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/browser-code-cut.js.map +1 -1
  61. package/lib-prod/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/code-split-process.enum.d.ts +8 -10
  62. package/lib-prod/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/code-split-process.enum.js +43 -185
  63. package/lib-prod/project/abstract/artifacts/npm-lib-and-cli-tool/tools/build-isomorphic-lib/code-cut/code-split-process.enum.js.map +1 -1
  64. package/lib-prod/project/abstract/artifacts/npm-lib-and-cli-tool/tools/copy-manager/copy-manager-standalone.js +3 -1
  65. package/lib-prod/project/abstract/artifacts/npm-lib-and-cli-tool/tools/copy-manager/copy-manager-standalone.js.map +1 -1
  66. package/lib-prod/project/cli/cli-GENERATE.d.ts +1 -0
  67. package/lib-prod/project/cli/cli-GENERATE.js +10 -2
  68. package/lib-prod/project/cli/cli-GENERATE.js.map +1 -1
  69. package/lib-prod/vscode-plugin/vscode-menu-items.js +22 -0
  70. package/lib-prod/vscode-plugin/vscode-menu-items.js.map +1 -1
  71. package/package.json +1 -1
  72. package/websql/fesm2022/tnp-websql.mjs +923 -3
  73. package/websql/fesm2022/tnp-websql.mjs.map +1 -1
  74. package/websql/package.json +1 -1
  75. package/websql-prod/fesm2022/tnp-websql-prod.mjs +923 -3
  76. package/websql-prod/fesm2022/tnp-websql-prod.mjs.map +1 -1
  77. package/websql-prod/package.json +1 -1
  78. package/websql-prod/types/tnp-websql-prod.d.ts.map +1 -1
  79. package/full-dts/project/abstract/taon-worker/secrets-keychain/secrets-keychain.repository copy.d.ts +0 -10
  80. package/full-dts/project/cli/cli-LANG copy.d.ts +0 -16
  81. package/full-dts/wrap-env.d.ts +0 -4
  82. package/lib/project/abstract/taon-worker/secrets-keychain/secrets-keychain.repository copy.d.ts +0 -9
  83. package/lib/project/abstract/taon-worker/secrets-keychain/secrets-keychain.repository copy.js +0 -37
  84. package/lib/project/abstract/taon-worker/secrets-keychain/secrets-keychain.repository copy.js.map +0 -1
  85. package/lib/project/cli/cli-LANG copy.d.ts +0 -15
  86. package/lib/project/cli/cli-LANG copy.js +0 -46
  87. package/lib/project/cli/cli-LANG copy.js.map +0 -1
  88. package/lib/wrap-env.d.ts +0 -3
  89. package/lib/wrap-env.js +0 -10
  90. package/lib/wrap-env.js.map +0 -1
  91. package/lib-esm/app.d.ts +0 -0
  92. package/lib-esm/app.electron.d.ts +0 -0
  93. package/lib-esm/app.electron.js +0 -2
  94. package/lib-esm/app.electron.js.map +0 -1
  95. package/lib-esm/app.hosts.d.ts +0 -0
  96. package/lib-esm/app.hosts.js +0 -2
  97. package/lib-esm/app.hosts.js.map +0 -1
  98. package/lib-esm/app.js +0 -2
  99. package/lib-esm/app.js.map +0 -1
  100. package/lib-esm/app.vscode.d.ts +0 -0
  101. package/lib-esm/app.vscode.js +0 -2
  102. package/lib-esm/app.vscode.js.map +0 -1
  103. package/lib-esm/lib/project/abstract/taon-worker/secrets-keychain/secrets-keychain.repository copy.d.ts +0 -9
  104. package/lib-esm/lib/project/abstract/taon-worker/secrets-keychain/secrets-keychain.repository copy.js +0 -28
  105. package/lib-esm/lib/project/abstract/taon-worker/secrets-keychain/secrets-keychain.repository copy.js.map +0 -1
  106. package/lib-esm/lib/project/cli/cli-LANG copy.d.ts +0 -15
  107. package/lib-esm/lib/project/cli/cli-LANG copy.js +0 -42
  108. package/lib-esm/lib/project/cli/cli-LANG copy.js.map +0 -1
  109. package/lib-esm/lib/wrap-env.d.ts +0 -3
  110. package/lib-esm/lib/wrap-env.js +0 -7
  111. package/lib-esm/lib/wrap-env.js.map +0 -1
  112. package/lib-prod/env/env.angular-node-app.d.ts +0 -67
  113. package/lib-prod/env/env.angular-node-app.js +0 -138
  114. package/lib-prod/env/env.angular-node-app.js.map +0 -1
  115. package/lib-prod/env/env.docs-webapp.d.ts +0 -67
  116. package/lib-prod/env/env.docs-webapp.js +0 -138
  117. package/lib-prod/env/env.docs-webapp.js.map +0 -1
  118. package/lib-prod/env/env.electron-app.d.ts +0 -67
  119. package/lib-prod/env/env.electron-app.js +0 -138
  120. package/lib-prod/env/env.electron-app.js.map +0 -1
  121. package/lib-prod/env/env.mobile-app.d.ts +0 -67
  122. package/lib-prod/env/env.mobile-app.js +0 -138
  123. package/lib-prod/env/env.mobile-app.js.map +0 -1
  124. package/lib-prod/env/env.npm-lib-and-cli-tool.d.ts +0 -67
  125. package/lib-prod/env/env.npm-lib-and-cli-tool.js +0 -138
  126. package/lib-prod/env/env.npm-lib-and-cli-tool.js.map +0 -1
  127. package/lib-prod/env/env.vscode-plugin.d.ts +0 -67
  128. package/lib-prod/env/env.vscode-plugin.js +0 -138
  129. package/lib-prod/env/env.vscode-plugin.js.map +0 -1
  130. package/lib-prod/env/index.d.ts +0 -4
  131. package/lib-prod/env/index.js +0 -5
  132. package/lib-prod/env/index.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { TaonTempRoutesFolder, TaonTempDatabasesFolder, TaonBaseAbstractEntity, TaonEntity, TaonBaseMigration, TaonMigration, TaonBaseEntity, GET, TaonController, Taon, TaonBaseContext } from 'taon/browser';
2
- import { fse, crossPlatformPath, _, path, dotTaonFolder, Utils, config, folderName, fileName, extForStyles, UtilsTerminal, Helpers, chalk, taonPackageName, UtilsWaitNotifier, UtilsOs, taonProjects, UtilsString, taonContainers, os } from 'tnp-core/browser';
2
+ import { fse, crossPlatformPath, _, path, dotTaonFolder, Utils, config, folderName, fileName, extForStyles, UtilsTerminal, Helpers, chalk, taonPackageName, UtilsWaitNotifier, UtilsOs, taonProjects, UtilsString, taonContainers, frontEndOnly, stateServiceSuffix, os } from 'tnp-core/browser';
3
3
  export { globalSpinner } from 'tnp-core/browser';
4
- import { BaseCliWorkerTerminalUI, TaonBaseCliWorkerController, getBaseCliWorkerDatabaseConfig, BaseCliWorker, BaseProjectResolver, Helpers as Helpers$1, BaseProject } from 'tnp-helpers/browser';
4
+ import { BaseCliWorkerTerminalUI, TaonBaseCliWorkerController, getBaseCliWorkerDatabaseConfig, BaseCliWorker, BaseProjectResolver, Helpers as Helpers$1, BaseProject, UtilsTypescript } from 'tnp-helpers/browser';
5
5
  import { walk } from 'lodash-walk-object/browser';
6
6
  import { __decorate, __metadata } from 'tslib';
7
7
 
@@ -29,7 +29,7 @@ const CURRENT_PACKAGE_TAON_VERSION = 'v21';
29
29
  /**
30
30
  * Autogenerated by current cli tool. Use *tnp release* to bump version.
31
31
  */
32
- const CURRENT_PACKAGE_VERSION = '21.0.281';
32
+ const CURRENT_PACKAGE_VERSION = '21.0.285';
33
33
  // THIS FILE IS GENERATED - DO NOT MODIFY
34
34
 
35
35
  //#region imports
@@ -3593,6 +3593,905 @@ class Project extends BaseProject {
3593
3593
  }
3594
3594
  }
3595
3595
 
3596
+ //#endregion
3597
+ function removeCommentsFromScssFile(scss) {
3598
+ /* */
3599
+ /* */
3600
+ /* */
3601
+ /* */
3602
+ /* */
3603
+ /* */
3604
+ /* */
3605
+ /* */
3606
+ /* */
3607
+ return (void 0);
3608
+ }
3609
+ //#region allowed to release map
3610
+ const ALLOWED_TO_RELEASE = {
3611
+ 'manual-taon': [
3612
+ ReleaseArtifactTaon.NPM_LIB_PKG_AND_CLI_TOOL,
3613
+ ReleaseArtifactTaon.ANGULAR_NODE_APP,
3614
+ ],
3615
+ 'cloud-ci-taon': [],
3616
+ 'cloud-ci-cloudflare': [],
3617
+ 'manual-cloudflare': [ReleaseArtifactTaon.ANGULAR_NODE_APP],
3618
+ 'manual-static-pages': [
3619
+ ReleaseArtifactTaon.ANGULAR_NODE_APP,
3620
+ ReleaseArtifactTaon.DOCS_DOCS_WEBAPP,
3621
+ ReleaseArtifactTaon.ELECTRON_APP,
3622
+ ReleaseArtifactTaon.VSCODE_PLUGIN,
3623
+ ],
3624
+ 'cloud-ci-static-pages': [],
3625
+ local: [
3626
+ ReleaseArtifactTaon.ELECTRON_APP,
3627
+ ReleaseArtifactTaon.NPM_LIB_PKG_AND_CLI_TOOL,
3628
+ ReleaseArtifactTaon.VSCODE_PLUGIN,
3629
+ ReleaseArtifactTaon.ANGULAR_NODE_APP,
3630
+ ],
3631
+ };
3632
+ //#endregion
3633
+ //#region is browser file path
3634
+ const isBrowserFilePath = (pathToFile, options) => {
3635
+ if (!pathToFile) {
3636
+ Helpers.warn(`[app-utils][isBrowserFilePath] Wrong path "${pathToFile}"`);
3637
+ return false;
3638
+ }
3639
+ options = options || {};
3640
+ const isFrontendFile = !_.isUndefined(frontEndOnly.find(f => pathToFile.endsWith(f) &&
3641
+ (options.skipStateService
3642
+ ? !pathToFile.endsWith(stateServiceSuffix)
3643
+ : true)));
3644
+ return isFrontendFile;
3645
+ };
3646
+ //#endregion
3647
+ //#region is ts file
3648
+ const isTsFile = (pathToFile) => ['.ts', '.tsx'].includes(_.isString(pathToFile) ? path.extname(pathToFile) : '');
3649
+ //#endregion
3650
+ //#region filter/sort children for build or release
3651
+ const filterChildren = (currentProject, children, releaseOptions, opt) => {
3652
+ /* */
3653
+ /* */
3654
+ /* */
3655
+ /* */
3656
+ /* */
3657
+ /* */
3658
+ /* */
3659
+ /* */
3660
+ /* */
3661
+ /* */
3662
+ /* */
3663
+ /* */
3664
+ /* */
3665
+ /* */
3666
+ /* */
3667
+ /* */
3668
+ /* */
3669
+ /* */
3670
+ /* */
3671
+ /* */
3672
+ /* */
3673
+ /* */
3674
+ /* */
3675
+ /* */
3676
+ /* */
3677
+ /* */
3678
+ /* */
3679
+ /* */
3680
+ /* */
3681
+ /* */
3682
+ /* */
3683
+ /* */
3684
+ /* */
3685
+ /* */
3686
+ /* */
3687
+ /* */
3688
+ /* */
3689
+ /* */
3690
+ /* */
3691
+ /* */
3692
+ /* */
3693
+ /* */
3694
+ /* */
3695
+ /* */
3696
+ /* */
3697
+ /* */
3698
+ /* */
3699
+ /* */
3700
+ /* */
3701
+ /* */
3702
+ /* */
3703
+ /* */
3704
+ /* */
3705
+ /* */
3706
+ /* */
3707
+ /* */
3708
+ /* */
3709
+ /* */
3710
+ /* */
3711
+ /* */
3712
+ /* */
3713
+ /* */
3714
+ /* */
3715
+ /* */
3716
+ /* */
3717
+ /* */
3718
+ /* */
3719
+ /* */
3720
+ /* */
3721
+ /* */
3722
+ /* */
3723
+ /* */
3724
+ /* */
3725
+ /* */
3726
+ /* */
3727
+ /* */
3728
+ /* */
3729
+ /* */
3730
+ /* */
3731
+ /* */
3732
+ /* */
3733
+ /* */
3734
+ /* */
3735
+ /* */
3736
+ /* */
3737
+ /* */
3738
+ /* */
3739
+ /* */
3740
+ /* */
3741
+ /* */
3742
+ /* */
3743
+ /* */
3744
+ /* */
3745
+ /* */
3746
+ /* */
3747
+ /* */
3748
+ /* */
3749
+ /* */
3750
+ /* */
3751
+ /* */
3752
+ /* */
3753
+ /* */
3754
+ /* */
3755
+ /* */
3756
+ /* */
3757
+ /* */
3758
+ /* */
3759
+ /* */
3760
+ /* */
3761
+ return (void 0);
3762
+ };
3763
+ //#endregion
3764
+ //#region transform env function to browser
3765
+ function transformEnvFunctionToBrowser(functionAsString) {
3766
+ /* */
3767
+ /* */
3768
+ /* */
3769
+ /* */
3770
+ /* */
3771
+ /* */
3772
+ /* */
3773
+ /* */
3774
+ /* */
3775
+ /* */
3776
+ /* */
3777
+ /* */
3778
+ /* */
3779
+ /* */
3780
+ /* */
3781
+ /* */
3782
+ /* */
3783
+ /* */
3784
+ /* */
3785
+ /* */
3786
+ /* */
3787
+ /* */
3788
+ /* */
3789
+ /* */
3790
+ /* */
3791
+ /* */
3792
+ /* */
3793
+ /* */
3794
+ /* */
3795
+ /* */
3796
+ /* */
3797
+ /* */
3798
+ /* */
3799
+ /* */
3800
+ /* */
3801
+ /* */
3802
+ /* */
3803
+ /* */
3804
+ /* */
3805
+ /* */
3806
+ /* */
3807
+ /* */
3808
+ /* */
3809
+ /* */
3810
+ /* */
3811
+ /* */
3812
+ return (void 0);
3813
+ }
3814
+ //#endregion
3815
+ //#region is test file
3816
+ const isTestFile = (filePath) => {
3817
+ if (!filePath) {
3818
+ Helpers.warn(`[isTestFile] Checking empty path`, true);
3819
+ return false;
3820
+ }
3821
+ return (filePath.endsWith('.test.ts') ||
3822
+ filePath.endsWith('.test.tsx') ||
3823
+ filePath.endsWith('.spec.ts') ||
3824
+ filePath.endsWith('.spec.tsx') ||
3825
+ filePath.endsWith('.e2e.ts') ||
3826
+ filePath.endsWith('.e2e.tsx'));
3827
+ };
3828
+ //#endregion
3829
+ //#region create short name
3830
+ function createShortName(taonProjectName, opt) {
3831
+ const MAX_LENGTH = 6;
3832
+ const name = taonProjectName.toLowerCase();
3833
+ if (name.length <= MAX_LENGTH) {
3834
+ return name;
3835
+ }
3836
+ const parts = name.split('-').filter(Boolean);
3837
+ /**
3838
+ * Prefer consonants because they usually carry more
3839
+ * recognizable information than vowels.
3840
+ */
3841
+ const compactWord = (word, maxLength) => {
3842
+ if (word.length <= maxLength) {
3843
+ return word;
3844
+ }
3845
+ if (maxLength <= 1) {
3846
+ return word[0];
3847
+ }
3848
+ const first = word[0];
3849
+ const last = word[word.length - 1];
3850
+ const middle = word.slice(1, -1).replace(/[aeiou]/g, '');
3851
+ const result = first + middle.slice(0, Math.max(0, maxLength - 2)) + last;
3852
+ return result.slice(0, maxLength);
3853
+ };
3854
+ /**
3855
+ * Names containing "-" should preferably keep one dash.
3856
+ *
3857
+ * mattbachat-pl
3858
+ * -> mtb-pl
3859
+ *
3860
+ * application-quiz
3861
+ * -> app-qz
3862
+ */
3863
+ if (parts.length >= 2) {
3864
+ const lastPart = parts[parts.length - 1];
3865
+ const leftPart = parts.slice(0, -1).join('');
3866
+ // Reserve:
3867
+ // 1 char for "-"
3868
+ // up to 2 chars for right side
3869
+ const rightLength = Math.min(2, lastPart.length);
3870
+ const leftLength = MAX_LENGTH - 1 - rightLength;
3871
+ const left = compactWord(leftPart, leftLength);
3872
+ const right = compactWord(lastPart, rightLength);
3873
+ return `${left}-${right}`;
3874
+ }
3875
+ /**
3876
+ * Single-word project.
3877
+ *
3878
+ * kloniebachatowepl
3879
+ * -> klbpl / similar recognizable shortening
3880
+ *
3881
+ * myprojecttest
3882
+ * -> mypst
3883
+ */
3884
+ const word = parts[0];
3885
+ const consonants = word.slice(1, -2).replace(/[aeiou]/g, '');
3886
+ let result = word.slice(0, 2) + consonants.slice(0, 2) + word.slice(-2);
3887
+ result = [...new Set(result)].join('');
3888
+ /**
3889
+ * Deduplication can make it shorter than desired.
3890
+ * Fill deterministically from the original name.
3891
+ */
3892
+ for (const char of word) {
3893
+ if (result.length >= MAX_LENGTH) {
3894
+ break;
3895
+ }
3896
+ if (!result.includes(char)) {
3897
+ result += char;
3898
+ }
3899
+ }
3900
+ /**
3901
+ * Parent can provide deterministic uniqueness if the
3902
+ * generated name is unusually short.
3903
+ */
3904
+ if (result.length < 4 && opt?.optionalParentProjectName) {
3905
+ for (const char of opt.optionalParentProjectName) {
3906
+ if (/[a-z0-9]/.test(char) && !result.includes(char)) {
3907
+ result += char;
3908
+ }
3909
+ if (result.length >= MAX_LENGTH) {
3910
+ break;
3911
+ }
3912
+ }
3913
+ }
3914
+ return result.slice(0, MAX_LENGTH);
3915
+ }
3916
+ //#endregion
3917
+ //#region extract first level regions
3918
+ const extractFirstLevelRegions = (content) => {
3919
+ const lines = content.split(/\r?\n/);
3920
+ const result = [];
3921
+ let depth = 0;
3922
+ let currentRegionName = null;
3923
+ let buffer = [];
3924
+ for (const line of lines) {
3925
+ const startMatch = line.match(/^\s*\/\/#region\s*(.*)$/);
3926
+ const endMatch = line.match(/^\s*\/\/#endregion/);
3927
+ // REGION START
3928
+ if (startMatch) {
3929
+ depth++;
3930
+ // If entering first level
3931
+ if (depth === 1) {
3932
+ currentRegionName = startMatch[1].trim();
3933
+ buffer = [];
3934
+ }
3935
+ else if (depth > 1) {
3936
+ // Nested region → keep it in content
3937
+ buffer.push(line);
3938
+ }
3939
+ continue;
3940
+ }
3941
+ // REGION END
3942
+ if (endMatch) {
3943
+ if (depth === 1 && currentRegionName) {
3944
+ result.push({
3945
+ regionName: currentRegionName,
3946
+ regionContent: buffer.join('\n'),
3947
+ });
3948
+ currentRegionName = null;
3949
+ buffer = [];
3950
+ }
3951
+ else if (depth > 1) {
3952
+ // Nested region end → keep it
3953
+ buffer.push(line);
3954
+ }
3955
+ depth--;
3956
+ continue;
3957
+ }
3958
+ // Normal content inside first level region
3959
+ if (depth >= 1 && currentRegionName) {
3960
+ buffer.push(line);
3961
+ }
3962
+ }
3963
+ return result;
3964
+ };
3965
+ //#endregion
3966
+ //#region angular projx project path
3967
+ /**
3968
+ * @returns relative path to proxy angular project build folder
3969
+ */
3970
+ const angularProjProxyPath = (options) => {
3971
+ /* */
3972
+ /* */
3973
+ /* */
3974
+ /* */
3975
+ /* */
3976
+ /* */
3977
+ /* */
3978
+ /* */
3979
+ /* */
3980
+ /* */
3981
+ /* */
3982
+ /* */
3983
+ /* */
3984
+ /* */
3985
+ /* */
3986
+ /* */
3987
+ /* */
3988
+ /* */
3989
+ /* */
3990
+ /* */
3991
+ /* */
3992
+ /* */
3993
+ /* */
3994
+ /* */
3995
+ /* */
3996
+ return (void 0);
3997
+ };
3998
+ //#endregion
3999
+ //#region get proxy ng projects
4000
+ const getProxyNgProj = (project, buildOptions, targetArtifact) => {
4001
+ /* */
4002
+ /* */
4003
+ /* */
4004
+ /* */
4005
+ /* */
4006
+ /* */
4007
+ /* */
4008
+ /* */
4009
+ /* */
4010
+ /* */
4011
+ /* */
4012
+ return (void 0);
4013
+ };
4014
+ //#endregion
4015
+ //#region template folder for artifact
4016
+ const templateFolderForArtifact = (artifact) => {
4017
+ /* */
4018
+ /* */
4019
+ /* */
4020
+ /* */
4021
+ /* */
4022
+ /* */
4023
+ /* */
4024
+ /* */
4025
+ /* */
4026
+ /* */
4027
+ /* */
4028
+ /* */
4029
+ /* */
4030
+ /* */
4031
+ /* */
4032
+ /* */
4033
+ /* */
4034
+ /* */
4035
+ /* */
4036
+ /* */
4037
+ /* */
4038
+ /* */
4039
+ return (void 0);
4040
+ };
4041
+ //#endregion
4042
+ //#region get clean import
4043
+ const getCleanImport = (importName) => {
4044
+ return UtilsTypescript.getCleanImport(importName);
4045
+ };
4046
+ //#endregion
4047
+ //#region parse ai md content
4048
+ function parseAiMdContent(input) {
4049
+ const results = [];
4050
+ // Remove AI-MD wrapper markers if present
4051
+ input = input
4052
+ .replace(/===\s*start of AI-MD multi-file markdown structure\s*===/i, '')
4053
+ .replace(/===\s*end of AI-MD multi-file markdown structure\s*===/i, '')
4054
+ .trim();
4055
+ // Match blocks like:
4056
+ // # filename.ext (optional)
4057
+ // ```lang
4058
+ // content
4059
+ // ```
4060
+ const blockRegex = /^#?\s*([^\n`]+?)\s*(?:\([^)]+\))?\s*\n```[^\n]*\n([\s\S]*?)\n```/gm;
4061
+ let match;
4062
+ while ((match = blockRegex.exec(input)) !== null) {
4063
+ const rawFilename = match[1].trim();
4064
+ const content = match[2];
4065
+ results.push({
4066
+ filename: (rawFilename || '').replace(`#`, '').trim(),
4067
+ content,
4068
+ });
4069
+ }
4070
+ return results;
4071
+ }
4072
+ //#endregion
4073
+ //#region error main worker communication
4074
+ const errorMainWorkerCommunication = () => {
4075
+ Helpers.warn(`Not able to communicate with main worker or current build worker:
4076
+ - restart build (that is failing)
4077
+ OR
4078
+ - restart taon worker: ${config.frameworkName} cloud --restart
4079
+ OR
4080
+ - use old build mode that does not need worker
4081
+ (add flag ${oldBuildModePrefix} or short version ${oldBuildModePrefixShort})
4082
+
4083
+ `);
4084
+ };
4085
+ //#endregion
4086
+ //#region replace assets links for app
4087
+ const replaceAssetsLinksForApp = (rawContentForAPPONLYBrowser, relativePath, project, buildOptions) => {
4088
+ /* */
4089
+ /* */
4090
+ /* */
4091
+ /* */
4092
+ /* */
4093
+ /* */
4094
+ /* */
4095
+ /* */
4096
+ /* */
4097
+ /* */
4098
+ /* */
4099
+ /* */
4100
+ /* */
4101
+ /* */
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
+ /* */
4164
+ /* */
4165
+ /* */
4166
+ /* */
4167
+ /* */
4168
+ /* */
4169
+ /* */
4170
+ /* */
4171
+ /* */
4172
+ /* */
4173
+ /* */
4174
+ /* */
4175
+ /* */
4176
+ /* */
4177
+ /* */
4178
+ /* */
4179
+ /* */
4180
+ /* */
4181
+ /* */
4182
+ /* */
4183
+ /* */
4184
+ /* */
4185
+ /* */
4186
+ /* */
4187
+ /* */
4188
+ /* */
4189
+ /* */
4190
+ /* */
4191
+ /* */
4192
+ /* */
4193
+ /* */
4194
+ /* */
4195
+ /* */
4196
+ /* */
4197
+ /* */
4198
+ /* */
4199
+ /* */
4200
+ /* */
4201
+ /* */
4202
+ /* */
4203
+ /* */
4204
+ /* */
4205
+ /* */
4206
+ /* */
4207
+ /* */
4208
+ /* */
4209
+ /* */
4210
+ /* */
4211
+ /* */
4212
+ /* */
4213
+ /* */
4214
+ /* */
4215
+ /* */
4216
+ /* */
4217
+ /* */
4218
+ /* */
4219
+ /* */
4220
+ /* */
4221
+ /* */
4222
+ /* */
4223
+ /* */
4224
+ /* */
4225
+ /* */
4226
+ /* */
4227
+ /* */
4228
+ /* */
4229
+ /* */
4230
+ return (void 0);
4231
+ };
4232
+ //#endregion
4233
+ //#region replace before save in ts file
4234
+ const replaceBeforeSaveInTsFile = (beOrFeTsFileContent,
4235
+ /**
4236
+ * <project location>src/<relativeFilePath>
4237
+ */
4238
+ relativeFilePath, project) => {
4239
+ /* */
4240
+ /* */
4241
+ /* */
4242
+ /* */
4243
+ /* */
4244
+ /* */
4245
+ /* */
4246
+ /* */
4247
+ /* */
4248
+ /* */
4249
+ /* */
4250
+ /* */
4251
+ /* */
4252
+ /* */
4253
+ /* */
4254
+ /* */
4255
+ /* */
4256
+ /* */
4257
+ /* */
4258
+ /* */
4259
+ /* */
4260
+ /* */
4261
+ /* */
4262
+ /* */
4263
+ /* */
4264
+ /* */
4265
+ /* */
4266
+ /* */
4267
+ /* */
4268
+ /* */
4269
+ /* */
4270
+ /* */
4271
+ /* */
4272
+ /* */
4273
+ /* */
4274
+ /* */
4275
+ /* */
4276
+ /* */
4277
+ /* */
4278
+ /* */
4279
+ /* */
4280
+ /* */
4281
+ /* */
4282
+ /* */
4283
+ /* */
4284
+ /* */
4285
+ /* */
4286
+ /* */
4287
+ /* */
4288
+ /* */
4289
+ /* */
4290
+ /* */
4291
+ /* */
4292
+ /* */
4293
+ /* */
4294
+ /* */
4295
+ /* */
4296
+ /* */
4297
+ /* */
4298
+ /* */
4299
+ /* */
4300
+ /* */
4301
+ /* */
4302
+ /* */
4303
+ /* */
4304
+ /* */
4305
+ /* */
4306
+ /* */
4307
+ /* */
4308
+ /* */
4309
+ /* */
4310
+ /* */
4311
+ /* */
4312
+ /* */
4313
+ /* */
4314
+ /* */
4315
+ /* */
4316
+ /* */
4317
+ /* */
4318
+ /* */
4319
+ /* */
4320
+ /* */
4321
+ /* */
4322
+ /* */
4323
+ /* */
4324
+ /* */
4325
+ /* */
4326
+ /* */
4327
+ /* */
4328
+ /* */
4329
+ /* */
4330
+ /* */
4331
+ /* */
4332
+ /* */
4333
+ /* */
4334
+ /* */
4335
+ /* */
4336
+ /* */
4337
+ /* */
4338
+ /* */
4339
+ /* */
4340
+ /* */
4341
+ /* */
4342
+ /* */
4343
+ /* */
4344
+ /* */
4345
+ /* */
4346
+ /* */
4347
+ /* */
4348
+ /* */
4349
+ /* */
4350
+ /* */
4351
+ /* */
4352
+ /* */
4353
+ /* */
4354
+ /* */
4355
+ /* */
4356
+ /* */
4357
+ /* */
4358
+ /* */
4359
+ /* */
4360
+ /* */
4361
+ /* */
4362
+ /* */
4363
+ /* */
4364
+ /* */
4365
+ /* */
4366
+ /* */
4367
+ /* */
4368
+ /* */
4369
+ /* */
4370
+ /* */
4371
+ /* */
4372
+ /* */
4373
+ /* */
4374
+ /* */
4375
+ /* */
4376
+ /* */
4377
+ /* */
4378
+ /* */
4379
+ /* */
4380
+ /* */
4381
+ /* */
4382
+ /* */
4383
+ /* */
4384
+ /* */
4385
+ /* */
4386
+ /* */
4387
+ /* */
4388
+ /* */
4389
+ /* */
4390
+ /* */
4391
+ /* */
4392
+ /* */
4393
+ /* */
4394
+ /* */
4395
+ /* */
4396
+ /* */
4397
+ /* */
4398
+ /* */
4399
+ /* */
4400
+ /* */
4401
+ /* */
4402
+ /* */
4403
+ /* */
4404
+ /* */
4405
+ /* */
4406
+ /* */
4407
+ /* */
4408
+ /* */
4409
+ /* */
4410
+ /* */
4411
+ /* */
4412
+ /* */
4413
+ /* */
4414
+ /* */
4415
+ /* */
4416
+ /* */
4417
+ /* */
4418
+ /* */
4419
+ /* */
4420
+ return (void 0);
4421
+ };
4422
+ //#endregion
4423
+ //#region replace import to assets imports
4424
+ const replaceImportToAssetsIMport = (rawContentForBrowser, nameForNpmPackage, relativeFilePath, project) => {
4425
+ /* */
4426
+ /* */
4427
+ /* */
4428
+ /* */
4429
+ /* */
4430
+ /* */
4431
+ /* */
4432
+ /* */
4433
+ /* */
4434
+ /* */
4435
+ /* */
4436
+ /* */
4437
+ /* */
4438
+ /* */
4439
+ /* */
4440
+ /* */
4441
+ /* */
4442
+ /* */
4443
+ /* */
4444
+ /* */
4445
+ /* */
4446
+ /* */
4447
+ /* */
4448
+ /* */
4449
+ /* */
4450
+ /* */
4451
+ /* */
4452
+ /* */
4453
+ return (void 0);
4454
+ };
4455
+ //#endregion
4456
+ //#region copy 64 hash
4457
+ async function hash64() {
4458
+ /* */
4459
+ /* */
4460
+ /* */
4461
+ /* */
4462
+ /* */
4463
+ /* */
4464
+ /* */
4465
+ /* */
4466
+ /* */
4467
+ return (void 0);
4468
+ }
4469
+ const compareAndSave = ({ fileAbsPath, isFirstTime, newContent, oldContent, isBackend, project, }) => {
4470
+ /* */
4471
+ /* */
4472
+ /* */
4473
+ /* */
4474
+ /* */
4475
+ /* */
4476
+ /* */
4477
+ /* */
4478
+ /* */
4479
+ /* */
4480
+ /* */
4481
+ /* */
4482
+ /* */
4483
+ /* */
4484
+ /* */
4485
+ /* */
4486
+ /* */
4487
+ /* */
4488
+ /* */
4489
+ /* */
4490
+ /* */
4491
+ /* */
4492
+ return (void 0);
4493
+ };
4494
+
3596
4495
  const vscodeMenuItems = ({ vscode, FRAMEWORK_NAME, CURRENT_PROJECT, ProjectItem, focustFirstElement, runInTerminal, tmp_FRONTEND_NORMAL_APP_PORT, tmp_FRONTEND_WEBSQL_APP_PORT, tmp_FRONTEND_CLOUDFLARE_APP_PORT, skipTaonItems, }) => {
3597
4496
  return [
3598
4497
  //#region items with actions / git log
@@ -4036,6 +4935,27 @@ const vscodeMenuItems = ({ vscode, FRAMEWORK_NAME, CURRENT_PROJECT, ProjectItem,
4036
4935
  }),
4037
4936
  //#endregion
4038
4937
  //#region items with actions / regenerate src/lib/index._auto-generated_.ts
4938
+ new ProjectItem(`$ ${FRAMEWORK_NAME} generate:hash64`, vscode.TreeItemCollapsibleState.None, {
4939
+ iconPath: null,
4940
+ project: CURRENT_PROJECT,
4941
+ // skipReturnToMenu: true,
4942
+ triggerActionOnClick: async (project, progress) => {
4943
+ if (project) {
4944
+ progress?.report({
4945
+ message: 'Generating random 64 characters hash',
4946
+ });
4947
+ const hash = await hash64();
4948
+ vscode.env.clipboard.writeText(hash);
4949
+ progress?.report({
4950
+ message: 'Done generating random 64 characters hash',
4951
+ increment: 100,
4952
+ });
4953
+ vscode.window.showInformationMessage(`Hash copied to clipboard: ${hash}`);
4954
+ }
4955
+ },
4956
+ }),
4957
+ //#endregion
4958
+ //#region items with actions / regenerate src/lib/index._auto-generated_.ts
4039
4959
  // new ProjectItem(
4040
4960
  // `$ ${FRAMEWORK_NAME} genreate:new:component:structure:ai:info`,
4041
4961
  // vscode.TreeItemCollapsibleState.None,