Skip to content

Commit

Permalink
Converted to use babel for all builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Wilaby committed Sep 19, 2018
1 parent b455827 commit 5b922cf
Show file tree
Hide file tree
Showing 89 changed files with 15,144 additions and 47,646 deletions.
268 changes: 150 additions & 118 deletions package-lock.json

Large diffs are not rendered by default.

16,377 changes: 13 additions & 16,364 deletions packages/app/client/package-lock.json

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions packages/app/client/package.json
Expand Up @@ -38,12 +38,19 @@
]
},
"devDependencies": {
"@babel/cli": "^7.1.0",
"@babel/core": "^7.1.0",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-react-jsx": "^7.0.0",
"@babel/preset-env": "^7.1.0",
"@babel/preset-typescript": "^7.1.0",
"@types/enzyme": "^3.1.10",
"@types/jest": "^22.2.3",
"@types/react": "~16.3.2",
"@types/react-dom": "^16.0.4",
"@types/request": "^2.47.0",
"babel-loader": "^7.1.4",
"babel-loader": "^8.0.2",
"babel-preset-react-app": "^3.1.1",
"copy-webpack-plugin": "^4.5.1",
"coveralls": "^3.0.1",
Expand All @@ -70,7 +77,7 @@
"ts-loader": "^4.4.2",
"tslint": "^5.10.0",
"tslint-loader": "^3.6.0",
"typescript": "2.7.2",
"typescript": "3.0.3",
"typings-for-css-modules-loader": "^1.7.0",
"url-loader": "^1.0.1",
"webpack": "^4.16.4",
Expand Down
Expand Up @@ -94,7 +94,7 @@ export class ConnectedServicePicker extends Component<ConnectedServicesPickerPro
{ this.headerElements }
{ this.selectAllCheckbox }
<ul>
{ ...this.serviceListElements }
{ this.serviceListElements }
</ul>
{ this.contentElements }
</div>
Expand Down
Expand Up @@ -108,7 +108,7 @@ class TabBarComponent extends React.Component<TabBarProps, TabBarState> {
}
</ul>
<div className={ styles.tabBarWidgets }>
{ ...this.widgets }
{ this.widgets }
</div>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/app/client/src/ui/shell/navBar/navBar.tsx
Expand Up @@ -68,7 +68,7 @@ export class NavBarComponent extends React.Component<NavBarProps, NavBarState> {
render() {
return (
<nav className={ styles.navBar }>
{ ...this.links }
{ this.links }
</nav>
);
}
Expand Down
22 changes: 21 additions & 1 deletion packages/app/client/webpack.config.js
Expand Up @@ -39,7 +39,27 @@ const defaultConfig = {
{
test: /\.(tsx?)|(jsx)$/,
exclude: [/node_modules/],
use: ['ts-loader']
use: {
loader: 'babel-loader',
options: {
"presets": [
[
"@babel/preset-env",
{
"targets": {
"chrome": "58",
"esmodules": true
}
}
],
"@babel/preset-typescript"
],
"plugins": [
"@babel/proposal-class-properties",
"@babel/plugin-transform-react-jsx"
]
}
}
},
{
test: /\.css$/,
Expand Down
17 changes: 17 additions & 0 deletions packages/app/main/.babelrc
@@ -0,0 +1,17 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "8"
}
}
],
"@babel/preset-typescript"
],
"plugins": [
"@babel/proposal-class-properties",
"@babel/plugin-transform-react-jsx"
]
}
107 changes: 15 additions & 92 deletions packages/app/main/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions packages/app/main/package.json
Expand Up @@ -8,7 +8,7 @@
"homepage": "https://github.com/Microsoft/BotFramework-Emulator",
"scripts": {
"build": "run-s lint build:electron",
"build:electron": "tsc -p . --outdir app/server && gulp copy-extension-stubs",
"build:electron": "babel ./src --out-dir app/server --extensions \".ts,.tsx\" --ignore \"*.spec.ts\" --delete-dir-on-start --source-maps inline && gulp copy-extension-stubs",
"lint": "tslint --project tsconfig.json",
"start": "concurrently --kill-others --names \"electron,react-app\" --success first \"npm run start:electron:dev\" \"npm run start:react-app\"",
"start:electron": "./node_modules/.bin/electron --inspect=7777 .",
Expand Down Expand Up @@ -49,18 +49,23 @@
},
"license": "MIT",
"devDependencies": {
"@babel/cli": "^7.1.0",
"@babel/core": "^7.1.0",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-react-jsx": "^7.0.0",
"@babel/preset-env": "^7.1.0",
"@babel/preset-typescript": "^7.1.0",
"@types/async": "^2.0.47",
"@types/chokidar": "^1.7.5",
"@types/formidable": "^1.0.30",
"@types/fs-extra": "^5.0.4",
"@types/jest": "^22.2.3",
"@types/jsonpath": "^0.2.0",
"@types/jsonwebtoken": "^7.2.8",
"@types/mkdirp": "^0.5.2",
"@types/node": "8.9.3",
"@types/request": "^2.47.0",
"@types/restify": "^5.0.7",
"@types/restify-cors-middleware": "^1.0.1",
"@types/semver": "^5.5.0",
"@types/ws": "^4.0.1",
"asar-integrity": "^0.2.4",
Expand Down Expand Up @@ -89,7 +94,7 @@
"through2": "^2.0.3",
"ts-jest": "^22.4.6",
"tslint": "^5.10.0",
"typescript": "2.7.2",
"typescript": "3.0.3",
"vinyl-buffer": "^1.0.1",
"vinyl-source-stream": "^2.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/app/main/src/commandLine.ts
Expand Up @@ -31,7 +31,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

import * as commandLineArgs from 'command-line-args';
import commandLineArgs from 'command-line-args';
import { CommandLineArgs } from '@bfemulator/app-shared';
import * as globals from './globals';

Expand Down
3 changes: 2 additions & 1 deletion packages/app/main/src/commands/electronCommands.ts
Expand Up @@ -41,7 +41,8 @@ import { ContextMenuService } from '../services/contextMenuService';
import { getStore } from '../botData/store';
import { CommandRegistryImpl } from '@bfemulator/sdk-shared';
import { SharedConstants } from '@bfemulator/app-shared';
import shell = Electron.shell;

const { shell } = Electron;

const store = getStore();

Expand Down
10 changes: 5 additions & 5 deletions packages/app/main/src/ipc/electron.ts
Expand Up @@ -35,8 +35,8 @@ import { Event, ipcMain, WebContents } from 'electron';
import { Disposable, IPC } from '@bfemulator/sdk-shared';

export class ElectronIPC extends IPC {
get id(): number {
return this._webContents.id;
get webContents(): WebContents {
return this._webContents;
}

constructor(private _webContents: WebContents) {
Expand All @@ -57,11 +57,11 @@ export class ElectronIPC extends IPC {
}

export const ElectronIPCServer = new class {
private _ipcs: { [id: number]: ElectronIPC } = {};
private _ipcs: WeakMap<WebContents, ElectronIPC> = new WeakMap<WebContents, ElectronIPC>();
private initialized = false;

registerIPC(ipc: ElectronIPC): Disposable {
this._ipcs[ipc.id] = ipc;
this._ipcs.set(ipc.webContents, ipc);
this.initialize();
return {
dispose: () => {
Expand All @@ -75,7 +75,7 @@ export const ElectronIPCServer = new class {
return;
}
ipcMain.on('ipc:message', (event: Event, ...args) => {
const ipc = this._ipcs[event.sender.id];
const ipc = this._ipcs.get(event.sender);
if (ipc) {
ipc.onMessage(event, ...args);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/app/main/src/restServer.ts
Expand Up @@ -32,7 +32,7 @@
//

import { BotEmulator, Conversation } from '@bfemulator/emulator-core';
import * as CORS from 'restify-cors-middleware';
import CORS from 'restify-cors-middleware';
import * as Restify from 'restify';
import fetch from 'node-fetch';

Expand Down
4 changes: 2 additions & 2 deletions packages/app/main/src/services/azureAuthWorkflowService.ts
Expand Up @@ -33,8 +33,8 @@

import { BrowserWindow } from 'electron';
import fetch from 'node-fetch';
import * as uuidv4 from 'uuid/v4';
import * as jwt from 'jsonwebtoken';
import uuidv4 from 'uuid/v4';
import jwt from 'jsonwebtoken';

let getPem = require('rsa-pem-from-mod-exp');
const clientId = '4f28e5eb-6b7f-49e6-ac0e-f992b622da57';
Expand Down
16 changes: 16 additions & 0 deletions packages/app/shared/.babelrc
@@ -0,0 +1,16 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "8"
}
}
],
"@babel/preset-typescript"
],
"plugins": [
"@babel/proposal-class-properties"
]
}
5 changes: 3 additions & 2 deletions packages/app/shared/package.json
Expand Up @@ -6,7 +6,8 @@
"main": "built/index.js",
"types": "built/index.d.ts",
"scripts": {
"build": "npm run lint && npm run clean && tsc --pretty",
"build": "npm run lint && npm run clean && npm run build:prod && tsc --emitDeclarationOnly --declaration",
"build:prod": "babel ./src --out-dir built --extensions \".ts,.tsx\"",
"clean": "rimraf ./built && rimraf ../../../node_modules/@types/prop-types",
"lint": "tslint --project tsconfig.json",
"prepare": "npm run clean",
Expand All @@ -20,7 +21,7 @@
"rimraf": "^2.6.2",
"ts-jest": "^22.4.6",
"tslint": "^5.10.0",
"typescript": "2.7.2"
"typescript": "3.0.3"
},
"dependencies": {
"@bfemulator/sdk-shared": "^1.0.0",
Expand Down

0 comments on commit 5b922cf

Please sign in to comment.