From f49672ae7b5ad496436df50bc90ba83355e959b4 Mon Sep 17 00:00:00 2001 From: Dominic Go <18517029+dominicstop@users.noreply.github.com> Date: Wed, 5 Jun 2024 06:00:34 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20Chore:=20Modify=20Generate?= =?UTF-8?q?d=20Template?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/IosModalView.mm | 8 ++-- lefthook.yml | 14 ------- package.json | 74 +++++++++++++++++----------------- react-native-ios-modal.podspec | 4 ++ src/__tests__/index.test.tsx | 1 - 5 files changed, 46 insertions(+), 55 deletions(-) delete mode 100644 lefthook.yml delete mode 100644 src/__tests__/index.test.tsx diff --git a/ios/IosModalView.mm b/ios/IosModalView.mm index c7f18a50..dd8ca166 100644 --- a/ios/IosModalView.mm +++ b/ios/IosModalView.mm @@ -1,9 +1,9 @@ #import "IosModalView.h" -#import -#import -#import -#import +#import +#import +#import +#import #import "RCTFabricComponentsPlugins.h" diff --git a/lefthook.yml b/lefthook.yml deleted file mode 100644 index b22aaa72..00000000 --- a/lefthook.yml +++ /dev/null @@ -1,14 +0,0 @@ -pre-commit: - parallel: true - commands: - lint: - glob: "*.{js,ts,jsx,tsx}" - run: npx eslint {staged_files} - types: - glob: "*.{js,ts, jsx, tsx}" - run: npx tsc --noEmit -commit-msg: - parallel: true - commands: - commitlint: - run: npx commitlint --edit diff --git a/package.json b/package.json index 7e2e6492..b30e1dfd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "react-native-ios-modal", - "version": "0.1.0", - "description": "TBA", + "version": "2.0.0-3", + "description": "A react-native component for displaying a modal on iOS by natively wrapping a react-native view inside a UIViewController and presenting it.", "main": "lib/commonjs/index", "module": "lib/module/index", "types": "lib/typescript/src/index.d.ts", @@ -28,11 +28,28 @@ "scripts": { "example": "yarn workspace react-native-ios-modal-example", "test": "jest", - "typecheck": "tsc --noEmit", + "typescript": "tsc --noEmit --project tsconfig.build.json", + "typescript-example": "cd example && tsc --noEmit --project tsconfig.json", + "typescript-all": "yarn run typescript ; yarn run typescript-example", "lint": "eslint \"**/*.{js,ts,tsx}\"", "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib", "prepare": "bob build", - "release": "release-it" + "release": "release-it --only-version", + "open:ios": "open -a \"Xcode\" example/ios", + "open:android": "open -a \"Android Studio\" example/android", + "pod-install": "cd example/ios && bundle install ; RCT_NEW_ARCH_ENABLED=1 bundle exec pod install", + "pod-install-old": "cd example/ios && pod install", + "build:ios": "xcodebuild -workspace example/ios/IosModalExample.xcworkspace -scheme IosModalExample -destination 'generic/platform=iOS'", + "build": "yarn run lint ; yarn run typescript ; yarn run bob build ; yarn run pod-install ; yarn run build:ios", + "run-release": "cd example && npx react-native run-ios --configuration Release", + "run-debug": "cd example && npx react-native run-ios --configuration Debug", + "build-and-run": "yarn run build && yarn run run-debug && yarn run run-release", + "nuke-node-modules": "rm -rfv ./node_modules ; cd example ; rm -rfv ./node_modules ; cd ../..", + "nuke-example-pods": "cd example/ios ; pod cache clean --all ; rm -rfv ./Pods ./build ; cd ../..", + "nuke-all": "yarn run nuke-node-modules ; yarn run nuke-example-pods", + "update-dep-pods": "cd example/ios ; pod update DGSwiftUtilities ComputableLayout ; pod install --repo-update ; cd ../..", + "update-dep": "yarn add react-native-ios-utilities --dev ; cd example ; yarn add react-native-ios-utilities ; cd .. ; yarn run update-dep-pods", + "update-dep-next": "yarn add react-native-ios-utilities@next --dev ; cd example ; yarn add react-native-ios-utilities@next ; cd .. ; yarn run update-dep-pods" }, "keywords": [ "react-native", @@ -53,52 +70,37 @@ "registry": "https://registry.npmjs.org/" }, "devDependencies": { - "@commitlint/config-conventional": "^17.0.2", - "@evilmartians/lefthook": "^1.5.0", "@react-native/eslint-config": "^0.73.1", - "@release-it/conventional-changelog": "^5.0.0", - "@types/jest": "^29.5.5", "@types/react": "^18.2.44", - "commitlint": "^17.0.2", "del-cli": "^5.1.0", "eslint": "^8.51.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-prettier": "^5.0.1", - "jest": "^29.7.0", "prettier": "^3.0.3", "react": "18.2.0", "react-native": "0.74.2", "react-native-builder-bob": "^0.20.0", "release-it": "^15.0.0", "turbo": "^1.10.7", - "typescript": "^5.2.2" + "typescript": "^5.2.2", + "@dominicstop/ts-event-emitter": "^1.1.0", + "react-native-ios-utilities": "^5.0.0-0" }, "resolutions": { "@types/react": "^18.2.44" }, "peerDependencies": { "react": "*", - "react-native": "*" + "react-native": "*", + "react-native-ios-utilities": "5.0.x" }, "workspaces": [ "example" ], "packageManager": "yarn@3.6.1", - "jest": { - "preset": "react-native", - "modulePathIgnorePatterns": [ - "/example/node_modules", - "/lib/" - ] - }, - "commitlint": { - "extends": [ - "@commitlint/config-conventional" - ] - }, "release-it": { "git": { - "commitMessage": "chore: release ${version}", + "commitMessage": "⚙️ chore: release ${version}", "tagName": "v${version}" }, "npm": { @@ -106,11 +108,6 @@ }, "github": { "release": true - }, - "plugins": { - "@release-it/conventional-changelog": { - "preset": "angular" - } } }, "eslintConfig": { @@ -121,13 +118,14 @@ ], "rules": { "prettier/prettier": [ - "error", + "warn", { - "quoteProps": "consistent", + "quoteProps": "as-needed", "singleQuote": true, "tabWidth": 2, "trailingComma": "es5", - "useTabs": false + "useTabs": false, + "semi": true } ] } @@ -137,7 +135,7 @@ "lib/" ], "prettier": { - "quoteProps": "consistent", + "quoteProps": "as-needed", "singleQuote": true, "tabWidth": 2, "trailingComma": "es5", @@ -158,8 +156,12 @@ ] }, "codegenConfig": { - "name": "RNIosModalViewSpec", + "name": "RNIModalSpec", "type": "components", - "jsSrcsDir": "src" + "jsSrcsDir": "src", + "interfaceOnly": true, + "excludedPlatforms": [ + "android" + ] } } diff --git a/react-native-ios-modal.podspec b/react-native-ios-modal.podspec index 7d5ba855..6e73fede 100644 --- a/react-native-ios-modal.podspec +++ b/react-native-ios-modal.podspec @@ -16,6 +16,10 @@ Pod::Spec.new do |s| s.source_files = "ios/**/*.{h,m,mm}" + s.dependency 'react-native-ios-utilities' + s.dependency 'DGSwiftUtilities' + s.dependency 'ComputableLayout' + # 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) diff --git a/src/__tests__/index.test.tsx b/src/__tests__/index.test.tsx deleted file mode 100644 index bf84291a..00000000 --- a/src/__tests__/index.test.tsx +++ /dev/null @@ -1 +0,0 @@ -it.todo('write a test');