@nu-art/build-and-install 0.300.8 → 0.400.1

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 (195) hide show
  1. package/build-and-install-v3.d.ts +29 -0
  2. package/build-and-install-v3.js +132 -0
  3. package/build-and-install-v3.js.map +1 -0
  4. package/build-and-install.js +18 -24
  5. package/build-and-install.js.map +1 -0
  6. package/core/consts.d.ts +7 -2
  7. package/core/consts.js +12 -9
  8. package/core/consts.js.map +1 -0
  9. package/core/exceptions/PhaseAggregatedException.d.ts +5 -0
  10. package/core/exceptions/PhaseAggregatedException.js +9 -0
  11. package/core/exceptions/PhaseAggregatedException.js.map +1 -0
  12. package/core/package/consts.d.ts +1 -1
  13. package/core/package/consts.js +7 -9
  14. package/core/package/consts.js.map +1 -0
  15. package/core/params/params.d.ts +18 -19
  16. package/core/params/params.js +142 -178
  17. package/core/params/params.js.map +1 -0
  18. package/core/types/configs/firebasejson.js +2 -2
  19. package/core/types/configs/firebasejson.js.map +1 -0
  20. package/core/types/configs/firebaserc.js +2 -2
  21. package/core/types/configs/firebaserc.js.map +1 -0
  22. package/core/types/configs/index.d.ts +3 -3
  23. package/core/types/configs/index.js +4 -19
  24. package/core/types/configs/index.js.map +1 -0
  25. package/core/types/configs/package-json.d.ts +2 -1
  26. package/core/types/configs/package-json.js +2 -2
  27. package/core/types/configs/package-json.js.map +1 -0
  28. package/core/types/core.js +2 -2
  29. package/core/types/core.js.map +1 -0
  30. package/core/types/index.d.ts +4 -4
  31. package/core/types/index.js +5 -20
  32. package/core/types/index.js.map +1 -0
  33. package/core/types/package/index.d.ts +2 -2
  34. package/core/types/package/index.js +3 -18
  35. package/core/types/package/index.js.map +1 -0
  36. package/core/types/package/package.d.ts +10 -14
  37. package/core/types/package/package.js +15 -12
  38. package/core/types/package/package.js.map +1 -0
  39. package/core/types/package/runtime-package.d.ts +2 -2
  40. package/core/types/package/runtime-package.js +2 -2
  41. package/core/types/package/runtime-package.js.map +1 -0
  42. package/core/types/project-config.d.ts +31 -2
  43. package/core/types/project-config.js +2 -2
  44. package/core/types/project-config.js.map +1 -0
  45. package/defaults/backend-proxy/proxy._ts +3 -1
  46. package/defaults/consts.d.ts +0 -7
  47. package/defaults/consts.js +10 -10
  48. package/defaults/consts.js.map +1 -0
  49. package/{v2/phase-runner → old}/PhaseRunnerDispatcher.d.ts +4 -4
  50. package/old/PhaseRunnerDispatcher.js +33 -0
  51. package/old/PhaseRunnerDispatcher.js.map +1 -0
  52. package/{v2/unit → old}/runner-dispatchers.d.ts +3 -3
  53. package/old/runner-dispatchers.js +4 -0
  54. package/old/runner-dispatchers.js.map +1 -0
  55. package/package.json +20 -15
  56. package/v3/PhaseManager.d.ts +26 -0
  57. package/v3/PhaseManager.js +144 -0
  58. package/v3/PhaseManager.js.map +1 -0
  59. package/v3/RunningStatusHandler.d.ts +16 -0
  60. package/v3/RunningStatusHandler.js +57 -0
  61. package/v3/RunningStatusHandler.js.map +1 -0
  62. package/v3/UnitsDependencyMapper/UnitsDependencyMapper.d.ts +52 -0
  63. package/v3/UnitsDependencyMapper/UnitsDependencyMapper.js +287 -0
  64. package/v3/UnitsDependencyMapper/UnitsDependencyMapper.js.map +1 -0
  65. package/v3/UnitsMapper/UnitsMapper.d.ts +21 -0
  66. package/v3/UnitsMapper/UnitsMapper.js +60 -0
  67. package/v3/UnitsMapper/UnitsMapper.js.map +1 -0
  68. package/v3/UnitsMapper/resolvers/UnitMapper_Base.d.ts +23 -0
  69. package/v3/UnitsMapper/resolvers/UnitMapper_Base.js +17 -0
  70. package/v3/UnitsMapper/resolvers/UnitMapper_Base.js.map +1 -0
  71. package/v3/UnitsMapper/resolvers/UnitMapper_FirebaseFunction.d.ts +62 -0
  72. package/v3/UnitsMapper/resolvers/UnitMapper_FirebaseFunction.js +56 -0
  73. package/v3/UnitsMapper/resolvers/UnitMapper_FirebaseFunction.js.map +1 -0
  74. package/v3/UnitsMapper/resolvers/UnitMapper_FirebaseHosting.d.ts +38 -0
  75. package/v3/UnitsMapper/resolvers/UnitMapper_FirebaseHosting.js +49 -0
  76. package/v3/UnitsMapper/resolvers/UnitMapper_FirebaseHosting.js.map +1 -0
  77. package/v3/UnitsMapper/resolvers/UnitMapper_Node.d.ts +30 -0
  78. package/v3/UnitsMapper/resolvers/UnitMapper_Node.js +59 -0
  79. package/v3/UnitsMapper/resolvers/UnitMapper_Node.js.map +1 -0
  80. package/v3/UnitsMapper/resolvers/UnitMapper_NodeLib.d.ts +25 -0
  81. package/v3/UnitsMapper/resolvers/UnitMapper_NodeLib.js +29 -0
  82. package/v3/UnitsMapper/resolvers/UnitMapper_NodeLib.js.map +1 -0
  83. package/v3/UnitsMapper/resolvers/UnitMapper_NodeProject.d.ts +24 -0
  84. package/v3/UnitsMapper/resolvers/UnitMapper_NodeProject.js +23 -0
  85. package/v3/UnitsMapper/resolvers/UnitMapper_NodeProject.js.map +1 -0
  86. package/v3/UnitsMapper/resolvers/index.d.ts +4 -0
  87. package/v3/UnitsMapper/resolvers/index.js +5 -0
  88. package/v3/UnitsMapper/resolvers/index.js.map +1 -0
  89. package/v3/UnitsMapper/types.d.ts +25 -0
  90. package/v3/UnitsMapper/types.js +2 -0
  91. package/v3/UnitsMapper/types.js.map +1 -0
  92. package/v3/core/FileSystemUtils.d.ts +34 -0
  93. package/v3/core/FileSystemUtils.js +152 -0
  94. package/v3/core/FileSystemUtils.js.map +1 -0
  95. package/v3/core/FilesCache.d.ts +7 -0
  96. package/v3/core/FilesCache.js +34 -0
  97. package/v3/core/FilesCache.js.map +1 -0
  98. package/v3/core/Unit_HelpPrinter.d.ts +16 -0
  99. package/v3/core/Unit_HelpPrinter.js +48 -0
  100. package/v3/core/Unit_HelpPrinter.js.map +1 -0
  101. package/v3/core/types.d.ts +17 -0
  102. package/v3/core/types.js +6 -0
  103. package/v3/core/types.js.map +1 -0
  104. package/v3/phase/consts.d.ts +52 -0
  105. package/v3/phase/consts.js +127 -0
  106. package/v3/phase/consts.js.map +1 -0
  107. package/v3/phase/index.d.ts +2 -0
  108. package/v3/phase/index.js +3 -0
  109. package/v3/phase/index.js.map +1 -0
  110. package/v3/phase/types.d.ts +9 -0
  111. package/v3/phase/types.js +2 -0
  112. package/v3/phase/types.js.map +1 -0
  113. package/v3/units/BaseUnit.d.ts +46 -0
  114. package/v3/units/BaseUnit.js +120 -0
  115. package/v3/units/BaseUnit.js.map +1 -0
  116. package/v3/units/ProjectUnit.d.ts +18 -0
  117. package/v3/units/ProjectUnit.js +12 -0
  118. package/v3/units/ProjectUnit.js.map +1 -0
  119. package/v3/units/Unit_NodeProject.d.ts +30 -0
  120. package/v3/units/Unit_NodeProject.js +244 -0
  121. package/v3/units/Unit_NodeProject.js.map +1 -0
  122. package/v3/units/Unit_PackageJson.d.ts +18 -0
  123. package/v3/units/Unit_PackageJson.js +51 -0
  124. package/v3/units/Unit_PackageJson.js.map +1 -0
  125. package/v3/units/Unit_TypescriptLib.d.ts +45 -0
  126. package/v3/units/Unit_TypescriptLib.js +377 -0
  127. package/v3/units/Unit_TypescriptLib.js.map +1 -0
  128. package/v3/units/firebase/Unit_FirebaseFunctionsApp.d.ts +60 -0
  129. package/v3/units/firebase/Unit_FirebaseFunctionsApp.js +281 -0
  130. package/v3/units/firebase/Unit_FirebaseFunctionsApp.js.map +1 -0
  131. package/v3/units/firebase/Unit_FirebaseHostingApp.d.ts +49 -0
  132. package/v3/units/firebase/Unit_FirebaseHostingApp.js +100 -0
  133. package/v3/units/firebase/Unit_FirebaseHostingApp.js.map +1 -0
  134. package/v3/units/index.d.ts +5 -0
  135. package/v3/units/index.js +6 -0
  136. package/v3/units/index.js.map +1 -0
  137. package/core/params/types.d.ts +0 -51
  138. package/core/params/types.js +0 -2
  139. package/tsconfig.json +0 -23
  140. package/v2/phase/consts.d.ts +0 -53
  141. package/v2/phase/consts.js +0 -151
  142. package/v2/phase/index.d.ts +0 -2
  143. package/v2/phase/index.js +0 -18
  144. package/v2/phase/types.d.ts +0 -12
  145. package/v2/phase/types.js +0 -2
  146. package/v2/phase-runner/PhaseRunner.d.ts +0 -69
  147. package/v2/phase-runner/PhaseRunner.js +0 -472
  148. package/v2/phase-runner/PhaseRunnerDispatcher.js +0 -37
  149. package/v2/phase-runner/RunnerParams.d.ts +0 -12
  150. package/v2/phase-runner/RunnerParams.js +0 -9
  151. package/v2/phase-runner/consts.d.ts +0 -7
  152. package/v2/phase-runner/consts.js +0 -9
  153. package/v2/phase-runner/kaki.d.ts +0 -0
  154. package/v2/phase-runner/kaki.js +0 -1
  155. package/v2/phase-runner/types.d.ts +0 -13
  156. package/v2/phase-runner/types.js +0 -6
  157. package/v2/project/types.d.ts +0 -8
  158. package/v2/project/types.js +0 -2
  159. package/v2/screens/BAIScreen.d.ts +0 -22
  160. package/v2/screens/BAIScreen.js +0 -82
  161. package/v2/screens/BAIScreenManager.d.ts +0 -28
  162. package/v2/screens/BAIScreenManager.js +0 -77
  163. package/v2/screens/BAIScreen_Launch.d.ts +0 -28
  164. package/v2/screens/BAIScreen_Launch.js +0 -173
  165. package/v2/screens/BAIScreen_UnitList.d.ts +0 -36
  166. package/v2/screens/BAIScreen_UnitList.js +0 -203
  167. package/v2/unit/consts.d.ts +0 -6
  168. package/v2/unit/consts.js +0 -8
  169. package/v2/unit/core/BaseUnit.d.ts +0 -39
  170. package/v2/unit/core/BaseUnit.js +0 -138
  171. package/v2/unit/core/Unit_Python.d.ts +0 -16
  172. package/v2/unit/core/Unit_Python.js +0 -26
  173. package/v2/unit/core/Unit_Typescript.d.ts +0 -49
  174. package/v2/unit/core/Unit_Typescript.js +0 -143
  175. package/v2/unit/core/Unit_TypescriptLib.d.ts +0 -48
  176. package/v2/unit/core/Unit_TypescriptLib.js +0 -226
  177. package/v2/unit/core/Unit_TypescriptProject.d.ts +0 -31
  178. package/v2/unit/core/Unit_TypescriptProject.js +0 -194
  179. package/v2/unit/core/index.d.ts +0 -5
  180. package/v2/unit/core/index.js +0 -21
  181. package/v2/unit/firebase-units/Unit_FirebaseFunctionsApp.d.ts +0 -35
  182. package/v2/unit/firebase-units/Unit_FirebaseFunctionsApp.js +0 -309
  183. package/v2/unit/firebase-units/Unit_FirebaseHostingApp.d.ts +0 -24
  184. package/v2/unit/firebase-units/Unit_FirebaseHostingApp.js +0 -138
  185. package/v2/unit/firebase-units/consts.d.ts +0 -2
  186. package/v2/unit/firebase-units/consts.js +0 -9
  187. package/v2/unit/firebase-units/index.d.ts +0 -2
  188. package/v2/unit/firebase-units/index.js +0 -18
  189. package/v2/unit/runner-dispatchers.js +0 -6
  190. package/v2/unit/thunderstorm.d.ts +0 -171
  191. package/v2/unit/thunderstorm.js +0 -199
  192. package/v2/unit/tools/tools.d.ts +0 -2
  193. package/v2/unit/tools/tools.js +0 -15
  194. package/v2/unit/types.d.ts +0 -8
  195. package/v2/unit/types.js +0 -2
@@ -0,0 +1,57 @@
1
+ import fs, { promises as _fs } from 'fs';
2
+ import { __stringify, Logger } from '@nu-art/ts-common';
3
+ export class RunningStatusHandler extends Logger {
4
+ isolated = false;
5
+ steps = [];
6
+ outputFolder;
7
+ runtimeParams;
8
+ startIndex = 0;
9
+ constructor(outputFolder, runtimeParams) {
10
+ super();
11
+ this.outputFolder = outputFolder;
12
+ this.runtimeParams = runtimeParams;
13
+ }
14
+ async init() {
15
+ if (!fs.existsSync(this.outputFolder))
16
+ await _fs.mkdir(this.outputFolder, { recursive: true });
17
+ if (this.runtimeParams.continue) {
18
+ const currentParams = this.runtimeParams;
19
+ this.startIndex = await this.load();
20
+ this.runtimeParams = Object.assign(currentParams, this.runtimeParams);
21
+ }
22
+ }
23
+ setSteps(steps) {
24
+ if (this.runtimeParams.continue)
25
+ return;
26
+ this.steps = steps;
27
+ }
28
+ isolate() {
29
+ this.isolated = true;
30
+ return this;
31
+ }
32
+ async update(index) {
33
+ this.startIndex = index;
34
+ if (this.isolated)
35
+ return;
36
+ this.logVerbose(`Setting execution index to #${index}`, this.steps[index]);
37
+ await _fs.writeFile(`${this.outputFolder}/running-status.json`, __stringify({
38
+ index: this.startIndex,
39
+ runtimeParams: this.runtimeParams,
40
+ steps: this.steps
41
+ }, true));
42
+ }
43
+ async load() {
44
+ try {
45
+ const data = JSON.parse(await _fs.readFile(`${this.outputFolder}/running-status.json`, { encoding: 'utf-8' }));
46
+ this.startIndex = data.index;
47
+ this.steps = data.steps;
48
+ this.runtimeParams = data.runtimeParams;
49
+ return data.index;
50
+ }
51
+ catch (e) {
52
+ this.logError('Failed reading running status, using initial status', e);
53
+ return;
54
+ }
55
+ }
56
+ }
57
+ //# sourceMappingURL=RunningStatusHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RunningStatusHandler.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/build-and-install/src/main/","sources":["v3/RunningStatusHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAC,QAAQ,IAAI,GAAG,EAAC,MAAM,IAAI,CAAC;AACvC,OAAO,EAAC,WAAW,EAAE,MAAM,EAAC,MAAM,mBAAmB,CAAC;AAKtD,MAAM,OAAO,oBACZ,SAAQ,MAAM;IACN,QAAQ,GAAG,KAAK,CAAC;IACjB,KAAK,GAAoB,EAAE,CAAC;IAC5B,YAAY,CAAS;IAC7B,aAAa,CAAY;IACzB,UAAU,GAAW,CAAC,CAAC;IAEvB,YAAY,YAAoB,EAAE,aAAwB;QACzD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACpC,CAAC;IAED,KAAK,CAAC,IAAI;QACT,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC;YACpC,MAAM,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE,EAAC,SAAS,EAAE,IAAI,EAAC,CAAC,CAAC;QAEvD,IAAI,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC;YACjC,MAAM,aAAa,G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AI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;YACxC,OAAO,IAAI,CAAC,KAAK,CAAC;QACnB,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YACjB,IAAI,CAAC,QAAQ,CAAC,qDAAqD,EAAE,CAAC,CAAC,CAAC;YACxE,OAAO;QACR,CAAC;IACF,CAAC;CACD"}
@@ -0,0 +1,52 @@
1
+ import { Logger } from '@nu-art/ts-common';
2
+ export type UnitDependentNode = {
3
+ key: string;
4
+ dependsOn: string[];
5
+ };
6
+ /**
7
+ * Maps unit dependencies and provides tools to analyze and operate on the dependency graph.
8
+ */
9
+ export declare class UnitsDependencyMapper extends Logger {
10
+ private readonly map;
11
+ private pathToOutputFolder?;
12
+ constructor(units: UnitDependentNode[], pathToOutputFolder?: string);
13
+ /**
14
+ * Builds dependency layers (bottom-to-top) from the provided keys.
15
+ * Filters out any non-participating units and prunes the graph accordingly.
16
+ */
17
+ buildDependencyTree(participatingKeys?: string[]): Promise<string[][]>;
18
+ /**
19
+ * Pretty-prints the dependency graph in a visual tree structure.
20
+ */
21
+ printGraph(): void;
22
+ /**
23
+ * Filters units by resolving full downstream dependencies from given targets,
24
+ * excluding explicitly excluded units.
25
+ */
26
+ filterForTargets(included: string[], excluded?: string[]): UnitDependentNode[];
27
+ private printNodeRecursive;
28
+ /**
29
+ * Given a set of changed keys, returns all upstream dependents (reverse dependencies).
30
+ */
31
+ getReverseDependencies(changedKeys: string[], strict?: boolean): string[];
32
+ /**
33
+ * Recursively gathers all transitive dependencies of given units (excluding the keys themselves).
34
+ */
35
+ getTransitiveDependencies(key: string[]): string[];
36
+ /**
37
+ * Returns all detected cycles in the graph as ordered lists of unit keys.
38
+ */
39
+ detectCycles(): string[][];
40
+ /**
41
+ * Checks if there is a dependency path from one unit to another.
42
+ */
43
+ isReachable(from: string, to: string): boolean;
44
+ /**
45
+ * Returns all root units (not depended on by any other units).
46
+ */
47
+ getRoots(): string[];
48
+ /**
49
+ * Returns all leaf units (those with no dependencies).
50
+ */
51
+ getLeaves(): string[];
52
+ }
@@ -0,0 +1,287 @@
1
+ import { __stringify, _keys, _values, BadImplementationException, DateTimeFormat_yyyyMMDDTHHmmss, deepClone, Logger, reduceObject, sortArray } from '@nu-art/ts-common';
2
+ import { FileSystemUtils } from '../core/FileSystemUtils.js';
3
+ import { resolve } from 'path';
4
+ /**
5
+ * Maps unit dependencies and provides tools to analyze and operate on the dependency graph.
6
+ */
7
+ export class UnitsDependencyMapper extends Logger {
8
+ map = {};
9
+ pathToOutputFolder;
10
+ constructor(units, pathToOutputFolder) {
11
+ super();
12
+ this.pathToOutputFolder = pathToOutputFolder;
13
+ for (const unit of units)
14
+ this.map[unit.key] = unit;
15
+ for (const unit of units)
16
+ for (const dep of unit.dependsOn)
17
+ if (!this.map[dep])
18
+ throw new BadImplementationException(`Unknown key: ${dep}, in unit: ${unit.key}`);
19
+ }
20
+ /**
21
+ * Builds dependency layers (bottom-to-top) from the provided keys.
22
+ * Filters out any non-participating units and prunes the graph accordingly.
23
+ */
24
+ async buildDependencyTree(participatingKeys = [..._keys(this.map)]) {
25
+ this.logDebug('Building dependency tree for: ', participatingKeys.sort());
26
+ const dependentNodes = reduceObject(this.map, [], (acc, key, value) => {
27
+ acc.push(value);
28
+ return acc;
29
+ });
30
+ this.logVerbose(dependentNodes);
31
+ const allKnownKeys = _keys(this.map);
32
+ const map = deepClone(this.map);
33
+ for (const key of participatingKeys) {
34
+ if (!map[key])
35
+ throw new BadImplementationException(`Unknown key: ${key}`);
36
+ }
37
+ const notParticipatingKeys = allKnownKeys.filter(key => !participatingKeys.includes(key));
38
+ for (const key of _keys(map)) {
39
+ if (notParticipatingKeys.includes(key)) {
40
+ delete map[key];
41
+ continue;
42
+ }
43
+ const node = map[key];
44
+ node.dependsOn = node.dependsOn.filter(dep => !notParticipatingKeys.includes(dep));
45
+ }
46
+ const dependentsMap = {};
47
+ const referencedKeys = new Set();
48
+ this.logVerbose(map);
49
+ // 1. Build reverse dependency graph
50
+ for (const key of _keys(map)) {
51
+ const node = map[key];
52
+ for (const dep of node.dependsOn) {
53
+ let set = dependentsMap[dep];
54
+ if (!set)
55
+ dependentsMap[dep] = set = new Set();
56
+ set.add(key);
57
+ referencedKeys.add(dep);
58
+ }
59
+ }
60
+ // 2. Identify bottom layer (depends on no one)
61
+ const bottomLayer = _keys(map).filter(key => map[key].dependsOn.length === 0);
62
+ // 3. Identify top layer (no one depends on them)
63
+ const topLayer = _keys(map).filter(key => !dependentsMap[key] && !bottomLayer.includes(key));
64
+ // 4. Build actual layers from bottom to top
65
+ const resolved = new Set(bottomLayer);
66
+ const layers = [];
67
+ if (bottomLayer.length > 0)
68
+ layers.push(sortArray(bottomLayer));
69
+ while (resolved.size < participatingKeys.length - topLayer.length) {
70
+ const nextLayer = [];
71
+ for (const key of _keys(map)) {
72
+ const node = map[key];
73
+ if (resolved.has(key) || topLayer.includes(key))
74
+ continue;
75
+ if (node.dependsOn.every(dep => resolved.has(dep)))
76
+ nextLayer.push(key);
77
+ }
78
+ if (nextLayer.length === 0) {
79
+ this.logWarning(participatingKeys);
80
+ this.logWarning(map);
81
+ this.logWarning(layers);
82
+ throw new Error('Cyclic or disconnected dependency detected');
83
+ }
84
+ nextLayer.sort();
85
+ layers.push(sortArray(nextLayer));
86
+ nextLayer.forEach(k => resolved.add(k));
87
+ }
88
+ // 5. Add top layer last
89
+ if (topLayer.length > 0)
90
+ layers.push(sortArray(topLayer));
91
+ if (this.pathToOutputFolder)
92
+ await FileSystemUtils.file.write(resolve(this.pathToOutputFolder, `./dependency-tree-calc-${DateTimeFormat_yyyyMMDDTHHmmss.format()}.json`), __stringify({
93
+ unitKeys: participatingKeys,
94
+ dependencies: dependentNodes,
95
+ output: layers,
96
+ }));
97
+ this.logDebug('Dependency tree:', layers);
98
+ return layers;
99
+ }
100
+ /**
101
+ * Pretty-prints the dependency graph in a visual tree structure.
102
+ */
103
+ printGraph() {
104
+ console.log('');
105
+ // key -> list of dependencies (sorted)
106
+ const dependsOnMap = new Map();
107
+ for (const key of _keys(this.map)) {
108
+ const node = this.map[key];
109
+ dependsOnMap.set(key, [...node.dependsOn].sort());
110
+ }
111
+ // Build reverse index to detect root nodes
112
+ const allKeys = _keys(this.map);
113
+ const referencedKeys = new Set();
114
+ for (const deps of dependsOnMap.values())
115
+ deps.forEach(dep => referencedKeys.add(dep));
116
+ // Root nodes: those no one depends on
117
+ const rootNodes = allKeys
118
+ .filter(k => !referencedKeys.has(k))
119
+ .sort();
120
+ const visited = new Set();
121
+ for (const root of rootNodes) {
122
+ console.log(`◉ ${root}`);
123
+ visited.add(root);
124
+ const children = dependsOnMap.get(root) ?? [];
125
+ for (let i = 0; i < children.length; i++) {
126
+ const isLast = i === children.length - 1;
127
+ this.printNodeRecursive(children[i], dependsOnMap, visited, '', isLast);
128
+ }
129
+ }
130
+ // Handle disconnected/unreferenced nodes
131
+ for (const key of allKeys.sort()) {
132
+ if (!visited.has(key)) {
133
+ console.log(`\n◉ ${key} (unlinked)`);
134
+ this.printNodeRecursive(key, dependsOnMap, visited, '', true);
135
+ }
136
+ }
137
+ }
138
+ /**
139
+ * Filters units by resolving full downstream dependencies from given targets,
140
+ * excluding explicitly excluded units.
141
+ */
142
+ filterForTargets(included, excluded = []) {
143
+ const visited = new Set();
144
+ const toExclude = new Set(excluded);
145
+ const stack = [...included];
146
+ while (stack.length > 0) {
147
+ const key = stack.pop();
148
+ if (visited.has(key) || toExclude.has(key))
149
+ continue;
150
+ const node = this.map[key];
151
+ if (!node)
152
+ throw new Error(`Unknown unit: ${key}`);
153
+ visited.add(key);
154
+ for (const dep of node.dependsOn)
155
+ stack.push(dep);
156
+ }
157
+ // Return only units that were visited and not excluded
158
+ return [..._values(this.map)]
159
+ .filter(node => visited.has(node.key) && !toExclude.has(node.key));
160
+ }
161
+ printNodeRecursive(node, graph, visited, prefix, isLast) {
162
+ const connector = isLast ? '└── ' : '├── ';
163
+ console.log(`${prefix}${connector}${node}`);
164
+ visited.add(node);
165
+ const children = graph.get(node) ?? [];
166
+ const newPrefix = prefix + (isLast ? ' ' : '│ ');
167
+ for (let i = 0; i < children.length; i++) {
168
+ const child = children[i];
169
+ const childIsLast = i === children.length - 1;
170
+ this.printNodeRecursive(child, graph, visited, newPrefix, childIsLast);
171
+ }
172
+ }
173
+ /**
174
+ * Given a set of changed keys, returns all upstream dependents (reverse dependencies).
175
+ */
176
+ getReverseDependencies(changedKeys, strict = true) {
177
+ const dependentsMap = new Map();
178
+ for (const key of _keys(this.map)) {
179
+ const node = this.map[key];
180
+ for (const dep of node.dependsOn) {
181
+ if (!dependentsMap.has(dep))
182
+ dependentsMap.set(dep, new Set());
183
+ dependentsMap.get(dep).add(key);
184
+ }
185
+ }
186
+ const visited = new Set();
187
+ const stack = [...changedKeys];
188
+ while (stack.length > 0) {
189
+ const key = stack.pop();
190
+ if (!this.map[key]) {
191
+ if (strict)
192
+ throw new Error(`Unknown unit: ${key}`);
193
+ continue;
194
+ }
195
+ if (visited.has(key))
196
+ continue;
197
+ visited.add(key);
198
+ const dependents = dependentsMap.get(key);
199
+ if (dependents)
200
+ stack.push(...dependents);
201
+ }
202
+ return Array.from(visited);
203
+ }
204
+ /**
205
+ * Recursively gathers all transitive dependencies of given units (excluding the keys themselves).
206
+ */
207
+ getTransitiveDependencies(key) {
208
+ const visited = new Set();
209
+ const stack = [...key];
210
+ while (stack.length > 0) {
211
+ const current = stack.pop();
212
+ if (visited.has(current))
213
+ continue;
214
+ visited.add(current);
215
+ const node = this.map[current];
216
+ if (!node)
217
+ throw new Error(`Unit '${current}' not found in dependency map.`);
218
+ stack.push(...node.dependsOn);
219
+ }
220
+ key.forEach(_key => visited.delete(_key));
221
+ return [...visited];
222
+ }
223
+ /**
224
+ * Returns all detected cycles in the graph as ordered lists of unit keys.
225
+ */
226
+ detectCycles() {
227
+ const visited = new Set();
228
+ const inStack = new Set();
229
+ const cycles = [];
230
+ const visit = (key, path) => {
231
+ if (inStack.has(key)) {
232
+ const cycleStart = path.indexOf(key);
233
+ cycles.push(path.slice(cycleStart).concat(key));
234
+ return;
235
+ }
236
+ if (visited.has(key))
237
+ return;
238
+ visited.add(key);
239
+ inStack.add(key);
240
+ const node = this.map[key];
241
+ if (node)
242
+ for (const dep of node.dependsOn)
243
+ visit(dep, path.concat(key));
244
+ inStack.delete(key);
245
+ };
246
+ for (const key of _keys(this.map))
247
+ visit(key, []);
248
+ return cycles;
249
+ }
250
+ /**
251
+ * Checks if there is a dependency path from one unit to another.
252
+ */
253
+ isReachable(from, to) {
254
+ const visited = new Set();
255
+ const stack = [from];
256
+ while (stack.length > 0) {
257
+ const key = stack.pop();
258
+ if (key === to)
259
+ return true;
260
+ if (visited.has(key))
261
+ continue;
262
+ visited.add(key);
263
+ const node = this.map[key];
264
+ if (node)
265
+ stack.push(...node.dependsOn);
266
+ }
267
+ return false;
268
+ }
269
+ /**
270
+ * Returns all root units (not depended on by any other units).
271
+ */
272
+ getRoots() {
273
+ const allKeys = new Set(_keys(this.map));
274
+ const dependedUpon = new Set();
275
+ for (const node of _values(this.map))
276
+ for (const dep of node.dependsOn)
277
+ dependedUpon.add(dep);
278
+ return [...allKeys].filter(k => !dependedUpon.has(k)).sort();
279
+ }
280
+ /**
281
+ * Returns all leaf units (those with no dependencies).
282
+ */
283
+ getLeaves() {
284
+ return _values(this.map).filter(node => node.dependsOn.length === 0).map(node => node.key).sort();
285
+ }
286
+ }
287
+ //# sourceMappingURL=UnitsDependencyMapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnitsDependencyMapper.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/build-and-install/src/main/","sources":["v3/UnitsDependencyMapper/UnitsDependencyMapper.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,WAAW,EACX,KAAK,EACL,OAAO,EACP,0BAA0B,EAC1B,8BAA8B,EAAE,SAAS,EACzC,MAAM,EACN,YAAY,EACZ,SAAS,EAET,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAC,eA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AC/B,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACxB,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC9D,CAAC;IAED;;OAEG;IACI,SAAS;QACf,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACnG,CAAC;CACD"}
@@ -0,0 +1,21 @@
1
+ import { BaseUnit, ProjectUnit } from '../units/index.js';
2
+ import { Logger } from '@nu-art/ts-common';
3
+ import { UnitMapper_Base } from './resolvers/UnitMapper_Base.js';
4
+ import { BaiParams } from '../../core/params/params.js';
5
+ /**
6
+ * This class will receive a path and will map the workspace packages and libs
7
+ *
8
+ * A lib will have rules to infer it, mainly from the package.json but also from existing files in the context of the node lib
9
+ */
10
+ export declare class UnitsMapper extends Logger {
11
+ private rules;
12
+ /**
13
+ * @param path - will always be a directory
14
+ * @param projectRoot - The path to the project root
15
+ * @param units - The project units derived from the file system
16
+ */
17
+ resolveUnits(path: string, projectRoot?: string, units?: BaseUnit<any>[]): Promise<BaseUnit<any, import("../units/BaseUnit.js").UnitRuntimeContext>[]>;
18
+ addRules<T extends BaseUnit<any>>(...rules: UnitMapper_Base<T>[]): this;
19
+ setRuntimeParams(runtimeParams: BaiParams): this;
20
+ assertUniqueKeys(units: ProjectUnit[]): void;
21
+ }
@@ -0,0 +1,60 @@
1
+ import { promises as fs } from 'fs';
2
+ import { BadImplementationException, Logger } from '@nu-art/ts-common';
3
+ /**
4
+ * This class will receive a path and will map the workspace packages and libs
5
+ *
6
+ * A lib will have rules to infer it, mainly from the package.json but also from existing files in the context of the node lib
7
+ */
8
+ export class UnitsMapper extends Logger {
9
+ rules = [];
10
+ /**
11
+ * @param path - will always be a directory
12
+ * @param projectRoot - The path to the project root
13
+ * @param units - The project units derived from the file system
14
+ */
15
+ async resolveUnits(path, projectRoot = path, units = []) {
16
+ if (path.endsWith('/node_modules') || path.match(/\/\.[\w -_]+$/))
17
+ return units;
18
+ let unit;
19
+ for (const rule of this.rules) {
20
+ unit = await rule.resolveUnit(path, projectRoot);
21
+ if (!unit)
22
+ continue;
23
+ this.logDebug(`Found unit ${unit.config.key} at path ${path}`);
24
+ units.push(unit);
25
+ if (!unit.config.isRoot)
26
+ return units;
27
+ break;
28
+ }
29
+ this.logVerbose(`Iterating on path: ${path}`);
30
+ if (!(await fs.stat(path)).isDirectory())
31
+ throw new BadImplementationException(`Provided path '${path}' is not a directory`);
32
+ // filter out all the folders in the provided path
33
+ const paths = (await fs.readdir(path, { withFileTypes: true }))
34
+ .filter(dirent => dirent.isDirectory())
35
+ .map(dirent => `${path}/${dirent.name}`);
36
+ for (const path of paths) {
37
+ await this.resolveUnits(path, projectRoot, units);
38
+ }
39
+ return units;
40
+ }
41
+ addRules(...rules) {
42
+ this.rules.push(...rules);
43
+ return this;
44
+ }
45
+ setRuntimeParams(runtimeParams) {
46
+ this.rules.forEach(rule => rule.setRuntimeParams(runtimeParams));
47
+ return this;
48
+ }
49
+ assertUniqueKeys(units) {
50
+ const keyToUnit = {};
51
+ for (const unit of units) {
52
+ const config = unit.config;
53
+ const existing = keyToUnit[config.key]?.config;
54
+ if (existing)
55
+ throw new BadImplementationException(`Duplicate unit key "${config.key}" found:\n- ${existing.relativePath}\n- ${config.relativePath}`);
56
+ keyToUnit[config.key] = unit;
57
+ }
58
+ }
59
+ }
60
+ //# sourceMappingURL=UnitsMapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnitsMapper.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/build-and-install/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ator } from '@nu-art/ts-common';
2
+ import { BaseUnit } from '../../units/index.js';
3
+ import { BAI_Config } from '../../../core/types/index.js';
4
+ import { BaiParams } from '../../../core/params/params.js';
5
+ export type BaseUnitConfig = {
6
+ fullPath: AbsolutePath;
7
+ relativePath: RelativePath;
8
+ label: string;
9
+ key: string;
10
+ dependencies: StringMap;
11
+ };
12
+ export type UnitConfigJSON_Base = {
13
+ type: string;
14
+ };
15
+ export declare abstract class UnitMapper_Base<T extends BaseUnit<any>, ConfigJSON extends UnitConfigJSON_Base = UnitConfigJSON_Base> extends Logger {
16
+ protected validator: TypeValidator<ConfigJSON>;
17
+ protected baiConfig: BAI_Config;
18
+ protected runtimeParams: BaiParams;
19
+ protected constructor(validator: TypeValidator<ConfigJSON>);
20
+ setRuntimeParams(runtimeParams: BaiParams): void;
21
+ setConfig(config: BAI_Config): void;
22
+ abstract resolveUnit(path: string, root: string): Promise<T | undefined>;
23
+ }
@@ -0,0 +1,17 @@
1
+ import { Logger } from '@nu-art/ts-common';
2
+ export class UnitMapper_Base extends Logger {
3
+ validator;
4
+ baiConfig;
5
+ runtimeParams;
6
+ constructor(validator) {
7
+ super();
8
+ this.validator = validator;
9
+ }
10
+ setRuntimeParams(runtimeParams) {
11
+ this.runtimeParams = runtimeParams;
12
+ }
13
+ setConfig(config) {
14
+ this.baiConfig = config;
15
+ }
16
+ }
17
+ //# sourceMappingURL=UnitMapper_Base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnitMapper_Base.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/build-and-install/src/main/","sources":["v3/UnitsMapper/resolvers/UnitMapper_Base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,EAAyC,MAAM,mBAAmB,CAAC;AAgB/F,MAAM,OAAgB,eAGrB,SAAQ,MAAM;IAEJ,SAAS,CAA4B;IACrC,SAAS,CAAc;IACvB,aAAa,CAAa;IAEpC,YAAsB,SAAoC;QACzD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC5B,CAAC;IAED,gBAAgB,CAAC,aAAwB;QACxC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACpC,CAAC;IAED,SAAS,CAAC,MAAkB;QAC3B,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC;IACzB,CAAC;CAGD"}
@@ -0,0 +1,62 @@
1
+ import { TypedMap } from '@nu-art/ts-common';
2
+ import { UnitConfigJSON_Node, UnitMapper_Node, UnitMapper_NodeContext } from './UnitMapper_Node.js';
3
+ import { Unit_FirebaseFunctionsApp } from '../../units/firebase/Unit_FirebaseFunctionsApp.js';
4
+ type EnvConfig = {
5
+ defaultConfig?: string;
6
+ envConfig?: string;
7
+ projectId: string;
8
+ isLocal?: boolean;
9
+ };
10
+ type UnitConfigJSON_FirebaseFunction = UnitConfigJSON_Node & {
11
+ debugPort?: number;
12
+ basePort?: number;
13
+ envs: TypedMap<EnvConfig>;
14
+ ignore?: string[];
15
+ sslKey?: string;
16
+ sslCert?: string;
17
+ };
18
+ export declare class UnitMapper_FirebaseFunction_Class extends UnitMapper_Node<Unit_FirebaseFunctionsApp, UnitConfigJSON_FirebaseFunction> {
19
+ static tsValidator_FirebaseFunction: {
20
+ label: import("@nu-art/ts-common").Validator<string>;
21
+ customESLintConfig: import("@nu-art/ts-common").Validator<boolean>;
22
+ customTSConfig: import("@nu-art/ts-common").Validator<boolean>;
23
+ hasSelfHotReload: import("@nu-art/ts-common").Validator<boolean>;
24
+ type: import("@nu-art/ts-common").Validator<any>;
25
+ ignore: import("@nu-art/ts-common").Validator<string[]>;
26
+ envs: (import("@nu-art/ts-common").ValidatorImpl<any> | ((input?: TypedMap<EnvConfig> | undefined) => import("@nu-art/ts-common").InvalidResultObject<TypedMap<EnvConfig>> | undefined))[];
27
+ debugPort: import("@nu-art/ts-common").Validator<number>;
28
+ basePort: import("@nu-art/ts-common").Validator<number>;
29
+ sslKey: import("@nu-art/ts-common").Validator<string>;
30
+ sslCert: import("@nu-art/ts-common").Validator<string>;
31
+ };
32
+ constructor();
33
+ protected resolveNodeUnit(context: UnitMapper_NodeContext<UnitConfigJSON_FirebaseFunction>): Promise<Unit_FirebaseFunctionsApp<{
34
+ envConfig: {
35
+ defaultConfig: string | undefined;
36
+ envConfig: string | undefined;
37
+ projectId: string;
38
+ isLocal: boolean;
39
+ };
40
+ isTopLevelApp: true;
41
+ hasSelfHotReload: boolean;
42
+ packageJson: import("../types.js").TS_PackageJSON<UnitConfigJSON_FirebaseFunction>;
43
+ customESLintConfig: boolean;
44
+ customTSConfig: boolean;
45
+ output: string;
46
+ sslCert: string;
47
+ sslKey: string;
48
+ label: string;
49
+ debugPort: number;
50
+ basePort: number;
51
+ envs: TypedMap<EnvConfig>;
52
+ ignore?: string[] | undefined;
53
+ pathToFirebaseConfig: string;
54
+ pathToEmulatorData: string;
55
+ fullPath: import("@nu-art/ts-common").AbsolutePath;
56
+ relativePath: import("@nu-art/ts-common").RelativePath;
57
+ key: string;
58
+ dependencies: import("@nu-art/ts-common").StringMap;
59
+ }>>;
60
+ }
61
+ export declare const UnitMapper_FirebaseFunction: UnitMapper_FirebaseFunction_Class;
62
+ export {};