ci(build-font): Use Vercel blob storage for font codepoints allocations

This commit is contained in:
Eric Fennis
2026-03-02 08:30:29 +01:00
parent d54247b637
commit 4201f70d7b
5 changed files with 58 additions and 1988 deletions
+37 -61
View File
@@ -199,7 +199,7 @@ importers:
version: 7.7.1
nitropack:
specifier: 2.8.1
version: 2.8.1(@vercel/blob@2.0.0)(db0@0.3.4)(encoding@0.1.13)(ioredis@5.8.2)(xml2js@0.6.2)
version: 2.8.1(@vercel/blob@2.3.0)(db0@0.3.4)(encoding@0.1.13)(ioredis@5.8.2)(xml2js@0.6.2)
rollup-plugin-copy:
specifier: ^3.5.0
version: 3.5.0
@@ -226,7 +226,7 @@ importers:
version: 6.9.1
astro:
specifier: ^5.16.0
version: 5.16.0(@types/node@24.10.1)(@vercel/blob@2.0.0)(db0@0.3.4)(ioredis@5.8.2)(jiti@2.6.1)(less@4.2.0)(rollup@4.59.0)(sass@1.77.8)(stylus@0.56.0)(terser@5.44.1)(typescript@5.9.3)(yaml@2.8.0)
version: 5.16.0(@types/node@24.10.1)(@vercel/blob@2.3.0)(db0@0.3.4)(ioredis@5.8.2)(jiti@2.6.1)(less@4.2.0)(rollup@4.59.0)(sass@1.77.8)(stylus@0.56.0)(terser@5.44.1)(typescript@5.9.3)(yaml@2.8.0)
jest-serializer-html:
specifier: ^7.1.0
version: 7.1.0
@@ -810,6 +810,9 @@ importers:
tools/build-font:
dependencies:
'@vercel/blob':
specifier: ^2.3.0
version: 2.3.0
fs-extra:
specifier: ^11.2.0
version: 11.3.2
@@ -1178,10 +1181,6 @@ packages:
resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==}
engines: {node: '>=6.9.0'}
'@babel/code-frame@7.28.6':
resolution: {integrity: sha512-JYgintcMjRiCvS8mMECzaEn+m3PfoQiyqukOMCCVQtoJGYJw8j/8LBJEiqkHLkfwCcs74E3pbAUFNg7d9VNJ+Q==}
engines: {node: '>=6.9.0'}
'@babel/code-frame@7.29.0':
resolution: {integrity: sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==}
engines: {node: '>=6.9.0'}
@@ -1463,11 +1462,6 @@ packages:
engines: {node: '>=6.0.0'}
hasBin: true
'@babel/parser@7.28.6':
resolution: {integrity: sha512-TeR9zWR18BvbfPmGbLampPMW+uW1NZnJlRuuHso8i87QZNq2JRF9i6RgxRqtEq+wQGsS19NNTWr2duhnE49mfQ==}
engines: {node: '>=6.0.0'}
hasBin: true
'@babel/parser@7.29.0':
resolution: {integrity: sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww==}
engines: {node: '>=6.0.0'}
@@ -5759,8 +5753,8 @@ packages:
cpu: [x64]
os: [win32]
'@vercel/blob@2.0.0':
resolution: {integrity: sha512-oAj7Pdy83YKSwIaMFoM7zFeLYWRc+qUpW3PiDSblxQMnGFb43qs4bmfq7dr/+JIfwhs6PTwe1o2YBwKhyjWxXw==}
'@vercel/blob@2.3.0':
resolution: {integrity: sha512-oYWiJbWRQ7gz9Mj0X/NHFJ3OcLMOBzq/2b3j6zeNrQmtFo6dHwU8FAwNpxVIYddVMd+g8eqEi7iRueYx8FtM0Q==}
engines: {node: '>=20.0.0'}
'@vercel/nft@0.24.4':
@@ -12775,14 +12769,14 @@ packages:
resolution: {integrity: sha512-zICwjrDrcrUE0pyyJc1I2QzBkLM8FINsgOrt6WjA+BgajVq9Nxu2PbFFXUrAggLfDXlZGZBVZYw7WNV5KiBiBA==}
engines: {node: '>=14.0'}
undici@5.29.0:
resolution: {integrity: sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==}
engines: {node: '>=14.0'}
undici@6.21.3:
resolution: {integrity: sha512-gBLkYIlEnSp8pFbT64yFgGE6UIB9tAkhukC23PmMDCe5Nd+cRqKxSjw5y54MK2AZMgZfJWMaNE4nYUHgi1XEOw==}
engines: {node: '>=18.17'}
undici@6.23.0:
resolution: {integrity: sha512-VfQPToRA5FZs/qJxLIinmU59u0r7LXqoJkCzinq3ckNJp3vKEh7jTWN589YQ5+aoAC/TGRLyJLCPKcLQbM8r9g==}
engines: {node: '>=18.17'}
unenv@1.10.0:
resolution: {integrity: sha512-wY5bskBQFL9n3Eca5XnhH6KbUo/tfvkwm9OpcdCvLaeA7piBNbavbOKJySEwQ1V0RH6HvNlSAFRTpvTqgKRQXQ==}
@@ -14202,12 +14196,6 @@ snapshots:
js-tokens: 4.0.0
picocolors: 1.1.1
'@babel/code-frame@7.28.6':
dependencies:
'@babel/helper-validator-identifier': 7.28.5
js-tokens: 4.0.0
picocolors: 1.1.1
'@babel/code-frame@7.29.0':
dependencies:
'@babel/helper-validator-identifier': 7.28.5
@@ -14349,7 +14337,7 @@ snapshots:
'@babel/helper-builder-binary-assignment-operator-visitor@7.24.7':
dependencies:
'@babel/traverse': 7.28.5
'@babel/types': 7.28.6
'@babel/types': 7.29.0
transitivePeerDependencies:
- supports-color
@@ -14503,7 +14491,7 @@ snapshots:
'@babel/helper-module-imports@7.18.6':
dependencies:
'@babel/types': 7.28.5
'@babel/types': 7.29.0
'@babel/helper-module-imports@7.22.15':
dependencies:
@@ -14628,21 +14616,21 @@ snapshots:
'@babel/helper-simple-access@7.24.7':
dependencies:
'@babel/traverse': 7.28.5
'@babel/types': 7.28.6
'@babel/types': 7.29.0
transitivePeerDependencies:
- supports-color
'@babel/helper-skip-transparent-expression-wrappers@7.24.7':
dependencies:
'@babel/traverse': 7.28.5
'@babel/types': 7.28.6
'@babel/types': 7.29.0
transitivePeerDependencies:
- supports-color
'@babel/helper-skip-transparent-expression-wrappers@7.27.1':
dependencies:
'@babel/traverse': 7.28.5
'@babel/types': 7.28.5
'@babel/types': 7.29.0
transitivePeerDependencies:
- supports-color
@@ -14660,7 +14648,7 @@ snapshots:
dependencies:
'@babel/template': 7.28.6
'@babel/traverse': 7.28.5
'@babel/types': 7.28.6
'@babel/types': 7.29.0
transitivePeerDependencies:
- supports-color
@@ -14699,10 +14687,6 @@ snapshots:
dependencies:
'@babel/types': 7.28.5
'@babel/parser@7.28.6':
dependencies:
'@babel/types': 7.29.0
'@babel/parser@7.29.0':
dependencies:
'@babel/types': 7.29.0
@@ -15180,7 +15164,7 @@ snapshots:
dependencies:
'@babel/core': 7.16.12
'@babel/helper-plugin-utils': 7.27.1
'@babel/template': 7.27.2
'@babel/template': 7.28.6
'@babel/plugin-transform-computed-properties@7.27.1(@babel/core@7.28.5)':
dependencies:
@@ -15880,7 +15864,7 @@ snapshots:
'@babel/helper-plugin-utils': 7.27.1
'@babel/plugin-proposal-unicode-property-regex': 7.18.6(@babel/core@7.16.12)
'@babel/plugin-transform-dotall-regex': 7.24.7(@babel/core@7.16.12)
'@babel/types': 7.28.5
'@babel/types': 7.29.0
esutils: 2.0.3
'@babel/preset-modules@0.1.6-no-external-plugins(@babel/core@7.28.5)':
@@ -15955,9 +15939,9 @@ snapshots:
'@babel/template@7.28.6':
dependencies:
'@babel/code-frame': 7.28.6
'@babel/parser': 7.28.6
'@babel/types': 7.28.6
'@babel/code-frame': 7.29.0
'@babel/parser': 7.29.0
'@babel/types': 7.29.0
'@babel/traverse@7.27.1':
dependencies:
@@ -19200,14 +19184,13 @@ snapshots:
'@unrs/resolver-binding-win32-x64-msvc@1.6.2':
optional: true
'@vercel/blob@2.0.0':
'@vercel/blob@2.3.0':
dependencies:
async-retry: 1.3.3
is-buffer: 2.0.5
is-node-process: 1.2.0
throttleit: 2.1.0
undici: 5.29.0
optional: true
undici: 6.23.0
'@vercel/nft@0.24.4(encoding@0.1.13)':
dependencies:
@@ -19853,7 +19836,7 @@ snapshots:
dependencies:
tslib: 2.8.1
astro@5.16.0(@types/node@24.10.1)(@vercel/blob@2.0.0)(db0@0.3.4)(ioredis@5.8.2)(jiti@2.6.1)(less@4.2.0)(rollup@4.59.0)(sass@1.77.8)(stylus@0.56.0)(terser@5.44.1)(typescript@5.9.3)(yaml@2.8.0):
astro@5.16.0(@types/node@24.10.1)(@vercel/blob@2.3.0)(db0@0.3.4)(ioredis@5.8.2)(jiti@2.6.1)(less@4.2.0)(rollup@4.59.0)(sass@1.77.8)(stylus@0.56.0)(terser@5.44.1)(typescript@5.9.3)(yaml@2.8.0):
dependencies:
'@astrojs/compiler': 2.13.0
'@astrojs/internal-helpers': 0.7.5
@@ -19908,7 +19891,7 @@ snapshots:
ultrahtml: 1.6.0
unifont: 0.6.0
unist-util-visit: 5.0.0
unstorage: 1.17.3(@vercel/blob@2.0.0)(db0@0.3.4)(ioredis@5.8.2)
unstorage: 1.17.3(@vercel/blob@2.3.0)(db0@0.3.4)(ioredis@5.8.2)
vfile: 6.0.3
vite: 6.4.1(@types/node@24.10.1)(jiti@2.6.1)(less@4.2.0)(sass@1.77.8)(stylus@0.56.0)(terser@5.44.1)(yaml@2.8.0)
vitefu: 1.1.1(vite@6.4.1(@types/node@24.10.1)(jiti@2.6.1)(less@4.2.0)(sass@1.77.8)(stylus@0.56.0)(terser@5.44.1)(yaml@2.8.0))
@@ -19962,7 +19945,6 @@ snapshots:
async-retry@1.3.3:
dependencies:
retry: 0.13.1
optional: true
async-sema@3.1.1: {}
@@ -23128,8 +23110,7 @@ snapshots:
is-buffer@1.1.6: {}
is-buffer@2.0.5:
optional: true
is-buffer@2.0.5: {}
is-builtin-module@3.2.1:
dependencies:
@@ -23201,8 +23182,7 @@ snapshots:
is-negative-zero@2.0.3: {}
is-node-process@1.2.0:
optional: true
is-node-process@1.2.0: {}
is-number-object@1.1.1:
dependencies:
@@ -23337,7 +23317,7 @@ snapshots:
istanbul-lib-instrument@5.2.1:
dependencies:
'@babel/core': 7.16.12
'@babel/parser': 7.28.5
'@babel/parser': 7.29.0
'@istanbuljs/schema': 0.1.3
istanbul-lib-coverage: 3.2.2
semver: 7.7.3
@@ -24870,7 +24850,7 @@ snapshots:
node-gyp-build: 4.8.4
optional: true
nitropack@2.8.1(@vercel/blob@2.0.0)(db0@0.3.4)(encoding@0.1.13)(ioredis@5.8.2)(xml2js@0.6.2):
nitropack@2.8.1(@vercel/blob@2.3.0)(db0@0.3.4)(encoding@0.1.13)(ioredis@5.8.2)(xml2js@0.6.2):
dependencies:
'@cloudflare/kv-asset-handler': 0.3.4
'@netlify/functions': 2.8.2
@@ -24935,7 +24915,7 @@ snapshots:
unctx: 2.4.1
unenv: 1.10.0
unimport: 3.14.6(rollup@4.53.3)
unstorage: 1.17.3(@vercel/blob@2.0.0)(db0@0.3.4)(ioredis@5.8.2)
unstorage: 1.17.3(@vercel/blob@2.3.0)(db0@0.3.4)(ioredis@5.8.2)
optionalDependencies:
xml2js: 0.6.2
transitivePeerDependencies:
@@ -25532,7 +25512,7 @@ snapshots:
parse-json@5.2.0:
dependencies:
'@babel/code-frame': 7.28.6
'@babel/code-frame': 7.29.0
error-ex: 1.3.2
json-parse-even-better-errors: 2.3.1
lines-and-columns: 1.2.4
@@ -27883,8 +27863,7 @@ snapshots:
throat@5.0.0: {}
throttleit@2.1.0:
optional: true
throttleit@2.1.0: {}
through2@2.0.5:
dependencies:
@@ -28158,13 +28137,10 @@ snapshots:
dependencies:
'@fastify/busboy': 2.1.1
undici@5.29.0:
dependencies:
'@fastify/busboy': 2.1.1
optional: true
undici@6.21.3: {}
undici@6.23.0: {}
unenv@1.10.0:
dependencies:
consola: 3.4.2
@@ -28352,7 +28328,7 @@ snapshots:
'@unrs/resolver-binding-win32-ia32-msvc': 1.6.2
'@unrs/resolver-binding-win32-x64-msvc': 1.6.2
unstorage@1.17.3(@vercel/blob@2.0.0)(db0@0.3.4)(ioredis@5.8.2):
unstorage@1.17.3(@vercel/blob@2.3.0)(db0@0.3.4)(ioredis@5.8.2):
dependencies:
anymatch: 3.1.3
chokidar: 4.0.3
@@ -28363,7 +28339,7 @@ snapshots:
ofetch: 1.5.1
ufo: 1.6.1
optionalDependencies:
'@vercel/blob': 2.0.0
'@vercel/blob': 2.3.0
db0: 0.3.4
ioredis: 5.8.2
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -6,12 +6,13 @@
"main": "main.ts",
"type": "module",
"scripts": {
"start": "node ./src/main.ts"
"start": "node --env-file-if-exists=.env ./src/main.ts"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@vercel/blob": "^2.3.0",
"fs-extra": "^11.2.0",
"minimist": "^1.2.8",
"oslllo-svg-fixer": "^5.0.0",
+13 -12
View File
@@ -2,18 +2,18 @@ import { type IconAliases } from '@lucide/helpers';
import path from 'path';
import { promises as fs } from 'fs';
import { cwd } from 'process';
import { put } from '@vercel/blob';
const VERCEL_BLOB_CODEPOINTS_PATH = 'latest/font/codepoints.json';
export type CodePoints = Record<string, number>;
async function getLatestCodePoints(): Promise<CodePoints> {
// This is for the first release where no codepoints.json exists yet
const codepointsContents = await fs.readFile(path.join(cwd(), 'codepoints.json'), 'utf-8');
const codepointsContents = await fetch(
`https://geoxmjocxfnaryc4.public.blob.vercel-storage.com/${VERCEL_BLOB_CODEPOINTS_PATH}`,
);
return JSON.parse(codepointsContents) as CodePoints;
// TODO: Next releases will use the codepoints.json from latest release in lucide-static.
// const codepointsContents = await fetch('https://unpkg.com/lucide-static@latest/font/codepoints.json')
// return codepointsContents.json() as Promise<CodePoints>
return codepointsContents.json() as Promise<CodePoints>;
}
interface AllocateCodePointsOptions {
@@ -49,11 +49,12 @@ export async function allocateCodePoints({
);
if (saveCodePoints) {
await fs.writeFile(
path.join(cwd(), 'codepoints.json'),
JSON.stringify(baseCodePoints, null, 2),
'utf-8',
);
const content = JSON.stringify(baseCodePoints, null, 2);
await fs.writeFile(path.join(cwd(), 'codepoints.json'), content, 'utf-8');
await put(VERCEL_BLOB_CODEPOINTS_PATH, content, { access: 'public', allowOverwrite: true });
console.log('Code points saved to codepoints.json and uploaded to Vercel Blob Storage.');
}
return baseCodePoints;
+6
View File
@@ -20,6 +20,12 @@ const iconsDir = path.join(repoRoot, 'icons');
const outlinedDir = path.join(repoRoot, 'outlined');
const targetDir = path.join(repoRoot, outputDir);
if (saveCodePoints && !process.env.BLOB_READ_WRITE_TOKEN) {
throw new Error(
'Saving code points requires BLOB_READ_WRITE_TOKEN environment variable to be set.',
);
}
const iconsWithAliases = await getAllIconAliases(iconsDir);
await outlineSVG({