jira-sprinter 2.6.0 → 2.7.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jira-sprinter",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "description": "Small CLI tool to manage sprints in JIRA Board",
5
5
  "main": "src/main.ts",
6
6
  "type": "commonjs",
@@ -34,24 +34,25 @@
34
34
  "scrum"
35
35
  ],
36
36
  "dependencies": {
37
- "@inquirer/checkbox": "^5.2.1",
38
- "@inquirer/select": "5.2.1",
37
+ "@inquirer/checkbox": "5.2.5",
38
+ "@inquirer/select": "5.2.5",
39
39
  "@total-typescript/ts-reset": "0.6.1",
40
40
  "chalk": "6.0.0",
41
41
  "commander": "15.0.0",
42
42
  "dotenv": "17.4.2",
43
43
  "jira.js": "5.4.0",
44
- "kerberos": "^7.0.0",
45
- "product-pages": "^1.0.1",
46
- "zod": "4.4.3"
44
+ "kerberos": "7.0.0",
45
+ "product-pages": "1.0.1",
46
+ "zod": "4.6.1"
47
47
  },
48
48
  "devDependencies": {
49
- "@types/node": "26.2.0",
50
- "@vitest/coverage-v8": "4.1.10",
49
+ "@types/node": "22.20.2",
50
+ "@vitest/coverage-v8": "5.0.0",
51
51
  "esbuild": "0.28.2",
52
52
  "prettier": "3.9.6",
53
53
  "ts-node": "10.9.2",
54
54
  "typescript": "7.0.2",
55
- "vitest": "4.1.10"
55
+ "vite": "8.2.2",
56
+ "vitest": "5.0.0"
56
57
  }
57
58
  }
package/src/auto.ts CHANGED
@@ -85,7 +85,10 @@ export async function runAuto(options: OptionValues): Promise<void> {
85
85
  )
86
86
  );
87
87
 
88
- const activeSprint = await jira.getActiveSprint(+options.board);
88
+ const activeSprint = await jira.getActiveSprint(
89
+ +options.board,
90
+ options.prefix
91
+ );
89
92
  let tasksWithoutSprint: { key?: string; fields?: Record<string, any> }[] = [];
90
93
 
91
94
  if (!activeSprint) {
package/src/cli.ts CHANGED
@@ -34,22 +34,27 @@ export function cli(): Command {
34
34
  .description(
35
35
  'Automatically manages split tasks (Preliminary Testing and QE) based on ticket state and status'
36
36
  )
37
- .option('-b, --board [board]', 'Jira Board ID', getDefaultValue('BOARD'))
37
+ .option('-b, --board <board>', 'Jira Board ID', getDefaultValue('BOARD'))
38
38
  .requiredOption(
39
- '-t, --team [assigned team]',
39
+ '-t, --team <assigned team>',
40
40
  'Jira Assigned Team',
41
41
  getDefaultValue('TEAM')
42
42
  )
43
43
  .option(
44
- '-c, --components [components]',
44
+ '-c, --components <components>',
45
45
  'Jira Components',
46
46
  getDefaultValue('COMPONENTS')
47
47
  )
48
48
  .option(
49
- '--deadlines-file [path]',
49
+ '--deadlines-file <path>',
50
50
  'Path to deadlines JSON file',
51
51
  getDefaultValue('DEADLINES_FILE')
52
52
  )
53
+ .option(
54
+ '-p, --prefix <prefix>',
55
+ 'Sprint name prefix for matching the active sprint',
56
+ getDefaultValue('SPRINT_PREFIX')
57
+ )
53
58
  .action(async (_opts, command) => {
54
59
  await runAuto(command.optsWithGlobals());
55
60
  })
package/src/jira.ts CHANGED
@@ -111,9 +111,18 @@ export class Jira {
111
111
  return response.values;
112
112
  }
113
113
 
114
- async getActiveSprint(boardId: number): Promise<Sprint | undefined> {
114
+ async getActiveSprint(
115
+ boardId: number,
116
+ prefix?: string
117
+ ): Promise<Sprint | undefined> {
115
118
  const sprints = await this.getSprints(boardId);
116
- return sprints.find(s => s.state === 'active');
119
+ const activeSprints = sprints.filter(s => s.state === 'active');
120
+
121
+ if (prefix) {
122
+ return activeSprints.find(s => s.name?.startsWith(prefix));
123
+ }
124
+
125
+ return activeSprints[0];
117
126
  }
118
127
 
119
128
  async getIssuesInSprint(
package/src/util.ts CHANGED
@@ -30,6 +30,7 @@ export function getDefaultValue(
30
30
  | 'DRY'
31
31
  | 'YOLO'
32
32
  | 'DEADLINES_FILE'
33
+ | 'SPRINT_PREFIX'
33
34
  ) {
34
35
  if (isDefaultValuesDisabled()) {
35
36
  return undefined;
File without changes