@nu-art/build-and-install 0.204.67 → 0.204.68
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.js +11 -26
- package/core/package/generate.js +5 -3
- package/core/params/params.d.ts +3 -2
- package/core/params/params.js +16 -4
- package/defaults/consts.d.ts +11 -23
- package/defaults/consts.js +7 -7
- package/package.json +1 -1
- package/phases/phases.js +7 -3
- package/screen/ProjectScreen.js +0 -1
- package/v2/phase/consts.d.ts +53 -0
- package/v2/phase/consts.js +146 -0
- package/v2/phase/index.d.ts +2 -0
- package/v2/phase/index.js +18 -0
- package/v2/phase/types.d.ts +9 -0
- package/v2/phase/types.js +2 -0
- package/v2/phase-runner/PhaseRunner.d.ts +69 -13
- package/v2/phase-runner/PhaseRunner.js +392 -32
- package/v2/phase-runner/PhaseRunnerDispatcher.d.ts +25 -0
- package/v2/phase-runner/PhaseRunnerDispatcher.js +26 -0
- package/v2/phase-runner/RunnerParams.d.ts +12 -0
- package/v2/phase-runner/RunnerParams.js +9 -0
- package/v2/phase-runner/consts.d.ts +7 -0
- package/v2/phase-runner/consts.js +9 -0
- package/v2/phase-runner/types.d.ts +6 -9
- package/v2/phase-runner/types.js +4 -0
- package/v2/project/types.d.ts +8 -0
- package/v2/project/types.js +2 -0
- package/v2/screens/list-screen.d.ts +47 -0
- package/v2/screens/list-screen.js +196 -0
- package/v2/unit/core/BaseUnit.d.ts +18 -7
- package/v2/unit/core/BaseUnit.js +35 -10
- package/v2/unit/core/Unit_Python.d.ts +18 -2
- package/v2/unit/core/Unit_Python.js +30 -1
- package/v2/unit/core/Unit_Typescript.d.ts +15 -13
- package/v2/unit/core/Unit_Typescript.js +40 -36
- package/v2/unit/core/Unit_TypescriptLib.d.ts +27 -3
- package/v2/unit/core/Unit_TypescriptLib.js +98 -4
- package/v2/unit/core/Unit_TypescriptProject.d.ts +11 -2
- package/v2/unit/core/Unit_TypescriptProject.js +29 -0
- package/v2/unit/core/index.d.ts +2 -1
- package/v2/unit/core/index.js +2 -1
- package/v2/unit/firebase-units/Unit_FirebaseFunctionsApp.d.ts +40 -0
- package/v2/unit/firebase-units/Unit_FirebaseFunctionsApp.js +312 -0
- package/v2/unit/firebase-units/Unit_FirebaseHostingApp.d.ts +32 -0
- package/v2/unit/firebase-units/Unit_FirebaseHostingApp.js +159 -0
- package/v2/unit/firebase-units/index.d.ts +2 -0
- package/v2/unit/firebase-units/index.js +18 -0
- package/v2/unit/thunderstorm.d.ts +291 -0
- package/v2/unit/thunderstorm.js +199 -0
- package/v2/unit/types.d.ts +7 -0
- package/v2/unit/types.js +2 -0
- package/v2/BasePackage.d.ts +0 -4
- package/v2/BasePackage.js +0 -9
- package/v2/ProjectManagerV2.d.ts +0 -8
- package/v2/ProjectManagerV2.js +0 -23
- package/v2/test/test.d.ts +0 -14
- package/v2/test/test.js +0 -85
- package/v2/unit/core/types.d.ts +0 -13
- package/v2/unit/core/types.js +0 -23
package/build-and-install.js
CHANGED
|
@@ -1,34 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const ProjectManager_1 = require("./logic/ProjectManager");
|
|
4
3
|
const ts_common_1 = require("@nu-art/ts-common");
|
|
5
|
-
const phases_1 = require("./phases/phases");
|
|
6
4
|
const params_1 = require("./core/params/params");
|
|
5
|
+
const PhaseRunner_1 = require("./v2/phase-runner/PhaseRunner");
|
|
6
|
+
const list_screen_1 = require("./v2/screens/list-screen");
|
|
7
|
+
const thunderstorm_1 = require("./v2/unit/thunderstorm");
|
|
7
8
|
ts_common_1.DebugFlag.DefaultLogLevel = params_1.RuntimeParams.debug ? ts_common_1.LogLevel.Debug : ts_common_1.LogLevel.Info;
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
projectManager.registerPhase(phases_1.Phase_PrintDependencyTree);
|
|
17
|
-
projectManager.registerPhase(phases_1.Phase_CheckCyclicImports);
|
|
18
|
-
projectManager.registerPhase(phases_1.Phase_PrintEnv);
|
|
19
|
-
projectManager.registerPhase(phases_1.Phase_PackagePurge);
|
|
20
|
-
projectManager.registerPhase(phases_1.Phase_InstallGlobals);
|
|
21
|
-
projectManager.registerPhase(phases_1.Phase_InstallPackages);
|
|
22
|
-
projectManager.registerPhase(phases_1.Phase_InstallPythonPackages);
|
|
23
|
-
projectManager.registerPhase(phases_1.Phase_Lint);
|
|
24
|
-
projectManager.registerPhase(phases_1.Phase_PrepareCompile);
|
|
25
|
-
projectManager.registerPhase(phases_1.Phase_PreCompile);
|
|
26
|
-
projectManager.registerPhase(phases_1.Phase_Compile);
|
|
27
|
-
projectManager.registerPhase(phases_1.Phase_CompileWatch);
|
|
28
|
-
projectManager.registerPhase(phases_1.Phase_Launch);
|
|
29
|
-
projectManager.registerPhase(phases_1.Phase_DeployFrontend);
|
|
30
|
-
projectManager.registerPhase(phases_1.Phase_DeployBackend);
|
|
31
|
-
projectManager.execute()
|
|
9
|
+
const runner = new PhaseRunner_1.PhaseRunner('./.config/project-config-v2.ts');
|
|
10
|
+
const screen = new list_screen_1.BAI_ListScreen(runner.getUnits());
|
|
11
|
+
screen.setKillCB(async () => await runner.killRunner());
|
|
12
|
+
runner.setScreen(screen);
|
|
13
|
+
if (params_1.RuntimeParams.runWithThunderstorm)
|
|
14
|
+
runner.registerUnits(thunderstorm_1.allTSUnits);
|
|
15
|
+
runner
|
|
16
|
+
.execute()
|
|
32
17
|
.then(() => {
|
|
33
18
|
ts_common_1.StaticLogger.logInfo('completed');
|
|
34
19
|
})
|
package/core/package/generate.js
CHANGED
|
@@ -164,15 +164,17 @@ function getEnvConfig(pkg) {
|
|
|
164
164
|
}
|
|
165
165
|
exports.getEnvConfig = getEnvConfig;
|
|
166
166
|
async function generateProxyFile(firebasePkg, pathToFile) {
|
|
167
|
-
var _a, _b;
|
|
167
|
+
var _a, _b, _c;
|
|
168
168
|
const envConfig = getEnvConfig(firebasePkg);
|
|
169
169
|
const defaultFiles = consts_2.MemKey_DefaultFiles.get();
|
|
170
|
+
if (!((_a = defaultFiles === null || defaultFiles === void 0 ? void 0 : defaultFiles.backend) === null || _a === void 0 ? void 0 : _a.proxy))
|
|
171
|
+
return;
|
|
170
172
|
let fileContent = await fs_1.promises.readFile(defaultFiles.backend.proxy, { encoding: 'utf-8' });
|
|
171
173
|
fileContent = fileContent.replace(/PROJECT_ID/g, `${envConfig.projectId}`);
|
|
172
174
|
fileContent = fileContent.replace(/PROXY_PORT/g, `${firebasePkg.envConfig.basePort}`);
|
|
173
175
|
fileContent = fileContent.replace(/SERVER_PORT/g, `${firebasePkg.envConfig.basePort + 1}`);
|
|
174
|
-
fileContent = fileContent.replace(/PATH_TO_SSL_KEY/g, `${(
|
|
175
|
-
fileContent = fileContent.replace(/PATH_TO_SSL_CERTIFICATE/g, `${(
|
|
176
|
+
fileContent = fileContent.replace(/PATH_TO_SSL_KEY/g, `${(_b = firebasePkg.envConfig.ssl) === null || _b === void 0 ? void 0 : _b.pathToKey}`);
|
|
177
|
+
fileContent = fileContent.replace(/PATH_TO_SSL_CERTIFICATE/g, `${(_c = firebasePkg.envConfig.ssl) === null || _c === void 0 ? void 0 : _c.pathToCertificate}`);
|
|
176
178
|
await fs_1.promises.writeFile(pathToFile, fileContent, { encoding: 'utf-8' });
|
|
177
179
|
}
|
|
178
180
|
exports.generateProxyFile = generateProxyFile;
|
package/core/params/params.d.ts
CHANGED
|
@@ -35,5 +35,6 @@ export declare const BaiParam_Publish: BaseCliParam<'publish', string>;
|
|
|
35
35
|
export declare const BaiParam_AllLogs: BaseCliParam<'allLogs', boolean>;
|
|
36
36
|
export declare const BaiParam_EncounterManager: BaseCliParam<'encounterManager', boolean>;
|
|
37
37
|
export declare const BaiParam_EncounterManagerListen: BaseCliParam<'encounterManagerListen', boolean>;
|
|
38
|
-
export declare const
|
|
39
|
-
export declare const
|
|
38
|
+
export declare const BaiParam_UsePackage: BaseCliParam<'usePackage', string[]>;
|
|
39
|
+
export declare const AllBaiParams: (BaseCliParam<"help", boolean> | BaseCliParam<"dependencyTree", boolean> | BaseCliParam<"checkCyclicImports", boolean> | BaseCliParam<"printEnv", boolean> | BaseCliParam<"continue", boolean> | BaseCliParam<"environment", string> | BaseCliParam<"setup", boolean> | BaseCliParam<"install", boolean> | BaseCliParam<"installPackages", boolean> | BaseCliParam<"installGlobals", boolean> | BaseCliParam<"clean", boolean> | BaseCliParam<"purge", boolean> | BaseCliParam<"generate", boolean> | BaseCliParam<"generateDocs", boolean> | BaseCliParam<"noBuild", boolean> | BaseCliParam<"dryRun", boolean> | BaseCliParam<"runWithThunderstorm", boolean> | BaseCliParam<"withCommando", boolean> | BaseCliParam<"noThunderstorm", boolean> | BaseCliParam<"lint", boolean> | BaseCliParam<"watch", boolean> | BaseCliParam<"test", string> | BaseCliParam<"launch", string> | BaseCliParam<"launchFrontend", boolean> | BaseCliParam<"launchBackend", boolean> | BaseCliParam<"debugBackend", boolean> | BaseCliParam<"deploy", string> | BaseCliParam<"deployBackend", boolean> | BaseCliParam<"deployFrontend", boolean> | BaseCliParam<"noGit", boolean> | BaseCliParam<"debug", boolean> | BaseCliParam<"publish", string> | BaseCliParam<"allLogs", boolean> | BaseCliParam<"encounterManager", boolean> | BaseCliParam<"encounterManagerListen", boolean> | BaseCliParam<"usePackage", string[]>)[];
|
|
40
|
+
export declare const RuntimeParams: import("@nu-art/commando/cli/cli-params").CliParams<(BaseCliParam<"help", boolean> | BaseCliParam<"dependencyTree", boolean> | BaseCliParam<"checkCyclicImports", boolean> | BaseCliParam<"printEnv", boolean> | BaseCliParam<"continue", boolean> | BaseCliParam<"environment", string> | BaseCliParam<"setup", boolean> | BaseCliParam<"install", boolean> | BaseCliParam<"installPackages", boolean> | BaseCliParam<"installGlobals", boolean> | BaseCliParam<"clean", boolean> | BaseCliParam<"purge", boolean> | BaseCliParam<"generate", boolean> | BaseCliParam<"generateDocs", boolean> | BaseCliParam<"noBuild", boolean> | BaseCliParam<"dryRun", boolean> | BaseCliParam<"runWithThunderstorm", boolean> | BaseCliParam<"withCommando", boolean> | BaseCliParam<"noThunderstorm", boolean> | BaseCliParam<"lint", boolean> | BaseCliParam<"watch", boolean> | BaseCliParam<"test", string> | BaseCliParam<"launch", string> | BaseCliParam<"launchFrontend", boolean> | BaseCliParam<"launchBackend", boolean> | BaseCliParam<"debugBackend", boolean> | BaseCliParam<"deploy", string> | BaseCliParam<"deployBackend", boolean> | BaseCliParam<"deployFrontend", boolean> | BaseCliParam<"noGit", boolean> | BaseCliParam<"debug", boolean> | BaseCliParam<"publish", string> | BaseCliParam<"allLogs", boolean> | BaseCliParam<"encounterManager", boolean> | BaseCliParam<"encounterManagerListen", boolean> | BaseCliParam<"usePackage", string[]>)[]>;
|
package/core/params/params.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RuntimeParams = exports.AllBaiParams = exports.BaiParam_EncounterManagerListen = exports.BaiParam_EncounterManager = exports.BaiParam_AllLogs = exports.BaiParam_Publish = exports.BaiParam_QuickDeploy = exports.BaiParam_Debug = exports.BaiParam_NoGit = exports.BaiParam_DeployFrontend = exports.BaiParam_DeployBackend = exports.BaiParam_Deploy = exports.BaiParam_DebugBackend = exports.BaiParam_LaunchBackend = exports.BaiParam_LaunchFrontend = exports.BaiParam_Launch = exports.BaiParam_Test = exports.BaiParam_Watch = exports.BaiParam_Lint = exports.BaiParam_NoThunderstorm = exports.BaiParam_WithCommando = exports.BaiParam_RunWithThunderstorm = exports.BaiParam_DryRun = exports.BaiParam_NoBuild = exports.BaiParam_GenerateDocs = exports.BaiParam_Generate = exports.BaiParam_Purge = exports.BaiParam_Clean = exports.BaiParam_InstallGlobals = exports.BaiParam_InstallPackages = exports.BaiParam_Install = exports.BaiParam_Setup = exports.BaiParam_SetEnv = exports.BaiParam_continue = exports.BaiParam_PrintEnv = exports.BaiParam_CheckCyclicImports = exports.BaiParam_DependencyTree = exports.BaiParam_Help = void 0;
|
|
3
|
+
exports.RuntimeParams = exports.AllBaiParams = exports.BaiParam_UsePackage = exports.BaiParam_EncounterManagerListen = exports.BaiParam_EncounterManager = exports.BaiParam_AllLogs = exports.BaiParam_Publish = exports.BaiParam_QuickDeploy = exports.BaiParam_Debug = exports.BaiParam_NoGit = exports.BaiParam_DeployFrontend = exports.BaiParam_DeployBackend = exports.BaiParam_Deploy = exports.BaiParam_DebugBackend = exports.BaiParam_LaunchBackend = exports.BaiParam_LaunchFrontend = exports.BaiParam_Launch = exports.BaiParam_Test = exports.BaiParam_Watch = exports.BaiParam_Lint = exports.BaiParam_NoThunderstorm = exports.BaiParam_WithCommando = exports.BaiParam_RunWithThunderstorm = exports.BaiParam_DryRun = exports.BaiParam_NoBuild = exports.BaiParam_GenerateDocs = exports.BaiParam_Generate = exports.BaiParam_Purge = exports.BaiParam_Clean = exports.BaiParam_InstallGlobals = exports.BaiParam_InstallPackages = exports.BaiParam_Install = exports.BaiParam_Setup = exports.BaiParam_SetEnv = exports.BaiParam_continue = exports.BaiParam_PrintEnv = exports.BaiParam_CheckCyclicImports = exports.BaiParam_DependencyTree = exports.BaiParam_Help = void 0;
|
|
4
4
|
const cli_params_1 = require("@nu-art/commando/cli/cli-params");
|
|
5
5
|
exports.BaiParam_Help = {
|
|
6
6
|
keys: ['--help', '-h'],
|
|
@@ -46,11 +46,11 @@ exports.BaiParam_SetEnv = {
|
|
|
46
46
|
description: 'Will set the .config-${environment}.json as the current .config.json and prepare it as base 64 for local usage \ninput required: envName(string)'
|
|
47
47
|
};
|
|
48
48
|
exports.BaiParam_Setup = {
|
|
49
|
-
keys: ['--setup'
|
|
49
|
+
keys: ['--setup'],
|
|
50
50
|
keyName: 'setup',
|
|
51
51
|
type: 'boolean',
|
|
52
52
|
group: 'Build',
|
|
53
|
-
description: '
|
|
53
|
+
description: 'Setup local project for developer'
|
|
54
54
|
};
|
|
55
55
|
exports.BaiParam_Install = {
|
|
56
56
|
keys: ['--install', '-i'],
|
|
@@ -260,6 +260,18 @@ exports.BaiParam_EncounterManagerListen = {
|
|
|
260
260
|
group: 'Other',
|
|
261
261
|
description: 'Will install encounter manager shit and launch after advisor and km',
|
|
262
262
|
};
|
|
263
|
+
exports.BaiParam_UsePackage = {
|
|
264
|
+
keys: ['-up', '--use-packages'],
|
|
265
|
+
keyName: 'usePackage',
|
|
266
|
+
type: 'string[]',
|
|
267
|
+
group: 'Other',
|
|
268
|
+
description: 'Will specify units to process',
|
|
269
|
+
process: (value) => {
|
|
270
|
+
if (!value)
|
|
271
|
+
return [];
|
|
272
|
+
return value.split(',').map(str => str.trim());
|
|
273
|
+
}
|
|
274
|
+
};
|
|
263
275
|
exports.AllBaiParams = [
|
|
264
276
|
exports.BaiParam_Help,
|
|
265
277
|
exports.BaiParam_DependencyTree,
|
|
@@ -295,7 +307,7 @@ exports.AllBaiParams = [
|
|
|
295
307
|
exports.BaiParam_Publish,
|
|
296
308
|
exports.BaiParam_AllLogs,
|
|
297
309
|
exports.BaiParam_EncounterManager,
|
|
298
|
-
exports.BaiParam_EncounterManagerListen
|
|
310
|
+
exports.BaiParam_EncounterManagerListen, exports.BaiParam_UsePackage
|
|
299
311
|
];
|
|
300
312
|
const params = cli_params_1.CLIParams_Resolver.create(...exports.AllBaiParams).resolveParamValue();
|
|
301
313
|
exports.RuntimeParams = params;
|
package/defaults/consts.d.ts
CHANGED
|
@@ -1,35 +1,23 @@
|
|
|
1
1
|
import { MemKey } from '@nu-art/ts-common/mem-storage/MemStorage';
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
firebaseConfig: {
|
|
7
|
-
databaseRules: string;
|
|
8
|
-
firestoreIndexesRules: string;
|
|
9
|
-
firestoreRules: string;
|
|
10
|
-
storageRules: string;
|
|
2
|
+
export declare const Const_FirebaseConfigKeys: readonly ["databaseRules", "firestoreIndexesRules", "firestoreRules", "storageRules"];
|
|
3
|
+
export type ProjectConfig_DefaultFileRoutes = {
|
|
4
|
+
firebaseConfig?: {
|
|
5
|
+
[k in typeof Const_FirebaseConfigKeys[number]]?: string;
|
|
11
6
|
};
|
|
12
|
-
backend
|
|
13
|
-
proxy
|
|
7
|
+
backend?: {
|
|
8
|
+
proxy?: string;
|
|
14
9
|
};
|
|
15
10
|
};
|
|
16
|
-
export declare const
|
|
11
|
+
export declare const Const_FirebaseDefaultsKeyToFile: {
|
|
12
|
+
[k in typeof Const_FirebaseConfigKeys[number]]: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const Default_Files: ProjectConfig_DefaultFileRoutes;
|
|
17
15
|
export declare const Default_OutputFiles: {
|
|
18
16
|
output: string;
|
|
19
17
|
outputLogs: string;
|
|
20
18
|
runningStatus: string;
|
|
21
19
|
};
|
|
22
|
-
export declare const MemKey_DefaultFiles: MemKey<
|
|
23
|
-
firebaseConfig: {
|
|
24
|
-
databaseRules: string;
|
|
25
|
-
firestoreIndexesRules: string;
|
|
26
|
-
firestoreRules: string;
|
|
27
|
-
storageRules: string;
|
|
28
|
-
};
|
|
29
|
-
backend: {
|
|
30
|
-
proxy: string;
|
|
31
|
-
};
|
|
32
|
-
}>;
|
|
20
|
+
export declare const MemKey_DefaultFiles: MemKey<ProjectConfig_DefaultFileRoutes>;
|
|
33
21
|
export type RunningStatus = {
|
|
34
22
|
phaseKey: string;
|
|
35
23
|
packageDependencyIndex?: number;
|
package/defaults/consts.js
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MemKey_RunningStatus = exports.MemKey_DefaultFiles = exports.Default_OutputFiles = exports.
|
|
3
|
+
exports.MemKey_RunningStatus = exports.MemKey_DefaultFiles = exports.Default_OutputFiles = exports.Default_Files = exports.Const_FirebaseDefaultsKeyToFile = exports.Const_FirebaseConfigKeys = void 0;
|
|
4
4
|
const MemStorage_1 = require("@nu-art/ts-common/mem-storage/MemStorage");
|
|
5
5
|
const CONST_FirebaseConfig = `${__dirname}/.firebase_config`;
|
|
6
6
|
const CONST_BackendProxy = `${__dirname}/backend-proxy`;
|
|
7
|
+
exports.Const_FirebaseConfigKeys = [
|
|
8
|
+
'databaseRules',
|
|
9
|
+
'firestoreIndexesRules',
|
|
10
|
+
'firestoreRules',
|
|
11
|
+
'storageRules',
|
|
12
|
+
];
|
|
7
13
|
exports.Const_FirebaseDefaultsKeyToFile = {
|
|
8
14
|
databaseRules: 'database.rules.json',
|
|
9
15
|
firestoreIndexesRules: 'firestore.indexes.json',
|
|
@@ -21,12 +27,6 @@ exports.Default_Files = {
|
|
|
21
27
|
proxy: `${CONST_BackendProxy}/proxy._ts`
|
|
22
28
|
}
|
|
23
29
|
};
|
|
24
|
-
exports.Const_FirebaseConfigKeys = [
|
|
25
|
-
'databaseRules',
|
|
26
|
-
'firestoreIndexesRules',
|
|
27
|
-
'firestoreRules',
|
|
28
|
-
'storageRules',
|
|
29
|
-
];
|
|
30
30
|
const Default_OutputPath = './.trash';
|
|
31
31
|
exports.Default_OutputFiles = {
|
|
32
32
|
output: Default_OutputPath,
|
package/package.json
CHANGED
package/phases/phases.js
CHANGED
|
@@ -193,21 +193,25 @@ exports.Phase_ResolveEnv = {
|
|
|
193
193
|
if (pkg.type === 'firebase-functions-app') {
|
|
194
194
|
const firebaseFunctionPkg = firebasePkg;
|
|
195
195
|
const pathToFirebaseConfigFolder = `${firebaseFunctionPkg.path}/${firebaseFunctionPkg.envConfig.pathToFirebaseConfig}`;
|
|
196
|
+
if (firebasePkg.envConfig.ssl)
|
|
197
|
+
await (0, generate_1.generateProxyFile)(firebasePkg, `${firebaseFunctionPkg.path}/src/main/proxy.ts`);
|
|
196
198
|
try {
|
|
197
199
|
await fs_1.promises.access(pathToFirebaseConfigFolder);
|
|
198
200
|
}
|
|
199
201
|
catch (e) {
|
|
200
202
|
await fs_1.promises.mkdir(pathToFirebaseConfigFolder, { recursive: true });
|
|
201
203
|
}
|
|
202
|
-
if (firebasePkg.envConfig.ssl)
|
|
203
|
-
await (0, generate_1.generateProxyFile)(firebasePkg, `${firebaseFunctionPkg.path}/src/main/proxy.ts`);
|
|
204
204
|
await Promise.all(consts_2.Const_FirebaseConfigKeys.map(async (firebaseConfigKey) => {
|
|
205
|
+
var _a;
|
|
205
206
|
const pathToConfigFile = `${pathToFirebaseConfigFolder}/${consts_2.Const_FirebaseDefaultsKeyToFile[firebaseConfigKey]}`;
|
|
206
207
|
try {
|
|
207
208
|
await fs_1.promises.access(pathToConfigFile);
|
|
208
209
|
}
|
|
209
210
|
catch (e) {
|
|
210
|
-
const
|
|
211
|
+
const path = (_a = defaultFiles.firebaseConfig) === null || _a === void 0 ? void 0 : _a[firebaseConfigKey];
|
|
212
|
+
if (!path)
|
|
213
|
+
return;
|
|
214
|
+
const defaultFileContent = await fs_1.promises.readFile(path, { encoding: 'utf-8' });
|
|
211
215
|
await fs_1.promises.writeFile(pathToConfigFile, defaultFileContent, { encoding: 'utf-8' });
|
|
212
216
|
}
|
|
213
217
|
}));
|
package/screen/ProjectScreen.js
CHANGED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Phase } from './types';
|
|
2
|
+
export type Phase_Help = typeof phase_Help;
|
|
3
|
+
export declare const phaseKey_Help = "help";
|
|
4
|
+
export declare const phase_Help: Phase<'printHelp'>;
|
|
5
|
+
export type Phase_PrintDependencyTree = typeof phase_PrintDependencyTree;
|
|
6
|
+
export declare const phaseKey_PrintDependencyTree = "print-dependency-tree";
|
|
7
|
+
export declare const phase_PrintDependencyTree: Phase<'printDependencyTree'>;
|
|
8
|
+
export type Phase_CheckCyclicImports = typeof phase_CheckCyclicImports;
|
|
9
|
+
export declare const phaseKey_CheckCyclicImports = "check-cyclic-imports";
|
|
10
|
+
export declare const phase_CheckCyclicImports: Phase<'checkCyclicImports'>;
|
|
11
|
+
export type Phase_PrintEnv = typeof phase_PrintEnv;
|
|
12
|
+
export declare const phaseKey_PrintEnv = "print-env";
|
|
13
|
+
export declare const phase_PrintEnv: Phase<'printEnv'>;
|
|
14
|
+
export type Phase_Debug = typeof phase_Debug;
|
|
15
|
+
export declare const phaseKey_Debug = "debug";
|
|
16
|
+
export declare const phase_Debug: Phase<'debug'>;
|
|
17
|
+
export declare const phases_Terminating: Phase<string>[];
|
|
18
|
+
export type Phase_Purge = typeof phase_Purge;
|
|
19
|
+
export declare const phaseKey_Purge = "purge";
|
|
20
|
+
export declare const phase_Purge: Phase<'purge'>;
|
|
21
|
+
export type Phase_CopyPackageJSON = typeof phase_CopyPackageJSON;
|
|
22
|
+
export declare const phaseKey_CopyPackageJSON = "copy-package-json";
|
|
23
|
+
export declare const phase_CopyPackageJSON: Phase<'copyPackageJson'>;
|
|
24
|
+
export type Phase_Install = typeof phase_Install;
|
|
25
|
+
export declare const phaseKey_Install = "install";
|
|
26
|
+
export declare const phase_Install: Phase<'install'>;
|
|
27
|
+
export type Phase_ResolveConfigs = typeof phase_ResolveConfigs;
|
|
28
|
+
export declare const phaseKey_ResolveConfigs = "resolve-configs";
|
|
29
|
+
export declare const phase_ResolveConfigs: Phase<'resolveConfigs'>;
|
|
30
|
+
export type Phase_Lint = typeof phase_Lint;
|
|
31
|
+
export declare const phaseKey_Lint = "lint";
|
|
32
|
+
export declare const phase_Lint: Phase<'lint'>;
|
|
33
|
+
export type Phase_PreCompile = typeof phase_PreCompile;
|
|
34
|
+
export declare const phaseKey_PreCompile = "pre-compile";
|
|
35
|
+
export declare const phase_PreCompile: Phase<'preCompile'>;
|
|
36
|
+
export type Phase_Compile = typeof phase_Compile;
|
|
37
|
+
export declare const phaseKey_Compile = "compile";
|
|
38
|
+
export declare const phase_Compile: Phase<'compile'>;
|
|
39
|
+
export type Phase_Watch = typeof phase_Watch;
|
|
40
|
+
export declare const phaseKey_Watch = "watch";
|
|
41
|
+
export declare const phase_Watch: Phase<'watch'>;
|
|
42
|
+
export declare const phases_Build: Phase<string>[];
|
|
43
|
+
export type Phase_Launch = typeof phase_Launch;
|
|
44
|
+
export declare const phaseKey_Launch = "launch";
|
|
45
|
+
export declare const phase_Launch: Phase<'launch'>;
|
|
46
|
+
export declare const phases_Launch: Phase<string>[];
|
|
47
|
+
export type Phase_DeployFrontend = typeof phase_DeployFrontend;
|
|
48
|
+
export declare const phaseKey_DeployFrontend = "deploy-frontend";
|
|
49
|
+
export declare const phase_DeployFrontend: Phase<'deployFrontend'>;
|
|
50
|
+
export type Phase_DeployBackend = typeof phase_DeployBackend;
|
|
51
|
+
export declare const phaseKey_DeployBackend = "deploy-backend";
|
|
52
|
+
export declare const phase_DeployBackend: Phase<'deployBackend'>;
|
|
53
|
+
export declare const phases_Deploy: Phase<string>[];
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.phases_Deploy = exports.phase_DeployBackend = exports.phaseKey_DeployBackend = exports.phase_DeployFrontend = exports.phaseKey_DeployFrontend = exports.phases_Launch = exports.phase_Launch = exports.phaseKey_Launch = exports.phases_Build = exports.phase_Watch = exports.phaseKey_Watch = exports.phase_Compile = exports.phaseKey_Compile = exports.phase_PreCompile = exports.phaseKey_PreCompile = exports.phase_Lint = exports.phaseKey_Lint = exports.phase_ResolveConfigs = exports.phaseKey_ResolveConfigs = exports.phase_Install = exports.phaseKey_Install = exports.phase_CopyPackageJSON = exports.phaseKey_CopyPackageJSON = exports.phase_Purge = exports.phaseKey_Purge = exports.phases_Terminating = exports.phase_Debug = exports.phaseKey_Debug = exports.phase_PrintEnv = exports.phaseKey_PrintEnv = exports.phase_CheckCyclicImports = exports.phaseKey_CheckCyclicImports = exports.phase_PrintDependencyTree = exports.phaseKey_PrintDependencyTree = exports.phase_Help = exports.phaseKey_Help = void 0;
|
|
4
|
+
const params_1 = require("../../core/params/params");
|
|
5
|
+
exports.phaseKey_Help = 'help';
|
|
6
|
+
exports.phase_Help = {
|
|
7
|
+
key: exports.phaseKey_Help,
|
|
8
|
+
name: 'Help',
|
|
9
|
+
method: 'printHelp',
|
|
10
|
+
filter: () => params_1.RuntimeParams.help,
|
|
11
|
+
terminateAfterPhase: true,
|
|
12
|
+
};
|
|
13
|
+
exports.phaseKey_PrintDependencyTree = 'print-dependency-tree';
|
|
14
|
+
exports.phase_PrintDependencyTree = {
|
|
15
|
+
key: exports.phaseKey_PrintDependencyTree,
|
|
16
|
+
name: 'Print Dependency Tree',
|
|
17
|
+
method: 'printDependencyTree',
|
|
18
|
+
filter: () => params_1.RuntimeParams.dependencyTree,
|
|
19
|
+
terminateAfterPhase: true,
|
|
20
|
+
};
|
|
21
|
+
exports.phaseKey_CheckCyclicImports = 'check-cyclic-imports';
|
|
22
|
+
exports.phase_CheckCyclicImports = {
|
|
23
|
+
key: exports.phaseKey_CheckCyclicImports,
|
|
24
|
+
name: 'Check Cyclic Imports',
|
|
25
|
+
method: 'checkCyclicImports',
|
|
26
|
+
filter: () => params_1.RuntimeParams.checkCyclicImports,
|
|
27
|
+
terminateAfterPhase: true,
|
|
28
|
+
};
|
|
29
|
+
exports.phaseKey_PrintEnv = 'print-env';
|
|
30
|
+
exports.phase_PrintEnv = {
|
|
31
|
+
key: exports.phaseKey_PrintEnv,
|
|
32
|
+
name: 'Print ENV',
|
|
33
|
+
method: 'printEnv',
|
|
34
|
+
terminateAfterPhase: true,
|
|
35
|
+
filter: () => params_1.RuntimeParams.printEnv,
|
|
36
|
+
};
|
|
37
|
+
exports.phaseKey_Debug = 'debug';
|
|
38
|
+
exports.phase_Debug = {
|
|
39
|
+
key: exports.phaseKey_Debug,
|
|
40
|
+
name: 'Debug',
|
|
41
|
+
method: 'debug',
|
|
42
|
+
terminateAfterPhase: true,
|
|
43
|
+
filter: () => params_1.RuntimeParams.debug,
|
|
44
|
+
};
|
|
45
|
+
exports.phases_Terminating = [
|
|
46
|
+
exports.phase_Help,
|
|
47
|
+
exports.phase_PrintDependencyTree,
|
|
48
|
+
exports.phase_CheckCyclicImports,
|
|
49
|
+
exports.phase_PrintEnv,
|
|
50
|
+
// phase_Debug
|
|
51
|
+
];
|
|
52
|
+
exports.phaseKey_Purge = 'purge';
|
|
53
|
+
exports.phase_Purge = {
|
|
54
|
+
key: exports.phaseKey_Purge,
|
|
55
|
+
name: 'Purge',
|
|
56
|
+
method: 'purge',
|
|
57
|
+
filter: () => params_1.RuntimeParams.purge,
|
|
58
|
+
};
|
|
59
|
+
exports.phaseKey_CopyPackageJSON = 'copy-package-json';
|
|
60
|
+
exports.phase_CopyPackageJSON = {
|
|
61
|
+
key: exports.phaseKey_CopyPackageJSON,
|
|
62
|
+
name: 'Copy Package JSON',
|
|
63
|
+
method: 'copyPackageJson',
|
|
64
|
+
};
|
|
65
|
+
exports.phaseKey_Install = 'install';
|
|
66
|
+
exports.phase_Install = {
|
|
67
|
+
key: exports.phaseKey_Install,
|
|
68
|
+
name: 'Install',
|
|
69
|
+
method: 'install',
|
|
70
|
+
filter: () => params_1.RuntimeParams.install || params_1.RuntimeParams.installPackages || params_1.RuntimeParams.installGlobals,
|
|
71
|
+
};
|
|
72
|
+
exports.phaseKey_ResolveConfigs = 'resolve-configs';
|
|
73
|
+
exports.phase_ResolveConfigs = {
|
|
74
|
+
key: exports.phaseKey_ResolveConfigs,
|
|
75
|
+
name: 'Resolve Configs',
|
|
76
|
+
method: 'resolveConfigs',
|
|
77
|
+
//TODO: Should have a filter
|
|
78
|
+
};
|
|
79
|
+
exports.phaseKey_Lint = 'lint';
|
|
80
|
+
exports.phase_Lint = {
|
|
81
|
+
key: exports.phaseKey_Lint,
|
|
82
|
+
name: 'Lint',
|
|
83
|
+
method: 'lint',
|
|
84
|
+
filter: () => params_1.RuntimeParams.lint,
|
|
85
|
+
};
|
|
86
|
+
exports.phaseKey_PreCompile = 'pre-compile';
|
|
87
|
+
exports.phase_PreCompile = {
|
|
88
|
+
key: exports.phaseKey_PreCompile,
|
|
89
|
+
name: 'Pre Compile',
|
|
90
|
+
method: 'preCompile',
|
|
91
|
+
filter: () => !params_1.RuntimeParams.noBuild,
|
|
92
|
+
runUnitsInDependency: true,
|
|
93
|
+
};
|
|
94
|
+
exports.phaseKey_Compile = 'compile';
|
|
95
|
+
exports.phase_Compile = {
|
|
96
|
+
key: exports.phaseKey_Compile,
|
|
97
|
+
name: 'Compile',
|
|
98
|
+
method: 'compile',
|
|
99
|
+
filter: () => !params_1.RuntimeParams.noBuild,
|
|
100
|
+
runUnitsInDependency: true,
|
|
101
|
+
dependencyPhaseKeys: [exports.phaseKey_CopyPackageJSON, exports.phaseKey_PreCompile],
|
|
102
|
+
};
|
|
103
|
+
exports.phaseKey_Watch = 'watch';
|
|
104
|
+
exports.phase_Watch = {
|
|
105
|
+
key: exports.phaseKey_Watch,
|
|
106
|
+
name: 'Watch',
|
|
107
|
+
method: 'watch',
|
|
108
|
+
filter: () => params_1.RuntimeParams.watch,
|
|
109
|
+
};
|
|
110
|
+
exports.phases_Build = [
|
|
111
|
+
exports.phase_Purge,
|
|
112
|
+
exports.phase_CopyPackageJSON,
|
|
113
|
+
exports.phase_Install,
|
|
114
|
+
exports.phase_ResolveConfigs,
|
|
115
|
+
exports.phase_Lint,
|
|
116
|
+
exports.phase_PreCompile,
|
|
117
|
+
exports.phase_Compile,
|
|
118
|
+
exports.phase_Watch
|
|
119
|
+
];
|
|
120
|
+
exports.phaseKey_Launch = 'launch';
|
|
121
|
+
exports.phase_Launch = {
|
|
122
|
+
key: exports.phaseKey_Launch,
|
|
123
|
+
name: 'Launch',
|
|
124
|
+
method: 'launch',
|
|
125
|
+
filter: () => !!params_1.RuntimeParams.launch,
|
|
126
|
+
};
|
|
127
|
+
exports.phases_Launch = [
|
|
128
|
+
exports.phase_Launch,
|
|
129
|
+
];
|
|
130
|
+
exports.phaseKey_DeployFrontend = 'deploy-frontend';
|
|
131
|
+
exports.phase_DeployFrontend = {
|
|
132
|
+
key: exports.phaseKey_DeployFrontend,
|
|
133
|
+
name: 'Deploy Frontend',
|
|
134
|
+
method: 'deployFrontend',
|
|
135
|
+
filter: () => params_1.RuntimeParams.deployFrontend,
|
|
136
|
+
dependencyPhaseKeys: [exports.phaseKey_Lint, exports.phaseKey_Compile],
|
|
137
|
+
};
|
|
138
|
+
exports.phaseKey_DeployBackend = 'deploy-backend';
|
|
139
|
+
exports.phase_DeployBackend = {
|
|
140
|
+
key: exports.phaseKey_DeployBackend,
|
|
141
|
+
name: 'Deploy Backend',
|
|
142
|
+
method: 'deployBackend',
|
|
143
|
+
filter: () => params_1.RuntimeParams.deployBackend,
|
|
144
|
+
dependencyPhaseKeys: [exports.phaseKey_Lint, exports.phaseKey_Compile],
|
|
145
|
+
};
|
|
146
|
+
exports.phases_Deploy = [exports.phase_DeployFrontend, exports.phase_DeployBackend];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
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("./types"), exports);
|
|
18
|
+
__exportStar(require("./consts"), exports);
|
|
@@ -1,19 +1,75 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { RelativePath } from '@nu-art/ts-common';
|
|
2
|
+
import { Phase, Phase_Debug, Phase_Help, Phase_PrintEnv } from '../phase';
|
|
3
|
+
import { UnitPhaseImplementor } from '../unit/types';
|
|
4
|
+
import { BaseUnit } from '../unit/core';
|
|
5
|
+
import { BAI_ListScreen } from '../screens/list-screen';
|
|
6
|
+
export declare class PhaseRunner extends BaseUnit implements UnitPhaseImplementor<[Phase_Help, Phase_PrintEnv, Phase_Debug]> {
|
|
6
7
|
private readonly phases;
|
|
7
|
-
private units;
|
|
8
|
-
private
|
|
9
|
-
|
|
8
|
+
private readonly units;
|
|
9
|
+
private unitDependencyTree;
|
|
10
|
+
private readonly project;
|
|
11
|
+
private runningStatus;
|
|
12
|
+
private screen?;
|
|
13
|
+
private phaseFilter;
|
|
14
|
+
constructor(projectPath: RelativePath);
|
|
10
15
|
protected init(): Promise<void>;
|
|
11
|
-
|
|
16
|
+
private filterUnits;
|
|
17
|
+
private loadProject;
|
|
18
|
+
private showAllLogs;
|
|
19
|
+
private showScreenLogs;
|
|
20
|
+
private prepareProjectParams;
|
|
21
|
+
private prepareDefaultFileRouts;
|
|
22
|
+
private buildUnitDependencyTree;
|
|
23
|
+
private printInit;
|
|
24
|
+
private phaseFilters;
|
|
25
|
+
private executeImpl;
|
|
26
|
+
registerUnits(units: BaseUnit | BaseUnit[]): void;
|
|
12
27
|
private getUnitsForPhase;
|
|
13
|
-
|
|
14
|
-
|
|
28
|
+
getUnits(): BaseUnit<{}, {}, {
|
|
29
|
+
key: string;
|
|
30
|
+
label: string;
|
|
31
|
+
filter?: (() => boolean | Promise<boolean>) | undefined;
|
|
32
|
+
}, {
|
|
33
|
+
dependencyName: string;
|
|
34
|
+
unitDependencyNames: string[];
|
|
35
|
+
}>[];
|
|
36
|
+
/**
|
|
37
|
+
* Determines whether to run the phase.</br>
|
|
38
|
+
* returns true if phase ran, false otherwise
|
|
39
|
+
* @param phase
|
|
40
|
+
* @private
|
|
41
|
+
*/
|
|
15
42
|
private executePhase;
|
|
43
|
+
/**
|
|
44
|
+
* Will add a phase to the start of the phase array.
|
|
45
|
+
* @param phase
|
|
46
|
+
*/
|
|
47
|
+
prependPhase(phase: Phase<string>): void;
|
|
48
|
+
/**
|
|
49
|
+
* Will add a phase before a specified phase.
|
|
50
|
+
* If the specified phase is not in the phase array, will add to the start of the array.
|
|
51
|
+
* @param phase
|
|
52
|
+
* @param beforePhase
|
|
53
|
+
*/
|
|
54
|
+
prependPhase(phase: Phase<string>, beforePhase: Phase<string>): void;
|
|
55
|
+
/**
|
|
56
|
+
* Will add a phase to the end of the phase array.
|
|
57
|
+
* @param phase
|
|
58
|
+
*/
|
|
59
|
+
appendPhase(phase: Phase<string>): void;
|
|
60
|
+
/**
|
|
61
|
+
* Will add a phase after a specified phase.
|
|
62
|
+
* If the specified phase is not in the phase array, will add to the end of the array.
|
|
63
|
+
* @param phase
|
|
64
|
+
* @param afterPhase
|
|
65
|
+
*/
|
|
66
|
+
appendPhase(phase: Phase<string>, afterPhase: Phase<string>): void;
|
|
67
|
+
private setRunningStatus;
|
|
68
|
+
private loadRunningStatus;
|
|
16
69
|
execute(): Promise<void>;
|
|
17
|
-
|
|
70
|
+
killRunner(): Promise<void>;
|
|
71
|
+
setScreen(screen: BAI_ListScreen): void;
|
|
72
|
+
printHelp(): Promise<void>;
|
|
73
|
+
printEnv(): Promise<void>;
|
|
74
|
+
debug(): Promise<void>;
|
|
18
75
|
}
|
|
19
|
-
export {};
|