Skip to content
TreeNode and path expression support for use in automation clients
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
legal
lib
test
.gitattributes
.gitignore
.npmignore
CHANGELOG.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
README.md
index.ts
package-lock.json
package.json
tsconfig.json
tslint.json

README.md

@atomist/tree-path

atomist sdm goals npm version

Node.js module @atomist/tree-path-ts defining trees and path expressions. These capabilities were created for use in Atomist code transformations, including those used to transform seed projects into new projects.

XPath-like path expressions can be executed against any implementation of the simple TreeNode interface. This is typically used to expose ASTS: for example, those resulting from ANTLR grammars, microgrammars or a standalone parser such as the TypeScript compiler's parser. The ability to skip levels in navigating path expressions (e.g., via //) is invaluable in ignoring irrelevant levels of language ASTs, which tend to be noisy.

For example, find all variable names in a TypeScript file (using TypeScript AST integration in automation-client:

const variableNames = evaluateScalarValue(
	sourceFile,
	"//VariableDeclaration/Identifier"
);

Concepts

For more information, please read Tree and path expression overview.

Support

General support questions should be discussed in the #support channel in the Atomist community Slack workspace.

If you find a problem, please create an issue.

Development

You will need to install Node.js to build and test this project.

Build and test

Install dependencies.

$ npm install

Use the build package script to compile, test, lint, and build the documentation.

$ npm run build

Release

Releases are handled via the Atomist SDM. Just press the 'Approve' button in the Atomist dashboard or Slack.


Created by Atomist. Need Help? Join our Slack workspace.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.