Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ddc3472
feat(app-dist): typescript migrations
MichaelVerdon Jan 27, 2026
328e58b
fix: tests
MichaelVerdon Jan 27, 2026
0231ead
chore: format
MichaelVerdon Feb 2, 2026
1d86149
fix: iOS debug build configuration in detox
MichaelVerdon Feb 2, 2026
c7cf036
fix: valid_archs on release
MichaelVerdon Feb 2, 2026
12c0f00
chore: revert workflow changes
MichaelVerdon Feb 2, 2026
29c57d2
fix: bump xcode version for ci
MichaelVerdon Feb 2, 2026
8599bc7
chore: PR Corrections
MichaelVerdon Feb 3, 2026
04ed2db
chore: use AppDistribution instead of Module
MichaelVerdon Feb 3, 2026
dcd6af7
chore: refactor
MichaelVerdon Feb 3, 2026
899f1b7
Merge branch 'main' into app-distribution-ts-migrations
MichaelVerdon Feb 3, 2026
34c1cfb
chore: format
MichaelVerdon Feb 3, 2026
4964180
fix: apply changes to match storage pr
MichaelVerdon Mar 3, 2026
14a4bee
fix: .call() for modular methods and handle module typing
MichaelVerdon Mar 3, 2026
64578eb
test(app-distribution): align V9 deprecation tests with storage pattern
MichaelVerdon Mar 3, 2026
c089c6f
test(app-distribution): drop statics V9 deprecation check
MichaelVerdon Mar 3, 2026
accf181
format: js format in modular.ts
MichaelVerdon Mar 3, 2026
f4f837f
refactor: drop FirebaseAppDistributionTypes from app-distribution types
MichaelVerdon Mar 3, 2026
c58ad33
refactor: move app module augmentation into types/namespaced
MichaelVerdon Mar 3, 2026
c6570c9
chore: use type-test.ts in tsconfig and align type-test with storage
MichaelVerdon Mar 3, 2026
5f12b94
fix: expose Statics from modular API
MichaelVerdon Mar 3, 2026
ed51cc3
refactor: move WithModularDeprecationArg to types/internal
MichaelVerdon Mar 3, 2026
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
76 changes: 42 additions & 34 deletions packages/app-distribution/__tests__/app-distribution.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,49 +79,57 @@ describe('appDistribution()', function () {
{
get: () =>
jest.fn().mockResolvedValue({
constants: {
isTesterSignedIn: true,
},
displayVersion: '1.0.0',
buildVersion: '123',
releaseNotes: null,
downloadURL: 'https://example.com',
isExpired: false,
} as never),
},
);
});
});

it('isTesterSignedIn', function () {
const appDistribution = getAppDistribution();
appDistributionV9Deprecation(
() => isTesterSignedIn(appDistribution),
() => appDistribution.isTesterSignedIn(),
'isTesterSignedIn',
);
});
describe('AppDistribution', function () {
it('isTesterSignedIn()', function () {
const appDistribution = getAppDistribution();
appDistributionV9Deprecation(
() => isTesterSignedIn(appDistribution),
// @ts-expect-error Combines modular and namespace API
() => appDistribution.isTesterSignedIn(),
'isTesterSignedIn',
);
});

it('signInTester', function () {
const appDistribution = getAppDistribution();
appDistributionV9Deprecation(
() => signInTester(appDistribution),
() => appDistribution.signInTester(),
'signInTester',
);
});
it('signInTester()', function () {
const appDistribution = getAppDistribution();
appDistributionV9Deprecation(
() => signInTester(appDistribution),
// @ts-expect-error Combines modular and namespace API
() => appDistribution.signInTester(),
'signInTester',
);
});

it('checkForUpdate', function () {
const appDistribution = getAppDistribution();
appDistributionV9Deprecation(
() => checkForUpdate(appDistribution),
() => appDistribution.checkForUpdate(),
'checkForUpdate',
);
});
it('checkForUpdate()', function () {
const appDistribution = getAppDistribution();
appDistributionV9Deprecation(
() => checkForUpdate(appDistribution),
// @ts-expect-error Combines modular and namespace API
() => appDistribution.checkForUpdate(),
'checkForUpdate',
);
});

it('signOutTester', function () {
const appDistribution = getAppDistribution();
appDistributionV9Deprecation(
() => signOutTester(appDistribution),
() => appDistribution.signOutTester(),
'signOutTester',
);
it('signOutTester()', function () {
const appDistribution = getAppDistribution();
appDistributionV9Deprecation(
() => signOutTester(appDistribution),
// @ts-expect-error Combines modular and namespace API
() => appDistribution.signOutTester(),
'signOutTester',
);
});
});
});
});
88 changes: 0 additions & 88 deletions packages/app-distribution/lib/index.js

This file was deleted.

27 changes: 27 additions & 0 deletions packages/app-distribution/lib/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright (c) 2016-present Invertase Limited & Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this library except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

// Export types from types/app-distribution (public/modular API; Statics re-exported via modular)
export type { AppDistributionRelease, AppDistribution } from './types/app-distribution';
export type { FirebaseAppDistributionTypes } from './types/namespaced';

// Export modular API functions
export * from './modular';

// Export namespaced API
export * from './namespaced';
export { default } from './namespaced';
69 changes: 69 additions & 0 deletions packages/app-distribution/lib/modular.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import { getApp } from '@react-native-firebase/app';
import { MODULAR_DEPRECATION_ARG } from '@react-native-firebase/app/dist/module/common';
import type { ReactNativeFirebase } from '@react-native-firebase/app';
import type { AppDistribution, AppDistributionRelease } from './types/app-distribution';
import type { AppDistributionInternal, WithModularDeprecationArg } from './types/internal';

export type { Statics } from './types/app-distribution';

export type FirebaseAppDistribution = AppDistribution;

/**
* Get an App Distribution instance for the specified app or current app.
*/
export function getAppDistribution(app?: ReactNativeFirebase.FirebaseApp): FirebaseAppDistribution {
if (app) {
return getApp(app.name).appDistribution() as FirebaseAppDistribution;
}
return getApp().appDistribution() as FirebaseAppDistribution;
}

/**
* Returns true if the App Distribution tester is signed in.
* If not an iOS device, it always rejects, as neither false nor true seem like a sensible default.
*/
export function isTesterSignedIn(appDistribution: FirebaseAppDistribution): Promise<boolean> {
return (
(appDistribution as AppDistributionInternal).isTesterSignedIn as WithModularDeprecationArg<
AppDistributionInternal['isTesterSignedIn']
>
).call(appDistribution, MODULAR_DEPRECATION_ARG);
}

/**
* Sign-in the App Distribution tester
* If not an iOS device, it always rejects, as no defaults seem sensible.
*/
export function signInTester(appDistribution: FirebaseAppDistribution): Promise<void> {
return (
(appDistribution as AppDistributionInternal).signInTester as WithModularDeprecationArg<
AppDistributionInternal['signInTester']
>
).call(appDistribution, MODULAR_DEPRECATION_ARG);
}

/**
* Check to see whether a new distribution is available
* If not an iOS device, it always rejects, as no default response seems sensible.
*/
export function checkForUpdate(
appDistribution: FirebaseAppDistribution,
): Promise<AppDistributionRelease> {
return (
(appDistribution as AppDistributionInternal).checkForUpdate as WithModularDeprecationArg<
AppDistributionInternal['checkForUpdate']
>
).call(appDistribution, MODULAR_DEPRECATION_ARG);
}

/**
* Sign out App Distribution tester
* If not an iOS device, it always rejects, as no default response seems sensible.
*/
export function signOutTester(appDistribution: FirebaseAppDistribution): Promise<void> {
return (
(appDistribution as AppDistributionInternal).signOutTester as WithModularDeprecationArg<
AppDistributionInternal['signOutTester']
>
).call(appDistribution, MODULAR_DEPRECATION_ARG);
}
39 changes: 0 additions & 39 deletions packages/app-distribution/lib/modular/index.d.ts

This file was deleted.

50 changes: 0 additions & 50 deletions packages/app-distribution/lib/modular/index.js

This file was deleted.

Loading
Loading