tnp-helpers 19.0.11 → 19.0.12

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 (31) hide show
  1. package/browser/fesm2022/tnp-helpers.mjs +84 -61
  2. package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
  3. package/browser/lib/build-info._auto-generated_.d.ts +1 -1
  4. package/browser/lib/helpers/for-backend/helpers-file-folders.d.ts +7 -0
  5. package/browser/package.json +1 -1
  6. package/client/fesm2022/tnp-helpers.mjs +84 -61
  7. package/client/fesm2022/tnp-helpers.mjs.map +1 -1
  8. package/client/lib/build-info._auto-generated_.d.ts +1 -1
  9. package/client/lib/helpers/for-backend/helpers-file-folders.d.ts +7 -0
  10. package/client/package.json +1 -1
  11. package/lib/base/tcp-udp-ports/not-assignable-port.entity.js +2 -2
  12. package/lib/base/tcp-udp-ports/ports.entity.d.ts +1 -1
  13. package/lib/base/tcp-udp-ports/tcp-udp-ports.context.d.ts +2 -2
  14. package/lib/build-info._auto-generated_.d.ts +1 -1
  15. package/lib/build-info._auto-generated_.js +1 -1
  16. package/lib/helpers/for-backend/helpers-file-folders.d.ts +7 -0
  17. package/lib/helpers/for-backend/helpers-file-folders.js +43 -0
  18. package/lib/helpers/for-backend/helpers-file-folders.js.map +1 -1
  19. package/lib/helpers/for-browser/angular.helper.js +2 -2
  20. package/lib/old/base-component.js +2 -2
  21. package/lib/old/base-formly-component.js +2 -2
  22. package/lib/old/dual-component-ctrl.js +2 -2
  23. package/lib/utils.js +0 -2
  24. package/lib/utils.js.map +1 -1
  25. package/package.json +1 -1
  26. package/tmp-environment.json +3 -3
  27. package/websql/fesm2022/tnp-helpers.mjs +84 -61
  28. package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
  29. package/websql/lib/build-info._auto-generated_.d.ts +1 -1
  30. package/websql/lib/helpers/for-backend/helpers-file-folders.d.ts +7 -0
  31. package/websql/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { _, CoreModels, Utils, CoreHelpers, Helpers as Helpers$1, UtilsTerminal, crossPlatformPath, path, fse, chalk } from 'tnp-core/browser';
2
2
  import { Subject } from 'rxjs';
3
- import { isImportDeclaration, isNamedImports, isExportDeclaration, isNamedExports } from 'typescript';
3
+ import { isImportDeclaration, isNamedImports, isExportDeclaration, isNamedExports, createSourceFile, ScriptTarget, ScriptKind } from 'typescript';
4
4
  import * as fuzzy from 'fuzzy';
5
5
  import { Level } from 'ng2-logger/browser';
6
6
  import { CLASS } from 'typescript-class-helpers/browser';
@@ -1143,65 +1143,46 @@ var UtilsTypescript;
1143
1143
  //#endregion
1144
1144
  //#region remove tagged imports/exports
1145
1145
  function removeTaggedImportExport(tsFileContent, tags) {
1146
- /* */
1147
- /* */
1148
- /* */
1149
- /* */
1150
- /* */
1151
- /* */
1152
- /* */
1153
- /* */
1154
- /* */
1155
- /* */
1156
- /* */
1157
- /* */
1158
- /* */
1159
- /* */
1160
- /* */
1161
- /* */
1162
- /* */
1163
- /* */
1164
- /* */
1165
- /* */
1166
- /* */
1167
- /* */
1168
- /* */
1169
- /* */
1170
- /* */
1171
- /* */
1172
- /* */
1173
- /* */
1174
- /* */
1175
- /* */
1176
- /* */
1177
- /* */
1178
- /* */
1179
- /* */
1180
- /* */
1181
- /* */
1182
- /* */
1183
- /* */
1184
- /* */
1185
- /* */
1186
- /* */
1187
- /* */
1188
- /* */
1189
- /* */
1190
- /* */
1191
- /* */
1192
- /* */
1193
- /* */
1194
- /* */
1195
- /* */
1196
- /* */
1197
- /* */
1198
- /* */
1199
- /* */
1200
- /* */
1201
- /* */
1202
- /* */
1203
- /* */
1204
- return (void 0);
1146
+ const sourceFile = createSourceFile('temp.ts', tsFileContent, ScriptTarget.Latest, true, ScriptKind.TS);
1147
+ // debug && console.log(tsFileContent);
1148
+ const lines = tsFileContent.split(/\r?\n/);
1149
+ const tagRegex = new RegExp(tags
1150
+ .map(t => (Array.isArray(t) ? t[0] : t))
1151
+ .filter(Boolean)
1152
+ .map(Utils.escapeStringForRegEx)
1153
+ .join('|'), 'i');
1154
+ let a = 0;
1155
+ for (const statement of sourceFile.statements) {
1156
+ // debug && console.log('processing line ' + a++);
1157
+ if (!isImportDeclaration(statement) && !isExportDeclaration(statement)) {
1158
+ continue;
1159
+ }
1160
+ const start = statement.getStart();
1161
+ const end = statement.getEnd();
1162
+ const startLine = sourceFile.getLineAndCharacterOfPosition(start).line;
1163
+ const endLine = sourceFile.getLineAndCharacterOfPosition(end).line;
1164
+ // get full text including trailing comments
1165
+ const endLineText = lines[endLine]; // ← get real line content from file
1166
+ if (!tagRegex.test(endLineText))
1167
+ continue;
1168
+ // debug &&
1169
+ // console.log(`
1170
+ // start: ${start}
1171
+ // end: ${end}
1172
+ // startLine: ${startLine}
1173
+ // endLine: ${endLine}
1174
+ // endLineText: >> ${endLineText} <<
1175
+ // `);
1176
+ // console.log('removing line ' + startLine + ' to ' + endLine);
1177
+ for (let i = startLine; i <= endLine; i++) {
1178
+ const original = lines[i];
1179
+ lines[i] = '/* */' + ' '.repeat(Math.max(0, original.length - 4));
1180
+ }
1181
+ }
1182
+ // debug && console.log('\n\n\n\n');
1183
+ const result = lines.join('\n');
1184
+ // debug && console.log(result)
1185
+ return result;
1205
1186
  }
1206
1187
  UtilsTypescript.removeTaggedImportExport = removeTaggedImportExport;
1207
1188
  //#endregion
@@ -3160,6 +3141,48 @@ class HelpersFileFolders {
3160
3141
  /* */
3161
3142
  return (void 0);
3162
3143
  }
3144
+ /**
3145
+ * Copy folder using os native command
3146
+ * (perfect for large folders/files)
3147
+ */
3148
+ async copyFolderOsNative(from, to, options) {
3149
+ /* */
3150
+ /* */
3151
+ /* */
3152
+ /* */
3153
+ /* */
3154
+ /* */
3155
+ /* */
3156
+ /* */
3157
+ /* */
3158
+ /* */
3159
+ /* */
3160
+ /* */
3161
+ /* */
3162
+ /* */
3163
+ /* */
3164
+ /* */
3165
+ /* */
3166
+ /* */
3167
+ /* */
3168
+ /* */
3169
+ /* */
3170
+ /* */
3171
+ /* */
3172
+ /* */
3173
+ /* */
3174
+ /* */
3175
+ /* */
3176
+ /* */
3177
+ /* */
3178
+ /* */
3179
+ /* */
3180
+ /* */
3181
+ /* */
3182
+ /* */
3183
+ /* */
3184
+ return (void 0);
3185
+ }
3163
3186
  copy(sourceDir, destinationDir, options) {
3164
3187
  /* */
3165
3188
  /* */
@@ -5773,7 +5796,7 @@ class PortsWorker extends BaseCliWorker {
5773
5796
  // THIS FILE IS GENERATED - DO NOT MODIFY
5774
5797
  const BUILD_FRAMEWORK_CLI_NAME = 'tnp';
5775
5798
  const PROJECT_NPM_NAME = 'tnp-helpers';
5776
- const CURRENT_PACKAGE_VERSION = '19.0.11';
5799
+ const CURRENT_PACKAGE_VERSION = '19.0.12';
5777
5800
  // THIS FILE IS GENERATED - DO NOT MODIFY
5778
5801
 
5779
5802
  //#endregion