Skip to content

Commit

Permalink
Merge branch 'dev-0.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
birdofpreyru committed May 18, 2023
2 parents bafdfd1 + 88697f6 commit 0cb38c8
Show file tree
Hide file tree
Showing 17 changed files with 779 additions and 665 deletions.
Binary file removed .README/sponsor.png
Binary file not shown.
19 changes: 19 additions & 0 deletions .README/sponsor.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "iOS")
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_OSX_ARCHITECTURES=${ESCAPED_ARCHS}
-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}
-DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=${CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH}
-DCMAKE_IOS_INSTALL_COMBINED=${CMAKE_IOS_INSTALL_COMBINED}
-GXcode
)
Expand Down
37 changes: 34 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Embed HTTP server for [React Native] applications for Android, iOS, Mac (Catalys
and Windows platforms. Powered by [Lighttpd] server, supports both [new][New Architecture]
and [old][Old Architecture] RN architectures.

[![Sponsor](https://raw.githubusercontent.com/birdofpreyru/react-native-static-server/master/.README/sponsor.svg)](https://github.com/sponsors/birdofpreyru)

### Sponsored By:
<table>
<tr>
Expand All @@ -29,8 +31,6 @@ and [old][Old Architecture] RN architectures.
</tr>
</table>

[![Sponsor](https://raw.githubusercontent.com/birdofpreyru/react-native-static-server/master/.README/sponsor.png)](https://github.com/sponsors/birdofpreyru)

<!-- links -->
[Error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error
[example app]: https://github.com/birdofpreyru/react-native-static-server/tree/master/example
Expand All @@ -55,16 +55,28 @@ and [old][Old Architecture] RN architectures.
[Getting Started]: #getting-started

[CMake]: https://cmake.org
[Homebrew]: https://brew.sh

**Note:** _In addition to these instructions, have a look at
[the example project][example app] included into the library repository._

- [CMake] is required on the build host.
- On **MacOS** you may get it by installing [Homebrew](https://brew.sh),
- On **MacOS** you may get it by installing [Homebrew],
then executing
```shell
$ brew install cmake
```
**IMPORTANT:** The proper [Homebrew] installation on new M1 Mac machines
requires to manually add `eval "$(/opt/homebrew/bin/brew shellenv)"'`
command to your `.zshrc` or `.bashrc`. This will ensure that the folder
`/opt/homebrew/bin`, where [Homebrew] installs packages on M1 Mac, is added
to your `PATH`. Without it `cmake` and `pkg-config` installed via [Homebrew]
will not be visible to the XCode build environment, thus failing the build
step of this library.
For details read: https://earthly.dev/blog/homebrew-on-m1,
and [Issue#29](https://github.com/birdofpreyru/react-native-static-server/issues/29).
- On **Ubuntu** you may get it by executing
```shell
$ sudo apt-get update && sudo apt-get install cmake
Expand Down Expand Up @@ -311,6 +323,10 @@ outside platform-specific sub-folders.
- [Server] &mdash; Represents a server instance.
- [constructor()] &mdash; Creates a new [Server] instance.
- [.addStateListener()] &mdash; Adds state listener to the server instance.
- [.removeAllStateListeners()] &mdash; Removes all state listeners from this
server instance.
- [.removeStateListener()] &mdash; Removes specified state listener from this
server instance.
- [.start()] &mdash; Launches the server.
- [.stop()] &mdash; Stops the server.
- [.errorLog] &mdash; Holds `errorLog` configuration.
Expand Down Expand Up @@ -444,6 +460,21 @@ each time the server state changes, with the following arguments:
This method returns "unsubscribe" function, call it to remove added
listener from the server instance.
#### .removeAllStateListeners()
[.removeAllStateListeners()]: #removeallstatelisteners
```ts
server.removeAllStateListeners()
```
Removes all state listeners connected to the server instance.
#### .removeStateListener()
[.removeStateListener()]: #removestatelistener
```ts
server.removeStateListener(listener: StateListener)
```
Removes given state `listener` if it is connected to the server instance;
does nothing otherwise.
#### .start()
[.start()]: #start
```ts
Expand Down
2 changes: 1 addition & 1 deletion dr-pogodin-react-native-static-server.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Pod::Spec.new do |s|
if [[ ${PLATFORM_FAMILY_NAME} == "iOS" ]]
then
EXTRA_CONFIG_ARGS="-DCMAKE_OSX_DEPLOYMENT_TARGET=${IPHONEOS_DEPLOYMENT_TARGET} -DCMAKE_SYSTEM_NAME=iOS -GXcode"
EXTRA_CONFIG_ARGS="-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET=${IPHONEOS_DEPLOYMENT_TARGET} -DCMAKE_SYSTEM_NAME=iOS -GXcode"
BUILD_OUTPUT_FOLDER_LIGHTTPD="/${CONFIGURATION}${EFFECTIVE_PLATFORM_NAME}"
BUILD_OUTPUT_FOLDER_PCRE2="/Release${EFFECTIVE_PLATFORM_NAME}"
else
Expand Down
Loading

0 comments on commit 0cb38c8

Please sign in to comment.