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

chore: Project setup #277

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ buck-out/
*.jsbundle

# CocoaPods
Apps/APN/ios/Pods/
Pods

package-lock.json
lib/module/index.js
.Bundle

# Yarn
.yarn/install-state.gz
yarn.lock

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving yarn.lock out of .gitignore as missing lock file is throwing error when example project is run. Here is the detail if you want to learn more about the yarn error.

# Env to avoid accidental publishing workplace credentials
UntrackedEnv.swift
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "cio-native-sdks/customerio-ios"]
path = cio-native-sdks/customerio-ios
url = https://github.com/customerio/customerio-ios
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should ideally add branch in here, will help with testing changes on a specific branch.

894 changes: 894 additions & 0 deletions .yarn/releases/yarn-4.3.1.cjs

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
nmHoistingLimits: workspaces

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.3.1.cjs
46 changes: 46 additions & 0 deletions CustomerIOReactNative.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
require "json"

package = JSON.parse(File.read(File.join(__dir__, "package.json")))
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'

Pod::Spec.new do |s|
s.name = "CustomerIOReactNative"
s.version = package["version"]
s.summary = package["description"]
s.homepage = package["homepage"]
s.license = package["license"]
s.authors = package["author"]

s.platforms = { :ios => min_ios_version_supported }
s.source = { :git => "https://github.com/customerio/customerio-reactnative.git", :tag => "#{s.version}" }

s.source_files = "ios/wrappers/**/*.{h,m,mm,swift}"
s.dependency "CustomerIO/DataPipelines"
s.dependency "CustomerIO/MessagingInApp"
s.dependency "CustomerIO/MessagingPush"

# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.

if respond_to?(:install_modules_dependencies, true)
install_modules_dependencies(s)

else
s.dependency "React-Core"

# Don't install the dependencies when we run `pod install` in the old architecture.
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
s.pod_target_xcconfig = {
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
}
s.dependency "React-Codegen"
s.dependency "RCT-Folly"
s.dependency "RCTRequired"
s.dependency "RCTTypeSafety"
s.dependency "ReactCommon/turbomodule/core"
end
end
end
32 changes: 32 additions & 0 deletions CustomerIOReactNativePush.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
require "json"

package = JSON.parse(File.read(File.join(__dir__, "package.json")))

Pod::Spec.new do |s|
s.name = "CustomerIOReactNativePush"
s.version = package["version"]
s.summary = package["description"]
s.homepage = package["homepage"]
s.license = package["license"]
s.authors = package["author"]

s.platforms = { :ios => min_ios_version_supported }
s.source = { :git => "https://github.com/customerio/customerio-reactnative.git", :tag => "#{s.version}" }

s.pod_target_xcconfig = {
"DEFINES_MODULE" => "YES",
}

s.default_subspec = 'APN'

s.subspec 'APN' do |ss|
ss.dependency "CustomerIO/MessagingPushAPN"
ss.source_files = "ios/apn/**/*.{h,m,mm,swift}"
end

s.subspec 'FCM' do |ss|
ss.dependency "CustomerIO/MessagingPushFCM"
ss.source_files = "ios/fcm/**/*.{h,m,mm,swift}"
end

end
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
presets: ['module:@react-native/babel-preset'],
};
1 change: 1 addition & 0 deletions cio-native-sdks/customerio-ios
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When this package gets pushed to npm, is this directory excluded?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see this directory in gitignore file hence I assume that it will be pushed to npm.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I believe it should be ideally in .gitignore or .npmignore. I am sure there are reasons behind Ahmed proposing using ios native SDK as a sub-module and one of them is "Made the native iOS repo a git submodule of this repo, simplifying the process of starting and validating relevant native changes within the RN repo." but this also makes me wonder if this change is to help testing or some other reason that's not called out.

Submodule customerio-ios added at 6af400
31 changes: 0 additions & 31 deletions customerio-reactnative-richpush.podspec

This file was deleted.

44 changes: 0 additions & 44 deletions customerio-reactnative.podspec

This file was deleted.

9 changes: 0 additions & 9 deletions ios/CustomerioInAppMessaging.m

This file was deleted.

39 changes: 0 additions & 39 deletions ios/CustomerioReactnative.m

This file was deleted.

Loading
Loading