-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Expo plugin issues, dependency issues, and stabilize (#247)
- Update Expo config - Add Prettier config - Update Node version in NPM release GitHub action - Rebuild ViroRenderer for iOS
- Loading branch information
1 parent
50879c8
commit 15d3e1d
Showing
159 changed files
with
10,498 additions
and
2,270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"trailingComma": "es5", | ||
"tabWidth": 2, | ||
"semi": true, | ||
"singleQuote": false | ||
} |
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
import { DEFAULTS } from "../plugins/withViro"; | ||
|
||
const TEST_TEXT = "This is not the default text."; | ||
|
||
export const infoPlistDefinedTestPluginConfigs = [ | ||
{ | ||
config: [ | ||
"@viro-community/react-viro", | ||
{ ios: { photosPermission: TEST_TEXT } }, | ||
], | ||
afterInfoPlist: { | ||
NSPhotoLibraryUsageDescription: TEST_TEXT, | ||
NSPhotoLibraryAddUsageDescription: DEFAULTS.ios.savePhotosPermission, | ||
NSCameraUsageDescription: DEFAULTS.ios.cameraUsagePermission, | ||
NSMicrophoneUsageDescription: DEFAULTS.ios.microphoneUsagePermission, | ||
}, | ||
}, | ||
{ | ||
config: [ | ||
"@viro-community/react-viro", | ||
{ ios: { savePhotosPermission: TEST_TEXT } }, | ||
], | ||
afterInfoPlist: { | ||
NSPhotoLibraryUsageDescription: DEFAULTS.ios.photosPermission, | ||
NSPhotoLibraryAddUsageDescription: TEST_TEXT, | ||
NSCameraUsageDescription: DEFAULTS.ios.cameraUsagePermission, | ||
NSMicrophoneUsageDescription: DEFAULTS.ios.microphoneUsagePermission, | ||
}, | ||
}, | ||
{ | ||
config: [ | ||
"@viro-community/react-viro", | ||
{ ios: { cameraUsagePermission: TEST_TEXT } }, | ||
], | ||
afterInfoPlist: { | ||
NSPhotoLibraryUsageDescription: DEFAULTS.ios.photosPermission, | ||
NSPhotoLibraryAddUsageDescription: DEFAULTS.ios.savePhotosPermission, | ||
NSCameraUsageDescription: TEST_TEXT, | ||
NSMicrophoneUsageDescription: DEFAULTS.ios.microphoneUsagePermission, | ||
}, | ||
}, | ||
{ | ||
config: [ | ||
"@viro-community/react-viro", | ||
{ ios: { microphoneUsagePermission: TEST_TEXT } }, | ||
], | ||
afterInfoPlist: { | ||
NSPhotoLibraryUsageDescription: DEFAULTS.ios.photosPermission, | ||
NSPhotoLibraryAddUsageDescription: DEFAULTS.ios.savePhotosPermission, | ||
NSCameraUsageDescription: DEFAULTS.ios.cameraUsagePermission, | ||
NSMicrophoneUsageDescription: TEST_TEXT, | ||
}, | ||
}, | ||
{ | ||
config: [ | ||
"@viro-community/react-viro", | ||
{ | ||
ios: { | ||
microphoneUsagePermission: TEST_TEXT, | ||
photosPermission: TEST_TEXT, | ||
savePhotosPermission: TEST_TEXT, | ||
cameraUsagePermission: TEST_TEXT, | ||
}, | ||
}, | ||
], | ||
afterInfoPlist: { | ||
NSPhotoLibraryUsageDescription: TEST_TEXT, | ||
NSPhotoLibraryAddUsageDescription: TEST_TEXT, | ||
NSCameraUsageDescription: TEST_TEXT, | ||
NSMicrophoneUsageDescription: TEST_TEXT, | ||
}, | ||
}, | ||
]; | ||
|
||
export const infoPlistDefinedAppConfigBefore: any = { | ||
name: "Example App Config", | ||
slug: "example-app-config", | ||
version: "1.0.0", | ||
orientation: "portrait", | ||
icon: "./assets/images/icon.png", | ||
scheme: "myapp", | ||
userInterfaceStyle: "automatic", | ||
splash: { | ||
image: "./assets/images/splash.png", | ||
resizeMode: "contain", | ||
backgroundColor: "#ffffff", | ||
}, | ||
updates: { | ||
fallbackToCacheTimeout: 0, | ||
}, | ||
assetBundlePatterns: ["**/*"], | ||
plugins: [], | ||
ios: { | ||
supportsTablet: true, | ||
bundleIdentifier: "com.example.app.config", | ||
buildNumber: `${Math.floor(Number(Date.now() / 1000))}`, | ||
config: { | ||
usesNonExemptEncryption: false, | ||
}, | ||
}, | ||
android: { | ||
adaptiveIcon: { | ||
foregroundImage: "./assets/images/adaptive-icon.png", | ||
backgroundColor: "#ffffff", | ||
}, | ||
package: "com.example.app.config", | ||
versionCode: Math.floor(Number(Date.now() / 1000)), | ||
}, | ||
extra: { | ||
eas: { | ||
projectId: "eef69c9f-ddbe-45f2-933a-51ff4f8948b9", | ||
}, | ||
}, | ||
}; | ||
|
||
export const infoPlistDefinedAppConfigAfter: any = { | ||
name: "Example App Config", | ||
slug: "example-app-config", | ||
version: "1.0.0", | ||
orientation: "portrait", | ||
icon: "./assets/images/icon.png", | ||
scheme: "myapp", | ||
userInterfaceStyle: "automatic", | ||
splash: { | ||
image: "./assets/images/splash.png", | ||
resizeMode: "contain", | ||
backgroundColor: "#ffffff", | ||
}, | ||
updates: { | ||
fallbackToCacheTimeout: 0, | ||
}, | ||
assetBundlePatterns: ["**/*"], | ||
plugins: [], | ||
ios: { | ||
supportsTablet: true, | ||
bundleIdentifier: "com.example.app.config", | ||
buildNumber: `${Math.floor(Number(Date.now() / 1000))}`, | ||
config: { | ||
usesNonExemptEncryption: false, | ||
}, | ||
infoPlist: { | ||
NSPhotoLibraryUsageDescription: DEFAULTS.ios.photosPermission, | ||
NSPhotoLibraryAddUsageDescription: DEFAULTS.ios.savePhotosPermission, | ||
NSCameraUsageDescription: DEFAULTS.ios.cameraUsagePermission, | ||
NSMicrophoneUsageDescription: DEFAULTS.ios.microphoneUsagePermission, | ||
}, | ||
}, | ||
android: { | ||
adaptiveIcon: { | ||
foregroundImage: "./assets/images/adaptive-icon.png", | ||
backgroundColor: "#ffffff", | ||
}, | ||
package: "com.example.app.config", | ||
versionCode: Math.floor(Number(Date.now() / 1000)), | ||
}, | ||
extra: { | ||
eas: { | ||
projectId: "eef69c9f-ddbe-45f2-933a-51ff4f8948b9", | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import { DEFAULTS } from "../plugins/withViro"; | ||
|
||
export const pluginConfigs = [ | ||
"@viro-community/react-viro", | ||
["@viro-community/react-viro", { ios: {} }], | ||
["@viro-community/react-viro", { android: { xRMode: ["GVR"] } }], | ||
["@viro-community/react-viro", { android: { xRMode: ["GVR"] }, ios: {} }], | ||
]; | ||
|
||
export const noInfoPlistDefinitionsAppConfigBefore: any = { | ||
name: "Example App Config", | ||
slug: "example-app-config", | ||
version: "1.0.0", | ||
orientation: "portrait", | ||
icon: "./assets/images/icon.png", | ||
scheme: "myapp", | ||
userInterfaceStyle: "automatic", | ||
splash: { | ||
image: "./assets/images/splash.png", | ||
resizeMode: "contain", | ||
backgroundColor: "#ffffff", | ||
}, | ||
updates: { | ||
fallbackToCacheTimeout: 0, | ||
}, | ||
assetBundlePatterns: ["**/*"], | ||
plugins: [], | ||
ios: { | ||
supportsTablet: true, | ||
bundleIdentifier: "com.example.app.config", | ||
buildNumber: `${Math.floor(Number(Date.now() / 1000))}`, | ||
config: { | ||
usesNonExemptEncryption: false, | ||
}, | ||
}, | ||
android: { | ||
adaptiveIcon: { | ||
foregroundImage: "./assets/images/adaptive-icon.png", | ||
backgroundColor: "#ffffff", | ||
}, | ||
package: "com.example.app.config", | ||
versionCode: Math.floor(Number(Date.now() / 1000)), | ||
}, | ||
extra: { | ||
eas: { | ||
projectId: "eef69c9f-ddbe-45f2-933a-51ff4f8948b9", | ||
}, | ||
}, | ||
}; | ||
|
||
export const noInfoPlistDefinitionsAppConfigAfter: any = { | ||
name: "Example App Config", | ||
slug: "example-app-config", | ||
version: "1.0.0", | ||
orientation: "portrait", | ||
icon: "./assets/images/icon.png", | ||
scheme: "myapp", | ||
userInterfaceStyle: "automatic", | ||
splash: { | ||
image: "./assets/images/splash.png", | ||
resizeMode: "contain", | ||
backgroundColor: "#ffffff", | ||
}, | ||
updates: { | ||
fallbackToCacheTimeout: 0, | ||
}, | ||
assetBundlePatterns: ["**/*"], | ||
plugins: [], | ||
ios: { | ||
supportsTablet: true, | ||
bundleIdentifier: "com.example.app.config", | ||
buildNumber: `${Math.floor(Number(Date.now() / 1000))}`, | ||
config: { | ||
usesNonExemptEncryption: false, | ||
}, | ||
infoPlist: { | ||
NSPhotoLibraryUsageDescription: DEFAULTS.ios.photosPermission, | ||
NSPhotoLibraryAddUsageDescription: DEFAULTS.ios.savePhotosPermission, | ||
NSCameraUsageDescription: DEFAULTS.ios.cameraUsagePermission, | ||
NSMicrophoneUsageDescription: DEFAULTS.ios.microphoneUsagePermission, | ||
}, | ||
}, | ||
android: { | ||
adaptiveIcon: { | ||
foregroundImage: "./assets/images/adaptive-icon.png", | ||
backgroundColor: "#ffffff", | ||
}, | ||
package: "com.example.app.config", | ||
versionCode: Math.floor(Number(Date.now() / 1000)), | ||
}, | ||
extra: { | ||
eas: { | ||
projectId: "eef69c9f-ddbe-45f2-933a-51ff4f8948b9", | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { describe, expect, test } from "@jest/globals"; | ||
import { withDefaultInfoPlist } from "../plugins/withViroIos"; | ||
import { | ||
noInfoPlistDefinitionsAppConfigAfter, | ||
noInfoPlistDefinitionsAppConfigBefore, | ||
pluginConfigs, | ||
} from "./noInfoPlistDefined"; | ||
import { | ||
infoPlistDefinedAppConfigAfter, | ||
infoPlistDefinedAppConfigBefore, | ||
infoPlistDefinedTestPluginConfigs, | ||
} from "./infoPlistDefined"; | ||
|
||
describe("withViro", () => { | ||
test("should correctly set InfoPlist config if no InfoPlist values are configured", () => { | ||
for (const configuration of pluginConfigs) { | ||
noInfoPlistDefinitionsAppConfigBefore.plugins = [configuration]; | ||
noInfoPlistDefinitionsAppConfigAfter.plugins = [configuration]; | ||
expect( | ||
withDefaultInfoPlist( | ||
noInfoPlistDefinitionsAppConfigBefore, | ||
undefined as any | ||
) | ||
).toStrictEqual(noInfoPlistDefinitionsAppConfigAfter); | ||
} | ||
}); | ||
|
||
test("should correctly set InfoPlist config if InfoPlist values are configured", () => { | ||
for (const scenario of infoPlistDefinedTestPluginConfigs) { | ||
infoPlistDefinedAppConfigBefore.ios.infoPlist = undefined; | ||
infoPlistDefinedAppConfigBefore.plugins = [scenario.config]; | ||
infoPlistDefinedAppConfigAfter.plugins = [scenario.config]; | ||
infoPlistDefinedAppConfigAfter.ios.infoPlist = scenario.afterInfoPlist; | ||
expect( | ||
withDefaultInfoPlist(infoPlistDefinedAppConfigBefore, undefined as any) | ||
).toStrictEqual(infoPlistDefinedAppConfigAfter); | ||
} | ||
}); | ||
|
||
// TODO: Testing that withViro updates files correctly (Podfile, Android files, etc.) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
presets: [ | ||
['@babel/preset-env', {targets: {node: 'current'}}], | ||
'@babel/preset-typescript', | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.