@norcy/react-native-toolkit 0.2.7 → 0.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/android/build.gradle +7 -0
- package/android/buildscript.gradle +15 -0
- package/android/dependencies.gradle +149 -0
- package/android/gradle.properties +4 -4
- package/android/root.gradle +37 -0
- package/android/settings.gradle +2 -0
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/norcy/reactnativetoolkit/BaseToolkitActivity.java +42 -0
- package/android/src/main/java/com/norcy/reactnativetoolkit/BaseToolkitApplication.java +63 -0
- package/android/src/main/java/com/norcy/reactnativetoolkit/CheckPackageInstallationModule.java +48 -0
- package/android/src/main/java/com/norcy/reactnativetoolkit/NCYAPI.java +191 -0
- package/android/src/main/java/com/norcy/reactnativetoolkit/NCYReport.java +48 -0
- package/android/src/main/java/com/norcy/reactnativetoolkit/PreferencesManager.java +50 -0
- package/android/src/main/java/com/{norcyreactnativetoolkit → norcy/reactnativetoolkit}/ReactNativeToolkitModule.kt +2 -1
- package/android/src/main/java/com/{norcyreactnativetoolkit → norcy/reactnativetoolkit}/ReactNativeToolkitPackage.kt +8 -2
- package/android/src/main/java/com/norcy/reactnativetoolkit/UMengManager.java +54 -0
- package/lib/commonjs/AppLink.js.map +1 -1
- package/lib/commonjs/SentryManager.js +31 -23
- package/lib/commonjs/SentryManager.js.map +1 -1
- package/lib/commonjs/Tool.js +26 -0
- package/lib/commonjs/Tool.js.map +1 -1
- package/lib/module/AppLink.js.map +1 -1
- package/lib/module/SentryManager.js +32 -24
- package/lib/module/SentryManager.js.map +1 -1
- package/lib/module/Tool.js +27 -1
- package/lib/module/Tool.js.map +1 -1
- package/lib/typescript/AppLink.d.ts +1 -2
- package/lib/typescript/AppLink.d.ts.map +1 -1
- package/lib/typescript/SentryManager.d.ts.map +1 -1
- package/lib/typescript/Tool.d.ts +3 -0
- package/lib/typescript/Tool.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/AppLink.ts +2 -3
- package/src/SentryManager.ts +37 -27
- package/src/Tool.ts +39 -1
- package/.circleci/config.yml +0 -98
- package/.editorconfig +0 -15
- package/.gitattributes +0 -3
- package/.github/workflows/publish-on-main.yml +0 -32
- package/.gitignore +0 -66
- package/.husky/pre-commit +0 -2
- package/.prettierrc +0 -8
- package/.watchmanconfig +0 -6
- package/babel.config.js +0 -3
- package/cocoa_plugins/cocoapods-rn-toolkit/Gemfile +0 -13
- package/cocoa_plugins/cocoapods-rn-toolkit/LICENSE.txt +0 -22
- package/cocoa_plugins/cocoapods-rn-toolkit/README.md +0 -27
- package/cocoa_plugins/cocoapods-rn-toolkit/Rakefile +0 -13
- package/cocoa_plugins/cocoapods-rn-toolkit/cocoapods-rn-toolkit.gemspec +0 -28
- package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods-rn-toolkit/command/toolkit.rb +0 -44
- package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods-rn-toolkit/command.rb +0 -1
- package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods-rn-toolkit/common_build_settings.rb +0 -12
- package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods-rn-toolkit/gem_version.rb +0 -3
- package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods-rn-toolkit/ios17_uigraphics.rb +0 -57
- package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods-rn-toolkit/library_search_paths.rb +0 -41
- package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods-rn-toolkit/xcode16_rnziparchive.rb +0 -15
- package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods-rn-toolkit.rb +0 -1
- package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods_plugin.rb +0 -32
- package/cocoa_plugins/cocoapods-rn-toolkit/spec/command/toolkit_spec.rb +0 -12
- package/cocoa_plugins/cocoapods-rn-toolkit/spec/spec_helper.rb +0 -50
- package/locales/en-US.json +0 -1
- package/locales/zh-CN.json +0 -1
- package/tsconfig.json +0 -27
- package/yarn.lock +0 -10168
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
module CocoapodsRnToolkit
|
|
2
|
-
module IOS17UIGraphics
|
|
3
|
-
def self.apply(context)
|
|
4
|
-
context.pods_project.targets.each do |target|
|
|
5
|
-
target.build_configurations.each do |config|
|
|
6
|
-
update_prefix_header(context, config)
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
private
|
|
12
|
-
|
|
13
|
-
def self.update_prefix_header(context, config)
|
|
14
|
-
prefix_path = config.build_settings['GCC_PREFIX_HEADER']
|
|
15
|
-
return unless prefix_path
|
|
16
|
-
|
|
17
|
-
full_prefix_path = File.join(context.sandbox.root, prefix_path)
|
|
18
|
-
return unless File.exist?(full_prefix_path)
|
|
19
|
-
|
|
20
|
-
content = File.read(full_prefix_path)
|
|
21
|
-
return if content.include?(macro)
|
|
22
|
-
|
|
23
|
-
# puts "[cocoapods-rn-toolkit] 更新前缀头文件: #{full_prefix_path}"
|
|
24
|
-
|
|
25
|
-
content = content + "\n" + macro
|
|
26
|
-
File.open(full_prefix_path, 'w') { |file| file.write(content) }
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def self.macro
|
|
30
|
-
<<~MACRO
|
|
31
|
-
#ifndef UIGraphicsBeginImageContextWithOptions
|
|
32
|
-
#define UIGraphicsBeginImageContextWithOptions(size, opaque, scale) \\
|
|
33
|
-
do {\\
|
|
34
|
-
if (@available(iOS 17.0, *)) {\\
|
|
35
|
-
CGSize _size = CGSizeMake(size.width < 0.01 ? 0.01 : size.width, size.height < 0.01 ? 0.01 : size.height);\\
|
|
36
|
-
UIGraphicsBeginImageContextWithOptions(_size, opaque, scale);\\
|
|
37
|
-
} else {\\
|
|
38
|
-
UIGraphicsBeginImageContextWithOptions(size, opaque, scale);\\
|
|
39
|
-
}\\
|
|
40
|
-
} while(0)
|
|
41
|
-
#endif
|
|
42
|
-
|
|
43
|
-
#ifndef UIGraphicsBeginImageContext
|
|
44
|
-
#define UIGraphicsBeginImageContext(size) \\
|
|
45
|
-
do {\\
|
|
46
|
-
if (@available(iOS 17.0, *)) {\\
|
|
47
|
-
CGSize _size = CGSizeMake(size.width < 0.01 ? 0.01 : size.width, size.height < 0.01 ? 0.01 : size.height);\\
|
|
48
|
-
UIGraphicsBeginImageContext(_size);\\
|
|
49
|
-
} else {\\
|
|
50
|
-
UIGraphicsBeginImageContext(size);\\
|
|
51
|
-
}\\
|
|
52
|
-
} while(0)
|
|
53
|
-
#endif
|
|
54
|
-
MACRO
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
end
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
module CocoapodsRnToolkit
|
|
2
|
-
module LibrarySearchPaths
|
|
3
|
-
def self.apply(context)
|
|
4
|
-
# 获取所有的用户项目
|
|
5
|
-
user_projects = context.umbrella_targets.map(&:user_project).uniq(&:path)
|
|
6
|
-
|
|
7
|
-
# 获取 Pods 项目
|
|
8
|
-
pods_project = context.pods_project
|
|
9
|
-
|
|
10
|
-
# 合并所有需要处理的项目
|
|
11
|
-
projects = user_projects + [pods_project]
|
|
12
|
-
|
|
13
|
-
projects.each do |project|
|
|
14
|
-
project.build_configurations.each do |config|
|
|
15
|
-
fix_config(config)
|
|
16
|
-
end
|
|
17
|
-
project.native_targets.each do |target|
|
|
18
|
-
target.build_configurations.each do |config|
|
|
19
|
-
fix_config(config)
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
project.save()
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
private
|
|
27
|
-
|
|
28
|
-
def self.fix_config(config)
|
|
29
|
-
lib_search_paths = config.build_settings["LIBRARY_SEARCH_PATHS"]
|
|
30
|
-
if lib_search_paths
|
|
31
|
-
if lib_search_paths.include?("$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)") || lib_search_paths.include?("\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"")
|
|
32
|
-
lib_search_paths.delete("$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)")
|
|
33
|
-
lib_search_paths.delete("\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"")
|
|
34
|
-
if !(lib_search_paths.include?("$(SDKROOT)/usr/lib/swift") || lib_search_paths.include?("\"$(SDKROOT)/usr/lib/swift\""))
|
|
35
|
-
lib_search_paths.insert(0, "$(SDKROOT)/usr/lib/swift")
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
end
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
module CocoapodsRnToolkit
|
|
2
|
-
module Xcode16RNZipArchive
|
|
3
|
-
def self.apply(installer)
|
|
4
|
-
installer.pods_project.targets.each do |target|
|
|
5
|
-
if target.name == 'RNZipArchive'
|
|
6
|
-
target.source_build_phase.files.each do |file|
|
|
7
|
-
if file.settings && file.settings['COMPILER_FLAGS']
|
|
8
|
-
file.settings['COMPILER_FLAGS'] = ''
|
|
9
|
-
end
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require 'cocoapods-rn-toolkit/gem_version'
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
require 'cocoapods-rn-toolkit/xcode16_rnziparchive'
|
|
2
|
-
require 'cocoapods-rn-toolkit/ios17_uigraphics'
|
|
3
|
-
require 'cocoapods-rn-toolkit/library_search_paths'
|
|
4
|
-
require 'cocoapods-rn-toolkit/common_build_settings'
|
|
5
|
-
|
|
6
|
-
module CocoapodsRnToolkit
|
|
7
|
-
Pod::HooksManager.register('cocoapods-rn-toolkit', :post_install) do |context|
|
|
8
|
-
puts "[cocoapods-rn-toolkit] 开始应用 React Native 修复..."
|
|
9
|
-
|
|
10
|
-
puts "[cocoapods-rn-toolkit] 应用通用构建设置..."
|
|
11
|
-
CocoapodsRnToolkit::CommonBuildSettings.apply(context)
|
|
12
|
-
|
|
13
|
-
puts "[cocoapods-rn-toolkit] 应用 Xcode 16 RNZipArchive 修复..."
|
|
14
|
-
CocoapodsRnToolkit::Xcode16RNZipArchive.apply(context)
|
|
15
|
-
|
|
16
|
-
puts "[cocoapods-rn-toolkit] 应用 iOS 17 UIGraphics 修复..."
|
|
17
|
-
CocoapodsRnToolkit::IOS17UIGraphics.apply(context)
|
|
18
|
-
|
|
19
|
-
puts "[cocoapods-rn-toolkit] 应用库搜索路径修复..."
|
|
20
|
-
CocoapodsRnToolkit::LibrarySearchPaths.apply(context)
|
|
21
|
-
|
|
22
|
-
puts "[cocoapods-rn-toolkit] React Native 修复应用完成。"
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
module Pod
|
|
27
|
-
class Podfile
|
|
28
|
-
def apply_rn_fixes!
|
|
29
|
-
plugin 'cocoapods-rn-toolkit'
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
require 'pathname'
|
|
2
|
-
ROOT = Pathname.new(File.expand_path('../../', __FILE__))
|
|
3
|
-
$:.unshift((ROOT + 'lib').to_s)
|
|
4
|
-
$:.unshift((ROOT + 'spec').to_s)
|
|
5
|
-
|
|
6
|
-
require 'bundler/setup'
|
|
7
|
-
require 'bacon'
|
|
8
|
-
require 'mocha-on-bacon'
|
|
9
|
-
require 'pretty_bacon'
|
|
10
|
-
require 'pathname'
|
|
11
|
-
require 'cocoapods'
|
|
12
|
-
|
|
13
|
-
Mocha::Configuration.prevent(:stubbing_non_existent_method)
|
|
14
|
-
|
|
15
|
-
require 'cocoapods_plugin'
|
|
16
|
-
|
|
17
|
-
#-----------------------------------------------------------------------------#
|
|
18
|
-
|
|
19
|
-
module Pod
|
|
20
|
-
|
|
21
|
-
# Disable the wrapping so the output is deterministic in the tests.
|
|
22
|
-
#
|
|
23
|
-
UI.disable_wrap = true
|
|
24
|
-
|
|
25
|
-
# Redirects the messages to an internal store.
|
|
26
|
-
#
|
|
27
|
-
module UI
|
|
28
|
-
@output = ''
|
|
29
|
-
@warnings = ''
|
|
30
|
-
|
|
31
|
-
class << self
|
|
32
|
-
attr_accessor :output
|
|
33
|
-
attr_accessor :warnings
|
|
34
|
-
|
|
35
|
-
def puts(message = '')
|
|
36
|
-
@output << "#{message}\n"
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def warn(message = '', actions = [])
|
|
40
|
-
@warnings << "#{message}\n"
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
def print(message)
|
|
44
|
-
@output << message
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
#-----------------------------------------------------------------------------#
|
package/locales/en-US.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|
package/locales/zh-CN.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|
package/tsconfig.json
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"allowSyntheticDefaultImports": true,
|
|
4
|
-
"esModuleInterop": true,
|
|
5
|
-
"allowUnreachableCode": false,
|
|
6
|
-
"allowUnusedLabels": true,
|
|
7
|
-
"baseUrl": ".",
|
|
8
|
-
"paths": {
|
|
9
|
-
"@norcy/react-native-toolkit": ["./src/index"]
|
|
10
|
-
},
|
|
11
|
-
"jsx": "react",
|
|
12
|
-
"lib": ["esnext"],
|
|
13
|
-
"module": "esnext",
|
|
14
|
-
"target": "esnext",
|
|
15
|
-
"moduleResolution": "node",
|
|
16
|
-
"forceConsistentCasingInFileNames": true,
|
|
17
|
-
"noFallthroughCasesInSwitch": true,
|
|
18
|
-
"noImplicitReturns": true,
|
|
19
|
-
"noImplicitUseStrict": false,
|
|
20
|
-
"noStrictGenericChecks": false,
|
|
21
|
-
"noUnusedLocals": true,
|
|
22
|
-
"noUnusedParameters": true,
|
|
23
|
-
"resolveJsonModule": true,
|
|
24
|
-
"skipLibCheck": true,
|
|
25
|
-
"strict": true
|
|
26
|
-
}
|
|
27
|
-
}
|