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

Support yarn 3 lockfile entries #643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
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
11 changes: 8 additions & 3 deletions cli/internal/fs/yarn_lockfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ package fs

type LockfileEntry struct {
// resolved version for the particular entry based on the provided semver revision
Version string `yaml:"version"`
Resolved string `yaml:"resolved"`
Integrity string `yaml:"integrity"`
Version string `yaml:"version"`
Resolved string `yaml:"resolved,omitempty"`
Integrity string `yaml:"integrity,omitempty"`
Resolution string `yaml:"resolution,omitempty"`
// the list of unresolved modules and revisions (e.g. type-detect : ^4.0.0)
Dependencies map[string]string `yaml:"dependencies,omitempty"`
// the list of unresolved modules and revisions (e.g. type-detect : ^4.0.0)
OptionalDependencies map[string]string `yaml:"optionalDependencies,omitempty"`
Checksum string `yaml:"checksum,omitempty"`
Conditions string `yaml:"conditions,omitempty"`
LanguageName string `yaml:"languageName,omitempty"`
LinkType string `yaml:"linkType,omitempty"`
}

type YarnLockfile map[string]*LockfileEntry
2 changes: 1 addition & 1 deletion cli/internal/prune/prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ func (c *PruneCommand) Run(args []string) int {
if ctx.Backend.Name == "nodejs-yarn" {
tmpGeneratedLockfileWriter.WriteString("# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n# yarn lockfile v1\n\n")
} else {
tmpGeneratedLockfileWriter.WriteString("# This file is generated by running \"yarn install\" inside your project.\n# Manual changes might be lost - proceed with caution!\n\n__metadata:\nversion: 5\ncacheKey: 8\n\n")
tmpGeneratedLockfileWriter.WriteString("# This file is generated by running \"yarn install\" inside your project.\n# Manual changes might be lost - proceed with caution!\n\n__metadata:\n version: 5\n cacheKey: 8\n")
}

// because of yarn being yarn, we need to inject lines in between each block of YAML to make it "valid" SYML
Expand Down