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

📃New Blog Post - Velaptor v1.0.0-preview.36 Release #83

Merged
merged 11 commits into from
May 5, 2024
4 changes: 2 additions & 2 deletions .vscode/mdx-snippets.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"scope": "mdx",
"prefix": "section",
"body": [
"## <span class=\"color-section\">${1: description}</span>\n\n$3"
"## <span className=\"color-section\">${1: description}</span>\n\n$3"
],
"description": "Section"
},
Expand All @@ -68,7 +68,7 @@
"scope": "mdx",
"prefix": "sub-section",
"body": [
"### <span class=\"color-sub-section\">${1: description}</span>\n\n$3"
"### <span className=\"color-sub-section\">${1: description}</span>\n\n$3"
],
"description": "Sub Section"
},
Expand Down
42 changes: 21 additions & 21 deletions blog/2023-07-10-deno-cicd/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import JoinComm from "@site/src/components/JoinComm";

</div>

## <span class="color-section">Intro</span>
## <span className="color-section">Intro</span>

A lot of us just want to work on our core project and not have to worry about things like
documentation, workflows, status checks, and a readme file, right? I can empathize with that!!
Expand All @@ -35,7 +35,7 @@ However, one thing that I've used to help with CICD recently is **Deno** and I t
a game changer!


## <span class="color-section">What is Deno?</span>
## <span className="color-section">What is Deno?</span>

If you know what **NodeJS** is, then the concept is the same. **Deno** is a secure runtime for
**JavaScript** and **TypeScript** built with <URL link="www.rust-lang.org/" text="Rust"/> and is the predecessor to **NodeJS**. It's built by the
Expand All @@ -48,7 +48,7 @@ Check out **Deno** at <URL link="deno.land"/>.
:::


## <span class="color-section">Some Deno benefits</span>
## <span className="color-section">Some Deno benefits</span>

One thing that makes **Deno** awesome is the ability to execute scripts directly from the
web using a URL. That's right! You can execute a script directly from the web without
Expand All @@ -74,7 +74,7 @@ Using these scripts hasn't only made my pipelines reusable and reliable but has
made them quick and easy to develop and maintain.


## <span class="color-section">So how do you do use Deno for CICD?</span>
## <span className="color-section">So how do you do use Deno for CICD?</span>

There are different ways to go about it depending on your needs. You can host the **Deno**
scripts alongside your project or in a central location like another repository. I have done both with no problems
Expand All @@ -92,20 +92,20 @@ If you want to check out some of my scripts or **GitHub** workflows that are use
Now that I've sold you on **Deno** 😉, let's create a status check workflow that executes a **Deno**
script and validates that your pull request head branch is valid.

## <span class="color-section">Project setup</span>
## <span className="color-section">Project setup</span>

### <span class="color-sub-section">1. Create or choose repo</span>
### <span className="color-sub-section">1. Create or choose repo</span>
Create a new or choose an already existing **GitHub** repository.

### <span class="color-sub-section">2. Create new folder & script file</span>
### <span className="color-sub-section">2. Create new folder & script file</span>
In the root of your repository (or location of your choice), create a folder called _**cicd**_, then
inside that folder, create a file called _**validate-feature-branch.ts**_.

:::note Script location
It does not matter where you put your scripts. That is up to you and your needs.
:::

## <span class="color-section">Add arg validation</span>
## <span className="color-section">Add arg validation</span>
Add the following code to check that a single argument is being passed into the script from the workflow.

``` ts
Expand All @@ -124,7 +124,7 @@ If zero or more than one argument has been passed in, the script will exit with
Using the `Deno.exit()` function with any number argument greater than zero will fail the **GitHub** workflow.


## <span class="color-section">Branch name and regex</span>
## <span className="color-section">Branch name and regex</span>
We can use some handy regex to validate whether or not the name of the branch meets our branch
naming requirements. Add the following lines of code to get the argument value and some regex to use for validation.

Expand All @@ -141,7 +141,7 @@ const branchName = Deno.args[0].trim();
```


## <span class="color-section">Checking the branch name</span>
## <span className="color-section">Checking the branch name</span>

Now that we have our branch name and some regex to use for validation, add the following _`if..else`_ block.
The workflow will pass or fail based on whether or not the branch name meets the validation requirements dictated by
Expand All @@ -166,24 +166,24 @@ Click <URL link="docs.github.com/en/actions/using-workflows/workflow-commands-fo
:::


## <span class="color-section">Creating a workflow</span>
## <span className="color-section">Creating a workflow</span>

:::note GitHub workflows
If you are unfamiliar with **GitHub** workflows, check out the <URL link="docs.github.com/en/actions/learn-github-actions/introduction-to-github-actions" text="GitHub Workflow Docs"/>.
:::

Now that we have our script, we can create a workflow that will execute the script. Follow the steps below:

### <span class="color-sub-section">1. Create workflow folders</span>
### <span className="color-sub-section">1. Create workflow folders</span>

If these folders don't already exist, create a folder with the name _**.github**_ in the root of the repository
and then create a folder named _**workflows**_ inside the _**.github**_ folder.

### <span class="color-sub-section">2. Create workflow file</span>
### <span className="color-sub-section">2. Create workflow file</span>

In the _**.github/workflows**_ folder, create a file with the name _**branch-status-check.yml**_.

### <span class="color-sub-section">3. Basic workflow structure</span>
### <span className="color-sub-section">3. Basic workflow structure</span>

We'll give our workflow some basic structure like the workflow name, a pull request trigger, and a job with a step.
The first step will be the checkout action which is required to get access to the script file
Expand Down Expand Up @@ -211,7 +211,7 @@ I use '✅' for status checks and '🚀' for releases. You can of course can do
:::


### <span class="color-sub-section">4. Setup Deno</span>
### <span className="color-sub-section">4. Setup Deno</span>

The **Deno** team has an action in the marketplace for making it easy to install **Deno** in the **GitHub** runner which is required
before you execute any **Deno** commands. The good thing about **Deno** is that it's super small, cross-platform, and
Expand All @@ -226,7 +226,7 @@ Add the following step to the workflow below the checkout step to set up Deno.
deno-version: v1.x.x
```

### <span class="color-sub-section">5. Add script execution step</span>
### <span className="color-sub-section">5. Add script execution step</span>

Now that we have **Deno** set up, we can execute our script. Add the following step to the workflow below the **Deno** setup step.

Expand Down Expand Up @@ -263,14 +263,14 @@ Go to the <URL link="docs.deno.com/runtime/manual/basics/permissions" text="Deno

That's it!! Very simple and the only limit is your imagination!!

## <span class="color-section">Summary</span>
## <span className="color-section">Summary</span>

Deno is a great option for creating utility scripts for whatever your needs are. It can be
local scripts on your machine to help automate your development workflow, scripts to
do simple tasks in a project such as cleanup, or this case, for **GitHub** workflows to help automate
your CICD process. I have personally been using this all over my organization and it's been a wonderful experience!!

## <span class="color-section">Resources</span>
## <span className="color-section">Resources</span>

- <URL link="https://deno.land/" text="Deno"/>

Expand All @@ -282,7 +282,7 @@ your CICD process. I have personally been using this all over my organization a
- <URL link="regex101.com/" text="Regex101"/>
- <URL link="www.rust-lang.org/" text="Rust"/>

<details closed>
<details closed="true">
<summary>Full TypeScript Source</summary>

```ts
Expand All @@ -306,7 +306,7 @@ if (branchNameRegEx.test(branchName)) {
```
</details>

<details closed>
<details closed="true">
<summary>Full Workflow Source</summary>

```yml
Expand Down Expand Up @@ -337,6 +337,6 @@ jobs:
If you have any questions, want to chat, or contribute to any of my open-source projects, feel free to reach out
to me on our discord channel or X located at the top right.

## <span class="color-section">Join Our Community</span>
## <span className="color-section">Join Our Community</span>

<JoinComm />
4 changes: 2 additions & 2 deletions news/2023-09-25-added-funding/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ If you are interested in contributing and helping us advance our projects, you c

Your support is greatly appreciated! 🙏🏻

## <span class="color-section">Join Our Community</span>
## <span className="color-section">Join Our Community</span>

<JoinComm />@site/src/components/GHProj@site/src/components/GHUrl
<JoinComm />
24 changes: 12 additions & 12 deletions news/2024-01-16-vel-release/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ A quick thanks to the following contributors for their contributions to this rel
{/*truncate*/}


## <span class="color-section">Quick Overview</span>
## <span className="color-section">Quick Overview</span>

This release of **Velaptor** brings you the following:

Expand All @@ -37,7 +37,7 @@ This release of **Velaptor** brings you the following:
6. Internal dependency updates.


## <span class="color-section">Perf Improvements</span>
## <span className="color-section">Perf Improvements</span>

<Image url="https://media.giphy.com/media/fBEMsUeGHdpsClFsxM/giphy.gif"/>

Expand All @@ -53,17 +53,17 @@ Please note that even the smallest performance improvements can accumulate over
a significantly smoother and faster gaming experience. Stay tuned as we will as we continue to
enhance _**Velaptor’s**_ performance!

## <span class="color-section">Mocking Library Migration</span>
## <span className="color-section">Mocking Library Migration</span>

This is not going to affect any users of **Velaptor**, but this will affect contributors and maintainers.

### <span class="color-sub-section">Migration Details</span>
### <span className="color-sub-section">Migration Details</span>

This is related to refactoring all of our unit test code from using the <GHProj owner="devlooped" projName="moq"/>
library to the [NSubstitute](https://nsubstitute.github.io/) library. This is going to take a while but all of
the issues related to this are created and ready to go. We will be working on releasing at least one of these issues or more per release.

### <span class="color-sub-section">Rationale Behind the Migration</span>
### <span className="color-sub-section">Rationale Behind the Migration</span>


The decision to migrate from _**Moq**_ to _**NSubstitute**_ is influenced by several factors.
Expand All @@ -88,7 +88,7 @@ However, it’s important to note that the decision to switch was not solely bas
There are multiple reasons, all aimed at improving the quality and maintainability of _**Velaptor**_.


## <span class="color-section">Deprecated UI Usage Removal</span>
## <span className="color-section">Deprecated UI Usage Removal</span>

We deprecated the _**Velaptor UI Control API**_ in the last release which was version _**v1.0.0-preview.31**_.

Expand All @@ -110,7 +110,7 @@ With the replacement of the UI API with ImGui.NET in the _**VelaptorTesting**_ p
remove the deprecated control UI API from the _**Velaptor**_ codebase when the time is right.


### <span class="color-sub-section">Reasons for deprecation</span>
### <span className="color-sub-section">Reasons for deprecation</span>

The decision to deprecate the _**Velaptor**_ UI Control API was a significant one that I’ve been contemplating for some time.
This API, which enables the creation of UI controls like buttons and text boxes, proved to be quite labor-intensive during its development.
Expand All @@ -126,7 +126,7 @@ Given these considerations, I decided it would be best to deprecate the UI Contr
This decision allows us to focus on enhancing the core functionalities of Velaptor.
However, this doesn’t rule out the possibility of revisiting this direction in the future.

### <span class="color-sub-section">Timeline for full removal?</span>
### <span className="color-sub-section">Timeline for full removal?</span>

While the Velaptor UI Control API is currently deprecated, it remains functional. As you continue to use the API,
you’ll notice deprecation warnings in your preferred IDE or text editor.
Expand All @@ -143,7 +143,7 @@ We recommend updating your code as soon as possible.
:::


## <span class="color-section">Bug Squashing!!</span>
## <span className="color-section">Bug Squashing!!</span>

Let’s be honest, there’s a certain satisfaction in squashing bugs, especially during development.
It’s like getting a bonus when you discover a bug while working on something else.
Expand All @@ -160,7 +160,7 @@ of the game object using the `Window.Dispose()` method. One might wonder, why wo
the bug is now fixed. If you attempt to do this, you will receive a proper `ObjectDisposedException` message.


## <span class="color-section">Dependency Updates</span>
## <span className="color-section">Dependency Updates</span>

We keep our dependencies up to date as much as possible. This release is no different.

Expand All @@ -169,7 +169,7 @@ We keep our dependencies up to date as much as possible. This release is no diff
2. SixLabors.ImageSharp updated from _**v3.1.1**_ to _**v3.1.2**_.
- This is used for loading image data from disk before being uploaded to the GPU.

## <span class="color-section">Wrap Up!!</span>
## <span className="color-section">Wrap Up!!</span>

Well, that is it for the release!! If you want to know more details of the changes of any release,
it is all public and open source!!
Expand All @@ -182,6 +182,6 @@ Until the next release!!

<Image url="https://media.giphy.com/media/rHR8qP1mC5V3G/giphy.gif"/>

## <span class="color-section">Join Our Community</span>
## <span className="color-section">Join Our Community</span>

<JoinComm />
2 changes: 1 addition & 1 deletion news/2024-04-17-casl-release/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,6 @@ for trying out the different features from a non-code perspective.

That's it for this release!! Enjoy!!

## <span class="color-section">Join Our Community</span>
## <span className="color-section">Join Our Community</span>

<JoinComm />
Loading
Loading