Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion .commitlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"security",
"config"
]
]
],
"header-max-length": [ 2, "always", 100 ]
}
}
6 changes: 6 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ name: Pull Request Checks
on:
pull_request:
branches: ['**'] # Run on all branches
workflow_dispatch:

jobs:
dummy:
runs-on: ubuntu-latest
steps:
- name: Dummy Step
run: echo "This is a dummy job to allow workflow_dispatch"
pull-request-call-reusable-ci-checks-workflow:
name: Pull Request run CI Checks
uses: ./.github/workflows/reuseable-ci-checks.yml
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/workflow-readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@ they stay in the pull request ui. they are also only targetted on master
- npm and node
- seperate script to auto merge

## automerge-passing-minor-patch-dependabot-prs
-

# Git setup

## Pull requests
- Branch checks for master (they dont directly use Reuseable Ci Checks instead they use them via the pull_request yml, unsure why not directly available)
- Branch checks for master dont work, they don't run the workflow dispatch.
If we want these checks one solution is every check in its own yml (they dont directly use Reuseable Ci Checks instead they use them via the pull_request yml)


# Notes
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,6 @@ CHANGELOG.md
/TELBlazor.Components/wwwroot/css/nhsuk.css
/TELBlazor.Components.ShowCase.Shared/wwwroot/css/nhsuk.css
/TELBlazor.Components.ShowCase.E2ETests/Reports/*.zip
/CICDPackageLocation/*.nupkg


14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# [1.4.0-feat-button-for-cicd-testing.2](https://github.com/TechnologyEnhancedLearning/TELBlazor/compare/v1.4.0-feat-button-for-cicd-testing.1...v1.4.0-feat-button-for-cicd-testing.2) (2025-05-27)


### Features

* **button:** dispatch for pr ([e5832d2](https://github.com/TechnologyEnhancedLearning/TELBlazor/commit/e5832d2304a7e5a03f832769ff891cf173915f3f))

# [1.4.0-feat-button-for-cicd-testing.1](https://github.com/TechnologyEnhancedLearning/TELBlazor/compare/v1.3.0...v1.4.0-feat-button-for-cicd-testing.1) (2025-05-27)


### Features

* **tweaks:** lint limit ([8140e8a](https://github.com/TechnologyEnhancedLearning/TELBlazor/commit/8140e8ae3c23355f59380e55dd6e0626d30a7cf9))

# [1.3.0](https://github.com/TechnologyEnhancedLearning/TELBlazor/compare/v1.2.0...v1.3.0) (2025-05-27)


Expand Down
1 change: 1 addition & 0 deletions CICDPackageLocation/gitinclude.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gitinclude
180 changes: 110 additions & 70 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@

# TELBlazor
TEL Blazor Component Library Package

# This ReadMe

This readme is the repo readme, it is also used as the package readme as this is the solution for making the TELBlazor.Components package.
There is also a cicd readme in the workflow folder.

The [MVCBlazor repo ](https://github.com/TechnologyEnhancedLearning/MVCBlazor) readme has exploration of various of the choices and alternatives to what is implemented here. And the other blazor repos may
also be a useful resource when developing for this repo.

# Purpose

Progressive components, that use the server prerendering in Global Wasm Blazor to ensure that if the user has no JS they will get html. And that html can be created to have working post actions.
The render cycle will hydrate the prerender and the post actions will be overrided by services injected in the components.
It is client side so the users browser will do the work.



# Links

Expand All @@ -34,80 +42,112 @@ It is client side so the users browser will do the work.

# Set Up

## How to set up this solution locally
*Be aware wasm wwwroot appsettings are public*
- TELBlazor\TELBlazor.Components.ShowCase.E2ETests\bin\Debug\net8.0\playwright.ps1 need to be run as admin
- local hook for commits, recommended for pre commit, and pre push as can only check the commit name value post commit
## "It works on my machine"
qqqq run release first make branch for kevin
### Hi Kevin, Please rewrite or correct these steps.
- im expecting ome global node may end up not working if anything as its already set up on my machine

### Steps

#### Get the repo
1. Go to [TELBlazor Repo](https://github.com/TechnologyEnhancedLearning/TELBlazor) hit code and get the clone string
1. Clone the repo locally
1. Go to [TELBlazor Repo](https://github.com/TechnologyEnhancedLearning/TELBlazor)
- create a branch (**there is branch name checks in cicd**) so for example call it "docs-readme-setup-instructions"
- [branch lint rule](https://github.com/TechnologyEnhancedLearning/TELBlazor/blob/master/.releaserc.json)
- you commits will look like this "docs(readme): added detail on commit rules"
1. Fetch, and checkout your new branch locally so you can add to the readme as you go
- create commit "docs(readme): first commit"
- see [commit rules](https://github.com/TechnologyEnhancedLearning/TELBlazor/blob/master/.commitlintrc.json)
- *these rules also enable the versioning in cicd*
- Bonus dont wait for the pipeline to fail your commit names and expose your secrets: you may want to add
- gitguardian from confluence docs (follow it to the letter) [gitguardian global setup instructions](https://hee-tis.atlassian.net/wiki/spaces/TP/pages/3855253505/GitGuardian+Setup+-+Simplified+Version)
- and add a pre-commit and push hook (you need both as you cannot lint what hasnt yet been commit) you add these to your templates if you want them for every repo, or just to this repo, or you can be lazy and add them into the gitguardian hook
- ```
#### --- Commitlint Logic (force local config) ---
REPO_ROOT=$(git rev-parse --show-toplevel)
CONFIG_PATH="$REPO_ROOT/.commitlintrc.json"
echo "COMMIT_MSG_FILE is one msg behind it is only set to the commit your trying to commit after the commit succeeds so this script is one behind"
echo "so would work best in prepush template"
COMMIT_MSG_FILE="$REPO_ROOT/.git/COMMIT_EDITMSG"

# Check if the local .commitlintrc.json exists in the repository root
if [ -f "$CONFIG_PATH" ]; then

echo "✅ Local .commitlintrc.json found at: $CONFIG_PATH. Running commitlint..."
echo "⚠️ if commit lint fails in precommit its actually reading previous commit name you need to reset or squash make a new commit and change .git/COMMIT_EDITMSG to something that would pass. ⚠️"

if command -v npx &> /dev/null; then

cd "$REPO_ROOT" || exit 1

# Debug: Print the commit message file content
if [ -f "$COMMIT_MSG_FILE" ]; then
echo "Commit message content:"
cat "$COMMIT_MSG_FILE"
else
echo "❌ Commit message file not found!"
exit 1
fi


# Run commitlint, explicitly pointing to the local config and providing the commit message via stdin
OUTPUT1=$(npx.cmd --no -- commitlint --config=".commitlintrc.json" --edit="$COMMIT_MSG_FILE" 2>&1)

EXIT_CODE1=$?
# echo "!!!!!!!!!!! OUTPUT1"
# echo "$OUTPUT1"


# OUTPUT2=$(npx.cmd --no -- commitlint --config=".commitlintrc.json" --from=origin/master --to=HEAD 2>&1)

# EXIT_CODE2=$?
# echo "!!!!!!!!!!! OUTPUT2"
# echo "$OUTPUT2"

# OUTPUT3=$(npx.cmd --no -- commitlint --config=".commitlintrc.json" --from-last-tag 2>&1)


# EXIT_CODE3=$?
# echo "!!!!!!!!!!! OUTPUT3"
# echo "$OUTPUT3"



#if [ "$EXIT_CODE1" -ne 0 ] || [ "$EXIT_CODE2" -ne 0 ] || [ "$EXIT_CODE3" -ne 0 ]; then
if [ "$EXIT_CODE1" -ne 0 ]; then
echo "❌ Commitlint failed:"

echo "$OUTPUT1"
exit 1
else
echo "✅ Commitlint passed!"
fi
else
echo "⚠️ npx not found. Please ensure Node.js and npm are installed to use commitlint."
# Optionally fail here
# exit 1
fi
else
echo "ℹ️ No local .commitlintrc.json found in $REPO_ROOT. Skipping commitlint."
fi
```
### Install packages

```
# --- Commitlint Logic (force local config) ---
REPO_ROOT=$(git rev-parse --show-toplevel)
CONFIG_PATH="$REPO_ROOT/.commitlintrc.json"
echo "COMMIT_MSG_FILE is one msg behind it is only set to the commit your trying to commit after the commit succeeds so this script is one behind"
echo "so would work best in prepush template"
COMMIT_MSG_FILE="$REPO_ROOT/.git/COMMIT_EDITMSG"
### Create local files

# Check if the local .commitlintrc.json exists in the repository root
if [ -f "$CONFIG_PATH" ]; then
### Set local environment variables

echo "✅ Local .commitlintrc.json found at: $CONFIG_PATH. Running commitlint..."
echo "⚠️ if commit lint fails in precommit its actually reading previous commit name you need to reset or squash make a new commit and change .git/COMMIT_EDITMSG to something that would pass. ⚠️"
### Run tests



### How to set up this solution locally
*Be aware wasm wwwroot appsettings are public*
- TELBlazor\TELBlazor.Components.ShowCase.E2ETests\bin\Debug\net8.0\playwright.ps1 need to be run as admin
- local hook for commits, recommended for pre commit, and pre push as can only check the commit name value post commit

if command -v npx &> /dev/null; then

cd "$REPO_ROOT" || exit 1

# Debug: Print the commit message file content
if [ -f "$COMMIT_MSG_FILE" ]; then
echo "Commit message content:"
cat "$COMMIT_MSG_FILE"
else
echo "❌ Commit message file not found!"
exit 1
fi


# Run commitlint, explicitly pointing to the local config and providing the commit message via stdin
OUTPUT1=$(npx.cmd --no -- commitlint --config=".commitlintrc.json" --edit="$COMMIT_MSG_FILE" 2>&1)

EXIT_CODE1=$?
# echo "!!!!!!!!!!! OUTPUT1"
# echo "$OUTPUT1"


# OUTPUT2=$(npx.cmd --no -- commitlint --config=".commitlintrc.json" --from=origin/master --to=HEAD 2>&1)

# EXIT_CODE2=$?
# echo "!!!!!!!!!!! OUTPUT2"
# echo "$OUTPUT2"

# OUTPUT3=$(npx.cmd --no -- commitlint --config=".commitlintrc.json" --from-last-tag 2>&1)


# EXIT_CODE3=$?
# echo "!!!!!!!!!!! OUTPUT3"
# echo "$OUTPUT3"



#if [ "$EXIT_CODE1" -ne 0 ] || [ "$EXIT_CODE2" -ne 0 ] || [ "$EXIT_CODE3" -ne 0 ]; then
if [ "$EXIT_CODE1" -ne 0 ]; then
echo "❌ Commitlint failed:"

echo "$OUTPUT1"
exit 1
else
echo "✅ Commitlint passed!"
fi
else
echo "⚠️ npx not found. Please ensure Node.js and npm are installed to use commitlint."
# Optionally fail here
# exit 1
fi
else
echo "ℹ️ No local .commitlintrc.json found in $REPO_ROOT. Skipping commitlint."
fi
```
- open powershell admin
- go to e2e project bin/Debug/net8
- run the playwright script with "install"
Expand Down