@norcy/react-native-toolkit 0.1.165 → 0.1.167

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.
Files changed (36) hide show
  1. package/android/dependencies.gradle +1 -1
  2. package/lib/commonjs/Tool.js +7 -4
  3. package/lib/commonjs/Tool.js.map +1 -1
  4. package/lib/module/Tool.js +7 -4
  5. package/lib/module/Tool.js.map +1 -1
  6. package/package.json +1 -1
  7. package/src/Tool.ts +7 -4
  8. package/.circleci/config.yml +0 -98
  9. package/.editorconfig +0 -15
  10. package/.gitattributes +0 -3
  11. package/.github/workflows/publish-on-main.yml +0 -32
  12. package/.gitignore +0 -66
  13. package/.prettierrc +0 -8
  14. package/.watchmanconfig +0 -6
  15. package/babel.config.js +0 -3
  16. package/clean_build.sh +0 -6
  17. package/cocoa_plugins/cocoapods-rn-toolkit/Gemfile +0 -13
  18. package/cocoa_plugins/cocoapods-rn-toolkit/LICENSE.txt +0 -22
  19. package/cocoa_plugins/cocoapods-rn-toolkit/README.md +0 -27
  20. package/cocoa_plugins/cocoapods-rn-toolkit/Rakefile +0 -13
  21. package/cocoa_plugins/cocoapods-rn-toolkit/cocoapods-rn-toolkit.gemspec +0 -28
  22. package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods-rn-toolkit/command/toolkit.rb +0 -44
  23. package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods-rn-toolkit/command.rb +0 -1
  24. package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods-rn-toolkit/common_build_settings.rb +0 -12
  25. package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods-rn-toolkit/gem_version.rb +0 -3
  26. package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods-rn-toolkit/ios17_uigraphics.rb +0 -57
  27. package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods-rn-toolkit/library_search_paths.rb +0 -41
  28. package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods-rn-toolkit/xcode16_rnziparchive.rb +0 -15
  29. package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods-rn-toolkit.rb +0 -1
  30. package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods_plugin.rb +0 -32
  31. package/cocoa_plugins/cocoapods-rn-toolkit/spec/command/toolkit_spec.rb +0 -12
  32. package/cocoa_plugins/cocoapods-rn-toolkit/spec/spec_helper.rb +0 -50
  33. package/locales/en-US.json +0 -1
  34. package/locales/zh-CN.json +0 -1
  35. package/tsconfig.json +0 -27
  36. package/yarn.lock +0 -11536
package/.watchmanconfig DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "ignore_dirs": [
3
- ".git",
4
- "node_modules"
5
- ]
6
- }
package/babel.config.js DELETED
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- presets: ['module:metro-react-native-babel-preset'],
3
- };
package/clean_build.sh DELETED
@@ -1,6 +0,0 @@
1
- #!/bin/bash
2
- # 清理库的构建缓存
3
- ./gradlew clean 2>/dev/null || echo "没有 gradlew,跳过"
4
- rm -rf android/build
5
- rm -rf android/.gradle
6
- echo "库缓存已清理"
@@ -1,13 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in cocoapods-rn-toolkit.gemspec
4
- gemspec
5
-
6
- group :development do
7
- gem 'cocoapods'
8
-
9
- gem 'mocha'
10
- gem 'bacon'
11
- gem 'mocha-on-bacon'
12
- gem 'prettybacon'
13
- end
@@ -1,22 +0,0 @@
1
- Copyright (c) 2024 Nx <chenyg32@gmail.com>
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,27 +0,0 @@
1
- # cocoapods-rn-toolkit
2
-
3
- A description of cocoapods-rn-toolkit.
4
-
5
- ## 构建
6
-
7
- ```
8
- gem build cocoapods-rn-toolkit.gemspec
9
- ```
10
-
11
- ## 发布
12
-
13
- ```
14
- # Step 1: 修改 gem_version.rb 中的版本号
15
- # Step 2: 发布
16
- gem push cocoapods-rn-toolkit-x.x.x.gem
17
- ```
18
-
19
- ## Installation
20
-
21
- $ gem install -s https://rubygems.org cocoapods-rn-toolkit -V
22
- $ bundle install
23
-
24
- ## Usage
25
-
26
- $ pod spec toolkit POD_NAME
27
-
@@ -1,13 +0,0 @@
1
- require 'bundler/gem_tasks'
2
-
3
- def specs(dir)
4
- FileList["spec/#{dir}/*_spec.rb"].shuffle.join(' ')
5
- end
6
-
7
- desc 'Runs all the specs'
8
- task :specs do
9
- sh "bundle exec bacon #{specs('**')}"
10
- end
11
-
12
- task :default => :specs
13
-
@@ -1,28 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'cocoapods-rn-toolkit/gem_version.rb'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = 'cocoapods-rn-toolkit'
8
- spec.version = CocoapodsRnToolkit::VERSION
9
- spec.authors = ['Nx']
10
- spec.email = ['chenyg32@gmail.com']
11
- spec.description = %q{A toolkit for React Native development with CocoaPods.}
12
- spec.summary = %q{cocoapods-rn-toolkit provides utilities and commands to streamline React Native development using CocoaPods.}
13
- spec.homepage = 'https://github.com/your_username/cocoapods-rn-toolkit'
14
- spec.license = 'MIT'
15
-
16
- spec.files = Dir['lib/**/*', 'README.md', 'LICENSE']
17
- spec.require_paths = ['lib']
18
-
19
- spec.add_runtime_dependency 'cocoapods', '~> 1.0'
20
-
21
- spec.add_development_dependency 'bundler', '~> 2.0'
22
- spec.add_development_dependency 'rake', '~> 13.0'
23
- spec.add_development_dependency 'rspec', '~> 3.0'
24
-
25
- spec.required_ruby_version = '>= 2.6.0'
26
- spec.platform = Gem::Platform::RUBY
27
- spec.required_rubygems_version = '>= 2.7.0'
28
- end
@@ -1,44 +0,0 @@
1
- module Pod
2
- class Command
3
- # This is an example of a cocoapods plugin adding a top-level subcommand
4
- # to the 'pod' command.
5
- #
6
- # You can also create subcommands of existing or new commands. Say you
7
- # wanted to add a subcommand to `list` to show newly deprecated pods,
8
- # (e.g. `pod list deprecated`), there are a few things that would need
9
- # to change.
10
- #
11
- # - move this file to `lib/pod/command/list/deprecated.rb` and update
12
- # the class to exist in the the Pod::Command::List namespace
13
- # - change this class to extend from `List` instead of `Command`. This
14
- # tells the plugin system that it is a subcommand of `list`.
15
- # - edit `lib/cocoapods_plugins.rb` to require this file
16
- #
17
- # @todo Create a PR to add your plugin to CocoaPods/cocoapods.org
18
- # in the `plugins.json` file, once your plugin is released.
19
- #
20
- class Toolkit < Command
21
- self.summary = 'Short description of cocoapods-rn-toolkit.'
22
-
23
- self.description = <<-DESC
24
- Longer description of cocoapods-rn-toolkit.
25
- DESC
26
-
27
- self.arguments = 'NAME'
28
-
29
- def initialize(argv)
30
- @name = argv.shift_argument
31
- super
32
- end
33
-
34
- def validate!
35
- super
36
- help! 'A Pod name is required.' unless @name
37
- end
38
-
39
- def run
40
- UI.puts "Add your implementation for the cocoapods-rn-toolkit plugin in #{__FILE__}"
41
- end
42
- end
43
- end
44
- end
@@ -1 +0,0 @@
1
- require 'cocoapods-rn-toolkit/command/toolkit'
@@ -1,12 +0,0 @@
1
- module CocoapodsRnToolkit
2
- class CommonBuildSettings
3
- def self.apply(installer)
4
- installer.pods_project.targets.each do |target|
5
- target.build_configurations.each do |config|
6
- config.build_settings['ENABLE_BITCODE'] = "NO"
7
- config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = "arm64"
8
- end
9
- end
10
- end
11
- end
12
- end
@@ -1,3 +0,0 @@
1
- module CocoapodsRnToolkit
2
- VERSION = "0.0.14"
3
- end
@@ -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,12 +0,0 @@
1
- require File.expand_path('../../spec_helper', __FILE__)
2
-
3
- module Pod
4
- describe Command::Toolkit do
5
- describe 'CLAide' do
6
- it 'registers it self' do
7
- Command.parse(%w{ toolkit }).should.be.instance_of Command::Toolkit
8
- end
9
- end
10
- end
11
- end
12
-
@@ -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
- #-----------------------------------------------------------------------------#
@@ -1 +0,0 @@
1
- {}
@@ -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
- }