Skip to content

Commit

Permalink
Add syntax-decimal to babel-standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Jul 21, 2020
1 parent e6c74e2 commit 1cee768
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/babel-standalone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"@babel/plugin-proposal-unicode-property-regex": "^7.10.4",
"@babel/plugin-syntax-async-generators": "^7.8.0",
"@babel/plugin-syntax-class-properties": "^7.10.4",
"@babel/plugin-syntax-decimal": "^7.10.1",
"@babel/plugin-syntax-decorators": "^7.10.4",
"@babel/plugin-syntax-do-expressions": "^7.10.4",
"@babel/plugin-syntax-export-default-from": "^7.10.4",
Expand Down
1 change: 1 addition & 0 deletions packages/babel-standalone/scripts/pluginConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"external-helpers",
"syntax-async-generators",
"syntax-class-properties",
"syntax-decimal",
"syntax-decorators",
"syntax-do-expressions",
"syntax-export-default-from",
Expand Down
3 changes: 3 additions & 0 deletions packages/babel-standalone/src/generated/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import externalHelpers from "@babel/plugin-external-helpers";
import syntaxAsyncGenerators from "@babel/plugin-syntax-async-generators";
import syntaxClassProperties from "@babel/plugin-syntax-class-properties";
import syntaxDecimal from "@babel/plugin-syntax-decimal";
import syntaxDecorators from "@babel/plugin-syntax-decorators";
import syntaxDoExpressions from "@babel/plugin-syntax-do-expressions";
import syntaxExportDefaultFrom from "@babel/plugin-syntax-export-default-from";
Expand Down Expand Up @@ -98,6 +99,7 @@ export {
externalHelpers,
syntaxAsyncGenerators,
syntaxClassProperties,
syntaxDecimal,
syntaxDecorators,
syntaxDoExpressions,
syntaxExportDefaultFrom,
Expand Down Expand Up @@ -191,6 +193,7 @@ export const all = {
"external-helpers": externalHelpers,
"syntax-async-generators": syntaxAsyncGenerators,
"syntax-class-properties": syntaxClassProperties,
"syntax-decimal": syntaxDecimal,
"syntax-decorators": syntaxDecorators,
"syntax-do-expressions": syntaxDoExpressions,
"syntax-export-default-from": syntaxExportDefaultFrom,
Expand Down
1 change: 1 addition & 0 deletions packages/babel-standalone/src/preset-stage-1.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default (_: any, opts: Object = {}) => {
],
],
plugins: [
babelPlugins.syntaxDecimal,
[
babelPlugins.syntaxModuleAttributes,
{ version: moduleAttributesVersion },
Expand Down
13 changes: 13 additions & 0 deletions packages/babel-standalone/test/preset-stage-1.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
(process.env.TEST_TYPE === "cov" ? describe : describe.skip)(
"stage-1 preset",
() => {
const Babel = require("../babel");

it("should parser decimal literal", () => {
const output = Babel.transform("0.3m", {
presets: [["stage-1", { decoratorsBeforeExport: true }]],
}).code;
expect(output).toBe("0.3m;");
});
},
);

0 comments on commit 1cee768

Please sign in to comment.