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

initial app setup #1

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
d2d2799
Update package.json
JorrinKievit May 1, 2024
8280fa9
Update pnpm-lock.yaml
JorrinKievit May 1, 2024
e308033
buffer style color
JorrinKievit May 1, 2024
4484bfe
chore: bump action version
castdrian May 1, 2024
918b45c
feat: marketplace module
castdrian May 2, 2024
eedbbf3
chore: bump tamagui since it appears to be broken otherwise
castdrian May 2, 2024
d1b762d
chore: cleanup
castdrian May 2, 2024
26aea32
chore: adjust metro config for eventual new arch release
castdrian May 2, 2024
486d242
fix: prevent screen sleeping on android
castdrian May 2, 2024
67a879f
refactor: test bun (possibly revert if needed)
castdrian May 2, 2024
64c99a5
fix: spacing in action
castdrian May 2, 2024
988bd27
fix: stupidity
castdrian May 2, 2024
26524f9
feat: add providers to packages
castdrian May 2, 2024
cab613f
providers linter + build step
JorrinKievit May 2, 2024
67c811d
fix ci
JorrinKievit May 2, 2024
7b50fa6
chore: deps
castdrian May 3, 2024
2a75f95
fix: use quick crypto main branch
castdrian May 3, 2024
ba612af
chore: skip ios build if repo owner matches
castdrian May 3, 2024
558816d
chore: not using eas
castdrian May 3, 2024
7f8a741
bump version
JorrinKievit May 3, 2024
4961044
lint
JorrinKievit May 3, 2024
07a64d1
idk whats going on
JorrinKievit May 6, 2024
38e220c
chore: revert to stable quick crypto
castdrian May 7, 2024
9576ce3
chore: format your ass
castdrian May 7, 2024
6b09878
chore: fix typo
castdrian May 7, 2024
684c08b
refactor: ditch context menu for action sheet
castdrian May 7, 2024
ecebde9
feat: finish action sheet context menu
castdrian May 7, 2024
3bc17a6
chore: comment out social links
castdrian May 7, 2024
2d98413
start with expo-video (broken)
JorrinKievit Aug 12, 2024
764d8fa
revert
JorrinKievit Aug 12, 2024
a40c5f9
revert back to pnpm because bun does not handle peer dependency confl…
JorrinKievit Aug 13, 2024
9bc7dd8
lint
JorrinKievit Aug 13, 2024
7c8b584
lint again
JorrinKievit Aug 13, 2024
d5a136c
yeet sudo providers in here
JorrinKievit Aug 14, 2024
415e3ce
get rid of the tests
JorrinKievit Aug 14, 2024
8f0b90d
some improvements (still broken)
JorrinKievit Aug 14, 2024
ad83de9
refactor: rewrite certificate check module to be more detailed
castdrian Aug 16, 2024
1bf0cc5
fix: eat my ass
castdrian Aug 16, 2024
38a6d8f
chore: expo 51 finally fixed this
castdrian Aug 17, 2024
6c5bb84
fix video player crashing on unmount
JorrinKievit Aug 19, 2024
3558cf2
poll video timer
JorrinKievit Aug 19, 2024
02ddd59
fix video slider
JorrinKievit Sep 8, 2024
169c88e
upgrade some packages
JorrinKievit Nov 17, 2024
ee20dc6
fix infinite rerender
JorrinKievit Nov 17, 2024
95463df
fix pipeline
JorrinKievit Nov 17, 2024
fa68bcc
enable ipa
JorrinKievit Nov 17, 2024
c693173
Update build-mobile.yml
JorrinKievit Nov 17, 2024
6442d3b
Update build-mobile.yml
JorrinKievit Nov 17, 2024
fe8dcd6
start with expo-audio
JorrinKievit Dec 3, 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
21 changes: 18 additions & 3 deletions .github/workflows/build-mobile.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
name: build mobile app

on:
pull_request:
branches:
- "*"
workflow_dispatch: # Manual trigger
inputs:
target:
type: choice
description: "Choose the build target"
required: true
default: "android"
options:
- android
- ios

permissions:
contents: write
pull-requests: write

jobs:
build-android:
if: ${{ inputs.target == 'android' }} # Runs only if 'android' is selected
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -47,6 +55,9 @@ jobs:
- name: Install dependencies
run: corepack enable && pnpm install

- name: Build dependencies
run: pnpm run build

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

Expand All @@ -60,6 +71,7 @@ jobs:
path: ./apps/expo/android/app/build/movie-web.apk

build-ios:
if: ${{ inputs.target == 'ios' }} # Runs only if 'ios' is selected
runs-on: macos-14

steps:
Expand Down Expand Up @@ -87,6 +99,9 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Build dependencies
run: pnpm run build

- name: Cache Pods
uses: actions/cache@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-mobile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: release mobile app
on:
push:
branches:
- main
- master
workflow_dispatch:

permissions:
Expand Down
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ coverage
dist/
expo-env.d.ts
apps/expo/.gitignore
ios/
android/
!modules/*/ios/
!modules/*/android/

# Ignore top-level ios and android directories
apps/expo/ios/
apps/expo/android/

# production
build
Expand Down
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

21 changes: 8 additions & 13 deletions apps/expo/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { ExpoConfig } from "expo/config";

import { version } from "./package.json";
import withRemoveiOSNotificationEntitlement from "./src/plugins/withRemoveiOSNotificationEntitlement";

const defineConfig = (): ExpoConfig => ({
name: "movie-web",
Expand All @@ -20,20 +19,19 @@ const defineConfig = (): ExpoConfig => ({
},
assetBundlePatterns: ["**/*"],
ios: {
bundleIdentifier: "dev.movieweb.app",
newArchEnabled: true,
bundleIdentifier: "dev.movieweb.mobile",
supportsTablet: true,
requireFullScreen: true,
infoPlist: {
CFBundleName: "movie-web",
NSPhotoLibraryUsageDescription:
"This app saves videos to the photo library.",
NSAppTransportSecurity: {
NSAllowsArbitraryLoads: true,
},
},
},
android: {
package: "dev.movieweb.app",
newArchEnabled: true,
package: "dev.movieweb.mobile",
permissions: ["WRITE_SETTINGS"],
},
web: {
Expand All @@ -46,7 +44,8 @@ const defineConfig = (): ExpoConfig => ({
},
plugins: [
"expo-router",
[withRemoveiOSNotificationEntitlement as unknown as string],
"expo-video",
"expo-audio",
[
"expo-screen-orientation",
{
Expand All @@ -59,12 +58,8 @@ const defineConfig = (): ExpoConfig => ({
android: {
minSdkVersion: 24,
packagingOptions: {
pickFirst: [
"lib/x86/libcrypto.so",
"lib/x86_64/libcrypto.so",
"lib/armeabi-v7a/libcrypto.so",
"lib/arm64-v8a/libcrypto.so",
],
pickFirst: ["**/libcrypto.so"],
excludes: ["**/libreactnative.so"],
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion apps/expo/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = function (api) {
{
alias: {
crypto: "react-native-quick-crypto",
stream: "stream-browserify",
stream: "readable-stream",
buffer: "@craftzdog/react-native-buffer",
},
},
Expand Down
31 changes: 0 additions & 31 deletions apps/expo/eas.json

This file was deleted.

18 changes: 15 additions & 3 deletions apps/expo/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Learn more: https://docs.expo.dev/guides/monorepos/
const { getDefaultConfig } = require("expo/metro-config");
const { mergeConfig } = require("metro-config");
const { FileStore } = require("metro-cache");
const { withTamagui } = require("@tamagui/metro-plugin");

Expand All @@ -8,9 +9,20 @@ const path = require("path");
module.exports = withTurborepoManagedCache(
withMonorepoPaths(
withTamagui(
getDefaultConfig(__dirname, {
isCSSEnabled: true,
}),
mergeConfig(
getDefaultConfig(__dirname, {
isCSSEnabled: true,
}),
{
transformer: {
getTransformOptions: async () => ({
transform: {
inlineRequires: true,
},
}),
},
},
),
{
components: ["tamagui"],
config: "./tamagui.config.ts",
Expand Down
6 changes: 6 additions & 0 deletions apps/expo/modules/check-ios-app-id/expo-module.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"platforms": ["ios"],
"ios": {
"modules": ["CheckIosAppIdModule"]
}
}
9 changes: 9 additions & 0 deletions apps/expo/modules/check-ios-app-id/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import CheckIosAppIdModule from "./src/CheckIosAppIdModule";

export function isIncorrectAppId(): boolean {
return CheckIosAppIdModule.isIncorrectAppId();
}

export function getAppId(): string {
return CheckIosAppIdModule.getAppId();
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Pod::Spec.new do |s|
s.name = 'CheckIosCertificate'
s.name = 'CheckIosAppId'
s.version = '1.0.0'
s.summary = 'Check if iOS certificate is Development or Production.'
s.description = 'Check if iOS certificate is Development or Production.'
s.summary = 'Check if iOS App ID is explicit or wildcard.'
s.description = 'Check if iOS App ID is explicit or wildcard.'
s.author = 'castdrian'
s.homepage = 'https://docs.expo.dev/modules/'
s.platforms = { :ios => '13.4', :tvos => '13.4' }
Expand Down
54 changes: 54 additions & 0 deletions apps/expo/modules/check-ios-app-id/ios/CheckIosAppIdModule.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import ExpoModulesCore

public class CheckIosAppIdModule: Module {
public func definition() -> ModuleDefinition {
Name("CheckIosAppId")

Function("isIncorrectAppId") { () -> Bool in
#if targetEnvironment(simulator)
return false
#else
guard let appId = self.extractAppId() else {
return false
}

return appId.hasSuffix(".*") || (Bundle.main.bundleIdentifier != nil && !appId.contains(Bundle.main.bundleIdentifier!))
#endif
}

// Function to get the App ID from the provisioning profile
Function("getAppId") { () -> String? in
#if targetEnvironment(simulator)
return nil
#else
return self.extractAppId()
#endif
}
}

// Helper function to extract the application-identifier value from the provisioning profile
private func extractAppId() -> String? {
guard let filePath = Bundle.main.path(forResource: "embedded", ofType: "mobileprovision") else {
return nil
}

let fileURL = URL(fileURLWithPath: filePath)
do {
let data = try String(contentsOf: fileURL, encoding: .ascii)
let cleared = data.components(separatedBy: .whitespacesAndNewlines).joined()

// Search for the application-identifier key and extract its value
if let range = cleared.range(of: "<key>application-identifier</key><string>") {
let substring = cleared[range.upperBound...]
if let endRange = substring.range(of: "</string>") {
let appId = String(substring[..<endRange.lowerBound])
return appId
}
}
} catch {
print("Error reading provisioning profile: \(error)")
return nil
}
return nil
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { UnavailabilityError } from "expo-modules-core";

export default {
isIncorrectAppId(): boolean {
throw new UnavailabilityError("CheckIosAppId", "isIncorrectAppId");
},
getAppId(): string {
throw new UnavailabilityError("CheckIosAppId", "getAppId");
},
};
11 changes: 11 additions & 0 deletions apps/expo/modules/check-ios-app-id/src/CheckIosAppIdModule.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { requireNativeModule } from "expo-modules-core";

interface CheckIosAppIdModule {
isIncorrectAppId(): boolean;
getAppId(): string;
}

// It loads the native module object from the JSI or falls back to
// the bridge module (from NativeModulesProxy) if the remote debugger is on.
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
export default requireNativeModule("CheckIosAppId") as CheckIosAppIdModule;

This file was deleted.

11 changes: 0 additions & 11 deletions apps/expo/modules/check-ios-certificate/index.ts

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"platforms": ["ios"],
"ios": {
"modules": ["CheckIosMarketplaceModule"]
}
}
6 changes: 6 additions & 0 deletions apps/expo/modules/check-ios-marketplace/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import type { MarketplaceSource } from "./src/CheckIosMarketplaceModule";
import CheckIosMarketplaceModule from "./src/CheckIosMarketplaceModule";

export async function getCurrentMarketplaceAsync(): Promise<MarketplaceSource> {
return CheckIosMarketplaceModule.getCurrentMarketplaceAsync();
}
Loading
Loading