Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make adaptive expression library compatible with IE #2906

Merged
merged 9 commits into from
Oct 20, 2020
29 changes: 29 additions & 0 deletions libraries/adaptive-expressions-ie11/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module.exports = function (api) {
api.cache(false);
const presets = [
['@babel/preset-typescript'],
[
'@babel/preset-env',
{
corejs: { version: 3 },
useBuiltIns: 'usage',
targets: {
browsers: ['last 2 versions', 'ie >= 11', 'not ie < 11', 'not android > 0', 'not ios > 0'],
},
},
],
];
// These plugins are used to apply transformation to the compiled code,
// like converting class or method decorators to appropriate js code. Please
// check individual plugin documentation for more details.
const plugins = [
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
['@babel/plugin-proposal-class-properties'],
['@babel/plugin-transform-modules-commonjs'],
['@babel/plugin-transform-runtime', { useESModules: false }],
];
return {
presets,
plugins,
};
};
50 changes: 50 additions & 0 deletions libraries/adaptive-expressions-ie11/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "adaptive-expressions-ie11",
"author": "Microsoft Corp.",
"description": "Common Expression Language",
"version": "4.1.6",
"license": "MIT",
"keywords": [
"botbuilder",
"botframework",
"expression"
],
"bugs": {
"url": "https://github.com/Microsoft/botbuilder-js/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/botbuilder-js.git"
},
"main": "./dist/index.js",
"typings": "./dist/index.d.ts",
"dependencies": {
"adaptive-expressions": "4.1.6",
"core-js": "^3.3.2"
},
"devDependencies": {
"@babel/core": "^7.6.4",
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/plugin-proposal-decorators": "^7.6.0",
"@babel/plugin-transform-runtime": "^7.6.2",
"@babel/preset-env": "^7.6.3",
"@babel/preset-typescript": "^7.6.0",
"@babel/runtime": "^7.6.3",
"@types/node": "^10.17.27",
"babel-loader": "^8.0.6",
"copyfiles": "2.4.0",
"ts-loader": "^7.0.5",
"typescript": "3.5.3",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12"
},
"scripts": {
"build": "webpack && copyfiles -u 3 node_modules/adaptive-expressions/lib/**/*.d.ts dist",
"clean": "erase /q /s .\\dist",
"set-version": "npm version --allow-same-version ${Version}"
},
"files": [
"src",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any benefit to us including "src"? If someone wanted to use the "src", they should likely instead use adaptive-expressions, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks for pushing those changes

stevengum marked this conversation as resolved.
Show resolved Hide resolved
"dist"
]
}
4 changes: 4 additions & 0 deletions libraries/adaptive-expressions-ie11/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

export * from 'adaptive-expressions';
stevengum marked this conversation as resolved.
Show resolved Hide resolved
11 changes: 11 additions & 0 deletions libraries/adaptive-expressions-ie11/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "../adaptive-expressions/tsconfig.json",
"compilerOptions": {
"target": "es5",
"outDir": "./dist",
"rootDir": "./src"
},
"include": [
"src/**/*"
]
}
44 changes: 44 additions & 0 deletions libraries/adaptive-expressions-ie11/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
const path = require('path');

module.exports = (env, argv) => {
return {
mode: 'none',
entry: path.resolve(__dirname, './src/index.ts'),
output: {
path: path.resolve(__dirname, './dist'),
libraryTarget: 'amd',
filename: 'index.js',
},
devtool: 'none',
resolve: {
extensions: ['.ts', '.js'],
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
include: path.resolve(__dirname, './src'),
},
{
test: /\.js$/,
use: [
{
loader: 'babel-loader',
},
],
include: [
path.resolve(__dirname, './node_modules/adaptive-expressions'),
path.resolve(
__dirname,
'./node_modules/@microsoft/recognizers-text-data-types-timex-expression'
),
path.resolve(__dirname, './node_modules/antlr4ts'),
path.resolve(__dirname, './node_modules/lru-cache'),
path.resolve(__dirname, './node_modules/yallist'),
],
},
],
},
};
};