[hub] Export HUB_URL constant for consumers
This PR exports the HUB_URL constant from the hub package so that consumers can directly access it in their applications.
Changes
- Added
export { HUB_URL } from "./consts";topackages/hub/src/index.ts - Added a "Constants" section to the README.md explaining the exported HUB_URL constant and how to use it
Usage Example
import { HUB_URL } from "@huggingface/hub";
console.log(HUB_URL); // https://huggingface.co
// Can be useful when constructing URLs or checking against the default URL
const customHubUrl = process.env.CUSTOM_HUB_URL || HUB_URL;
This is useful for applications that need to reference the default hub URL or construct hub-related URLs in their code, without having to define the constant themselves.
Fixes #1336.
[!WARNING]
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
hg.mozilla.org
- Triggering command:
node ./dist/install.js(dns block)hub-ci.huggingface.co
- Triggering command:
node /home/REDACTED/work/huggingface.js/huggingface.js/node_modules/.bin/../vitest/vitest.mjs run(dns block)huggingface.co
- Triggering command:
node /home/REDACTED/work/huggingface.js/huggingface.js/node_modules/.bin/../vitest/vitest.mjs run(dns block)If you need me to access, download, or install something from one of these locations, you can either:
- Configure Actions setup steps to set up my environment, which run before the firewall is enabled
- Add the appropriate URLs or hosts to my firewall allow list
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
BIG SUCCESS
Please revert the changes to package-lock.json
Otherwise, kittens might die.
I've removed the package-lock.json file as requested in commit 08a3af2. The repository now only contains the necessary changes for exporting the HUB_URL constant.
[!WARNING]
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
cdn.fwupd.org
- Triggering command:
/usr/bin/fwupdmgr refresh(dns block)hub-ci.huggingface.co
- Triggering command:
node /home/REDACTED/work/huggingface.js/huggingface.js/node_modules/.bin/../vitest/vitest.mjs run(dns block)huggingface.co
- Triggering command:
node /home/REDACTED/work/huggingface.js/huggingface.js/node_modules/.bin/../vitest/vitest.mjs run(dns block)If you need me to access, download, or install something from one of these locations, you can either:
- Configure Actions setup steps to set up my environment, which run before the firewall is enabled
- Add the appropriate URLs or hosts to my firewall allow list
so smooth
so smooth
i don't see a strong difference with humans so far
@julien-c Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.
You can ask me to try again later by mentioning me in a new comment.
If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: dd3a6423-ff9a-43ee-99ff-d7da81f117b3
Sorry for the inconvenience!
lmao
@julien-c Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.
You can ask me to try again later by mentioning me in a new comment.
If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: b2e78aad-45f0-4427-accf-6e44d75bab32
Sorry for the inconvenience!
also revert the changes to hub/README.md, we don't really care
I've reverted the changes to hub/README.md as requested in commit 2d198cd. The HUB_URL export in index.ts remains intact as that's the core functionality of this PR.