Skip to content
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

feat!: typescript rewrite #41

Merged
merged 34 commits into from
Jan 6, 2022
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e65103f
refactor: initial typescript refactorings
dylancom Dec 14, 2021
cd8ed69
refactor: all ads are ts files now
dylancom Dec 14, 2021
c53f99a
refactor: 137 ts errors to go
dylancom Dec 14, 2021
c54a0e6
refactor: further progress on ts integration
dylancom Dec 14, 2021
0b4a809
feat: remove ts checks on internal
dylancom Dec 14, 2021
e5f89cb
refactor: more ts conversions
dylancom Dec 14, 2021
401bf71
refactor: fix ts errors
dylancom Dec 15, 2021
56f8840
feat: integrate builder bob
dylancom Dec 15, 2021
e072223
chore: remove output files
dylancom Dec 15, 2021
33e3ff2
refactor: prepare task
dylancom Dec 15, 2021
6cfd09e
refactor: use enum for banner size constants
dylancom Dec 15, 2021
85691d0
refactor: default test ids type
dylancom Dec 15, 2021
2338c5e
feat: make use of enum
dylancom Dec 15, 2021
73ccb8b
fix: add missing exports
dylancom Dec 15, 2021
0a6525f
fix: ignore lib
dylancom Dec 15, 2021
ebedeb4
fix types
dylancom Dec 15, 2021
664ec0a
fix: jest config
dylancom Dec 15, 2021
7fe22d1
Update src/types/AdsConsent.interface.ts
dylancom Dec 17, 2021
307b9c5
Update src/types/RequestConfiguration.ts
dylancom Dec 17, 2021
e7986d2
refactor: re-use build task
dylancom Dec 17, 2021
338511f
Merge branch 'feature/ts-rewrite' of https://github.com/dylancom/reac…
dylancom Dec 17, 2021
9527a4b
refactor: use global undefined
dylancom Dec 17, 2021
d147da1
add enum InitializationState
dylancom Dec 19, 2021
cb853a2
use enum and import eventemitter type
dylancom Dec 19, 2021
cbcaf0e
no emit
dylancom Dec 19, 2021
89bdf38
remove explicit any
dylancom Dec 19, 2021
008813e
refactor: use named exports
dylancom Dec 20, 2021
5590a8e
remove unused error methods
dylancom Dec 20, 2021
4aa8bc0
bring back deleted files
dylancom Dec 20, 2021
4491bef
added types to common
dylancom Dec 20, 2021
4e6e2e1
completed ts rewrite
dylancom Dec 20, 2021
eccf803
improved interface naming
dylancom Dec 20, 2021
bc77692
use the same naming as the native class MobileAds
dylancom Dec 20, 2021
44741f2
git track uppercase change
dylancom Dec 20, 2021
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ google-services.json
GoogleService-Info.plist

# generated files
src/version.ts
RNFBVersion.m
ReactNativeFirebaseVersion.java

Expand All @@ -564,3 +565,6 @@ spelling.json
# Gatsby / Website
website/.cache
website/public

# generated files by bob
lib/
2 changes: 1 addition & 1 deletion __tests__/consent.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AdsConsent } from '../lib';
import { AdsConsent } from '../src';

describe('Google Ads AdsConsent', function () {
describe('requestInfoUpdate', function () {
Expand Down
5 changes: 2 additions & 3 deletions __tests__/googleAds.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import admob, { GoogleAdsTypes } from '../lib';
import admob, { MaxAdContentRating } from '../src';

describe('Admob', function () {
describe('setRequestConfiguration()', function () {
Expand All @@ -13,8 +13,7 @@ describe('Admob', function () {
it('throws if maxAdContentRating is invalid', function () {
expect(() =>
admob().setRequestConfiguration({
maxAdContentRating:
'Y' as GoogleAdsTypes.MaxAdContentRating[keyof GoogleAdsTypes.MaxAdContentRating],
maxAdContentRating: 'Y' as MaxAdContentRating,
}),
).toThrowError(
"setRequestConfiguration(*) 'requestConfiguration.maxAdContentRating' expected on of MaxAdContentRating.G, MaxAdContentRating.PG, MaxAdContentRating.T or MaxAdContentRating.MA",
Expand Down
2 changes: 1 addition & 1 deletion __tests__/interstitial.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { InterstitialAd } from '../lib';
import { InterstitialAd } from '../src';

describe('Google Ads Interstitial', function () {
describe('createForAdRequest', function () {
Expand Down
11 changes: 2 additions & 9 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
module.exports = {
maxConcurrency: 10,
preset: './node_modules/react-native/jest-preset.js',
transform: {
'^.+\\.(js)$': '<rootDir>/node_modules/babel-jest',
'\\.(ts|tsx)$': 'ts-jest',
},
preset: 'react-native',
modulePathIgnorePatterns: ['<rootDir>/example/node_modules', '<rootDir>/lib/'],
setupFiles: ['./jest.setup.ts'],
testRegex: '(/^__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$',
modulePaths: ['node_modules'],
moduleDirectories: ['node_modules'],
moduleFileExtensions: ['ts', 'tsx', 'js'],
};
24 changes: 0 additions & 24 deletions lib/AdEventType.js

This file was deleted.

22 changes: 0 additions & 22 deletions lib/AdsConsentStatus.js

This file was deleted.

28 changes: 0 additions & 28 deletions lib/BannerAdSize.js

This file was deleted.

21 changes: 0 additions & 21 deletions lib/RewardedAdEventType.js

This file was deleted.

77 changes: 0 additions & 77 deletions lib/ads/InterstitialAd.js

This file was deleted.

76 changes: 0 additions & 76 deletions lib/ads/RewardedAd.js

This file was deleted.

Loading