-
Notifications
You must be signed in to change notification settings - Fork 88
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
chore: add a comprehensive dfx json reference #2361
Changes from 12 commits
55c9911
e6d28e1
fc203da
9de7e24
7df1f6c
8761ca4
9f05cda
f775cd6
bc08bae
ca578a3
e3f90e9
2de0de0
f522758
6e12c16
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Update Docs | ||
on: | ||
pull_request: | ||
sesi200 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
jobs: | ||
update_dfx_json_schema: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
rust: ["1.60.0"] | ||
os: [ ubuntu-20.04 ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
sesi200 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
sesi200 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- name: Install Rust | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. more of a fyi, cause I'm not 100% certain here (help @adamspofford-dfinity), but I think this step is unnecessary since we have to verify, you might want to try |
||
run: | | ||
rustup update ${{ matrix.rust }} --no-self-update | ||
rustup component add clippy | ||
rustup default ${{ matrix.rust }} | ||
|
||
- name: Check cargo build | ||
run: cargo build | ||
- name: Show download worked | ||
run: cargo run -- --version | ||
- name: Update docs/dfx-json-schema.json | ||
run: | | ||
cargo run -- schema --outfile docs/dfx-json-schema.json | ||
cat docs/dfx-json-schema.json | ||
if ! git diff-index --quiet HEAD; then | ||
sesi200 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
git config user.name "GitHub Actions Bot" | ||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git add docs/dfx-json-schema.json | ||
git commit -m "update dfx-json-schema" | ||
git push | ||
fi |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# dfx schema | ||
|
||
The `dfx schema` command prints the schema for `dfx.json`. | ||
|
||
## Basic usage | ||
|
||
``` bash | ||
dfx schema [option] [flag] | ||
``` | ||
|
||
## Flags | ||
|
||
You can use the following optional flags with the `dfx schema` command. | ||
|
||
| Flag | Description | | ||
|-------------------|-------------| | ||
| `-h`, `--help` | Displays usage information. | | ||
| `-V`, `--version` | Displays version information. | | ||
|
||
## Options | ||
|
||
You can use the following option with the `dfx schema` command. | ||
|
||
| Option | Description | | ||
|---------------|-------------------------------------------------------------------------------------------------------------------| | ||
| `--outfile <outfile>` | Specifies a file to output the schema to instead of printing it to stdout. | | ||
|
||
## Examples | ||
|
||
You can print the schema for `dfx.json` by running the following command: | ||
|
||
``` bash | ||
dfx schema | ||
``` | ||
|
||
If you want to write the schema to `path/to/file/schema.json`, you can do so by running the following command: | ||
|
||
``` bash | ||
dfx schema --outfile path/to/file/schema.json | ||
``` |
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
:
is unnecessary here