@miketromba/issy-app 0.10.1 → 0.11.0

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.
Files changed (3) hide show
  1. package/dist/app.js +60 -60
  2. package/dist/server.js +18 -33
  3. package/package.json +2 -2
package/dist/server.js CHANGED
@@ -133,6 +133,21 @@ function getBlockingIssues(issue, issues) {
133
133
  function isIssueUnblocked(issue, issues) {
134
134
  return issue.frontmatter.status === "open" && getBlockingIssues(issue, issues).length === 0;
135
135
  }
136
+ function compareIssuesByRoadmapOrder(a, b) {
137
+ const orderA = a.frontmatter.order;
138
+ const orderB = b.frontmatter.order;
139
+ if (orderA && orderB) {
140
+ if (orderA < orderB)
141
+ return -1;
142
+ if (orderA > orderB)
143
+ return 1;
144
+ }
145
+ if (orderA && !orderB)
146
+ return -1;
147
+ if (!orderA && orderB)
148
+ return 1;
149
+ return a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
150
+ }
136
151
  function getIssueIdFromFilename(filename) {
137
152
  const match = filename.match(/^(\d+)-/);
138
153
  return match ? match[1] : filename.replace(".md", "");
@@ -175,17 +190,7 @@ async function getAllIssues() {
175
190
  content: body
176
191
  });
177
192
  }
178
- return issues.sort((a, b) => {
179
- const orderA = a.frontmatter.order;
180
- const orderB = b.frontmatter.order;
181
- if (orderA && orderB)
182
- return orderA < orderB ? -1 : orderA > orderB ? 1 : 0;
183
- if (orderA && !orderB)
184
- return -1;
185
- if (!orderA && orderB)
186
- return 1;
187
- return a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
188
- });
193
+ return issues.sort(compareIssuesByRoadmapOrder);
189
194
  }
190
195
  // ../core/src/lib/query-parser.ts
191
196
  var SUPPORTED_QUALIFIERS = new Set([
@@ -1608,17 +1613,7 @@ function filterAndSearchIssues(issues, filters) {
1608
1613
  function sortIssues(issues, sortBy) {
1609
1614
  const sortOption = sortBy.toLowerCase();
1610
1615
  if (sortOption === "roadmap") {
1611
- issues.sort((a, b) => {
1612
- const orderA = a.frontmatter.order;
1613
- const orderB = b.frontmatter.order;
1614
- if (orderA && orderB)
1615
- return orderA < orderB ? -1 : orderA > orderB ? 1 : 0;
1616
- if (orderA && !orderB)
1617
- return -1;
1618
- if (!orderA && orderB)
1619
- return 1;
1620
- return a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
1621
- });
1616
+ issues.sort(compareIssuesByRoadmapOrder);
1622
1617
  } else if (sortOption === "priority") {
1623
1618
  const priorityOrder = {
1624
1619
  high: 0,
@@ -1672,17 +1667,7 @@ function sortIssues(issues, sortBy) {
1672
1667
  } else if (sortOption === "id") {
1673
1668
  issues.sort((a, b) => b.id.localeCompare(a.id));
1674
1669
  } else {
1675
- issues.sort((a, b) => {
1676
- const orderA = a.frontmatter.order;
1677
- const orderB = b.frontmatter.order;
1678
- if (orderA && orderB)
1679
- return orderA < orderB ? -1 : orderA > orderB ? 1 : 0;
1680
- if (orderA && !orderB)
1681
- return -1;
1682
- if (!orderA && orderB)
1683
- return 1;
1684
- return a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
1685
- });
1670
+ issues.sort(compareIssuesByRoadmapOrder);
1686
1671
  }
1687
1672
  }
1688
1673
  function filterByQuery(issues, query) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miketromba/issy-app",
3
- "version": "0.10.1",
3
+ "version": "0.11.0",
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.1",
38
+ "@miketromba/issy-core": "^0.11.0",
39
39
  "bun-plugin-tailwind": "^0.1.2"
40
40
  },
41
41
  "devDependencies": {