taskin 1.0.10 → 1.0.11

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/README.md +3 -3
  2. package/dist/index.js +48 -22
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -19,7 +19,7 @@ Taskin is a command-line tool that helps you manage tasks directly from your ter
19
19
 
20
20
  ## 🚀 Installation
21
21
 
22
- \`\`\`bash
22
+ ```bash
23
23
 
24
24
  # Using npx (recommended - no installation needed!)
25
25
 
@@ -36,9 +36,9 @@ pnpm add -g taskin
36
36
  # Or with yarn
37
37
 
38
38
  yarn global add taskin
39
- \`\`\`
39
+ ```
40
40
 
41
- > **Note:** This is a beta version. Please report any issues on [GitHub](https://github.com/sidartaveloso/taskin/issues).
41
+ > **Note:** Please report any issues on [GitHub](https://github.com/sidartaveloso/taskin/issues).
42
42
 
43
43
  ## 📦 Available Packages
44
44
 
package/dist/index.js CHANGED
@@ -127,7 +127,9 @@ async function validateTaskFile(filePath) {
127
127
  });
128
128
  }
129
129
  if (hasInlineStatus) {
130
- const statusLineIdx = lines.findIndex((line) => /^Status:/i.test(line.trim()));
130
+ const statusLineIdx = lines.findIndex(
131
+ (line) => /^Status:/i.test(line.trim())
132
+ );
131
133
  issues.push({
132
134
  file: filePath,
133
135
  line: statusLineIdx >= 0 ? statusLineIdx + 1 : void 0,
@@ -147,7 +149,9 @@ async function validateTaskFile(filePath) {
147
149
  const statusMatch = content.match(/## Status\s*\n\s*([^\n\r]+)/i);
148
150
  const statusValue = statusMatch ? statusMatch[1].trim().toLowerCase() : "";
149
151
  if (!["todo", "in-progress", "done", "pending"].includes(statusValue)) {
150
- const statusLineIdx = lines.findIndex((line) => line.trim() === "## Status");
152
+ const statusLineIdx = lines.findIndex(
153
+ (line) => line.trim() === "## Status"
154
+ );
151
155
  issues.push({
152
156
  file: filePath,
153
157
  line: statusLineIdx >= 0 ? statusLineIdx + 2 : void 0,
@@ -194,9 +198,15 @@ async function validateTaskFile(filePath) {
194
198
  return issues;
195
199
  }
196
200
  function createLintResult(allIssues) {
197
- const errorCount = allIssues.filter((issue) => issue.severity === "error").length;
198
- const warningCount = allIssues.filter((issue) => issue.severity === "warning").length;
199
- const infoCount = allIssues.filter((issue) => issue.severity === "info").length;
201
+ const errorCount = allIssues.filter(
202
+ (issue) => issue.severity === "error"
203
+ ).length;
204
+ const warningCount = allIssues.filter(
205
+ (issue) => issue.severity === "warning"
206
+ ).length;
207
+ const infoCount = allIssues.filter(
208
+ (issue) => issue.severity === "info"
209
+ ).length;
200
210
  return {
201
211
  valid: errorCount === 0,
202
212
  issues: allIssues,
@@ -7105,7 +7115,9 @@ var FileSystemTaskProvider = class {
7105
7115
  }
7106
7116
  async findTask(taskId) {
7107
7117
  const files = await fs.readdir(this.tasksDirectory);
7108
- const taskFile = files.find((file) => file.startsWith(`task-${taskId}-`) && file.endsWith(".md"));
7118
+ const taskFile = files.find(
7119
+ (file) => file.startsWith(`task-${taskId}-`) && file.endsWith(".md")
7120
+ );
7109
7121
  if (!taskFile) {
7110
7122
  return void 0;
7111
7123
  }
@@ -7120,8 +7132,7 @@ var FileSystemTaskProvider = class {
7120
7132
  for (const n of names) {
7121
7133
  const rx = new RegExp(`##\\s*${n}\\s*\\n\\s*([^\\n\\r]+)`, "i");
7122
7134
  const m = content.match(rx);
7123
- if (m)
7124
- return m[1].trim();
7135
+ if (m) return m[1].trim();
7125
7136
  }
7126
7137
  return null;
7127
7138
  };
@@ -7133,7 +7144,9 @@ var FileSystemTaskProvider = class {
7133
7144
  const assigneeValue = assigneeMatch.trim();
7134
7145
  assignee = this.userRegistry.resolveUser(assigneeValue);
7135
7146
  if (!assignee) {
7136
- console.warn(`[FS Provider] User "${assigneeValue}" not found in registry, creating temporary user`);
7147
+ console.warn(
7148
+ `[FS Provider] User "${assigneeValue}" not found in registry, creating temporary user`
7149
+ );
7137
7150
  assignee = this.userRegistry.createTemporaryUser(assigneeValue);
7138
7151
  }
7139
7152
  }
@@ -7151,7 +7164,9 @@ var FileSystemTaskProvider = class {
7151
7164
  }
7152
7165
  async updateTask(task) {
7153
7166
  const currentContent = await fs.readFile(task.filePath, "utf-8");
7154
- const hasInlineMetadata = /^(Status|Type|Assignee):\s*.+$/im.test(currentContent);
7167
+ const hasInlineMetadata = /^(Status|Type|Assignee):\s*.+$/im.test(
7168
+ currentContent
7169
+ );
7155
7170
  if (hasInlineMetadata) {
7156
7171
  const { fixTaskFile: fixTaskFile2 } = await Promise.resolve().then(() => (init_task_validator(), task_validator_exports));
7157
7172
  await fixTaskFile2(task.filePath);
@@ -7159,18 +7174,26 @@ var FileSystemTaskProvider = class {
7159
7174
  const content = await fs.readFile(task.filePath, "utf-8");
7160
7175
  let updatedContent;
7161
7176
  if (/##\s*Status/i.test(content)) {
7162
- updatedContent = content.replace(/(##\s*Status\s*\n\s*)([^\n\r]*)/i, `$1${task.status}`);
7177
+ updatedContent = content.replace(
7178
+ /(##\s*Status\s*\n\s*)([^\n\r]*)/i,
7179
+ `$1${task.status}`
7180
+ );
7163
7181
  } else {
7164
- updatedContent = content.replace(/(^#.*\n)/, `$1
7182
+ updatedContent = content.replace(
7183
+ /(^#.*\n)/,
7184
+ `$1
7165
7185
  ## Status
7166
7186
  ${task.status}
7167
- `);
7187
+ `
7188
+ );
7168
7189
  }
7169
7190
  await fs.writeFile(task.filePath, updatedContent, "utf-8");
7170
7191
  }
7171
7192
  async getAllTasks() {
7172
7193
  const files = await fs.readdir(this.tasksDirectory);
7173
- const taskFiles = files.filter((file) => file.startsWith("task-") && file.endsWith(".md"));
7194
+ const taskFiles = files.filter(
7195
+ (file) => file.startsWith("task-") && file.endsWith(".md")
7196
+ );
7174
7197
  const tasks = [];
7175
7198
  for (const file of taskFiles) {
7176
7199
  const filePath = path2.join(this.tasksDirectory, file);
@@ -7186,8 +7209,7 @@ ${task.status}
7186
7209
  for (const n of names) {
7187
7210
  const rx = new RegExp(`##\\s*${n}\\s*\\n\\s*([^\\n\\r]+)`, "i");
7188
7211
  const m = content.match(rx);
7189
- if (m)
7190
- return m[1].trim();
7212
+ if (m) return m[1].trim();
7191
7213
  }
7192
7214
  return null;
7193
7215
  };
@@ -7339,7 +7361,9 @@ var UserRegistry = class {
7339
7361
  console.log(`[UserRegistry] Loaded ${this.users.size} users`);
7340
7362
  } catch (error2) {
7341
7363
  if (error2.code === "ENOENT") {
7342
- console.warn("[UserRegistry] users.json not found, starting with empty registry");
7364
+ console.warn(
7365
+ "[UserRegistry] users.json not found, starting with empty registry"
7366
+ );
7343
7367
  this.users.clear();
7344
7368
  } else {
7345
7369
  throw error2;
@@ -7358,12 +7382,10 @@ var UserRegistry = class {
7358
7382
  */
7359
7383
  resolveUser(nameOrId) {
7360
7384
  const byId = this.users.get(nameOrId);
7361
- if (byId)
7362
- return byId;
7385
+ if (byId) return byId;
7363
7386
  const slug = nameOrId.toLowerCase().replace(/\s+/g, "-");
7364
7387
  const bySlug = this.users.get(slug);
7365
- if (bySlug)
7366
- return bySlug;
7388
+ if (bySlug) return bySlug;
7367
7389
  for (const user of this.users.values()) {
7368
7390
  if (user.name.toLowerCase() === nameOrId.toLowerCase()) {
7369
7391
  return user;
@@ -7403,7 +7425,11 @@ var UserRegistry = class {
7403
7425
  const data = {
7404
7426
  users: Object.fromEntries(this.users.entries())
7405
7427
  };
7406
- await fs2.writeFile(this.usersFilePath, JSON.stringify(data, null, 2), "utf-8");
7428
+ await fs2.writeFile(
7429
+ this.usersFilePath,
7430
+ JSON.stringify(data, null, 2),
7431
+ "utf-8"
7432
+ );
7407
7433
  }
7408
7434
  };
7409
7435
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskin",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "Task management system integrated with Git workflows",
5
5
  "motivation": "Provide a CLI tool for task management integrated with Git workflows",
6
6
  "solve": "Simplifies task tracking and management directly from the command line",
@@ -88,9 +88,9 @@
88
88
  "@opentask/taskin-fs-provider": "1.0.5",
89
89
  "@opentask/taskin-task-manager": "1.0.5",
90
90
  "@opentask/taskin-task-server-ws": "0.1.0",
91
+ "@opentask/taskin-utils": "1.0.5",
91
92
  "@opentask/taskin-task-server-mcp": "0.1.0",
92
- "@opentask/taskin-types": "1.0.5",
93
- "@opentask/taskin-utils": "1.0.5"
93
+ "@opentask/taskin-types": "1.0.5"
94
94
  },
95
95
  "scripts": {
96
96
  "build": "pnpm run build:dashboard && tsup",