Skip to content

Commit 0711b6b

Browse files
author
timmydoza
authored
Update NPM scripts to allow usage in Windows (#744)
1 parent cfe1b4b commit 0711b6b

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
},
8787
"scripts": {
8888
"postinstall": "rimraf public/virtualbackground && copyfiles -f node_modules/@twilio/video-processors/dist/build/* public/virtualbackground",
89-
"start": "npx cross-env REACT_APP_VERSION=$(node -e \"console.log(require('./package.json').version)\") concurrently npm:server npm:dev",
89+
"start": "concurrently npm:server npm:dev",
9090
"dev": "react-scripts start",
9191
"build": "node ./scripts/build.js",
9292
"test": "cross-env TZ=utc jest --config jest.config.js",

scripts/build.js

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class Filter extends Transform {
4040

4141
// Colors normally don't work when using spawn(), so here we re-enable colors.
4242
process.env.FORCE_COLOR = require('supports-color').stdout.level;
43-
process.env.REACT_APP_VERSION = require(__dirname + "/../package.json").version
4443

4544
const buildProcess = spawn('node', [require.resolve('react-scripts/scripts/build')]);
4645

src/components/AboutDialog/AboutDialog.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { useAppState } from '../../state';
55

66
jest.mock('twilio-video', () => ({ version: '1.2', isSupported: true }));
77
jest.mock('../../state');
8+
jest.mock('../../../package.json', () => ({ version: '1.3' }));
89

910
const mockUseAppState = useAppState as jest.Mock<any>;
1011
mockUseAppState.mockImplementation(() => ({ roomType: undefined }));

src/components/AboutDialog/AboutDialog.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import DialogContent from '@material-ui/core/DialogContent';
66
import DialogContentText from '@material-ui/core/DialogContentText';
77
import DialogTitle from '@material-ui/core/DialogTitle';
88
import Divider from '@material-ui/core/Divider';
9+
import packageJSON from '../../../package.json';
910

1011
import Video from 'twilio-video';
1112
import { useAppState } from '../../state';
@@ -24,7 +25,7 @@ function AboutDialog({ open, onClose }: PropsWithChildren<AboutDialogProps>) {
2425
<DialogContent>
2526
<DialogContentText>Browser supported: {String(Video.isSupported)}</DialogContentText>
2627
<DialogContentText>SDK Version: {Video.version}</DialogContentText>
27-
<DialogContentText>App Version: {process.env.REACT_APP_VERSION}</DialogContentText>
28+
<DialogContentText>App Version: {packageJSON.version}</DialogContentText>
2829
<DialogContentText>Deployed Tag: {process.env.REACT_APP_GIT_TAG || 'N/A'}</DialogContentText>
2930
<DialogContentText>Deployed Commit Hash: {process.env.REACT_APP_GIT_COMMIT || 'N/A'}</DialogContentText>
3031
{roomType && <DialogContentText>Room Type: {roomType}</DialogContentText>}

0 commit comments

Comments
 (0)