Skip to content

Commit 1961daa

Browse files
renovate[bot]renovate-botAdam Butterworth
authored
fix(deps): update babel monorepo (#25)
* fix(deps): update babel monorepo * Update babel config option key * fix linter in smoke test and update readme Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: Adam Butterworth <[email protected]>
1 parent 837b675 commit 1961daa

File tree

8 files changed

+2463
-540
lines changed

8 files changed

+2463
-540
lines changed

README.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ documentation to learn what options are available. Example package.json::
2727
"scripts": {
2828
"build": "fedx-scripts webpack",
2929
"i18n_extract": "BABEL_ENV=i18n fedx-scripts babel src --quiet > /dev/null",
30-
"lint": "fedx-scripts eslint",
30+
"lint": "fedx-scripts eslint --ext .jsx,.js .",
3131
"precommit": "npm run lint",
3232
"snapshot": "fedx-scripts jest --updateSnapshot",
3333
"start": "fedx-scripts webpack-dev-server --progress",
@@ -113,8 +113,11 @@ or to test with an existing project you can do the following:
113113
1. Delete the node_modules directories in the host project:
114114
``rm -rf node_modules/``
115115

116-
2. Install the development version of frontend-build
117-
``npm i --save-dev @edx/frontend-build@file:../frontend-build``.
116+
2. Move frontend-build inside the host project and delete its node modules folder
117+
``mv ../frontend-build ./ && rm -rf frontend-build/node_modules``
118+
119+
3. Install the development version of frontend-build
120+
``npm i --save-dev @edx/frontend-build@file:./frontend-build``.
118121

119122

120123
.. |Build Status| image:: https://api.travis-ci.org/edx/frontend-build.svg?branch=master

bin/fedx-scripts.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const presets = require('../lib/presets');
1717
*/
1818

1919

20-
function configOptionExists(keys = ['--config', '-c']) {
20+
function optionExists(keys) {
2121
return process.argv.some((arg) => {
2222
// eslint-disable-next-line no-plusplus
2323
for (let i = 0; i < keys.length; i++) {
@@ -30,10 +30,10 @@ function configOptionExists(keys = ['--config', '-c']) {
3030
}
3131

3232
// Ensures that a config option already exists and if it does not adds a default
33-
function ensureConfigOption(preset) {
34-
if (!configOptionExists()) {
33+
function ensureConfigOption(preset, keys = ['--config', '-c']) {
34+
if (!optionExists(keys)) {
3535
console.log(`Running with resolved config:\n${preset.resolvedFilepath}\n`);
36-
process.argv.push('--config');
36+
process.argv.push(keys[0]);
3737
process.argv.push(preset.resolvedFilepath);
3838
}
3939
}
@@ -46,7 +46,7 @@ process.argv.splice(1, 1);
4646

4747
switch (commandName) {
4848
case 'babel':
49-
ensureConfigOption(presets.babel);
49+
ensureConfigOption(presets.babel, ['--config-file']);
5050
require('@babel/cli/bin/babel');
5151
break;
5252
case 'eslint':

example/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"main": "webpack.prod.config.js",
66
"scripts": {
77
"test": "../bin/fedx-scripts.js jest ./src",
8-
"build": "../bin/fedx-scripts.js webpack --config ./webpack.prod.config.js",
9-
"lint": "../bin/fedx-scripts.js eslint .",
8+
"build": "../bin/fedx-scripts.js webpack",
9+
"lint": "../bin/fedx-scripts.js eslint . --ext .jsx,.js",
1010
"babel": "../bin/fedx-scripts.js babel src --out-dir dist/babel --source-maps --ignore **/*.test.jsx,**/*.test.js --copy-files",
1111
"start": "../bin/fedx-scripts.js webpack-dev-server"
1212
},

example/src/test.jsx renamed to example/src/App.test.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable global-require */
22
import React from 'react';
3-
import renderer, { act } from 'react-test-renderer';
3+
import renderer from 'react-test-renderer';
44
import App from './App';
55

66
describe('Basic test', () => {

example/webpack.prod.config.js

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

0 commit comments

Comments
 (0)