Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade dev dependencies #778

Merged
merged 14 commits into from
Jul 22, 2023
18 changes: 0 additions & 18 deletions .babelrc

This file was deleted.

21 changes: 12 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ jobs:
build-test-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3.7.0
with:
node-version: 16.x
node-version: 18.x
cache: 'yarn'
- name: Setup
run: sudo apt-get install -y libgbm-dev
- name: Test
Expand All @@ -26,10 +27,11 @@ jobs:
build-test-macos:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3.7.0
with:
node-version: 16.x
node-version: 18.x
cache: 'yarn'
- name: Test
run: |
yarn
Expand All @@ -40,10 +42,11 @@ jobs:
build-test-windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3.7.0
with:
node-version: 16.x
node-version: 18.x
cache: 'yarn'
- name: Test
shell: bash
run: |
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ jobs:
release-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3.7.0
with:
node-version: 16.x
node-version: 18.x
cache: 'yarn'
- name: Package
run: |
yarn
Expand All @@ -24,10 +25,11 @@ jobs:
release-windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3.7.0
with:
node-version: 16.x
node-version: 18.x
cache: 'yarn'
- name: Package
shell: bash
run: |
Expand Down
5 changes: 2 additions & 3 deletions __e2e__/app.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import createMockRNServer from './mockRNServer';

const delay = (time) => new Promise((resolve) => setTimeout(resolve, time));

// eslint-disable-next-line
jasmine.DEFAULT_TIMEOUT_INTERVAL = 6e4;
jest.setTimeout(6e4);

describe('Application launch', () => {
let electronApp;
Expand Down Expand Up @@ -108,7 +107,7 @@ describe('Application launch', () => {
const rndPort = fs.readFileSync(portFile, 'utf-8');

const sendSuccess = await new Promise((resolve) => {
const socket = net.createConnection({ port: rndPort }, () => {
const socket = net.createConnection({ host: '127.0.0.1', port: rndPort }, () => {
let pass;
socket.setEncoding('utf-8');
socket.write(JSON.stringify({ path: rndPath }));
Expand Down
27 changes: 14 additions & 13 deletions app/containers/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,7 @@

const shortcutPrefix = process.platform === 'darwin' ? '⌥⌘' : 'Ctrl+Alt+';

@connect(
state => ({
debugger: state.debugger,
setting: state.setting,
}),
dispatch => ({
actions: {
debugger: bindActionCreators(debuggerActions, dispatch),
setting: bindActionCreators(settingActions, dispatch),
},
})
)
export default class App extends Component {
class App extends Component {
static propTypes = {
setting: PropTypes.object.isRequired,
debugger: PropTypes.object.isRequired,
Expand Down Expand Up @@ -145,7 +133,7 @@
handlePortOnSubmit = (evt, port) => {
ipcRenderer.once('check-port-available-reply', (event, available) => {
if (!available) {
alert(`The port ${port} is already used by another window.`);

Check warning on line 136 in app/containers/App.js

View workflow job for this annotation

GitHub Actions / build-test-linux

Unexpected alert

Check warning on line 136 in app/containers/App.js

View workflow job for this annotation

GitHub Actions / build-test-macos

Unexpected alert

Check warning on line 136 in app/containers/App.js

View workflow job for this annotation

GitHub Actions / build-test-windows

Unexpected alert

Check warning on line 136 in app/containers/App.js

View workflow job for this annotation

GitHub Actions / build-test-linux

Unexpected alert

Check warning on line 136 in app/containers/App.js

View workflow job for this annotation

GitHub Actions / build-test-windows

Unexpected alert

Check warning on line 136 in app/containers/App.js

View workflow job for this annotation

GitHub Actions / build-test-macos

Unexpected alert
return;
}
const { setDebuggerLocation } = this.props.actions.debugger;
Expand Down Expand Up @@ -207,3 +195,16 @@
);
}
}

export default connect(
state => ({
debugger: state.debugger,
setting: state.setting,
}),
dispatch => ({
actions: {
debugger: bindActionCreators(debuggerActions, dispatch),
setting: bindActionCreators(settingActions, dispatch),
},
})
)(App);
18 changes: 10 additions & 8 deletions app/containers/ReactInspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,7 @@ const styles = {

const isReactPanelOpen = props => props.setting.react;

@connect(
state => ({
debugger: state.debugger,
setting: state.setting,
}),
dispatch => ({ dispatch })
)
export default class ReactInspector extends Component {
class ReactInspector extends Component {
static propTypes = {
debugger: PropTypes.object,
setting: PropTypes.object,
Expand Down Expand Up @@ -159,3 +152,12 @@ export default class ReactInspector extends Component {
);
}
}


export default connect(
state => ({
debugger: state.debugger,
setting: state.setting,
}),
dispatch => ({ dispatch })
)(ReactInspector);
42 changes: 21 additions & 21 deletions app/containers/ReduxDevTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,7 @@ const devtoolsStyle = {
height: '100%', overflow: 'auto',
};

@enhance
@connect(
state => {
const instances = state.instances;
const id = getActiveInstance(instances);
return {
selected: instances.selected,
liftedState: instances.states[id],
monitorState: state.monitor.monitorState,
options: instances.options[id],
monitor: state.monitor.selected,
dispatcherIsOpen: state.monitor.dispatcherIsOpen,
sliderIsOpen: state.monitor.sliderIsOpen,
};
},
dispatch => ({
liftedDispatch: bindActionCreators(liftedDispatchAction, dispatch),
dispatch,
})
)
export default class ReduxDevTools extends Component {
class ReduxDevTools extends Component {
static propTypes = {
style: PropTypes.object,
debugger: PropTypes.object,
Expand Down Expand Up @@ -141,3 +121,23 @@ export default class ReduxDevTools extends Component {
);
}
}

export default connect(
state => {
const instances = state.instances;
const id = getActiveInstance(instances);
return {
selected: instances.selected,
liftedState: instances.states[id],
monitorState: state.monitor.monitorState,
options: instances.options[id],
monitor: state.monitor.selected,
dispatcherIsOpen: state.monitor.dispatcherIsOpen,
sliderIsOpen: state.monitor.sliderIsOpen,
};
},
dispatch => ({
liftedDispatch: bindActionCreators(liftedDispatchAction, dispatch),
dispatch,
})
)(enhance(ReduxDevTools));
2 changes: 1 addition & 1 deletion app/worker/asyncStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export const getClearAsyncStorageFn = AsyncStorage => {
return () => AsyncStorage.clear().catch(f => f);
};

function convertError(error): ?Error {
function convertError(error) {
if (!error) {
return null;
}
Expand Down
17 changes: 17 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = (api) => {
api.cache(true);
return {
presets: [['@babel/preset-env', { targets: { node: '18.5' } }], '@babel/preset-react'],
plugins: [],
env: {
production: {
plugins: [
'@babel/plugin-transform-react-inline-elements',
'@babel/plugin-transform-react-constant-elements',
'transform-react-remove-prop-types',
'closure-elimination',
],
},
},
};
};
28 changes: 14 additions & 14 deletions electron/config/__tests__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`openConfigFile 1`] = `
Object {
"config": Object {
{
"config": {
"autoUpdate": true,
"defaultNetworkInspect": false,
"defaultRNPackagerPorts": Array [
"defaultRNPackagerPorts": [
8081,
],
"defaultReactDevToolsPort": 19567,
"defaultReactDevToolsTheme": "RNDebugger",
"editor": "",
"timesJSLoadToRefreshDevTools": -1,
"windowBounds": Object {
"windowBounds": {
"frame": true,
},
},
}
`;

exports[`readConfig 1`] = `
Object {
"config": Object {
{
"config": {
"autoUpdate": true,
"defaultNetworkInspect": false,
"defaultRNPackagerPorts": Array [
"defaultRNPackagerPorts": [
8081,
],
"defaultReactDevToolsPort": 19567,
"defaultReactDevToolsTheme": "RNDebugger",
"editor": "",
"timesJSLoadToRefreshDevTools": -1,
"windowBounds": Object {
"windowBounds": {
"frame": true,
},
},
}
`;

exports[`readConfig 2`] = `
Object {
"config": Object {
{
"config": {
"autoUpdate": false,
},
}
`;

exports[`readConfig 3`] = `
Object {
"config": Object {
{
"config": {
"autoUpdate": true,
"defaultNetworkInspect": false,
"defaultRNPackagerPorts": Array [
"defaultRNPackagerPorts": [
8081,
],
"defaultReactDevToolsPort": 19567,
"defaultReactDevToolsTheme": "RNDebugger",
"editor": "",
"timesJSLoadToRefreshDevTools": -1,
"windowBounds": Object {
"windowBounds": {
"frame": true,
},
},
Expand Down
3 changes: 0 additions & 3 deletions npm-package/.babelrc

This file was deleted.

6 changes: 6 additions & 0 deletions npm-package/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = (api) => {
api.cache(true);
return {
presets: [['env', { targets: { node: '12' } }]],
};
};
Loading
Loading