tnp-helpers 19.0.52 → 19.0.54
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.
- package/browser/fesm2022/tnp-helpers.mjs +168 -265
- package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
- package/browser/lib/base/classes/base-cli-worker/base-cli-worker.d.ts +4 -1
- package/browser/lib/base/classes/base-docker.d.ts +16 -0
- package/browser/lib/base/classes/base-git.d.ts +1 -0
- package/browser/lib/base/classes/base-project.d.ts +2 -0
- package/browser/lib/base/tcp-udp-ports/tcp-udp-ports.context.d.ts +7 -6
- package/browser/lib/build-info._auto-generated_.d.ts +1 -1
- package/browser/lib/utils.d.ts +41 -16
- package/browser/package.json +1 -1
- package/lib/base/classes/base-cli-worker/base-cli-worker-terminal-ui.js +4 -2
- package/lib/base/classes/base-cli-worker/base-cli-worker-terminal-ui.js.map +1 -1
- package/lib/base/classes/base-cli-worker/base-cli-worker.d.ts +4 -1
- package/lib/base/classes/base-cli-worker/base-cli-worker.js +39 -13
- package/lib/base/classes/base-cli-worker/base-cli-worker.js.map +1 -1
- package/lib/base/classes/base-docker.d.ts +15 -0
- package/lib/base/classes/base-docker.js +56 -0
- package/lib/base/classes/base-docker.js.map +1 -0
- package/lib/base/classes/base-git.d.ts +1 -0
- package/lib/base/classes/base-git.js +4 -0
- package/lib/base/classes/base-git.js.map +1 -1
- package/lib/base/classes/base-global-command-line.backend.d.ts +5 -0
- package/lib/base/classes/base-global-command-line.backend.js +129 -33
- package/lib/base/classes/base-global-command-line.backend.js.map +1 -1
- package/lib/base/classes/base-project.d.ts +2 -0
- package/lib/base/classes/base-project.js +61 -57
- package/lib/base/classes/base-project.js.map +1 -1
- package/lib/base/classes/base-vscode.js +7 -1
- package/lib/base/classes/base-vscode.js.map +1 -1
- package/lib/base/tcp-udp-ports/not-assignable-port.entity.js +2 -2
- package/lib/base/tcp-udp-ports/ports.entity.d.ts +1 -1
- package/lib/base/tcp-udp-ports/tcp-udp-ports.context.d.ts +9 -8
- package/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib/build-info._auto-generated_.js +1 -1
- package/lib/env/env.angular-node-app.d.ts +2 -0
- package/lib/env/env.angular-node-app.js +4 -2
- package/lib/env/env.angular-node-app.js.map +1 -1
- package/lib/env/env.docs-webapp.d.ts +2 -0
- package/lib/env/env.docs-webapp.js +4 -2
- package/lib/env/env.docs-webapp.js.map +1 -1
- package/lib/env/env.electron-app.d.ts +2 -0
- package/lib/env/env.electron-app.js +4 -2
- package/lib/env/env.electron-app.js.map +1 -1
- package/lib/env/env.mobile-app.d.ts +2 -0
- package/lib/env/env.mobile-app.js +4 -2
- package/lib/env/env.mobile-app.js.map +1 -1
- package/lib/env/env.npm-lib-and-cli-tool.d.ts +2 -0
- package/lib/env/env.npm-lib-and-cli-tool.js +4 -2
- package/lib/env/env.npm-lib-and-cli-tool.js.map +1 -1
- package/lib/env/env.vscode-plugin.d.ts +2 -0
- package/lib/env/env.vscode-plugin.js +4 -2
- package/lib/env/env.vscode-plugin.js.map +1 -1
- package/lib/helpers/for-backend/helpers-file-folders.js +1 -1
- package/lib/helpers/for-backend/helpers-file-folders.js.map +1 -1
- package/lib/helpers/for-backend/helpers-git.backend.js +14 -4
- package/lib/helpers/for-backend/helpers-git.backend.js.map +1 -1
- package/lib/helpers/for-browser/angular.helper.js +2 -2
- package/lib/old/base-component.js +2 -2
- package/lib/old/base-formly-component.js +2 -2
- package/lib/old/dual-component-ctrl.js +2 -2
- package/lib/utils.d.ts +41 -16
- package/lib/utils.js +124 -229
- package/lib/utils.js.map +1 -1
- package/package.json +1 -1
- package/websql/fesm2022/tnp-helpers.mjs +168 -265
- package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
- package/websql/lib/base/classes/base-cli-worker/base-cli-worker.d.ts +4 -1
- package/websql/lib/base/classes/base-docker.d.ts +16 -0
- package/websql/lib/base/classes/base-git.d.ts +1 -0
- package/websql/lib/base/classes/base-project.d.ts +2 -0
- package/websql/lib/base/tcp-udp-ports/tcp-udp-ports.context.d.ts +7 -6
- package/websql/lib/build-info._auto-generated_.d.ts +1 -1
- package/websql/lib/utils.d.ts +41 -16
- package/websql/package.json +1 -1
|
@@ -20,6 +20,7 @@ export declare abstract class BaseCliWorker<REMOTE_CTRL extends BaseCliWorkerCon
|
|
|
20
20
|
readonly terminalUI: TERMINAL_UI;
|
|
21
21
|
readonly workerContextTemplate: ReturnType<typeof Taon.createContextTemplate>;
|
|
22
22
|
private workerMainContext;
|
|
23
|
+
getRemoteControllerFor(ipAddressOfTaonInstance: string, port?: number): Promise<REMOTE_CTRL>;
|
|
23
24
|
private workerRemoteContext;
|
|
24
25
|
readonly controllerClass: new () => REMOTE_CTRL;
|
|
25
26
|
private contextForRemoteConnection;
|
|
@@ -44,7 +45,9 @@ export declare abstract class BaseCliWorker<REMOTE_CTRL extends BaseCliWorkerCon
|
|
|
44
45
|
* start normally process
|
|
45
46
|
* this will crash if process already started
|
|
46
47
|
*/
|
|
47
|
-
startNormallyInCurrentProcess(
|
|
48
|
+
startNormallyInCurrentProcess(options?: {
|
|
49
|
+
actionBeforeTerminalUI?: () => Promise<void>;
|
|
50
|
+
}): Promise<void>;
|
|
48
51
|
getControllerForRemoteConnection(options?: {
|
|
49
52
|
calledFrom?: string;
|
|
50
53
|
}): Promise<REMOTE_CTRL>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import type { ChildProcess, StdioOptions } from 'child_process';
|
|
3
|
+
import { BaseFeatureForProject } from './base-feature-for-project';
|
|
4
|
+
import { BaseProject } from './base-project';
|
|
5
|
+
export declare class BaseDocker<PROJECT extends BaseProject = any> extends BaseFeatureForProject<PROJECT> {
|
|
6
|
+
/**
|
|
7
|
+
* Updates ports in .env file based on available ports range.
|
|
8
|
+
*/
|
|
9
|
+
updateDockerComposePorts(): Promise<void>;
|
|
10
|
+
getDockerComposeUpExecChildProcess(action: 'up' | 'down', options?: {
|
|
11
|
+
composeFileName?: string;
|
|
12
|
+
cwd?: string;
|
|
13
|
+
env?: NodeJS.ProcessEnv;
|
|
14
|
+
stdio?: StdioOptions;
|
|
15
|
+
}): ChildProcess;
|
|
16
|
+
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { CoreModels } from 'tnp-core/websql';
|
|
3
3
|
import { CoreProject } from '../../index';
|
|
4
4
|
import { BaseProjectType } from '../../models';
|
|
5
|
+
import { BaseDocker } from './base-docker';
|
|
5
6
|
import { BaseFileFoldersOperations } from './base-file-folders-operations';
|
|
6
7
|
import { BaseGit } from './base-git';
|
|
7
8
|
import { BaseIgnoreHideHelpers } from './base-ignore-hide';
|
|
@@ -44,6 +45,7 @@ export declare abstract class BaseProject<PROJECT extends BaseProject<any, any>
|
|
|
44
45
|
quickFixes?: BaseQuickFixes;
|
|
45
46
|
staticPages?: BaseStaticPages;
|
|
46
47
|
javaJdk?: BaseJavaJdk;
|
|
48
|
+
docker?: BaseDocker;
|
|
47
49
|
private __location;
|
|
48
50
|
get location(): string;
|
|
49
51
|
set location(v: string);
|
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
export declare const PortsContextTemplate: () => {
|
|
3
3
|
readonly contextName: string;
|
|
4
4
|
readonly appId: string;
|
|
5
|
+
cloneAsRemote: (cloneOpt?: {
|
|
6
|
+
overrideRemoteHost?: string;
|
|
7
|
+
}) => any;
|
|
8
|
+
cloneAsNormal: (cloneOpt?: {
|
|
9
|
+
overrideHost?: string;
|
|
10
|
+
}) => any;
|
|
5
11
|
__ref(): Promise<import("taon/websql").EndpointContext>;
|
|
6
12
|
readonly __refSync: import("taon/websql").EndpointContext;
|
|
7
13
|
getClassInstance<T>(ctor: new (...args: any[]) => T): T;
|
|
8
14
|
getClass<T>(ctor: new (...args: any[]) => T): new (...args: any[]) => T;
|
|
9
|
-
initialize: (overrideOptions?:
|
|
10
|
-
overrideHost?: string;
|
|
11
|
-
overrideRemoteHost?: string;
|
|
12
|
-
onlyMigrationRun?: boolean;
|
|
13
|
-
onlyMigrationRevertToTimestamp?: number;
|
|
14
|
-
}) => Promise<import("taon/websql").EndpointContext>;
|
|
15
|
+
initialize: (overrideOptions?: import("taon/websql").Models.TaonInitializeParams) => Promise<import("taon/websql").EndpointContext>;
|
|
15
16
|
readonly realtime: {
|
|
16
17
|
readonly client: import("taon/websql/lib/realtime/realtime-client").RealtimeClient;
|
|
17
18
|
readonly server: import("taon/websql/lib/realtime/realtime-server").RealtimeServer;
|
package/websql/lib/utils.d.ts
CHANGED
|
@@ -156,22 +156,6 @@ export declare namespace UtilsVSCode {
|
|
|
156
156
|
const vscodeImport: () => any;
|
|
157
157
|
const regenerateVsCodeSettingsColors: (cwd: string, overideBottomColor?: string) => void;
|
|
158
158
|
}
|
|
159
|
-
export declare namespace UtilsDotFile {
|
|
160
|
-
const setValueToDotFile: (dotFileAbsPath: string | string[], key: string, value: string | number | boolean) => void;
|
|
161
|
-
const setCommentToKeyInDotFile: (dotFileAbsPath: string | string[], key: string, comment: string) => void;
|
|
162
|
-
const getValueFromDotFile: (dotFileAbsPath: string | string[], key: string) => string | number | boolean;
|
|
163
|
-
const setValuesKeysFromObject: (dotFileAbsPath: string | string[], obj: Record<string, string | number | boolean>, options?: {
|
|
164
|
-
/**
|
|
165
|
-
* if true, it will overwrite existing keys
|
|
166
|
-
*/
|
|
167
|
-
setAsNewFile?: boolean;
|
|
168
|
-
}) => void;
|
|
169
|
-
const getValuesKeysAsJsonObject: <T = Record<string, string | number | boolean>>(dotFileAbsPath: string | string[]) => T;
|
|
170
|
-
/**
|
|
171
|
-
* @returns key|comment pairs as json object
|
|
172
|
-
*/
|
|
173
|
-
const getCommentsKeysAsJsonObject: <T = Record<string, string>>(dotFileAbsPath: string | string[]) => T;
|
|
174
|
-
}
|
|
175
159
|
export declare namespace UtilsZipBrowser {
|
|
176
160
|
const zipDirBrowser: (fileList: FileList) => Promise<Blob>;
|
|
177
161
|
const unzipArchiveBrowser: (zipBlob: Blob) => Promise<Map<string, Blob>>;
|
|
@@ -207,4 +191,45 @@ export declare namespace UtilsJava {
|
|
|
207
191
|
export declare namespace UtilsPasswords {
|
|
208
192
|
const hashPassword: (password: string) => Promise<string>;
|
|
209
193
|
const verifyPassword: (password: string, stored: string) => Promise<boolean>;
|
|
194
|
+
}
|
|
195
|
+
export declare namespace FilePathMetaData {
|
|
196
|
+
/**
|
|
197
|
+
* Embed metadata into filename while preserving the extension.
|
|
198
|
+
*
|
|
199
|
+
* Example:
|
|
200
|
+
* embedData({ version: "1.2.3", envName: "__" }, "project.zip")
|
|
201
|
+
* -> "version|-|1.2.3||--||envName|-|__|||project.zip"
|
|
202
|
+
*/
|
|
203
|
+
function embedData<T extends Record<string, any>>(data: T, orgFilename: string, options?: {
|
|
204
|
+
skipAddingBasenameAtEnd?: boolean;
|
|
205
|
+
}): string;
|
|
206
|
+
/**
|
|
207
|
+
* Extract metadata from filename (reverse of embedData).
|
|
208
|
+
*
|
|
209
|
+
* Example:
|
|
210
|
+
* extractData<{ version: string; env: string }>("myfile__version-1.2.3__env-prod.zip")
|
|
211
|
+
* -> { version: "1.2.3", env: "prod" }
|
|
212
|
+
*/
|
|
213
|
+
function extractData<T extends Record<string, any>>(filename: string): T;
|
|
214
|
+
const getOnlyMetadataString: (filename: string) => string;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Easy way to connect CLI commands to cli class methods.
|
|
218
|
+
*
|
|
219
|
+
* Example:
|
|
220
|
+
* in clic class
|
|
221
|
+
* $FirstCli {
|
|
222
|
+
*
|
|
223
|
+
* @UtilsCliMethod.decorator('doSomething')
|
|
224
|
+
* doSomething() {
|
|
225
|
+
* console.log('doing something');
|
|
226
|
+
* }
|
|
227
|
+
* }
|
|
228
|
+
*
|
|
229
|
+
* UtilsCliMethod.getFrom($FirstCli.prototype.doSomething) // "firstcli:dosomething"
|
|
230
|
+
*
|
|
231
|
+
*/
|
|
232
|
+
export declare namespace UtilsCliMethod {
|
|
233
|
+
const decorator: (methodName: string) => MethodDecorator;
|
|
234
|
+
const getFrom: (ClassPrototypeMethodFnHere: Function, globalMethod?: boolean) => string;
|
|
210
235
|
}
|