From 233636e2ea97aa3591b03323a20dd7b4b97cf4a9 Mon Sep 17 00:00:00 2001 From: "Dr. Sergey Pogodin" Date: Wed, 28 Jun 2023 15:21:23 +0200 Subject: [PATCH 01/16] WIP: v0.8.0: Upgrade to RN@0.72 --- .editorconfig | 15 ++ .gitattributes | 2 + .gitignore | 64 +++---- .nvmrc | 2 +- .watchmanconfig | 1 + android/build.gradle | 1 + dr-pogodin-react-native-static-server.podspec | 6 + example/.node-version | 1 - example/.watchmanconfig | 2 +- example/Gemfile | 4 +- example/android/app/build.gradle | 51 +---- .../MainActivity.java | 9 +- .../res/drawable/rn_edit_text_material.xml | 2 +- example/android/build.gradle | 2 +- example/android/gradle.properties | 2 +- .../android/gradle/wrapper/gradle-wrapper.jar | Bin 59821 -> 61574 bytes .../gradle/wrapper/gradle-wrapper.properties | 3 +- example/android/gradlew | 18 +- example/android/gradlew.bat | 181 +++++++++--------- example/android/settings.gradle | 2 +- example/app.json | 2 +- example/ios/Dummy.swift | 8 - example/ios/File.swift | 6 + example/ios/Podfile | 18 +- ...ativeStaticServerExample-Bridging-Header.h | 1 - .../project.pbxproj | 10 +- .../contents.xcworkspacedata | 10 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - .../AppDelegate.mm | 10 - .../ReactNativeStaticServerExample/Info.plist | 2 +- example/jest.config.js | 3 + example/package.json | 13 +- package.json | 8 +- tsconfig.json | 2 +- 34 files changed, 212 insertions(+), 257 deletions(-) create mode 100644 .editorconfig create mode 100644 .watchmanconfig delete mode 100644 example/.node-version delete mode 100644 example/ios/Dummy.swift create mode 100644 example/ios/File.swift delete mode 100644 example/ios/ReactNativeStaticServerExample.xcworkspace/contents.xcworkspacedata delete mode 100644 example/ios/ReactNativeStaticServerExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 example/jest.config.js diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..65365be --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = true + +[*] + +indent_style = space +indent_size = 2 + +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/.gitattributes b/.gitattributes index d42ff18..030ef14 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,3 @@ *.pbxproj -text +# specific for windows script files +*.bat text eol=crlf \ No newline at end of file diff --git a/.gitignore b/.gitignore index a078d54..05de830 100644 --- a/.gitignore +++ b/.gitignore @@ -2,12 +2,12 @@ # .DS_Store -# node.js -# -node_modules/ -npm-debug.log -yarn-error.log +# XDE +.expo/ +# VSCode +.vscode/ +jsconfig.json # Xcode # @@ -28,48 +28,46 @@ DerivedData *.ipa *.xcuserstate project.xcworkspace -/example/ios/Pods/ - -# Android/IntelliJ +# Android/IJ # -build/ +.classpath .cxx -.idea .gradle +.idea +.project +.settings local.properties -*.iml +android.iml + +# Cocoapods +# +example/ios/Pods + +# Ruby +example/vendor/ + +# node.js +# +node_modules/ +npm-debug.log +yarn-debug.log +yarn-error.log # BUCK buck-out/ \.buckd/ -*.keystore - -# Test generated files -/ReactAndroid/src/androidTest/assets/AndroidTestBundle.js -*.js.meta +android/app/libs +android/keystores/debug.keystore -my-release-key.keystore -StaticServerExample/my-release-key.keystore +# Expo +.expo/ -# Android -.classpath -.project -.settings/ -android/.project -/android/**/jniLibs/*/*.so +# Turborepo +.turbo/ # generated by bob lib/ -# Java compiler outputs -*.class - -# MSBuild Binary and Structured Log -*.binlog -*.tlog - # Other /dr.pogodin-react-native-static-server-*.tgz -/.vscode -/.vs diff --git a/.nvmrc b/.nvmrc index 3c79f30..3876fd4 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -18.16.0 \ No newline at end of file +18.16.1 diff --git a/.watchmanconfig b/.watchmanconfig new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.watchmanconfig @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index 1896af5..f06cfa7 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -15,6 +15,7 @@ def isNewArchitectureEnabled() { apply plugin: "com.android.library" + def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') } if (isNewArchitectureEnabled()) { diff --git a/dr-pogodin-react-native-static-server.podspec b/dr-pogodin-react-native-static-server.podspec index d73d00d..7f57fc4 100644 --- a/dr-pogodin-react-native-static-server.podspec +++ b/dr-pogodin-react-native-static-server.podspec @@ -17,6 +17,11 @@ Pod::Spec.new do |s| s.preserve_paths = 'README.md', 'package.json', 'index.js' s.source_files = "ios/**/*.{h,m,mm}" + # 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" # This requires CMake on the build host, which can be installed via Homebrew (https://brew.sh) @@ -95,4 +100,5 @@ Pod::Spec.new do |s| "OTHER_LIBTOOLFLAGS" => $otherLibToolFlags } end + end end diff --git a/example/.node-version b/example/.node-version deleted file mode 100644 index 3c03207..0000000 --- a/example/.node-version +++ /dev/null @@ -1 +0,0 @@ -18 diff --git a/example/.watchmanconfig b/example/.watchmanconfig index 9e26dfe..0967ef4 100644 --- a/example/.watchmanconfig +++ b/example/.watchmanconfig @@ -1 +1 @@ -{} \ No newline at end of file +{} diff --git a/example/Gemfile b/example/Gemfile index 1142b1b..1fa2c2e 100644 --- a/example/Gemfile +++ b/example/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version -ruby '>= 2.6.10' +ruby ">= 2.6.10" -gem 'cocoapods', '>= 1.11.3' +gem 'cocoapods', '~> 1.12' diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 44d5ebd..f0f5db0 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -1,8 +1,6 @@ apply plugin: "com.android.application" apply plugin: "com.facebook.react" -import com.android.build.OutputFile - /** * This is the configuration block to customize your React Native Android app. * By default you don't need to apply any configuration, just uncomment the lines you need. @@ -13,8 +11,8 @@ react { // root = file("../") // The folder where the react-native NPM package is. Default is ../node_modules/react-native // reactNativeDir = file("../node_modules/react-native") - // The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen - // codegenDir = file("../node_modules/react-native-codegen") + // The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen + // codegenDir = file("../node_modules/@react-native/codegen") // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js // cliFile = file("../node_modules/react-native/cli.js") @@ -52,14 +50,6 @@ react { // hermesFlags = ["-O", "-output-source-map"] } -/** - * Set this to true to create four separate APKs instead of one, - * one for each native architecture. This is useful if you don't - * use App Bundles (https://developer.android.com/guide/app-bundle/) - * and want to have separate APKs to upload to the Play Store. - */ -def enableSeparateBuildPerCPUArchitecture = false - /** * Set this to true to Run Proguard on Release builds to minify the Java bytecode. */ @@ -78,16 +68,6 @@ def enableProguardInReleaseBuilds = true */ def jscFlavor = 'org.webkit:android-jsc:+' -/** - * Private function to get the list of Native Architectures you want to build. - * This reads the value from reactNativeArchitectures in your gradle.properties - * file and works together with the --active-arch-only flag of react-native run-android. - */ -def reactNativeArchitectures() { - def value = project.getProperties().get("reactNativeArchitectures") - return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] -} - android { ndkVersion rootProject.ext.ndkVersion @@ -107,15 +87,6 @@ android { assets.srcDirs = ['../../assets'] } } - - splits { - abi { - reset() - enable enableSeparateBuildPerCPUArchitecture - universalApk false // If true, also generate a universal APK - include (*reactNativeArchitectures()) - } - } signingConfigs { debug { storeFile file('debug.keystore') @@ -136,30 +107,12 @@ android { proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } } - - // applicationVariants are e.g. debug, release - applicationVariants.all { variant -> - variant.outputs.each { output -> - // For each separate APK per architecture, set a unique version code as described here: - // https://developer.android.com/studio/build/configure-apk-splits.html - // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc. - def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] - def abi = output.getFilter(OutputFile.ABI) - if (abi != null) { // null for the universal-debug, universal-release variants - output.versionCodeOverride = - defaultConfig.versionCode * 1000 + versionCodes.get(abi) - } - - } - } } dependencies { // The version of react-native is set by the React Native Gradle Plugin implementation("com.facebook.react:react-android") - implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0") - debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { exclude group:'com.squareup.okhttp3', module:'okhttp' diff --git a/example/android/app/src/main/java/com/reactnativestaticserverexample/MainActivity.java b/example/android/app/src/main/java/com/reactnativestaticserverexample/MainActivity.java index 572fb9d..137dcfa 100644 --- a/example/android/app/src/main/java/com/reactnativestaticserverexample/MainActivity.java +++ b/example/android/app/src/main/java/com/reactnativestaticserverexample/MainActivity.java @@ -27,13 +27,6 @@ protected ReactActivityDelegate createReactActivityDelegate() { this, getMainComponentName(), // If you opted-in for the New Architecture, we enable the Fabric Renderer. - - // react-native-webview used in this example does not support Fabric - // yet. - DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled - - // If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18). - DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled - ); + DefaultNewArchitectureEntryPoint.getFabricEnabled()); } } diff --git a/example/android/app/src/main/res/drawable/rn_edit_text_material.xml b/example/android/app/src/main/res/drawable/rn_edit_text_material.xml index f35d996..73b37e4 100644 --- a/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +++ b/example/android/app/src/main/res/drawable/rn_edit_text_material.xml @@ -20,7 +20,7 @@ android:insetBottom="@dimen/abc_edit_text_inset_bottom_material"> - - {262a7409-f396-49eb-9f4c-c2f13fc27d5e} - - - - {3e3931f2-4735-4417-8cb0-33668a7314d6} + {0324ce2d-6b96-4f99-9a75-10139a52eb04} diff --git a/example/windows/ReactNativeStaticServerExample/Package.appxmanifest b/example/windows/ReactNativeStaticServerExample/Package.appxmanifest index 33c8bc5..5f784f2 100644 --- a/example/windows/ReactNativeStaticServerExample/Package.appxmanifest +++ b/example/windows/ReactNativeStaticServerExample/Package.appxmanifest @@ -7,11 +7,11 @@ IgnorableNamespaces="uap mp"> - + ReactNativeStaticServerExample diff --git a/example/windows/ReactNativeStaticServerExample/ReactNativeStaticServerExample.vcxproj b/example/windows/ReactNativeStaticServerExample/ReactNativeStaticServerExample.vcxproj index c2735aa..4dd53c2 100644 --- a/example/windows/ReactNativeStaticServerExample/ReactNativeStaticServerExample.vcxproj +++ b/example/windows/ReactNativeStaticServerExample/ReactNativeStaticServerExample.vcxproj @@ -1,12 +1,12 @@ - + true true true - {ee425c7b-b8cd-4b20-943a-b658f49ad758} + {d0a26e76-6de5-4c8f-a928-08c2db2b3883} ReactNativeStaticServerExample ReactNativeStaticServerExample en-US @@ -60,8 +60,7 @@ false - - + @@ -173,4 +172,4 @@ - \ No newline at end of file + diff --git a/package-lock.json b/package-lock.json index 4cce798..2edc32a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,6 +22,7 @@ "eslint-config-prettier": "^8.8.0", "eslint-plugin-prettier": "^4.0.0", "jest": "^29.5.0", + "metro-config": "^0.76.7", "pod-install": "^0.1.38", "prettier": "^2.8.8", "react": "18.2.0", @@ -4203,6 +4204,23 @@ "node": ">=8" } }, + "node_modules/@react-native-community/cli-plugin-metro/node_modules/metro-config": { + "version": "0.76.5", + "resolved": "https://registry.npmjs.org/metro-config/-/metro-config-0.76.5.tgz", + "integrity": "sha512-SCMVIDOtm8s3H62E9z2IcY4Q9GVMqDurbiJS3PHrWgTZjwZFaL59lrW4W6DvzvFZHa9bbxKric5TFtwvVuyOCg==", + "dev": true, + "dependencies": { + "cosmiconfig": "^5.0.5", + "jest-validate": "^29.2.1", + "metro": "0.76.5", + "metro-cache": "0.76.5", + "metro-core": "0.76.5", + "metro-runtime": "0.76.5" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/@react-native-community/cli-plugin-metro/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -5301,6 +5319,23 @@ "metro-runtime": "0.76.5" } }, + "node_modules/@react-native/metro-config/node_modules/metro-config": { + "version": "0.76.5", + "resolved": "https://registry.npmjs.org/metro-config/-/metro-config-0.76.5.tgz", + "integrity": "sha512-SCMVIDOtm8s3H62E9z2IcY4Q9GVMqDurbiJS3PHrWgTZjwZFaL59lrW4W6DvzvFZHa9bbxKric5TFtwvVuyOCg==", + "dev": true, + "dependencies": { + "cosmiconfig": "^5.0.5", + "jest-validate": "^29.2.1", + "metro": "0.76.5", + "metro-cache": "0.76.5", + "metro-core": "0.76.5", + "metro-runtime": "0.76.5" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/@react-native/normalize-colors": { "version": "0.72.0", "resolved": "https://registry.npmjs.org/@react-native/normalize-colors/-/normalize-colors-0.72.0.tgz", @@ -12497,22 +12532,575 @@ } }, "node_modules/metro-config": { - "version": "0.76.5", - "resolved": "https://registry.npmjs.org/metro-config/-/metro-config-0.76.5.tgz", - "integrity": "sha512-SCMVIDOtm8s3H62E9z2IcY4Q9GVMqDurbiJS3PHrWgTZjwZFaL59lrW4W6DvzvFZHa9bbxKric5TFtwvVuyOCg==", + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-config/-/metro-config-0.76.7.tgz", + "integrity": "sha512-CFDyNb9bqxZemiChC/gNdXZ7OQkIwmXzkrEXivcXGbgzlt/b2juCv555GWJHyZSlorwnwJfY3uzAFu4A9iRVfg==", "dev": true, "dependencies": { + "connect": "^3.6.5", "cosmiconfig": "^5.0.5", "jest-validate": "^29.2.1", - "metro": "0.76.5", - "metro-cache": "0.76.5", - "metro-core": "0.76.5", - "metro-runtime": "0.76.5" + "metro": "0.76.7", + "metro-cache": "0.76.7", + "metro-core": "0.76.7", + "metro-runtime": "0.76.7" }, "engines": { "node": ">=16" } }, + "node_modules/metro-config/node_modules/@jest/types": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", + "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/metro-config/node_modules/@types/yargs": { + "version": "16.0.5", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.5.tgz", + "integrity": "sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==", + "dev": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/metro-config/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/metro-config/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/metro-config/node_modules/ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "node_modules/metro-config/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/metro-config/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/metro-config/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/metro-config/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/metro-config/node_modules/hermes-estree": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.12.0.tgz", + "integrity": "sha512-+e8xR6SCen0wyAKrMT3UD0ZCCLymKhRgjEB5sS28rKiFir/fXgLoeRilRUssFCILmGHb+OvHDUlhxs0+IEyvQw==", + "dev": true + }, + "node_modules/metro-config/node_modules/hermes-parser": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.12.0.tgz", + "integrity": "sha512-d4PHnwq6SnDLhYl3LHNHvOg7nQ6rcI7QVil418REYksv0Mh3cEkHDcuhGxNQ3vgnLSLl4QSvDrFCwQNYdpWlzw==", + "dev": true, + "dependencies": { + "hermes-estree": "0.12.0" + } + }, + "node_modules/metro-config/node_modules/jest-regex-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-27.5.1.tgz", + "integrity": "sha512-4bfKq2zie+x16okqDXjXn9ql2B0dScQu+vcwe4TvFVhkVyuWLqpZrZtXxLLWoXYgn0E87I6r6GRYHF7wFZBUvg==", + "dev": true, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/metro-config/node_modules/jest-util": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-27.5.1.tgz", + "integrity": "sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw==", + "dev": true, + "dependencies": { + "@jest/types": "^27.5.1", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/metro-config/node_modules/jest-util/node_modules/ci-info": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", + "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } + }, + "node_modules/metro-config/node_modules/jest-worker": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", + "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", + "dev": true, + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/metro-config/node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/metro-config/node_modules/metro": { + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro/-/metro-0.76.7.tgz", + "integrity": "sha512-67ZGwDeumEPnrHI+pEDSKH2cx+C81Gx8Mn5qOtmGUPm/Up9Y4I1H2dJZ5n17MWzejNo0XAvPh0QL0CrlJEODVQ==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "@babel/core": "^7.20.0", + "@babel/generator": "^7.20.0", + "@babel/parser": "^7.20.0", + "@babel/template": "^7.0.0", + "@babel/traverse": "^7.20.0", + "@babel/types": "^7.20.0", + "accepts": "^1.3.7", + "async": "^3.2.2", + "chalk": "^4.0.0", + "ci-info": "^2.0.0", + "connect": "^3.6.5", + "debug": "^2.2.0", + "denodeify": "^1.2.1", + "error-stack-parser": "^2.0.6", + "graceful-fs": "^4.2.4", + "hermes-parser": "0.12.0", + "image-size": "^1.0.2", + "invariant": "^2.2.4", + "jest-worker": "^27.2.0", + "jsc-safe-url": "^0.2.2", + "lodash.throttle": "^4.1.1", + "metro-babel-transformer": "0.76.7", + "metro-cache": "0.76.7", + "metro-cache-key": "0.76.7", + "metro-config": "0.76.7", + "metro-core": "0.76.7", + "metro-file-map": "0.76.7", + "metro-inspector-proxy": "0.76.7", + "metro-minify-terser": "0.76.7", + "metro-minify-uglify": "0.76.7", + "metro-react-native-babel-preset": "0.76.7", + "metro-resolver": "0.76.7", + "metro-runtime": "0.76.7", + "metro-source-map": "0.76.7", + "metro-symbolicate": "0.76.7", + "metro-transform-plugins": "0.76.7", + "metro-transform-worker": "0.76.7", + "mime-types": "^2.1.27", + "node-fetch": "^2.2.0", + "nullthrows": "^1.1.1", + "rimraf": "^3.0.2", + "serialize-error": "^2.1.0", + "source-map": "^0.5.6", + "strip-ansi": "^6.0.0", + "throat": "^5.0.0", + "ws": "^7.5.1", + "yargs": "^17.6.2" + }, + "bin": { + "metro": "src/cli.js" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-config/node_modules/metro-babel-transformer": { + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-babel-transformer/-/metro-babel-transformer-0.76.7.tgz", + "integrity": "sha512-bgr2OFn0J4r0qoZcHrwEvccF7g9k3wdgTOgk6gmGHrtlZ1Jn3oCpklW/DfZ9PzHfjY2mQammKTc19g/EFGyOJw==", + "dev": true, + "dependencies": { + "@babel/core": "^7.20.0", + "hermes-parser": "0.12.0", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-config/node_modules/metro-cache": { + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-cache/-/metro-cache-0.76.7.tgz", + "integrity": "sha512-nWBMztrs5RuSxZRI7hgFgob5PhYDmxICh9FF8anm9/ito0u0vpPvRxt7sRu8fyeD2AHdXqE7kX32rWY0LiXgeg==", + "dev": true, + "dependencies": { + "metro-core": "0.76.7", + "rimraf": "^3.0.2" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-config/node_modules/metro-cache-key": { + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-cache-key/-/metro-cache-key-0.76.7.tgz", + "integrity": "sha512-0pecoIzwsD/Whn/Qfa+SDMX2YyasV0ndbcgUFx7w1Ct2sLHClujdhQ4ik6mvQmsaOcnGkIyN0zcceMDjC2+BFQ==", + "dev": true, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-config/node_modules/metro-core": { + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-core/-/metro-core-0.76.7.tgz", + "integrity": "sha512-0b8KfrwPmwCMW+1V7ZQPkTy2tsEKZjYG9Pu1PTsu463Z9fxX7WaR0fcHFshv+J1CnQSUTwIGGjbNvj1teKe+pw==", + "dev": true, + "dependencies": { + "lodash.throttle": "^4.1.1", + "metro-resolver": "0.76.7" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-config/node_modules/metro-file-map": { + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-file-map/-/metro-file-map-0.76.7.tgz", + "integrity": "sha512-s+zEkTcJ4mOJTgEE2ht4jIo1DZfeWreQR3tpT3gDV/Y/0UQ8aJBTv62dE775z0GLsWZApiblAYZsj7ZE8P06nw==", + "dev": true, + "dependencies": { + "anymatch": "^3.0.3", + "debug": "^2.2.0", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.4", + "invariant": "^2.2.4", + "jest-regex-util": "^27.0.6", + "jest-util": "^27.2.0", + "jest-worker": "^27.2.0", + "micromatch": "^4.0.4", + "node-abort-controller": "^3.1.1", + "nullthrows": "^1.1.1", + "walker": "^1.0.7" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "node_modules/metro-config/node_modules/metro-inspector-proxy": { + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-inspector-proxy/-/metro-inspector-proxy-0.76.7.tgz", + "integrity": "sha512-rNZ/6edTl/1qUekAhAbaFjczMphM50/UjtxiKulo6vqvgn/Mjd9hVqDvVYfAMZXqPvlusD88n38UjVYPkruLSg==", + "dev": true, + "dependencies": { + "connect": "^3.6.5", + "debug": "^2.2.0", + "node-fetch": "^2.2.0", + "ws": "^7.5.1", + "yargs": "^17.6.2" + }, + "bin": { + "metro-inspector-proxy": "src/cli.js" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-config/node_modules/metro-minify-terser": { + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-minify-terser/-/metro-minify-terser-0.76.7.tgz", + "integrity": "sha512-FQiZGhIxCzhDwK4LxyPMLlq0Tsmla10X7BfNGlYFK0A5IsaVKNJbETyTzhpIwc+YFRT4GkFFwgo0V2N5vxO5HA==", + "dev": true, + "dependencies": { + "terser": "^5.15.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-config/node_modules/metro-minify-uglify": { + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-minify-uglify/-/metro-minify-uglify-0.76.7.tgz", + "integrity": "sha512-FuXIU3j2uNcSvQtPrAJjYWHruPiQ+EpE++J9Z+VznQKEHcIxMMoQZAfIF2IpZSrZYfLOjVFyGMvj41jQMxV1Vw==", + "dev": true, + "dependencies": { + "uglify-es": "^3.1.9" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-config/node_modules/metro-react-native-babel-preset": { + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-react-native-babel-preset/-/metro-react-native-babel-preset-0.76.7.tgz", + "integrity": "sha512-R25wq+VOSorAK3hc07NW0SmN8z9S/IR0Us0oGAsBcMZnsgkbOxu77Mduqf+f4is/wnWHc5+9bfiqdLnaMngiVw==", + "dev": true, + "dependencies": { + "@babel/core": "^7.20.0", + "@babel/plugin-proposal-async-generator-functions": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.18.0", + "@babel/plugin-proposal-export-default-from": "^7.0.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.0", + "@babel/plugin-proposal-numeric-separator": "^7.0.0", + "@babel/plugin-proposal-object-rest-spread": "^7.20.0", + "@babel/plugin-proposal-optional-catch-binding": "^7.0.0", + "@babel/plugin-proposal-optional-chaining": "^7.20.0", + "@babel/plugin-syntax-dynamic-import": "^7.8.0", + "@babel/plugin-syntax-export-default-from": "^7.0.0", + "@babel/plugin-syntax-flow": "^7.18.0", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.0.0", + "@babel/plugin-syntax-optional-chaining": "^7.0.0", + "@babel/plugin-transform-arrow-functions": "^7.0.0", + "@babel/plugin-transform-async-to-generator": "^7.20.0", + "@babel/plugin-transform-block-scoping": "^7.0.0", + "@babel/plugin-transform-classes": "^7.0.0", + "@babel/plugin-transform-computed-properties": "^7.0.0", + "@babel/plugin-transform-destructuring": "^7.20.0", + "@babel/plugin-transform-flow-strip-types": "^7.20.0", + "@babel/plugin-transform-function-name": "^7.0.0", + "@babel/plugin-transform-literals": "^7.0.0", + "@babel/plugin-transform-modules-commonjs": "^7.0.0", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.0.0", + "@babel/plugin-transform-parameters": "^7.0.0", + "@babel/plugin-transform-react-display-name": "^7.0.0", + "@babel/plugin-transform-react-jsx": "^7.0.0", + "@babel/plugin-transform-react-jsx-self": "^7.0.0", + "@babel/plugin-transform-react-jsx-source": "^7.0.0", + "@babel/plugin-transform-runtime": "^7.0.0", + "@babel/plugin-transform-shorthand-properties": "^7.0.0", + "@babel/plugin-transform-spread": "^7.0.0", + "@babel/plugin-transform-sticky-regex": "^7.0.0", + "@babel/plugin-transform-typescript": "^7.5.0", + "@babel/plugin-transform-unicode-regex": "^7.0.0", + "@babel/template": "^7.0.0", + "babel-plugin-transform-flow-enums": "^0.0.2", + "react-refresh": "^0.4.0" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "@babel/core": "*" + } + }, + "node_modules/metro-config/node_modules/metro-resolver": { + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-resolver/-/metro-resolver-0.76.7.tgz", + "integrity": "sha512-pC0Wgq29HHIHrwz23xxiNgylhI8Rq1V01kQaJ9Kz11zWrIdlrH0ZdnJ7GC6qA0ErROG+cXmJ0rJb8/SW1Zp2IA==", + "dev": true, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-config/node_modules/metro-runtime": { + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-runtime/-/metro-runtime-0.76.7.tgz", + "integrity": "sha512-MuWHubQHymUWBpZLwuKZQgA/qbb35WnDAKPo83rk7JRLIFPvzXSvFaC18voPuzJBt1V98lKQIonh6MiC9gd8Ug==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.0.0", + "react-refresh": "^0.4.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-config/node_modules/metro-source-map": { + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-source-map/-/metro-source-map-0.76.7.tgz", + "integrity": "sha512-Prhx7PeRV1LuogT0Kn5VjCuFu9fVD68eefntdWabrksmNY6mXK8pRqzvNJOhTojh6nek+RxBzZeD6MIOOyXS6w==", + "dev": true, + "dependencies": { + "@babel/traverse": "^7.20.0", + "@babel/types": "^7.20.0", + "invariant": "^2.2.4", + "metro-symbolicate": "0.76.7", + "nullthrows": "^1.1.1", + "ob1": "0.76.7", + "source-map": "^0.5.6", + "vlq": "^1.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-config/node_modules/metro-symbolicate": { + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-symbolicate/-/metro-symbolicate-0.76.7.tgz", + "integrity": "sha512-p0zWEME5qLSL1bJb93iq+zt5fz3sfVn9xFYzca1TJIpY5MommEaS64Va87lp56O0sfEIvh4307Oaf/ZzRjuLiQ==", + "dev": true, + "dependencies": { + "invariant": "^2.2.4", + "metro-source-map": "0.76.7", + "nullthrows": "^1.1.1", + "source-map": "^0.5.6", + "through2": "^2.0.1", + "vlq": "^1.0.0" + }, + "bin": { + "metro-symbolicate": "src/index.js" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-config/node_modules/metro-transform-plugins": { + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-transform-plugins/-/metro-transform-plugins-0.76.7.tgz", + "integrity": "sha512-iSmnjVApbdivjuzb88Orb0JHvcEt5veVyFAzxiS5h0QB+zV79w6JCSqZlHCrbNOkOKBED//LqtKbFVakxllnNg==", + "dev": true, + "dependencies": { + "@babel/core": "^7.20.0", + "@babel/generator": "^7.20.0", + "@babel/template": "^7.0.0", + "@babel/traverse": "^7.20.0", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-config/node_modules/metro-transform-worker": { + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/metro-transform-worker/-/metro-transform-worker-0.76.7.tgz", + "integrity": "sha512-cGvELqFMVk9XTC15CMVzrCzcO6sO1lURfcbgjuuPdzaWuD11eEyocvkTX0DPiRjsvgAmicz4XYxVzgYl3MykDw==", + "dev": true, + "dependencies": { + "@babel/core": "^7.20.0", + "@babel/generator": "^7.20.0", + "@babel/parser": "^7.20.0", + "@babel/types": "^7.20.0", + "babel-preset-fbjs": "^3.4.0", + "metro": "0.76.7", + "metro-babel-transformer": "0.76.7", + "metro-cache": "0.76.7", + "metro-cache-key": "0.76.7", + "metro-source-map": "0.76.7", + "metro-transform-plugins": "0.76.7", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-config/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/metro-config/node_modules/ob1": { + "version": "0.76.7", + "resolved": "https://registry.npmjs.org/ob1/-/ob1-0.76.7.tgz", + "integrity": "sha512-BQdRtxxoUNfSoZxqeBGOyuT9nEYSn18xZHwGMb0mMVpn2NBcYbnyKY4BK2LIHRgw33CBGlUmE+KMaNvyTpLLtQ==", + "dev": true, + "engines": { + "node": ">=16" + } + }, + "node_modules/metro-config/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/metro-config/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/metro-core": { "version": "0.76.5", "resolved": "https://registry.npmjs.org/metro-core/-/metro-core-0.76.5.tgz", @@ -13069,6 +13657,23 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/metro/node_modules/metro-config": { + "version": "0.76.5", + "resolved": "https://registry.npmjs.org/metro-config/-/metro-config-0.76.5.tgz", + "integrity": "sha512-SCMVIDOtm8s3H62E9z2IcY4Q9GVMqDurbiJS3PHrWgTZjwZFaL59lrW4W6DvzvFZHa9bbxKric5TFtwvVuyOCg==", + "dev": true, + "dependencies": { + "cosmiconfig": "^5.0.5", + "jest-validate": "^29.2.1", + "metro": "0.76.5", + "metro-cache": "0.76.5", + "metro-core": "0.76.5", + "metro-runtime": "0.76.5" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/metro/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -15061,6 +15666,23 @@ "node": ">=8" } }, + "node_modules/react-native/node_modules/metro-config": { + "version": "0.76.5", + "resolved": "https://registry.npmjs.org/metro-config/-/metro-config-0.76.5.tgz", + "integrity": "sha512-SCMVIDOtm8s3H62E9z2IcY4Q9GVMqDurbiJS3PHrWgTZjwZFaL59lrW4W6DvzvFZHa9bbxKric5TFtwvVuyOCg==", + "dev": true, + "dependencies": { + "cosmiconfig": "^5.0.5", + "jest-validate": "^29.2.1", + "metro": "0.76.5", + "metro-cache": "0.76.5", + "metro-core": "0.76.5", + "metro-runtime": "0.76.5" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/react-native/node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", diff --git a/package.json b/package.json index fb9ae9c..fd248d0 100644 --- a/package.json +++ b/package.json @@ -49,12 +49,13 @@ "eslint-config-prettier": "^8.8.0", "eslint-plugin-prettier": "^4.0.0", "jest": "^29.5.0", + "metro-config": "^0.76.7", "pod-install": "^0.1.38", "prettier": "^2.8.8", "react": "18.2.0", "react-native": "0.72.1", - "react-native-fs": "^2.20.0", "react-native-builder-bob": "^0.21.0", + "react-native-fs": "^2.20.0", "react-native-windows": "^0.72.0", "typescript": "^5.1.6" }, diff --git a/windows/.gitignore b/windows/.gitignore index 98b9f5c..4ea0c7b 100644 --- a/windows/.gitignore +++ b/windows/.gitignore @@ -89,3 +89,4 @@ packages/ #Files generated by the VS build **/Generated Files/** + diff --git a/windows/ReactNativeStaticServer.sln b/windows/ReactNativeStaticServer.sln index 9e42f36..8008a72 100644 --- a/windows/ReactNativeStaticServer.sln +++ b/windows/ReactNativeStaticServer.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.3.32929.385 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactNativeStaticServer", "ReactNativeStaticServer\ReactNativeStaticServer.vcxproj", "{262A7409-F396-49EB-9F4C-C2F13FC27D5E}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactNativeStaticServer", "ReactNativeStaticServer\ReactNativeStaticServer.vcxproj", "{0324CE2D-6B96-4F99-9A75-10139A52EB04}" ProjectSection(ProjectDependencies) = postProject {F7D32BD0-2749-483E-9A0D-1635EF7E3136} = {F7D32BD0-2749-483E-9A0D-1635EF7E3136} EndProjectSection @@ -54,24 +54,24 @@ Global Release|ARM64 = Release|ARM64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {262A7409-F396-49EB-9F4C-C2F13FC27D5E}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {262A7409-F396-49EB-9F4C-C2F13FC27D5E}.Debug|ARM64.Build.0 = Debug|ARM64 - {262A7409-F396-49EB-9F4C-C2F13FC27D5E}.Debug|ARM64.Deploy.0 = Debug|ARM64 - {262A7409-F396-49EB-9F4C-C2F13FC27D5E}.Debug|x64.ActiveCfg = Debug|x64 - {262A7409-F396-49EB-9F4C-C2F13FC27D5E}.Debug|x64.Build.0 = Debug|x64 - {262A7409-F396-49EB-9F4C-C2F13FC27D5E}.Debug|x64.Deploy.0 = Debug|x64 - {262A7409-F396-49EB-9F4C-C2F13FC27D5E}.Debug|x86.ActiveCfg = Debug|Win32 - {262A7409-F396-49EB-9F4C-C2F13FC27D5E}.Debug|x86.Build.0 = Debug|Win32 - {262A7409-F396-49EB-9F4C-C2F13FC27D5E}.Debug|x86.Deploy.0 = Debug|Win32 - {262A7409-F396-49EB-9F4C-C2F13FC27D5E}.Release|ARM64.ActiveCfg = Release|ARM64 - {262A7409-F396-49EB-9F4C-C2F13FC27D5E}.Release|ARM64.Build.0 = Release|ARM64 - {262A7409-F396-49EB-9F4C-C2F13FC27D5E}.Release|ARM64.Deploy.0 = Release|ARM64 - {262A7409-F396-49EB-9F4C-C2F13FC27D5E}.Release|x64.ActiveCfg = Release|x64 - {262A7409-F396-49EB-9F4C-C2F13FC27D5E}.Release|x64.Build.0 = Release|x64 - {262A7409-F396-49EB-9F4C-C2F13FC27D5E}.Release|x64.Deploy.0 = Release|x64 - {262A7409-F396-49EB-9F4C-C2F13FC27D5E}.Release|x86.ActiveCfg = Release|Win32 - {262A7409-F396-49EB-9F4C-C2F13FC27D5E}.Release|x86.Build.0 = Release|Win32 - {262A7409-F396-49EB-9F4C-C2F13FC27D5E}.Release|x86.Deploy.0 = Release|Win32 + {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Debug|ARM64.Build.0 = Debug|ARM64 + {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Debug|x64.ActiveCfg = Debug|x64 + {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Debug|x64.Build.0 = Debug|x64 + {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Debug|x64.Deploy.0 = Debug|x64 + {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Debug|x86.ActiveCfg = Debug|Win32 + {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Debug|x86.Build.0 = Debug|Win32 + {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Debug|x86.Deploy.0 = Debug|Win32 + {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Release|ARM64.ActiveCfg = Release|ARM64 + {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Release|ARM64.Build.0 = Release|ARM64 + {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Release|ARM64.Deploy.0 = Release|ARM64 + {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Release|x64.ActiveCfg = Release|x64 + {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Release|x64.Build.0 = Release|x64 + {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Release|x64.Deploy.0 = Release|x64 + {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Release|x86.ActiveCfg = Release|Win32 + {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Release|x86.Build.0 = Release|Win32 + {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Release|x86.Deploy.0 = Release|Win32 {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|ARM64.ActiveCfg = Debug|ARM64 {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|ARM64.Build.0 = Debug|ARM64 {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x64.ActiveCfg = Debug|x64 diff --git a/windows/ReactNativeStaticServer/NativeReactNativeStaticServerSpec.g.h b/windows/ReactNativeStaticServer/NativeReactNativeStaticServerSpec.g.h index 5e4e1a7..7094ffe 100644 --- a/windows/ReactNativeStaticServer/NativeReactNativeStaticServerSpec.g.h +++ b/windows/ReactNativeStaticServer/NativeReactNativeStaticServerSpec.g.h @@ -29,6 +29,8 @@ REACT_STRUCT(ReactNativeStaticServerSpec_Constants) struct ReactNativeStaticServerSpec_Constants { REACT_FIELD(CRASHED) std::string CRASHED; + REACT_FIELD(IS_MAC_CATALYST) + bool IS_MAC_CATALYST; REACT_FIELD(LAUNCHED) std::string LAUNCHED; REACT_FIELD(TERMINATED) diff --git a/windows/ReactNativeStaticServer/ReactNativeStaticServer.vcxproj b/windows/ReactNativeStaticServer/ReactNativeStaticServer.vcxproj index d4cc440..e4b2de2 100644 --- a/windows/ReactNativeStaticServer/ReactNativeStaticServer.vcxproj +++ b/windows/ReactNativeStaticServer/ReactNativeStaticServer.vcxproj @@ -1,12 +1,12 @@ - + true true true - {262a7409-f396-49eb-9f4c-c2f13fc27d5e} + {0324ce2d-6b96-4f99-9a75-10139a52eb04} ReactNativeStaticServer ReactNativeStaticServer en-US @@ -21,7 +21,7 @@ 10.0.19041.0 - 10.0.16299.0 + 10.0.17763.0 @@ -65,8 +65,7 @@ false - - + @@ -173,4 +172,4 @@ - \ No newline at end of file + diff --git a/windows/ReactNativeStaticServer/lighttpd/lemon.exe b/windows/ReactNativeStaticServer/lighttpd/lemon.exe index f7afa314a1d1a883d17bcc3a6749991b29f996ef..e506ef6d7561e7de15efa5b809413beef4d75c5b 100644 GIT binary patch delta 37 vcmV+=0NVe{jTg&}7m$bp3%sI{i%kMaXo1>=+5v^y0)^TGh1vwQ+6D2&KrIof delta 37 tcmX@zD}K6Hd_o6vTXOltZeOOE{EfF-Z!xysVrsp`+;>n+xgM*%;45tsk~ diff --git a/windows/ReactNativeStaticServer/lighttpd/libpcre2-8.dll b/windows/ReactNativeStaticServer/lighttpd/libpcre2-8.dll index aecd577626b99f1cf5f5eab3695206cf377cac78..eb20426056e6a47838b0f5c68756518375423af2 100644 GIT binary patch delta 49 zcmZ3vO@8Gz`3W7&S9UL&*zLI^%i66EvD96%&oUrw%%gZ`VW$9WoO&U&aQMD E08^qCqW}N^ delta 49 zcmZ3vO@8Gz`3W7&p2_7CyM38hRyN*hy~Wsii>dV%bL%aZt+!aU{(~f2+1a+Tvn$;O E02>DsX#fBK diff --git a/windows/ReactNativeStaticServer/lighttpd/lighttpd.dll b/windows/ReactNativeStaticServer/lighttpd/lighttpd.dll index 32c8131881d03795cd1cdc2d88754752708b8336..9d075be41e53211147e22447331923e63f5bb5f0 100644 GIT binary patch delta 162 zcmWN=ISztQ6hP77`}h?{l)+gjT@0m5a3K~ilGx}L*n_d5p`*8aoAI9H^gj)HzG}(a z=KZYX+Ld=x3)BW`qUJspUPQ9Cd3YCcNY4?+j5y(xGtRl-k}+3YGhxb%IXB#L$2|`` N^29TXuXkm4`vW|}Cz}8O delta 162 zcmWm3ISztQ6hP77|M(qHoIo5wI~U_BjBBvAc#*^g8g^o+?dU1rT1>nYr#ek5UV|bx z)$LKfujUt?pDOB!_C$@S{iuI2-M*al(TBqTLyRy+fC;7uF~b}SEU`j_7;7ZhV2d60 OIN*pBS?%oUd;bG8=_iQ* diff --git a/windows/ReactNativeStaticServer/lighttpd/mod_dirlisting.dll b/windows/ReactNativeStaticServer/lighttpd/mod_dirlisting.dll index a1cc1fe5263a209c6987cc2c758cf658e5c1904e..c707a9e4bed8fb0f455674b868b035e5e2828691 100644 GIT binary patch delta 39 tcmeA@$Gars~p5@X0K>xuVCEHUcuD11^`#>5KsUB delta 39 vcmeA@$<_^yKo1-M&orMjLNwl`~IEE^lV9XlJir+|FLX)V2lyL3|HC diff --git a/windows/ReactNativeStaticServer/lighttpd/mod_h2.dll b/windows/ReactNativeStaticServer/lighttpd/mod_h2.dll index 7f62d90fdc510c307d348dfdc504b4ec68fb2983..6f01c01a499ca439585e00b3845399e40b327829 100644 GIT binary patch delta 43 wcmX>$SNPam;Rzkg;(HcN?Dl2q6yA7C>m`WS%>JsK{S_k+Gi_&o#k~Is0Ho*>PXGV_ delta 43 wcmX>$SNPam;Rzkg)04|5cKb3JC2hQ=^%BHuW`EVr{)!QZnYOdPV&4A*0Hj9~KL7v# From 5687225499ae145cada4fd42748f24af26e3fe7d Mon Sep 17 00:00:00 2001 From: "Dr. Sergey Pogodin" Date: Mon, 3 Jul 2023 17:07:54 +0200 Subject: [PATCH 14/16] README --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 9481496..eb39702 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,9 @@ 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. +**BEWARE:** _The Windows support is broken in the version v0.8.0, rely on +the library version v0.7.13 instead, for now._ + [![Sponsor](https://raw.githubusercontent.com/birdofpreyru/react-native-static-server/master/.README/sponsor.svg)](https://github.com/sponsors/birdofpreyru) ### Sponsored By: From 3759e7ab549b3c5eea1fafa570acfda79798e081 Mon Sep 17 00:00:00 2001 From: "Dr. Sergey Pogodin" Date: Mon, 3 Jul 2023 17:30:07 +0200 Subject: [PATCH 15/16] Fix for Android --- .../reactnativestaticserver/ReactNativeStaticServerModule.java | 1 + 1 file changed, 1 insertion(+) diff --git a/android/src/main/java/com/drpogodin/reactnativestaticserver/ReactNativeStaticServerModule.java b/android/src/main/java/com/drpogodin/reactnativestaticserver/ReactNativeStaticServerModule.java index 7044a44..8401122 100644 --- a/android/src/main/java/com/drpogodin/reactnativestaticserver/ReactNativeStaticServerModule.java +++ b/android/src/main/java/com/drpogodin/reactnativestaticserver/ReactNativeStaticServerModule.java @@ -54,6 +54,7 @@ public Map getTypedExportedConstants() { final Map constants = new HashMap<>(); constants.put("CRASHED", Server.CRASHED); + constants.put("IS_MAC_CATALYST", false); constants.put("LAUNCHED", Server.LAUNCHED); constants.put("TERMINATED", Server.TERMINATED); From 937a0dd4e92f9bca02b6c4eb1268df79c6cb75aa Mon Sep 17 00:00:00 2001 From: "Dr. Sergey Pogodin" Date: Tue, 4 Jul 2023 02:20:08 +0200 Subject: [PATCH 16/16] Fixes for Windows --- example/metro.config.js | 2 ++ example/package-lock.json | 8 ++--- example/package.json | 2 +- .../ReactNativeStaticServerExample.sln | 32 ++++++++----------- .../Package.appxmanifest | 4 +-- .../ReactNativeStaticServerExample.vcxproj | 2 +- package-lock.json | 8 ++--- package.json | 2 +- src/utils.ts | 4 ++- .../ReactNativeModule.cpp | 1 + .../ReactNativeStaticServer.vcxproj | 2 +- 11 files changed, 34 insertions(+), 33 deletions(-) diff --git a/example/metro.config.js b/example/metro.config.js index a33a983..5e9d795 100644 --- a/example/metro.config.js +++ b/example/metro.config.js @@ -84,5 +84,7 @@ module.exports = mergeConfig(getDefaultConfig(), { inlineRequires: true, }, }), + // This fixes the 'missing-asset-registry-path` error (see https://github.com/microsoft/react-native-windows/issues/11437) + assetRegistryPath: 'react-native/Libraries/Image/AssetRegistry', }, }); diff --git a/example/package-lock.json b/example/package-lock.json index 3f6697c..c4f33d6 100644 --- a/example/package-lock.json +++ b/example/package-lock.json @@ -12,7 +12,7 @@ "react-native": "0.72.1", "react-native-fs": "^2.20.0", "react-native-webview": "^13.2.2", - "react-native-windows": "0.72.0" + "react-native-windows": "0.72.1" }, "devDependencies": { "@babel/core": "^7.22.5", @@ -11702,9 +11702,9 @@ } }, "node_modules/react-native-windows": { - "version": "0.72.0", - "resolved": "https://registry.npmjs.org/react-native-windows/-/react-native-windows-0.72.0.tgz", - "integrity": "sha512-nb5yA8g7eIjaDV6vu7Jz9Mbwcl6fpsRuQKTfVmSVixWuohDTkZFasdogIj0u4xLuig4x2Y2DKbRDv+bO+b11Vw==", + "version": "0.72.1", + "resolved": "https://registry.npmjs.org/react-native-windows/-/react-native-windows-0.72.1.tgz", + "integrity": "sha512-Bv8syVPZqxCrUzwvuXOD3z8GyCVfZKGSE752rMREDGa3+LeusICX3qgdJnF6UE+uVJNNPGGKHpSXSeqZj1dIvg==", "dependencies": { "@babel/runtime": "^7.0.0", "@jest/create-cache-key-function": "^29.2.1", diff --git a/example/package.json b/example/package.json index 050816d..ed939fe 100644 --- a/example/package.json +++ b/example/package.json @@ -14,7 +14,7 @@ "react-native": "0.72.1", "react-native-fs": "^2.20.0", "react-native-webview": "^13.2.2", - "react-native-windows": "0.72.0" + "react-native-windows": "0.72.1" }, "devDependencies": { "@babel/core": "^7.22.5", diff --git a/example/windows/ReactNativeStaticServerExample.sln b/example/windows/ReactNativeStaticServerExample.sln index f1cac09..0f40a2c 100644 --- a/example/windows/ReactNativeStaticServerExample.sln +++ b/example/windows/ReactNativeStaticServerExample.sln @@ -33,10 +33,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Mso", "..\node_modules\reac EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Include", "..\node_modules\react-native-windows\include\Include.vcxitems", "{EF074BA1-2D54-4D49-A28E-5E040B47CD2E}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactNativeWebView", "..\node_modules\react-native-webview\windows\ReactNativeWebView\ReactNativeWebView.vcxproj", "{00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactNativeStaticServer", "..\..\windows\ReactNativeStaticServer\ReactNativeStaticServer.vcxproj", "{0324CE2D-6B96-4F99-9A75-10139A52EB04}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactNativeWebView", "..\node_modules\react-native-webview\windows\ReactNativeWebView\ReactNativeWebView.vcxproj", "{00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|ARM64 = Debug|ARM64 @@ -127,34 +127,30 @@ Global {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x64.Build.0 = Release|x64 {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x86.ActiveCfg = Release|Win32 {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x86.Build.0 = Release|Win32 - {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Debug|ARM64.Build.0 = Debug|ARM64 - {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Debug|x64.ActiveCfg = Debug|x64 - {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Debug|x64.Build.0 = Debug|x64 - {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Debug|x86.ActiveCfg = Debug|Win32 - {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Debug|x86.Build.0 = Debug|Win32 - {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Debug|x86.Deploy.0 = Debug|Win32 - {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Release|ARM64.ActiveCfg = Release|ARM64 - {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Release|ARM64.Build.0 = Release|ARM64 - {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Release|x64.ActiveCfg = Release|x64 - {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Release|x64.Build.0 = Release|x64 - {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Release|x86.ActiveCfg = Release|Win32 - {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Release|x86.Build.0 = Release|Win32 - {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Release|x86.Deploy.0 = Release|Win32 {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Debug|ARM64.ActiveCfg = Debug|ARM64 {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Debug|ARM64.Build.0 = Debug|ARM64 {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Debug|x64.ActiveCfg = Debug|x64 {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Debug|x64.Build.0 = Debug|x64 {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Debug|x86.ActiveCfg = Debug|Win32 {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Debug|x86.Build.0 = Debug|Win32 - {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Debug|x86.Deploy.0 = Debug|Win32 {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Release|ARM64.ActiveCfg = Release|ARM64 {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Release|ARM64.Build.0 = Release|ARM64 {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Release|x64.ActiveCfg = Release|x64 {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Release|x64.Build.0 = Release|x64 {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Release|x86.ActiveCfg = Release|Win32 {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Release|x86.Build.0 = Release|Win32 - {0324CE2D-6B96-4F99-9A75-10139A52EB04}.Release|x86.Deploy.0 = Release|Win32 + {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Debug|ARM64.Build.0 = Debug|ARM64 + {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Debug|x64.ActiveCfg = Debug|x64 + {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Debug|x64.Build.0 = Debug|x64 + {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Debug|x86.ActiveCfg = Debug|Win32 + {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Debug|x86.Build.0 = Debug|Win32 + {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Release|ARM64.ActiveCfg = Release|ARM64 + {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Release|ARM64.Build.0 = Release|ARM64 + {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Release|x64.ActiveCfg = Release|x64 + {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Release|x64.Build.0 = Release|x64 + {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Release|x86.ActiveCfg = Release|Win32 + {00AA3765-C6A0-4713-B3F9-BFE47B9C83F5}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/example/windows/ReactNativeStaticServerExample/Package.appxmanifest b/example/windows/ReactNativeStaticServerExample/Package.appxmanifest index 5f784f2..c10e876 100644 --- a/example/windows/ReactNativeStaticServerExample/Package.appxmanifest +++ b/example/windows/ReactNativeStaticServerExample/Package.appxmanifest @@ -7,11 +7,11 @@ IgnorableNamespaces="uap mp"> - + ReactNativeStaticServerExample diff --git a/example/windows/ReactNativeStaticServerExample/ReactNativeStaticServerExample.vcxproj b/example/windows/ReactNativeStaticServerExample/ReactNativeStaticServerExample.vcxproj index 4dd53c2..185853b 100644 --- a/example/windows/ReactNativeStaticServerExample/ReactNativeStaticServerExample.vcxproj +++ b/example/windows/ReactNativeStaticServerExample/ReactNativeStaticServerExample.vcxproj @@ -1,5 +1,5 @@ - + diff --git a/package-lock.json b/package-lock.json index 2edc32a..f1ef4b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,7 @@ "react-native": "0.72.1", "react-native-builder-bob": "^0.21.0", "react-native-fs": "^2.20.0", - "react-native-windows": "^0.72.0", + "react-native-windows": "^0.72.1", "typescript": "^5.1.6" }, "engines": { @@ -15154,9 +15154,9 @@ } }, "node_modules/react-native-windows": { - "version": "0.72.0", - "resolved": "https://registry.npmjs.org/react-native-windows/-/react-native-windows-0.72.0.tgz", - "integrity": "sha512-nb5yA8g7eIjaDV6vu7Jz9Mbwcl6fpsRuQKTfVmSVixWuohDTkZFasdogIj0u4xLuig4x2Y2DKbRDv+bO+b11Vw==", + "version": "0.72.1", + "resolved": "https://registry.npmjs.org/react-native-windows/-/react-native-windows-0.72.1.tgz", + "integrity": "sha512-Bv8syVPZqxCrUzwvuXOD3z8GyCVfZKGSE752rMREDGa3+LeusICX3qgdJnF6UE+uVJNNPGGKHpSXSeqZj1dIvg==", "dev": true, "dependencies": { "@babel/runtime": "^7.0.0", diff --git a/package.json b/package.json index fd248d0..ecf3654 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "react-native": "0.72.1", "react-native-builder-bob": "^0.21.0", "react-native-fs": "^2.20.0", - "react-native-windows": "^0.72.0", + "react-native-windows": "^0.72.1", "typescript": "^5.1.6" }, "peerDependencies": { diff --git a/src/utils.ts b/src/utils.ts index a5c0ac2..1c45f4f 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -11,8 +11,10 @@ function getPlatform(): PLATFORM { return 'ANDROID'; case 'ios': return IS_MAC_CATALYST ? 'MACOS' : 'IOS'; + case 'windows': + return 'WINDOWS'; default: - throw Error('Unsupported platform'); + throw Error(`Unsupported platform ${Platform.OS}`); } } diff --git a/windows/ReactNativeStaticServer/ReactNativeModule.cpp b/windows/ReactNativeStaticServer/ReactNativeModule.cpp index 2a8a6fa..ec70e02 100644 --- a/windows/ReactNativeStaticServer/ReactNativeModule.cpp +++ b/windows/ReactNativeStaticServer/ReactNativeModule.cpp @@ -31,6 +31,7 @@ void OnSignal(std::string signal, std::string details) { ReactNativeStaticServerSpec_Constants ReactNativeModule::GetConstants() noexcept { ReactNativeStaticServerSpec_Constants res; res.CRASHED = CRASHED; + res.IS_MAC_CATALYST = false; res.LAUNCHED = LAUNCHED; res.TERMINATED = TERMINATED; return res; diff --git a/windows/ReactNativeStaticServer/ReactNativeStaticServer.vcxproj b/windows/ReactNativeStaticServer/ReactNativeStaticServer.vcxproj index e4b2de2..6e83359 100644 --- a/windows/ReactNativeStaticServer/ReactNativeStaticServer.vcxproj +++ b/windows/ReactNativeStaticServer/ReactNativeStaticServer.vcxproj @@ -1,5 +1,5 @@ - +