Skip to content

Commit

Permalink
MM_30476 : Updated Babel configs (#5068)
Browse files Browse the repository at this point in the history
  • Loading branch information
avinashlng1080 authored Dec 29, 2020
1 parent 2dfb343 commit 0d2868e
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 30 deletions.
14 changes: 10 additions & 4 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,36 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
presets: [
'module:metro-react-native-babel-preset',
'@babel/preset-typescript',
['@babel/preset-env', {targets: {node: 'current'}}],
],
env: {
production: {
plugins: ['transform-remove-console'],
},
},
plugins: [
'@babel/plugin-transform-runtime',
['@babel/plugin-proposal-decorators', {legacy: true}],
'@babel/plugin-proposal-class-properties',
'@babel/plugin-transform-runtime',
['module-resolver', {
root: ['.'],
alias: {
'@assets': './dist/assets',
'@actions': './app/actions',
'@assets': './dist/assets',
'@components': './app/components',
'@constants': './app/constants',
'@i18n': './app/i18n',
'@init': './app/init',
'@notifications': './app/notifications',
'@share': './share_extension',
'@screens': './app/screens',
'@selectors': './app/selectors',
'@share': './share_extension',
'@store': './app/store',
'@telemetry': './app/telemetry',
'@typings': './types',
'@utils': './app/utils',
'@websocket': './app/client/websocket',
},
Expand Down
46 changes: 24 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@
"devDependencies": {
"@babel/cli": "7.12.1",
"@babel/core": "7.12.3",
"@babel/plugin-proposal-decorators": "7.12.1",
"@babel/plugin-proposal-class-properties": "7.12.1",
"@babel/plugin-proposal-decorators": "7.12.12",
"@babel/plugin-transform-runtime": "7.12.1",
"@babel/preset-env": "7.12.1",
"@babel/preset-typescript": "7.12.7",
"@babel/register": "7.12.1",
"@react-native-community/eslint-config": "2.0.0",
"@storybook/addon-knobs": "6.0.28",
Expand Down Expand Up @@ -135,7 +137,7 @@
"react-native-dotenv": "2.4.2",
"react-native-storybook-loader": "2.0.2",
"ts-jest": "26.4.4",
"typescript": "4.0.5",
"typescript": "4.1.3",
"underscore": "1.11.0",
"util": "0.12.3"
},
Expand All @@ -146,33 +148,33 @@
},
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"build-storybook": "build-storybook",
"build:android": "./scripts/build.sh apk",
"build:android-unsigned": "./scripts/build.sh apk unsigned",
"build:ios": "./scripts/build.sh ipa",
"build:ios-sim": "./scripts/build.sh ipa simulator",
"build:ios-unsigned": "./scripts/build.sh ipa unsigned",
"check": "npm run lint && npm run tsc",
"clean": "./scripts/clean.sh",
"ios-gems": "cd ios && bundle install",
"e2e:android": "cd detox && npm run e2e:android-build && npm run e2e:android-test && cd ..",
"e2e:ios": "cd detox && npm run e2e:ios-test && cd ..",
"fix": "npm run lint -- --fix",
"i18n-clean-empty": "npm run mmjstool -- i18n clean-empty --mobile-dir .",
"i18n-extract": "npm run mmjstool -- i18n extract-mobile",
"ios": "react-native run-ios",
"ios-gems": "cd ios && bundle install",
"lint": "eslint --ignore-path .gitignore --ignore-pattern node_modules --quiet .",
"mmjstool": "mmjstool",
"pod-install": "cd ios && bundle exec pod install",
"postinstall": "patch-package && ./scripts/postinstall.sh",
"tsc": "NODE_OPTIONS=--max_old_space_size=12000 tsc --noEmit",
"test": "echo PLEASE ADD TESTS and then modify package.json to run 'jest --forceExit --runInBand --detectOpenHandles'",
"test:watch": "npm test -- --watch",
"test:coverage": "jest --coverage",
"updatesnapshot": "jest --updateSnapshot",
"mmjstool": "mmjstool",
"i18n-extract": "npm run mmjstool -- i18n extract-mobile",
"i18n-clean-empty": "npm run mmjstool -- i18n clean-empty --mobile-dir .",
"e2e:android": "cd detox && npm run e2e:android-build && npm run e2e:android-test && cd ..",
"e2e:ios": "cd detox && npm run e2e:ios-test && cd ..",
"build:ios": "./scripts/build.sh ipa",
"build:ios-unsigned": "./scripts/build.sh ipa unsigned",
"build:ios-sim": "./scripts/build.sh ipa simulator",
"build:android": "./scripts/build.sh apk",
"build:android-unsigned": "./scripts/build.sh apk unsigned",
"build-storybook": "build-storybook",
"prestorybook": "rnstl",
"storybook": "start-storybook -p 7007"
"start": "react-native start",
"storybook": "start-storybook -p 7007",
"test": "jest --forceExit --runInBand --detectOpenHandles",
"test:coverage": "jest --coverage",
"test:watch": "npm test -- --watch",
"tsc": "NODE_OPTIONS=--max_old_space_size=12000 tsc --noEmit",
"updatesnapshot": "jest --updateSnapshot"
},
"config": {
"react-native-storybook-loader": {
Expand Down
9 changes: 5 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"jsx": "react",
"moduleResolution": "node",
"noEmit": false,
"strict": false,
"strict": true,
"importHelpers": true,
"declaration": true,
"sourceMap": false,
Expand All @@ -35,8 +35,8 @@
"paths": {
"@assets/*": ["dist/assets/*"],
"@components/*": ["app/components/*"],
"@constants/*": ["app/constants/*"],
"@constants": ["app/constants/index"],
"@constants/*": ["app/constants/*"],
"@i18n": ["app/i18n/index"],
"@init/*": ["app/init/*"],
"@notifications": ["app/notifications/index"],
Expand All @@ -45,6 +45,7 @@
"@share/*": ["share_extension/*"],
"@store": ["app/store/index"],
"@store/*": ["app/store/*"],
"@typings/*": ["types/*"],
"@telemetry/*": ["/app/telemetry/*"],
"@utils/*": ["app/utils/*"],
"@websocket": ["app/client/websocket"],
Expand All @@ -61,5 +62,5 @@
"babel.config.js",
"metro.config.js",
"jest.config.js",
]
}
],
}

0 comments on commit 0d2868e

Please sign in to comment.