You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
workspace types
Adds a directory where you want the .ts file to be copied when running anchor build. This is helpful when you want to keep this file in version control, like when using it on the frontend, which will probably not have access to the target directory generated by anchor.
Example:
[workspace]
types = "app/src/idl/"
But this is confusing. The auto-generated files include both IDL json (by default in target/idl) and typescript/js (by default in target/types). How can I control the location of both of these? The documentation confusingly suggests that "types" will control the "typescript" file and then proceeds to set the value of that parameter to a directory that mentions "idl", which is a strictly different kind of autogenerated output.
This is super basic stuff. Can we get some clarity and it fixed?
I want to be able to control where "target/idl/.json" file is generated, and also where the "target/types/.ts" file is generated.
Even more, since I have various compile time constants that depend on my environmet (production, staging, development), I would actually like to set the value of these customized locations so that they depend on the value of a config in a dotenv file. Is that possible? If not, is there a way to do a post-script for "anchor build"? Then, I could keep the files generated to the standard location (which will not be verision-controlled), and then I'd copy it into a dotenv-specific directory after running "anchor build". I do not want to run a separate command, as people will forgot to do that.
The text was updated successfully, but these errors were encountered:
The documentation says:
But this is confusing. The auto-generated files include both IDL json (by default in
target/idl
) and typescript/js (by default intarget/types
). How can I control the location of both of these? The documentation confusingly suggests that "types" will control the "typescript" file and then proceeds to set the value of that parameter to a directory that mentions "idl", which is a strictly different kind of autogenerated output.This is super basic stuff. Can we get some clarity and it fixed?
I want to be able to control where "target/idl/.json" file is generated, and also where the "target/types/.ts" file is generated.
Even more, since I have various compile time constants that depend on my environmet (production, staging, development), I would actually like to set the value of these customized locations so that they depend on the value of a config in a dotenv file. Is that possible? If not, is there a way to do a post-script for "anchor build"? Then, I could keep the files generated to the standard location (which will not be verision-controlled), and then I'd copy it into a dotenv-specific directory after running "anchor build". I do not want to run a separate command, as people will forgot to do that.
The text was updated successfully, but these errors were encountered: