Skip to content

Commit 0ad55df

Browse files
committed
fix: add aegir
1 parent 40a9d3e commit 0ad55df

File tree

8 files changed

+29
-267
lines changed

8 files changed

+29
-267
lines changed

.aegir.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22

33
const EchoServer = require('aegir/utils/echo-server')
44
const { format } =require('iso-url')
5-
const path = require('path')
65

76
/** @type {import('aegir').Options["build"]["config"]} */
87
const esbuild = {
9-
//inject: [path.join(__dirname, '../../scripts/node-globals.js')],
108
plugins: [
119
{
1210
name: 'node built ins',
@@ -19,6 +17,7 @@ const esbuild = {
1917
]
2018
}
2119

20+
/** @type {import('aegir').PartialOptions} */
2221
module.exports = {
2322
build: {
2423
config: esbuild
@@ -29,13 +28,17 @@ module.exports = {
2928
buildConfig: esbuild
3029
}
3130
},
32-
before: async () => {
31+
async before (options) {
3332
let echoServer = new EchoServer()
3433
await echoServer.start()
3534
const { address, port } = echoServer.server.address()
35+
let hostname = address
36+
if(options.runner === 'react-native-android') {
37+
hostname = '10.0.2.2'
38+
}
3639
return {
3740
echoServer,
38-
env: { ECHO_SERVER : format({ protocol: 'http:', hostname: address, port })}
41+
env: { ECHO_SERVER : format({ protocol: 'http:', hostname, port })}
3942
}
4043
},
4144
async after (options, before) {

.github/workflows/main.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,21 +76,21 @@ jobs:
7676
target: default
7777
arch: x86_64
7878
profile: pixel
79-
avd-name: google-pixel
79+
avd-name: aegir-android-29
8080
script: |
81-
npx rn-test --platform android --emulator google-pixel 'test/**/*.spec.js'
82-
test-react-native-ios:
83-
runs-on: macos-latest
84-
steps:
85-
- uses: actions/checkout@v2
86-
- run: npm install
87-
- name: Create and run iOS simulator
88-
run: |
89-
SIMULATOR_RUNTIME=$(echo "iOS 14.4" | sed 's/[ \.]/-/g')
90-
SIMULATOR_ID=$(xcrun simctl create "iPhone 11" com.apple.CoreSimulator.SimDeviceType.iPhone-11 com.apple.CoreSimulator.SimRuntime.$SIMULATOR_RUNTIME)
91-
echo "IOS_SIMULATOR=$SIMULATOR_ID" >> $GITHUB_ENV
92-
xcrun simctl boot $SIMULATOR_ID &
93-
- run: npx rn-test --platform ios --simulator 'iPhone 11 (14.4)' --rn 0.62.0 'test/**/*.spec.js'
94-
- name: Shutdown iOS simulator
95-
run: |
96-
xcrun simctl shutdown $IOS_SIMULATOR
81+
npx aegir test -t react-native-android'
82+
# test-react-native-ios:
83+
# runs-on: macos-latest
84+
# steps:
85+
# - uses: actions/checkout@v2
86+
# - run: npm install
87+
# - name: Create and run iOS simulator
88+
# run: |
89+
# SIMULATOR_RUNTIME=$(echo "iOS 14.4" | sed 's/[ \.]/-/g')
90+
# SIMULATOR_ID=$(xcrun simctl create "iPhone 11" com.apple.CoreSimulator.SimDeviceType.iPhone-11 com.apple.CoreSimulator.SimRuntime.$SIMULATOR_RUNTIME)
91+
# echo "IOS_SIMULATOR=$SIMULATOR_ID" >> $GITHUB_ENV
92+
# xcrun simctl boot $SIMULATOR_ID &
93+
# - run: npx rn-test --platform ios --simulator 'iPhone 11 (14.4)' --rn 0.62.0 'test/**/*.spec.js'
94+
# - name: Shutdown iOS simulator
95+
# run: |
96+
# xcrun simctl shutdown $IOS_SIMULATOR

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"is-electron": "^2.2.0",
6060
"iso-url": "^1.1.3",
6161
"it-glob": "~0.0.11",
62-
"it-to-stream": "^0.1.2",
62+
"it-to-stream": "^1.0.0",
6363
"merge-options": "^3.0.4",
6464
"nanoid": "^3.1.20",
6565
"native-abort-controller": "^1.0.3",
@@ -71,17 +71,17 @@
7171
"devDependencies": {
7272
"@types/err-code": "^2.0.0",
7373
"@types/fs-extra": "^9.0.5",
74-
"aegir": "^32.2.0",
74+
"aegir": "ipfs/aegir#feat/rn",
7575
"delay": "^5.0.0",
7676
"events": "^3.3.0",
7777
"ipfs-unixfs": "^4.0.1",
7878
"it-all": "^1.0.4",
7979
"it-drain": "^1.0.3",
8080
"it-last": "^1.0.4",
81+
"react-native-polyfill-globals": "^3.0.0",
8182
"readable-stream": "^3.6.0",
8283
"uint8arrays": "^2.0.5",
83-
"util": "^0.12.3",
84-
"react-native-polyfill-globals": "^3.0.0"
84+
"util": "^0.12.3"
8585
},
8686
"eslintConfig": {
8787
"extends": "ipfs",

src/http/error.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ exports.AbortError = AbortError
1818

1919
class HTTPError extends Error {
2020
/**
21-
* @param {import('native-fetch').Response} response
21+
* @param {Response} response
2222
*/
2323
constructor (response) {
2424
super(response.statusText)

tsconfig.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@
22
"extends": "aegir/src/config/tsconfig.aegir.json",
33
"compilerOptions": {
44
"outDir": "dist"
5-
// "baseUrl": "./",
6-
// "paths": {
7-
// "*": ["./types/*"]
8-
// }
95
},
106
"include": [
11-
// "types",
127
"test",
138
"src"
149
]

types/electron-fetch/index.d.ts

Lines changed: 0 additions & 117 deletions
This file was deleted.

types/is-electron/index.d.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

types/native-fetch/index.d.ts

Lines changed: 0 additions & 117 deletions
This file was deleted.

0 commit comments

Comments
 (0)