Skip to content

V11 - Remove functions node bundle #8507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 36 commits into from
Sep 23, 2024
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4bdab6f
Removed node-fetch from rules-unit-testing
DellaBitta Sep 10, 2024
45723bb
Draft emulator impl not quite working.
DellaBitta Sep 11, 2024
5ee8eb7
Wrap the emulator download in a promise
DellaBitta Sep 11, 2024
84f0770
Update yarn.lock
DellaBitta Sep 12, 2024
afea52d
emulator.ts reject/resolve fix. formatting.
DellaBitta Sep 12, 2024
79753b2
Update emaultor.ts with chmod operation.
DellaBitta Sep 12, 2024
ba32125
emulator.ts remove setBinaryPath & add comments.
DellaBitta Sep 12, 2024
6fdd758
Remove undici from messaging testing
DellaBitta Sep 12, 2024
0601594
Remove undici from auth source and package.json
DellaBitta Sep 12, 2024
2c4a46e
auth format
DellaBitta Sep 12, 2024
3b93ffe
repo-scripts
DellaBitta Sep 12, 2024
97eb7a3
Auth: remove custom webpack step for undici
DellaBitta Sep 12, 2024
9c010b2
Remove undici from firestore
DellaBitta Sep 13, 2024
69d789c
Lint fix.
DellaBitta Sep 13, 2024
c8c64e7
Remove fetch from functions
DellaBitta Sep 13, 2024
b16903b
fix build
DellaBitta Sep 13, 2024
0c05f70
Fixed build?
DellaBitta Sep 13, 2024
5077ae3
format
DellaBitta Sep 13, 2024
7a6691b
Remove undici from storage
DellaBitta Sep 13, 2024
033c4dc
Remove undici from changelog generator
DellaBitta Sep 13, 2024
9aa1f75
Fix storage test for node
DellaBitta Sep 13, 2024
f35d2a0
Remove no longer required eslint-disable comments.
DellaBitta Sep 16, 2024
1e25ff2
Functions export public-types
DellaBitta Sep 16, 2024
7acb14e
Auth - remove superfluous casting.
DellaBitta Sep 19, 2024
498bc7b
Fix hanging promise in emulator download code
DellaBitta Sep 19, 2024
10a6149
Remove fetch casting in auth-compat
DellaBitta Sep 20, 2024
10e089e
Changeset
DellaBitta Sep 20, 2024
d517b14
Changeset 2
DellaBitta Sep 20, 2024
399efc0
Remove functions node bundle
DellaBitta Sep 20, 2024
8bb819b
Changeset
DellaBitta Sep 20, 2024
49f0618
Change test:node target file
DellaBitta Sep 20, 2024
3f14414
Update functions-compat
DellaBitta Sep 20, 2024
8cb2f4d
Merge branch 'v11' into v11-remove-func-node-bundle
DellaBitta Sep 20, 2024
c055cfe
remove --file src/index.node.ts from functions-compat
DellaBitta Sep 20, 2024
5e34319
Merge branch 'v11' into v11-remove-func-node-bundle
DellaBitta Sep 22, 2024
9da8f06
Delete index.node.ts
DellaBitta Sep 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Removed node-fetch from rules-unit-testing
DellaBitta committed Sep 10, 2024
commit 4bdab6fa6af32f9d1b6c66437cce126ae0508c9e
4 changes: 0 additions & 4 deletions packages/rules-unit-testing/package.json
Original file line number Diff line number Diff line change
@@ -53,9 +53,5 @@
"typings": "dist/index.d.ts",
"bugs": {
"url": "https://github.com/firebase/firebase-js-sdk/issues"
},
"dependencies": {
"node-fetch": "2.6.7",
"@types/node-fetch": "2.6.4"
}
}
5 changes: 2 additions & 3 deletions packages/rules-unit-testing/src/impl/discovery.ts
Original file line number Diff line number Diff line change
@@ -16,7 +16,6 @@
*/

import { EmulatorConfig, HostAndPort } from '../public_types';
import nodeFetch from 'node-fetch';
import { makeUrl, fixHostname } from './url';

/**
@@ -27,9 +26,9 @@ import { makeUrl, fixHostname } from './url';
*/
export async function discoverEmulators(
hub: HostAndPort,
fetch: typeof nodeFetch = nodeFetch
fetchImpl: typeof fetch = fetch
): Promise<DiscoveredEmulators> {
const res = await fetch(makeUrl(hub, '/emulators'));
const res = await fetchImpl(makeUrl(hub, '/emulators'));
if (!res.ok) {
throw new Error(
`HTTP Error ${res.status} when attempting to reach Emulator Hub at ${res.url}, are you sure it is running?`
1 change: 0 additions & 1 deletion packages/rules-unit-testing/src/impl/rules.ts
Original file line number Diff line number Diff line change
@@ -17,7 +17,6 @@

import { HostAndPort } from '../public_types';
import { makeUrl } from './url';
import fetch from 'node-fetch';

/**
* @private
1 change: 0 additions & 1 deletion packages/rules-unit-testing/src/impl/test_environment.ts
Original file line number Diff line number Diff line change
@@ -15,7 +15,6 @@
* limitations under the License.
*/

import fetch from 'node-fetch';
import firebase from 'firebase/compat/app';
import 'firebase/compat/firestore';
import 'firebase/compat/database';
1 change: 0 additions & 1 deletion packages/rules-unit-testing/src/util.ts
Original file line number Diff line number Diff line change
@@ -21,7 +21,6 @@ import {
} from './impl/discovery';
import { fixHostname, makeUrl } from './impl/url';
import { HostAndPort } from './public_types';
import fetch from 'node-fetch';

/**
* Run a setup function with background Cloud Functions triggers disabled. This can be used to
2 changes: 1 addition & 1 deletion packages/rules-unit-testing/test/impl/discovery.test.ts
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@ describe('discoverEmulators()', () => {
// Connect to port:0. Should always fail (although error codes may differ among OSes).
await expect(
discoverEmulators({ host: '127.0.0.1', port: 0 })
).to.be.rejectedWith(/EADDRNOTAVAIL|ECONNREFUSED/);
).to.be.rejectedWith(/EADDRNOTAVAIL|ECONNREFUSED|fetch failed/);
});

it('throws if response status is not 2xx', async () => {
4 changes: 2 additions & 2 deletions packages/rules-unit-testing/test/util.test.ts
Original file line number Diff line number Diff line change
@@ -165,7 +165,7 @@ describe('assertFails()', () => {

describe('withFunctionTriggersDisabled()', () => {
it('disabling function triggers does not throw, returns value', async function () {
const fetchSpy = sinon.spy(require('node-fetch'), 'default');
const fetchSpy = sinon.spy(globalThis, 'fetch');

const res = await withFunctionTriggersDisabled(() => {
return Promise.resolve(1234);
@@ -176,7 +176,7 @@ describe('withFunctionTriggersDisabled()', () => {
});

it('disabling function triggers always re-enables, event when the function throws', async function () {
const fetchSpy = sinon.spy(require('node-fetch'), 'default');
const fetchSpy = sinon.spy(globalThis, 'fetch');

const res = withFunctionTriggersDisabled(() => {
throw new Error('I throw!');
1 change: 0 additions & 1 deletion scripts/emulator-testing/emulators/emulator.ts
Original file line number Diff line number Diff line change
@@ -21,7 +21,6 @@ import { ChildProcess } from 'child_process';
import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import fetch from 'node-fetch';
// @ts-ignore
import * as tmp from 'tmp';