Skip to content

Commit b863408

Browse files
committed
fix: orion declaration of target outputs for non-updated dirs
1 parent d0cbbe9 commit b863408

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

language/js/generate.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,12 @@ func (ts *typeScriptLang) GenerateRules(args language.GenerateArgs) language.Gen
113113
}
114114

115115
func (ts *typeScriptLang) tsPackageInfoToRelsToIndex(cfg *JsGazelleConfig, args language.GenerateArgs, info *TsProjectInfo) []string {
116-
i := []string{
117-
// Might be an npm package reference
118-
cfg.PnpmLockDir(),
116+
i := []string{}
117+
118+
if p := ts.pnpmProjects.GetProject(cfg.rel); p != nil {
119+
for _, pkg := range p.GetLocalReferences() {
120+
i = append(i, pkg)
121+
}
119122
}
120123

121124
for it := info.imports.Iterator(); it.Next(); {

language/orion/resolver.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ func symbolToImportSpec(symbol plugin.Symbol) resolve.ImportSpec {
4343
}
4444

4545
const extGeneratedRules = "__starzelle_generated_rules"
46+
const extGeneratedRulesPkg = "__starzelle_generated_rules_pkg"
4647

4748
func (re *GazelleHost) importsGenerateRules(cfg *BUILDConfig, c *config.Config, f *rule.File) gazelleLanguage.GenerateResult {
4849
BazelLog.Debugf("Imports.GenerateRules(%s): //%s", GazelleLanguageName, f.Pkg)
@@ -84,8 +85,9 @@ func (re *GazelleHost) Imports(c *config.Config, r *rule.Rule, f *rule.File) []r
8485
//
8586
// When running partial generations this means we must manually invoke GenerateRules() if it
8687
// was not invoked by gazelle as part of the partial run.
87-
if c.Exts[extGeneratedRules] == nil {
88+
if c.Exts[extGeneratedRulesPkg] != cfg.rel {
8889
c.Exts[extGeneratedRules] = re.importsGenerateRules(cfg, c, f)
90+
c.Exts[extGeneratedRulesPkg] = cfg.rel
8991
}
9092

9193
// Find this rule in the host-generated rules

0 commit comments

Comments
 (0)