Skip to content

Commit b16e817

Browse files
committed
Revert back to v5 of execa due to ESM issues
1 parent cef98b8 commit b16e817

File tree

15 files changed

+45
-183
lines changed

15 files changed

+45
-183
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ lib/
6464

6565
# React Native Codegen
6666
android/generated
67+
ios/generated
6768

6869
# Expo Example prebuild generated files
6970
ExpoExample/android

android/src/newarch/OwlSpec.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.owl
1+
package com.formidable.reactnativeowl;
22

33
import com.facebook.react.bridge.ReactApplicationContext
44

android/src/oldarch/OwlSpec.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
package com.owl
1+
package com.formidable.reactnativeowl;
22

33
import com.facebook.react.bridge.ReactApplicationContext
44
import com.facebook.react.bridge.ReactContextBaseJavaModule
55
import com.facebook.react.bridge.Promise
66

77
abstract class OwlSpec internal constructor(context: ReactApplicationContext) :
88
ReactContextBaseJavaModule(context) {
9-
10-
abstract fun multiply(a: Double, b: Double, promise: Promise)
119
}

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
},
7676
"dependencies": {
7777
"ajv": "^7.2.4",
78-
"execa": "^9.4.0",
78+
"execa": "^5.1.1",
7979
"handlebars": "^4.7.8",
8080
"pixelmatch": "^6.0.0",
8181
"pngjs": "^7.0.0",
@@ -179,7 +179,8 @@
179179
"type": "all",
180180
"jsSrcsDir": "src",
181181
"outputDir": {
182-
"android": "android/generated"
182+
"android": "android/generated",
183+
"ios": "ios/generated"
183184
},
184185
"android": {
185186
"javaPackageName": "com.formidable.reactnativeowl"

src/__tests__/cli/build.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import path from 'path';
2-
import * as execa from 'execa';
2+
import execa from 'execa';
33

44
import { buildAndroid, buildHandler, buildIOS, ENTRY_FILE } from '../../cli/build';
55
import type { CliBuildOptions, Config, ConfigEnv } from '../../types';
@@ -8,7 +8,7 @@ import * as configHelpers from '../../cli/config';
88

99
describe('build.ts', () => {
1010
const logger = new Logger();
11-
const execMock = jest.spyOn(execa, 'execaCommand').mockImplementation();
11+
const execMock = jest.spyOn(execa, 'command').mockImplementation();
1212

1313
beforeEach(() => {
1414
execMock.mockReset();

src/__tests__/cli/run.test.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import type { CliRunOptions, Config } from '../../types';
77
import * as run from '../../cli/run';
88
import * as xcrun from '../../utils/xcrun';
99
import * as adb from '../../utils/adb';
10-
import * as execa from 'execa';
11-
import { execaCommand } from 'execa';
10+
import execa from 'execa';
1211
import { Logger } from '../../logger';
1312

1413
jest.mock('../../utils/xcrun');
@@ -22,9 +21,9 @@ describe('run.ts', () => {
2221
const mkdirMock = jest.spyOn(fs, 'mkdir');
2322
const execKillMock = {
2423
kill: jest.fn(),
25-
} as unknown as ReturnType<typeof execaCommand>;
24+
} as unknown as execa.ExecaChildProcess<any>;
2625

27-
const execMock = jest.spyOn(execa, 'execaCommand').mockReturnValue(execKillMock);
26+
const execMock = jest.spyOn(execa, 'command').mockImplementation();
2827

2928
beforeEach(() => {
3029
mkdirMock.mockReset();
@@ -154,7 +153,7 @@ describe('run.ts', () => {
154153
process.cwd()
155154
)} --runInBand`;
156155

157-
const commandSyncMock = jest.spyOn(execa, 'execaCommandSync');
156+
const commandSyncMock = jest.spyOn(execa, 'commandSync');
158157
const mockGenerateReport = jest.spyOn(reportHelpers, 'generateReport');
159158

160159
jest.spyOn(Logger.prototype, 'print').mockImplementation();

src/__tests__/screenshot.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as execa from 'execa';
1+
import execa from 'execa';
22
import path from 'path';
33
import { promises as fs } from 'fs';
44

@@ -8,7 +8,7 @@ import * as fileExistsHelpers from '../utils/file-exists';
88
const SCREENSHOT_FILENAME = 'screen';
99

1010
describe('screenshot.ts', () => {
11-
const commandMock = jest.spyOn(execa, 'execaCommand');
11+
const commandMock = jest.spyOn(execa, 'command');
1212
const mkdirMock = jest.spyOn(fs, 'mkdir').mockImplementation();
1313
const writeFileMock = jest.spyOn(fs, 'writeFile').mockImplementation();
1414

src/__tests__/utils/adb.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import * as execa from 'execa';
2-
import { execaCommand } from 'execa';
1+
import execa from 'execa';
32

43
import * as adb from '../../utils/adb';
54

@@ -10,8 +9,8 @@ describe('adb.ts', () => {
109

1110
const execKillMock = {
1211
kill: jest.fn(),
13-
} as unknown as ReturnType<typeof execaCommand>;
14-
const execMock = jest.spyOn(execa, 'execaCommand').mockReturnValue(execKillMock);
12+
} as unknown as execa.ExecaChildProcess<any>;
13+
const execMock = jest.spyOn(execa, 'command').mockReturnValue(execKillMock);
1514

1615
beforeEach(() => {
1716
execMock.mockReset();

src/__tests__/utils/xcrun.test.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import * as execa from 'execa';
2-
import { execaCommand } from 'execa';
1+
import execa from 'execa';
32

43
import * as xcrun from '../../utils/./xcrun';
54

@@ -10,9 +9,9 @@ describe('xcrun.ts', () => {
109

1110
const execKillMock = {
1211
kill: jest.fn(),
13-
} as unknown as ReturnType<typeof execaCommand>;
14-
const execMock = jest.spyOn(execa, 'execaCommand').mockReturnValue(execKillMock);
15-
12+
stdout: 'bundleId',
13+
} as unknown as execa.ExecaChildProcess<any>;
14+
const execMock = jest.spyOn(execa, 'command').mockReturnValue(execKillMock);
1615

1716
beforeEach(() => {
1817
execMock.mockClear();

src/cli/build.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import path from 'path';
2-
import { execaCommand } from 'execa';
2+
import execa from 'execa';
33

44
import type { CliBuildOptions, Config } from '../types';
55
import { Logger } from '../logger';
@@ -29,7 +29,7 @@ export const buildIOS = async (
2929

3030
logger.info(`[OWL - CLI] Building the app with: ${buildCommand.join(' ')}.`);
3131

32-
await execaCommand(buildCommand.join(' '), {
32+
await execa.command(buildCommand.join(' '), {
3333
stdio: 'inherit',
3434
env: {
3535
ENTRY_FILE,
@@ -65,7 +65,7 @@ export const buildAndroid = async (
6565

6666
logger.info(`[OWL - CLI] Building the app with: ${buildCommand.join(' ')}.`);
6767

68-
await execaCommand(buildCommand.join(' '), {
68+
await execa.command(buildCommand.join(' '), {
6969
stdio: 'inherit',
7070
cwd,
7171
env: {

0 commit comments

Comments
 (0)