-
Notifications
You must be signed in to change notification settings - Fork 1
feat(DAPP-7450): add typescript build command to compile #38
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not safe after this change: https://github.com/smartcontractkit/cre-cli/pull/36/files#r2382877260
cc @timothyF95 who is working on providing a path instead of the main.go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeffrifwaldsmartcontract for typescipt, do we have to specify the x.ts file or it is okay to just give the path of the workflow directory where the x.ts lives? Relevant ticket: https://smartcontract-it.atlassian.net/browse/DEVSVCS-2420
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can adapt this to however Go wants to ultimately address figuring out what the input file is. Right now the inputFile is read from the command line, so examining that filename is the easiest.
Looking at the proposals, maybe we can instead just read the directory and see if main.go or main.ts exists in the folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if you think this is OK for now or if we want to wait on this until those other tickets are resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we go with the directory approach, what if there are multiple ts files in the directory? For go, it compiles and build the whole directory, so it doesnt matter. I am not sure about TS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'll need to see how the Go compile command will ultimately be utilized. It is certainly possible to scan a directory tree for ts files, but is there something inherently special about the file name main.go or main.ts in those directories?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically, how do we figure out the workflow entry point when dealing with a directory? I might have a bunch of scripts sitting around with .ts extensions that I don't want compiled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @silaslenihan @yashnevatia. for go, they build the whole directory. Ref: https://github.com/smartcontractkit/cre-cli/pull/36/files#r2388501556
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the way Go build is gonna be
GOOS=wasip1 GOARCH=wasm go build -o w.wasm ./DirectoryOfWorkflowEntry
.I guess if TS has to specify the TS entry file, we can treat Go and TS differently in the setting, where Go is directory of workflow, while TS is the path to ts file (e.g. main.ts)
Thoughts @ejacquier @timothyF95