firebase-tools-with-isolate 12.9.1-7 → 12.9.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.
package/README.md
CHANGED
|
@@ -1,28 +1,36 @@
|
|
|
1
1
|
# Firebase CLI with monorepo support
|
|
2
2
|
|
|
3
|
-
This is an experimental fork of the [
|
|
3
|
+
This is an experimental fork of the [firebase-tools](https://github.com/firebase/firebase-tools) which integrates [isolate-package](https://github.com/0x80/isolate-package/) as part of the functions `deploy` command in order to [support monorepo setups](https://thijs-koerselman.medium.com/deploy-to-firebase-without-the-hacks-e685de39025e).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Alternatively, you can manually configure `isolate` as part of the `predeploy` step of your configuration, but having the process integrated and only running as part of the deploy command is essential if you want to have live code updates when running the Firebase emulators locally during development with a watch task.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
I suspect it will take some time before the Firebase team would agree to make isolate an integral part of the toolchain and that is why I have published this fork to be available on NPM.
|
|
8
|
+
|
|
9
|
+
In the meantime I will try to keep this fairly in-sync with updates to the original firebase-tools repository. The published versions of the fork will be kept the same as the original `firebase-tools` package, so you can easily see how up-to-date it is.
|
|
8
10
|
|
|
9
11
|
## Installation
|
|
10
12
|
|
|
11
13
|
It is probably best to install this as a local dependency on whatever package you want to deploy to Firebase, as opposed to using a global install. This way the forked binary does not interfere with the original one on your system, and you can easily use the fork on one project will still using the original one on others.
|
|
12
14
|
|
|
13
15
|
```bash
|
|
14
|
-
npm install firebase-tools-with-isolate
|
|
16
|
+
npm install firebase-tools-with-isolate --save-dev
|
|
15
17
|
```
|
|
16
18
|
|
|
17
19
|
Personally I would advise you to [try PNPM](https://pnpm.io/feature-comparison) for monorepo setups. At the moment, `isolate-package` only supports generating isolated lockfiles for PNPM, but you can always choose to deploy to Firebase without a lockfile, similar to other workarounds people have been using.
|
|
18
20
|
|
|
19
21
|
```bash
|
|
20
|
-
pnpm add firebase-tools-with-isolate
|
|
22
|
+
pnpm add firebase-tools-with-isolate -D
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Or, if you want to work with the latest pre-release version
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pnpm add firebase-tools-with-isolate@next -D
|
|
21
29
|
```
|
|
22
30
|
|
|
23
31
|
## Commands
|
|
24
32
|
|
|
25
|
-
Installing the fork locally provides you with the same `firebase` command but in order to execute
|
|
33
|
+
Installing the fork locally provides you with the same `firebase` command but in order to execute a command on the command line you prefix it with `npx` like `npx firebase deploy`.
|
|
26
34
|
|
|
27
35
|
If you are using the commands as part of a package.json script, `npx` is not required, because scripts already prefer locally installed binaries when available.
|
|
28
36
|
|
|
@@ -33,7 +41,7 @@ You have to opt-in to the functions isolate process by setting `functions.isolat
|
|
|
33
41
|
```json
|
|
34
42
|
{
|
|
35
43
|
"functions": {
|
|
36
|
-
"source": "
|
|
44
|
+
"source": ".",
|
|
37
45
|
"runtime": "nodejs20",
|
|
38
46
|
"predeploy": ["turbo build"],
|
|
39
47
|
"isolate": true
|
|
@@ -92,13 +92,12 @@ async function packageSource(sourceDir, config, runtimeConfig) {
|
|
|
92
92
|
return { pathToSource: tmpFile, hash };
|
|
93
93
|
}
|
|
94
94
|
async function prepareFunctionsUpload(sourceDir, config, runtimeConfig) {
|
|
95
|
-
utils.logLabeledBullet("functions", `+++ Prepare functions for upload`);
|
|
96
95
|
if (config.isolate === true) {
|
|
97
|
-
utils.logLabeledBullet("functions",
|
|
96
|
+
utils.logLabeledBullet("functions", `Start isolating the source folder...`);
|
|
98
97
|
try {
|
|
99
|
-
const { isolate } = await (0, dynamicImport_1.dynamicImport)("isolate-package");
|
|
98
|
+
const { isolate } = (await (0, dynamicImport_1.dynamicImport)("isolate-package"));
|
|
100
99
|
const isolateDir = await isolate();
|
|
101
|
-
utils.logLabeledBullet("functions",
|
|
100
|
+
utils.logLabeledBullet("functions", `Finished isolation at ${clc.bold(isolateDir)}`);
|
|
102
101
|
return packageSource(isolateDir, config, runtimeConfig);
|
|
103
102
|
}
|
|
104
103
|
catch (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firebase-tools-with-isolate",
|
|
3
|
-
"version": "12.9.1
|
|
3
|
+
"version": "12.9.1",
|
|
4
4
|
"description": "Command-Line Interface for Firebase with experimental monorepo support",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"glob": "^7.1.2",
|
|
114
114
|
"google-auth-library": "^7.11.0",
|
|
115
115
|
"inquirer": "^8.2.0",
|
|
116
|
-
"isolate-package": "^1.4.1-
|
|
116
|
+
"isolate-package": "^1.4.1-8",
|
|
117
117
|
"js-yaml": "^3.13.1",
|
|
118
118
|
"jsonwebtoken": "^9.0.0",
|
|
119
119
|
"leven": "^3.1.0",
|