semantic-release-linear-app 0.3.0-next.2 → 0.3.0-next.4
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 +24 -225
- package/dist/lib/linear-client.d.ts +1 -1
- package/dist/lib/linear-client.js +5 -5
- package/dist/lib/parse-issues.d.ts +0 -7
- package/dist/lib/parse-issues.js +2 -25
- package/dist/lib/parse-issues.test.js +13 -26
- package/dist/lib/success.d.ts +2 -2
- package/dist/lib/success.js +52 -47
- package/dist/lib/verify.d.ts +2 -2
- package/dist/lib/verify.js +7 -7
- package/dist/lib/verify.test.js +11 -11
- package/dist/types.d.ts +1 -10
- package/package.json +12 -13
- package/src/lib/linear-client.ts +10 -21
- package/src/lib/parse-issues.test.ts +14 -35
- package/src/lib/parse-issues.ts +2 -29
- package/src/lib/success.ts +63 -72
- package/src/lib/verify.test.ts +14 -16
- package/src/lib/verify.ts +16 -16
- package/src/types/semantic-release-error.d.ts +1 -1
- package/src/types.ts +7 -19
package/src/lib/verify.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import SemanticReleaseError from
|
|
2
|
-
import { VerifyConditionsContext } from
|
|
3
|
-
import { LinearClient } from
|
|
4
|
-
import { PluginConfig, LinearContext } from
|
|
1
|
+
import SemanticReleaseError from '@semantic-release/error';
|
|
2
|
+
import { VerifyConditionsContext } from 'semantic-release';
|
|
3
|
+
import { LinearClient } from './linear-client';
|
|
4
|
+
import { PluginConfig, LinearContext } from '../types';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Verify the plugin configuration and Linear API access
|
|
@@ -18,9 +18,9 @@ export async function verifyConditions(
|
|
|
18
18
|
|
|
19
19
|
if (!linearApiKey) {
|
|
20
20
|
throw new SemanticReleaseError(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
'No Linear API key found',
|
|
22
|
+
'ENOLINEARTOKEN',
|
|
23
|
+
'Please provide a Linear API key via plugin config or LINEAR_API_KEY environment variable.',
|
|
24
24
|
);
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -33,10 +33,10 @@ export async function verifyConditions(
|
|
|
33
33
|
|
|
34
34
|
if (invalidTeamKeys.length > 0) {
|
|
35
35
|
throw new SemanticReleaseError(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
`Invalid: ${invalidTeamKeys.join(
|
|
36
|
+
'Invalid team key format',
|
|
37
|
+
'EINVALIDTEAMKEY',
|
|
38
|
+
'Team keys must be uppercase letters (e.g. SD) or branch names (e.g. caio/tk-519-title). ' +
|
|
39
|
+
`Invalid: ${invalidTeamKeys.join(', ')}`,
|
|
40
40
|
);
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -44,13 +44,13 @@ export async function verifyConditions(
|
|
|
44
44
|
const client = new LinearClient(linearApiKey);
|
|
45
45
|
|
|
46
46
|
try {
|
|
47
|
-
logger.log(
|
|
47
|
+
logger.log('Verifying Linear API access...');
|
|
48
48
|
await client.testConnection();
|
|
49
|
-
logger.log(
|
|
49
|
+
logger.log('✓ Linear API access verified');
|
|
50
50
|
} catch (error) {
|
|
51
51
|
throw new SemanticReleaseError(
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
'Failed to connect to Linear API',
|
|
53
|
+
'ELINEARCONNECTION',
|
|
54
54
|
`Could not connect to Linear API: ${(error as Error).message}`,
|
|
55
55
|
);
|
|
56
56
|
}
|
|
@@ -59,6 +59,6 @@ export async function verifyConditions(
|
|
|
59
59
|
context.linear = {
|
|
60
60
|
apiKey: linearApiKey,
|
|
61
61
|
teamKeys: teamKeys.length > 0 ? teamKeys : null,
|
|
62
|
-
labelPrefix: pluginConfig.labelPrefix ||
|
|
62
|
+
labelPrefix: pluginConfig.labelPrefix || 'v',
|
|
63
63
|
};
|
|
64
64
|
}
|
package/src/types.ts
CHANGED
|
@@ -16,12 +16,6 @@ export interface PluginConfig {
|
|
|
16
16
|
|
|
17
17
|
/** Preview changes without updating Linear (default: false) */
|
|
18
18
|
dryRun?: boolean;
|
|
19
|
-
|
|
20
|
-
/** Branches to skip unless they contain issue IDs (default: ["main", "master", "develop", "staging", "production"]) */
|
|
21
|
-
skipBranches?: string[];
|
|
22
|
-
|
|
23
|
-
/** Require issues in branch name to process (default: true) */
|
|
24
|
-
requireIssueInBranch?: boolean;
|
|
25
19
|
}
|
|
26
20
|
|
|
27
21
|
export interface LinearContext {
|
|
@@ -45,22 +39,16 @@ export interface LinearLabel {
|
|
|
45
39
|
color?: string;
|
|
46
40
|
}
|
|
47
41
|
|
|
48
|
-
export interface IssueUpdateResult {
|
|
49
|
-
issueId: string;
|
|
50
|
-
status: "updated" | "failed" | "not_found";
|
|
51
|
-
error?: string;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
42
|
export interface LinearViewer {
|
|
55
43
|
id: string;
|
|
56
44
|
name: string;
|
|
57
45
|
}
|
|
58
46
|
|
|
59
47
|
export type ReleaseType =
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
|
|
|
66
|
-
|
|
|
48
|
+
| 'major'
|
|
49
|
+
| 'premajor'
|
|
50
|
+
| 'minor'
|
|
51
|
+
| 'preminor'
|
|
52
|
+
| 'patch'
|
|
53
|
+
| 'prepatch'
|
|
54
|
+
| 'prerelease';
|