Skip to content

Commit

Permalink
Angular: patched latest workspace updates
Browse files Browse the repository at this point in the history
Since the workspace was successfully deployed for Holloway's
client and successfully internalized, we can patch the latest
workspace updates back here. Hence, let's do this.

This pathc patches latest workspace udpates into Angular/
directory.

Co-authored-by: Shuralyov, Jean <jean.shuralyov@proton.me>
Co-authored-by: Galyna, Cory <cory.galyna@gmail.com>
Co-authored-by: (Holloway) Chew, Kean Ho <me@hollowaykeanho.com>
Signed-off-by: (Holloway) Chew, Kean Ho <me@hollowaykeanho.com>
  • Loading branch information
3 people committed Dec 17, 2024
1 parent 0b40dd2 commit 2c5fadb
Show file tree
Hide file tree
Showing 25 changed files with 416 additions and 73 deletions.
2 changes: 1 addition & 1 deletion Angular/.ci/build_windows-any.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if ($___process -ne 0) {
$null = I18N-Build "${env:PROJECT_ANGULAR}"
$__current_path = Get-Location
$null = Set-Location "${env:PROJECT_PATH_ROOT}\${env:PROJECT_ANGULAR}"
$___process = OS-Exec "./build.sh.ps1"
$___process = OS-Exec ".\build.sh.ps1"
$null = Set-Location "${__current_path}"
$null = Remove-Variable __current_path
if ($___process -ne 0) {
Expand Down
22 changes: 11 additions & 11 deletions Angular/.ci/clean_unix-any.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# Copyright 2024 (Holloway) Chew, Kean Ho <hollowaykeanho@gmail.com>
# Copyright 2023 (Holloway) Chew, Kean Ho <hollowaykeanho@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
Expand All @@ -20,21 +20,21 @@ if [ "$PROJECT_PATH_ROOT" = "" ]; then
return 1
fi

. "${LIBS_AUTOMATACI}/services/io/fs.sh"
. "${LIBS_AUTOMATACI}/services/i18n/translations.sh"




# execute
__current_path="$PWD"
cd "${PROJECT_PATH_ROOT}/${PROJECT_ANGULAR}"

FS_Remove_Silently "dist"
FS_Remove_Silently "node_modules"
FS_Remove_Silently ".angular"

cd "$__current_path"
unset __current_path
I18N_Build "$PROJECT_ANGULAR"
__current_path="$PWD" && cd "${PROJECT_PATH_ROOT}/${PROJECT_ANGULAR}"
./clean.sh.ps1
___process=$?
cd "$__current_path" && unset __current_path
if [ $___process -ne 0 ]; then
I18N_Build_Failed
return 1
fi



Expand Down
18 changes: 10 additions & 8 deletions Angular/.ci/clean_windows-any.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 (Holloway) Chew, Kean Ho <hollowaykeanho@gmail.com>
# Copyright 2023 (Holloway) Chew, Kean Ho <hollowaykeanho@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
Expand All @@ -19,21 +19,23 @@ if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) {
return 1
}

. "${env:LIBS_AUTOMATACI}\services\io\fs.ps1"
. "${env:LIBS_AUTOMATACI}\services\io\os.ps1"
. "${env:LIBS_AUTOMATACI}\services\i18n\translations.ps1"




# execute
$null = I18N-Build "${env:PROJECT_ANGULAR}"
$__current_path = Get-Location
$null = Set-Location "${env:PROJECT_PATH_ROOT}\${env:PROJECT_ANGULAR}"

$null = FS-Remove-Silently "dist"
$null = FS-Remove-Silently "node_modules"
$null = FS-Remove-Silently ".angular"

$null = Set-Location "${__current_path}"
$___process = OS-Exec ".\clean.sh.ps1"
$null = Set-Location $__current_path
$null = Remove-Variable __current_path
if ($___process -ne 0) {
$null = I18N-Build-Failed
return 1
}



Expand Down
2 changes: 1 addition & 1 deletion Angular/.ci/prepare_unix-any.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fi

I18N_Import_Dependencies
__current_path="$PWD" && cd "${PROJECT_PATH_ROOT}/${PROJECT_ANGULAR}"
npm install
./setup.sh.ps1
___process=$?
cd "$__current_path" && unset __current_path
if [ $___process -ne 0 ]; then
Expand Down
2 changes: 1 addition & 1 deletion Angular/.ci/prepare_windows-any.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if ($___process -ne 0) {
$null = I18N-Import-Dependencies
$__current_path = Get-Location
$null = Set-Location "${env:PROJECT_PATH_ROOT}\${env:PROJECT_ANGULAR}"
$___process = OS-Exec "npm" "install"
$___process = OS-Exec "powershell" ".\setup.sh.ps1"
$null = Set-Location "${__current_path}"
$null = Remove-Variable -Name __current_path
if ($___process -ne 0) {
Expand Down
14 changes: 9 additions & 5 deletions Angular/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,19 @@ services/HestiaSOCIAL/
# (1) These are auto-generated asset files. Leave them as it is in order to #
# maintain good and proper performance. #
################################################################################
assets/.nojekyll
assets/CNAME
assets/browserconfig.xml
assets/manifest.webmanifest
assets/robots.txt
assets/CNAME
assets/sitemaps
assets/sitemap.xml
assets/sitemaps/
assets/robots.txt
assets/browserconfig.xml
assets/.nojekyll
services/app/root.html
services/app/.root.html
dist/
.angular/
node_modules/
coverage/



Expand Down
24 changes: 14 additions & 10 deletions Angular/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,28 +48,32 @@ $ cd Angular/
# (2) run any of the following matching your intention:
$ ./setup.sh.ps1 # for setup
$ ./serve.sh.ps1 # for development
$ ./test.sh.ps1 # for test run
$ ./test.sh.ps1 # for test
$ ./build.sh.ps1 # for build
$ ./watch.sh.ps1 # for watch
$ ./clean.sh.ps1 # for clean up
```

This is mainly due to Angular does not have any pre-initialization function
to update critical SEO files generations autonomously & dynamically. Affected
files are:

* `assets/browserconfig.xml`
* `assets/manifest.webmanifest`
* `assets/CNAME`
* `assets/.nojekyll`
* `assets/sitemaps`
* `assets/sitemap.xml`
* `assets/robots.txt`
* `assets/manifest.webmanifest`
* `assets/browserconfig.xml`
* `assets/.nojekyll`
* `services/app/root.html`

This includes the `index.html` (`services/app/root.html`) that `angular.json`
depends on. To workaround this issue, a 2-steps execution is done using the
Shell (and PowerShell on Windows) scripts where Stage-1 is to prepare these
criticaly files dynamically while Stage-2 is your designated execution.
This includes the `index.html` main template file (`services/app/root.html`)
that `angular.json` uses. To workaround this issue, a 2-steps execution is
done using the Shell (and PowerShell on Windows) scripts where Stage-1 is to
prepare these criticaly files dynamically while Stage-2 is your designated
execution.

Those shell scripts are Polygot in nature so the same script works on both
UNIX and Windows OSes natively.
Expand Down Expand Up @@ -165,8 +169,8 @@ The `services/app/root.html` (main template file) is dynamically generated
in Stage-1 execution with the site-level thumbnails meta included.

Currently, Angular updates the meta tags dynamically using `Meta` and `Title`
services from `@angular/platform-browser` library. There is no way to statically
generate/patch the output `index.html` file yet.
services from `@angular/platform-browser` library. There is no way to
statically generate/patch the output `index.html` file yet.

Recommended media dimension would be:

Expand Down
48 changes: 48 additions & 0 deletions Angular/clean.sh.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
echo \" <<'RUN_AS_BATCH' >/dev/null ">NUL "\" \`" <#"
@ECHO OFF
REM LICENSE CLAUSES HERE
REM ----------------------------------------------------------------------------
REM ############################################################################
REM # Windows BATCH Codes #
REM ############################################################################
echo "[ ERROR ] --> powershell.exe !!!"
exit /b 1
REM ############################################################################
REM # Windows BATCH Codes #
REM ############################################################################
RUN_AS_BATCH
#> | Out-Null




echo \" <<'RUN_AS_POWERSHELL' >/dev/null # " | Out-Null
################################################################################
# Windows POWERSHELL Codes #
################################################################################
${env:WORKSPACE_ROOT} = Get-Location
$___process = . "${env:WORKSPACE_ROOT}\services\app\shell\clean.ps1"
################################################################################
# Windows POWERSHELL Codes #
################################################################################
exit $___process
<#
RUN_AS_POWERSHELL
################################################################################
# Unix Main Codes #
################################################################################
WORKSPACE_ROOT="$PWD"
. "${WORKSPACE_ROOT}/services/app/shell/clean.sh"
################################################################################
# Unix Main Codes #
################################################################################
exit $?
#>
2 changes: 1 addition & 1 deletion Angular/contents/404/page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { TestBed } from '@angular/core/testing';



describe('Page_Lang', () => {
describe('Page_404', () => {
beforeEach(async () => {
console.log('run before each test case');
});
Expand Down
2 changes: 1 addition & 1 deletion Angular/contents/data-i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class Data_Page extends Metadata_Page {
this.Lang = 'en';
this.Title = this.Site.Name[this.Lang];
this.Description = 'Hello World';
this.Keywords = 'website, landing, root';
this.Keywords = 'website, landing';
break;
}

Expand Down
4 changes: 3 additions & 1 deletion Angular/contents/lang/data-i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class Data_Page extends Metadata_Page {
this.URL = route.snapshot.url.toString();
this.Site = METADATA_SITE;


// setting language-specific metadata
switch (route.snapshot.data['lang']) {
case 'en':
Expand All @@ -37,10 +38,11 @@ export class Data_Page extends Metadata_Page {
this.Lang = 'en';
this.Title = 'Language-Specific Landing Page';
this.Description = 'the language-specific landing page.';
this.Keywords = `website, landing, ${this.Lang}`;
this.Keywords = 'website, landing, en';
break;
}


// initiate the page
this.service.Init(this);
}
Expand Down
17 changes: 0 additions & 17 deletions Angular/contents/lang/page.css
Original file line number Diff line number Diff line change
@@ -1,17 +0,0 @@
section.selector .panel {
margin: 2rem 0;
}

section.selector .panel .catalog {
display: flex;
flex-direction: column;
justify-content: center;
gap: 2rem;

margin: 4rem 0;
}

section.selector .panel .catalog > .social {
min-width: 80vw;
--social-height: 8rem;
}
5 changes: 2 additions & 3 deletions Angular/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 44 additions & 3 deletions Angular/services/app/Metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const METADATA_SITE: Metadata_Site = {
//
// Leaving this field empty can cause catastrophic failure.
Name: {
"en": "Project Example",
"en": "Example Website",
},


Expand All @@ -74,7 +74,7 @@ export const METADATA_SITE: Metadata_Site = {
//
// Leaving this field empty can cause catastrophic failure.
Description: {
"en": "An example web app.",
"en": "An example website.",
},


Expand Down Expand Up @@ -160,7 +160,7 @@ export const METADATA_SITE: Metadata_Site = {
Owners: [{
UUID: '',
Name_Family: {
"en": "Holloway",
"en": "Chew",
},
Name_Given: {
"en": "Kean Ho",
Expand All @@ -178,6 +178,13 @@ export const METADATA_SITE: Metadata_Site = {
"en": "Learn, Internalize, Grow, and Expand.",
},
Contacts: {
email_01: {
"en": {
ID: "hello@hollowaykeanho.com",
Type: "email",
URL: "hello@hollowaykeanho.com",
},
},
bluesky_01: {
"en": {
ID: "hollowaykeanho.com",
Expand All @@ -199,6 +206,34 @@ export const METADATA_SITE: Metadata_Site = {
URL: "https://mastodon.online/@hollowaykeanho",
},
},
orcid_01: {
"en": {
ID: "0000-0003-4202-4863",
Type: "orcid",
URL: "https://orcid.org/0000-0003-4202-4863",
},
},
website_01: {
"en": {
ID: "(Holloway) Chew, Kean Ho",
Type: "website",
URL: "https://www.hollowaykeanho.com",
},
},
youtube_01: {
"en": {
ID: "@chewkeanho",
Type: "youtube",
URL: "https://www.youtube.com/@chewkeanho",
},
},
zenodo_01: {
"en": {
ID: "chewkeanho",
Type: "zenodo",
URL: "https://zenodo.org/communities/chewkeanho/",
},
},
},
Roles: [
"Creator",
Expand Down Expand Up @@ -874,6 +909,12 @@ export class Service_Page {


public Init(metadata: Metadata_Page): number {
// valdiate base url (redirect to proper base URL)
if (!this.service_url.Validate_Current_URL(metadata.URL)) {
return 1;
}


// validate input
if (metadata.Lang == '') {
metadata.Lang = 'en';
Expand Down
Loading

0 comments on commit 2c5fadb

Please sign in to comment.