@nu-art/build-and-install 0.400.14 → 0.401.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/BuildAndInstall.d.ts +40 -0
  2. package/BuildAndInstall.js +155 -0
  3. package/build-and-install-v3.d.ts +1 -32
  4. package/build-and-install-v3.js +1 -154
  5. package/build-and-install.js +11 -11
  6. package/config/consts.d.ts +43 -0
  7. package/config/consts.js +42 -0
  8. package/{core → config}/package/consts.d.ts +1 -1
  9. package/{core → config}/types/project-config.d.ts +3 -0
  10. package/core/FilesCache.d.ts +50 -0
  11. package/core/FilesCache.js +76 -0
  12. package/core/Unit_HelpPrinter.d.ts +16 -0
  13. package/core/Unit_HelpPrinter.js +47 -0
  14. package/core/params/params.d.ts +1 -41
  15. package/core/params/params.js +1 -334
  16. package/core/params.d.ts +50 -0
  17. package/core/params.js +441 -0
  18. package/{v3/core → core}/types.d.ts +1 -1
  19. package/{v3/UnitsDependencyMapper → dependencies}/UnitsDependencyMapper.d.ts +21 -1
  20. package/{v3/UnitsDependencyMapper → dependencies}/UnitsDependencyMapper.js +26 -3
  21. package/dependencies/types.d.ts +1 -0
  22. package/dependencies/types.js +1 -0
  23. package/exceptions/PhaseAggregatedException.d.ts +34 -0
  24. package/{core/exceptions → exceptions}/PhaseAggregatedException.js +26 -0
  25. package/exceptions/UnitPhaseException.d.ts +20 -0
  26. package/exceptions/UnitPhaseException.js +21 -0
  27. package/exports/ExportIndexCache.d.ts +25 -0
  28. package/exports/ExportIndexCache.js +115 -0
  29. package/exports/ExportMapper.d.ts +43 -0
  30. package/exports/ExportMapper.js +519 -0
  31. package/exports/IndicesMcpServer.d.ts +22 -0
  32. package/exports/IndicesMcpServer.js +220 -0
  33. package/exports/types.js +3 -0
  34. package/package.json +20 -9
  35. package/phases/PhaseManager.d.ts +130 -0
  36. package/phases/PhaseManager.js +267 -0
  37. package/{v3/phase → phases/definitions}/consts.d.ts +36 -0
  38. package/{v3/phase → phases/definitions}/consts.js +45 -2
  39. package/phases/definitions/types.d.ts +40 -0
  40. package/phases/index.d.ts +2 -0
  41. package/phases/index.js +2 -0
  42. package/run.js +10 -0
  43. package/runtime/RunningStatusHandler.d.ts +104 -0
  44. package/runtime/RunningStatusHandler.js +153 -0
  45. package/runtime/types.d.ts +1 -0
  46. package/runtime/types.js +2 -0
  47. package/{defaults → templates}/consts.d.ts +9 -0
  48. package/{defaults → templates}/consts.js +12 -2
  49. package/templates/firebase/functions/cloudbuild.yaml +17 -0
  50. package/templates/firebase/functions/dockerfile +19 -0
  51. package/templates/firebase/functions/service.yaml +49 -0
  52. package/{v3/units → units/base}/BaseUnit.d.ts +35 -3
  53. package/{v3/units → units/base}/BaseUnit.js +22 -2
  54. package/units/base/ProjectUnit.d.ts +32 -0
  55. package/units/base/ProjectUnit.js +25 -0
  56. package/units/base/types.js +1 -0
  57. package/units/discovery/UnitsMapper.d.ts +69 -0
  58. package/{v3/UnitsMapper → units/discovery}/UnitsMapper.js +51 -3
  59. package/units/discovery/resolvers/UnitMapper_Base.d.ts +65 -0
  60. package/units/discovery/resolvers/UnitMapper_Base.js +46 -0
  61. package/{v3/UnitsMapper → units/discovery}/resolvers/UnitMapper_FirebaseFunction.d.ts +5 -3
  62. package/units/discovery/resolvers/UnitMapper_FirebaseFunction.js +105 -0
  63. package/{v3/UnitsMapper → units/discovery}/resolvers/UnitMapper_FirebaseHosting.d.ts +3 -2
  64. package/{v3/UnitsMapper → units/discovery}/resolvers/UnitMapper_FirebaseHosting.js +14 -10
  65. package/{v3/UnitsMapper → units/discovery}/resolvers/UnitMapper_Node.d.ts +1 -1
  66. package/{v3/UnitsMapper → units/discovery}/resolvers/UnitMapper_Node.js +2 -2
  67. package/{v3/UnitsMapper → units/discovery}/resolvers/UnitMapper_NodeLib.d.ts +24 -1
  68. package/{v3/UnitsMapper → units/discovery}/resolvers/UnitMapper_NodeLib.js +24 -1
  69. package/{v3/UnitsMapper → units/discovery}/resolvers/UnitMapper_NodeProject.d.ts +22 -1
  70. package/{v3/UnitsMapper → units/discovery}/resolvers/UnitMapper_NodeProject.js +22 -1
  71. package/units/discovery/types.js +1 -0
  72. package/units/implementations/Unit_NodeProject.d.ts +59 -0
  73. package/{v3/units → units/implementations}/Unit_NodeProject.js +67 -6
  74. package/units/implementations/Unit_PackageJson.d.ts +56 -0
  75. package/{v3/units → units/implementations}/Unit_PackageJson.js +39 -3
  76. package/{v3/units → units/implementations}/Unit_TypescriptLib.d.ts +40 -4
  77. package/{v3/units → units/implementations}/Unit_TypescriptLib.js +167 -17
  78. package/units/implementations/firebase/Unit_FirebaseFunctionsApp.d.ts +233 -0
  79. package/units/implementations/firebase/Unit_FirebaseFunctionsApp.js +804 -0
  80. package/units/implementations/firebase/Unit_FirebaseHostingApp.d.ts +113 -0
  81. package/units/implementations/firebase/Unit_FirebaseHostingApp.js +320 -0
  82. package/units/implementations/firebase/common.d.ts +26 -0
  83. package/units/implementations/firebase/common.js +65 -0
  84. package/units/index.d.ts +6 -0
  85. package/units/index.js +6 -0
  86. package/v3/core/Unit_HelpPrinter.d.ts +1 -16
  87. package/v3/core/Unit_HelpPrinter.js +1 -47
  88. package/workspace/Workspace.d.ts +95 -0
  89. package/workspace/Workspace.js +192 -0
  90. package/core/consts.d.ts +0 -13
  91. package/core/consts.js +0 -12
  92. package/core/exceptions/PhaseAggregatedException.d.ts +0 -8
  93. package/core/exceptions/UnitPhaseException.d.ts +0 -5
  94. package/core/exceptions/UnitPhaseException.js +0 -6
  95. package/old/PhaseRunnerDispatcher.d.ts +0 -24
  96. package/old/PhaseRunnerDispatcher.js +0 -32
  97. package/old/runner-dispatchers.d.ts +0 -10
  98. package/old/runner-dispatchers.js +0 -3
  99. package/v3/PhaseManager.d.ts +0 -26
  100. package/v3/PhaseManager.js +0 -158
  101. package/v3/RunningStatusHandler.d.ts +0 -18
  102. package/v3/RunningStatusHandler.js +0 -67
  103. package/v3/UnitsMapper/UnitsMapper.d.ts +0 -21
  104. package/v3/UnitsMapper/resolvers/UnitMapper_Base.d.ts +0 -23
  105. package/v3/UnitsMapper/resolvers/UnitMapper_Base.js +0 -16
  106. package/v3/UnitsMapper/resolvers/UnitMapper_FirebaseFunction.js +0 -66
  107. package/v3/core/FilesCache.d.ts +0 -7
  108. package/v3/core/FilesCache.js +0 -33
  109. package/v3/phase/types.d.ts +0 -9
  110. package/v3/units/ProjectUnit.d.ts +0 -18
  111. package/v3/units/ProjectUnit.js +0 -11
  112. package/v3/units/Unit_NodeProject.d.ts +0 -30
  113. package/v3/units/Unit_PackageJson.d.ts +0 -17
  114. package/v3/units/firebase/Unit_FirebaseFunctionsApp.d.ts +0 -64
  115. package/v3/units/firebase/Unit_FirebaseFunctionsApp.js +0 -306
  116. package/v3/units/firebase/Unit_FirebaseHostingApp.d.ts +0 -49
  117. package/v3/units/firebase/Unit_FirebaseHostingApp.js +0 -114
  118. package/v3/units/firebase/common.d.ts +0 -3
  119. package/v3/units/firebase/common.js +0 -13
  120. package/v3/units/index.d.ts +0 -6
  121. package/v3/units/index.js +0 -6
  122. /package/{core → config}/package/consts.js +0 -0
  123. /package/{core → config}/types/configs/firebasejson.d.ts +0 -0
  124. /package/{core → config}/types/configs/firebasejson.js +0 -0
  125. /package/{core → config}/types/configs/firebaserc.d.ts +0 -0
  126. /package/{core → config}/types/configs/firebaserc.js +0 -0
  127. /package/{core → config}/types/configs/index.d.ts +0 -0
  128. /package/{core → config}/types/configs/index.js +0 -0
  129. /package/{core → config}/types/configs/package-json.d.ts +0 -0
  130. /package/{core → config}/types/configs/package-json.js +0 -0
  131. /package/{core → config}/types/core.d.ts +0 -0
  132. /package/{core → config}/types/core.js +0 -0
  133. /package/{core → config}/types/index.d.ts +0 -0
  134. /package/{core → config}/types/index.js +0 -0
  135. /package/{core → config}/types/package/index.d.ts +0 -0
  136. /package/{core → config}/types/package/index.js +0 -0
  137. /package/{core → config}/types/package/package.d.ts +0 -0
  138. /package/{core → config}/types/package/package.js +0 -0
  139. /package/{core → config}/types/package/runtime-package.d.ts +0 -0
  140. /package/{core → config}/types/package/runtime-package.js +0 -0
  141. /package/{core → config}/types/project-config.js +0 -0
  142. /package/{v3/core → core}/types.js +0 -0
  143. /package/{v3/UnitsMapper/types.js → exports/types.d.ts} +0 -0
  144. /package/{v3/phase → phases/definitions}/index.d.ts +0 -0
  145. /package/{v3/phase → phases/definitions}/index.js +0 -0
  146. /package/{v3/phase → phases/definitions}/types.js +0 -0
  147. /package/{v3/units/types.js → run.d.ts} +0 -0
  148. /package/{defaults/backend-proxy → templates/backend/proxy}/proxy._ts +0 -0
  149. /package/{defaults/.firebase_config → templates/firebase/config}/database.rules.json +0 -0
  150. /package/{defaults/.firebase_config → templates/firebase/config}/firestore.indexes.json +0 -0
  151. /package/{defaults/.firebase_config → templates/firebase/config}/firestore.rules +0 -0
  152. /package/{defaults/.firebase_config → templates/firebase/config}/storage.rules +0 -0
  153. /package/{v3/units → units/base}/types.d.ts +0 -0
  154. /package/{v3/UnitsMapper → units/discovery}/resolvers/index.d.ts +0 -0
  155. /package/{v3/UnitsMapper → units/discovery}/resolvers/index.js +0 -0
  156. /package/{v3/UnitsMapper → units/discovery}/types.d.ts +0 -0
@@ -1,67 +0,0 @@
1
- import fs, { promises as _fs } from 'fs';
2
- import { __stringify, Logger } from '@nu-art/ts-common';
3
- export class RunningStatusHandler extends Logger {
4
- isolated = false;
5
- outputFolder;
6
- // The completed units in the phase.. when running -con, these can be skipped
7
- completedUnits = [];
8
- runtimeParams;
9
- startIndex = 0;
10
- constructor(outputFolder, runtimeParams) {
11
- super();
12
- this.outputFolder = outputFolder;
13
- this.runtimeParams = runtimeParams;
14
- }
15
- async init() {
16
- if (!fs.existsSync(this.outputFolder))
17
- await _fs.mkdir(this.outputFolder, { recursive: true });
18
- if (this.runtimeParams.continue) {
19
- const currentParams = this.runtimeParams;
20
- this.startIndex = await this.load();
21
- this.runtimeParams = Object.assign(currentParams, this.runtimeParams);
22
- }
23
- }
24
- isolate() {
25
- this.isolated = true;
26
- return this;
27
- }
28
- isCompleted(unitKey) {
29
- return this.completedUnits.includes(unitKey);
30
- }
31
- async onUnitCompleted(unitKey) {
32
- this.logDebug(`On unit completed: ${unitKey}`);
33
- this.completedUnits.push(unitKey);
34
- await this.saveStatus();
35
- }
36
- async onStepEnded() {
37
- this.logDebug(`On step ended successfully #${this.startIndex}`);
38
- this.completedUnits = [];
39
- }
40
- async onStepStarted(index) {
41
- this.startIndex = index;
42
- this.logDebug(`Setting execution index to #${this.startIndex}`);
43
- if (this.isolated)
44
- return;
45
- await this.saveStatus();
46
- }
47
- async saveStatus() {
48
- await _fs.writeFile(`${this.outputFolder}/running-status.json`, __stringify({
49
- index: this.startIndex,
50
- runtimeParams: this.runtimeParams,
51
- completedUnits: this.completedUnits
52
- }, true));
53
- }
54
- async load() {
55
- try {
56
- const data = JSON.parse(await _fs.readFile(`${this.outputFolder}/running-status.json`, { encoding: 'utf-8' }));
57
- this.startIndex = data.index;
58
- this.completedUnits = data.completedUnits ?? [];
59
- this.runtimeParams = data.runtimeParams;
60
- return data.index;
61
- }
62
- catch (e) {
63
- this.logError('Failed reading running status, using initial status', e);
64
- return;
65
- }
66
- }
67
- }
@@ -1,21 +0,0 @@
1
- import { BaseUnit, ProjectUnit } from '../units/index.js';
2
- import { Logger } from '@nu-art/ts-common';
3
- import { UnitMapper_Base } from './resolvers/UnitMapper_Base.js';
4
- import { BaiParams } from '../../core/params/params.js';
5
- /**
6
- * This class will receive a path and will map the workspace packages and libs
7
- *
8
- * A lib will have rules to infer it, mainly from the package.json but also from existing files in the context of the node lib
9
- */
10
- export declare class UnitsMapper extends Logger {
11
- private rules;
12
- /**
13
- * @param path - will always be a directory
14
- * @param projectRoot - The path to the project root
15
- * @param units - The project units derived from the file system
16
- */
17
- resolveUnits(path: string, projectRoot?: string, units?: BaseUnit<any>[]): Promise<BaseUnit<any, import("../units/BaseUnit.js").UnitRuntimeContext>[]>;
18
- addRules<T extends BaseUnit<any>>(...rules: UnitMapper_Base<T>[]): this;
19
- setRuntimeParams(runtimeParams: BaiParams): this;
20
- assertUniqueKeys(units: ProjectUnit[]): void;
21
- }
@@ -1,23 +0,0 @@
1
- import { AbsolutePath, Logger, RelativePath, StringMap, TypeValidator } from '@nu-art/ts-common';
2
- import { BaseUnit } from '../../units/index.js';
3
- import { BAI_Config } from '../../../core/types/index.js';
4
- import { BaiParams } from '../../../core/params/params.js';
5
- export type BaseUnitConfig = {
6
- fullPath: AbsolutePath;
7
- relativePath: RelativePath;
8
- label: string;
9
- key: string;
10
- dependencies: StringMap;
11
- };
12
- export type UnitConfigJSON_Base = {
13
- type: string;
14
- };
15
- export declare abstract class UnitMapper_Base<T extends BaseUnit<any>, ConfigJSON extends UnitConfigJSON_Base = UnitConfigJSON_Base> extends Logger {
16
- protected validator: TypeValidator<ConfigJSON>;
17
- protected baiConfig: BAI_Config;
18
- protected runtimeParams: BaiParams;
19
- protected constructor(validator: TypeValidator<ConfigJSON>);
20
- setRuntimeParams(runtimeParams: BaiParams): void;
21
- setConfig(config: BAI_Config): void;
22
- abstract resolveUnit(path: string, root: string): Promise<T | undefined>;
23
- }
@@ -1,16 +0,0 @@
1
- import { Logger } from '@nu-art/ts-common';
2
- export class UnitMapper_Base extends Logger {
3
- validator;
4
- baiConfig;
5
- runtimeParams;
6
- constructor(validator) {
7
- super();
8
- this.validator = validator;
9
- }
10
- setRuntimeParams(runtimeParams) {
11
- this.runtimeParams = runtimeParams;
12
- }
13
- setConfig(config) {
14
- this.baiConfig = config;
15
- }
16
- }
@@ -1,66 +0,0 @@
1
- import { tsValidate_OptionalArray, tsValidateAnyString, tsValidateBoolean, tsValidateDynamicObject, tsValidateOptionalAnyNumber, tsValidateOptionalAnyString, tsValidateValue } from '@nu-art/ts-common';
2
- import { UnitMapper_Node } from './UnitMapper_Node.js';
3
- import { Unit_FirebaseFunctionsApp } from '../../units/firebase/Unit_FirebaseFunctionsApp.js';
4
- import { resolve } from 'path';
5
- import { BaiParam_SetEnv } from '../../../core/params/params.js';
6
- const valuesValidator = {
7
- defaultConfig: tsValidateOptionalAnyString,
8
- envConfig: tsValidateOptionalAnyString,
9
- identityAccount: tsValidateOptionalAnyString,
10
- projectId: tsValidateAnyString,
11
- isLocal: tsValidateBoolean(false),
12
- };
13
- export class UnitMapper_FirebaseFunction_Class extends UnitMapper_Node {
14
- static tsValidator_FirebaseFunction = {
15
- type: tsValidateValue(['firebase-function']),
16
- ignore: tsValidate_OptionalArray(tsValidateOptionalAnyString),
17
- envs: tsValidateDynamicObject(valuesValidator, tsValidateAnyString),
18
- debugPort: tsValidateOptionalAnyNumber,
19
- basePort: tsValidateOptionalAnyNumber,
20
- sslKey: tsValidateOptionalAnyString,
21
- sslCert: tsValidateOptionalAnyString,
22
- ...UnitMapper_Node.tsValidator_Node,
23
- };
24
- constructor() {
25
- super(UnitMapper_FirebaseFunction_Class.tsValidator_FirebaseFunction);
26
- }
27
- async resolveNodeUnit(context) {
28
- const outputDir = context.packageJson.publishConfig?.directory;
29
- const env = this.runtimeParams[BaiParam_SetEnv.keyName];
30
- let envUnitConfig = context.packageJson.unitConfig.envs[env];
31
- if (!envUnitConfig) {
32
- this.logWarning(`Missing EnvConfig in unit ${context.baseConfig.key}`);
33
- envUnitConfig = {
34
- identityAccount: '',
35
- defaultConfig: '',
36
- envConfig: '',
37
- projectId: '',
38
- isLocal: true
39
- };
40
- // throw new ImplementationMissingException(`Missing configuration for env: ${env}`);
41
- }
42
- const envConfig = {
43
- identityAccount: envUnitConfig.identityAccount,
44
- defaultConfig: envUnitConfig.defaultConfig,
45
- envConfig: envUnitConfig.envConfig,
46
- projectId: envUnitConfig.projectId,
47
- isLocal: envUnitConfig.isLocal ?? env === 'local'
48
- };
49
- const { type, ...unitConfig } = context.packageJson.unitConfig;
50
- return new Unit_FirebaseFunctionsApp({
51
- ...context.baseConfig,
52
- ...Unit_FirebaseFunctionsApp.DefaultConfig_FirebaseFunction,
53
- ...unitConfig,
54
- envConfig,
55
- isTopLevelApp: true,
56
- hasSelfHotReload: unitConfig.hasSelfHotReload ?? false,
57
- packageJson: context.packageJson,
58
- customESLintConfig: context.customESLintConfig,
59
- customTSConfig: context.customTSConfig,
60
- output: resolve(context.baseConfig.fullPath, outputDir ?? Unit_FirebaseFunctionsApp.DefaultConfig_FirebaseFunction.output),
61
- sslCert: resolve(context.baseConfig.fullPath, unitConfig.sslCert ?? Unit_FirebaseFunctionsApp.DefaultConfig_FirebaseFunction.sslCert),
62
- sslKey: resolve(context.baseConfig.fullPath, unitConfig.sslKey ?? Unit_FirebaseFunctionsApp.DefaultConfig_FirebaseFunction.sslKey),
63
- });
64
- }
65
- }
66
- export const UnitMapper_FirebaseFunction = new UnitMapper_FirebaseFunction_Class();
@@ -1,7 +0,0 @@
1
- export declare const FilesCache: {
2
- clear: () => {};
3
- load: {
4
- json: <T>(pathToFile: string) => Promise<T>;
5
- text: (pathToFile: string) => Promise<string>;
6
- };
7
- };
@@ -1,33 +0,0 @@
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
- };
@@ -1,9 +0,0 @@
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
- };
@@ -1,18 +0,0 @@
1
- import { StringMap } from '@nu-art/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
- }
@@ -1,11 +0,0 @@
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
- }
@@ -1,30 +0,0 @@
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(): StringMap;
16
- assignUnit(units: ProjectUnit[]): void;
17
- /**
18
- * Resolve all paths to watch in all project libs
19
- * @private
20
- * @returns string[]
21
- */
22
- private prepareWatchPaths;
23
- stopWatch(): Promise<void | undefined>;
24
- private findUnit;
25
- install(): Promise<void>;
26
- watch(timeout?: number, maxTimeout?: number): Promise<void>;
27
- purge(): Promise<void>;
28
- postPublish(): Promise<void>;
29
- }
30
- export {};
@@ -1,17 +0,0 @@
1
- import { StringMap } from '@nu-art/ts-common';
2
- import { UnitPhaseImplementor } from '../core/types.js';
3
- import { Config_ProjectUnit, ProjectUnit } from './ProjectUnit.js';
4
- import { TS_PackageJSON } from '../UnitsMapper/types.js';
5
- import { Phase_Prepare, Phase_Purge } from '../phase/index.js';
6
- export type Unit_PackageJson_Config = Config_ProjectUnit & {
7
- packageJson: TS_PackageJSON;
8
- };
9
- export declare class Unit_PackageJson<C extends Unit_PackageJson_Config = Unit_PackageJson_Config> extends ProjectUnit<C> implements UnitPhaseImplementor<[Phase_Purge, Phase_Prepare]> {
10
- constructor(config: C);
11
- protected npmCommand(command: string): string;
12
- protected deriveDistDependencies(): StringMap;
13
- protected deriveLibDependencies(): StringMap;
14
- prepare(): Promise<void>;
15
- purge(): Promise<void>;
16
- protected releasePorts(allPorts: string[]): Promise<void>;
17
- }
@@ -1,64 +0,0 @@
1
- import { UnitPhaseImplementor } from '../../core/types.js';
2
- import { FirebasePackageConfig } from '../../../core/types/index.js';
3
- import { StringMap } from '@nu-art/ts-common';
4
- import { Phase_Deploy, Phase_Launch } from '../../phase/index.js';
5
- import { Unit_TypescriptLib, Unit_TypescriptLib_Config } from '../Unit_TypescriptLib.js';
6
- export declare const firebaseFunctionEmulator_ErrorStrings: string[];
7
- export declare const firebaseFunctionEmulator_WarningStrings: string[];
8
- type EnvConfig = {
9
- defaultConfig?: string;
10
- envConfig?: string;
11
- projectId: string;
12
- isLocal?: boolean;
13
- identityAccount?: string;
14
- };
15
- export type Unit_FirebaseFunctionsApp_Config = Unit_TypescriptLib_Config & {
16
- firebaseConfig?: FirebasePackageConfig;
17
- pathToFirebaseConfig: string;
18
- envConfig: EnvConfig;
19
- ignore?: string[];
20
- debugPort: number;
21
- basePort: number;
22
- sslKey: string;
23
- sslCert: string;
24
- pathToEmulatorData: string;
25
- sources?: string[];
26
- };
27
- export declare class Unit_FirebaseFunctionsApp<C extends Unit_FirebaseFunctionsApp_Config = Unit_FirebaseFunctionsApp_Config> extends Unit_TypescriptLib<C> implements UnitPhaseImplementor<[Phase_Launch, Phase_Deploy]> {
28
- functions: StringMap;
29
- static staggerCount: number;
30
- static DefaultConfig_FirebaseFunction: {
31
- pathToFirebaseConfig: string;
32
- debugPort: number;
33
- basePort: number;
34
- sslKey: string;
35
- sslCert: string;
36
- output: string;
37
- pathToEmulatorData: string;
38
- };
39
- readonly emulatorLogStrings: {
40
- error: string[];
41
- warning: string[];
42
- };
43
- constructor(config: Unit_FirebaseFunctionsApp<C>['config']);
44
- protected copyPackageJSONToOutput(): Promise<void>;
45
- prepare(): Promise<void>;
46
- resolveConfigs(): Promise<void>;
47
- compile(): Promise<void>;
48
- postCompile(): Promise<void>;
49
- launch(): Promise<void>;
50
- releaseEmulatorPorts(): Promise<void>;
51
- deploy(): Promise<void>;
52
- private resolveFunctionsRC;
53
- private resolveProxyFile;
54
- private pathToProxy;
55
- private resolveConfigDir;
56
- private resolveFunctionsJSON;
57
- private resolveFunctionsRuntimeConfig;
58
- private createAppVersionFile;
59
- protected deriveDistDependencies(): StringMap;
60
- private createDependenciesDir;
61
- private runProxy;
62
- private runEmulator;
63
- }
64
- export {};