From 5623696c4993fd85dd86d288701bff35c0e80897 Mon Sep 17 00:00:00 2001 From: Lucas Garron Date: Fri, 3 Jan 2025 17:00:35 -0800 Subject: [PATCH 1/5] Bump `@cubing/icons` to v2.1.0-pre.3 This should be a compatible replacement. I've done a basic check that the icons show up properly, and a full switch on the WCA website will help shake out potential issues. --- app/webpacker/packs/global_styles.js | 2 +- package.json | 2 +- yarn.lock | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/webpacker/packs/global_styles.js b/app/webpacker/packs/global_styles.js index 1a9a9a450f0..da0c95e7fd3 100644 --- a/app/webpacker/packs/global_styles.js +++ b/app/webpacker/packs/global_styles.js @@ -1,5 +1,5 @@ import 'flag-icons/css/flag-icons.css'; -import '@cubing/icons'; +import '@cubing/icons/css'; import 'semantic-css/accordion'; import 'semantic-css/button'; diff --git a/package.json b/package.json index 044d953a14a..8b9d22a1570 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "@babel/preset-env": "^7.26.0", "@babel/preset-react": "^7.26.3", "@babel/runtime": "^7.26.0", - "@cubing/icons": "^1.1.3", + "@cubing/icons": "^2.1.0-pre.3", "@fullcalendar/core": "^6.1.15", "@fullcalendar/interaction": "^6.1.15", "@fullcalendar/luxon3": "^6.1.15", diff --git a/yarn.lock b/yarn.lock index d0d00ccd4d9..40e0e3f37a8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1898,10 +1898,10 @@ __metadata: languageName: node linkType: hard -"@cubing/icons@npm:^1.1.3": - version: 1.1.3 - resolution: "@cubing/icons@npm:1.1.3" - checksum: 10c0/332fb3a4888020c39031201e9045569a190e9b40852c1857cdc44e624a9bf09d4fafc72691c8596ba7c59411ffc9dd79bb6686f48608f7438807ed099a22c805 +"@cubing/icons@npm:^2.1.0-pre.3": + version: 2.1.0-pre.3 + resolution: "@cubing/icons@npm:2.1.0-pre.3" + checksum: 10c0/b3b0b1e8c7ffa2ea8e5e53bf2e4d85485c63ec7d65ccb2c49d43f6d034bd27ae7eb604ba2ee62e9e3ad7af0f0cdf515b7fd02616aeed375d7d3d5919f3bf25c1 languageName: node linkType: hard @@ -10159,7 +10159,7 @@ __metadata: "@babel/preset-env": "npm:^7.26.0" "@babel/preset-react": "npm:^7.26.3" "@babel/runtime": "npm:^7.26.0" - "@cubing/icons": "npm:^1.1.3" + "@cubing/icons": "npm:^2.1.0-pre.3" "@fullcalendar/core": "npm:^6.1.15" "@fullcalendar/interaction": "npm:^6.1.15" "@fullcalendar/luxon3": "npm:^6.1.15" From 77de4d1013f0ec697558c3692a93c6809be793ac Mon Sep 17 00:00:00 2001 From: Lucas Garron Date: Fri, 3 Jan 2025 17:36:27 -0800 Subject: [PATCH 2/5] grrr --- app/webpacker/packs/global_styles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/webpacker/packs/global_styles.js b/app/webpacker/packs/global_styles.js index da0c95e7fd3..1a9a9a450f0 100644 --- a/app/webpacker/packs/global_styles.js +++ b/app/webpacker/packs/global_styles.js @@ -1,5 +1,5 @@ import 'flag-icons/css/flag-icons.css'; -import '@cubing/icons/css'; +import '@cubing/icons'; import 'semantic-css/accordion'; import 'semantic-css/button'; From c841a6c3167633115b10c0c6ec1fbba17e21c47a Mon Sep 17 00:00:00 2001 From: Lucas Garron Date: Fri, 3 Jan 2025 17:44:03 -0800 Subject: [PATCH 3/5] hmm --- app/assets/stylesheets/pdf.css.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/pdf.css.scss b/app/assets/stylesheets/pdf.css.scss index 6048c8a3e51..0459a97be99 100644 --- a/app/assets/stylesheets/pdf.css.scss +++ b/app/assets/stylesheets/pdf.css.scss @@ -8,7 +8,7 @@ a { // We need the import here, otherwise Rails' asset adds a BOM at the beginning of it, // and the font doesn't get recognize! -@import "cubing-icons"; /* stylelint-disable-line no-invalid-position-at-import-rule */ +@import "@cubing/icons"; /* stylelint-disable-line no-invalid-position-at-import-rule */ header { width: 100%; From ec937f5f05c3c76d5ede22d9c0d3a10be396eea2 Mon Sep 17 00:00:00 2001 From: Lucas Garron Date: Thu, 9 Jan 2025 01:30:22 -0800 Subject: [PATCH 4/5] Bump `@cubing/icons` to v3.0.0 --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 8b9d22a1570..c9e4e2d1da2 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "@babel/preset-env": "^7.26.0", "@babel/preset-react": "^7.26.3", "@babel/runtime": "^7.26.0", - "@cubing/icons": "^2.1.0-pre.3", + "@cubing/icons": "^3.0.0", "@fullcalendar/core": "^6.1.15", "@fullcalendar/interaction": "^6.1.15", "@fullcalendar/luxon3": "^6.1.15", diff --git a/yarn.lock b/yarn.lock index 40e0e3f37a8..52e143e7670 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1898,10 +1898,10 @@ __metadata: languageName: node linkType: hard -"@cubing/icons@npm:^2.1.0-pre.3": - version: 2.1.0-pre.3 - resolution: "@cubing/icons@npm:2.1.0-pre.3" - checksum: 10c0/b3b0b1e8c7ffa2ea8e5e53bf2e4d85485c63ec7d65ccb2c49d43f6d034bd27ae7eb604ba2ee62e9e3ad7af0f0cdf515b7fd02616aeed375d7d3d5919f3bf25c1 +"@cubing/icons@npm:^3.0.0": + version: 3.0.0 + resolution: "@cubing/icons@npm:3.0.0" + checksum: 10c0/7ac6721ba9a8b206ea8171697d1485b4c36f8ad3c4564f852f42cfd7de6ed102d35af0982ad8c6b9b3b16b46d1ee770274375a5ed4ae976cd1fd361198f1896b languageName: node linkType: hard @@ -10159,7 +10159,7 @@ __metadata: "@babel/preset-env": "npm:^7.26.0" "@babel/preset-react": "npm:^7.26.3" "@babel/runtime": "npm:^7.26.0" - "@cubing/icons": "npm:^2.1.0-pre.3" + "@cubing/icons": "npm:^3.0.0" "@fullcalendar/core": "npm:^6.1.15" "@fullcalendar/interaction": "npm:^6.1.15" "@fullcalendar/luxon3": "npm:^6.1.15" From 9a46c68c07f0ea133ad2b8ff8d45d6f89db95085 Mon Sep 17 00:00:00 2001 From: Lucas Garron Date: Thu, 9 Jan 2025 01:38:38 -0800 Subject: [PATCH 5/5] Try to fix the paths. --- app/assets/stylesheets/pdf.css.scss | 4 +++- config/initializers/assets.rb | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/pdf.css.scss b/app/assets/stylesheets/pdf.css.scss index 0459a97be99..a72daa57989 100644 --- a/app/assets/stylesheets/pdf.css.scss +++ b/app/assets/stylesheets/pdf.css.scss @@ -8,7 +8,9 @@ a { // We need the import here, otherwise Rails' asset adds a BOM at the beginning of it, // and the font doesn't get recognize! -@import "@cubing/icons"; /* stylelint-disable-line no-invalid-position-at-import-rule */ +// This refers to: `[repo root]/node_modules/@cubing/icons/dist/lib/@cubing/icons/cubing-icons.css`, +// per a configuration in `assets.rb`. +@import "cubing-icons"; /* stylelint-disable-line no-invalid-position-at-import-rule */ header { width: 100%; diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 10499a8f0c4..c84547c9748 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -10,7 +10,12 @@ # helper! # wicked_pdf's helpers can't handle "packs_with_chunks" and therefore cannot # properly inline our packs :( -Rails.application.config.assets.paths << Rails.root.join("node_modules", "@cubing", "icons", "www", "css") +# Note: reaching into the package structure violates the semantics of package +# exports, which could theoretically turn any release of `@cubing/icons` into a +# breaking one. However, this path should be fairly stable, and the usage here +# should be safe as long as `@cubing/icons` is not bumped automatically without +# exercising this code path in a test. +Rails.application.config.assets.paths << Rails.root.join("node_modules", "@cubing", "icons", "dist", "lib", "@cubing", "icons") # Precompile additional assets. # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.