firebase-tools-with-isolate 13.29.1-0 → 13.29.1-2
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/README.md
CHANGED
|
@@ -14,14 +14,14 @@ clarity.
|
|
|
14
14
|
|
|
15
15
|
## Installation
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Add this dependency to the root of your monorepo, and co-locate all off your Firebase configurations there as well, as described in the docs.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
I encourage you to use `pnpm` over `npm` or `yarn`. Apart from being fast and
|
|
20
20
|
efficient, PNPM has better support for monorepos, and the the lockfile isolation
|
|
21
21
|
code is solid and works in parallel for multiple packages, [unlike NPM](https://github.com/0x80/isolate-package/README.md#npm)
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
pnpm add firebase-tools-with-isolate -D
|
|
24
|
+
pnpm add firebase-tools-with-isolate -D -w
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
Or run the equivalent for NPM or Yarn.
|
|
@@ -49,7 +49,54 @@ You have to opt-in to the functions isolate process by setting `functions.isolat
|
|
|
49
49
|
}
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
If you
|
|
52
|
+
If you have a monorepo, your firebase.json file should be located in the root listing all of the packages, emulator settings and other firebase related files. It would look something like this:
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"functions": [
|
|
57
|
+
{
|
|
58
|
+
"source": "services/api",
|
|
59
|
+
"predeploy": ["turbo build --filter=@repo/api"],
|
|
60
|
+
"runtime": "nodejs22",
|
|
61
|
+
"codebase": "api",
|
|
62
|
+
"isolate": true
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"source": "services/functions",
|
|
66
|
+
"predeploy": ["turbo build --filter=@repo/functions"],
|
|
67
|
+
"runtime": "nodejs22",
|
|
68
|
+
"codebase": "fns",
|
|
69
|
+
"isolate": true
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"firestore": {
|
|
73
|
+
"rules": "firestore.rules",
|
|
74
|
+
"indexes": "firestore.indexes.json"
|
|
75
|
+
},
|
|
76
|
+
"storage": {
|
|
77
|
+
"rules": "storage.rules"
|
|
78
|
+
},
|
|
79
|
+
"emulators": {
|
|
80
|
+
"ui": {
|
|
81
|
+
"enabled": true
|
|
82
|
+
},
|
|
83
|
+
"auth": {
|
|
84
|
+
"port": 9099
|
|
85
|
+
},
|
|
86
|
+
"functions": {
|
|
87
|
+
"port": 5001
|
|
88
|
+
},
|
|
89
|
+
"firestore": {
|
|
90
|
+
"port": 8080
|
|
91
|
+
},
|
|
92
|
+
"pubsub": {
|
|
93
|
+
"port": 8085
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
If you would like to see a complete working example of a modern monorepo setup check out [mono-ts](https://github.com/0x80/mono-ts)
|
|
53
100
|
|
|
54
101
|
## Documentation
|
|
55
102
|
|
|
@@ -101,7 +101,7 @@ async function runIsolate(sourceDirName) {
|
|
|
101
101
|
const { isolate } = (await (0, dynamicImport_1.dynamicImport)("isolate-package"));
|
|
102
102
|
const isolateDir = await isolate(sourceDirName !== "."
|
|
103
103
|
? {
|
|
104
|
-
|
|
104
|
+
targetPackagePath: path.join("./", sourceDirName),
|
|
105
105
|
}
|
|
106
106
|
: undefined);
|
|
107
107
|
utils.logLabeledBullet("isolate", `Finished isolation at ${clc.bold(isolateDir)}`);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.lifecycleHooks = void 0;
|
|
4
|
-
const utils = require("../utils");
|
|
5
|
-
const clc = require("colorette");
|
|
6
4
|
const childProcess = require("child_process");
|
|
5
|
+
const clc = require("colorette");
|
|
6
|
+
const path = require("path");
|
|
7
7
|
const error_1 = require("../error");
|
|
8
|
-
const needProjectId = require("../projectUtils").needProjectId;
|
|
9
8
|
const logger_1 = require("../logger");
|
|
10
|
-
const
|
|
9
|
+
const utils = require("../utils");
|
|
11
10
|
const vsCodeUtils_1 = require("../vsCodeUtils");
|
|
11
|
+
const needProjectId = require("../projectUtils").needProjectId;
|
|
12
12
|
function runCommand(command, childOptions) {
|
|
13
13
|
const escapedCommand = command.replace(/\"/g, '\\"');
|
|
14
14
|
const isVSCode = (0, vsCodeUtils_1.isVSCodeExtension)();
|
|
@@ -19,11 +19,6 @@ function runCommand(command, childOptions) {
|
|
|
19
19
|
const translatedCommand = '"' + nodeExecutable + '" "' + crossEnvShellPath + '" "' + escapedCommand + '"';
|
|
20
20
|
return new Promise((resolve, reject) => {
|
|
21
21
|
logger_1.logger.info("Running command: " + command);
|
|
22
|
-
if (command.includes("=")) {
|
|
23
|
-
utils.logWarning(clc.yellow(clc.bold("Warning: ")) +
|
|
24
|
-
"Your command contains '=', it may result in the command not running." +
|
|
25
|
-
" Please consider removing it.");
|
|
26
|
-
}
|
|
27
22
|
if (translatedCommand === "") {
|
|
28
23
|
return resolve();
|
|
29
24
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firebase-tools-with-isolate",
|
|
3
3
|
"description": "Command-Line Interface for Firebase with monorepo support",
|
|
4
|
-
"version": "13.29.1-
|
|
4
|
+
"version": "13.29.1-2",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"firebase": "lib/bin/firebase.js"
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"google-auth-library": "^9.11.0",
|
|
130
130
|
"inquirer": "^8.2.6",
|
|
131
131
|
"inquirer-autocomplete-prompt": "^2.0.1",
|
|
132
|
-
"isolate-package": "^1.
|
|
132
|
+
"isolate-package": "^1.23.0",
|
|
133
133
|
"js-yaml": "^3.14.1",
|
|
134
134
|
"jsonwebtoken": "^9.0.0",
|
|
135
135
|
"leven": "^3.1.0",
|