Skip to content

Comments

upgrade golang add additional clients#4

Merged
donseba merged 1 commit intomainfrom
upgrade
Mar 12, 2025
Merged

upgrade golang add additional clients#4
donseba merged 1 commit intomainfrom
upgrade

Conversation

@donseba
Copy link
Owner

@donseba donseba commented Mar 12, 2025

This pull request introduces several updates to improve the functionality and documentation of the go-importmap package. The main changes include the addition of new funding models, the setup of a Go linter workflow, and significant enhancements to the README documentation. Additionally, new CDN clients and tests have been added to support various providers.

Enhancements to documentation:

  • README.md: Simplified the package description, updated the features list, and added detailed usage examples. Removed outdated file structure information and added a new section on raw imports. [1] [2] [3] [4]

New funding models:

  • .github/FUNDING.yml: Added multiple supported funding model platforms including GitHub Sponsors, Patreon, Open Collective, and more.

Workflow improvements:

New CDN clients and tests:

Code quality improvements:

@donseba donseba requested a review from Copilot March 12, 2025 08:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request updates the go-importmap package to improve functionality and documentation. Key changes include the addition of new CDN clients (esm.sh, skypack, unpkg, raw), the introduction of a GitHub Actions workflow for golangci-lint, and significant enhancements to the README.

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/workflows/golangci-lint.yml Added GitHub Actions workflow to run golangci-lint on push/PR events
client/esmsh/esmsh.go Added new client to fetch package files from esm.sh
client/esmsh/esmsh_test.go Added tests for the esm.sh client
client/skypack/skypack.go & _test.go New client and tests for fetching package files from skypack
client/unpkg/unpkg.go & _test.go New client and tests for fetching package files from unpkg
client/jsdelivr/jsdelivr.go & _test.go Updated error message formatting and adjusted test context usage
client/cdnjs/cdnjs.go & _test.go Updated error message formatting for improved consistency
client/raw/raw.go Added a raw provider and its error handling
README.md Updated package description, new sections for supported providers, and a quick example
importmap.go Updated default shim URL and provider handling in Fetch and logging
library/package.go Introduced the Provider interface into the Package struct
Comments suppressed due to low confidence (2)

client/raw/raw.go:24

  • Consider validating the raw provider URL during initialization (in New) rather than waiting until FetchPackageFiles is called, to catch configuration errors earlier.
if p.URL == "" {

client/jsdelivr/jsdelivr.go:79

  • [nitpick] Including the client name (e.g. jsdelivr) in the error message could improve clarity when debugging API response issues.
return nil, "", fmt.Errorf("client api responded with code %d", resp.StatusCode)

@donseba donseba merged commit 1f85070 into main Mar 12, 2025
1 check passed
@donseba donseba deleted the upgrade branch March 12, 2025 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant