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(actions): supports typescript rootDir options #163

Merged
merged 2 commits into from
Oct 20, 2023
Merged

feat(actions): supports typescript rootDir options #163

merged 2 commits into from
Oct 20, 2023

Conversation

mathewmeconry
Copy link
Contributor

The current version of the cli doesn't support the rootDir option for typescript-based web3 actions projects.
This forces developers to use the following directory structure:

.
├── tenderly.yaml
└── actions/
    ├── tsconfig.json
    ├── package.json
    ├── package-lock.json
    ├── node_modules
    ├── my-cool-action1.ts
    ├── my-cool-action2.ts
    └── outDir/
        ├── my-cool-action1.js
        └── my-cool-action2.js

with this change the cli also takes the rootDir compiler option in tsconfig.json into account to check if the sources exists and allows developers to bundle their actions into a source directory:

.
├── tenderly.yaml
└── actions/
    ├── tsconfig.json
    ├── package.json
    ├── package-lock.json
    ├── node_modules
    ├── src/
    │   ├── my-cool-action1.ts
    │   └── my-cool-action2.ts
    └── outDir/
        ├── my-cool-action1.js
        └── my-cool-action2.js   

I ran the make command precommit. The changes in commands/logout.go, go.mod and go.sum are because of it.

@mathewmeconry
Copy link
Contributor Author

Hey @BogdanHabic @nebojsa94
Did you have a chance to check this pull out?

@g4ndr4 g4ndr4 self-requested a review October 5, 2023 10:06
Copy link
Contributor

@g4ndr4 g4ndr4 left a comment

Choose a reason for hiding this comment

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

Hey @mathewmeconry, thanks for submitting this PR, always awesome to see people contributing 🤩!
Great idea and I think users will appreciate the added flexibility in project structure 👌

I left only one small change request, as the rootDir setting in default tsconfig breaks the build process when initializing a new project. Other than that, everything LGTM! 🚀

typescript/tsconfig.go Outdated Show resolved Hide resolved
Co-authored-by: Dragan Obradović <[email protected]>
@mathewmeconry
Copy link
Contributor Author

hey @g4ndr4
Thanks for the comment :)
I added the requested change to the branch

Copy link
Contributor

@g4ndr4 g4ndr4 left a comment

Choose a reason for hiding this comment

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

Great! Everything is working as expected! 🚀 🤩

@g4ndr4 g4ndr4 merged commit 1f5c29a into Tenderly:master Oct 20, 2023
@g4ndr4
Copy link
Contributor

g4ndr4 commented Oct 20, 2023

@mathewmeconry Thank you so much for contributing once again! 🙌

@mathewmeconry mathewmeconry deleted the feat/typescript_rootDir branch November 8, 2023 15:09
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.

3 participants