Remove the need for Nix npm dependency hash (#3652)

* Remove the need for nix npmDeps hash

* Use 2.x

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Timon
2026-01-17 22:22:59 +00:00
committed by GitHub
co-authored by Keavon Chambers
parent 2ffb87c9d2
commit 00718c5b61
7 changed files with 27 additions and 25 deletions
+3 -6
View File
@@ -44,18 +44,15 @@ let
// { // {
cargoArtifacts = deps.crane.lib.buildDepsOnly resourcesCommon; cargoArtifacts = deps.crane.lib.buildDepsOnly resourcesCommon;
# TODO: Remove the need for this hash by using individual package resolutions and hashes from package-lock.json npmDeps = pkgs.importNpmLock {
npmDeps = pkgs.fetchNpmDeps { npmRoot = "${info.src}/frontend";
inherit (info) pname version;
src = "${info.src}/frontend";
hash = "sha256-WlwzWGoFi3hjRuM5ucrgavko/gg4iFAwMc6uMLjT/FI=";
}; };
npmRoot = "frontend"; npmRoot = "frontend";
npmConfigScript = "setup"; npmConfigScript = "setup";
makeCacheWritable = true; makeCacheWritable = true;
nativeBuildInputs = tools.frontend ++ [ pkgs.npmHooks.npmConfigHook ]; nativeBuildInputs = tools.frontend ++ [ pkgs.importNpmLock.npmConfigHook ];
prePatch = '' prePatch = ''
mkdir branding mkdir branding
+4 -2
View File
@@ -67,6 +67,9 @@
"cSpell.language": "en-US", "cSpell.language": "en-US",
"cSpell.logLevel": "Information", "cSpell.logLevel": "Information",
"cSpell.allowCompoundWords": true, "cSpell.allowCompoundWords": true,
// Other extensions config
"evenBetterToml.formatter.alignComments": false,
"package-json-upgrade.ignorePatterns": ["source-sans-pro"],
// VS Code config // VS Code config
"html.format.wrapLineLength": 200, "html.format.wrapLineLength": 200,
"files.eol": "\n", "files.eol": "\n",
@@ -75,6 +78,5 @@
"*.graphite": "json" "*.graphite": "json"
}, },
"editor.renderWhitespace": "boundary", "editor.renderWhitespace": "boundary",
"editor.minimap.markSectionHeaderRegex": "// ===+\\n\\s*//\\s*(?<label>[^\\n]{1,18})[^\\n]*(\\n\\s*//[^\\n]*)*\\n\\s*// ===+", "editor.minimap.markSectionHeaderRegex": "// ===+\\n\\s*//\\s*(?<label>[^\\n]{1,18})[^\\n]*(\\n\\s*//[^\\n]*)*\\n\\s*// ===+"
"evenBetterToml.formatter.alignComments": false
} }
+1 -1
View File
@@ -84,7 +84,7 @@ async function main() {
const url = lines[0]; const url = lines[0];
const expectedHash = lines[1]; const expectedHash = lines[1];
console.log(`Downloading branding assets from ${url}...`); console.log(`Downloading branding assets from <${url}>...`);
try { try {
await downloadFile(url, TEMP_FILE); await downloadFile(url, TEMP_FILE);
+10 -8
View File
@@ -10,8 +10,8 @@
"class-transformer": "^0.5.1", "class-transformer": "^0.5.1",
"idb-keyval": "^6.2.2", "idb-keyval": "^6.2.2",
"reflect-metadata": "^0.2.2", "reflect-metadata": "^0.2.2",
"source-code-pro": "github:adobe-fonts/source-code-pro#2.042R-u/1.062R-i/1.026R-vf", "source-code-pro": "2.42.0",
"source-sans": "github:adobe-fonts/source-sans#2.045R-ro%2F1.095R-it" "source-sans-pro": "2.45.0"
}, },
"devDependencies": { "devDependencies": {
"@eslint/compat": "^2.0.1", "@eslint/compat": "^2.0.1",
@@ -6008,8 +6008,9 @@
} }
}, },
"node_modules/source-code-pro": { "node_modules/source-code-pro": {
"version": "2.38.0", "version": "2.42.0",
"resolved": "git+ssh://git@github.com/adobe-fonts/source-code-pro.git#d3f1a5962cde503f9409c21e58527611d4a19ef1", "resolved": "https://registry.npmjs.org/source-code-pro/-/source-code-pro-2.42.0.tgz",
"integrity": "sha512-18isp9l4xtOL3r61TwL9m1hjYX9qb1+i7iK0pSHEeWADKuQCOdQkBzhFiv8pBfOP7u9lNTBN75yYif2HUdyiyg==",
"license": "OFL-1.1" "license": "OFL-1.1"
}, },
"node_modules/source-map-js": { "node_modules/source-map-js": {
@@ -6022,10 +6023,11 @@
"node": ">=0.10.0" "node": ">=0.10.0"
} }
}, },
"node_modules/source-sans": { "node_modules/source-sans-pro": {
"name": "source-sans-pro", "version": "2.45.0",
"version": "2.40.0", "resolved": "https://registry.npmjs.org/source-sans-pro/-/source-sans-pro-2.45.0.tgz",
"resolved": "git+ssh://git@github.com/adobe-fonts/source-sans.git#ce77773581f4d454f0fa985c073bb25c721bfcf5", "integrity": "sha512-MBbmgyzlD0yCKAvJ4Q86s9BB8yXYld26joJh0DMD53j9aFJZYnFo/B7f4RKXDUfX9I4FyEfdr51lOaVioAOBHw==",
"deprecated": "WARNING: This project has been renamed to source-sans. Install using source-sans instead.",
"license": "SIL Open Font License 1.1" "license": "SIL Open Font License 1.1"
}, },
"node_modules/spdx-compare": { "node_modules/spdx-compare": {
+3 -2
View File
@@ -30,12 +30,13 @@
"wasm:watch-profiling": "cargo watch --postpone --watch-when-idle --workdir=wasm --shell \"wasm-pack build . --profiling --target=web -- --color=always\"", "wasm:watch-profiling": "cargo watch --postpone --watch-when-idle --workdir=wasm --shell \"wasm-pack build . --profiling --target=web -- --color=always\"",
"wasm:watch-production": "cargo watch --postpone --watch-when-idle --workdir=wasm --shell \"wasm-pack build . --release --target=web -- --color=always\"" "wasm:watch-production": "cargo watch --postpone --watch-when-idle --workdir=wasm --shell \"wasm-pack build . --release --target=web -- --color=always\""
}, },
"//": "NOTE: `source-sans-pro` is never to be upgraded to 3.x because that renders a pixel above its intended position.",
"dependencies": { "dependencies": {
"class-transformer": "^0.5.1", "class-transformer": "^0.5.1",
"idb-keyval": "^6.2.2", "idb-keyval": "^6.2.2",
"reflect-metadata": "^0.2.2", "reflect-metadata": "^0.2.2",
"source-code-pro": "github:adobe-fonts/source-code-pro#2.042R-u/1.062R-i/1.026R-vf", "source-code-pro": "2.42.0",
"source-sans": "github:adobe-fonts/source-sans#2.045R-ro%2F1.095R-it" "source-sans-pro": "2.45.0"
}, },
"devDependencies": { "devDependencies": {
"@eslint/compat": "^2.0.1", "@eslint/compat": "^2.0.1",
+4 -4
View File
@@ -331,7 +331,7 @@
font-weight: 400; font-weight: 400;
font-style: normal; font-style: normal;
font-stretch: normal; font-stretch: normal;
src: url("@graphite/../node_modules/source-sans/WOFF2/TTF/SourceSansPro-Regular.ttf.woff2") format("woff2"); src: url("@graphite/../node_modules/source-sans-pro/WOFF2/TTF/SourceSansPro-Regular.ttf.woff2") format("woff2");
} }
@font-face { @font-face {
@@ -339,7 +339,7 @@
font-weight: 400; font-weight: 400;
font-style: italic; font-style: italic;
font-stretch: normal; font-stretch: normal;
src: url("@graphite/../node_modules/source-sans/WOFF2/TTF/SourceSansPro-It.ttf.woff2") format("woff2"); src: url("@graphite/../node_modules/source-sans-pro/WOFF2/TTF/SourceSansPro-It.ttf.woff2") format("woff2");
} }
@font-face { @font-face {
@@ -347,7 +347,7 @@
font-weight: 700; font-weight: 700;
font-style: normal; font-style: normal;
font-stretch: normal; font-stretch: normal;
src: url("@graphite/../node_modules/source-sans/WOFF2/TTF/SourceSansPro-Bold.ttf.woff2") format("woff2"); src: url("@graphite/../node_modules/source-sans-pro/WOFF2/TTF/SourceSansPro-Bold.ttf.woff2") format("woff2");
} }
@font-face { @font-face {
@@ -355,7 +355,7 @@
font-weight: 700; font-weight: 700;
font-style: italic; font-style: italic;
font-stretch: normal; font-stretch: normal;
src: url("@graphite/../node_modules/source-sans/WOFF2/TTF/SourceSansPro-BoldIt.ttf.woff2") format("woff2"); src: url("@graphite/../node_modules/source-sans-pro/WOFF2/TTF/SourceSansPro-BoldIt.ttf.woff2") format("woff2");
} }
@font-face { @font-face {
+2 -2
View File
@@ -264,8 +264,8 @@ function generateAdditionalLicenses(): LicenseInfo[] {
const ADDITIONAL_LICENSES = [ const ADDITIONAL_LICENSES = [
{ {
licenseName: "SIL Open Font License 1.1", licenseName: "SIL Open Font License 1.1",
licenseTextPath: "node_modules/source-sans/LICENSE.txt", licenseTextPath: "node_modules/source-sans-pro/LICENSE.txt",
manifestPath: "node_modules/source-sans/package.json", manifestPath: "node_modules/source-sans-pro/package.json",
}, },
{ {
licenseName: "SIL Open Font License 1.1", licenseName: "SIL Open Font License 1.1",