@joshski/dust 0.1.25 → 0.1.26
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/workflow-tasks.d.ts +1 -1
- package/dist/workflow-tasks.js +10 -5
- package/package.json +1 -1
package/dist/workflow-tasks.d.ts
CHANGED
|
@@ -22,4 +22,4 @@ export interface CreateIdeaTransitionTaskResult {
|
|
|
22
22
|
export declare function createRefineIdeaTask(fileSystem: FileSystem, dustPath: string, ideaSlug: string, description?: string): Promise<CreateIdeaTransitionTaskResult>;
|
|
23
23
|
export declare function createTaskFromIdea(fileSystem: FileSystem, dustPath: string, ideaSlug: string, description?: string): Promise<CreateIdeaTransitionTaskResult>;
|
|
24
24
|
export declare function createShelveIdeaTask(fileSystem: FileSystem, dustPath: string, ideaSlug: string, description?: string): Promise<CreateIdeaTransitionTaskResult>;
|
|
25
|
-
export declare function createCaptureIdeaTask(fileSystem: FileSystem, dustPath: string, description: string): Promise<CreateIdeaTransitionTaskResult>;
|
|
25
|
+
export declare function createCaptureIdeaTask(fileSystem: FileSystem, dustPath: string, title: string, description: string): Promise<CreateIdeaTransitionTaskResult>;
|
package/dist/workflow-tasks.js
CHANGED
|
@@ -83,16 +83,21 @@ async function createTaskFromIdea(fileSystem, dustPath, ideaSlug, description) {
|
|
|
83
83
|
async function createShelveIdeaTask(fileSystem, dustPath, ideaSlug, description) {
|
|
84
84
|
return createIdeaTask(fileSystem, dustPath, "Shelve Idea: ", ideaSlug, (ideaTitle) => `Archive this idea and remove it from the active backlog. See [${ideaTitle}](../ideas/${ideaSlug}.md).`, ["Idea file is deleted", "Rationale is recorded in the commit message"], description);
|
|
85
85
|
}
|
|
86
|
-
async function createCaptureIdeaTask(fileSystem, dustPath, description) {
|
|
86
|
+
async function createCaptureIdeaTask(fileSystem, dustPath, title, description) {
|
|
87
|
+
if (!title || !title.trim()) {
|
|
88
|
+
throw new Error("title is required and must not be whitespace-only");
|
|
89
|
+
}
|
|
87
90
|
if (!description || !description.trim()) {
|
|
88
91
|
throw new Error("description is required and must not be whitespace-only");
|
|
89
92
|
}
|
|
90
|
-
const taskTitle =
|
|
93
|
+
const taskTitle = `Add Idea: ${title}`;
|
|
91
94
|
const filename = titleToFilename(taskTitle);
|
|
92
95
|
const filePath = `${dustPath}/tasks/${filename}`;
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
+
const ideaFilename = titleToFilename(title);
|
|
97
|
+
const ideaPath = `.dust/ideas/${ideaFilename}`;
|
|
98
|
+
const content = renderTask(taskTitle, `Create a new idea file at \`${ideaPath}\` with the title "${title}" and the following description:`, [
|
|
99
|
+
`Idea file exists at ${ideaPath}`,
|
|
100
|
+
`Idea file has an H1 title matching "${title}"`
|
|
96
101
|
], description);
|
|
97
102
|
await fileSystem.writeFile(filePath, content);
|
|
98
103
|
return { filePath };
|