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

Update to Rust based helpers #1

Merged
merged 7 commits into from
Sep 3, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .dprint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"typescript": {
},
"json": {
},
"markdown": {
"ignoreDirective": "prettier-ignore",
"ignoreFileDirective": "prettier-ignore-file",
"ignoreStartDirective": "prettier-ignore-start",
"ignoreEndDirective": "prettier-ignore-end"
},
"toml": {
},
"excludes": [
"**/html*",
"**/.yarn",
"**/node_modules",
"**/*-lock.json"
],
"plugins": [
"https://plugins.dprint.dev/typescript-0.87.1.wasm",
"https://plugins.dprint.dev/json-0.17.4.wasm",
"https://plugins.dprint.dev/markdown-0.16.0.wasm",
"https://plugins.dprint.dev/toml-0.5.4.wasm"
]
}
32 changes: 32 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Checks
on:
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
push:
branches:
- main
pull_request:
branches:
- main

jobs:
ci-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache
id: cache
uses: actions/cache@v3
with:
path: ~/.cache/dprint # TODO add more paths here for various checkers
key: ${{ runner.os }}-${{ hashFiles('**/*dprint.json') }}

- name: Format Check (dprint)
uses: dprint/[email protected]
with:
config-path: .dprint.json

# FIXME .mlc.toml config not working... https://github.com/becheran/mlc/issues/78
- name: Markup Link Checker (mlc)
uses: becheran/[email protected]
with:
args: "./content/ --ignore-links '*slides.md,*slides.html,*twitter.com*,*sec.gov*,*support.giphy.com*,*bitdefender.com*,*etherscan.io*,*cryptoslate.com*,*golden.com*,'"
20 changes: 0 additions & 20 deletions .github/workflows/link-check.yml

This file was deleted.

10 changes: 0 additions & 10 deletions .github/workflows/mlc_config.json

This file was deleted.

5 changes: 1 addition & 4 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# From https://github.com/rust-lang/mdBook/wiki/Automated-Deployment%3A-GitHub-Actions#raw-example
name: Build and push to `html-*` branches, publish to Pages
on:
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
push:
branches:
- main

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write # needed to push to branches
Expand Down Expand Up @@ -77,7 +75,6 @@ jobs:
with:
path: ./html-book

# Deployment job
deploy:
environment:
name: github-pages
Expand Down
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# Rust artifacts
**/target

# Build artifacts
/html*

# Jupyter artifacts
# Rust artifacts
**/target

# Jupyter artifacts
**/.ipynb_checkpoints/**

# Some common ones
tmp
tmp/**
*.log
log/**
.vscode
.idea/
*.iml
Expand All @@ -18,8 +20,6 @@ tmp
out/
.DS_Store
.svn
log/*.log
tmp/**
node_modules/
.sass-cache
_static/
Expand Down
20 changes: 20 additions & 0 deletions .mlc.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# FIXME this config is not working... https://github.com/becheran/mlc/issues/78
# Print debug information to console
debug = false
# Do not check web links
offline = false
# Check the exact file extension when searching for a file
match-file-extension = true
# List of files and directories which will be ignored
ignore-path = [""]
# List of links which will be ignored
ignore-links = [
"*slides.md,*slides.html,*twitter.com*,*sec.gov*,*support.giphy.com*,*bitdefender.com*,*etherscan.io*,*cryptoslate.com*,*golden.com*,",
]
# List of markup types which shall be checked
markup-types = ["Markdown", "Html"]
# Wait time in milliseconds between http request to the same host
# Consider use only if getting `429 - Too Many Requests`
throttle = 0
# Path to the root folder used to resolve all relative paths
root-dir = "./content/"
8 changes: 4 additions & 4 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module.exports = {
arrowParens: 'avoid',
endOfLine: 'lf',
arrowParens: "avoid",
endOfLine: "lf",
semi: true,
singleQuote: true,
trailingComma: 'es5',
trailingComma: "es5",
overrides: [
{
files: '*.md',
files: "*.md",
options: {
singleQuote: false,
},
Expand Down
51 changes: 30 additions & 21 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,25 @@ skip_crate_env_info = true
category = "Install"
alias = "install"


[tasks.install]
description = "Install dependencies for slides and book tooling."
category = "Install"
dependencies = ["install-slides", "install-book"]
dependencies = ["install-slides", "install-book", "install-linkcheck", "install-formatter"]

[tasks.install-book]
description = "Install dependencies for book tooling only."
description = "Install dependencies for building the book only."
category = "Install"
script = "cargo install --locked mdbook"

[tasks.install-linkcheck]
description = "Install markup link checker (mlc)."
category = "Install"
script = "cargo install --locked mlc"

[tasks.install-formatter]
description = "Install formatter (dprint)."
category = "Install"
script = "cargo install mdbook"
script = "cargo install --locked dprint"

[tasks.install-slides]
description = "Install dependencies for slides tooling only."
Expand Down Expand Up @@ -144,7 +153,6 @@ category = "Clean"
script = "rm -rf html-slides"

[tasks.img]
# FIXME want a native-to-rust way to invoke prettier, ideally without need for global install of https://prettier.io/docs/en/install.html
category = "Checks"
description = "Scan for image issues througout content."
script = "./tools/scripts/orphan-image-scan.sh content/"
Expand All @@ -154,16 +162,17 @@ category = "Checks"
alias = "all-links"

[tasks.all-links]
# FIXME want a native-to-rust way to invoke prettier, ideally without need for global install of https://prettier.io/docs/en/install.html
category = "Checks"
description = "Check included links for all markdown files."
script = "yarn l"
description = "Check included links for all markup (.md|.html) files."
# FIXME .mlc.toml config not working... https://github.com/becheran/mlc/issues/78
script = "mlc content/ --ignore-links '*slides.md,*slides.html,*twitter.com*,*sec.gov*,*support.giphy.com*,*bitdefender.com*,*etherscan.io*,*cryptoslate.com*,*golden.com*,'"

[tasks.links-for]
# FIXME want a native-to-rust way to invoke prettier, ideally without need for global install of https://prettier.io/docs/en/install.html
category = "Checks"
description = "Check links for specific file(s). Example: `makers links-for ./content/contribute/**/*.md`"
script = "yarn links-for ${@}"
# FIXME .mlc.toml config not working... https://github.com/becheran/mlc/issues/78
script = "mlc ${@} --ignore-links '*slides.md,*slides.html,*twitter.com*,*sec.gov*,*support.giphy.com*,*bitdefender.com*,*etherscan.io*,*cryptoslate.com*,*golden.com*,'"

[tasks.f]
category = "Format"
Expand All @@ -173,17 +182,7 @@ alias = "fmt"
# FIXME want a native-to-rust way to invoke prettier, ideally without need for global install of https://prettier.io/docs/en/install.html
category = "Format"
description = "Format everything."
script = "yarn fmt"

[tasks.fmt-book]
description = "Format the book source, only. (requires slides tooling installed)"
category = "Format"
script = "yarn fmt-book"

[tasks.fmt-slides]
description = "Format the slides source, only."
category = "Format"
script = "yarn fmt-slides"
script = "dprint fmt"

[tasks.catch-error]
description = "Check and hint at solutions to common errors."
Expand All @@ -197,7 +196,17 @@ if ! $(echo "type mdbook" | sh > /dev/null ) ; then
exit 127
fi

if ! $(yarn --cwd ./slides-source/ --version > /dev/null) ; then
if ! $(echo "type mlc" | sh > /dev/null ) ; then
echo "\n❌ You may need to install the helpers tooling. Run:\n\nmarkers install\n\n***********"
exit 127
fi

if ! $(echo "type dprint" | sh > /dev/null ) ; then
echo "\n❌ You may need to install the helpers tooling. Run:\n\nmarkers install\n\n***********"
exit 127
fi

if ! $(yarn --version > /dev/null) ; then
echo "\n❌ You may need to install the slides tooling. Run:\n\nmarkers slides-install\n"
exit 127
fi
Expand Down
3 changes: 1 addition & 2 deletions content/CODE-OF-CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ representative at an online or offline event.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[INSERT CONTACT METHOD].
reported to the community leaders responsible for enforcement at [[email protected]](mailto:[email protected]).
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
Expand Down
18 changes: 9 additions & 9 deletions content/LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ means having the right to grant, to the maximum extent possible, whether at the

means any of the following:

1. any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or
2. any new file in Source Code Form that contains any Covered Software.
1. any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or
2. any new file in Source Code Form that contains any Covered Software.

### 1.11. “Patent Claims” of a Contributor

Expand All @@ -70,8 +70,8 @@ means an individual or a legal entity exercising rights under this License. For

Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:

1. under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and
2. under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version.
1. under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and
2. under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version.

### 2.2. Effective Date

Expand All @@ -81,9 +81,9 @@ The licenses granted in Section 2.1 with respect to any Contribution become eff

The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor:

1. for any code that a Contributor has removed from Covered Software; or
2. for infringements caused by: (i) Your and any other third party’s modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or
3. under Patent Claims infringed by Covered Software in the absence of its Contributions.
1. for any code that a Contributor has removed from Covered Software; or
2. for infringements caused by: (i) Your and any other third party’s modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or
3. under Patent Claims infringed by Covered Software in the absence of its Contributions.

This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4).

Expand Down Expand Up @@ -113,8 +113,8 @@ All distribution of Covered Software in Source Code Form, including any Modifica

If You distribute Covered Software in Executable Form then:

1. such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and
2. You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients’ rights in the Source Code Form under this License.
1. such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and
2. You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients’ rights in the Source Code Form under this License.

### 3.3. Distribution of a Larger Work

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ See the README included in the repository for further instructions.

## Learning objectives:

1. How to run a node
1. What the log messages mean
1. Preview: How to configure a network with a chain spec
1. Experience peer connections coming and going
1. Practice checking for common not-peering issues (different genesis, firewall)
1. How to run a node
1. What the log messages mean
1. Preview: How to configure a network with a chain spec
1. Experience peer connections coming and going
1. Practice checking for common not-peering issues (different genesis, firewall)

## Outline

Expand Down
3 changes: 2 additions & 1 deletion content/blockchain-contracts/accounting/slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ Did I forget any?

Notes:" />

Verify as opposed to determining the outcome. Not submitting output state in transaction
Verify as opposed to determining the outcome.
Not submitting output state in transaction

---

Expand Down
Loading