From aab40be9646079d023716485f279b5560b8f218d Mon Sep 17 00:00:00 2001 From: Josh Lee Date: Thu, 14 Nov 2024 10:59:43 -0500 Subject: [PATCH 1/5] Update Node.js in CI Switch from 18.x (maintenance LTS until next spring) to 22.x (active LTS for the coming year). Rather than repeating the version in every workflow, reference the tool version by filename. Rather than specifying an exact major version, allow actions/setup-node to use a version that matches the requirement of ">=18", which is likely to require adjusting this less often (assuming things don't break by surprise when the version changes). --- .github/workflows/build-preview.yml | 4 ++-- .github/workflows/deploy.yml | 4 ++-- .github/workflows/lint.yml | 4 ++-- .github/workflows/test-build-macos-13.yml | 4 ++-- .github/workflows/test-build-ubuntu.yml | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-preview.yml b/.github/workflows/build-preview.yml index 84d2ac002..d58ff8649 100644 --- a/.github/workflows/build-preview.yml +++ b/.github/workflows/build-preview.yml @@ -18,10 +18,10 @@ jobs: build-preview: runs-on: ubuntu-latest steps: - - name: Use Node.js 18.x + - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: 18.x + node-version-file: package.json - name: Checkout Main Branch 🛎️ uses: actions/checkout@v4 with: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index fc8537a81..f89360df5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -20,10 +20,10 @@ jobs: steps: - name: Checkout 🛎️ uses: actions/checkout@v4 - - name: Use Node.js 18.x + - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: 18.x + node-version-file: package.json - name: Install and Build 🔧 # TODO: when we move shieldlib to its own repo, move shieldlib docs CI also run: | diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5d1c098d2..e9ae3a477 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,10 +18,10 @@ jobs: # This is important to fetch the changes to the previous commit fetch-depth: 0 - - name: Set up Node.js + - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: "18" # Specify the Node.js version + node-version-file: package.json - name: Install dependencies run: npm install diff --git a/.github/workflows/test-build-macos-13.yml b/.github/workflows/test-build-macos-13.yml index 3d893b395..a6e033a3d 100644 --- a/.github/workflows/test-build-macos-13.yml +++ b/.github/workflows/test-build-macos-13.yml @@ -10,10 +10,10 @@ jobs: steps: - name: Checkout 🛎️ uses: actions/checkout@v4 - - name: Use Node.js 18.x + - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: 18.x + node-version-file: package.json - name: Build Shield Library 🛡️ run: | cd shieldlib diff --git a/.github/workflows/test-build-ubuntu.yml b/.github/workflows/test-build-ubuntu.yml index 4440ba9c6..c8fbc19c0 100644 --- a/.github/workflows/test-build-ubuntu.yml +++ b/.github/workflows/test-build-ubuntu.yml @@ -10,10 +10,10 @@ jobs: steps: - name: Checkout 🛎️ uses: actions/checkout@v4 - - name: Use Node.js 18.x + - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: 18.x + node-version-file: package.json - name: Build Shield Library 🛡️ run: | cd shieldlib From 83e9503b99488c283645e851b4b32822aa86759c Mon Sep 17 00:00:00 2001 From: Josh Lee Date: Thu, 14 Nov 2024 11:57:17 -0500 Subject: [PATCH 2/5] Use a version with prebuilds of node-canvas --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 096fcdd1e..4af8caf53 100644 --- a/package.json +++ b/package.json @@ -78,6 +78,6 @@ }, "engines": { "npm": ">=8.3.0", - "node": ">=18" + "node": ">=18 <=20" } } From 70013a0e80d370217421d5e43a39aebc0bcb48b7 Mon Sep 17 00:00:00 2001 From: Josh Lee Date: Thu, 14 Nov 2024 11:58:55 -0500 Subject: [PATCH 3/5] apparently we have directories --- .github/workflows/build-preview.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-preview.yml b/.github/workflows/build-preview.yml index d58ff8649..bba0ffb2f 100644 --- a/.github/workflows/build-preview.yml +++ b/.github/workflows/build-preview.yml @@ -18,10 +18,6 @@ jobs: build-preview: runs-on: ubuntu-latest steps: - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: package.json - name: Checkout Main Branch 🛎️ uses: actions/checkout@v4 with: @@ -31,6 +27,10 @@ jobs: uses: actions/checkout@v4 with: path: pr-branch + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: pr-branch/package.json - name: Install and Build Main Branch 🔧 run: | npm ci --include=dev From 73ddc5183f7db8b3342c808676483e27e338d802 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Fri, 29 Nov 2024 22:01:14 -0500 Subject: [PATCH 4/5] Fix errant banner definitions --- src/js/shield_defs.js | 53 ++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index 06df44179..ceb3589ba 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -639,7 +639,7 @@ export function loadShields() { // United States // Interstate Highways - shields["US:I"] = { + const usInterstateShield = { spriteBlank: ["shield_us_interstate_2", "shield_us_interstate_3"], textLayout: textConstraint("southHalfEllipse"), textColor: Color.shields.white, @@ -649,6 +649,9 @@ export function loadShields() { top: 6, bottom: 5, }, + } + shields["US:I"] = { + ...usInterstateShield, bannerMap: { "US:I:Alternate": ["ALT"], "US:I:Express": ["EXPR"], @@ -660,7 +663,7 @@ export function loadShields() { }; shields["US:I:Business:Loop"] = { - ...shields["US:I"], + ...usInterstateShield, spriteBlank: [ "shield_us_interstate_business_2", "shield_us_interstate_business_3", @@ -1457,7 +1460,7 @@ export function loadShields() { }; // Maryland - shields["US:MD"] = { + const marylandShield = { spriteBlank: ["shield_us_md_2", "shield_us_md_3"], textColor: Color.shields.black, padding: { @@ -1466,6 +1469,10 @@ export function loadShields() { top: 6, bottom: 2, }, + } + + shields["US:MD"] = { + ...marylandShield, bannerMap: { "US:MD:Alternate": ["ALT"], "US:MD:Bypass": ["BYP"], @@ -1473,7 +1480,7 @@ export function loadShields() { }; shields["US:MD:Business"] = banneredShield( { - ...shields["US:MD"], + ...marylandShield, textColor: Color.shields.green, colorLighten: Color.shields.green, }, @@ -2097,7 +2104,7 @@ export function loadShields() { ); // New York - shields["US:NY"] = { + const usNewYorkShield = { spriteBlank: ["shield_us_ny_2", "shield_us_ny_3"], textColor: Color.shields.black, padding: { @@ -2106,6 +2113,9 @@ export function loadShields() { top: 5, bottom: 5, }, + } + shields["US:NY"] = { + ...usNewYorkShield, bannerMap: { "US:NY:Truck": ["TRK"], }, @@ -2124,8 +2134,8 @@ export function loadShields() { top: 3, bottom: 3, }, + ref: "LOOP" }; - shields["US:NY:Inner_Loop"].ref = "LOOP"; shields["US:NY:Thruway"] = { noref: { spriteBlank: "shield_us_ny_thruway", @@ -2137,7 +2147,7 @@ export function loadShields() { }, }; shields["US:NY:Parkway"] = { - ...shields["US:NY"], + ...usNewYorkShield, textColor: Color.shields.white, colorLighten: Color.shields.white, colorDarken: Color.shields.green, @@ -2704,6 +2714,18 @@ export function loadShields() { ); // Texas + const usTexasShapedShield = { + spriteBlank: "shield_us_tx_outline", + textColor: Color.shields.black, + textLayout: textConstraint("ellipse"), + padding: { + left: 3, + right: 0, + top: 7, + bottom: 10, + }, + } + shields["US:TX"] = { ...roundedRectShield(Color.shields.white, Color.shields.black), bannerMap: { @@ -2717,22 +2739,14 @@ export function loadShields() { }, }; shields["US:TX:FM"] = shields["US:TX:RM"] = { - spriteBlank: "shield_us_tx_outline", - textColor: Color.shields.black, - textLayout: textConstraint("ellipse"), - padding: { - left: 3, - right: 0, - top: 7, - bottom: 10, - }, + ...usTexasShapedShield, bannerMap: { "US:TX:FM:Business": ["BUS"], }, }; shields["US:TX:Recreational"] = banneredShield( { - ...shields["US:TX:FM"], + ...usTexasShapedShield, textColor: Color.shields.brown, colorLighten: Color.shields.brown, }, @@ -2751,10 +2765,7 @@ export function loadShields() { "US:TX:Loop:Express:Toll": ["EXPR", "LOOP"], }, }; - shields["US:TX:Toll"] = shields["US:TX:NTTA"] = roundedRectShield( - Color.shields.blue, - Color.shields.white - ); + shields["US:TX:CTRMA"] = { ...roundedRectShield( Color.shields.blue, From 24e5cf4f2b161c4c9890e11fa6fd536de2b943e1 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Fri, 29 Nov 2024 22:07:46 -0500 Subject: [PATCH 5/5] Prettier --- src/js/shield_defs.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/js/shield_defs.js b/src/js/shield_defs.js index ceb3589ba..86645dae5 100644 --- a/src/js/shield_defs.js +++ b/src/js/shield_defs.js @@ -649,7 +649,7 @@ export function loadShields() { top: 6, bottom: 5, }, - } + }; shields["US:I"] = { ...usInterstateShield, bannerMap: { @@ -1469,7 +1469,7 @@ export function loadShields() { top: 6, bottom: 2, }, - } + }; shields["US:MD"] = { ...marylandShield, @@ -2113,7 +2113,7 @@ export function loadShields() { top: 5, bottom: 5, }, - } + }; shields["US:NY"] = { ...usNewYorkShield, bannerMap: { @@ -2134,7 +2134,7 @@ export function loadShields() { top: 3, bottom: 3, }, - ref: "LOOP" + ref: "LOOP", }; shields["US:NY:Thruway"] = { noref: { @@ -2724,7 +2724,7 @@ export function loadShields() { top: 7, bottom: 10, }, - } + }; shields["US:TX"] = { ...roundedRectShield(Color.shields.white, Color.shields.black),