Skip to content

Commit

Permalink
babel-preset-silk-node6 with latest Babel plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
philikon authored and Michael Vines committed Dec 13, 2016
1 parent faf11de commit d0d5b4b
Show file tree
Hide file tree
Showing 28 changed files with 24,098 additions and 24,398 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -15,7 +15,7 @@ Silk's key components are open source and we :heart: to receive contributions fr
The repository generally consists of those parts:

- `babel`: Babel utilities
- `babel-preset-silk-node4`: Standardized babel configuration
- `babel-preset-silk-node6`: Standardized babel configuration
- `bsp-gonk`: Board support package for various Android-like devices
- `cli`: Commandline tool
- `device-main`: Device javascript entry point
Expand Down
48 changes: 0 additions & 48 deletions babel-preset-silk-node4/package.json

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,6 +1,6 @@
# Silk Babel Preset (Node 4)
# Silk Babel Preset (Node 6)

This is a flattened babel-preset for node 4 ...
This is a flattened babel-preset for node 6.x LTS ...

This project does not ship with the entire set of babel plugins as npm
dependencies instead it flattens all the dependencies into a single fast
Expand All @@ -19,11 +19,9 @@ babel-node).

## How to build:

```js
npm run compile

# Check in index.js to source tree ...
```
1. Run `npm run compile`
2. Check in `index.js` to source tree
3. Ignore/revert changes to `package.json`

# LICENSE

Expand Down
File renamed without changes.
Expand Up @@ -13,6 +13,7 @@ check_npm_version() {
}

main() {
npm install
./build/stage
check_npm_version
npm install
Expand Down
Expand Up @@ -18,13 +18,25 @@ const TARGET = path.join(__dirname, '..');
const PKG_PATH = path.join(TARGET, 'package.json');
const DEST = path.join(TARGET, 'staging/index.js');

const DEFAULT_BABEL_VERSION = '6.5.0';
const DEFAULT_BABEL_VERSION = '6.18.0';
const PLUGIN_VERSION_OVERRIDES = {
// 'transform-async-to-generator': 'MY_VER'
'syntax-trailing-function-commas': '6.13.0',
'transform-async-to-generator': '6.16.0',
'transform-es2015-function-name': '6.9.0',
'transform-es2015-unicode-regex': '6.11.0',
'transform-es2015-spread': '6.8.0',
'transform-export-extensions': '6.8.0',
'transform-object-rest-spread': '6.16.0',
'transform-decorators': '6.13.0',
};

const PLUGIN_SKIP = new Set([
'transform-es2015-generator-return'
'syntax-async-functions',
'syntax-async-generators',
'syntax-function-sent',
'transform-es2015-generator-return',
'transform-exponentiation-operator',
'transform-regenerator',
]);

const ADDITIONAL_PLUGINS = [
Expand All @@ -42,12 +54,16 @@ const ADDITIONAL_PLUGINS = [
'transform-decorators',
'transform-export-extensions',

// XXX: v8 does not like you to use super.X syntax which is used in our
// codebase so we compile our modules down using es2015.
// Node does not support the super.X syntax in generators, but our
// codebase uses super in async methods (which are compiled down to
// generators.) See https://github.com/babel/babel/issues/3930.
'transform-es2015-classes',
];

const es2015Plugins = features.options().plugins.filter((name) => {
if (Array.isArray(name)) {
name = name[0];
}
return !PLUGIN_SKIP.has(name);
});

Expand Down

0 comments on commit d0d5b4b

Please sign in to comment.