-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
cli: Add keys include/exclude in programs section #546
Conversation
Let's add this to one of the examples/tests so that we don't regress the feature. You can use |
@armaniferrante I added |
examples/typescript/Anchor.toml
Outdated
@@ -1,3 +1,7 @@ | |||
[provider] | |||
cluster = "localnet" | |||
wallet = "~/.config/solana/id.json" | |||
|
|||
[programs] |
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.
What do you think of renaming this to [workspace]
, similar to Cargo?
I'm a little hesitant to use the [programs]
name because in the future we may want to combine the [[test.genesis]]
and [clusters.<network>]
sections into one named [programs]
, since they both allow customizing various features of programs in the workspace and feels a little more appropriate.
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 it's will be better, thanks for the suggestion! Changed. But now I think, should [workspace]
have members
& exclude
as Cargo (with members
default to programs/*
for example)?
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.
Sounds good to me! members
may be better since it's consistent with Cargo but I'm happy with either choice.
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.
Went ahead and did the rename.
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.
Thanks. I thought to add regex support but was busy yesterday.
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.
Would be cool to see in a subsequent PR.
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.
Sure. Should we use default value for members
as["programs/*"]
?
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's hold off on the regex support. I'm making some changes that will conflict with this.
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.
To support package publishing, I've changed the members
and exclude
arrays to take paths relative to the workspace root (instead of relative to the programs/
dir, as is done in this PR), which is consistent with how Cargo handles this.
The next version will this PR in it. But the immediate release following will contain the breaking change (PR here #570).
Not sure that this is correct but I think it would be good if
programs
directory would be able to contain shared code (crate) between programs. Right nowanchor
cli consider all directories in inprograms
as program and trying to compile / generate IDL. This PR allows to include / exclude directories.