backend-manager 3.2.7 → 3.2.9

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backend-manager",
3
- "version": "3.2.7",
3
+ "version": "3.2.9",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
package/src/cli/cli.js CHANGED
@@ -17,6 +17,7 @@ const { spawn, child, exec, fork } = require('child_process');
17
17
  const JSON5 = require('json5');
18
18
  const fetch = require('wonderful-fetch');
19
19
  const argv = require('yargs').argv;
20
+ const powertools = require('node-powertools');
20
21
 
21
22
  // function parseArgumentsIntoOptions(rawArgs) {
22
23
  // const args = arg(
@@ -558,6 +559,22 @@ Main.prototype.setup = async function () {
558
559
  return true;
559
560
  }, NOFIX);
560
561
 
562
+ await self.test('create public .html files', function () {
563
+ const options = {url: self.bemConfigJSON.brand.url}
564
+ // index.html
565
+ const templateIndex = jetpack.read(path.resolve(`${__dirname}/../../templates/public/index.html`));
566
+ jetpack.write(`${self.firebaseProjectPath}/public/index.html`,
567
+ powertools.template(templateIndex, options)
568
+ )
569
+
570
+ // 404.html
571
+ const template404 = jetpack.read(path.resolve(`${__dirname}/../../templates/public/404.html`));
572
+ jetpack.write(`${self.firebaseProjectPath}/public/404.html`,
573
+ powertools.template(template404, options)
574
+ )
575
+ return true;
576
+ }, NOFIX);
577
+
561
578
  // await self.test('add roles/datastore.importExportAdmin', function () {
562
579
  // const result = await cmd_iamImportExport(self);
563
580
  // console.log('---result', result);
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>404 Error Page</title>
8
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
9
+ </head>
10
+
11
+ <body>
12
+ <div class="d-flex align-items-center justify-content-center vh-100">
13
+ <div class="text-center">
14
+ <h1 class="display-1 fw-bold">404</h1>
15
+
16
+ <p class="fs-3"> <span class="text-danger">Opps!</span> Page not found.</p>
17
+
18
+ <p class="lead">
19
+ The page you're looking for doesn't exist.
20
+ </p>
21
+
22
+ <a href="{url}" class="btn btn-primary">Go Home</a>
23
+ </div>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,24 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>404 Error Page</title>
8
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
9
+ </head>
10
+
11
+ <body>
12
+ <div class="d-flex align-items-center justify-content-center vh-100">
13
+ <div class="text-center">
14
+ <h1 class="display-1 fw-bold">Welcome!</h1>
15
+
16
+ <p class="lead">
17
+ This is an internal page, please return to our main website
18
+ </p>
19
+
20
+ <a href="{url}" class="btn btn-primary">Go Home</a>
21
+ </div>
22
+ </div>
23
+ </body>
24
+ </html>