Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add "deno ast" subcommand #6867

Closed
wants to merge 28 commits into from

Conversation

littledivy
Copy link
Member

Leverages the swc ast parser utility behind the --unstable flag

Closes #2355

cli/main.rs Outdated Show resolved Hide resolved
cli/main.rs Show resolved Hide resolved
cli/main.rs Outdated Show resolved Hide resolved
cli/flags.rs Outdated Show resolved Hide resolved
cli/flags.rs Outdated Show resolved Hide resolved
@littledivy littledivy marked this pull request as ready for review July 25, 2020 06:23
@littledivy littledivy requested a review from bartlomieju July 25, 2020 06:58
@littledivy littledivy changed the title wip feat(cli): deno ast <file.ts> --unstable feat(cli): deno ast <file.ts> --unstable Jul 25, 2020
@bartlomieju bartlomieju changed the title feat(cli): deno ast <file.ts> --unstable feat: Add "deno ast" subcommand Jul 25, 2020
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good 👍

@divy-work please add an integration test that checks the output of produced AST (just a small script will be enough).

@ry what do you think about this feat? We can leave it behind --unstable time for some time.

@littledivy
Copy link
Member Author

littledivy commented Jul 25, 2020

Sure will do. I think if future we can add an option to write the output json to a file.

@n10000k
Copy link

n10000k commented Jul 25, 2020

I think we need the --unstable to show that the output currently isn't stable, which I think @ry was getting at?

@littledivy
Copy link
Member Author

I think we need the --unstable to show that the output currently isn't stable, which I think @ry was getting at?

Yes, it is currently behind --unstable but the output is quite stable and also has strong typings available.
See https://github.com/swc-project/swc/blob/master/node-swc/src/types.ts

@littledivy
Copy link
Member Author

littledivy commented Jul 26, 2020

Hope the tests work now lol. (2 hours wasted)

EDIT: it was a newline issue 🤦

@bartlomieju bartlomieju requested a review from ry July 26, 2020 12:54
@CLAassistant
Copy link

CLAassistant commented Jul 27, 2020

CLA assistant check
All committers have signed the CLA.

@bartlomieju
Copy link
Member

bartlomieju commented Oct 30, 2020

@littledivy thank you for the PR, but after all I think this functionality should be implemented by third party libraries (#2355 (comment))

@littledivy littledivy deleted the feat/deno-ast-parser branch November 1, 2020 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"deno ast script.ts"
5 participants