Skip to content

Commit

Permalink
Fixes to checker and CLI items (#135)
Browse files Browse the repository at this point in the history
- Adds missing specification tests
- New documentation
- Renaming and general moving
- Updating infrastructure
  • Loading branch information
kaleidawave authored Apr 19, 2024
1 parent 24e35b9 commit 24fb424
Show file tree
Hide file tree
Showing 82 changed files with 1,302 additions and 800 deletions.
36 changes: 12 additions & 24 deletions .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ jobs:

outputs:
new-ezno-version: ${{ steps.get-version.outputs.new-ezno-version }}
new-ezno-version-name: ${{ steps.get-version.outputs.new-ezno-version-name }}
SPONSORS: ${{ steps.get-data.outputs.SPONSORS }}
CONTRIBUTORS: ${{ steps.get-data.outputs.CONTRIBUTORS }}
SPONSORS: ${{ steps.get-sponsors-and-contributors.outputs.SPONSORS }}
CONTRIBUTORS: ${{ steps.get-sponsors-and-contributors.outputs.CONTRIBUTORS }}

steps:
- uses: actions/checkout@v4
Expand All @@ -37,56 +36,45 @@ jobs:
if [ ${{ inputs.ezno-version }} = 'latest' ]; then
echo "::group::Ezno tags"
git for-each-ref --sort=creatordate --format '%(refname:short)' 'refs/tags/release/ezno-[0-9]*'
echo "::endgroup"
echo "::endgroup::"
TAG=$(git for-each-ref --sort=creatordate --format '%(refname:short)' 'refs/tags/release/ezno-[0-9]*' | tail -n 1)
echo "Building GH release for ${TAG:13}"
echo "new-ezno-version=${TAG:13}" >> $GITHUB_OUTPUT
# Replace '.' with '-'
NAME_VERSION=$(echo $VERSION | sed -e "s/\./-/g")
echo "new-ezno-version-name=${NAME_VERSION}" >> $GITHUB_OUTPUT
else
VERSION="${{ inputs.ezno-version }}"
echo "Building GH release for ${VERSION}"
echo "new-ezno-version=${VERSION}" >> $GITHUB_OUTPUT
# Replace '.' with '-'
NAME_VERSION=$(echo $VERSION | sed -e "s/\./-/g")
echo "new-ezno-version-name=${NAME_VERSION}" >> $GITHUB_OUTPUT
fi
- id: get-data
- id: get-sponsors-and-contributors
run: |
SPONSORS=$(gh api graphql -f query='{
user(login: "kaleidawave") {
sponsorshipsAsMaintainer(first: 100, activeOnly: false) {
edges {
node {
sponsor {
login
name
}
}
}
}
}
}' -q '.data.user.sponsorshipsAsMaintainer.edges | map(.node.sponsor.login) | join(", ")')
}' -q '.data.user.sponsorshipsAsMaintainer.edges | map(.node.sponsor.name) | join(",")')
echo "SPONSORS=$SPONSORS" >> $GITHUB_OUTPUT
CONTRIBUTORS=$(gh api graphql -f query='{
repository(owner: "kaleidawave", name: "ezno") {
pullRequests(first: 100, states: 'MERGED') {
edges {
node {
author {
login
}
}
}
}
}
}' -q '.data.repository.pullRequests.edges | map(.node.author.login) | unique | join(", ")')
CONTRIBUTORS=$(
gh pr list --search "-author:@me" --state merged --json author
| jq 'map(.author.name) | unique | join(",")'
)
echo "CONTRIBUTORS=$CONTRIBUTORS" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -127,7 +115,7 @@ jobs:
- name: Rename and move release assets
run: |
mkdir artifacts
mv target/release/ezno${{ matrix.executable-extension }} "artifacts/ezno-${{ needs.get-build-info.outputs.new-ezno-version-name }}-${{ matrix.platform_name }}${{ matrix.executable-extension }}"
mv target/release/ezno${{ matrix.executable-extension }} "artifacts/ezno-${{ needs.get-build-info.outputs.new-ezno-version }}-${{ matrix.platform_name }}${{ matrix.executable-extension }}"
- uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -163,4 +151,4 @@ jobs:
body: "For @kaleidawave to update"
files: |
README.md
build-artifacts/*
build-artifacts/*
4 changes: 2 additions & 2 deletions .github/workflows/lines-of-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
linesOfRustCode=$(scc -c --no-cocomo -f json -i rs "$cratePath" | jq '.[] | .Code');
fi
echo "\`$name\` has $linesOfRustCode lines of code" # >> $GITHUB_STEP_SUMMARY;
echo "\`$name\` has $linesOfRustCode lines of code" >> $GITHUB_STEP_SUMMARY;
curl \
--header "Content-Type: application/json" \
Expand All @@ -44,4 +44,4 @@ jobs:
record "parser" "ezno-parser"
record "checker" "ezno-checker"
record "src" "ezno"
record "src" "ezno"
24 changes: 9 additions & 15 deletions .github/workflows/performance-and-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,8 @@ jobs:
- name: Run checker performance
shell: bash
run: |
echo "::info::Found specification"
# Generate a file which contains everything that Ezno currently implements
cargo run -p ezno-parser --example code_blocks_to_script ./checker/specification/specification.md ./demo.ts
echo "::info::Finished file generation"
echo "<details>
Expand All @@ -62,8 +59,7 @@ jobs:
\`\`\`ts
" >> $GITHUB_STEP_SUMMARY
lines=$(scc -c --no-cocomo -f json demo.ts | jq ".[0].Code")
echo "// $lines lines of TypeScript" >> $GITHUB_STEP_SUMMARY
echo "// $(scc -c --no-cocomo -f json demo.ts | jq ".[0].Code") lines of TypeScript" >> $GITHUB_STEP_SUMMARY
cat ./demo.ts >> $GITHUB_STEP_SUMMARY
echo "\`\`\`
Expand All @@ -86,19 +82,17 @@ jobs:
" >> $GITHUB_STEP_SUMMARY
echo "### Checking
\`\`\`shell" >> $GITHUB_STEP_SUMMARY
hyperfine -i './target/release/ezno check demo.ts' >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
\`\`\`shell
$(hyperfine -i './target/release/ezno check demo.ts')
\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "::group::Comparing printing of diagnostics"
hyperfine -i './target/release/ezno check demo.ts' './target/release/ezno check demo.ts --count-diagnostics'
hyperfine -i './target/release/ezno check demo.ts' './target/release/ezno check demo.ts --compact-diagnostics' './target/release/ezno check demo.ts --count-diagnostics'
echo "::endgroup::"
echo "::group::cargo tree"
cargo tree
echo "::endgroup::"
- name: Download parser files
run: |
curl https://esm.sh/v128/react-dom@18.2.0/es2022/react-dom.mjs > react.js
- name: Run parser, minfier/stringer performance
shell: bash
Expand Down
21 changes: 6 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,29 +66,20 @@ jobs:
edges {
node {
sponsor {
login
name
}
}
}
}
}
}' -q '.data.user.sponsorshipsAsMaintainer.edges | map(.node.sponsor.login) | join(", ")')
}' -q '.data.user.sponsorshipsAsMaintainer.edges | map(.node.sponsor.name) | join(",")')
echo "SPONSORS=$SPONSORS" >> $GITHUB_OUTPUT
CONTRIBUTORS=$(gh api graphql -f query='{
repository(owner: "kaleidawave", name: "ezno") {
pullRequests(first: 100, states: 'MERGED') {
edges {
node {
author {
login
}
}
}
}
}
}' -q '.data.repository.pullRequests.edges | map(.node.author.login) | unique | join(", ")')
CONTRIBUTORS=$(
gh pr list --search "-author:@me" --state merged --json author
| jq 'map(.author.name) | unique | join(",")'
)
echo "CONTRIBUTORS=$CONTRIBUTORS" >> $GITHUB_OUTPUT
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ build
node_modules
/TODO.txt
checker/specification/Cargo.lock
checker/definitions/es5.d.ts
8 changes: 5 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ Now in the `ezno` directory, `cargo run` should show the CLI.

## Development

If you don't want to run the whole Ezno CLI. You can run just the checker with
You can run just the checker with

```shell
cargo run -p ezno-checker --example run path/to/file.ts
```

Note you can skip the cache with the additional `--no-cache` option (re-reads base `.d.ts` file)
> [!TIP]
> This can be faster as doesn't have recompile the CLI options and things. (although the errors don't contain the nice source annotations)
> Note you can skip the cache with the additional `--no-cache` option (re-reads base `.d.ts` file)
If you want to check all the checker tests

Expand Down Expand Up @@ -67,7 +69,7 @@ cargo run -p ezno-parser --example lex path/to/file.ts

### The `notify!` macro

The checker crate has the `crate::utils::notify!` macro, which can be used to trace information when the `EZNO_DEBUG` environment variable is set.
The checker crate has the `crate::utilities::notify!` macro, which can be used to trace information when the `EZNO_DEBUG` environment variable is set.

## *Rules* for contributions

Expand Down
Loading

0 comments on commit 24fb424

Please sign in to comment.