Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions scripts/build-r2-symlinks.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ const cachedDirectories = {
// Let's add these to our cached directories.
const fileSymlinks = JSON.parse(await readFile(FILE_SYMLINKS, 'utf8'));

// Delete this for now, we'll add it back again later
// Delete these for now, we'll add them back again later
delete fileSymlinks['node-config-schema.json'];
delete fileSymlinks['llms.txt'];

for (const file of Object.keys(fileSymlinks)) {
// Stat the actual file so we can get it's size, last modified
Expand Down Expand Up @@ -163,10 +164,12 @@ for (const file of Object.keys(fileSymlinks)) {

await writeFile(CACHED_DIRECTORIES_OUT, JSON.stringify(cachedDirectories));

// Update the node-config-schema.json file symlink to point to the latest
// version
// Update the node-config-schema.json and llms.txt file symlinks to point to
// the latest version
fileSymlinks['node-config-schema.json'] =
`${RELEASE_DIR}${latestVersions['latest']}/docs/node-config-schema.json`;
fileSymlinks['llms.txt'] =
`${RELEASE_DIR}${latestVersions['latest']}/docs/llms.txt`;

await writeFile(FILE_SYMLINKS, JSON.stringify(fileSymlinks));

Expand Down
3 changes: 2 additions & 1 deletion src/constants/fileSymlinks.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,6 @@
"nodejs/release/v0.1.15/node-v0.1.15.tar.gz": "nodejs/release/node-v0.1.15.tar.gz",
"nodejs/release/v0.4.12/node-v0.4.12.tar.gz": "nodejs/release/node-v0.4.12.tar.gz",
"nodejs/release/v0.1.32/node-v0.1.32.tar.gz": "nodejs/release/node-v0.1.32.tar.gz",
"node-config-schema.json": "nodejs/release/v25.7.0/docs/node-config-schema.json"
"node-config-schema.json": "nodejs/release/v25.7.0/docs/node-config-schema.json",
"llms.txt": "nodejs/release/v25.7.0/docs/llms.txt"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file doesn't seem to exist yet?

}
3 changes: 2 additions & 1 deletion src/middleware/r2Middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ function getR2Path({
}
} else if (
pathname.startsWith('/metrics') ||
pathname === '/node-config-schema.json'
pathname === '/node-config-schema.json' ||
pathname === '/llms.txt'
) {
// Substring to cut off the leading /
return pathname.substring(1);
Expand Down
3 changes: 3 additions & 0 deletions src/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ export function registerRoutes(router: Router): void {
router.head('/node-config-schema.json', r2Middleware);
router.get('/node-config-schema.json', r2Middleware);

router.head('/llms.txt', r2Middleware);
router.get('/llms.txt', r2Middleware);

router.head('/dist/?:filePath+', r2Middleware, originMiddleware);
router.get('/dist/?:filePath+', cachedR2Middleware, originMiddleware);

Expand Down