Skip to content

Commit

Permalink
Merge branch 'master' into navigation-documentation-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Nov 12, 2023
2 parents 3af93b9 + 0594ddc commit bba697e
Show file tree
Hide file tree
Showing 32 changed files with 940 additions and 286 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d
- uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
extensions: fileinfo
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: fileinfo, zip
Expand Down Expand Up @@ -169,7 +169,7 @@ jobs:
needs: run-smoke-tests

steps:
- uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d
- uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
coverage: xdebug
Expand Down Expand Up @@ -263,7 +263,7 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d
- uses: shivammathur/setup-php@v2
with:
php-version: "8.1"

Expand Down Expand Up @@ -311,7 +311,7 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d
- uses: shivammathur/setup-php@v2
with:
php-version: "8.1"

Expand Down Expand Up @@ -362,7 +362,7 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d
- uses: shivammathur/setup-php@v2
with:
php-version: "8.1"

Expand Down Expand Up @@ -468,7 +468,7 @@ jobs:
check-coding-standards:
runs-on: ubuntu-latest
steps:
- uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d
- uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
- uses: actions/checkout@v3
Expand All @@ -486,7 +486,7 @@ jobs:
run-static-analysis-psalm:
runs-on: ubuntu-latest
steps:
- uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d
- uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
- uses: actions/checkout@v3
Expand All @@ -495,16 +495,16 @@ jobs:
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

- name: Run static analysis (Psalm/Shepherd)
run: vendor/bin/psalm --shepherd || true
run: vendor/bin/psalm --shepherd > psalmout.txt|| true

- name: Ping CI server with type coverage results
run: php monorepo/scripts/ping-ci-server-with-type-coverage.php ${{ secrets.CI_SERVER_TOKEN }} ${{ github.sha }} master
run: php monorepo/scripts/ping-ci-server-with-type-coverage.php ${{ secrets.CI_SERVER_TOKEN }} ${{ github.sha }} master ${{ github.run_id }}


run-static-analysis-phpstan:
runs-on: ubuntu-latest
steps:
- uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d
- uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
- uses: actions/checkout@v3
Expand Down Expand Up @@ -569,7 +569,6 @@ jobs:


snyk-security:
if: false # Temporarily disabled due to unknown downstream error
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/deploy-documentation-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d
- uses: shivammathur/setup-php@v2
with:
php-version: "8.1"

Expand Down Expand Up @@ -56,7 +56,6 @@ jobs:
run: rm resources/views/vendor/hyde/components/docs/documentation-article.blade.php

- name: Create component to add an information badge
# TODO 1. Extract to component. 2. Add feature to hide card which is stored in local session storage for the duration of the visit (so it's reset on next PR page visit)
run: |
mkdir -p resources/views/vendor/hyde/layouts
cp vendor/hyde/framework/resources/views/layouts/docs.blade.php resources/views/vendor/hyde/layouts/docs.blade.php
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
test-coverage:
runs-on: ubuntu-latest
steps:
- uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d
- uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
coverage: xdebug
Expand Down
21 changes: 3 additions & 18 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ jobs:
psalm:
name: Run Analysis
runs-on: ubuntu-latest
continue-on-error: true
outputs:
exit-code: ${{ steps.analysis.outputs.EXIT_CODE }}
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -21,20 +18,8 @@ jobs:

- name: Run Psalm
id: analysis
run: vendor/bin/psalm > psalmout.txt || echo EXIT_CODE=$? >> $GITHUB_OUTPUT || exit 0
run: vendor/bin/psalm > psalmout.txt || exit 0

# Send the reports to the CI server to calculate type coverage and send back commit status checks
- name: Ping CI server with type coverage results
run: php monorepo/scripts/ping-ci-server-with-type-coverage.php ${{ secrets.CI_SERVER_TOKEN }} ${{ github.event.pull_request.head.sha }} ${{ github.head_ref }}


# Since GitHub Actions for some reason doesn't support exiting with warnings, we work around this by
# adding a second job. If the first job fails, this one won't run, thus resulting with a skipped status.
# TODO refactor to use CI server to report status if there are new issues encountered compared to the base branch
report-psalm:
name: Psalm Static Analysis
runs-on: ubuntu-latest
needs: psalm
if: needs.psalm.outputs.exit-code == 0
steps:
- name: Report analysis passed
run: echo "Got code ${{ needs.psalm.outputs.exit-code }}" && exit 0;
run: php monorepo/scripts/ping-ci-server-with-type-coverage.php ${{ secrets.CI_SERVER_TOKEN }} ${{ github.event.pull_request.head.sha }} ${{ github.head_ref }} ${{ github.run_id }}
4 changes: 2 additions & 2 deletions .github/workflows/test-pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d
- uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
coverage: xdebug
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: fileinfo, zip
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<h1 align=center>HydePHP - Source Monorepo</h1>
<h1 align=center>HydePHP - Source Code Monorepo</h1>
<h2 align=center>Contribute to the Core HydePHP Components in one place</h2>

<div align=center>

[![Test & Build](https://github.com/hydephp/develop/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/hydephp/develop/actions/workflows/continuous-integration.yml)
[![Framework Tests (Matrix)](https://github.com/hydephp/framework/actions/workflows/run-tests.yml/badge.svg)](https://github.com/hydephp/framework/actions/workflows/run-tests.yml)
[![Hyde Tests](https://github.com/hydephp/hyde/actions/workflows/run-tests.yml/badge.svg)](https://github.com/hydephp/hyde/actions/workflows/run-tests.yml)
[![Framework Tests (Matrix)](https://github.com/hydephp/framework/actions/workflows/run-tests.yml/badge.svg?branch=develop)](https://github.com/hydephp/framework/actions/workflows/run-tests.yml)
[![Hyde Tests](https://github.com/hydephp/hyde/actions/workflows/run-tests.yml/badge.svg?branch=develop)](https://github.com/hydephp/hyde/actions/workflows/run-tests.yml)
</div>

<div align=center>
Expand Down
4 changes: 2 additions & 2 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This serves two purposes:
2. At release time, you can move the Unreleased section changes into a new release version section.

### Added
- for new features.
- Adds a new fancy output for the realtime compiler serve command in https://github.com/hydephp/develop/pull/1444

### Changed
- for changes in existing functionality.
Expand All @@ -19,7 +19,7 @@ This serves two purposes:
- for soon-to-be removed features.

### Removed
- for now removed features.
- Removed unhelpful boilerplate from the `hyde/hyde` `package.json` in https://github.com/hydephp/develop/pull/1436

### Fixed
- for any bug fixes.
Expand Down
7 changes: 4 additions & 3 deletions config/docs.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@
| default to sort alphabetically. You can reorder the page identifiers
| in the list below, and the links will get sorted in that order.
|
| Internally, the items listed will get a position priority of 500 + the order its found in the list.
| Link items without an entry here will have fall back to the default priority of 999, putting them last.
| The items will get a priority of 500 plus the order its found in the list.
| Pages without a priority will fall back to the default priority of 999.
|
| You can also set explicit priorities in front matter.
| You can also set explicit priorities in front matter or by specifying
| a value to the array key in the list to override the inferred value.
|
*/

Expand Down
12 changes: 8 additions & 4 deletions config/hyde.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,27 +300,31 @@
|
| If you are looking to customize the main navigation menu, this is the place!
|
| All these settings uses Route Keys to identify the page you want to configure.
| A route key is simply the URL path to the page, without the file extension.
| So `_site/posts/hello-world.html` has the route key 'posts/hello-world'.
|
*/

'navigation' => [
// This configuration sets the priorities used to determine the order of the menu.
// The default values have been added below for reference and easy editing.
// The array key should match the page's route key (slug).
// Lower values show up first in the menu.
// The array key is the page's route key, the value is the priority.
// Lower values show up first in the menu. The default is 999.
'order' => [
'index' => 0,
'posts' => 10,
'docs/index' => 100,
],

// In case you want to customize the labels for the menu items, you can do so here.
// Simply add the route key (slug) as the key, and the label as the value.
// Simply add the route key as the array key, and the label as the value.
'labels' => [
'index' => 'Home',
'docs/index' => 'Docs',
],

// These are the pages that should not show up in the navigation menu.
// These are the route keys of pages that should not show up in the navigation menu.
'exclude' => [
'404',
],
Expand Down
9 changes: 9 additions & 0 deletions monorepo/scripts/ping-ci-server-with-type-coverage.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,19 @@
$token = $argv[1] ?? exit(400);
$commit = $argv[2] ?? exit(400);
$branch = $argv[3] ?? 'master';
$runId = $argv[4] ?? null;

if (file_exists('psalmout.txt')) {
// Count the number of errors in the output
$psalmErrors = substr_count(file_get_contents('psalmout.txt'), 'ERROR: ');
}

$data = [
'commit' => $commit,
'report' => file_get_contents('type-coverage.json') ?? exit(404),
'branch' => $branch,
'psalmErrors' => $psalmErrors ?? null,
'runId' => $runId,
];

$url = 'https://ci.hydephp.com/api/github/actions/type-coverage';
Expand Down
3 changes: 2 additions & 1 deletion monorepo/scripts/ping-openanalytics-testrunner.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* @internal This script is used to ping the OpenAnalytics server with the test results.
* @internal This script is used to ping the OpenAnalytics/CI server with the test results.
*
* @example php ping.php 'Monorepo Smoke Tests' ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }}
*
Expand All @@ -23,6 +23,7 @@
exit(404);
}

// Shared database with the CI server
$url = 'https://analytics.hydephp.com/api/test_runs';
$data = [
'runner' => json_encode($runner),
Expand Down
24 changes: 0 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,6 @@
"prod": "mix --production",
"watch": "mix watch"
},
"name": "hyde",
"description": "Elegant and Powerful Static App Builder",
"version": "1.1.0",
"main": "hyde",
"directories": {
"test": "tests"
},
"repository": {
"type": "git",
"url": "git+https://github.com/hydephp/hyde.git"
},
"keywords": [
"hydephp",
"hyde",
"static",
"site",
"generator"
],
"author": "Caen De Silva",
"license": "MIT",
"bugs": {
"url": "https://github.com/hydephp/hyde/issues"
},
"homepage": "https://hydephp.com",
"devDependencies": {
"@tailwindcss/typography": "^0.5.2",
"autoprefixer": "^10.4.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/framework/.github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@16011a795d747d5f45038f96371c3b98aec5669d
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: fileinfo, zip
Expand Down
7 changes: 4 additions & 3 deletions packages/framework/config/docs.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@
| default to sort alphabetically. You can reorder the page identifiers
| in the list below, and the links will get sorted in that order.
|
| Internally, the items listed will get a position priority of 500 + the order its found in the list.
| Link items without an entry here will have fall back to the default priority of 999, putting them last.
| The items will get a priority of 500 plus the order its found in the list.
| Pages without a priority will fall back to the default priority of 999.
|
| You can also set explicit priorities in front matter.
| You can also set explicit priorities in front matter or by specifying
| a value to the array key in the list to override the inferred value.
|
*/

Expand Down
12 changes: 8 additions & 4 deletions packages/framework/config/hyde.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,27 +300,31 @@
|
| If you are looking to customize the main navigation menu, this is the place!
|
| All these settings uses Route Keys to identify the page you want to configure.
| A route key is simply the URL path to the page, without the file extension.
| So `_site/posts/hello-world.html` has the route key 'posts/hello-world'.
|
*/

'navigation' => [
// This configuration sets the priorities used to determine the order of the menu.
// The default values have been added below for reference and easy editing.
// The array key should match the page's route key (slug).
// Lower values show up first in the menu.
// The array key is the page's route key, the value is the priority.
// Lower values show up first in the menu. The default is 999.
'order' => [
'index' => 0,
'posts' => 10,
'docs/index' => 100,
],

// In case you want to customize the labels for the menu items, you can do so here.
// Simply add the route key (slug) as the key, and the label as the value.
// Simply add the route key as the array key, and the label as the value.
'labels' => [
'index' => 'Home',
'docs/index' => 'Docs',
],

// These are the pages that should not show up in the navigation menu.
// These are the route keys of pages that should not show up in the navigation menu.
'exclude' => [
'404',
],
Expand Down
Loading

0 comments on commit bba697e

Please sign in to comment.