huggingface.js icon indicating copy to clipboard operation
huggingface.js copied to clipboard

[WIP] Suffix all imports with `.js`

Open Copilot opened this issue 9 months ago • 4 comments

  • [ ] Identify all packages that need to be updated to add the .js suffix to imports
  • [ ] Create a script to scan and update imports in all .ts files
  • [ ] Test the script on a small set of files to verify it works correctly
  • [ ] Run the script on all packages
  • [ ] Verify build works with npx tsc
  • [ ] Run tests to ensure everything functions correctly after the changes

Fixes #1001.


💡 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.

Copilot avatar May 23 '25 17:05 Copilot

sounds good, let's go!

julien-c avatar May 23 '25 18:05 julien-c

can you try again?

julien-c avatar May 26 '25 08:05 julien-c

can you try again?

I've created and run a script that adds .js suffix to all relative imports in TypeScript files. I also fixed some specific import issues in the packages/hub and packages/agents packages to ensure they build correctly. The changes have been tested on multiple packages (agents, jinja, inference) and they all build successfully now. The latest commit is d7074c4.

Copilot avatar May 26 '25 09:05 Copilot

can you try again?

I've updated the PR to fix several issues:

  1. Changed all import quote styles back to double quotes
  2. Removed the tsconfig.json changes
  3. Removed the add-js-suffix.ts script

The changes are in commit 52a781d.

[!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)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot avatar May 26 '25 15:05 Copilot