Export @babel/parser#tokTypes in @babel/core (#8986)

* Export @babel/parser in @babel/core

* Expose tokTypes instead of parser
This commit is contained in:
Kai Cataldo 2018-11-30 21:41:58 -05:00 committed by Logan Smyth
parent 2bf8dde782
commit 806e133473
3 changed files with 11 additions and 0 deletions

View File

@ -55,6 +55,7 @@ export default function makeAPI(
async: () => false,
caller,
assertVersion,
tokTypes: undefined,
};
}

View File

@ -10,6 +10,8 @@ export { version } from "../package.json";
export { getEnv } from "./config/helpers/environment";
export * as types from "@babel/types";
export { tokTypes } from "@babel/parser";
export { default as traverse } from "@babel/traverse";
export { default as template } from "@babel/template";

View File

@ -154,6 +154,14 @@ describe("api", function() {
);
});
it("exposes types", function() {
expect(babel.types).toBeDefined();
});
it("exposes the parser's token types", function() {
expect(babel.tokTypes).toBeDefined();
});
it("transformFile", function(done) {
const options = {
babelrc: false,