@nu-art/build-and-install 0.300.8 → 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 -151
- 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
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ImplementationMissingException } from '@nu-art/ts-common';
|
|
2
|
+
import { promises as fs } from 'fs';
|
|
3
|
+
let cachedFiles = {};
|
|
4
|
+
const readFile = async (path) => {
|
|
5
|
+
try {
|
|
6
|
+
const fileStat = await fs.stat(path);
|
|
7
|
+
if (fileStat.isFile())
|
|
8
|
+
return await fs.readFile(path, 'utf-8');
|
|
9
|
+
}
|
|
10
|
+
catch (error) {
|
|
11
|
+
if (error.code === 'ENOENT')
|
|
12
|
+
throw new ImplementationMissingException(`file does not exist: ${path}`);
|
|
13
|
+
throw error; // rethrow other errors
|
|
14
|
+
}
|
|
15
|
+
throw new ImplementationMissingException(`expected a file at: ${path}`);
|
|
16
|
+
};
|
|
17
|
+
export const FilesCache = {
|
|
18
|
+
clear: () => cachedFiles = {},
|
|
19
|
+
load: {
|
|
20
|
+
json: async (pathToFile) => {
|
|
21
|
+
const json = cachedFiles[pathToFile];
|
|
22
|
+
if (!json)
|
|
23
|
+
cachedFiles[pathToFile] = Object.freeze(JSON.parse(await readFile(pathToFile)));
|
|
24
|
+
return cachedFiles[pathToFile];
|
|
25
|
+
},
|
|
26
|
+
text: async (pathToFile) => {
|
|
27
|
+
const fileContent = cachedFiles[pathToFile];
|
|
28
|
+
if (!fileContent)
|
|
29
|
+
cachedFiles[pathToFile] = await readFile(pathToFile);
|
|
30
|
+
return cachedFiles[pathToFile];
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=FilesCache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilesCache.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/build-and-install/src/main/","sources":["v3/core/FilesCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,8BAA8B,EAAW,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAC,QAAQ,IA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CAAC,CAAC;YAEtD,OAAO,WAAW,CAAC,UAAU,CAAC,CAAC;QAChC,CAAC;KACD;CACD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseCliParam, CliParams } from '@nu-art/commando/cli-params/types';
|
|
2
|
+
import { UnitPhaseImplementor } from './types.js';
|
|
3
|
+
import { Phase } from '../phase/index.js';
|
|
4
|
+
import { ProjectUnit } from '../units/index.js';
|
|
5
|
+
export declare const BaiParam_Help: BaseCliParam<'help', boolean>;
|
|
6
|
+
declare const AllBaiParams_Help: (BaseCliParam<"allUnits", boolean> | BaseCliParam<"dependencyTree", boolean> | BaseCliParam<"checkCyclicImports", boolean> | BaseCliParam<"continue", boolean> | BaseCliParam<"environment", string> | BaseCliParam<"setup", boolean> | BaseCliParam<"install", boolean> | BaseCliParam<"clean", boolean> | BaseCliParam<"purge", boolean> | BaseCliParam<"generate", boolean> | BaseCliParam<"generateDocs", boolean> | BaseCliParam<"noBuild", boolean> | BaseCliParam<"prepare", boolean> | BaseCliParam<"dryRun", boolean> | BaseCliParam<"runWithThunderstorm", boolean> | BaseCliParam<"withCommando", boolean> | BaseCliParam<"noThunderstorm", boolean> | BaseCliParam<"lint", boolean> | BaseCliParam<"watch", boolean> | BaseCliParam<"watchBuildTree", boolean> | BaseCliParam<"test", boolean> | BaseCliParam<"testType", string[]> | BaseCliParam<"testFiles", string[]> | BaseCliParam<"testCases", string[]> | BaseCliParam<"testDebugPort", number> | BaseCliParam<"launch", boolean> | BaseCliParam<"debugBackend", boolean> | BaseCliParam<"deploy", string> | BaseCliParam<"debug", boolean> | BaseCliParam<"debugLifecycle", boolean> | BaseCliParam<"verbose", boolean> | BaseCliParam<"publish", "patch" | "minor" | "major"> | BaseCliParam<"publishDryRun", boolean> | BaseCliParam<"usePackage", string[]> | BaseCliParam<"help", boolean>)[];
|
|
7
|
+
export type Help_BaiParams = CliParams<typeof AllBaiParams_Help>;
|
|
8
|
+
export type Phase_Help = typeof phase_Help;
|
|
9
|
+
export declare const phaseKey_Help = "help";
|
|
10
|
+
export declare const phase_Help: Phase<'printHelp'>;
|
|
11
|
+
declare class _Unit_HelpPrinter extends ProjectUnit implements UnitPhaseImplementor<[Phase_Help]> {
|
|
12
|
+
constructor();
|
|
13
|
+
printHelp(): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export declare const Unit_HelpPrinter: _Unit_HelpPrinter;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { _keys, LogLevel, reduceToMap } from '@nu-art/ts-common';
|
|
2
|
+
import { AllBaiParams, BaiParam_AllUnits, BaiParam_NoBuild, BaiParam_Prepare } from '../../core/params/params.js';
|
|
3
|
+
import { ProjectUnit } from '../units/index.js';
|
|
4
|
+
export const BaiParam_Help = {
|
|
5
|
+
keys: ['--help', '-h'],
|
|
6
|
+
keyName: 'help',
|
|
7
|
+
type: 'boolean',
|
|
8
|
+
group: 'General',
|
|
9
|
+
description: 'This help menu',
|
|
10
|
+
dependencies: [{ param: BaiParam_NoBuild, value: true }, { param: BaiParam_Prepare, value: false }, { param: BaiParam_AllUnits, value: true }],
|
|
11
|
+
};
|
|
12
|
+
const AllBaiParams_Help = [...AllBaiParams, BaiParam_Help];
|
|
13
|
+
export const phaseKey_Help = 'help';
|
|
14
|
+
export const phase_Help = {
|
|
15
|
+
key: phaseKey_Help,
|
|
16
|
+
name: 'Help',
|
|
17
|
+
method: 'printHelp',
|
|
18
|
+
filter: (params) => params.help,
|
|
19
|
+
};
|
|
20
|
+
const config = { key: 'help-printer', fullPath: process.cwd(), relativePath: '.', dependencies: {}, label: 'Help Printer' };
|
|
21
|
+
class _Unit_HelpPrinter extends ProjectUnit {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(config);
|
|
24
|
+
this.setMinLevel(LogLevel.Verbose);
|
|
25
|
+
}
|
|
26
|
+
async printHelp() {
|
|
27
|
+
this.logInfo('Build and install parameters:');
|
|
28
|
+
const noGroupConst = 'No Group';
|
|
29
|
+
//Resolve all params by group
|
|
30
|
+
const paramsByGroup = reduceToMap(AllBaiParams, param => param.group ?? noGroupConst, (item, index, mapper) => {
|
|
31
|
+
mapper[item.group ?? noGroupConst] = [...mapper[item.group ?? noGroupConst] ?? [], item];
|
|
32
|
+
return mapper[item.group ?? noGroupConst];
|
|
33
|
+
});
|
|
34
|
+
_keys(paramsByGroup).map(paramGroup => {
|
|
35
|
+
this.logErrorBold(`${paramGroup}: \n`);
|
|
36
|
+
// commando.append(`echo "${paramGroup}:" \n`);
|
|
37
|
+
paramsByGroup[paramGroup].map(param => {
|
|
38
|
+
const paramKeys = param.keys.join(' | ');
|
|
39
|
+
const paramDescription = param.description.trim().split('\n').join('\n\t\t');
|
|
40
|
+
this.logDebug(`${paramKeys}`);
|
|
41
|
+
this.logVerbose(`\t${paramDescription}\n`);
|
|
42
|
+
// commando.append(`echo "\n ${param.keys.join(' | ')} \n \t\t${param.description.trim().split('\n').join('\n\t\t')} \n"`);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export const Unit_HelpPrinter = new _Unit_HelpPrinter();
|
|
48
|
+
//# sourceMappingURL=Unit_HelpPrinter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Unit_HelpPrinter.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/build-and-install/src/main/","sources":["v3/core/Unit_HelpPrinter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAW,MAAM,mBAAmB,CAAC;AAEzE,OAAO,EAAC,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,gBAAgB,EAAC,MAAM,6BAA6B,CAAC;AAGhH,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAE9C,MAAM,CAAC,MAAM,aAAa,GAAkC;IAC3D,IAAI,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC;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AE;YACpJ,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,YAAY,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,YAAY,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC;YACzF,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,YAAY,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;QAEH,KAAK,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;YACrC,IAAI,CAAC,YAAY,CAAC,GAAG,UAAU,MAAM,CAAC,CAAC;YACvC,+CAA+C;YAE/C,aAAa,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;gBACrC,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACzC,MAAM,gBAAgB,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAC7E,IAAI,CAAC,QAAQ,CAAC,GAAG,SAAS,EAAE,CAAC,CAAC;gBAC9B,IAAI,CAAC,UAAU,CAAC,KAAK,gBAAgB,IAAI,CAAC,CAAC;gBAC3C,2HAA2H;YAC5H,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC;CACD;AAGD,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AsyncVoidFunction } from '@nu-art/ts-common';
|
|
2
|
+
import { BaseUnit } from '../units/index.js';
|
|
3
|
+
import { Phase } from '../phase/index.js';
|
|
4
|
+
export type Unit<P extends Phase<string>[]> = BaseUnit & UnitPhaseImplementor<P>;
|
|
5
|
+
export type UnitPhaseImplementor<P extends Phase<string>[]> = {
|
|
6
|
+
[K in P[number]['method']]: AsyncVoidFunction;
|
|
7
|
+
};
|
|
8
|
+
export type WatchEventType = 'update' | 'add' | 'remove_file' | 'remove_dir' | 'ready';
|
|
9
|
+
export type RunningStatus = {
|
|
10
|
+
phaseKey: string;
|
|
11
|
+
unitsLayerIndex?: number;
|
|
12
|
+
};
|
|
13
|
+
export declare const WatchEvent_Add: WatchEventType;
|
|
14
|
+
export declare const WatchEvent_Update: WatchEventType;
|
|
15
|
+
export declare const WatchEvent_RemoveDir: WatchEventType;
|
|
16
|
+
export declare const WatchEvent_RemoveFile: WatchEventType;
|
|
17
|
+
export declare const WatchEvent_Ready: WatchEventType;
|
package/v3/core/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/build-and-install/src/main/","sources":["v3/core/types.ts"],"names":[],"mappings":"AAkBA,MAAM,CAAC,MAAM,cAAc,GAAmB,KAAK,CAAC;AACpD,MAAM,CAAC,MAAM,iBAAiB,GAAmB,QAAQ,CAAC;AAC1D,MAAM,CAAC,MAAM,oBAAoB,GAAmB,YAAY,CAAC;AACjE,MAAM,CAAC,MAAM,qBAAqB,GAAmB,aAAa,CAAC;AACnE,MAAM,CAAC,MAAM,gBAAgB,GAAmB,OAAO,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Phase } from './types.js';
|
|
2
|
+
export type Phase_PrintDependencyTree = typeof phase_PrintDependencyTree;
|
|
3
|
+
export declare const phaseKey_PrintDependencyTree = "print-dependency-tree";
|
|
4
|
+
export declare const phase_PrintDependencyTree: Phase<'printDependencyTree'>;
|
|
5
|
+
export type Phase_CheckCyclicImports = typeof phase_CheckCyclicImports;
|
|
6
|
+
export declare const phaseKey_CheckCyclicImports = "check-cyclic-imports";
|
|
7
|
+
export declare const phase_CheckCyclicImports: Phase<'checkCyclicImports'>;
|
|
8
|
+
export type Phase_Purge = typeof phase_Purge;
|
|
9
|
+
export declare const phaseKey_Purge = "purge";
|
|
10
|
+
export declare const phase_Purge: Phase<'purge'>;
|
|
11
|
+
export type Phase_Prepare = typeof phase_Prepare;
|
|
12
|
+
export declare const phaseKey_Prepare = "prepare";
|
|
13
|
+
export declare const phase_Prepare: Phase<'prepare'>;
|
|
14
|
+
export type Phase_Install = typeof phase_Install;
|
|
15
|
+
export declare const phaseKey_Install = "install";
|
|
16
|
+
export declare const phase_Install: Phase<'install'>;
|
|
17
|
+
export type Phase_Lint = typeof phase_Lint;
|
|
18
|
+
export declare const phaseKey_Lint = "lint";
|
|
19
|
+
export declare const phase_Lint: Phase<'lint'>;
|
|
20
|
+
export type Phase_PreCompile = typeof phase_PreCompile;
|
|
21
|
+
export declare const phaseKey_PreCompile = "preCompile";
|
|
22
|
+
export declare const phase_PreCompile: Phase<'preCompile'>;
|
|
23
|
+
export type Phase_Compile = typeof phase_Compile;
|
|
24
|
+
export declare const phaseKey_Compile = "compile";
|
|
25
|
+
export declare const phase_Compile: Phase<'compile'>;
|
|
26
|
+
export type Phase_CompileWatch = typeof phase_CompileWatch;
|
|
27
|
+
export declare const phaseKey_CompileWatch = "watchCompile";
|
|
28
|
+
export declare const phase_CompileWatch: Phase<'watchCompile'>;
|
|
29
|
+
export type Phase_Test = typeof phase_Test;
|
|
30
|
+
export declare const phaseKey_Test = "runTests";
|
|
31
|
+
export declare const phase_Test: Phase<'runTests'>;
|
|
32
|
+
export type Phase_Watch = typeof phase_Watch;
|
|
33
|
+
export declare const phaseKey_Watch = "watch";
|
|
34
|
+
export declare const phase_Watch: Phase<'watch'>;
|
|
35
|
+
export declare const phases_Build: Phase<string>[][];
|
|
36
|
+
export type Phase_Launch = typeof phase_Launch;
|
|
37
|
+
export declare const phaseKey_Launch = "launch";
|
|
38
|
+
export declare const phase_Launch: Phase<'launch'>;
|
|
39
|
+
export declare const phases_Launch: Phase<string>[][];
|
|
40
|
+
export type Phase_PublishDryRun = typeof phase_PublishDryRun;
|
|
41
|
+
export declare const phaseKey_PublishDryRun = "publishDryRun";
|
|
42
|
+
export declare const phase_PublishDryRun: Phase<'publishDryRun'>;
|
|
43
|
+
export type Phase_Publish = typeof phase_Publish;
|
|
44
|
+
export declare const phaseKey_Publish = "publish";
|
|
45
|
+
export declare const phase_Publish: Phase<'publish'>;
|
|
46
|
+
export type Phase_PostPublish = typeof phase_PostPublish;
|
|
47
|
+
export declare const phaseKey_PostPublish = "postPublish";
|
|
48
|
+
export declare const phase_PostPublish: Phase<'postPublish'>;
|
|
49
|
+
export type Phase_Deploy = typeof phase_Deploy;
|
|
50
|
+
export declare const phaseKey_Deploy = "deploy";
|
|
51
|
+
export declare const phase_Deploy: Phase<'deploy'>;
|
|
52
|
+
export declare const phases_Deploy: Phase<string>[][];
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
export const phaseKey_PrintDependencyTree = 'print-dependency-tree';
|
|
2
|
+
export const phase_PrintDependencyTree = {
|
|
3
|
+
key: phaseKey_PrintDependencyTree,
|
|
4
|
+
name: 'Print Dependency Tree',
|
|
5
|
+
method: 'printDependencyTree',
|
|
6
|
+
filter: (baiParams) => baiParams.dependencyTree,
|
|
7
|
+
terminateAfterPhase: true,
|
|
8
|
+
};
|
|
9
|
+
export const phaseKey_CheckCyclicImports = 'check-cyclic-imports';
|
|
10
|
+
export const phase_CheckCyclicImports = {
|
|
11
|
+
key: phaseKey_CheckCyclicImports,
|
|
12
|
+
name: 'Check Cyclic Imports',
|
|
13
|
+
method: 'checkCyclicImports',
|
|
14
|
+
filter: (baiParams) => baiParams.checkCyclicImports,
|
|
15
|
+
terminateAfterPhase: true,
|
|
16
|
+
};
|
|
17
|
+
export const phaseKey_Purge = 'purge';
|
|
18
|
+
export const phase_Purge = {
|
|
19
|
+
key: phaseKey_Purge,
|
|
20
|
+
name: 'Purge',
|
|
21
|
+
method: 'purge',
|
|
22
|
+
filter: (baiParams) => baiParams.purge,
|
|
23
|
+
};
|
|
24
|
+
export const phaseKey_Prepare = 'prepare';
|
|
25
|
+
export const phase_Prepare = {
|
|
26
|
+
key: phaseKey_Prepare,
|
|
27
|
+
name: 'Prepare',
|
|
28
|
+
method: 'prepare',
|
|
29
|
+
filter: (baiParams) => baiParams.prepare,
|
|
30
|
+
};
|
|
31
|
+
export const phaseKey_Install = 'install';
|
|
32
|
+
export const phase_Install = {
|
|
33
|
+
key: phaseKey_Install,
|
|
34
|
+
name: 'Install',
|
|
35
|
+
method: 'install',
|
|
36
|
+
filter: (baiParams) => baiParams.install,
|
|
37
|
+
dependencyPhase: [phase_Prepare]
|
|
38
|
+
};
|
|
39
|
+
export const phaseKey_Lint = 'lint';
|
|
40
|
+
export const phase_Lint = {
|
|
41
|
+
key: phaseKey_Lint,
|
|
42
|
+
name: 'Lint',
|
|
43
|
+
method: 'lint',
|
|
44
|
+
filter: (baiParams) => baiParams.lint,
|
|
45
|
+
};
|
|
46
|
+
export const phaseKey_PreCompile = 'preCompile';
|
|
47
|
+
export const phase_PreCompile = {
|
|
48
|
+
key: phaseKey_PreCompile,
|
|
49
|
+
name: 'PreCompile',
|
|
50
|
+
method: 'preCompile',
|
|
51
|
+
filter: (baiParams) => !baiParams.noBuild,
|
|
52
|
+
};
|
|
53
|
+
export const phaseKey_Compile = 'compile';
|
|
54
|
+
export const phase_Compile = {
|
|
55
|
+
key: phaseKey_Compile,
|
|
56
|
+
name: 'Compile',
|
|
57
|
+
method: 'compile',
|
|
58
|
+
filter: (baiParams) => !baiParams.noBuild,
|
|
59
|
+
dependencyPhase: [phase_PreCompile],
|
|
60
|
+
};
|
|
61
|
+
export const phaseKey_CompileWatch = 'watchCompile';
|
|
62
|
+
export const phase_CompileWatch = {
|
|
63
|
+
key: phaseKey_CompileWatch,
|
|
64
|
+
name: 'CompileWatch',
|
|
65
|
+
method: 'watchCompile',
|
|
66
|
+
filter: (baiParams) => !baiParams.noBuild,
|
|
67
|
+
};
|
|
68
|
+
export const phaseKey_Test = 'runTests';
|
|
69
|
+
export const phase_Test = {
|
|
70
|
+
key: phaseKey_Test,
|
|
71
|
+
name: 'Test',
|
|
72
|
+
method: 'runTests',
|
|
73
|
+
filter: (baiParams) => baiParams.test,
|
|
74
|
+
};
|
|
75
|
+
export const phaseKey_Watch = 'watch';
|
|
76
|
+
export const phase_Watch = {
|
|
77
|
+
key: phaseKey_Watch,
|
|
78
|
+
name: 'Watch',
|
|
79
|
+
method: 'watch',
|
|
80
|
+
filter: (baiParams) => baiParams.watch,
|
|
81
|
+
};
|
|
82
|
+
export const phases_Build = [
|
|
83
|
+
[phase_Purge, phase_Prepare],
|
|
84
|
+
[phase_Install],
|
|
85
|
+
[phase_Lint, phase_PreCompile, phase_Compile, phase_Test,],
|
|
86
|
+
[phase_Watch]
|
|
87
|
+
];
|
|
88
|
+
export const phaseKey_Launch = 'launch';
|
|
89
|
+
export const phase_Launch = {
|
|
90
|
+
key: phaseKey_Launch,
|
|
91
|
+
name: 'Launch',
|
|
92
|
+
method: 'launch',
|
|
93
|
+
filter: (baiParams) => !!baiParams.launch,
|
|
94
|
+
};
|
|
95
|
+
export const phases_Launch = [[
|
|
96
|
+
phase_Launch,
|
|
97
|
+
]];
|
|
98
|
+
export const phaseKey_PublishDryRun = 'publishDryRun';
|
|
99
|
+
export const phase_PublishDryRun = {
|
|
100
|
+
key: phaseKey_PublishDryRun,
|
|
101
|
+
name: 'PublishDryRun',
|
|
102
|
+
method: 'publishDryRun',
|
|
103
|
+
filter: (baiParams) => baiParams.publishDryRun,
|
|
104
|
+
};
|
|
105
|
+
export const phaseKey_Publish = 'publish';
|
|
106
|
+
export const phase_Publish = {
|
|
107
|
+
key: phaseKey_Publish,
|
|
108
|
+
name: 'Publish',
|
|
109
|
+
method: 'publish',
|
|
110
|
+
filter: (baiParams) => !!baiParams.publish,
|
|
111
|
+
};
|
|
112
|
+
export const phaseKey_PostPublish = 'postPublish';
|
|
113
|
+
export const phase_PostPublish = {
|
|
114
|
+
key: phaseKey_PostPublish,
|
|
115
|
+
name: 'PostPublish',
|
|
116
|
+
method: 'postPublish',
|
|
117
|
+
filter: (baiParams) => !!baiParams.publish,
|
|
118
|
+
};
|
|
119
|
+
export const phaseKey_Deploy = 'deploy';
|
|
120
|
+
export const phase_Deploy = {
|
|
121
|
+
key: phaseKey_Deploy,
|
|
122
|
+
name: 'Deploy',
|
|
123
|
+
method: 'deploy',
|
|
124
|
+
filter: (baiParams) => !!baiParams.deploy,
|
|
125
|
+
};
|
|
126
|
+
export const phases_Deploy = [[phase_PublishDryRun, phase_Publish, phase_Deploy], [phase_PostPublish]];
|
|
127
|
+
//# 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":["v3/phase/consts.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,4BAA4B,GAAG,uBAAuB,CAAC;AACpE,MAAM,CAAC,MAAM,yBAAyB,GAAiC;IACtE,GAAG,EAAE,4BAA4B;IACjC,IAAI,EAAE,uBAAuB;IAC7B,MAAM,EAAE,qBAAqB;IAC7B,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,cAAc;IAC/C,mBAAmB,EAAE,IAAI;CACzB,CAAC;AAGF,MAAM,CAAC,MAAM,2BAA2B,GAAG,sBAAsB,CAAC;AAClE,MAAM,CAAC,MAAM,wBAAwB,GAAgC;IACpE,GAAG,EAAE,2BAA2B;IAChC,IAAI,EAAE,sBAAsB;IAC5B,MAAM,EAAE,oBAAoB;IAC5B,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,kBAAkB;IACnD,mBAAmB,EAAE,IAAI;CACzB,CAAC;AAWF,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC;AACtC,MAAM,CAAC,MAAM,WAAW,GAAmB;IAC1C,GAAG,EAAE,cAAc;IACnB,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,CAAC,SAAS,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iB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/build-and-install/src/main/","sources":["v3/phase/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaiParams } from '../../core/params/params.js';
|
|
2
|
+
export type Phase<PhaseMethod extends string> = {
|
|
3
|
+
key: string;
|
|
4
|
+
name: string;
|
|
5
|
+
method: PhaseMethod;
|
|
6
|
+
filter?: (params: BaiParams) => boolean;
|
|
7
|
+
terminateAfterPhase?: boolean;
|
|
8
|
+
dependencyPhase?: Phase<string>[];
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/build-and-install/src/main/","sources":["v3/phase/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { AsyncVoidFunction, Constructor, LogClient_MemBuffer, Logger, LogLevel } from '@nu-art/ts-common';
|
|
2
|
+
import { CommandoInteractive } from '@nu-art/commando/shell/index';
|
|
3
|
+
import { BaseCommando } from '@nu-art/commando/shell/core/BaseCommando';
|
|
4
|
+
import { MergeTypes } from '@nu-art/commando/shell/core/class-merger';
|
|
5
|
+
import { Commando_Basic } from '@nu-art/commando/shell/plugins/basic';
|
|
6
|
+
import { BAI_Config } from '../../core/types/index.js';
|
|
7
|
+
import { UnitsDependencyMapper } from '../UnitsDependencyMapper/UnitsDependencyMapper.js';
|
|
8
|
+
import { BaiParams } from '../../core/params/params.js';
|
|
9
|
+
export type BaseUnit_Config = {
|
|
10
|
+
key: string;
|
|
11
|
+
label: string;
|
|
12
|
+
isTopLevelApp?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type UnitRuntimeContext = {
|
|
15
|
+
version: string;
|
|
16
|
+
baiConfig: Readonly<BAI_Config>;
|
|
17
|
+
unitsMapper: UnitsDependencyMapper;
|
|
18
|
+
unitsResolver: <Class extends BaseUnit>(keys: string[], className: Constructor<Class>) => Class[];
|
|
19
|
+
runtimeParams: BaiParams;
|
|
20
|
+
globalOutputFolder: string;
|
|
21
|
+
};
|
|
22
|
+
export declare abstract class BaseUnit<C extends BaseUnit_Config = BaseUnit_Config, RT_Context extends UnitRuntimeContext = UnitRuntimeContext> extends Logger {
|
|
23
|
+
readonly config: Readonly<C>;
|
|
24
|
+
private unitStatus;
|
|
25
|
+
protected logger: LogClient_MemBuffer;
|
|
26
|
+
private readonly classStack;
|
|
27
|
+
private processTerminator;
|
|
28
|
+
private timeCounter?;
|
|
29
|
+
protected runtimeContext: RT_Context;
|
|
30
|
+
protected constructor(config: C);
|
|
31
|
+
setupRuntimeContext(runtimeContext: RT_Context): void;
|
|
32
|
+
registerTerminatable(terminatable: AsyncVoidFunction): void;
|
|
33
|
+
unregisterTerminatable(terminatable: AsyncVoidFunction): void;
|
|
34
|
+
allocateCommando<T extends Constructor<any>[]>(...plugins: T): MergeTypes<[...T]> & CommandoInteractive & BaseCommando & Commando_Basic;
|
|
35
|
+
executeAsyncCommando<T>(commando: CommandoInteractive, command: string, callback?: (stdout: string, stderr: string, exitCode: number) => T): Promise<T>;
|
|
36
|
+
executeCommando<T>(commando: CommandoInteractive, action: (commando: CommandoInteractive) => Promise<T>): Promise<T>;
|
|
37
|
+
private initLogClient;
|
|
38
|
+
protected setErrorStatus(status: string, error: Error): void;
|
|
39
|
+
protected setStatus(status: string, type?: 'start' | 'end', logLevel?: LogLevel): void;
|
|
40
|
+
protected addToClassStack: (cls: Function) => void;
|
|
41
|
+
isInstanceOf: (cls: Function) => boolean;
|
|
42
|
+
isInstanceType: (cls: Function) => boolean;
|
|
43
|
+
getStatus(): string;
|
|
44
|
+
kill(): Promise<void>;
|
|
45
|
+
getLogs(): string;
|
|
46
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { _logger_finalDate, _logger_getPrefix, _logger_timezoneOffset, BeLogged, exists, lastElement, LogClient_MemBuffer, Logger, LogLevel, removeItemFromArray, timeCounter } from '@nu-art/ts-common';
|
|
2
|
+
import { dispatcher_UnitStatusChange } from '../../old/PhaseRunnerDispatcher.js';
|
|
3
|
+
import { CommandoPool } from '@nu-art/commando/shell/core/CommandoPool';
|
|
4
|
+
export class BaseUnit extends Logger {
|
|
5
|
+
config;
|
|
6
|
+
unitStatus = 'Pending Initialization';
|
|
7
|
+
logger;
|
|
8
|
+
classStack = [];
|
|
9
|
+
processTerminator = [];
|
|
10
|
+
timeCounter;
|
|
11
|
+
runtimeContext;
|
|
12
|
+
constructor(config) {
|
|
13
|
+
super(config.key);
|
|
14
|
+
this.config = Object.freeze(config);
|
|
15
|
+
this.addToClassStack(BaseUnit);
|
|
16
|
+
this.initLogClient();
|
|
17
|
+
}
|
|
18
|
+
setupRuntimeContext(runtimeContext) {
|
|
19
|
+
this.runtimeContext = runtimeContext;
|
|
20
|
+
}
|
|
21
|
+
registerTerminatable(terminatable) {
|
|
22
|
+
this.processTerminator.push(terminatable);
|
|
23
|
+
}
|
|
24
|
+
unregisterTerminatable(terminatable) {
|
|
25
|
+
removeItemFromArray(this.processTerminator, terminatable);
|
|
26
|
+
}
|
|
27
|
+
allocateCommando(...plugins) {
|
|
28
|
+
return CommandoPool.allocateCommando(this.config.key, ...plugins);
|
|
29
|
+
}
|
|
30
|
+
async executeAsyncCommando(commando, command, callback) {
|
|
31
|
+
let pid;
|
|
32
|
+
const terminatable = () => commando.killSubprocess(pid);
|
|
33
|
+
try {
|
|
34
|
+
this.registerTerminatable(terminatable);
|
|
35
|
+
return await commando
|
|
36
|
+
.appendAsync(command, _pid => pid = _pid)
|
|
37
|
+
.execute(callback);
|
|
38
|
+
}
|
|
39
|
+
finally {
|
|
40
|
+
this.unregisterTerminatable(terminatable);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
async executeCommando(commando, action) {
|
|
44
|
+
const terminatable = () => {
|
|
45
|
+
this.logError('KILLLLLLING');
|
|
46
|
+
return commando.kill();
|
|
47
|
+
};
|
|
48
|
+
try {
|
|
49
|
+
this.registerTerminatable(terminatable);
|
|
50
|
+
return action(commando);
|
|
51
|
+
}
|
|
52
|
+
finally {
|
|
53
|
+
this.unregisterTerminatable(terminatable);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//######################### Internal Logic #########################
|
|
57
|
+
initLogClient() {
|
|
58
|
+
this.logger = new LogClient_MemBuffer(this.tag);
|
|
59
|
+
this.logger.keepLogsNaturalColors();
|
|
60
|
+
this.logger.setComposer((tag, level) => {
|
|
61
|
+
_logger_finalDate.setTime(Date.now() - _logger_timezoneOffset);
|
|
62
|
+
const date = _logger_finalDate.toISOString().replace(/T/, '_').replace(/Z/, '').substring(0, 23).split('_')[1];
|
|
63
|
+
return `${date} ${_logger_getPrefix(level)}: `;
|
|
64
|
+
});
|
|
65
|
+
this.logger.setFilter((level, tag) => {
|
|
66
|
+
return tag === this.tag;
|
|
67
|
+
});
|
|
68
|
+
BeLogged.addClient(this.logger);
|
|
69
|
+
}
|
|
70
|
+
setErrorStatus(status, error) {
|
|
71
|
+
this.setStatus(status, 'end', LogLevel.Error);
|
|
72
|
+
this.logError(error);
|
|
73
|
+
}
|
|
74
|
+
setStatus(status, type, logLevel = LogLevel.Info) {
|
|
75
|
+
let operationDuration = '';
|
|
76
|
+
if (type === 'start')
|
|
77
|
+
this.timeCounter = timeCounter();
|
|
78
|
+
if (type === 'end')
|
|
79
|
+
if (!exists(this.timeCounter))
|
|
80
|
+
this.logError(`Got end status: '${status}' - while current status '${this.unitStatus}' was not a start`);
|
|
81
|
+
else {
|
|
82
|
+
const s = this.timeCounter.format('mm:ss');
|
|
83
|
+
if (s !== '00:00')
|
|
84
|
+
operationDuration = ` (${s})`;
|
|
85
|
+
delete this.timeCounter;
|
|
86
|
+
}
|
|
87
|
+
this.log(logLevel, false, [`Unit status update: ${this.unitStatus} => ${status}${operationDuration}`]);
|
|
88
|
+
this.unitStatus = `${status}${operationDuration}`;
|
|
89
|
+
dispatcher_UnitStatusChange.dispatch(this);
|
|
90
|
+
}
|
|
91
|
+
addToClassStack = (cls) => {
|
|
92
|
+
this.classStack.push(cls.name);
|
|
93
|
+
};
|
|
94
|
+
isInstanceOf = (cls) => {
|
|
95
|
+
return this.classStack.includes(cls.name);
|
|
96
|
+
};
|
|
97
|
+
isInstanceType = (cls) => {
|
|
98
|
+
return lastElement(this.classStack) === cls.name;
|
|
99
|
+
};
|
|
100
|
+
getStatus() {
|
|
101
|
+
return this.unitStatus;
|
|
102
|
+
}
|
|
103
|
+
async kill() {
|
|
104
|
+
if (!this.processTerminator.length)
|
|
105
|
+
return this.setStatus('Killed');
|
|
106
|
+
const processTerminator = [...this.processTerminator];
|
|
107
|
+
this.processTerminator.length = 0;
|
|
108
|
+
this.setStatus('Killing');
|
|
109
|
+
try {
|
|
110
|
+
await Promise.all(processTerminator.map(toTerminate => toTerminate()));
|
|
111
|
+
}
|
|
112
|
+
finally {
|
|
113
|
+
this.setStatus('Killed');
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
getLogs() {
|
|
117
|
+
return this.logger.buffers[0];
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=BaseUnit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseUnit.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/build-and-install/src/main/","sources":["v3/units/BaseUnit.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EAEtB,QAAQ,EAER,MAAM,EACN,WAAW,EACX,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,mBAAmB,EAEnB,WAAW,EACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAC,2BAA2B,EAAC,M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ts-common';
|
|
2
|
+
import { BaseUnit, BaseUnit_Config, UnitRuntimeContext } from './BaseUnit.js';
|
|
3
|
+
export type Config_ProjectUnit = BaseUnit_Config & {
|
|
4
|
+
relativePath: string;
|
|
5
|
+
fullPath: string;
|
|
6
|
+
dependencies: StringMap;
|
|
7
|
+
};
|
|
8
|
+
export type ProjectUnit_RuntimeContext = UnitRuntimeContext & {
|
|
9
|
+
parentUnit: ProjectUnit<any>;
|
|
10
|
+
childUnits: ProjectUnit[];
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Abstract class representing a Unit within a Project.
|
|
14
|
+
* Extends the BaseUnit to provide additional project-specific preparation logic.
|
|
15
|
+
*/
|
|
16
|
+
export declare abstract class ProjectUnit<C extends Config_ProjectUnit = Config_ProjectUnit> extends BaseUnit<C, ProjectUnit_RuntimeContext> {
|
|
17
|
+
constructor(config: C);
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseUnit } from './BaseUnit.js';
|
|
2
|
+
/**
|
|
3
|
+
* Abstract class representing a Unit within a Project.
|
|
4
|
+
* Extends the BaseUnit to provide additional project-specific preparation logic.
|
|
5
|
+
*/
|
|
6
|
+
export class ProjectUnit extends BaseUnit {
|
|
7
|
+
constructor(config) {
|
|
8
|
+
super(config);
|
|
9
|
+
this.addToClassStack(ProjectUnit);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=ProjectUnit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProjectUnit.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/build-and-install/src/main/","sources":["v3/units/ProjectUnit.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAsC,MAAM,eAAe,CAAC;AAc5E;;;GAGG;AACH,MAAM,OAAgB,WACrB,SAAQ,QAAuC;IAE/C,YAAY,MAAS;QACpB,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC;CACD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { UnitPhaseImplementor } from '../core/types.js';
|
|
2
|
+
import { StringMap } from '@nu-art/ts-common/utils/types';
|
|
3
|
+
import { Unit_PackageJson, Unit_PackageJson_Config } from './Unit_PackageJson.js';
|
|
4
|
+
import { ProjectUnit } from './ProjectUnit.js';
|
|
5
|
+
import { Phase_Install, Phase_PostPublish, Phase_Watch } from '../phase/index.js';
|
|
6
|
+
type Unit_TypescriptProject_Config = Unit_PackageJson_Config & {
|
|
7
|
+
globalPackages?: StringMap;
|
|
8
|
+
isRoot: true;
|
|
9
|
+
};
|
|
10
|
+
export declare class Unit_NodeProject<C extends Unit_TypescriptProject_Config = Unit_TypescriptProject_Config> extends Unit_PackageJson<C> implements UnitPhaseImplementor<[Phase_Install, Phase_Watch, Phase_PostPublish]> {
|
|
11
|
+
private watcher?;
|
|
12
|
+
readonly innerUnits: Unit_PackageJson[];
|
|
13
|
+
private readonly suffixesToWatch;
|
|
14
|
+
constructor(config: Unit_NodeProject<C>['config']);
|
|
15
|
+
protected deriveDistDependencies(): {
|
|
16
|
+
[s: string]: string;
|
|
17
|
+
};
|
|
18
|
+
assignUnit(units: ProjectUnit[]): void;
|
|
19
|
+
/**
|
|
20
|
+
* Resolve all paths to watch in all project libs
|
|
21
|
+
* @private
|
|
22
|
+
* @returns string[]
|
|
23
|
+
*/
|
|
24
|
+
private prepareWatchPaths;
|
|
25
|
+
stopWatch(): Promise<void | undefined>;
|
|
26
|
+
private findUnit;
|
|
27
|
+
install(): Promise<void>;
|
|
28
|
+
watch(timeout?: number, maxTimeout?: number): Promise<void>;
|
|
29
|
+
purge(): Promise<void>;
|
|
30
|
+
postPublish(): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
export {};
|