@miketromba/issy-app 0.10.0 → 0.10.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/server.js CHANGED
@@ -98,6 +98,41 @@ function yamlUnquote(value) {
98
98
  }
99
99
  return value;
100
100
  }
101
+ function parseDependencyIds(dependsOn) {
102
+ if (!dependsOn)
103
+ return [];
104
+ const seen = new Set;
105
+ const ids = [];
106
+ for (const token of dependsOn.split(/[,\s]+/)) {
107
+ const value = token.trim().replace(/^['"]+|['"]+$/g, "").replace(/^#/, "");
108
+ if (!/^\d+$/.test(value))
109
+ continue;
110
+ const id = value.padStart(4, "0");
111
+ if (seen.has(id))
112
+ continue;
113
+ seen.add(id);
114
+ ids.push(id);
115
+ }
116
+ return ids;
117
+ }
118
+ function filterExistingDependencyIds(dependsOn, issues, excludeId) {
119
+ const existingIds = new Set(issues.map((issue) => issue.id));
120
+ const excludedId = excludeId?.padStart(4, "0");
121
+ return parseDependencyIds(dependsOn).filter((id) => existingIds.has(id) && id !== excludedId);
122
+ }
123
+ function getDependencyIssues(issue, issues) {
124
+ const dependencyIds = filterExistingDependencyIds(issue.frontmatter.depends_on, issues, issue.id);
125
+ if (dependencyIds.length === 0)
126
+ return [];
127
+ const issueById = new Map(issues.map((i) => [i.id, i]));
128
+ return dependencyIds.map((id) => issueById.get(id)).filter((dependency) => Boolean(dependency));
129
+ }
130
+ function getBlockingIssues(issue, issues) {
131
+ return getDependencyIssues(issue, issues).filter((dependency) => dependency.frontmatter.status === "open");
132
+ }
133
+ function isIssueUnblocked(issue, issues) {
134
+ return issue.frontmatter.status === "open" && getBlockingIssues(issue, issues).length === 0;
135
+ }
101
136
  function getIssueIdFromFilename(filename) {
102
137
  const match = filename.match(/^(\d+)-/);
103
138
  return match ? match[1] : filename.replace(".md", "");
@@ -1659,6 +1694,14 @@ function filterByQuery(issues, query) {
1659
1694
  if (issue.frontmatter.status !== statusValue) {
1660
1695
  return false;
1661
1696
  }
1697
+ } else if (statusValue === "unblocked") {
1698
+ if (!isIssueUnblocked(issue, issues)) {
1699
+ return false;
1700
+ }
1701
+ } else if (statusValue === "blocked") {
1702
+ if (issue.frontmatter.status !== "open" || isIssueUnblocked(issue, issues)) {
1703
+ return false;
1704
+ }
1662
1705
  }
1663
1706
  }
1664
1707
  if (parsed.qualifiers.priority) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miketromba/issy-app",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "Local web UI and API server for issy",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -35,7 +35,7 @@
35
35
  "node": ">=18.0.0"
36
36
  },
37
37
  "dependencies": {
38
- "@miketromba/issy-core": "^0.10.0",
38
+ "@miketromba/issy-core": "^0.10.1",
39
39
  "bun-plugin-tailwind": "^0.1.2"
40
40
  },
41
41
  "devDependencies": {