这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@siggisim
Copy link
Member

@siggisim siggisim commented Jun 7, 2024

This allows you to use a npm package directly as a module.

Depending on an unscoped npm package at a version:

bazel_dep(name = "docusaurus", version = "npm+1.14.7")

Depending on a scoped npm package at a version:

bazel_dep(name = "docusaurus_core", version = "npm.docusaurus+3.4.0")

@siggisim siggisim requested a review from tylerwilliams June 7, 2024 23:54
bytes, status, err := handleNPM(path)
w.WriteHeader(status)
if err != nil {
log.Printf("error serving npm module %s: %s", path, err)
Copy link
Member

Choose a reason for hiding this comment

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

log.Errorf if you want to get fancy

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

}

if len(pathPaths) > 3 && pathPaths[1] == "modules" && strings.HasPrefix(pathPaths[3], "npm") {
bytes, status, err := handleNPM(path)
Copy link
Member

Choose a reason for hiding this comment

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

s/bytes/buf/g

Copy link
Member

Choose a reason for hiding this comment

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

b/c bytes is a commonly used package already

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@siggisim siggisim enabled auto-merge (squash) June 8, 2024 00:31
@siggisim siggisim merged commit 9ee6a75 into master Jun 8, 2024
@siggisim siggisim deleted the siggi-dev-branch-20240607-165234 branch June 8, 2024 00:32
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.

3 participants