Daily Post Image from Upsplash

April: 01

Notes

2024

Docker

Getting the express-colyseus-discord build operation on the portainer will be the goal for today! This includes having an endpoint for the portainer communication, which would include the deployment of any changes via github actions. We need to keep track of the X, Y, Z and maybe a couple other variables in a 3D space?

The next variable that I will be adding is the action, which is a string for now! This is just extending the TPlayerOptions with action and then defining the action as a type string.


LCAgents

We want to move the changes for LC Agents outside of the ci-alpha and towards the ci-main, so that we can keep the changes in order! After moving it towards the main branch, we can extend out the iOS and Android build process for Expo, now we need to make sure that the current flow will work. We might also want to automate the pull requests that it makes on the LC Agents repo as well, hmm.

Here is the pipeline that we are migrating with this push:


        expo-lcagents-web-build:
            needs: ['alter']
            name: Expo LC Agents We Build
            runs-on: ubuntu-latest
            if: needs.alter.outputs.expolcagents == 'true'
            steps:
                -   name: Checkout repository
                    uses: actions/checkout@v4

                -   name: Setup NodeJS
                    uses: actions/setup-node@v3
                    with:
                        node-version: 18

                -   name: Setup PNPM
                    uses: pnpm/action-setup@v3
                    with:
                        version: 8
                        run_install: false
                
                -   name: Install react-native-cli globally
                    run: pnpm add -g react-native-cli
                      
                -   name: Install dependencies
                    run: pnpm install

                -   name: Setup Watchman (if applicable)
                    run: |
                        sudo apt-get update
                        sudo apt-get install -y watchman
                        watchman --version

                -   name: NX Command
                    shell: bash
                    continue-on-error: true
                    run: |
                        pnpm nx run expo-lcagents:export --verbose    

                -   name: NX Command - 2
                    shell: bash
                    continue-on-error: true
                    run: |
                        pnpm nx run expo-lcagents:export --verbose 

                -   name: LCA Expo Build
                    uses: ./.github/actions/kbve-shell
                    with:
                        flag: '-nx expo-lcagents:export'
                        create_pull_request: false
                        github_token: ${{ secrets.GITHUB_TOKEN }}

                -   name: Create .nojekyll file
                    run: |
                          mkdir -p dist/apps/expo-lcagents/
                          touch dist/apps/expo-lcagents/.nojekyll
                          
                -   name: Create CNAME file
                    run: |
                            mkdir -p dist/apps/expo-lcagents/
                            echo "lc-agents.com" > dist/apps/expo-lcagents/CNAME
            
                -   name: LC Agents -> Deployment
                    uses: dobbelina/copy_file_to_another_repo_action@main
                    env:
                        API_TOKEN_GITHUB: ${{ secrets.UNITY_PAT }}
                    with:
                        source_file: 'dist/apps/expo-lcagents/'
                        destination_repo: 'kbve/lc-agents.com'
                        destination_folder: '/docs'
                        destination_branch: 'main'
                        destination_branch_create: 'patch-kbve-lcagents-deploy'
                        user_email: '[email protected]'
                        user_name: 'h0lybyte'
                        commit_message: ${{ github.event.head_commit.message }}
                        rsync_option: "-avrh --delete"


Pipeline

Under the beta branch, we can extend out integration testing, something that I can plan around this month. We will start with the kbve.com repo , which will just build the site, making sure that it runs? The other idea would be to deploy the beta of the website to beta.kbve.com, as an additional metric, but that might be something we can look into within the future.

We will be using the any_changed to calculate any of the files that are changed.


LC Agents

Here is the older code block for the LC Agents Expo application.


import { registerRootComponent } from 'expo';

import { ExpoRoot } from 'expo-router';
import 'expo-router/entry';
import BaseApp from './src/app/_layout';



// The ExpoRoot component requires a React element, not a component class or function directly.
// Therefore, we create a simple wrapper component that returns BaseApp.
function AppWrapper() {
  return <BaseApp />;
}

// Pass the wrapper component to ExpoRoot.
// ExpoRoot will take care of rendering your application within the Expo environment,
// ensuring that routing and other setup is handled correctly.
//registerRootComponent();

//ExpoRoot(<AppWrapper />);

// 03-27-2024 Changes


export function App() {
   const ctx = require.context('./src/app');
   return <ExpoRoot context={ctx} />;
}

registerRootComponent(App);


// Create a new component that renders ExpoRoot with AppWrapper.
// This component will be the entry point of your application.
// function RootComponent() {
//   return ExpoRoot(<AppWrapper />);
// }

// registerRootComponent(RootComponent);

However there are a couple errors that are appearing in the source code, including this one:

You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it.

So there might be an issue with how we are doing the root / application rendering.