@nu-art/build-and-install 0.300.7 → 0.400.0
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/build-and-install-v3.d.ts +29 -0
- package/build-and-install-v3.js +132 -0
- package/build-and-install-v3.js.map +1 -0
- package/build-and-install.js +18 -24
- package/build-and-install.js.map +1 -0
- package/core/consts.d.ts +7 -2
- package/core/consts.js +12 -9
- package/core/consts.js.map +1 -0
- package/core/exceptions/PhaseAggregatedException.d.ts +5 -0
- package/core/exceptions/PhaseAggregatedException.js +9 -0
- package/core/exceptions/PhaseAggregatedException.js.map +1 -0
- package/core/package/consts.d.ts +1 -1
- package/core/package/consts.js +7 -9
- package/core/package/consts.js.map +1 -0
- package/core/params/params.d.ts +18 -19
- package/core/params/params.js +142 -178
- package/core/params/params.js.map +1 -0
- package/core/types/configs/firebasejson.js +2 -2
- package/core/types/configs/firebasejson.js.map +1 -0
- package/core/types/configs/firebaserc.js +2 -2
- package/core/types/configs/firebaserc.js.map +1 -0
- package/core/types/configs/index.d.ts +3 -3
- package/core/types/configs/index.js +4 -19
- package/core/types/configs/index.js.map +1 -0
- package/core/types/configs/package-json.d.ts +2 -1
- package/core/types/configs/package-json.js +2 -2
- package/core/types/configs/package-json.js.map +1 -0
- package/core/types/core.js +2 -2
- package/core/types/core.js.map +1 -0
- package/core/types/index.d.ts +4 -4
- package/core/types/index.js +5 -20
- package/core/types/index.js.map +1 -0
- package/core/types/package/index.d.ts +2 -2
- package/core/types/package/index.js +3 -18
- package/core/types/package/index.js.map +1 -0
- package/core/types/package/package.d.ts +10 -14
- package/core/types/package/package.js +15 -12
- package/core/types/package/package.js.map +1 -0
- package/core/types/package/runtime-package.d.ts +2 -2
- package/core/types/package/runtime-package.js +2 -2
- package/core/types/package/runtime-package.js.map +1 -0
- package/core/types/project-config.d.ts +31 -2
- package/core/types/project-config.js +2 -2
- package/core/types/project-config.js.map +1 -0
- package/defaults/backend-proxy/proxy._ts +3 -1
- package/defaults/consts.d.ts +0 -7
- package/defaults/consts.js +10 -10
- package/defaults/consts.js.map +1 -0
- package/{v2/phase-runner → old}/PhaseRunnerDispatcher.d.ts +4 -4
- package/old/PhaseRunnerDispatcher.js +33 -0
- package/old/PhaseRunnerDispatcher.js.map +1 -0
- package/{v2/unit → old}/runner-dispatchers.d.ts +3 -3
- package/old/runner-dispatchers.js +4 -0
- package/old/runner-dispatchers.js.map +1 -0
- package/package.json +20 -15
- package/v3/PhaseManager.d.ts +26 -0
- package/v3/PhaseManager.js +144 -0
- package/v3/PhaseManager.js.map +1 -0
- package/v3/RunningStatusHandler.d.ts +16 -0
- package/v3/RunningStatusHandler.js +57 -0
- package/v3/RunningStatusHandler.js.map +1 -0
- package/v3/UnitsDependencyMapper/UnitsDependencyMapper.d.ts +52 -0
- package/v3/UnitsDependencyMapper/UnitsDependencyMapper.js +287 -0
- package/v3/UnitsDependencyMapper/UnitsDependencyMapper.js.map +1 -0
- package/v3/UnitsMapper/UnitsMapper.d.ts +21 -0
- package/v3/UnitsMapper/UnitsMapper.js +60 -0
- package/v3/UnitsMapper/UnitsMapper.js.map +1 -0
- package/v3/UnitsMapper/resolvers/UnitMapper_Base.d.ts +23 -0
- package/v3/UnitsMapper/resolvers/UnitMapper_Base.js +17 -0
- package/v3/UnitsMapper/resolvers/UnitMapper_Base.js.map +1 -0
- package/v3/UnitsMapper/resolvers/UnitMapper_FirebaseFunction.d.ts +62 -0
- package/v3/UnitsMapper/resolvers/UnitMapper_FirebaseFunction.js +56 -0
- package/v3/UnitsMapper/resolvers/UnitMapper_FirebaseFunction.js.map +1 -0
- package/v3/UnitsMapper/resolvers/UnitMapper_FirebaseHosting.d.ts +38 -0
- package/v3/UnitsMapper/resolvers/UnitMapper_FirebaseHosting.js +49 -0
- package/v3/UnitsMapper/resolvers/UnitMapper_FirebaseHosting.js.map +1 -0
- package/v3/UnitsMapper/resolvers/UnitMapper_Node.d.ts +30 -0
- package/v3/UnitsMapper/resolvers/UnitMapper_Node.js +59 -0
- package/v3/UnitsMapper/resolvers/UnitMapper_Node.js.map +1 -0
- package/v3/UnitsMapper/resolvers/UnitMapper_NodeLib.d.ts +25 -0
- package/v3/UnitsMapper/resolvers/UnitMapper_NodeLib.js +29 -0
- package/v3/UnitsMapper/resolvers/UnitMapper_NodeLib.js.map +1 -0
- package/v3/UnitsMapper/resolvers/UnitMapper_NodeProject.d.ts +24 -0
- package/v3/UnitsMapper/resolvers/UnitMapper_NodeProject.js +23 -0
- package/v3/UnitsMapper/resolvers/UnitMapper_NodeProject.js.map +1 -0
- package/v3/UnitsMapper/resolvers/index.d.ts +4 -0
- package/v3/UnitsMapper/resolvers/index.js +5 -0
- package/v3/UnitsMapper/resolvers/index.js.map +1 -0
- package/v3/UnitsMapper/types.d.ts +24 -0
- package/v3/UnitsMapper/types.js +2 -0
- package/v3/UnitsMapper/types.js.map +1 -0
- package/v3/core/FileSystemUtils.d.ts +34 -0
- package/v3/core/FileSystemUtils.js +152 -0
- package/v3/core/FileSystemUtils.js.map +1 -0
- package/v3/core/FilesCache.d.ts +7 -0
- package/v3/core/FilesCache.js +34 -0
- package/v3/core/FilesCache.js.map +1 -0
- package/v3/core/Unit_HelpPrinter.d.ts +16 -0
- package/v3/core/Unit_HelpPrinter.js +48 -0
- package/v3/core/Unit_HelpPrinter.js.map +1 -0
- package/v3/core/types.d.ts +17 -0
- package/v3/core/types.js +6 -0
- package/v3/core/types.js.map +1 -0
- package/v3/phase/consts.d.ts +52 -0
- package/v3/phase/consts.js +127 -0
- package/v3/phase/consts.js.map +1 -0
- package/v3/phase/index.d.ts +2 -0
- package/v3/phase/index.js +3 -0
- package/v3/phase/index.js.map +1 -0
- package/v3/phase/types.d.ts +9 -0
- package/v3/phase/types.js +2 -0
- package/v3/phase/types.js.map +1 -0
- package/v3/units/BaseUnit.d.ts +46 -0
- package/v3/units/BaseUnit.js +120 -0
- package/v3/units/BaseUnit.js.map +1 -0
- package/v3/units/ProjectUnit.d.ts +18 -0
- package/v3/units/ProjectUnit.js +12 -0
- package/v3/units/ProjectUnit.js.map +1 -0
- package/v3/units/Unit_NodeProject.d.ts +32 -0
- package/v3/units/Unit_NodeProject.js +244 -0
- package/v3/units/Unit_NodeProject.js.map +1 -0
- package/v3/units/Unit_PackageJson.d.ts +19 -0
- package/v3/units/Unit_PackageJson.js +42 -0
- package/v3/units/Unit_PackageJson.js.map +1 -0
- package/v3/units/Unit_TypescriptLib.d.ts +45 -0
- package/v3/units/Unit_TypescriptLib.js +373 -0
- package/v3/units/Unit_TypescriptLib.js.map +1 -0
- package/v3/units/firebase/Unit_FirebaseFunctionsApp.d.ts +62 -0
- package/v3/units/firebase/Unit_FirebaseFunctionsApp.js +281 -0
- package/v3/units/firebase/Unit_FirebaseFunctionsApp.js.map +1 -0
- package/v3/units/firebase/Unit_FirebaseHostingApp.d.ts +49 -0
- package/v3/units/firebase/Unit_FirebaseHostingApp.js +100 -0
- package/v3/units/firebase/Unit_FirebaseHostingApp.js.map +1 -0
- package/v3/units/index.d.ts +5 -0
- package/v3/units/index.js +6 -0
- package/v3/units/index.js.map +1 -0
- package/core/params/types.d.ts +0 -51
- package/core/params/types.js +0 -2
- package/tsconfig.json +0 -23
- package/v2/phase/consts.d.ts +0 -53
- package/v2/phase/consts.js +0 -149
- package/v2/phase/index.d.ts +0 -2
- package/v2/phase/index.js +0 -18
- package/v2/phase/types.d.ts +0 -12
- package/v2/phase/types.js +0 -2
- package/v2/phase-runner/PhaseRunner.d.ts +0 -69
- package/v2/phase-runner/PhaseRunner.js +0 -472
- package/v2/phase-runner/PhaseRunnerDispatcher.js +0 -37
- package/v2/phase-runner/RunnerParams.d.ts +0 -12
- package/v2/phase-runner/RunnerParams.js +0 -9
- package/v2/phase-runner/consts.d.ts +0 -7
- package/v2/phase-runner/consts.js +0 -9
- package/v2/phase-runner/kaki.d.ts +0 -0
- package/v2/phase-runner/kaki.js +0 -1
- package/v2/phase-runner/types.d.ts +0 -13
- package/v2/phase-runner/types.js +0 -6
- package/v2/project/types.d.ts +0 -8
- package/v2/project/types.js +0 -2
- package/v2/screens/BAIScreen.d.ts +0 -22
- package/v2/screens/BAIScreen.js +0 -82
- package/v2/screens/BAIScreenManager.d.ts +0 -28
- package/v2/screens/BAIScreenManager.js +0 -77
- package/v2/screens/BAIScreen_Launch.d.ts +0 -28
- package/v2/screens/BAIScreen_Launch.js +0 -173
- package/v2/screens/BAIScreen_UnitList.d.ts +0 -36
- package/v2/screens/BAIScreen_UnitList.js +0 -203
- package/v2/unit/consts.d.ts +0 -6
- package/v2/unit/consts.js +0 -8
- package/v2/unit/core/BaseUnit.d.ts +0 -39
- package/v2/unit/core/BaseUnit.js +0 -138
- package/v2/unit/core/Unit_Python.d.ts +0 -16
- package/v2/unit/core/Unit_Python.js +0 -26
- package/v2/unit/core/Unit_Typescript.d.ts +0 -49
- package/v2/unit/core/Unit_Typescript.js +0 -143
- package/v2/unit/core/Unit_TypescriptLib.d.ts +0 -48
- package/v2/unit/core/Unit_TypescriptLib.js +0 -226
- package/v2/unit/core/Unit_TypescriptProject.d.ts +0 -31
- package/v2/unit/core/Unit_TypescriptProject.js +0 -194
- package/v2/unit/core/index.d.ts +0 -5
- package/v2/unit/core/index.js +0 -21
- package/v2/unit/firebase-units/Unit_FirebaseFunctionsApp.d.ts +0 -35
- package/v2/unit/firebase-units/Unit_FirebaseFunctionsApp.js +0 -309
- package/v2/unit/firebase-units/Unit_FirebaseHostingApp.d.ts +0 -24
- package/v2/unit/firebase-units/Unit_FirebaseHostingApp.js +0 -138
- package/v2/unit/firebase-units/consts.d.ts +0 -2
- package/v2/unit/firebase-units/consts.js +0 -9
- package/v2/unit/firebase-units/index.d.ts +0 -2
- package/v2/unit/firebase-units/index.js +0 -18
- package/v2/unit/runner-dispatchers.js +0 -6
- package/v2/unit/thunderstorm.d.ts +0 -171
- package/v2/unit/thunderstorm.js +0 -199
- package/v2/unit/tools/tools.d.ts +0 -2
- package/v2/unit/tools/tools.js +0 -15
- package/v2/unit/types.d.ts +0 -8
- package/v2/unit/types.js +0 -2
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./package"), exports);
|
|
18
|
-
__exportStar(require("./runtime-package"), exports);
|
|
1
|
+
export * from './package.js';
|
|
2
|
+
export * from './runtime-package.js';
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/build-and-install/src/main/","sources":["core/types/package/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC"}
|
|
@@ -37,27 +37,22 @@ export type FirebaseEnvConfig<Env extends string> = {
|
|
|
37
37
|
[ModuleName: string]: any;
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
|
+
type FirebaseHostingConfig = {
|
|
41
|
+
public: string;
|
|
42
|
+
rewrites: {
|
|
43
|
+
source: string;
|
|
44
|
+
destination: string;
|
|
45
|
+
}[];
|
|
46
|
+
};
|
|
40
47
|
export type FirebasePackageConfig<Env extends string = string> = {
|
|
41
48
|
envs: FirebaseEnvConfig<Env>[];
|
|
42
49
|
name: string;
|
|
43
|
-
debugPort: number;
|
|
44
|
-
basePort: number;
|
|
45
|
-
hostingPort?: number;
|
|
46
50
|
pathToFirebaseConfig: string;
|
|
47
|
-
|
|
48
|
-
pathToKey: string;
|
|
49
|
-
pathToCertificate: string;
|
|
50
|
-
};
|
|
51
|
+
servingPort?: number;
|
|
51
52
|
functions?: {
|
|
52
53
|
ignore: string[];
|
|
53
54
|
};
|
|
54
|
-
hosting?:
|
|
55
|
-
public: string;
|
|
56
|
-
rewrites: {
|
|
57
|
-
source: string;
|
|
58
|
-
destination: string;
|
|
59
|
-
}[];
|
|
60
|
-
};
|
|
55
|
+
hosting?: FirebaseHostingConfig;
|
|
61
56
|
};
|
|
62
57
|
export type Package_Base = {
|
|
63
58
|
name: string;
|
|
@@ -94,3 +89,4 @@ export type Package_ProjectLib = Package_WithSources & {
|
|
|
94
89
|
type: typeof PackageType_ProjectLib;
|
|
95
90
|
};
|
|
96
91
|
export type Package = Package_Sourceless | Package_FirebaseHostingApp | Package_FirebaseFunctionsApp | Package_InfraLib | Package_ProjectLib | Package_Python;
|
|
92
|
+
export {};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
export const PackageType_InfraLib = 'infra-lib';
|
|
2
|
+
export const PackageType_ProjectLib = 'project-lib';
|
|
3
|
+
export const PackageType_FirebaseHostingApp = 'firebase-hosting-app';
|
|
4
|
+
export const PackageType_FirebaseHostingAndFunctionApp = 'firebase-app';
|
|
5
|
+
export const PackageType_FirebaseFunctionsApp = 'firebase-functions-app';
|
|
6
|
+
export const PackageType_Sourceless = 'sourceless';
|
|
7
|
+
export const PackageType_Python = 'python';
|
|
8
|
+
export const PackageTypes = [PackageType_InfraLib,
|
|
9
|
+
PackageType_ProjectLib,
|
|
10
|
+
PackageType_FirebaseHostingApp,
|
|
11
|
+
PackageType_FirebaseFunctionsApp,
|
|
12
|
+
PackageType_Sourceless,
|
|
13
|
+
PackageType_Python];
|
|
14
|
+
export const PackageTypesWithOutput = [PackageType_InfraLib, PackageType_ProjectLib, PackageType_FirebaseHostingApp, PackageType_FirebaseFunctionsApp];
|
|
15
|
+
//# sourceMappingURL=package.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/build-and-install/src/main/","sources":["core/types/package/package.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,WAAoB,CAAC;AACzD,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAsB,CAAC;AAC7D,MAAM,CAAC,MAAM,8BAA8B,GAAG,sBAA+B,CAAC;AAC9E,MAAM,CAAC,MAAM,yCAAyC,GAAG,cAAuB,CAAC;AACjF,MAAM,CAAC,MAAM,gCAAgC,GAAG,wBAAiC,CAAC;AAClF,MAAM,CAAC,MAAM,sBAAsB,GAAG,YAAqB,CAAC;AAC5D,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAiB,CAAC;AACpD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,oBAAoB;IAClC,sBAAsB;IACtB,8BAA8B;IAC9B,gCAAgC;IAChC,sBAAsB;IACtB,kBAAkB,CAAU,CAAC;AAC5C,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,oBAAoB,EAAE,sBAAsB,EAAE,8BAA8B,EAAE,gCAAgC,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PackageJson } from '../configs';
|
|
2
|
-
import { Package, Package_Sourceless } from './package';
|
|
1
|
+
import { PackageJson } from '../configs/index.js';
|
|
2
|
+
import { Package, Package_Sourceless } from './package.js';
|
|
3
3
|
type WithPackageJson = {
|
|
4
4
|
packageJsonTemplate: PackageJson;
|
|
5
5
|
packageJsonWorkspace?: PackageJson;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=runtime-package.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-package.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/build-and-install/src/main/","sources":["core/types/package/runtime-package.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StringMap } from '@nu-art/ts-common';
|
|
2
|
-
import { Package, RuntimePackage } from './package';
|
|
1
|
+
import { StringMap, TypedMap } from '@nu-art/ts-common';
|
|
2
|
+
import { Package, RuntimePackage } from './package/index.js';
|
|
3
3
|
export type ProjectConfig = {
|
|
4
4
|
params: StringMap;
|
|
5
5
|
packages: Package[];
|
|
@@ -13,3 +13,32 @@ export type RuntimeProjectConfig = {
|
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
export type Constructor<T> = new (...args: any) => T;
|
|
16
|
+
export type BAI_Config = {
|
|
17
|
+
thunderstormVersion: string;
|
|
18
|
+
appVersion: string;
|
|
19
|
+
templateParams?: {
|
|
20
|
+
packageJson?: TypedMap<string>;
|
|
21
|
+
};
|
|
22
|
+
files?: {
|
|
23
|
+
tests?: {
|
|
24
|
+
firebase?: {
|
|
25
|
+
'firebase.json'?: string;
|
|
26
|
+
'.firebaserc'?: string;
|
|
27
|
+
baseEmulationPort?: number;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
firebase?: {
|
|
31
|
+
databaseRules?: string;
|
|
32
|
+
storageRules?: string;
|
|
33
|
+
firestoreIndexesRules?: string;
|
|
34
|
+
firestoreRules?: string;
|
|
35
|
+
};
|
|
36
|
+
typescript?: {
|
|
37
|
+
tsConfig?: StringMap;
|
|
38
|
+
eslintConfig?: string;
|
|
39
|
+
};
|
|
40
|
+
backend: {
|
|
41
|
+
proxy: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=project-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-config.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/build-and-install/src/main/","sources":["core/types/project-config.ts"],"names":[],"mappings":""}
|
|
@@ -19,7 +19,9 @@ _express.all('*', (req, res) => {
|
|
|
19
19
|
const handleError = (error: any) => {
|
|
20
20
|
if(!error)
|
|
21
21
|
return;
|
|
22
|
+
|
|
22
23
|
console.log(`ERROR calling: ${url}`, error);
|
|
24
|
+
res.status(503).end();
|
|
23
25
|
};
|
|
24
26
|
|
|
25
27
|
try {
|
|
@@ -42,7 +44,7 @@ _express.all('*', (req, res) => {
|
|
|
42
44
|
console.log(`PROXY ${counter} - END`);
|
|
43
45
|
} catch (e) {
|
|
44
46
|
console.log(`ERROR calling: ${url}`, e);
|
|
45
|
-
res.
|
|
47
|
+
res.status(500).end();
|
|
46
48
|
}
|
|
47
49
|
});
|
|
48
50
|
|
package/defaults/consts.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { MemKey } from '@nu-art/ts-common/mem-storage/MemStorage';
|
|
2
1
|
export declare const Const_FirebaseConfigKeys: readonly ["databaseRules", "firestoreIndexesRules", "firestoreRules", "storageRules"];
|
|
3
2
|
export type ProjectConfig_DefaultFileRoutes = {
|
|
4
3
|
firebaseConfig?: {
|
|
@@ -17,9 +16,3 @@ export declare const Default_OutputFiles: {
|
|
|
17
16
|
outputLogs: string;
|
|
18
17
|
runningStatus: string;
|
|
19
18
|
};
|
|
20
|
-
export declare const MemKey_DefaultFiles: MemKey<ProjectConfig_DefaultFileRoutes>;
|
|
21
|
-
export type RunningStatus = {
|
|
22
|
-
phaseKey: string;
|
|
23
|
-
packageDependencyIndex?: number;
|
|
24
|
-
};
|
|
25
|
-
export declare const MemKey_RunningStatus: MemKey<RunningStatus>;
|
package/defaults/consts.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
1
|
+
import { fileURLToPath } from 'node:url';
|
|
2
|
+
import { dirname } from 'node:path';
|
|
3
|
+
// ESM-safe replacements for __filename/__dirname
|
|
4
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
5
|
+
const __dirname = dirname(__filename);
|
|
5
6
|
const CONST_FirebaseConfig = `${__dirname}/.firebase_config`;
|
|
6
7
|
const CONST_BackendProxy = `${__dirname}/backend-proxy`;
|
|
7
|
-
|
|
8
|
+
export const Const_FirebaseConfigKeys = [
|
|
8
9
|
'databaseRules',
|
|
9
10
|
'firestoreIndexesRules',
|
|
10
11
|
'firestoreRules',
|
|
11
12
|
'storageRules',
|
|
12
13
|
];
|
|
13
|
-
|
|
14
|
+
export const Const_FirebaseDefaultsKeyToFile = {
|
|
14
15
|
databaseRules: 'database.rules.json',
|
|
15
16
|
firestoreIndexesRules: 'firestore.indexes.json',
|
|
16
17
|
firestoreRules: 'firestore.rules',
|
|
17
18
|
storageRules: 'storage.rules',
|
|
18
19
|
};
|
|
19
|
-
|
|
20
|
+
export const Default_Files = {
|
|
20
21
|
firebaseConfig: {
|
|
21
22
|
databaseRules: `${CONST_FirebaseConfig}/database.rules.json`,
|
|
22
23
|
firestoreIndexesRules: `${CONST_FirebaseConfig}/firestore.indexes.json`,
|
|
@@ -28,10 +29,9 @@ exports.Default_Files = {
|
|
|
28
29
|
}
|
|
29
30
|
};
|
|
30
31
|
const Default_OutputPath = './.trash';
|
|
31
|
-
|
|
32
|
+
export const Default_OutputFiles = {
|
|
32
33
|
output: Default_OutputPath,
|
|
33
34
|
outputLogs: `${Default_OutputPath}/logs`,
|
|
34
35
|
runningStatus: `${Default_OutputPath}/running-status.json`
|
|
35
36
|
};
|
|
36
|
-
|
|
37
|
-
exports.MemKey_RunningStatus = new MemStorage_1.MemKey('running-status');
|
|
37
|
+
//# sourceMappingURL=consts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/build-and-install/src/main/","sources":["defaults/consts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AACvC,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC,iDAAiD;AACjD,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,MAAM,oBAAoB,GAAG,GAAG,SAAS,mBAAmB,CAAC;AAC7D,MAAM,kBAAkB,GAAG,GAAG,SAAS,gBAAgB,CAAC;AAExD,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACvC,eAAe;IACf,uBAAuB;IACvB,gBAAgB;IAChB,cAAc;CACL,CAAC;AASX,MAAM,CAAC,MAAM,+BAA+B,GAA+D;IAC1G,aAAa,EAAE,qBAAqB;IACpC,qBAAqB,EAAE,wBAAwB;IAC/C,cAAc,EAAE,iBAAiB;IACjC,YAAY,EAAE,eAAe;CAC7B,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAoC;IAC7D,cAAc,EAAE;QACf,aAAa,EAAE,GAAG,oBAAoB,sBAAsB;QAC5D,qBAAqB,EAAE,GAAG,oBAAoB,yBAAyB;QACvE,cAAc,EAAE,GAAG,oBAAoB,kBAAkB;QACzD,YAAY,EAAE,GAAG,oBAAoB,gBAAgB;KACrD;IACD,OAAO,EAAE;QACR,KAAK,EAAE,GAAG,kBAAkB,YAAY;KACxC;CACD,CAAC;AAEF,MAAM,kBAAkB,GAAG,UAAU,CAAC;AACtC,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAClC,MAAM,EAAE,kBAAkB;IAC1B,UAAU,EAAE,GAAG,kBAAkB,OAAO;IACxC,aAAa,EAAE,GAAG,kBAAkB,sBAAsB;CAC1D,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FunctionKeys, ParamResolver } from '@nu-art/ts-common';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { BaseUnit } from '../v3/units/index.js';
|
|
3
|
+
import { Phase } from '../v3/phase/index.js';
|
|
4
4
|
export declare class PhaseRunnerDispatcher<T, K extends FunctionKeys<T> = FunctionKeys<T>, P extends ParamResolver<T, K> = ParamResolver<T, K>> {
|
|
5
5
|
private readonly method;
|
|
6
6
|
constructor(method: K);
|
|
@@ -17,8 +17,8 @@ export declare const dispatcher_PhaseChange: PhaseRunnerDispatcher<PhaseRunner_O
|
|
|
17
17
|
export interface PhaseRunner_OnUnitStatusChange {
|
|
18
18
|
__onUnitStatusChange: (data: BaseUnit) => void;
|
|
19
19
|
}
|
|
20
|
-
export declare const dispatcher_UnitStatusChange: PhaseRunnerDispatcher<PhaseRunner_OnUnitStatusChange, "__onUnitStatusChange", [data: BaseUnit<import("../
|
|
20
|
+
export declare const dispatcher_UnitStatusChange: PhaseRunnerDispatcher<PhaseRunner_OnUnitStatusChange, "__onUnitStatusChange", [data: BaseUnit<import("../v3/units/BaseUnit.js").BaseUnit_Config, import("../v3/units/BaseUnit.js").UnitRuntimeContext>]>;
|
|
21
21
|
export interface PhaseRunner_OnUnitsChange {
|
|
22
22
|
__onUnitsChange: (data: BaseUnit[]) => void;
|
|
23
23
|
}
|
|
24
|
-
export declare const dispatcher_UnitChange: PhaseRunnerDispatcher<PhaseRunner_OnUnitsChange, "__onUnitsChange", [data: BaseUnit<import("../
|
|
24
|
+
export declare const dispatcher_UnitChange: PhaseRunnerDispatcher<PhaseRunner_OnUnitsChange, "__onUnitsChange", [data: BaseUnit<import("../v3/units/BaseUnit.js").BaseUnit_Config, import("../v3/units/BaseUnit.js").UnitRuntimeContext>[]]>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { removeItemFromArray } from '@nu-art/ts-common';
|
|
2
|
+
export class PhaseRunnerDispatcher {
|
|
3
|
+
method;
|
|
4
|
+
constructor(method) {
|
|
5
|
+
this.method = method;
|
|
6
|
+
}
|
|
7
|
+
listeners = [];
|
|
8
|
+
//######################### Listeners Logic #########################
|
|
9
|
+
addListener(listener) {
|
|
10
|
+
if (this.listeners.includes(listener))
|
|
11
|
+
return;
|
|
12
|
+
this.listeners.push(listener);
|
|
13
|
+
}
|
|
14
|
+
removeListener(listener) {
|
|
15
|
+
removeItemFromArray(this.listeners, listener);
|
|
16
|
+
}
|
|
17
|
+
dispatch(...data) {
|
|
18
|
+
this.listeners.forEach(listener => {
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
listener[this.method]?.(...data);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
async dispatchAsync(...data) {
|
|
24
|
+
await Promise.all(this.listeners.map(async (listener) => {
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
return listener[this.method]?.(...data);
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export const dispatcher_PhaseChange = new PhaseRunnerDispatcher('__onPhaseChange');
|
|
31
|
+
export const dispatcher_UnitStatusChange = new PhaseRunnerDispatcher('__onUnitStatusChange');
|
|
32
|
+
export const dispatcher_UnitChange = new PhaseRunnerDispatcher('__onUnitsChange');
|
|
33
|
+
//# sourceMappingURL=PhaseRunnerDispatcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhaseRunnerDispatcher.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/build-and-install/src/main/","sources":["old/PhaseRunnerDispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,mBAAmB,EAAC,MAAM,mBAAmB,CAAC;AAInF,MAAM,OAAO,qBAAqB;IAKhB,MAAM,CAAI;IAE3B,YAA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
|
+
import { PhaseRunnerDispatcher } from './PhaseRunnerDispatcher.js';
|
|
2
|
+
import { BaseUnit } from '../v3/units/index.js';
|
|
3
3
|
export interface OnWatchReady {
|
|
4
4
|
__onWatchReady: () => void;
|
|
5
5
|
}
|
|
@@ -7,4 +7,4 @@ export declare const dispatcher_WatchReady: PhaseRunnerDispatcher<OnWatchReady,
|
|
|
7
7
|
export interface OnUnitWatchCompiled {
|
|
8
8
|
__onUnitWatchCompiled: (units: BaseUnit[]) => void;
|
|
9
9
|
}
|
|
10
|
-
export declare const dispatcher_UnitWatchCompile: PhaseRunnerDispatcher<OnUnitWatchCompiled, "__onUnitWatchCompiled", [units: BaseUnit<import("
|
|
10
|
+
export declare const dispatcher_UnitWatchCompile: PhaseRunnerDispatcher<OnUnitWatchCompiled, "__onUnitWatchCompiled", [units: BaseUnit<import("../v3/units/BaseUnit.js").BaseUnit_Config, import("../v3/units/BaseUnit.js").UnitRuntimeContext>[]]>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PhaseRunnerDispatcher } from './PhaseRunnerDispatcher.js';
|
|
2
|
+
export const dispatcher_WatchReady = new PhaseRunnerDispatcher('__onWatchReady');
|
|
3
|
+
export const dispatcher_UnitWatchCompile = new PhaseRunnerDispatcher('__onUnitWatchCompiled');
|
|
4
|
+
//# sourceMappingURL=runner-dispatchers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner-dispatchers.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/build-and-install/src/main/","sources":["old/runner-dispatchers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAC,MAAM,4BAA4B,CAAC;AAOjE,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,qBAAqB,CAAe,gBAAgB,CAAC,CAAC;AAM/F,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,qBAAqB,CAAsB,uBAAuB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nu-art/build-and-install",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.400.0",
|
|
4
4
|
"description": "",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"keywords": [
|
|
6
7
|
"TacB0sS",
|
|
7
8
|
"infra",
|
|
@@ -13,8 +14,7 @@
|
|
|
13
14
|
"url": "https://github.com/nu-art-js/thunderstorm/issues"
|
|
14
15
|
},
|
|
15
16
|
"publishConfig": {
|
|
16
|
-
"directory": "dist"
|
|
17
|
-
"linkDirectory": true
|
|
17
|
+
"directory": "dist"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
@@ -22,24 +22,29 @@
|
|
|
22
22
|
},
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"author": "TacB0sS",
|
|
25
|
-
"main": "index.js",
|
|
26
|
-
"types": "index.d.ts",
|
|
27
25
|
"files": [
|
|
28
26
|
"**/*"
|
|
29
27
|
],
|
|
30
28
|
"scripts": {
|
|
31
|
-
"build": "tsc"
|
|
29
|
+
"build": "tsc",
|
|
30
|
+
"plop": "npm run plop --prefix ../.."
|
|
32
31
|
},
|
|
33
32
|
"dependencies": {
|
|
34
33
|
"chokidar": "^3.6.0",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"glob": "^10.3.14",
|
|
38
|
-
"@nu-art/ts-common": "~0.300.0",
|
|
39
|
-
"@nu-art/commando": "~0.300.0"
|
|
34
|
+
"@nu-art/ts-common": "workspace:*",
|
|
35
|
+
"@nu-art/commando": "workspace:*"
|
|
40
36
|
},
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
|
|
37
|
+
"unitConfig": {
|
|
38
|
+
"type": "typescript-lib"
|
|
39
|
+
},
|
|
40
|
+
"exports": {
|
|
41
|
+
".": {
|
|
42
|
+
"types": "./index.d.ts",
|
|
43
|
+
"import": "./index.js"
|
|
44
|
+
},
|
|
45
|
+
"./*": {
|
|
46
|
+
"types": "./*.d.ts",
|
|
47
|
+
"import": "./*.js"
|
|
48
|
+
}
|
|
44
49
|
}
|
|
45
|
-
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Logger } from '@nu-art/ts-common';
|
|
2
|
+
import { RunningStatusHandler } from './RunningStatusHandler.js';
|
|
3
|
+
import { Phase } from './phase/index.js';
|
|
4
|
+
import { BaseUnit } from './units/index.js';
|
|
5
|
+
export type ScheduledStep = {
|
|
6
|
+
phases: string[];
|
|
7
|
+
units: string[];
|
|
8
|
+
};
|
|
9
|
+
export type ExecutionStep = {
|
|
10
|
+
phases: Phase<any>[];
|
|
11
|
+
units: BaseUnit<any>[];
|
|
12
|
+
};
|
|
13
|
+
export declare class PhaseManager extends Logger {
|
|
14
|
+
private readonly phases;
|
|
15
|
+
private readonly units;
|
|
16
|
+
private runningUnits;
|
|
17
|
+
private killed;
|
|
18
|
+
private runningStatus;
|
|
19
|
+
private activeUnits;
|
|
20
|
+
private readonly keyToPhaseMap;
|
|
21
|
+
constructor(runningStatus: RunningStatusHandler, phases: Phase<any>[][], units: BaseUnit[][]);
|
|
22
|
+
calculateExecutionSteps(): Promise<ScheduledStep[]>;
|
|
23
|
+
execute(_steps: ScheduledStep[]): Promise<void>;
|
|
24
|
+
break(): Promise<void[]>;
|
|
25
|
+
private mapStep;
|
|
26
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { addItemToArray, exists, flatArray, Logger, removeItemFromArray, timeCounter } from '@nu-art/ts-common';
|
|
2
|
+
import { PhaseAggregatedException } from '../core/exceptions/PhaseAggregatedException.js';
|
|
3
|
+
export class PhaseManager extends Logger {
|
|
4
|
+
phases;
|
|
5
|
+
units;
|
|
6
|
+
runningUnits = [];
|
|
7
|
+
killed = false;
|
|
8
|
+
runningStatus;
|
|
9
|
+
activeUnits;
|
|
10
|
+
keyToPhaseMap;
|
|
11
|
+
constructor(runningStatus, phases, units) {
|
|
12
|
+
super();
|
|
13
|
+
this.phases = phases;
|
|
14
|
+
this.units = units;
|
|
15
|
+
this.runningStatus = runningStatus;
|
|
16
|
+
const unitKeySet = new Set();
|
|
17
|
+
const allUnits = [];
|
|
18
|
+
for (const unit of flatArray(units)) {
|
|
19
|
+
if (unitKeySet.has(unit.config.key))
|
|
20
|
+
throw new Error(`Multiple units with same key: ${unit.config.key}`);
|
|
21
|
+
unitKeySet.add(unit.config.key);
|
|
22
|
+
allUnits.push(unit);
|
|
23
|
+
}
|
|
24
|
+
const usePackageKeys = this.runningStatus.runtimeParams.usePackage;
|
|
25
|
+
if (!usePackageKeys?.length)
|
|
26
|
+
this.activeUnits = allUnits.map(unit => unit.config.key);
|
|
27
|
+
else {
|
|
28
|
+
const regexMatchers = usePackageKeys.map(filter => new RegExp(`.*?${filter}.*?`, 'i'));
|
|
29
|
+
this.activeUnits = allUnits.filter(unit => regexMatchers.some(matcher => matcher.test(unit.config.key))).map(unit => unit.config.key);
|
|
30
|
+
}
|
|
31
|
+
this.keyToPhaseMap = flatArray(phases).reduce((acc, phase) => {
|
|
32
|
+
acc[phase.key] = phase;
|
|
33
|
+
return acc;
|
|
34
|
+
}, {});
|
|
35
|
+
}
|
|
36
|
+
//######################### Initialization #########################
|
|
37
|
+
async calculateExecutionSteps() {
|
|
38
|
+
const steps = [];
|
|
39
|
+
this.logDebug('Calculating execution steps for phases: ', this.phases.map(phases => phases.map(phase => phase.key)));
|
|
40
|
+
this.logDebug('Active Units: ', this.activeUnits);
|
|
41
|
+
for (let phaseGroup of this.phases) {
|
|
42
|
+
phaseGroup = phaseGroup.filter(phase => !exists(phase.filter) || phase.filter(this.runningStatus.runtimeParams));
|
|
43
|
+
for (const layer of this.units) {
|
|
44
|
+
const layerUnits = layer.filter(u => this.activeUnits.includes(u.config.key));
|
|
45
|
+
if (layerUnits.length === 0)
|
|
46
|
+
continue;
|
|
47
|
+
const phaseMap = new Map();
|
|
48
|
+
for (const unit of layerUnits) {
|
|
49
|
+
const supportedPhases = phaseGroup.filter(phase => phase.method in unit && typeof unit[phase.method] === 'function');
|
|
50
|
+
if (supportedPhases.length === 0)
|
|
51
|
+
continue;
|
|
52
|
+
const key = phaseGroup
|
|
53
|
+
.filter(phase => supportedPhases.find(p => p.key === phase.key))
|
|
54
|
+
.map(p => p.key)
|
|
55
|
+
.join('|');
|
|
56
|
+
if (!phaseMap.has(key))
|
|
57
|
+
phaseMap.set(key, []);
|
|
58
|
+
phaseMap.get(key).push(unit);
|
|
59
|
+
}
|
|
60
|
+
for (const [phaseKeyCombo, groupedUnits] of phaseMap.entries()) {
|
|
61
|
+
steps.push({
|
|
62
|
+
phases: phaseKeyCombo.split('|'),
|
|
63
|
+
units: groupedUnits.map(u => u.config.key),
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
this.logVerbose('Calculated execution steps: ', steps);
|
|
69
|
+
return steps;
|
|
70
|
+
}
|
|
71
|
+
async execute(_steps) {
|
|
72
|
+
this.runningUnits = [];
|
|
73
|
+
for (let i = this.runningStatus.startIndex; i < _steps.length; i++) {
|
|
74
|
+
if (this.killed)
|
|
75
|
+
break;
|
|
76
|
+
const scheduledStep = _steps[i];
|
|
77
|
+
const step = this.mapStep(scheduledStep);
|
|
78
|
+
this.logDebug(`Executing step #${i + 1}/${_steps.length}`);
|
|
79
|
+
this.logVerbose(scheduledStep);
|
|
80
|
+
const errors = [];
|
|
81
|
+
let failedStep;
|
|
82
|
+
await Promise.all(step.units.map(async (unit) => {
|
|
83
|
+
for (const phase of step.phases) {
|
|
84
|
+
if (this.killed)
|
|
85
|
+
break;
|
|
86
|
+
if (this.runningStatus.runtimeParams.dryRun) {
|
|
87
|
+
this.logInfo(`[${phase.key}] - ${unit.config.key}`);
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
addItemToArray(this.runningUnits, unit);
|
|
91
|
+
const dtCounter = timeCounter();
|
|
92
|
+
try {
|
|
93
|
+
this.logInfo(`Phase(${phase.name}) - Running - ${unit.config.key}`);
|
|
94
|
+
if (typeof unit[phase.method] === 'function')
|
|
95
|
+
await unit[phase.method].call(unit);
|
|
96
|
+
let operationDuration = '';
|
|
97
|
+
if (dtCounter.dt() > 1500)
|
|
98
|
+
operationDuration = ` (${dtCounter.format('mm:ss')})`;
|
|
99
|
+
this.logInfo(`Phase(${phase.name}) - Completed${operationDuration} - ${unit.config.key}`);
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
this.logError(`Phase(${phase.name}) - Error - ${unit.config.key}`, error);
|
|
103
|
+
errors.push(error);
|
|
104
|
+
failedStep = scheduledStep;
|
|
105
|
+
this.killed = true;
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
finally {
|
|
109
|
+
removeItemFromArray(this.runningUnits, unit);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}));
|
|
113
|
+
await this.runningStatus.update(i);
|
|
114
|
+
if (failedStep && errors.length)
|
|
115
|
+
throw new PhaseAggregatedException(errors, failedStep);
|
|
116
|
+
}
|
|
117
|
+
this.logInfo('All steps completed.');
|
|
118
|
+
}
|
|
119
|
+
break() {
|
|
120
|
+
this.killed = true;
|
|
121
|
+
return Promise.all(this.runningUnits.map(unit => unit.kill()));
|
|
122
|
+
}
|
|
123
|
+
mapStep(scheduledStep) {
|
|
124
|
+
const mappedPhases = scheduledStep.phases.map(phaseKey => {
|
|
125
|
+
const phase = this.keyToPhaseMap[phaseKey];
|
|
126
|
+
if (!phase)
|
|
127
|
+
throw new Error(`Phase '${phaseKey}' not found in PhaseManager.phases`);
|
|
128
|
+
return phase;
|
|
129
|
+
});
|
|
130
|
+
const mappedUnits = scheduledStep.units.map(unitKey => {
|
|
131
|
+
for (const layer of this.units) {
|
|
132
|
+
const unit = layer.find(u => u.config.key === unitKey);
|
|
133
|
+
if (unit)
|
|
134
|
+
return unit;
|
|
135
|
+
}
|
|
136
|
+
throw new Error(`Unit '${unitKey}' not found in PhaseManager.units`);
|
|
137
|
+
});
|
|
138
|
+
return {
|
|
139
|
+
phases: mappedPhases,
|
|
140
|
+
units: mappedUnits
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=PhaseManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhaseManager.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/build-and-install/src/main/","sources":["v3/PhaseManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,mBAAmB,EAAE,WAAW,EAAW,MAAM,mBAAmB,CAAC;AAIxH,OAAO,EAAC,wBAAwB,EAAC,MAAM,gDAAgD,CAAC;AAYxF,MAAM,OAAO,YACZ,SAAQ,MAAM;IACG,MAAM,CAAiB;IACvB,KAAK,CAAe;IAC7B,YAAY,GAAe,EAAE,CAAC;IAC9B,MAAM,GAAG,KAAK,CAAC;IACf,aAAa,CAAuB;IACpC,WAAW,CAAW;IACb,aAAa,CAAuB;IAErD,YAAY,aAAmC,EAAE,MAAsB,EAAE,KAAmB;QAC3F,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;QAErC,MAAM,QAAQ,GAAe,EAAE,CAAC;QAChC,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;YACrC,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;gBAClC,MAAM,IAAI,KAAK,CAAC,iCAAiC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;YACrE,UAAU,CAAC,GAAG,C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I,IAAI,CAAC,KAAK,EAAE,CAAC;gBAChC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,KAAK,OAAO,CAAC,CAAC;gBACvD,IAAI,IAAI;oBAAE,OAAO,IAAI,CAAC;YACvB,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,SAAS,OAAO,mCAAmC,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;QAEH,OAAO;YACN,MAAM,EAAE,YAAY;YACpB,KAAK,EAAE,WAAW;SAClB,CAAC;IACH,CAAC;CACD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Logger } from '@nu-art/ts-common';
|
|
2
|
+
import { ScheduledStep } from './PhaseManager.js';
|
|
3
|
+
import { BaiParams } from '../core/params/params.js';
|
|
4
|
+
export declare class RunningStatusHandler extends Logger {
|
|
5
|
+
private isolated;
|
|
6
|
+
private steps;
|
|
7
|
+
private outputFolder;
|
|
8
|
+
runtimeParams: BaiParams;
|
|
9
|
+
startIndex: number;
|
|
10
|
+
constructor(outputFolder: string, runtimeParams: BaiParams);
|
|
11
|
+
init(): Promise<void>;
|
|
12
|
+
setSteps(steps: ScheduledStep[]): void;
|
|
13
|
+
isolate(): RunningStatusHandler;
|
|
14
|
+
update(index: number): Promise<void>;
|
|
15
|
+
load(): Promise<any>;
|
|
16
|
+
}
|