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(cli): add --output argument for single-contract compilation #1793

Merged
merged 5 commits into from
Feb 13, 2025

Conversation

Gusarich
Copy link
Member

Issue

Closes #1784.

Checklist

  • I have updated CHANGELOG.md
  • I have documented my contribution in docs/ and made the build locally
  • I have added tests to demonstrate the contribution is correctly implemented: this usually includes both positive and negative tests, showing the happy path(s) and featuring intentionally broken cases
  • I have run all the tests locally and no test failure was reported
  • I have run the linter, formatter and spellchecker
  • I did not do unrelated and/or undiscussed refactorings

@Gusarich Gusarich requested a review from a team as a code owner February 12, 2025 14:07
novusnota
novusnota previously approved these changes Feb 12, 2025
Copy link
Member

@novusnota novusnota left a comment

Choose a reason for hiding this comment

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

Neat!

@novusnota novusnota added this to the v1.6.0 milestone Feb 12, 2025
const relativeOutputDir = normalize(
join(dirname(filePath), outputDir),
);
(config.projects[0] as ConfigProject).output = relativeOutputDir;
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't use unsafe casts.

Here's a branch with fixed types for Config, so that all the fields there are readonly, and we can use as const type of createSingleFileConfig to prove it has that [0] field.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please rebase from this branch, and the error should go away.

#1798

Copy link
Member Author

Choose a reason for hiding this comment

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

have a look now please @verytactical

export const createSingleFileConfig = (fileName: string) =>
export const createSingleFileConfig = (
fileName: string,
outputDir: string = "./",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need a default value here?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

Copy link
Contributor

@verytactical verytactical Feb 13, 2025

Choose a reason for hiding this comment

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

Please pass the default value directly where it's needed.

Copy link
Member Author

Choose a reason for hiding this comment

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

@i582 @verytactical have a look now please!

Copy link
Contributor

@verytactical verytactical left a comment

Choose a reason for hiding this comment

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

(forgot to start a review)

@anton-trunov anton-trunov merged commit 723ff64 into tact-lang:main Feb 13, 2025
24 checks passed
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.

Add --output flag to control output directory for artifacts when compiling single contract
5 participants