spur-board 0.32.0 → 0.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/daemon.mjs +10 -4
- package/package.json +1 -1
package/dist/daemon.mjs
CHANGED
|
@@ -7904,16 +7904,22 @@ function trackerSource(project) {
|
|
|
7904
7904
|
function projectForSource(config, source) {
|
|
7905
7905
|
return config.projects.find((project) => source === trackerSource(project) || project.repos.some((repo) => source === `github:${project.id}:${repo.toLowerCase()}`));
|
|
7906
7906
|
}
|
|
7907
|
+
/** The one project whose tracker takes `key` by its form: Jira for `ABC-1`, GitHub for `#`. */
|
|
7907
7908
|
function projectForKey(config, key) {
|
|
7909
|
+
const parsed = parseRef$1(key, "task");
|
|
7910
|
+
if (!parsed.ok || parsed.value.kind !== "task") return null;
|
|
7911
|
+
const { form } = parsed.value;
|
|
7908
7912
|
const lowerKey = key.toLowerCase();
|
|
7909
7913
|
const matched = config.projects.filter((project) => {
|
|
7910
7914
|
const tracker = project.tracker;
|
|
7911
7915
|
if (tracker.type === "github-issues") {
|
|
7912
|
-
const
|
|
7913
|
-
const
|
|
7914
|
-
|
|
7916
|
+
const repo = lowerKey.split("#")[0];
|
|
7917
|
+
const full = tracker.repo.toLowerCase();
|
|
7918
|
+
if (form === "github") return repo === full;
|
|
7919
|
+
return form === "github-short" && repo === full.split("/")[1];
|
|
7915
7920
|
}
|
|
7916
|
-
|
|
7921
|
+
if (form !== "jira") return false;
|
|
7922
|
+
const prefix = key.split("-")[0]?.toUpperCase();
|
|
7917
7923
|
return prefix !== void 0 && (tracker.projectKeys.length === 0 || tracker.projectKeys.includes(prefix));
|
|
7918
7924
|
});
|
|
7919
7925
|
return matched.length === 1 ? matched[0] ?? null : null;
|