Skip to content

Commit

Permalink
Export @babel/parser#tokTypes in @babel/core (#8986)
Browse files Browse the repository at this point in the history
* Export @babel/parser in @babel/core

* Expose tokTypes instead of parser
  • Loading branch information
kaicataldo authored and loganfsmyth committed Dec 1, 2018
1 parent 2bf8dde commit 806e133
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/babel-core/src/config/helpers/config-api.js
Expand Up @@ -55,6 +55,7 @@ export default function makeAPI(
async: () => false,
caller,
assertVersion,
tokTypes: undefined,
};
}

Expand Down
2 changes: 2 additions & 0 deletions packages/babel-core/src/index.js
Expand Up @@ -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";

Expand Down
8 changes: 8 additions & 0 deletions packages/babel-core/test/api.js
Expand Up @@ -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,
Expand Down

0 comments on commit 806e133

Please sign in to comment.