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 23:22:59 +01:00 committed by GitHub
parent 2ffb87c9d2
commit 00718c5b61
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 27 additions and 25 deletions

View File

@ -44,18 +44,15 @@ let
// {
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.fetchNpmDeps {
inherit (info) pname version;
src = "${info.src}/frontend";
hash = "sha256-WlwzWGoFi3hjRuM5ucrgavko/gg4iFAwMc6uMLjT/FI=";
npmDeps = pkgs.importNpmLock {
npmRoot = "${info.src}/frontend";
};
npmRoot = "frontend";
npmConfigScript = "setup";
makeCacheWritable = true;
nativeBuildInputs = tools.frontend ++ [ pkgs.npmHooks.npmConfigHook ];
nativeBuildInputs = tools.frontend ++ [ pkgs.importNpmLock.npmConfigHook ];
prePatch = ''
mkdir branding

View File

@ -67,6 +67,9 @@
"cSpell.language": "en-US",
"cSpell.logLevel": "Information",
"cSpell.allowCompoundWords": true,
// Other extensions config
"evenBetterToml.formatter.alignComments": false,
"package-json-upgrade.ignorePatterns": ["source-sans-pro"],
// VS Code config
"html.format.wrapLineLength": 200,
"files.eol": "\n",
@ -75,6 +78,5 @@
"*.graphite": "json"
},
"editor.renderWhitespace": "boundary",
"editor.minimap.markSectionHeaderRegex": "// ===+\\n\\s*//\\s*(?<label>[^\\n]{1,18})[^\\n]*(\\n\\s*//[^\\n]*)*\\n\\s*// ===+",
"evenBetterToml.formatter.alignComments": false
"editor.minimap.markSectionHeaderRegex": "// ===+\\n\\s*//\\s*(?<label>[^\\n]{1,18})[^\\n]*(\\n\\s*//[^\\n]*)*\\n\\s*// ===+"
}

View File

@ -84,7 +84,7 @@ async function main() {
const url = lines[0];
const expectedHash = lines[1];
console.log(`Downloading branding assets from ${url}...`);
console.log(`Downloading branding assets from <${url}>...`);
try {
await downloadFile(url, TEMP_FILE);

View File

@ -10,8 +10,8 @@
"class-transformer": "^0.5.1",
"idb-keyval": "^6.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-sans": "github:adobe-fonts/source-sans#2.045R-ro%2F1.095R-it"
"source-code-pro": "2.42.0",
"source-sans-pro": "2.45.0"
},
"devDependencies": {
"@eslint/compat": "^2.0.1",
@ -6008,8 +6008,9 @@
}
},
"node_modules/source-code-pro": {
"version": "2.38.0",
"resolved": "git+ssh://git@github.com/adobe-fonts/source-code-pro.git#d3f1a5962cde503f9409c21e58527611d4a19ef1",
"version": "2.42.0",
"resolved": "https://registry.npmjs.org/source-code-pro/-/source-code-pro-2.42.0.tgz",
"integrity": "sha512-18isp9l4xtOL3r61TwL9m1hjYX9qb1+i7iK0pSHEeWADKuQCOdQkBzhFiv8pBfOP7u9lNTBN75yYif2HUdyiyg==",
"license": "OFL-1.1"
},
"node_modules/source-map-js": {
@ -6022,10 +6023,11 @@
"node": ">=0.10.0"
}
},
"node_modules/source-sans": {
"name": "source-sans-pro",
"version": "2.40.0",
"resolved": "git+ssh://git@github.com/adobe-fonts/source-sans.git#ce77773581f4d454f0fa985c073bb25c721bfcf5",
"node_modules/source-sans-pro": {
"version": "2.45.0",
"resolved": "https://registry.npmjs.org/source-sans-pro/-/source-sans-pro-2.45.0.tgz",
"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"
},
"node_modules/spdx-compare": {

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-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": {
"class-transformer": "^0.5.1",
"idb-keyval": "^6.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-sans": "github:adobe-fonts/source-sans#2.045R-ro%2F1.095R-it"
"source-code-pro": "2.42.0",
"source-sans-pro": "2.45.0"
},
"devDependencies": {
"@eslint/compat": "^2.0.1",

View File

@ -331,7 +331,7 @@
font-weight: 400;
font-style: 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 {
@ -339,7 +339,7 @@
font-weight: 400;
font-style: italic;
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 {
@ -347,7 +347,7 @@
font-weight: 700;
font-style: 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 {
@ -355,7 +355,7 @@
font-weight: 700;
font-style: italic;
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 {

View File

@ -264,8 +264,8 @@ function generateAdditionalLicenses(): LicenseInfo[] {
const ADDITIONAL_LICENSES = [
{
licenseName: "SIL Open Font License 1.1",
licenseTextPath: "node_modules/source-sans/LICENSE.txt",
manifestPath: "node_modules/source-sans/package.json",
licenseTextPath: "node_modules/source-sans-pro/LICENSE.txt",
manifestPath: "node_modules/source-sans-pro/package.json",
},
{
licenseName: "SIL Open Font License 1.1",