Skip to content

Commit fe1e50d

Browse files
committed
Revert back to v5 of execa due to ESM issues
1 parent 2bbfaf1 commit fe1e50d

File tree

15 files changed

+44
-181
lines changed

15 files changed

+44
-181
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/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 './build';
55
import type { CliBuildOptions, Config, ConfigEnv } from '../types';
@@ -8,7 +8,7 @@ import * as configHelpers from './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/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: {

src/cli/run.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ describe('run.ts', () => {
2121
const mkdirMock = jest.spyOn(fs, 'mkdir');
2222
const execKillMock = {
2323
kill: jest.fn(),
24-
} as unknown as ReturnType<typeof execa.execaCommand>;
24+
} as unknown as execa.ExecaChildProcess<any>;
2525

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

2828
beforeEach(() => {
2929
mkdirMock.mockReset();
@@ -153,7 +153,7 @@ describe('run.ts', () => {
153153
process.cwd()
154154
)} --runInBand`;
155155

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

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

src/cli/run.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, execaCommandSync } from 'execa';
2+
import execa from 'execa';
33
import { promises as fs } from 'fs';
44

55
import { cleanupScreenshots } from '../screenshot';
@@ -102,7 +102,7 @@ export const runHandler = async (args: CliRunOptions) => {
102102
await cleanupScreenshots();
103103

104104
logger.print(`[OWL - CLI] Starting websocket server.`);
105-
const webSocketProcess = execaCommand('node scripts/websocket-server.js', {
105+
const webSocketProcess = execa.command('node scripts/websocket-server.js', {
106106
stdio: 'inherit',
107107
cwd: path.join(__dirname, '..', '..'),
108108
env: {
@@ -149,7 +149,7 @@ export const runHandler = async (args: CliRunOptions) => {
149149
logger.info(`[OWL - CLI] Will set the jest root to ${process.cwd()}.`);
150150

151151
try {
152-
await execaCommandSync(jestCommand, {
152+
await execa.commandSync(jestCommand, {
153153
stdio: 'inherit',
154154
env: {
155155
OWL_PLATFORM: args.platform,

src/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/screenshot.ts

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

@@ -60,7 +60,7 @@ export const takeScreenshot = async (filename: string): Promise<string> => {
6060
logger.info(
6161
`[OWL - CLI] Will run the screenshot command: ${screenshotCommand}.`
6262
);
63-
await execaCommand(screenshotCommand, {
63+
await execa.command(screenshotCommand, {
6464
stdio,
6565
cwd,
6666
shell: platform === 'android',

0 commit comments

Comments
 (0)