@enrichlayer/el-linear 1.19.0 → 1.21.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/README.md +88 -0
- package/claude-skills/linear-operations/SKILL.md +6 -1
- package/dist/commands/comments.js +6 -0
- package/dist/commands/issues/tree.d.ts +22 -0
- package/dist/commands/issues/tree.js +102 -0
- package/dist/commands/issues.js +43 -5
- package/dist/commands/read-shortcut.js +122 -14
- package/dist/queries/common.d.ts +2 -2
- package/dist/queries/common.js +1 -0
- package/dist/queries/issue-tree.d.ts +48 -0
- package/dist/queries/issue-tree.js +67 -0
- package/dist/queries/issues-types.d.ts +12 -0
- package/dist/queries/issues.d.ts +29 -7
- package/dist/queries/issues.js +30 -0
- package/dist/queries/project-milestones.d.ts +1 -1
- package/dist/types/linear.d.ts +7 -0
- package/dist/utils/extract-field.d.ts +16 -0
- package/dist/utils/extract-field.js +22 -0
- package/dist/utils/format-tree.d.ts +14 -0
- package/dist/utils/format-tree.js +47 -0
- package/dist/utils/graphql-issues-service.d.ts +26 -0
- package/dist/utils/graphql-issues-service.js +109 -2
- package/dist/utils/with-includes.d.ts +40 -0
- package/dist/utils/with-includes.js +55 -0
- package/package.json +2 -2
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `issues read --with` parser (DEV-4476).
|
|
3
|
+
*
|
|
4
|
+
* Opt-in includes for `issues read`. Each value names an additional block
|
|
5
|
+
* of data to fetch alongside the base issue and inject into the JSON
|
|
6
|
+
* envelope. Comma-separated; whitespace tolerated; unknown values rejected
|
|
7
|
+
* with a structured error naming the candidates (deterministic-CLI
|
|
8
|
+
* doctrine — fail fast in the CLI, not in the consumer's script).
|
|
9
|
+
*
|
|
10
|
+
* Currently supported:
|
|
11
|
+
* - `relations` — fetches `Issue.relations` + `Issue.inverseRelations`
|
|
12
|
+
* and adds a `relations` array to the envelope.
|
|
13
|
+
*
|
|
14
|
+
* Reserved for future MRs (the value space is a closed set so adding more
|
|
15
|
+
* later is back-compat):
|
|
16
|
+
* - `children` — refetch with expanded sub-issue fragment (state,
|
|
17
|
+
* assignee, priority — beyond the default id/identifier/
|
|
18
|
+
* title trio that's already in the envelope).
|
|
19
|
+
* - `comments` — no-op for fetching (comments are already in the
|
|
20
|
+
* default envelope via `_WITH_COMMENTS` fragment) but
|
|
21
|
+
* would gate explicit summary-format rendering.
|
|
22
|
+
*
|
|
23
|
+
* Doctrine note: comments are intentionally NOT included today because
|
|
24
|
+
* adding `--with comments` would imply that comments are *off* by default,
|
|
25
|
+
* which would be a breaking JSON-shape change.
|
|
26
|
+
*/
|
|
27
|
+
export const WITH_INCLUDE_VALUES = ["relations"];
|
|
28
|
+
/**
|
|
29
|
+
* Parse a `--with <names>` argument. Returns a flag object so call sites
|
|
30
|
+
* read `if (includes.relations)` instead of `Set.has("relations")`.
|
|
31
|
+
*
|
|
32
|
+
* Empty / whitespace-only values are caller errors (commander allows
|
|
33
|
+
* `--with ""` through) — reject with the same message as unknown values
|
|
34
|
+
* so the user gets one consistent failure mode.
|
|
35
|
+
*/
|
|
36
|
+
export function parseWithIncludes(raw) {
|
|
37
|
+
const names = raw
|
|
38
|
+
.split(",")
|
|
39
|
+
.map((s) => s.trim())
|
|
40
|
+
.filter((s) => s.length > 0);
|
|
41
|
+
if (names.length === 0) {
|
|
42
|
+
throw new Error(`--with requires at least one include name. Supported: ${WITH_INCLUDE_VALUES.join(", ")}`);
|
|
43
|
+
}
|
|
44
|
+
const includes = { relations: false };
|
|
45
|
+
for (const name of names) {
|
|
46
|
+
if (!WITH_INCLUDE_VALUES.includes(name)) {
|
|
47
|
+
throw new Error(`--with: unknown include "${name}". Supported: ${WITH_INCLUDE_VALUES.join(", ")}`);
|
|
48
|
+
}
|
|
49
|
+
// Narrowing: only assignable members of ParsedWithIncludes.
|
|
50
|
+
if (name === "relations") {
|
|
51
|
+
includes.relations = true;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return includes;
|
|
55
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enrichlayer/el-linear",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0",
|
|
4
4
|
"description": "A pragmatic CLI for Linear.app — deterministic team/label/member resolution, structured issue validation, configurable term enforcement, and a GraphQL escape hatch.",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"types": "dist/main.d.ts",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@inquirer/prompts": "^8.4.2",
|
|
55
|
-
"@linear/sdk": "^
|
|
55
|
+
"@linear/sdk": "^86.0.0",
|
|
56
56
|
"commander": "^14.0.0",
|
|
57
57
|
"picocolors": "^1.1.1"
|
|
58
58
|
},
|