Compare commits

..

6 Commits

Author SHA1 Message Date
7feb0fc694 Add manual trigger to ValidateBranchName workflow
- Included `workflow_dispatch` event in GitHub Actions
- Allows for manual execution of the ValidateBranchName workflow
2024-08-23 21:29:14 +02:00
ea2383234f Add branch name validation configuration
- **Added** `.github/config.conf` for branch name prefixes configuration
- **Updated** `ValidateBranchName.yml` to read and utilize branch name prefixes from the config file
2024-08-23 21:28:22 +02:00
Max P.
a490ea980a Revert "feat: Update Identifier documentation in TypeScript"
This reverts commit 6e6a521c1f.
2024-08-23 21:23:56 +02:00
Max P.
d69eacf9be Revert "docs: Add Identifiers Changelog entry"
This reverts commit 099c8dbfa3.
2024-08-23 21:23:56 +02:00
099c8dbfa3 docs: Add Identifiers Changelog entry 2024-08-23 19:24:47 +02:00
6e6a521c1f feat: Update Identifier documentation in TypeScript 2024-08-23 19:24:47 +02:00
4 changed files with 30 additions and 38 deletions

2
.github/config.conf vendored Normal file
View File

@@ -0,0 +1,2 @@
[branch_validation]
valid_prefixes = feature/,fix/,refactoring/,testing/,dependabot/,gh-pages

View File

@@ -4,6 +4,7 @@ on:
pull_request:
branches:
- main
workflow_dispatch: # Allows manual execution of the workflow.
jobs:
validate-branch-name-on-pull-request:
@@ -13,11 +14,27 @@ jobs:
- name: Check out repository
uses: actions/checkout@v2
- name: Read Config File
id: config
run: |
VALID_PREFIXES=$(grep 'valid_prefixes' .github/config.conf | cut -d '=' -f2 | tr -d ' ')
echo "VALID_PREFIXES=$VALID_PREFIXES" >> $GITHUB_ENV
- name: Validate Branch Name on Pull Request
run: |
BRANCH_NAME=${GITHUB_HEAD_REF}
if [[ ! "$BRANCH_NAME" =~ ^(feature\/|fix\/|refactoring\/|testing\/|dependabot\/|gh-pages) ]]; then
BRANCH_NAME=${{ github.head_ref }}
VALID_PREFIXES_ARRAY=(${VALID_PREFIXES//,/ })
VALID=false
for PREFIX in "${VALID_PREFIXES_ARRAY[@]}"; do
if [[ "$BRANCH_NAME" =~ ^$PREFIX ]]; then
VALID=true
break
fi
done
if [ "$VALID" = false ]; then
echo "Invalid branch name: $BRANCH_NAME"
echo "Branch name must start with 'feature/', 'fix/', 'refactoring/', 'testing/', dependabot/" or "gh-pages"
echo "Branch name must start with one of the following prefixes: $VALID_PREFIXES"
exit 1
fi

View File

@@ -9,9 +9,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- feat: Add a full description of `Identifiers` as JSDoc comment.
This establishes the definition of what an `Identifiers` is.
### Deprecated

View File

@@ -1,35 +1,11 @@
/**
* ## The dependency identifier
*
* You can use any string or Symbol as identifier. The identifier is used to
* register a class in the TSinjex DI (Dependency Injection) container.
* See **Hierarchical identifiers** for more information on `.` in identifiers.
*
* ### Hierarchical identifiers
* To create hierarchical identifiers, you can use a dot `.` as a separator.
* E.g. `Parent.Child` or `Parent.Child.Grandchild`.
*
* ### Merge functionality
* You can merge multiple dependencies into one by resolving them with
* a identifier that is a prefix of the actual identifiers.
* E.g. `Parent` resolves `Parent.*` and returns a mixin of all children.
* Merging will only work, if the main identifier is not registered.
* Grandchildren are not included in the mixin but you can use something like
* `Parent.Child.Grandchild` to merge all direct children of Grandchild,
* e.g. `Parent.Child.Grandchild.*`.
* If you don't want to allow merging, you must register the dependencies
* with the full identifier. E.g. `Parent` or `Parent.Child.Grandchild`.
*
* ### Naming convention
* The name of a dependency should generally correspond to the interface that is implemented.
* E.g. a class `ClassA` that implements the interface `IClassA` and is registered
* as a dependent class is registered under the interface name `IClassA`.
*
* The mixin parts of the class are registered under the interface name `IClassA.*`.
* E.g. `IClassA.IClassZ`, `IClassA.IClassY`, etc.
*
* #### Static/Constructor Identifier naming
* The identifier for a static or constructor dependency should be the same as the class name
* postfixed with `_`. E.g. `IClassA_` for the the static or constructor interface of class `IClassA`.
* The dependency identifier.
* You can use any string as identifier.
* To create order, it is also possible to
* provide these with a separator: `GroupA.ClassZ`.
* The convection for naming is as follows:
* The name should generally correspond to the interface that is relevant.
* I.e. a class `ClassA` that implements the interface `IClassA` and is
* registered as a dependent class is registered under the interface name `IClassA`.
*/
export type Identifier = string | symbol;