* forc template resolves the HEAD and fetches the repo. Prints the requested directorie's path
* forc template works with and without template name
* forc init --template removed, pkg.rs unused pub modifier removed
* extra info added before copy, cargo-toml-lint, udeps fix, mdbook fix
* invoke CI
* Update scripts/mdbook-forc-documenter/examples/forc_template.md
Co-authored-by: John Adler <adlerjohn@users.noreply.github.com>
* Update scripts/mdbook-forc-documenter/examples/forc_template.md
Co-authored-by: John Adler <adlerjohn@users.noreply.github.com>
* default url provided, project_name is last parameter to pass without --project_name
* cargo fmt
* println to tracing::info
* local_repo_name to template_name
Co-authored-by: John Adler <adlerjohn@users.noreply.github.com>
* Remove selector debug which used the old parser
* remove sway-types dep on pest
Co-authored-by: mitchmindtree <mitchell.nordine@fuel.sh>
* remove friendly error string method
* Manifest files use env variable to set author or default back to the realname
* Updated formatting
* Moved environment &str into an importable constant
* DRYing the code
* Update for failing forc-documenter CI
* Add indentation for code block within forc deploy
* Separate examples from constants
* Update examples.rs to the latest version
* Remove long-form discussion in forc completions help
* Update examples and docs
* Revert examples check to shorten diff forn ow
* Newline
* Newline for docs
* Better formatting
* Add link to book within help
* Update docs
* Remove redundant shell command prefixes $ and PS
* Missed the C:s
* Run write-docs script
* Re-add FORC_COMPLETIONS_EXAMPLE
* hide = true for use-orig-asm and use-orig-parser
* update docs
* Hide use_orig_asm and use_orig_parser for deploy and run as well
* Update docs for run and deploy
Co-authored-by: binggh <binggh@proton.me>
* Added examples from examples repo
* Updated formatting
* Updating formatting again. I really need to figure out why cargo fmt is not running here
* change hello_world to counter in URL
* Use SWAY_GIT_TAG instead of master in URL
* Cleaned up branching. Alphabetized examples
* Removed hardcoded examples in favour of error handling and future auto example discovery
* Added automatic repo discovery upon user entering a nonexistent template
* Cleaned up error handling to use anyhow!()
* Cleaned up the formatting
* Changed the URL to query the SWAY_GIT_TAG instead of master
Co-authored-by: Chris O'Brien <57543709+eureka-cpu@users.noreply.github.com>
* emit file names by default, with option of full path
* pub use PluginsCommmand
* cargo fmt
* better handling of file_name
* Use expect for print_plugin + add panic assumptions comment
* Run forc-documenter for forc plugins
Co-authored-by: bing <binggh@proton.me>
* remove pest::Span from sway_types::Span
* Add new parser implementation
* use new parser in sway-core
* Proper error handling in convert_parse_tree
* rename new-parser-again to sway-parse
* remove redundant test bin from sway-parse
* fix dependencies in sway-parse
* fix clippy lints
* put dependencies in alphabetical order
* run rustfmt
* record full span in TokenStream
* remove an unused function
* alphabetically sort workspace members
* add --use-orig-parser cli option
* rust rustfmt
* update crate metadata for sway-parse
* update forc docs for --use-orig-parser
* Introduce a path-aware `ManifestFile` type
After loading a `Manifest`, most useful operations involving it require
knowledge of the directory path from which it was loaded from (i.e.
`entry_string`, `program_type`).
This introduces a `ManifestFile` type that stores the path to the
`Forc.toml` from which its inner `Manifest` was read. This allows to
avoid a lot of unnecessary code duplication related to traversing the
parents to find the root manifest directory. Now, we can just load the
`ManifestFile` and call `manifest.path()` or `manifest.dir()` to get the
path to the `Forc.toml` or its enclosing directory respectively.
* Use correct manifest directory path for `fetch_deps`
* Replace comment previously lost in rebase conflict resolution
* Use existing error constructor provided by pkg module
* moved check project type to manifest
* added find_manifest_dir to from_dir
* find and remove duplicate find_manifest_dir
* added manifest_dir to fns that require it
* updated forc init
* Fixed fmt and warning
* fix clippy
* fmt all?
* fmt the templates
* Fix default contract fmt
* TODO comment
* Added Test Function so things work in 3 cmds now
* Add a `forc plugins` command for listing all plugins
Closes#1198.
Lists the full path to every `forc-*` plugin discovered under the user's
`PATH`.
For example:
```sh
[mindtree@minddesk:~]$ forc plugins
/home/mindtree/.cargo/bin/forc-fmt
/home/mindtree/.cargo/bin/forc-explore
/home/mindtree/.cargo/bin/forc-lsp
```
We could potentially add flags to this command in the future for:
- only emitting executable names (not full paths)
- printing versions and descriptions in a table
- outputting via JSON or TOML for easier machine digestion.
For now, this PR just aims to add initial support.
The logic included in this should make it easier to include available
plugin commands in a future `forc --list` command too (ala #702).
* Specify major.minor for forc's walkdir dependency
* Add a new `forc-fmt` forc plugin for running the Sway code formatter
In preparation for removing internal support for formatting from `forc`
as a part of an ongoing effort toward slimming down `forc`'s dependency
graph.
* forc: Remove `fmt` command in favour of new `forc-fmt` plugin crate
* Add `forc-explore` plugin for running the fuel block explorer
This is aimed at replacing `forc`'s internal support for running the
block explorer, to be removed in a follow-up commit.
* Remove `forc` block explorer support in favour of `forc-explore` plugin
* forc-explore: don't panic on failed archive extraction
* forc-explore: sync to current `forc` version at 0.9.2
* forc-explore: use major.minor versions for deps
Also updates the `Cargo.lock` with the 0.9 -> 0.9.2 version change.
* forc-explore: forc-util dep version must be major.minor.patch
* Move `forc`'s LSP support into a dedicated `forc-lsp` plugin crate.
This creates a dedicated `forc-lsp` plugin crate. With `forc`'s new
plugin support, having this plugin installed and available via `PATH`
enables the original behaviour of starting the sway language server via
`forc lsp <args>`.
This also acts as a local test for `forc` plugin support and as a simple
example of how to implement a `forc` plugin.
The old `lsp` and `forc_lsp` modules have been removed from `forc` in
favour of this new `forc-lsp` plugin.
* Add forc-lsp plugin to CI git tag version check
* forc-lsp: sync to current `forc` version at 0.9.2
* fuel-lsp: Use `major.minor` for dep versions
* forc-lsp: local deps must be major.minor.patch for publishing
This allows for forwarding both custom options and custom arguments
through to `forc test`'s underlying `cargo test` invocation.
See the documentation for the new `forc_test::Command` fields for
information on how to forward options and arguments.
This also removes the permanent "--nocapture" arg that we previously
passed through to `cargo test` in favour of allowing the user to
optionally specify it if they wish.
To achieve the original behaviour, you can invoke `forc test` with the
following:
```
forc test -- --nocapture
```
Note that this PR *does* keep the original behaviour of permanently
setting `--color always` in order to provide nice colorful output by
default. This is useful as cargo appears to disable colored output by
default when run as a child process.
In the case that the user wishes to disable colored output, they can
still do so by specifying the necessary `cargo test` option, e.g.
```
forc test --cargo-test-opts="--color never"
```
Closes#1004
Adds support for treating external executables as `forc` plugins,
provided they are of the name `forc-*` and are available via `PATH`.
For example, this allows for using an installed `forc-foo <args>` plugin
via `forc foo <args>`.
This should enable us to cut down on some of `forc`'s bloat by moving
support for things like the block explorer, language server and running
a fuel node into dedicated plugins.
* wip
* can now emit lsp warnings for all parsed tokens
* set lsp DebugFlags via CLI input
* update tests to take a client and config
* add ops forc_lsp module
* cargo fmt
* add Cargo.lock
* remove commented line