forked from newsuk/times-components
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: Babel 7 (newsuk#1914)
* Use babel upgrade on packages * Replace babel rn preset with metro preset * Move from babelrc to babel.config.js * Bump babel deps * Tidy up babel versions * Update storybook and webpack * Bump jest * Storybook config * Bump graphql & apollo versions * Update webpack configurator to support babel.config.js * Update storybook webpack config * Clean up expo * Replace haul with metro * Fix native storybooks * Bump enzyme * Downgrade jest and upgrade few libs * Add babelrc for jest * Update svgs snaps * Fix babelrc * Sync babel-jest and jest versions * Fix jest config and snaps * Tidy up slice-layout snaps * Snaps * Tidy up jest dependencies * Fix more testse * Fix tests * Fix article header styles in article-main-standard * Update cli files * Update core babelrc * Remove fructose&dextrose * Downgrade prettier & eslint (left for another PR) * Lint * Fix native bundling with metro * Remove bundle meta * Remove comments * Fix native storybook * Update babel config on text-flow and cli * Tidy up webpack tests * Fix depend tests * Tidy up jest-configurator tests * Fix mock-tpa jest * Lint * Fix versions * Fix article tests * Fix ssr webpack config * Deprecate selectV2 nad replace with select on storybooks * Apollo server config * Lint * Ssr webpack configs * Fix android build script * Fix ios build script
- Loading branch information
Tunca Ulubilge
authored
May 9, 2019
1 parent
06bdf1b
commit e2c9183
Showing
297 changed files
with
5,555 additions
and
6,012 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// FIXME: remove once babel-jest supports babel.config.js | ||
module.exports = require('./babel.config')({ | ||
cache: () => {}, | ||
env: () => process.env.NODE_ENV | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,3 @@ storybook-static | |
packages | ||
android-app | ||
ios-app | ||
dextrose/snappy | ||
fructose/components.js | ||
haul.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,9 +82,6 @@ ios/Index/ | |
ios/main.jsbundle | ||
ios/main.jsbundle.meta | ||
|
||
# Haul | ||
# | ||
haul-debug.log | ||
|
||
|
||
fragment-matcher.js |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = api => { | ||
api.cache(true); | ||
return { | ||
plugins: ["@babel/plugin-transform-react-display-name"], | ||
presets: ["module:metro-react-native-babel-preset"] | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { AppRegistry } from 'react-native'; | ||
import StorybookUIRoot from "./storybook" | ||
|
||
AppRegistry.registerComponent('storybooknative', () => StorybookUIRoot); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const path = require("path"); | ||
|
||
module.exports = (baseConfig, env, defaultConfig) => { | ||
baseConfig.entry = path.resolve(__dirname, "./index.js"); | ||
baseConfig.resolve = { | ||
...baseConfig.resolve, | ||
extensions: [".android.js", ".ios.js", ".native.js", ".js", ".webpack.js", ".mjs"], | ||
mainFields: ["devModule", "dev", "react-native", "browser", "module", "main"], | ||
}; | ||
|
||
baseConfig.module.rules[0].test = /\.m?jsx?$/ | ||
baseConfig.module.rules[0].query.presets = ["module:metro-react-native-babel-preset"] | ||
baseConfig.module.rules[0].query.plugins = [] | ||
baseConfig.module.rules[0].exclude = /node_modules\/(?!react|@expo|svgs|pretty-format|metro)/; | ||
|
||
baseConfig.module.rules.push( | ||
{ | ||
test: /\.(png|jpg|jpeg|gif)$/, | ||
loader: 'url-loader', | ||
options: { limit: 10000 } | ||
}, | ||
{ | ||
test: /\.(eot|woff|svg|ttf)$/, | ||
loader: 'file-loader' | ||
}, | ||
{ | ||
include: /node_modules/, | ||
test: /\.mjs$/, | ||
type: "javascript/auto", | ||
} | ||
); | ||
|
||
return baseConfig; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import '@storybook/addon-knobs/register' | ||
import "@storybook/addon-knobs/register"; | ||
import "@storybook/addon-actions/register"; | ||
import '@storybook/addon-options/register'; | ||
import "@storybook/addon-options/register"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
const path = require("path"); | ||
const webpack = require("webpack"); | ||
|
||
module.exports = { | ||
devtool: "eval-source-map", | ||
resolve: { | ||
// Maps the 'react-native' import to 'react-native-web'. | ||
module.exports = async (baseConfig, env, defaultConfig) => { | ||
baseConfig.devtool = "eval-source-map" | ||
baseConfig.resolve = { | ||
...baseConfig.resolve, | ||
alias: { | ||
...baseConfig.resolve.alias, | ||
"react-native": "react-native-web", | ||
"@storybook/react-native": "@storybook/react" | ||
}, | ||
// If you're working on a multi-platform React Native app, web-specific | ||
// module implementations should be written in files using the extension | ||
// `.web.js`. | ||
extensions: [".web.js", ".js", ".ios.js", ".android.js"], | ||
mainFields: ["devModule", "dev", "module", "main"], | ||
}, | ||
|
||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(png|jpe?g|gif)$/, | ||
loader: 'react-native-web-image-loader?name=[hash].[ext]', | ||
} | ||
] | ||
}, | ||
|
||
plugins: [ | ||
// Use the DLL in development. | ||
extensions: [".web.js", ".js", ".ios.js", ".android.js", ".mjs"], | ||
mainFields: ["devModule", "dev", "module", "main"] | ||
}; | ||
baseConfig.plugins.push( | ||
new webpack.DllReferencePlugin({ | ||
context: __dirname, | ||
manifest: path.resolve("./dist/public/vendor-manifest.json") | ||
}) | ||
] | ||
); | ||
baseConfig.module.rules.push( | ||
{ | ||
test: /\.(png|jpe?g|gif)$/, | ||
loader: 'react-native-web-image-loader?name=[hash].[ext]', | ||
}, | ||
{ | ||
test: /\.mjs$/, | ||
include: /node_modules/, | ||
type: 'javascript/auto' | ||
} | ||
); | ||
|
||
return baseConfig; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,3 @@ | |
**/coverage/* | ||
dist | ||
rnw.js | ||
haul.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,6 @@ LICENSE | |
yarn.lock | ||
*.log | ||
rnw.js | ||
haul.config.js | ||
xnative/* | ||
gradle/* | ||
gradlew | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = api => { | ||
api.cache(true); | ||
return { | ||
plugins: ["@babel/plugin-transform-react-display-name"], | ||
presets: ["module:metro-react-native-babel-preset"] | ||
}; | ||
}; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.