@joshski/dust 0.1.61 → 0.1.62
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/artifacts/index.d.ts +3 -2
- package/dist/artifacts.js +29 -1
- package/package.json +1 -1
|
@@ -3,9 +3,10 @@ import { type Fact } from './facts';
|
|
|
3
3
|
import { type Idea, type IdeaOpenQuestion, type IdeaOption, parseOpenQuestions } from './ideas';
|
|
4
4
|
import { type Principle } from './principles';
|
|
5
5
|
import { type Task } from './tasks';
|
|
6
|
-
import { type CreateIdeaTransitionTaskResult, type DecomposeIdeaOptions, type OpenQuestionResponse, type ParsedCaptureIdeaTask, type WorkflowTaskMatch } from './workflow-tasks';
|
|
6
|
+
import { CAPTURE_IDEA_PREFIX, type CreateIdeaTransitionTaskResult, type DecomposeIdeaOptions, findAllCaptureIdeaTasks, type IdeaInProgress, type OpenQuestionResponse, type ParsedCaptureIdeaTask, type WorkflowTaskMatch } from './workflow-tasks';
|
|
7
7
|
export type { CreateIdeaTransitionTaskResult, DecomposeIdeaOptions, Fact, Idea, IdeaOpenQuestion, IdeaOption, OpenQuestionResponse, ParsedCaptureIdeaTask, Principle, Task, WorkflowTaskMatch, };
|
|
8
|
-
export { parseOpenQuestions };
|
|
8
|
+
export { CAPTURE_IDEA_PREFIX, findAllCaptureIdeaTasks, parseOpenQuestions };
|
|
9
|
+
export type { IdeaInProgress };
|
|
9
10
|
export interface ArtifactsRepository {
|
|
10
11
|
parseIdea(options: {
|
|
11
12
|
slug: string;
|
package/dist/artifacts.js
CHANGED
|
@@ -273,6 +273,32 @@ async function parseTask(fileSystem, dustPath, slug) {
|
|
|
273
273
|
// lib/artifacts/workflow-tasks.ts
|
|
274
274
|
var CAPTURE_IDEA_PREFIX = "Add Idea: ";
|
|
275
275
|
var BUILD_IDEA_PREFIX = "Build Idea: ";
|
|
276
|
+
async function findAllCaptureIdeaTasks(fileSystem, dustPath) {
|
|
277
|
+
const tasksPath = `${dustPath}/tasks`;
|
|
278
|
+
if (!fileSystem.exists(tasksPath))
|
|
279
|
+
return [];
|
|
280
|
+
const files = await fileSystem.readdir(tasksPath);
|
|
281
|
+
const results = [];
|
|
282
|
+
for (const file of files.filter((f) => f.endsWith(".md")).sort()) {
|
|
283
|
+
const content = await fileSystem.readFile(`${tasksPath}/${file}`);
|
|
284
|
+
const titleMatch = content.match(/^#\s+(.+)$/m);
|
|
285
|
+
if (!titleMatch)
|
|
286
|
+
continue;
|
|
287
|
+
const title = titleMatch[1].trim();
|
|
288
|
+
if (title.startsWith(CAPTURE_IDEA_PREFIX)) {
|
|
289
|
+
results.push({
|
|
290
|
+
taskSlug: file.replace(/\.md$/, ""),
|
|
291
|
+
ideaTitle: title.slice(CAPTURE_IDEA_PREFIX.length)
|
|
292
|
+
});
|
|
293
|
+
} else if (title.startsWith(BUILD_IDEA_PREFIX)) {
|
|
294
|
+
results.push({
|
|
295
|
+
taskSlug: file.replace(/\.md$/, ""),
|
|
296
|
+
ideaTitle: title.slice(BUILD_IDEA_PREFIX.length)
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return results;
|
|
301
|
+
}
|
|
276
302
|
function titleToFilename(title) {
|
|
277
303
|
return `${title.toLowerCase().replace(/\./g, "-").replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "")}.md`;
|
|
278
304
|
}
|
|
@@ -594,6 +620,8 @@ function buildReadOnlyArtifactsRepository(fileSystem, dustPath) {
|
|
|
594
620
|
}
|
|
595
621
|
export {
|
|
596
622
|
parseOpenQuestions,
|
|
623
|
+
findAllCaptureIdeaTasks,
|
|
597
624
|
buildReadOnlyArtifactsRepository,
|
|
598
|
-
buildArtifactsRepository
|
|
625
|
+
buildArtifactsRepository,
|
|
626
|
+
CAPTURE_IDEA_PREFIX
|
|
599
627
|
};
|