当我使用[npm i generator jhipster]下载生成器jhipster时,我发现了一些与github的where不同的地方,例如[generators\server\templates\src\main\java\package\repository\PersistenceAuditEventRepository.java.ejs]
<%_ if (reactive) { _%>
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
<%_ } _%>
import java.time.Instant;
<%_ if (!reactive) { _%>
import java.util.List;
<%_ } _%>
/**
* Spring Data <% if (databaseType === 'sql') { %>JPA<% } else if (databaseType === 'mongodb') { %>MongoDB<% } else if (databaseType === 'couchbase') { %>Couchbase<% } %> repository for the {@link PersistentAuditEvent} entity.
*/
这是githup 的代码
<%_ if (reactive) { _%>
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
<%_ } _%>
import java.time.Instant;
<%_ if (databaseType === 'sql' && reactive) { _%>
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.Map;
<%_ } _%>
<%_ if (!reactive) { _%>
import java.util.List;
<%_ } _%>
/**
* Spring Data <% if (databaseType === 'sql' && !reactive) { %>JPA<% } else if (databaseType === 'sql' && reactive) { %>R2DBC<% } else if (databaseType === 'mongodb') { %>MongoDB<% } else if (databaseType === 'couchbase') { %>Couchbase<% } %> repository for the {@link PersistentAuditEvent} entity.
*/
https://github.com/jhipster/generator-jhipster/blob/master/generators/server/templates/src/main/java/package/repository/PersistenceAuditEventRepository.java.ejs
我们可以清楚地看到,在npm安装的代码中,没有关于[(databaseType==='sql'&&reactive(]的判断。重要的是,他们的包.json都是6.8.0,我完全混淆了
您在GitHub中看到的内容不一定与您安装的内容相匹配,因为在GitHub上您看到的更改尚未发布。
特别是,版本6.8.0
于2020年3月8日发布,而您提到的更改是在版本6.8.0
发布后的2020(此处(提交的。
存储库包含最新的更改,而版本发布是某个日期回购的快照(被认为是稳定的(。