@nu-art/build-and-install 0.204.21 → 0.204.22
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/package.json +1 -1
- package/phases/phases.js +9 -8
package/package.json
CHANGED
package/phases/phases.js
CHANGED
|
@@ -177,6 +177,7 @@ exports.Phase_ResolveEnv = {
|
|
|
177
177
|
mandatoryPhases: [exports.Phase_ResolveTemplate, exports.Phase_PrepareParams, exports.Phase_SetupProject, exports.Phase_SetWithThunderstorm],
|
|
178
178
|
filter: async (pkg) => pkg.type === 'firebase-functions-app' || pkg.type === 'firebase-hosting-app',
|
|
179
179
|
action: async (pkg) => {
|
|
180
|
+
var _a, _b;
|
|
180
181
|
const firebasePkg = pkg;
|
|
181
182
|
await fs_1.promises.writeFile(`${firebasePkg.path}/${consts_1.CONST_FirebaseRC}`, JSON.stringify((0, generate_1.createFirebaseRC)(firebasePkg, params_1.RuntimeParams.environment), null, 2), { encoding: 'utf-8' });
|
|
182
183
|
const defaultFiles = consts_2.MemKey_DefaultFiles.get();
|
|
@@ -195,14 +196,14 @@ exports.Phase_ResolveEnv = {
|
|
|
195
196
|
catch (e) {
|
|
196
197
|
await fs_1.promises.mkdir(pathToFirebaseConfigFolder, { recursive: true });
|
|
197
198
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
199
|
+
if (firebasePkg.envConfig.ssl) {
|
|
200
|
+
const pathToProxyFile = `${firebaseFunctionPkg.path}/src/main/proxy.ts`;
|
|
201
|
+
let defaultFileContent = await fs_1.promises.readFile(defaultFiles.backend.proxy, { encoding: 'utf-8' });
|
|
202
|
+
defaultFileContent = defaultFileContent.replace(/SERVER_PORT/g, `${firebasePkg.envConfig.basePort}`);
|
|
203
|
+
defaultFileContent = defaultFileContent.replace(/PATH_TO_SSL_KEY/g, `${(_a = firebasePkg.envConfig.ssl) === null || _a === void 0 ? void 0 : _a.pathToKey}`);
|
|
204
|
+
defaultFileContent = defaultFileContent.replace(/PATH_TO_SSL_CERTIFICATE/g, `${(_b = firebasePkg.envConfig.ssl) === null || _b === void 0 ? void 0 : _b.pathToCertificate}`);
|
|
205
|
+
await fs_1.promises.writeFile(pathToProxyFile, defaultFileContent, { encoding: 'utf-8' });
|
|
206
|
+
}
|
|
206
207
|
await Promise.all(consts_2.Const_FirebaseConfigKeys.map(async (firebaseConfigKey) => {
|
|
207
208
|
const pathToConfigFile = `${pathToFirebaseConfigFolder}/${consts_2.Const_FirebaseDefaultsKeyToFile[firebaseConfigKey]}`;
|
|
208
209
|
try {
|