tnp-helpers 19.0.4 → 19.0.5

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 (48) hide show
  1. package/browser/fesm2022/tnp-helpers.mjs +1 -1
  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/package.json +1 -1
  5. package/client/fesm2022/tnp-helpers.mjs +1 -1
  6. package/client/fesm2022/tnp-helpers.mjs.map +1 -1
  7. package/client/lib/build-info._auto-generated_.d.ts +1 -1
  8. package/client/package.json +1 -1
  9. package/lib/base/tcp-udp-ports/not-assignable-port.entity.js +2 -2
  10. package/lib/build-info._auto-generated_.d.ts +1 -1
  11. package/lib/build-info._auto-generated_.js +1 -1
  12. package/lib/helpers/for-browser/angular.helper.js +2 -2
  13. package/lib/old/base-component.js +2 -2
  14. package/lib/old/base-formly-component.js +2 -2
  15. package/lib/old/dual-component-ctrl.js +2 -2
  16. package/package.json +1 -1
  17. package/tmp-environment.json +3 -3
  18. package/websql/fesm2022/tnp-helpers.mjs +1 -1
  19. package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
  20. package/websql/lib/build-info._auto-generated_.d.ts +1 -1
  21. package/websql/package.json +1 -1
  22. package/lib/base/classes/base-cli-worker-config.d.ts +0 -27
  23. package/lib/base/classes/base-cli-worker-config.js +0 -64
  24. package/lib/base/classes/base-cli-worker-config.js.map +0 -1
  25. package/lib/base/classes/base-cli-worker-controller.d.ts +0 -15
  26. package/lib/base/classes/base-cli-worker-controller.js +0 -124
  27. package/lib/base/classes/base-cli-worker-controller.js.map +0 -1
  28. package/lib/base/classes/base-cli-worker.d.ts +0 -111
  29. package/lib/base/classes/base-cli-worker.js +0 -535
  30. package/lib/base/classes/base-cli-worker.js.map +0 -1
  31. package/lib/base/classes/base-detached-service.d.ts +0 -6
  32. package/lib/base/classes/base-detached-service.js +0 -16
  33. package/lib/base/classes/base-detached-service.js.map +0 -1
  34. package/lib/base/classes/base-github-pages.d.ts +0 -14
  35. package/lib/base/classes/base-github-pages.js +0 -173
  36. package/lib/base/classes/base-github-pages.js.map +0 -1
  37. package/lib/helpers/for-backend/helpers-file-folders.backend.d.ts +0 -104
  38. package/lib/helpers/for-backend/helpers-file-folders.backend.js +0 -896
  39. package/lib/helpers/for-backend/helpers-file-folders.backend.js.map +0 -1
  40. package/lib/helpers/for-backend/helpers-process.backend.d.ts +0 -87
  41. package/lib/helpers/for-backend/helpers-process.backend.js +0 -456
  42. package/lib/helpers/for-backend/helpers-process.backend.js.map +0 -1
  43. package/lib/helpers/for-backend/ts-code/index.d.ts +0 -1
  44. package/lib/helpers/for-backend/ts-code/index.js +0 -5
  45. package/lib/helpers/for-backend/ts-code/index.js.map +0 -1
  46. package/lib/helpers/for-backend/ts-code/ts-import-export-extractor.d.ts +0 -29
  47. package/lib/helpers/for-backend/ts-code/ts-import-export-extractor.js +0 -81
  48. package/lib/helpers/for-backend/ts-code/ts-import-export-extractor.js.map +0 -1
@@ -1,173 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BaseGithubPages = void 0;
4
- var tslib_1 = require("tslib");
5
- //#region imports
6
- var tnp_config_1 = require("tnp-config");
7
- var base_feature_for_project_1 = require("./base-feature-for-project");
8
- var tnp_core_1 = require("tnp-core");
9
- var index_1 = require("../../index");
10
- //#endregion
11
- /**
12
- * Easy way to create github pages
13
- * (or similar static site hosting)
14
- */
15
- var BaseGithubPages = /** @class */ (function (_super) {
16
- tslib_1.__extends(BaseGithubPages, _super);
17
- function BaseGithubPages() {
18
- var _this = _super.apply(this, tslib_1.__spreadArray([], tslib_1.__read(arguments), false)) || this;
19
- _this.TMP_GH_PAGE_SITE_REPOS = 'tmp-gh-pages-sites-repos';
20
- return _this;
21
- //#endregion
22
- }
23
- //#region clear folder for gh-pages
24
- BaseGithubPages.prototype.cleanFolderForGhPages = function (pathToBranchRepoFolder) {
25
- return tslib_1.__awaiter(this, void 0, void 0, function () {
26
- var noAllowedToDeleteFiles, noAllowedToDeleteFolders, _a, _b, fileAbsPath, _c, _d, folderAbsPath;
27
- var e_1, _e, e_2, _f;
28
- return tslib_1.__generator(this, function (_g) {
29
- noAllowedToDeleteFiles = [tnp_config_1.config.file._gitignore];
30
- noAllowedToDeleteFolders = ['.git'];
31
- try {
32
- for (_a = tslib_1.__values(index_1.Helpers.filesFrom(pathToBranchRepoFolder)), _b = _a.next(); !_b.done; _b = _a.next()) {
33
- fileAbsPath = _b.value;
34
- if (!noAllowedToDeleteFiles.includes(tnp_core_1.path.basename(fileAbsPath))) {
35
- index_1.Helpers.removeIfExists(fileAbsPath);
36
- }
37
- }
38
- }
39
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
40
- finally {
41
- try {
42
- if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
43
- }
44
- finally { if (e_1) throw e_1.error; }
45
- }
46
- try {
47
- for (_c = tslib_1.__values(index_1.Helpers.foldersFrom(pathToBranchRepoFolder)), _d = _c.next(); !_d.done; _d = _c.next()) {
48
- folderAbsPath = _d.value;
49
- if (!noAllowedToDeleteFolders.includes(tnp_core_1.path.basename(folderAbsPath))) {
50
- index_1.Helpers.removeFolderIfExists(folderAbsPath);
51
- }
52
- }
53
- }
54
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
55
- finally {
56
- try {
57
- if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
58
- }
59
- finally { if (e_2) throw e_2.error; }
60
- }
61
- return [2 /*return*/];
62
- });
63
- });
64
- };
65
- Object.defineProperty(BaseGithubPages.prototype, "mainFolder", {
66
- //#endregion
67
- //#region main folder
68
- get: function () {
69
- return this.project.cache['mainFolder'];
70
- },
71
- enumerable: false,
72
- configurable: true
73
- });
74
- Object.defineProperty(BaseGithubPages.prototype, "mainFolderAbsPath", {
75
- get: function () {
76
- return this.project.pathFor([this.TMP_GH_PAGE_SITE_REPOS, this.mainFolder]);
77
- },
78
- enumerable: false,
79
- configurable: true
80
- });
81
- Object.defineProperty(BaseGithubPages.prototype, "pagesBranchName", {
82
- //#endregion
83
- //#region pages branch name
84
- get: function () {
85
- return "".concat(this.mainFolder, "-pages");
86
- },
87
- enumerable: false,
88
- configurable: true
89
- });
90
- //#endregion
91
- //#region init
92
- BaseGithubPages.prototype.init = function (mainFolder_1) {
93
- return tslib_1.__awaiter(this, arguments, void 0, function (mainFolder, completeProcess) {
94
- var tempRepoPath, currentDocsFolderAbsPath, error_1, error_2;
95
- if (completeProcess === void 0) { completeProcess = false; }
96
- return tslib_1.__generator(this, function (_a) {
97
- switch (_a.label) {
98
- case 0:
99
- //#region @backendFunc
100
- this.project.cache['mainFolder'] = mainFolder;
101
- tempRepoPath = this.project.pathFor([
102
- this.TMP_GH_PAGE_SITE_REPOS,
103
- mainFolder,
104
- ]);
105
- if (!!index_1.Helpers.exists(tempRepoPath)) return [3 /*break*/, 2];
106
- return [4 /*yield*/, index_1.Helpers.git.clone({
107
- cwd: this.project.pathFor(this.TMP_GH_PAGE_SITE_REPOS),
108
- url: this.project.git.originURL,
109
- destinationFolderName: mainFolder,
110
- })];
111
- case 1:
112
- _a.sent();
113
- _a.label = 2;
114
- case 2:
115
- index_1.Helpers.git.checkout(tempRepoPath, this.pagesBranchName, {
116
- createBranchIfNotExists: true,
117
- switchBranchWhenExists: true,
118
- });
119
- return [4 /*yield*/, this.cleanFolderForGhPages(tempRepoPath)];
120
- case 3:
121
- _a.sent();
122
- currentDocsFolderAbsPath = this.project.pathFor(tnp_config_1.config.folder.docs);
123
- if (index_1.Helpers.filesFrom(currentDocsFolderAbsPath).length > 0 &&
124
- index_1.Helpers.exists([currentDocsFolderAbsPath, 'index.html'])) {
125
- index_1.Helpers.copy(currentDocsFolderAbsPath, tempRepoPath, {
126
- recursive: true,
127
- overwrite: true,
128
- });
129
- }
130
- if (!completeProcess) return [3 /*break*/, 11];
131
- index_1.Helpers.git.stageAllFiles(tempRepoPath);
132
- index_1.Helpers.git.commit(tempRepoPath, 'update docs');
133
- _a.label = 4;
134
- case 4:
135
- _a.trys.push([4, 6, , 7]);
136
- return [4 /*yield*/, index_1.Helpers.git.pushCurrentBranch(tempRepoPath)];
137
- case 5:
138
- _a.sent();
139
- return [3 /*break*/, 7];
140
- case 6:
141
- error_1 = _a.sent();
142
- index_1.Helpers.error("Cannot push to ".concat(this.pagesBranchName, " branch"), false, true);
143
- return [3 /*break*/, 7];
144
- case 7:
145
- if (!(index_1.Helpers.filesFrom(currentDocsFolderAbsPath).length > 0 &&
146
- index_1.Helpers.exists([currentDocsFolderAbsPath, 'index.html']))) return [3 /*break*/, 11];
147
- index_1.Helpers.removeFolderIfExists(currentDocsFolderAbsPath);
148
- index_1.Helpers.mkdirp(currentDocsFolderAbsPath);
149
- index_1.Helpers.writeFile([currentDocsFolderAbsPath, 'info.md'], "# ".concat(this.project.name, " docs"));
150
- this.project.git.addAndCommit("chore: gh pages branch instead docs");
151
- _a.label = 8;
152
- case 8:
153
- _a.trys.push([8, 10, , 11]);
154
- return [4 /*yield*/, this.project.git.pushCurrentBranch({
155
- forcePushNoQuestion: true,
156
- force: true,
157
- })];
158
- case 9:
159
- _a.sent();
160
- return [3 /*break*/, 11];
161
- case 10:
162
- error_2 = _a.sent();
163
- index_1.Helpers.error("Cannot push to ".concat(this.pagesBranchName, " branch"), false, true);
164
- return [3 /*break*/, 11];
165
- case 11: return [2 /*return*/];
166
- }
167
- });
168
- });
169
- };
170
- return BaseGithubPages;
171
- }(base_feature_for_project_1.BaseFeatureForProject));
172
- exports.BaseGithubPages = BaseGithubPages;
173
- //# sourceMappingURL=base-github-pages.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-github-pages.js","sourceRoot":"","sources":["c:/Users/darek/projects/npm/taon-dev/tnp-helpers/src/lib/base/classes/base-github-pages.ts"],"names":[],"mappings":";;;;AAAA,iBAAiB;AACjB,yCAAoC;AACpC,uEAAmE;AAEnE,qCAAgC;AAChC,qCAAsC;AACtC,YAAY;A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AC,AAjHD,CAEU,gDAAqB,GA+G9B;AAjHY,0CAAe"}
@@ -1,104 +0,0 @@
1
- import type { CopyOptionsSync } from 'fs-extra';
2
- export interface GetRecrusiveFilesFromOptions {
3
- }
4
- export declare class HelpersFileFolders {
5
- /**
6
- * Calculate file or string checksum
7
- */
8
- checksum(absolutePathToFileOrContent: string, algorithm?: 'md5' | 'sha1'): string;
9
- getValueFromJSON(filepath: string, lodashGetPath: string, defaultValue?: any): any;
10
- getValueFromJSONC(filepath: string, lodashGetPath: string, defaultValue?: any): any;
11
- readValueFromJson(filepath: string, lodashGetPath: string, defaultValue?: any): any;
12
- readValueFromJsonC(filepath: string, lodashGetPath: string, defaultValue?: any): any;
13
- setValueToJSON(filepath: string, lodashGetPath: string, value: any): void;
14
- setValueToJSONC(filepath: string, lodashGetPath: string, value: any): void;
15
- /**
16
- * file size in bytes
17
- */
18
- size(filePath: string): number;
19
- pathFromLink(filePath: string): string;
20
- /**
21
- * @deprecated
22
- */
23
- renameFolder(from: string, to: string, cwd?: string): void;
24
- /**
25
- * @deprecated
26
- */
27
- renameFiles(from: string, to: string, cwd?: string): void;
28
- getTempFolder(): string;
29
- isPlainFileOrFolder(filePath: string): boolean;
30
- /**
31
- * @deprecated
32
- * use import (or modules only on backend)
33
- */
34
- requireUncached(module: string): any;
35
- /**
36
- * @deprecated
37
- * use import (or modules only on backend)
38
- *
39
- * get default export object from js file
40
- * @param jsFilePath
41
- */
42
- require(jsFilePath: string): any;
43
- tryRecreateDir(dirpath: string): void;
44
- /**
45
- * @deprecated
46
- */
47
- tryCopyFrom(source: string, destination: string, options?: {}): void;
48
- move(from: string, to: string): void;
49
- findChildren<T>(location: string, createFn: (childLocation: string) => T, options?: {
50
- allowAllNames: boolean;
51
- }): T[];
52
- /**
53
- * @deprecated
54
- */
55
- findChildrenNavi<T>(location: string, createFn: (childLocation: string) => T): T[];
56
- /**
57
- * get all files from folder
58
- * absolute paths
59
- */
60
- getRecrusiveFilesFrom(dir: string, ommitFolders?: string[], options?: GetRecrusiveFilesFromOptions): string[];
61
- checkIfNameAllowedForTaonProj(folderName: string): boolean;
62
- getLinesFromFiles(filename: string, lineCount?: number): Promise<string[]>;
63
- /**
64
- * Get the most recent changes file in direcory
65
- * @param dir absoulute path to file
66
- */
67
- getMostRecentFileName(dir: string): string;
68
- getMostRecentFilesNames(dir: string): string[];
69
- removeExcept(fromPath: string, exceptFolderAndFiles: string[]): void;
70
- copy(sourceDir: string, destinationDir: string, options?: {
71
- filter?: any;
72
- overwrite?: boolean;
73
- recursive?: boolean;
74
- asSeparatedFiles?: boolean;
75
- asSeparatedFilesAllowNotCopied?: boolean;
76
- asSeparatedFilesSymlinkAsFile?: boolean;
77
- /**
78
- * folders to omit: example: ['src','node_modules']
79
- *
80
- * This option works only with omitFoldersBaseFolder
81
- */
82
- omitFolders?: string[];
83
- /**
84
- * absolute path for base folder for omitFolder option
85
- */
86
- omitFoldersBaseFolder?: string;
87
- copySymlinksAsFiles?: boolean;
88
- copySymlinksAsFilesDeleteUnexistedLinksFromSourceFirst?: boolean;
89
- useTempFolder?: boolean;
90
- dontAskOnError?: boolean;
91
- } & CopyOptionsSync): void;
92
- filterDontCopy(basePathFoldersTosSkip: string[], projectOrBasepath: string): (src: string, dest: string) => boolean;
93
- filterOnlyCopy(basePathFoldersOnlyToInclude: string[], projectOrBasepath: string): (src: string, dest: string) => boolean;
94
- copyFile(sourcePath: string, destinationPath: string, options?: {
95
- transformTextFn?: (input: string) => string;
96
- debugMode?: boolean;
97
- fast?: boolean;
98
- dontCopySameContent?: boolean;
99
- }): boolean;
100
- /**
101
- * get real absolute path
102
- */
103
- resolve(fileOrFolderPath: string): string;
104
- }