Skip to content

Commit

Permalink
Merge pull request #165 from supportingami/updates/2024-09-2
Browse files Browse the repository at this point in the history
feat: preview action update and typography
  • Loading branch information
chrismclarke authored Sep 11, 2024
2 parents e6d85f2 + 086b642 commit efa1769
Show file tree
Hide file tree
Showing 16 changed files with 155 additions and 587 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build-and-deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: actions/checkout@master
# TODO - consider gradle/swift caches as well - https://github.com/actions/cache/blob/main/examples.md#java---gradle
- name: Setup Cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
Expand Down Expand Up @@ -61,14 +61,14 @@ jobs:
with:
name: maths-club-app
- name: Setup Cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies
run: yarn install --silent
run: yarn install --silent
- name: Sync capacitor plugins
run: npx cap sync android
run: npx cap sync android
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
with:
name: maths-club-app
- name: Setup Cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/generate-screenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@master
- name: Setup Cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
with:
name: maths-club-app
- name: Setup Cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
with:
name: maths-club-app
- name: Setup Cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
Expand All @@ -97,7 +97,7 @@ jobs:
- name: Sync capacitor plugins
run: npx cap sync android
# - name: Setup Cache
# uses: actions/cache@v2
# uses: actions/cache@v4
# with:
# path: |
# ~/.gradle/caches
Expand Down
33 changes: 25 additions & 8 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
name: PR Preview
on:
# use pull_request_target so that secrets accessible from fork
pull_request_target:
pull_request:
# Trigger when labels are changed or more commits added to a PR that contains labels
types: [labeled, synchronize]
# TODO - rever back when working
# # use pull_request_target so that secrets accessible from fork
# pull_request_target:
# # Trigger when labels are changed or more commits added to a PR that contains labels
# types: [labeled, synchronize]
jobs:
build_and_preview:
# NOTE - as we are going to check out and build from forks we also need to add manual
Expand All @@ -14,17 +19,29 @@ jobs:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
# pull the repo from the pull request source, not the default local repo
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Cache
uses: actions/cache@v2

#############################################################################
# Node Modules
# Manually restore any previous cache to speed install
# As immutable install will not change cache only save new cache if not hit
# Uses fine-grained methods from https://github.com/actions/cache
#############################################################################
- name: Enable Corepack
run: corepack enable

- name: Setup Node
uses: actions/setup-node@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install npm dependencies
run: yarn install
node-version: 22.x
cache: "yarn"

- name: Install node modules
run: yarn install --immutable

- name: Populate Config
run: echo $FIREBASE_CONFIG_JSON > maths-club-app/src/environments/firebaseConfig.json
env:
Expand Down
10 changes: 6 additions & 4 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@

**Refactor**

- [ ] all components standalone
- [ ] typography
- [x] all components standalone
- [x] provide sentry error handler (see legacy app module)
- [ ] lazy-load component routes
- [ ] problems standalone repo (?)
- [ ] material module imports to components (if standalone in mat 18)
- [ ] async pipe -> signals
- [ ] Dynamic links (deprecated?)
- [ ] Lint rules (enforce control-flow, ordered imports)
- [ ] Run prettier (write) `yarn prettier --write "**/*.{ts}"`
- [ ] problems standalone repo (?)

**Misc**

- [ ] Improve typography
1 change: 0 additions & 1 deletion maths-club-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"@sentry/angular": "^8.29.0",
"katex": "^0.16.0",
"marked": "^12.0.0",
"material-design-icons": "^3.0.1",
"ngx-markdown": "^18.0.0",
"rxjs": "~7.8.1",
"tslib": "^2.2.0",
Expand Down
8 changes: 4 additions & 4 deletions maths-club-app/src/styles.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/* You can add global styles to this file, and also import other style files */
@import "./theme/my-theme.scss";
@import "./theme/sami-theme.scss";

// Include material design icons
@import "~material-design-icons/iconfont/material-icons.css";
@import "./theme/fonts";
@import "./theme/overrides";
@import "./theme/typography";

html,
body {
Expand All @@ -14,7 +15,6 @@ body {
}
body {
margin: 0;
font-family: Roboto, "Helvetica Neue", sans-serif;
}
/* Markdown child content styling */
table,
Expand Down
53 changes: 53 additions & 0 deletions maths-club-app/src/theme/_fonts.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Noto Sans - exported from google fonts
/* latin */
@font-face {
font-family: "Noto Sans";
font-style: normal;
font-weight: 100 900;
font-stretch: 100%;
font-display: swap;
src: url(./fonts/noto-sans.woff2) format("woff2");
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

// Material Icons
@font-face {
font-family: "Material Icons";
font-style: normal;
font-weight: 400;

src: local("Material Icons"), local("assets/fonts/MaterialIcons-Regular"),
url(./fonts/MaterialIcons-Regular.woff2) format("woff2");
// url(./fonts/MaterialIcons-Regular.woff) format('woff'),
// url(./fonts/MaterialIcons-Regular.ttf) format('truetype');

// src: url(./fonts/MaterialIcons-Regular.eot);
}

.material-icons {
font-family: "Material Icons";
font-weight: normal;
font-style: normal;
font-size: 24px;
/* Preferred icon size */
display: inline-block;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;

/* Support for all WebKit browsers. */
-webkit-font-smoothing: antialiased;
/* Support for Safari and Chrome. */
text-rendering: optimizeLegibility;

/* Support for Firefox. */
-moz-osx-font-smoothing: grayscale;

/* Support for IE. */
font-feature-settings: "liga";
}
4 changes: 4 additions & 0 deletions maths-club-app/src/theme/_overrides.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
html {
// make filled buttons larger (default 36px)
--mdc-filled-button-container-height: 48px;
}
8 changes: 8 additions & 0 deletions maths-club-app/src/theme/_typography.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$fontFamily: "Noto Sans", sans-serif;

body {
font-family: $fontFamily;
}
p {
line-height: 1.75rem;
}
Binary file not shown.
12 changes: 12 additions & 0 deletions maths-club-app/src/theme/fonts/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Material Design Icons

Source for font can be obtained by inspecting url:
https://fonts.googleapis.com/icon?family=Material+Icons

E.g.
https://fonts.gstatic.com/s/materialicons/v140/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2

NOTE - material icons should not be confused with (newer) material symbols
https://github.com/angular/components/issues/24845

(see discussion about handling outdated fonts at: https://github.com/google/material-design-icons/issues/786)
Binary file added maths-club-app/src/theme/fonts/noto-sans.woff2
Binary file not shown.
26 changes: 0 additions & 26 deletions maths-club-app/src/theme/my-theme.scss

This file was deleted.

29 changes: 29 additions & 0 deletions maths-club-app/src/theme/sami-theme.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
@use '@angular/material' as mat;
@include mat.core();

$sami-theme-primary: mat.m2-define-palette(mat.$m2-light-blue-palette);
$sami-theme-accent: mat.m2-define-palette(
mat.$m2-amber-palette,
A200,
A100,
A400
);

$sami-theme-warn: mat.m2-define-palette(mat.$m2-red-palette);

$sami-theme: mat.m2-define-light-theme(
(
color: (
primary: $sami-theme-primary,
accent: $sami-theme-accent,
warn: $sami-theme-warn,
),
typography:
mat.m2-define-typography-config(
$font-family: "Noto Sans",
),
density: 0,
)
);

@include mat.all-component-themes($sami-theme);
8 changes: 0 additions & 8 deletions maths-club-app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9210,13 +9210,6 @@ __metadata:
languageName: node
linkType: hard

"material-design-icons@npm:^3.0.1":
version: 3.0.1
resolution: "material-design-icons@npm:3.0.1"
checksum: 10c0/80c02f73dd45ce07c3180f49d12d9120f76de51df11b016b09e61f3cc590691104aa44be37b609e31b7cef70d1f214db22f51204b8b0f3f1a83a21f84735b336
languageName: node
linkType: hard

"mdast-util-from-markdown@npm:^1.3.0":
version: 1.3.1
resolution: "mdast-util-from-markdown@npm:1.3.1"
Expand Down Expand Up @@ -11663,7 +11656,6 @@ __metadata:
karma-jasmine-html-reporter: "npm:^1.6.0"
katex: "npm:^0.16.0"
marked: "npm:^12.0.0"
material-design-icons: "npm:^3.0.1"
ngx-markdown: "npm:^18.0.0"
prettier: "npm:^2.2.1"
prettier-eslint: "npm:^12.0.0"
Expand Down
Loading

0 comments on commit efa1769

Please sign in to comment.