tnp-helpers 13.1.13 → 13.1.14

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 (158) hide show
  1. package/app.js +3 -3
  2. package/browser/README.md +24 -24
  3. package/browser/esm2020/lib/base-component.mjs +49 -49
  4. package/browser/esm2020/lib/base-formly-component.mjs +112 -112
  5. package/browser/esm2020/lib/condition-wait.mjs +45 -45
  6. package/browser/esm2020/lib/constants.mjs +7 -7
  7. package/browser/esm2020/lib/dual-component-ctrl.mjs +118 -118
  8. package/browser/esm2020/lib/firedev-models.mjs +3 -3
  9. package/browser/esm2020/lib/helpers-array-obj.mjs +82 -82
  10. package/browser/esm2020/lib/helpers-environment.mjs +32 -32
  11. package/browser/esm2020/lib/helpers-numbers.mjs +8 -8
  12. package/browser/esm2020/lib/helpers-strings-regexes.mjs +50 -50
  13. package/browser/esm2020/lib/helpers-strings.mjs +252 -252
  14. package/browser/esm2020/lib/helpers.mjs +279 -279
  15. package/browser/esm2020/lib/index.mjs +14 -14
  16. package/browser/esm2020/lib/long-press.directive.mjs +112 -112
  17. package/browser/esm2020/lib/project.mjs +429 -429
  18. package/browser/esm2020/lib/resize-service.mjs +21 -21
  19. package/browser/esm2020/public-api.mjs +1 -1
  20. package/browser/esm2020/tnp-helpers.mjs +4 -4
  21. package/browser/fesm2015/tnp-helpers.mjs +1542 -1542
  22. package/browser/fesm2020/tnp-helpers.mjs +1534 -1534
  23. package/browser/lib/base-component.d.ts +16 -16
  24. package/browser/lib/base-formly-component.d.ts +30 -30
  25. package/browser/lib/condition-wait.d.ts +7 -7
  26. package/browser/lib/constants.d.ts +5 -5
  27. package/browser/lib/dual-component-ctrl.d.ts +24 -24
  28. package/browser/lib/firedev-models.d.ts +12 -12
  29. package/browser/lib/helpers-array-obj.d.ts +14 -14
  30. package/browser/lib/helpers-environment.d.ts +4 -4
  31. package/browser/lib/helpers-numbers.d.ts +2 -2
  32. package/browser/lib/helpers-strings-regexes.d.ts +27 -27
  33. package/browser/lib/helpers-strings.d.ts +49 -49
  34. package/browser/lib/helpers.d.ts +27 -27
  35. package/browser/lib/index.d.ts +10 -10
  36. package/browser/lib/long-press.directive.d.ts +24 -24
  37. package/browser/lib/project.d.ts +94 -94
  38. package/browser/lib/resize-service.d.ts +8 -8
  39. package/browser/tnp-helpers.d.ts +4 -4
  40. package/client/README.md +24 -24
  41. package/client/esm2020/lib/base-component.mjs +49 -49
  42. package/client/esm2020/lib/base-formly-component.mjs +112 -112
  43. package/client/esm2020/lib/condition-wait.mjs +45 -45
  44. package/client/esm2020/lib/constants.mjs +7 -7
  45. package/client/esm2020/lib/dual-component-ctrl.mjs +118 -118
  46. package/client/esm2020/lib/firedev-models.mjs +3 -3
  47. package/client/esm2020/lib/helpers-array-obj.mjs +82 -82
  48. package/client/esm2020/lib/helpers-environment.mjs +32 -32
  49. package/client/esm2020/lib/helpers-numbers.mjs +8 -8
  50. package/client/esm2020/lib/helpers-strings-regexes.mjs +50 -50
  51. package/client/esm2020/lib/helpers-strings.mjs +252 -252
  52. package/client/esm2020/lib/helpers.mjs +279 -279
  53. package/client/esm2020/lib/index.mjs +14 -14
  54. package/client/esm2020/lib/long-press.directive.mjs +112 -112
  55. package/client/esm2020/lib/project.mjs +429 -429
  56. package/client/esm2020/lib/resize-service.mjs +21 -21
  57. package/client/esm2020/public-api.mjs +1 -1
  58. package/client/esm2020/tnp-helpers.mjs +4 -4
  59. package/client/fesm2015/tnp-helpers.mjs +1542 -1542
  60. package/client/fesm2020/tnp-helpers.mjs +1534 -1534
  61. package/client/lib/base-component.d.ts +16 -16
  62. package/client/lib/base-formly-component.d.ts +30 -30
  63. package/client/lib/condition-wait.d.ts +7 -7
  64. package/client/lib/constants.d.ts +5 -5
  65. package/client/lib/dual-component-ctrl.d.ts +24 -24
  66. package/client/lib/firedev-models.d.ts +12 -12
  67. package/client/lib/helpers-array-obj.d.ts +14 -14
  68. package/client/lib/helpers-environment.d.ts +4 -4
  69. package/client/lib/helpers-numbers.d.ts +2 -2
  70. package/client/lib/helpers-strings-regexes.d.ts +27 -27
  71. package/client/lib/helpers-strings.d.ts +49 -49
  72. package/client/lib/helpers.d.ts +27 -27
  73. package/client/lib/index.d.ts +10 -10
  74. package/client/lib/long-press.directive.d.ts +24 -24
  75. package/client/lib/project.d.ts +94 -94
  76. package/client/lib/resize-service.d.ts +8 -8
  77. package/client/tnp-helpers.d.ts +4 -4
  78. package/index.d.ts +1 -1
  79. package/lib/angular.helper.d.ts +22 -22
  80. package/lib/base-component.d.ts +13 -13
  81. package/lib/base-component.js +3 -3
  82. package/lib/base-formly-component.d.ts +27 -27
  83. package/lib/base-formly-component.js +3 -3
  84. package/lib/condition-wait.d.ts +8 -8
  85. package/lib/constants.d.ts +6 -6
  86. package/lib/dual-component-ctrl.d.ts +24 -24
  87. package/lib/dual-component-ctrl.js +3 -3
  88. package/lib/firedev-models.d.ts +13 -13
  89. package/lib/git-project.d.ts +46 -46
  90. package/lib/helpers-array-obj.d.ts +15 -15
  91. package/lib/helpers-cli-tool.backend.d.ts +55 -55
  92. package/lib/helpers-dependencies.backend.d.ts +11 -11
  93. package/lib/helpers-environment.d.ts +5 -5
  94. package/lib/helpers-file-folders.backend.d.ts +83 -83
  95. package/lib/helpers-git.backend.d.ts +43 -43
  96. package/lib/helpers-json5.backend.d.ts +16 -16
  97. package/lib/helpers-morphi-framework.backend.d.ts +4 -4
  98. package/lib/helpers-network.backend.d.ts +8 -8
  99. package/lib/helpers-npm.backend.d.ts +3 -3
  100. package/lib/helpers-numbers.d.ts +3 -3
  101. package/lib/helpers-path.backend.d.ts +7 -7
  102. package/lib/helpers-process.backend.d.ts +55 -53
  103. package/lib/helpers-process.backend.js +30 -0
  104. package/lib/helpers-strings-regexes.d.ts +28 -28
  105. package/lib/helpers-strings.d.ts +50 -50
  106. package/lib/helpers-system-terminal.backend.d.ts +5 -5
  107. package/lib/helpers-vscode.backend.d.ts +5 -5
  108. package/lib/helpers.d.ts +69 -69
  109. package/lib/index.d.ts +11 -11
  110. package/lib/long-press.directive.d.ts +22 -22
  111. package/lib/merge-helpers.backend.d.ts +23 -23
  112. package/lib/project.d.ts +97 -97
  113. package/lib/resize-service.d.ts +6 -6
  114. package/lib/ts-code/index.d.ts +1 -1
  115. package/lib/ts-code/ts-code-extractor.d.ts +14 -14
  116. package/lib/ts-code/ts-code-modifier.backend.d.ts +12 -12
  117. package/package.json +2 -2
  118. package/package.json_devDependencies.json +222 -222
  119. package/package.json_tnp.json5 +44 -44
  120. package/tmp-environment.json +7 -7
  121. package/websql/README.md +24 -24
  122. package/websql/esm2020/lib/base-component.mjs +49 -49
  123. package/websql/esm2020/lib/base-formly-component.mjs +112 -112
  124. package/websql/esm2020/lib/condition-wait.mjs +45 -45
  125. package/websql/esm2020/lib/constants.mjs +7 -7
  126. package/websql/esm2020/lib/dual-component-ctrl.mjs +118 -118
  127. package/websql/esm2020/lib/firedev-models.mjs +3 -3
  128. package/websql/esm2020/lib/helpers-array-obj.mjs +82 -82
  129. package/websql/esm2020/lib/helpers-environment.mjs +32 -32
  130. package/websql/esm2020/lib/helpers-numbers.mjs +8 -8
  131. package/websql/esm2020/lib/helpers-strings-regexes.mjs +50 -50
  132. package/websql/esm2020/lib/helpers-strings.mjs +252 -252
  133. package/websql/esm2020/lib/helpers.mjs +279 -279
  134. package/websql/esm2020/lib/index.mjs +14 -14
  135. package/websql/esm2020/lib/long-press.directive.mjs +112 -112
  136. package/websql/esm2020/lib/project.mjs +429 -429
  137. package/websql/esm2020/lib/resize-service.mjs +21 -21
  138. package/websql/esm2020/public-api.mjs +1 -1
  139. package/websql/esm2020/tnp-helpers.mjs +4 -4
  140. package/websql/fesm2015/tnp-helpers.mjs +1542 -1542
  141. package/websql/fesm2020/tnp-helpers.mjs +1534 -1534
  142. package/websql/lib/base-component.d.ts +16 -16
  143. package/websql/lib/base-formly-component.d.ts +30 -30
  144. package/websql/lib/condition-wait.d.ts +7 -7
  145. package/websql/lib/constants.d.ts +5 -5
  146. package/websql/lib/dual-component-ctrl.d.ts +24 -24
  147. package/websql/lib/firedev-models.d.ts +12 -12
  148. package/websql/lib/helpers-array-obj.d.ts +14 -14
  149. package/websql/lib/helpers-environment.d.ts +4 -4
  150. package/websql/lib/helpers-numbers.d.ts +2 -2
  151. package/websql/lib/helpers-strings-regexes.d.ts +27 -27
  152. package/websql/lib/helpers-strings.d.ts +49 -49
  153. package/websql/lib/helpers.d.ts +27 -27
  154. package/websql/lib/index.d.ts +10 -10
  155. package/websql/lib/long-press.directive.d.ts +24 -24
  156. package/websql/lib/project.d.ts +94 -94
  157. package/websql/lib/resize-service.d.ts +8 -8
  158. package/websql/tnp-helpers.d.ts +4 -4
@@ -1,55 +1,55 @@
1
- import type { Project } from './project';
2
- export declare class HelpersCliTool {
3
- /**
4
- * return simplified version of command:
5
- * example: tnp HELLO:WORLD
6
- * will be: tnp helloworld
7
- *
8
- * or: `tnp ${$START}`
9
- * will be `tnp start`
10
- *
11
- * @param commandStringOrClass
12
- */
13
- simplifiedCmd(commandStringOrClass: string | Function, shortVersion?: boolean): any;
14
- argsFromBegin<T = any>(argumentsCommands: string | string[], argsFunc: (restOfCommandArgs: any) => T): {
15
- resolved: T[];
16
- /**
17
- * arguments string without resolved
18
- */
19
- commandString: string;
20
- };
21
- cleanCommand<T extends {
22
- [k: string]: string | boolean | string[] | boolean[];
23
- }>(command: string | string[], minimistOption: T): string;
24
- argsFrom<T = any>(args: string | string[]): T;
25
- removeStartEndCommandChars(command: string): string;
26
- resolveProject<T = Project>(args: string | string[], CurrentProject: Project, ProjectClass: typeof Project): T;
27
- /**
28
- * Resolve child project when accessing from parent workspace, container etc...
29
- * @param args string or string[] from cli args
30
- * @param CurrentProject project from process.cwd()
31
- */
32
- resolveChildProject(args: string | string[], CurrentProject: Project): Project;
33
- resolveProjectsFromArgs(args: string | string[], CurrentProject: Project, ProjectClass: typeof Project): Project[];
34
- /**
35
- * Check if your function name fits into command line param
36
- *
37
- * @param name name of function
38
- * @param restOfArgs arguments from command line
39
- */
40
- match(name: string, restOfArgs: string[]): {
41
- isMatch: boolean;
42
- restOfArgs: string[];
43
- };
44
- /**
45
- * @todo TODO replace with funciton below
46
- */
47
- globalArgumentsParserTnp(argsv: string[]): string;
48
- /**
49
- * @todo TODO replace with funciton above
50
- */
51
- globalArgumentsParser(argsv: string[]): string[];
52
- removeArg(arg: string, argsv: string[]): string[];
53
- removeArgTnp(arg: string, argsv: string[]): string[];
54
- removeArgFromString(argsString: string, argsToClear?: string[]): string;
55
- }
1
+ import type { Project } from './project';
2
+ export declare class HelpersCliTool {
3
+ /**
4
+ * return simplified version of command:
5
+ * example: tnp HELLO:WORLD
6
+ * will be: tnp helloworld
7
+ *
8
+ * or: `tnp ${$START}`
9
+ * will be `tnp start`
10
+ *
11
+ * @param commandStringOrClass
12
+ */
13
+ simplifiedCmd(commandStringOrClass: string | Function, shortVersion?: boolean): any;
14
+ argsFromBegin<T = any>(argumentsCommands: string | string[], argsFunc: (restOfCommandArgs: any) => T): {
15
+ resolved: T[];
16
+ /**
17
+ * arguments string without resolved
18
+ */
19
+ commandString: string;
20
+ };
21
+ cleanCommand<T extends {
22
+ [k: string]: string | boolean | string[] | boolean[];
23
+ }>(command: string | string[], minimistOption: T): string;
24
+ argsFrom<T = any>(args: string | string[]): T;
25
+ removeStartEndCommandChars(command: string): string;
26
+ resolveProject<T = Project>(args: string | string[], CurrentProject: Project, ProjectClass: typeof Project): T;
27
+ /**
28
+ * Resolve child project when accessing from parent workspace, container etc...
29
+ * @param args string or string[] from cli args
30
+ * @param CurrentProject project from process.cwd()
31
+ */
32
+ resolveChildProject(args: string | string[], CurrentProject: Project): Project;
33
+ resolveProjectsFromArgs(args: string | string[], CurrentProject: Project, ProjectClass: typeof Project): Project[];
34
+ /**
35
+ * Check if your function name fits into command line param
36
+ *
37
+ * @param name name of function
38
+ * @param restOfArgs arguments from command line
39
+ */
40
+ match(name: string, restOfArgs: string[]): {
41
+ isMatch: boolean;
42
+ restOfArgs: string[];
43
+ };
44
+ /**
45
+ * @todo TODO replace with funciton below
46
+ */
47
+ globalArgumentsParserTnp(argsv: string[]): string;
48
+ /**
49
+ * @todo TODO replace with funciton above
50
+ */
51
+ globalArgumentsParser(argsv: string[]): string[];
52
+ removeArg(arg: string, argsv: string[]): string[];
53
+ removeArgTnp(arg: string, argsv: string[]): string[];
54
+ removeArgFromString(argsString: string, argsToClear?: string[]): string;
55
+ }
@@ -1,11 +1,11 @@
1
- import { Project } from './project';
2
- export declare class HelpersDependencies {
3
- sort<P extends Project = Project>(deps: {
4
- project: P;
5
- copyto: P[];
6
- }[]): {
7
- project: P;
8
- copyto: P[];
9
- }[];
10
- recrusiveFind<P extends Project = Project>(currentProj: P, allAvailableProjects: P[], deps?: P[], orgProj?: P): P[];
11
- }
1
+ import { Project } from './project';
2
+ export declare class HelpersDependencies {
3
+ sort<P extends Project = Project>(deps: {
4
+ project: P;
5
+ copyto: P[];
6
+ }[]): {
7
+ project: P;
8
+ copyto: P[];
9
+ }[];
10
+ recrusiveFind<P extends Project = Project>(currentProj: P, allAvailableProjects: P[], deps?: P[], orgProj?: P): P[];
11
+ }
@@ -1,5 +1,5 @@
1
- export declare class HelpersEnvironment {
2
- environmentName(filename: any, local_env_name: any): any;
3
- isValidGitRepuUrl(url: string): boolean;
4
- isValidIp(ip: string): boolean;
5
- }
1
+ export declare class HelpersEnvironment {
2
+ environmentName(filename: any, local_env_name: any): any;
3
+ isValidGitRepuUrl(url: string): boolean;
4
+ isValidIp(ip: string): boolean;
5
+ }
@@ -1,83 +1,83 @@
1
- import { fse } from 'tnp-core';
2
- import { Models } from 'tnp-models';
3
- import type { Project } from './project';
4
- export interface GetRecrusiveFilesFromOptions {
5
- }
6
- export declare class HelpersFileFolders {
7
- /**
8
- * Calculate file or string checksum
9
- */
10
- checksum(absolutePathToFileOrContent: string, algorithm?: 'md5' | 'sha1'): string;
11
- getValueFromJSON(filepath: string, lodashGetPath: string, defaultValue?: any): any;
12
- readValueFromJson(filepath: string, lodashGetPath: string, defaultValue?: any): any;
13
- setValueToJSON(filepath: string, lodashGetPath: string, value: any): void;
14
- /**
15
- * file size in bytes
16
- */
17
- size(filePath: string): number;
18
- pathFromLink(filePath: string): string;
19
- renameFolder(from: string, to: string, cwd?: string): void;
20
- getTempFolder(): string;
21
- isPlainFileOrFolder(filePath: any): boolean;
22
- requireUncached(module: any): any;
23
- /**
24
- * get default export object from js file
25
- * @param jsFilePath
26
- */
27
- require(jsFilePath: string): any;
28
- tryRecreateDir(dirpath: string): void;
29
- tryCopyFrom(source: string, destination: string, options?: {}): void;
30
- removeIfExists(absoluteFileOrFolderPath: string): void;
31
- removeFileIfExists(absoluteFilePath: string, options?: {
32
- modifiedFiles?: Models.other.ModifiedFiles;
33
- }): void;
34
- removeFolderIfExists(absoluteFolderPath: string, options?: {
35
- modifiedFiles?: Models.other.ModifiedFiles;
36
- }): void;
37
- tryRemoveDir(dirpath: string, contentOnly?: boolean): void;
38
- move(from: string, to: string): void;
39
- findChildren<T>(location: any, createFn: (childLocation: string) => T): T[];
40
- findChildrenNavi<T>(location: any, createFn: (childLocation: string) => T): T[];
41
- getRecrusiveFilesFrom(dir: string, ommitFolders?: string[], options?: GetRecrusiveFilesFromOptions): string[];
42
- getLinesFromFiles(filename: string, lineCount?: number): Promise<string[]>;
43
- /**
44
- * Get the most recent changes file in direcory
45
- * @param dir absoulute path to file
46
- */
47
- getMostRecentFileName(dir: any): string;
48
- getMostRecentFilesNames(dir: any): string[];
49
- removeExcept(fromPath: string, exceptFolderAndFiles: string[]): void;
50
- copy(sourceDir: string, destinationDir: string, options?: {
51
- filter?: any;
52
- overwrite?: boolean;
53
- recursive?: boolean;
54
- asSeparatedFiles?: boolean;
55
- asSeparatedFilesAllowNotCopied?: boolean;
56
- asSeparatedFilesSymlinkAsFile?: boolean;
57
- /**
58
- * folders to omit: example: ['src','node_modules']
59
- *
60
- * This option works only with omitFoldersBaseFolder
61
- */
62
- omitFolders?: string[];
63
- /**
64
- * absolute path for base folder for omitFolder option
65
- */
66
- omitFoldersBaseFolder?: string;
67
- copySymlinksAsFiles?: boolean;
68
- useTempFolder?: boolean;
69
- } & fse.CopyOptionsSync): void;
70
- filterDontCopy(basePathFoldersTosSkip: string[], projectOrBasepath: Project | string): (src: string, dest: string) => boolean;
71
- filterOnlyCopy(basePathFoldersOnlyToInclude: string[], projectOrBasepath: Project | string): (src: string, dest: string) => boolean;
72
- copyFile(sourcePath: string, destinationPath: string, options?: {
73
- transformTextFn?: (input: string) => string;
74
- debugMode?: boolean;
75
- fast?: boolean;
76
- dontCopySameContent?: boolean;
77
- modifiedFiles?: Models.other.ModifiedFiles;
78
- }): boolean;
79
- /**
80
- * get real absolute path
81
- */
82
- resolve(fileOrFolderPath: string): string;
83
- }
1
+ import { fse } from 'tnp-core';
2
+ import { Models } from 'tnp-models';
3
+ import type { Project } from './project';
4
+ export interface GetRecrusiveFilesFromOptions {
5
+ }
6
+ export declare class HelpersFileFolders {
7
+ /**
8
+ * Calculate file or string checksum
9
+ */
10
+ checksum(absolutePathToFileOrContent: string, algorithm?: 'md5' | 'sha1'): string;
11
+ getValueFromJSON(filepath: string, lodashGetPath: string, defaultValue?: any): any;
12
+ readValueFromJson(filepath: string, lodashGetPath: string, defaultValue?: any): any;
13
+ setValueToJSON(filepath: string, lodashGetPath: string, value: any): void;
14
+ /**
15
+ * file size in bytes
16
+ */
17
+ size(filePath: string): number;
18
+ pathFromLink(filePath: string): string;
19
+ renameFolder(from: string, to: string, cwd?: string): void;
20
+ getTempFolder(): string;
21
+ isPlainFileOrFolder(filePath: any): boolean;
22
+ requireUncached(module: any): any;
23
+ /**
24
+ * get default export object from js file
25
+ * @param jsFilePath
26
+ */
27
+ require(jsFilePath: string): any;
28
+ tryRecreateDir(dirpath: string): void;
29
+ tryCopyFrom(source: string, destination: string, options?: {}): void;
30
+ removeIfExists(absoluteFileOrFolderPath: string): void;
31
+ removeFileIfExists(absoluteFilePath: string, options?: {
32
+ modifiedFiles?: Models.other.ModifiedFiles;
33
+ }): void;
34
+ removeFolderIfExists(absoluteFolderPath: string, options?: {
35
+ modifiedFiles?: Models.other.ModifiedFiles;
36
+ }): void;
37
+ tryRemoveDir(dirpath: string, contentOnly?: boolean): void;
38
+ move(from: string, to: string): void;
39
+ findChildren<T>(location: any, createFn: (childLocation: string) => T): T[];
40
+ findChildrenNavi<T>(location: any, createFn: (childLocation: string) => T): T[];
41
+ getRecrusiveFilesFrom(dir: string, ommitFolders?: string[], options?: GetRecrusiveFilesFromOptions): string[];
42
+ getLinesFromFiles(filename: string, lineCount?: number): Promise<string[]>;
43
+ /**
44
+ * Get the most recent changes file in direcory
45
+ * @param dir absoulute path to file
46
+ */
47
+ getMostRecentFileName(dir: any): string;
48
+ getMostRecentFilesNames(dir: any): string[];
49
+ removeExcept(fromPath: string, exceptFolderAndFiles: string[]): void;
50
+ copy(sourceDir: string, destinationDir: string, options?: {
51
+ filter?: any;
52
+ overwrite?: boolean;
53
+ recursive?: boolean;
54
+ asSeparatedFiles?: boolean;
55
+ asSeparatedFilesAllowNotCopied?: boolean;
56
+ asSeparatedFilesSymlinkAsFile?: boolean;
57
+ /**
58
+ * folders to omit: example: ['src','node_modules']
59
+ *
60
+ * This option works only with omitFoldersBaseFolder
61
+ */
62
+ omitFolders?: string[];
63
+ /**
64
+ * absolute path for base folder for omitFolder option
65
+ */
66
+ omitFoldersBaseFolder?: string;
67
+ copySymlinksAsFiles?: boolean;
68
+ useTempFolder?: boolean;
69
+ } & fse.CopyOptionsSync): void;
70
+ filterDontCopy(basePathFoldersTosSkip: string[], projectOrBasepath: Project | string): (src: string, dest: string) => boolean;
71
+ filterOnlyCopy(basePathFoldersOnlyToInclude: string[], projectOrBasepath: Project | string): (src: string, dest: string) => boolean;
72
+ copyFile(sourcePath: string, destinationPath: string, options?: {
73
+ transformTextFn?: (input: string) => string;
74
+ debugMode?: boolean;
75
+ fast?: boolean;
76
+ dontCopySameContent?: boolean;
77
+ modifiedFiles?: Models.other.ModifiedFiles;
78
+ }): boolean;
79
+ /**
80
+ * get real absolute path
81
+ */
82
+ resolve(fileOrFolderPath: string): string;
83
+ }
@@ -1,43 +1,43 @@
1
- import type { Project } from './project';
2
- export declare class HelpersGit {
3
- lastCommitHash(cwd: any): string;
4
- penultimageCommitHash(cwd: any): string;
5
- checkTagExists(tag: string, cwd?: string): boolean;
6
- lastTagVersionName(cwd: string): string;
7
- lastTagHash(cwd: any): string;
8
- lastCommitDate(cwd: string): Date;
9
- lastCommitMessage(cwd: any): string;
10
- countCommits(cwd: string): number;
11
- hasAnyCommits(cwd: string): boolean;
12
- isInMergeProcess(cwd: string): boolean;
13
- getBranchesNames(cwd: string, pattern?: string | RegExp): string[];
14
- currentBranchName(cwd: any): string;
15
- commitWhatIs(cwd: string, customMessage?: string): void;
16
- commit(cwd: string, ProjectClass: typeof Project, args?: string): void;
17
- /**
18
- * example: https://github.com/darekf77/tnp-helpers.git
19
- *
20
- * Note: address ends with .git always
21
- *
22
- */
23
- getOriginURL(cwd: string, differentOriginName?: string): string;
24
- isGitRoot(cwd: string): boolean;
25
- isGitRepo(cwd: string): boolean;
26
- private pull;
27
- pullBranch(branchName: string, cwd: string, askToRetry?: boolean): Promise<void>;
28
- pullCurrentBranch(cwd: string, askToRetry?: boolean): Promise<void>;
29
- pushCurrentBranch(cwd: string, force?: boolean, origin?: string): void;
30
- defaultRepoBranch(cwd: string): string;
31
- checkoutDefaultBranch(cwd: any): void;
32
- clone({ cwd, url, destinationFolderName, throwErrors, override }: {
33
- cwd: string;
34
- url: string;
35
- destinationFolderName?: string;
36
- throwErrors?: boolean;
37
- override?: boolean;
38
- }): void;
39
- checkIfthereAreSomeUncommitedChange(cwd: string): boolean;
40
- thereAreSomeUncommitedChangeExcept(filesList: string[], cwd: string): boolean;
41
- restoreLastVersion(cwd: string, localFilePath: string): void;
42
- resetFiles(cwd: string, ...relativePathes: string[]): void;
43
- }
1
+ import type { Project } from './project';
2
+ export declare class HelpersGit {
3
+ lastCommitHash(cwd: any): string;
4
+ penultimageCommitHash(cwd: any): string;
5
+ checkTagExists(tag: string, cwd?: string): boolean;
6
+ lastTagVersionName(cwd: string): string;
7
+ lastTagHash(cwd: any): string;
8
+ lastCommitDate(cwd: string): Date;
9
+ lastCommitMessage(cwd: any): string;
10
+ countCommits(cwd: string): number;
11
+ hasAnyCommits(cwd: string): boolean;
12
+ isInMergeProcess(cwd: string): boolean;
13
+ getBranchesNames(cwd: string, pattern?: string | RegExp): string[];
14
+ currentBranchName(cwd: any): string;
15
+ commitWhatIs(cwd: string, customMessage?: string): void;
16
+ commit(cwd: string, ProjectClass: typeof Project, args?: string): void;
17
+ /**
18
+ * example: https://github.com/darekf77/tnp-helpers.git
19
+ *
20
+ * Note: address ends with .git always
21
+ *
22
+ */
23
+ getOriginURL(cwd: string, differentOriginName?: string): string;
24
+ isGitRoot(cwd: string): boolean;
25
+ isGitRepo(cwd: string): boolean;
26
+ private pull;
27
+ pullBranch(branchName: string, cwd: string, askToRetry?: boolean): Promise<void>;
28
+ pullCurrentBranch(cwd: string, askToRetry?: boolean): Promise<void>;
29
+ pushCurrentBranch(cwd: string, force?: boolean, origin?: string): void;
30
+ defaultRepoBranch(cwd: string): string;
31
+ checkoutDefaultBranch(cwd: any): void;
32
+ clone({ cwd, url, destinationFolderName, throwErrors, override }: {
33
+ cwd: string;
34
+ url: string;
35
+ destinationFolderName?: string;
36
+ throwErrors?: boolean;
37
+ override?: boolean;
38
+ }): void;
39
+ checkIfthereAreSomeUncommitedChange(cwd: string): boolean;
40
+ thereAreSomeUncommitedChangeExcept(filesList: string[], cwd: string): boolean;
41
+ restoreLastVersion(cwd: string, localFilePath: string): void;
42
+ resetFiles(cwd: string, ...relativePathes: string[]): void;
43
+ }
@@ -1,16 +1,16 @@
1
- export declare class JSON5Helpers<STRUCTURE = {}> {
2
- private filePath;
3
- private defaultValue;
4
- private isDataReadFirstTime;
5
- constructor(filePath: string, defaultValue?: {});
6
- private fileContent;
7
- get readOnlyData(): STRUCTURE;
8
- private get writeInstance();
9
- read(): void;
10
- update(data: STRUCTURE): void;
11
- save(): void;
12
- }
13
- export declare class HelpersJSON5 {
14
- fromFile<STRUCTURE = {}>(filePath: string): JSON5Helpers<STRUCTURE>;
15
- allFrom<STRUCTURE = {}>(folderPath: string): JSON5Helpers<STRUCTURE>[];
16
- }
1
+ export declare class JSON5Helpers<STRUCTURE = {}> {
2
+ private filePath;
3
+ private defaultValue;
4
+ private isDataReadFirstTime;
5
+ constructor(filePath: string, defaultValue?: {});
6
+ private fileContent;
7
+ get readOnlyData(): STRUCTURE;
8
+ private get writeInstance();
9
+ read(): void;
10
+ update(data: STRUCTURE): void;
11
+ save(): void;
12
+ }
13
+ export declare class HelpersJSON5 {
14
+ fromFile<STRUCTURE = {}>(filePath: string): JSON5Helpers<STRUCTURE>;
15
+ allFrom<STRUCTURE = {}>(folderPath: string): JSON5Helpers<STRUCTURE>[];
16
+ }
@@ -1,4 +1,4 @@
1
- export declare class HelpersMorphiFramework {
2
- getEntites(cwd: string): string[];
3
- getControllers(cwd: string): string[];
4
- }
1
+ export declare class HelpersMorphiFramework {
2
+ getEntites(cwd: string): string[];
3
+ getControllers(cwd: string): string[];
4
+ }
@@ -1,8 +1,8 @@
1
- import * as express from 'express';
2
- export { Application, Request, Response } from 'express';
3
- export declare class HelpersNetwork {
4
- from(app: express.Application): {
5
- use(): void;
6
- handle(respond: (req: any, res: any) => void, networkPath?: string | RegExp): void;
7
- };
8
- }
1
+ import * as express from 'express';
2
+ export { Application, Request, Response } from 'express';
3
+ export declare class HelpersNetwork {
4
+ from(app: express.Application): {
5
+ use(): void;
6
+ handle(respond: (req: any, res: any) => void, networkPath?: string | RegExp): void;
7
+ };
8
+ }
@@ -1,3 +1,3 @@
1
- export declare class HelpersNpm {
2
- checkValidNpmPackageName(pkg: any): boolean;
3
- }
1
+ export declare class HelpersNpm {
2
+ checkValidNpmPackageName(pkg: any): boolean;
3
+ }
@@ -1,3 +1,3 @@
1
- export declare class HelpersNumber {
2
- randomInteger: (max: any, min: any) => any;
3
- }
1
+ export declare class HelpersNumber {
2
+ randomInteger: (max: any, min: any) => any;
3
+ }
@@ -1,7 +1,7 @@
1
- export declare class HelpersPath {
2
- create(...pathPart: string[]): string;
3
- PREFIX(baseFileName: any): string;
4
- removeRootFolder(filePath: string): string;
5
- removeExtension(filePath: string): string;
6
- removeExt(filePath: string): string;
7
- }
1
+ export declare class HelpersPath {
2
+ create(...pathPart: string[]): string;
3
+ PREFIX(baseFileName: any): string;
4
+ removeRootFolder(filePath: string): string;
5
+ removeExtension(filePath: string): string;
6
+ removeExt(filePath: string): string;
7
+ }
@@ -1,53 +1,55 @@
1
- import { child_process } from 'tnp-core';
2
- import { Models } from 'tnp-models';
3
- import { Level } from 'ng2-logger';
4
- /**
5
- * - long buffer by default
6
- * - easy catch output of commands
7
- * - wrap with try catch
8
- * - handle backgroud proceses
9
- */
10
- export declare class HelpersProcess {
11
- restartApplicationItself(nameOfApp: string): Promise<unknown>;
12
- osIsMacOs(versino: 'big-sur' | 'catalina'): boolean;
13
- generatedFileWrap(content: string): string;
14
- changeCwdWrapper(dir: string, functionToExecure: Function, logLevel?: Level): Promise<void>;
15
- changeCwd(dir?: string): void;
16
- goToDir(dir?: string): boolean;
17
- pressKeyOrWait(message?: string, printWaitMessages?: number): Promise<unknown>;
18
- pressKeyAndContinue(message?: string): void;
19
- list<T = string>(question: string, choices: {
20
- name: string;
21
- value: T;
22
- }[]): Promise<any>;
23
- autocompleteAsk<T = string>(question: string, choices: {
24
- name: string;
25
- value: T;
26
- }[], pageSize?: number): Promise<T>;
27
- questionYesNo(message: string, callbackTrue?: () => any, callbackFalse?: () => any, defaultValue?: boolean): Promise<boolean>;
28
- get isWsl(): boolean;
29
- getWorkingDirOfProcess(PID: number): string;
30
- outputToVScode(data: {
31
- label: string;
32
- option: string;
33
- }[] | string, disableEncode?: boolean): void;
34
- sleep(seconds?: number): string;
35
- actionWrapper(fn: () => void, taskName?: string): Promise<void>;
36
- terminalLine(): string;
37
- killProcess(byPid: number): void;
38
- killProcessByPort(portOrPortsToKill: number | number[]): Promise<void>;
39
- clearConsole(): void;
40
- formatPath(pathToFileOrFolder: string): string;
41
- prepareWatchCommand(cmd: any): string;
42
- get watcher(): {
43
- /**
44
- * @deprecated
45
- */
46
- run(command: string, folderPath: string, options: Models.system.WatchOptions): child_process.ChildProcess;
47
- /**
48
- * @deprecated
49
- */
50
- call(fn: Function | string, params: string, folderPath: string, options: Models.system.WatchOptions): child_process.ChildProcess;
51
- };
52
- getStringFrom(command: string, descriptionOfCommand?: string): string;
53
- }
1
+ /// <reference types="node" />
2
+ import { child_process } from 'tnp-core';
3
+ import { Models } from 'tnp-models';
4
+ import { Level } from 'ng2-logger';
5
+ /**
6
+ * - long buffer by default
7
+ * - easy catch output of commands
8
+ * - wrap with try catch
9
+ * - handle backgroud proceses
10
+ */
11
+ export declare class HelpersProcess {
12
+ restartApplicationItself(nameOfApp: string): Promise<unknown>;
13
+ osIsMacOs(versino: 'big-sur' | 'catalina'): boolean;
14
+ generatedFileWrap(content: string): string;
15
+ changeCwdWrapper(dir: string, functionToExecure: Function, logLevel?: Level): Promise<void>;
16
+ changeCwd(dir?: string): void;
17
+ goToDir(dir?: string): boolean;
18
+ pressKeyOrWait(message?: string, printWaitMessages?: number): Promise<unknown>;
19
+ pressKeyAndContinue(message?: string): void;
20
+ list<T = string>(question: string, choices: {
21
+ name: string;
22
+ value: T;
23
+ }[]): Promise<any>;
24
+ autocompleteAsk<T = string>(question: string, choices: {
25
+ name: string;
26
+ value: T;
27
+ }[], pageSize?: number): Promise<T>;
28
+ questionYesNo(message: string, callbackTrue?: () => any, callbackFalse?: () => any, defaultValue?: boolean): Promise<boolean>;
29
+ get isWsl(): boolean;
30
+ getWorkingDirOfProcess(PID: number): string;
31
+ outputToVScode(data: {
32
+ label: string;
33
+ option: string;
34
+ }[] | string, disableEncode?: boolean): void;
35
+ sleep(seconds?: number): string;
36
+ actionWrapper(fn: () => void, taskName?: string): Promise<void>;
37
+ terminalLine(): string;
38
+ killProcess(byPid: number): void;
39
+ killProcessByPort(portOrPortsToKill: number | number[]): Promise<void>;
40
+ clearConsole(): void;
41
+ formatPath(pathToFileOrFolder: string): string;
42
+ prepareWatchCommand(cmd: any): string;
43
+ get watcher(): {
44
+ /**
45
+ * @deprecated
46
+ */
47
+ run(command: string, folderPath: string, options: Models.system.WatchOptions): child_process.ChildProcess;
48
+ /**
49
+ * @deprecated
50
+ */
51
+ call(fn: Function | string, params: string, folderPath: string, options: Models.system.WatchOptions): child_process.ChildProcess;
52
+ };
53
+ getStringFrom(command: string, descriptionOfCommand?: string): string;
54
+ waitForMessegeInStdout(proc: child_process.ChildProcess, message: string): Promise<unknown>;
55
+ }
@@ -437,6 +437,36 @@ var HelpersProcess = /** @class */ (function () {
437
437
  return void 0;
438
438
  }
439
439
  };
440
+ HelpersProcess.prototype.waitForMessegeInStdout = function (proc, message) {
441
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
442
+ return tslib_1.__generator(this, function (_a) {
443
+ return [2 /*return*/, new Promise(function (resolve, reject) {
444
+ var resolved = false;
445
+ proc.stdout.on('data', function (data) {
446
+ // console.log(`
447
+ // [waitForMessegeInStdout] data: ${data}
448
+ // [waitForMessegeInStdout] data typeof: ${typeof data}
449
+ // `);
450
+ if (tnp_core_1._.isObject(data) && tnp_core_1._.isFunction(data.toString)) {
451
+ data = data.toString();
452
+ }
453
+ if (tnp_core_1._.isString(data) && data.search(message) !== -1) {
454
+ resolved = true;
455
+ resolve(void 0);
456
+ }
457
+ });
458
+ proc.once('exit', function () {
459
+ // console.log(`
460
+ // [waitForMessegeInStdout] exit: ${code}
461
+ // `);
462
+ if (!resolved) {
463
+ reject();
464
+ }
465
+ });
466
+ })];
467
+ });
468
+ });
469
+ };
440
470
  return HelpersProcess;
441
471
  }());
442
472
  exports.HelpersProcess = HelpersProcess;