tnp-helpers 19.0.44 → 19.0.45

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 (64) hide show
  1. package/browser/fesm2022/tnp-helpers.mjs +232 -35
  2. package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
  3. package/browser/lib/base/classes/base-cli-worker/base-cli-worker-database-config.d.ts +10 -0
  4. package/browser/lib/base/classes/base-cli-worker/base-cli-worker-terminal-ui.d.ts +10 -9
  5. package/browser/lib/base/classes/base-cli-worker/base-cli-worker.d.ts +9 -3
  6. package/browser/lib/base/classes/base-cli-worker/index.d.ts +1 -0
  7. package/browser/lib/base/tcp-udp-ports/tcp-upd-ports-terminal-ui.d.ts +2 -2
  8. package/browser/lib/build-info._auto-generated_.d.ts +1 -1
  9. package/browser/lib/helpers/for-backend/helpers-file-folders.d.ts +1 -1
  10. package/browser/lib/models.d.ts +0 -2
  11. package/browser/lib/utils.d.ts +44 -29
  12. package/browser/package.json +1 -1
  13. package/lib/base/classes/base-cli-worker/base-cli-worker-database-config.d.ts +14 -0
  14. package/lib/base/classes/base-cli-worker/base-cli-worker-database-config.js +31 -0
  15. package/lib/base/classes/base-cli-worker/base-cli-worker-database-config.js.map +1 -0
  16. package/lib/base/classes/base-cli-worker/base-cli-worker-terminal-ui.d.ts +11 -10
  17. package/lib/base/classes/base-cli-worker/base-cli-worker-terminal-ui.js +2 -15
  18. package/lib/base/classes/base-cli-worker/base-cli-worker-terminal-ui.js.map +1 -1
  19. package/lib/base/classes/base-cli-worker/base-cli-worker.d.ts +9 -3
  20. package/lib/base/classes/base-cli-worker/base-cli-worker.js +32 -10
  21. package/lib/base/classes/base-cli-worker/base-cli-worker.js.map +1 -1
  22. package/lib/base/classes/base-cli-worker/index.d.ts +1 -0
  23. package/lib/base/classes/base-cli-worker/index.js +1 -0
  24. package/lib/base/classes/base-cli-worker/index.js.map +1 -1
  25. package/lib/base/classes/base-global-command-line.backend.d.ts +2 -0
  26. package/lib/base/classes/base-global-command-line.backend.js +109 -3
  27. package/lib/base/classes/base-global-command-line.backend.js.map +1 -1
  28. package/lib/base/classes/base-project.js +6 -2
  29. package/lib/base/classes/base-project.js.map +1 -1
  30. package/lib/base/classes/base-release-process.js +2 -2
  31. package/lib/base/classes/base-release-process.js.map +1 -1
  32. package/lib/base/tcp-udp-ports/not-assignable-port.entity.js +2 -2
  33. package/lib/base/tcp-udp-ports/tcp-udp-ports.context.js +2 -18
  34. package/lib/base/tcp-udp-ports/tcp-udp-ports.context.js.map +1 -1
  35. package/lib/base/tcp-udp-ports/tcp-upd-ports-terminal-ui.d.ts +3 -3
  36. package/lib/base/tcp-udp-ports/tcp-upd-ports-terminal-ui.js +15 -5
  37. package/lib/base/tcp-udp-ports/tcp-upd-ports-terminal-ui.js.map +1 -1
  38. package/lib/build-info._auto-generated_.d.ts +1 -1
  39. package/lib/build-info._auto-generated_.js +1 -1
  40. package/lib/helpers/for-backend/helpers-file-folders.d.ts +1 -1
  41. package/lib/helpers/for-backend/helpers-file-folders.js +2 -0
  42. package/lib/helpers/for-backend/helpers-file-folders.js.map +1 -1
  43. package/lib/helpers/for-browser/angular.helper.js +2 -2
  44. package/lib/models.d.ts +0 -2
  45. package/lib/models.js.map +1 -1
  46. package/lib/old/base-component.js +2 -2
  47. package/lib/old/base-formly-component.js +2 -2
  48. package/lib/old/dual-component-ctrl.js +2 -2
  49. package/lib/utils.d.ts +44 -29
  50. package/lib/utils.js +136 -4
  51. package/lib/utils.js.map +1 -1
  52. package/package.json +1 -1
  53. package/websql/fesm2022/tnp-helpers.mjs +232 -35
  54. package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
  55. package/websql/lib/base/classes/base-cli-worker/base-cli-worker-database-config.d.ts +10 -0
  56. package/websql/lib/base/classes/base-cli-worker/base-cli-worker-terminal-ui.d.ts +10 -9
  57. package/websql/lib/base/classes/base-cli-worker/base-cli-worker.d.ts +9 -3
  58. package/websql/lib/base/classes/base-cli-worker/index.d.ts +1 -0
  59. package/websql/lib/base/tcp-udp-ports/tcp-upd-ports-terminal-ui.d.ts +2 -2
  60. package/websql/lib/build-info._auto-generated_.d.ts +1 -1
  61. package/websql/lib/helpers/for-backend/helpers-file-folders.d.ts +1 -1
  62. package/websql/lib/models.d.ts +0 -2
  63. package/websql/lib/utils.d.ts +44 -29
  64. package/websql/package.json +1 -1
@@ -0,0 +1,10 @@
1
+ // @ts-nocheck
2
+ import { Models } from 'taon/websql';
3
+ /**
4
+ * Get taon service database config
5
+ * (database is stored in user's home directory)
6
+ * @param serviceNameUniqueInSystem - unique name of the service in the system
7
+ * @param recreateMode - mode of database recreation, default is 'DROP_DB+MIGRATIONS'
8
+ * @returns DatabaseConfig object with location and recreateMode
9
+ */
10
+ export declare const getBaseCliWorkerDatabaseConfig: (serviceNameUniqueInSystem: string, recreateMode?: Models.DBRecreateMode) => any;
@@ -1,13 +1,19 @@
1
1
  // @ts-nocheck
2
- import type { CfontAlign, CfontStyle } from '../../../models';
2
+ import { CoreModels } from 'tnp-core/websql';
3
3
  import type { BaseCliWorker } from './base-cli-worker';
4
4
  import type { BaseCliWorkerController } from './base-cli-worker-controller';
5
+ export type BaseWorkerTerminalActionReturnType = {
6
+ [uniqeActionName: string]: {
7
+ name: string;
8
+ action: () => unknown | Promise<unknown>;
9
+ };
10
+ };
5
11
  export declare class BaseCliWorkerTerminalUI<WORKER extends BaseCliWorker<BaseCliWorkerController, any>> {
6
12
  protected worker: WORKER;
7
13
  constructor(worker: WORKER);
8
14
  protected headerText(): Promise<string>;
9
- protected textHeaderStyle(): CfontStyle;
10
- protected headerTextAlign(): CfontAlign;
15
+ protected textHeaderStyle(): CoreModels.CfontStyle;
16
+ protected headerTextAlign(): CoreModels.CfontAlign;
11
17
  /**
12
18
  * override whole terminal header
13
19
  */
@@ -27,12 +33,7 @@ export declare class BaseCliWorkerTerminalUI<WORKER extends BaseCliWorker<BaseCl
27
33
  protected getWorkerTerminalActions(options?: {
28
34
  exitIsOnlyReturn?: boolean;
29
35
  chooseAction?: boolean;
30
- }): {
31
- [uniqeActionName: string]: {
32
- name: string;
33
- action: () => unknown | Promise<unknown>;
34
- };
35
- };
36
+ }): BaseWorkerTerminalActionReturnType;
36
37
  infoScreen(options?: {
37
38
  exitIsOnlyReturn?: boolean;
38
39
  }): Promise<void>;
@@ -39,11 +39,15 @@ export declare abstract class BaseCliWorker<REMOTE_CTRL extends BaseCliWorkerCon
39
39
  */
40
40
  serviceVersion: string);
41
41
  /**
42
+ * <strong>IMPORTANT USE ONLY IN DEVELOPMENT !!!</strong>
43
+ * for production use startDetachedIfNeedsToBeStarted()
42
44
  * start normally process
43
45
  * this will crash if process already started
44
46
  */
45
- protected startNormallyInCurrentProcess(): Promise<void>;
46
- getControllerForRemoteConnection(): Promise<REMOTE_CTRL>;
47
+ startNormallyInCurrentProcess(): Promise<void>;
48
+ getControllerForRemoteConnection(options?: {
49
+ calledFrom?: string;
50
+ }): Promise<REMOTE_CTRL>;
47
51
  startDetachedIfNeedsToBeStarted(options?: {
48
52
  useCurrentWindowForDetach?: boolean;
49
53
  }): Promise<any>;
@@ -85,6 +89,8 @@ export declare abstract class BaseCliWorker<REMOTE_CTRL extends BaseCliWorkerCon
85
89
  }): Promise<void>;
86
90
  private saveProcessInfo;
87
91
  protected initializeWorkerMetadata(): Promise<any>;
88
- protected waitForProcessPortSavedToDisk(): Promise<void>;
92
+ protected waitForProcessPortSavedToDisk(options?: {
93
+ calledFrom?: string;
94
+ }): Promise<void>;
89
95
  getServicePort(): Promise<number>;
90
96
  }
@@ -1,5 +1,6 @@
1
1
  // @ts-nocheck
2
2
  export * from './base-cli-worker';
3
+ export * from './base-cli-worker-database-config';
3
4
  export * from './base-cli-worker-controller';
4
5
  export * from './base-cli-worker-config';
5
6
  export * from './base-cli-worker-terminal-ui';
@@ -1,12 +1,12 @@
1
1
  // @ts-nocheck
2
+ import { CoreModels } from 'tnp-core/websql';
2
3
  import { Port } from '../../index';
3
- import { CfontStyle } from '../../models';
4
4
  import { BaseCliWorkerTerminalUI } from '../classes/base-cli-worker/base-cli-worker-terminal-ui';
5
5
  import { PortStatus } from './ports.entity';
6
6
  import type { PortsWorker } from './tcp-upd-ports.worker';
7
7
  export declare class TcpUdpPortsTerminalUI extends BaseCliWorkerTerminalUI<PortsWorker> {
8
8
  protected headerText(): Promise<string>;
9
- protected textHeaderStyle(): CfontStyle;
9
+ protected textHeaderStyle(): CoreModels.CfontStyle;
10
10
  protected crudMenuForTakeByOsPorts(): Promise<void>;
11
11
  protected addPortTerminalUiProcess(): Promise<void>;
12
12
  protected selectPortProcess(ports: Port[], title: string): Promise<Port>;
@@ -18,4 +18,4 @@ export declare const PROJECT_NPM_NAME = "tnp-helpers";
18
18
  /**
19
19
  * Autogenerated by current cli tool. Use *tnp release* to bump version.
20
20
  */
21
- export declare const CURRENT_PACKAGE_VERSION = "19.0.44";
21
+ export declare const CURRENT_PACKAGE_VERSION = "19.0.45";
@@ -101,7 +101,7 @@ export declare class HelpersFileFolders {
101
101
  } & CopyOptionsSync): void;
102
102
  filterDontCopy(basePathFoldersTosSkip: string[], projectOrBasepath: string): any;
103
103
  filterOnlyCopy(basePathFoldersOnlyToInclude: string[], projectOrBasepath: string): any;
104
- copyFile(sourcePath: string, destinationPath: string, options?: {
104
+ copyFile(sourcePath: string | string[], destinationPath: string | string[], options?: {
105
105
  transformTextFn?: (input: string) => string;
106
106
  debugMode?: boolean;
107
107
  fast?: boolean;
@@ -137,8 +137,6 @@ export declare class CommandProcess {
137
137
  start(options?: CommandProcessRunOptions): Promise<void>;
138
138
  stop(): Promise<void>;
139
139
  }
140
- export type CfontStyle = 'block' | 'slick' | 'tiny' | 'grid' | 'pallet' | 'shade' | 'chrome' | 'simple' | 'simpleBlock' | '3d' | 'simple3d' | 'huge';
141
- export type CfontAlign = 'left' | 'center' | 'right' | 'block';
142
140
  export interface DockerComposeFile {
143
141
  version: string;
144
142
  services: Record<string, DockerService>;
@@ -19,7 +19,7 @@ export declare namespace UtilsTypescript {
19
19
  * @param regionName - The name of the region to remove.
20
20
  * @returns Modified TypeScript code without the specified regions.
21
21
  */
22
- export const removeRegionByName: (sourceCode: string, regionName: string) => string;
22
+ const removeRegionByName: (sourceCode: string, regionName: string) => string;
23
23
  interface ExportInfo {
24
24
  type: 'class' | 'function' | 'const' | 'let' | 'var' | 'enum' | 'type' | 'interface' | 'default' | 'module' | 'namespace';
25
25
  name: string;
@@ -27,34 +27,34 @@ export declare namespace UtilsTypescript {
27
27
  /**
28
28
  * Function to extract exports from a TypeScript file
29
29
  */
30
- export const exportsFromFile: (filePath: string) => ExportInfo[];
30
+ const exportsFromFile: (filePath: string) => ExportInfo[];
31
31
  /**
32
32
  * Function to extract exports from a TypeScript file
33
33
  */
34
- export const exportsFromContent: (fileContent: string) => ExportInfo[];
35
- export const extractDefaultClassNameFromString: (sourceCode: string) => string | undefined;
36
- export const extractClassNameFromString: (sourceCode: string) => string[];
37
- export const extractClassNamesFromFile: (absoluteFilePath: string) => string[];
38
- export const extractDefaultClassNameFromFile: (absoluteFilePath: string) => any;
39
- export const formatFile: (absPathToFile: string | string[]) => void;
40
- export const formatAllFilesInsideFolder: (absPathToFolder: string) => void;
41
- export const eslintFixFile: (absPathToFile: string | string[]) => void;
42
- export const eslintFixAllFilesInsideFolder: (absPathToFolder: string | string[]) => void;
43
- export const getTaonContextFromContent: (fileContent: string) => string[];
44
- export const getTaonContextsNamesFromFile: (tsAbsFilePath: string) => string[];
45
- export const extractAngularComponentSelectors: (fileAbsPath: string) => {
34
+ const exportsFromContent: (fileContent: string) => ExportInfo[];
35
+ const extractDefaultClassNameFromString: (sourceCode: string) => string | undefined;
36
+ const extractClassNameFromString: (sourceCode: string) => string[];
37
+ const extractClassNamesFromFile: (absoluteFilePath: string) => string[];
38
+ const extractDefaultClassNameFromFile: (absoluteFilePath: string) => any;
39
+ const formatFile: (absPathToFile: string | string[]) => void;
40
+ const formatAllFilesInsideFolder: (absPathToFolder: string) => void;
41
+ const eslintFixFile: (absPathToFile: string | string[]) => void;
42
+ const eslintFixAllFilesInsideFolder: (absPathToFolder: string | string[]) => void;
43
+ const getTaonContextFromContent: (fileContent: string) => string[];
44
+ const getTaonContextsNamesFromFile: (tsAbsFilePath: string) => string[];
45
+ const extractAngularComponentSelectors: (fileAbsPath: string) => {
46
46
  className: string;
47
47
  selector: string;
48
48
  }[];
49
- export const wrapWithComment: (oneLineComment: string, absDestFilePath: string) => any;
49
+ const wrapWithComment: (oneLineComment: string, absDestFilePath: string) => any;
50
50
  /**
51
51
  * Attempts to set or add an exported const with given name and value.
52
52
  */
53
- export const setValueToVariableInTsFile: (tsAbsFilePath: string, variableName: string, valueOfVariable: any, options?: {
53
+ const setValueToVariableInTsFile: (tsAbsFilePath: string, variableName: string, valueOfVariable: any, options?: {
54
54
  skipAddIfNotExists?: boolean;
55
55
  useRawStringValue?: boolean;
56
56
  }) => void;
57
- export class TsImportExport {
57
+ class TsImportExport {
58
58
  /**
59
59
  * for external modification
60
60
  */
@@ -96,27 +96,26 @@ export declare namespace UtilsTypescript {
96
96
  getStringPartFrom(wholeContentOfFile: string): string;
97
97
  wrapInParenthesis(str: string): string;
98
98
  }
99
- export const recognizeImportsFromFile: (fileAbsPAth: string) => TsImportExport[];
100
- export const recognizeImportsFromContent: (fileContent: string) => TsImportExport[];
99
+ const recognizeImportsFromFile: (fileAbsPAth: string) => TsImportExport[];
100
+ const recognizeImportsFromContent: (fileContent: string) => TsImportExport[];
101
101
  /**
102
102
  * Transition methods ng18 => ng19
103
103
  * Remove standalone:true from component decorator
104
104
  * and add standalone: false if not exists
105
105
  */
106
- export function transformComponentStandaloneOption(sourceText: string): string;
107
- export const fixHtmlTemplatesInDir: (directoryPath: string) => void;
108
- export function removeTaggedImportExport(tsFileContent: string, tags: string[]): string;
109
- export const wrapFirstImportsInImportsRegion: (fileContent: string) => string;
106
+ function transformComponentStandaloneOption(sourceText: string): string;
107
+ const fixHtmlTemplatesInDir: (directoryPath: string) => void;
108
+ function removeTaggedImportExport(tsFileContent: string, tags: string[]): string;
109
+ const wrapFirstImportsInImportsRegion: (fileContent: string) => string;
110
110
  /**
111
111
  * wrap class field with decorators
112
112
  * wrap class methods with decorators
113
113
  */
114
- export function wrapContentClassMembersDecoratorsWithRegion(classFileContent: string, wrapTag?: string): string;
115
- export const clearRequireCacheRecursive: (modulePath: string, seen?: Set<string>) => void;
116
- export type DeepWritable<T> = {
114
+ function wrapContentClassMembersDecoratorsWithRegion(classFileContent: string, wrapTag?: string): string;
115
+ const clearRequireCacheRecursive: (modulePath: string, seen?: Set<string>) => void;
116
+ type DeepWritable<T> = {
117
117
  -readonly [P in keyof T]: T[P] extends object ? T[P] extends Function ? T[P] : DeepWritable<T[P]> : T[P];
118
118
  };
119
- export {};
120
119
  }
121
120
  export declare namespace UtilsHttp {
122
121
  const startHttpServer: (cwd: string, port: number) => Promise<any>;
@@ -157,7 +156,8 @@ export declare namespace UtilsVSCode {
157
156
  const vscodeImport: () => any;
158
157
  }
159
158
  export declare namespace UtilsDotFile {
160
- const setValueToDotFile: (dotFileAbsPath: string | string[], value: string, key: string | number | boolean) => void;
159
+ const setValueToDotFile: (dotFileAbsPath: string | string[], key: string, value: string | number | boolean) => void;
160
+ const setCommentToKeyInDotFile: (dotFileAbsPath: string | string[], key: string, comment: string) => void;
161
161
  const getValueFromDotFile: (dotFileAbsPath: string | string[], key: string) => string | number | boolean;
162
162
  const setValuesKeysFromObject: (dotFileAbsPath: string | string[], obj: Record<string, string | number | boolean>, options?: {
163
163
  /**
@@ -166,6 +166,10 @@ export declare namespace UtilsDotFile {
166
166
  setAsNewFile?: boolean;
167
167
  }) => void;
168
168
  const getValuesKeysAsJsonObject: <T = Record<string, string | number | boolean>>(dotFileAbsPath: string | string[]) => T;
169
+ /**
170
+ * @returns key|comment pairs as json object
171
+ */
172
+ const getCommentsKeysAsJsonObject: <T = Record<string, string>>(dotFileAbsPath: string | string[]) => T;
169
173
  }
170
174
  export declare namespace UtilsZipBrowser {
171
175
  const zipDirBrowser: (fileList: FileList) => Promise<Blob>;
@@ -178,6 +182,17 @@ export declare namespace UtilsZip {
178
182
  * @returns true if file was split, false if not needed
179
183
  */
180
184
  const splitFile: (inputPath: string, partSizeMB?: number) => Promise<number>;
181
- const zipDir: (absPathToDir: string) => Promise<void>;
185
+ /**
186
+ * @returns absolute path to zip file
187
+ */
188
+ const zipDir: (absPathToDir: string, options?: {
189
+ /**
190
+ * default false
191
+ */
192
+ overrideIfZipFileExists?: boolean;
193
+ }) => Promise<string>;
182
194
  const unzipArchive: (absPathToZip: string) => Promise<void>;
195
+ }
196
+ export declare namespace UtilsTaonWorker {
197
+ const getUniqueForTask: (task: string, location: string | string[]) => string;
183
198
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tnp-helpers/websql",
3
- "version": "19.0.44",
3
+ "version": "19.0.45",
4
4
  "module": "fesm2022/tnp-helpers.mjs",
5
5
  "typings": "index.d.ts",
6
6
  "exports": {