PromucFlow_constructor/app/shared/ast/index.ts
Ayangade Adeoluwa 3de00c6bf4
feat: Extraction of AST Logic (#15892)
* POC for Shared AST Logic using Yarn Symlinks

* fix: preinstall script for bundling shared packages

* Merge commit

* fix: updated the script to link, unlink the package as shared dep

* fix: updated dependencies

* Add a post-install script and fix yarn.lock file

* Remove commented code

* fix: added verification script, readme, moved scripts to shared

* Extraction of AST Logic into shared/ast folder

* Add jest test script

* Replace hardcoded ast Logic use with Shared AST module

* Replace parse code with getAST

Co-authored-by: Aman Agarwal <aman@appsmith.com>
2022-08-23 16:39:42 +05:30

41 lines
898 B
TypeScript

import {
ObjectExpression,
PropertyNode,
isIdentifierNode,
isVariableDeclarator,
isObjectExpression,
isLiteralNode,
isPropertyNode,
isPropertyAFunctionNode,
getAST,
extractIdentifiersFromCode,
getFunctionalParamsFromNode,
isTypeOfFunction,
} from "./src/index";
// constants
import { ECMA_VERSION, SourceType, NodeTypes } from "./src/constants";
// JSObjects
import { parseJSObjectWithAST } from "./src/jsObject";
// types or intefaces should be exported with type keyword, while enums can be exported like normal functions
export type { ObjectExpression, PropertyNode };
export {
isIdentifierNode,
isVariableDeclarator,
isObjectExpression,
isLiteralNode,
isPropertyNode,
isPropertyAFunctionNode,
getAST,
extractIdentifiersFromCode,
getFunctionalParamsFromNode,
isTypeOfFunction,
parseJSObjectWithAST,
ECMA_VERSION,
SourceType,
NodeTypes,
};