@metasession.co/devaudit-plugin-sdk 1.5.0 → 1.6.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/dist/commands.d.ts +6 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/index.d.ts +7 -76
- package/dist/index.d.ts.map +1 -0
- package/dist/lifecycle.d.ts +4 -0
- package/dist/lifecycle.d.ts.map +1 -0
- package/dist/manifest.d.ts +31 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/types.d.ts +37 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +5 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAID,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAElE"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,76 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
error(message: string): void;
|
|
9
|
-
debug(message: string): void;
|
|
10
|
-
}
|
|
11
|
-
interface PluginSdlcConfigView {
|
|
12
|
-
readonly project_slug: string;
|
|
13
|
-
readonly stack?: string;
|
|
14
|
-
readonly host?: string;
|
|
15
|
-
readonly node_version?: string | number;
|
|
16
|
-
readonly python_version?: string | number;
|
|
17
|
-
readonly working_directory?: string;
|
|
18
|
-
readonly source_dirs?: string;
|
|
19
|
-
readonly [key: string]: unknown;
|
|
20
|
-
}
|
|
21
|
-
interface PluginEvent {
|
|
22
|
-
readonly type: string;
|
|
23
|
-
readonly payload?: Readonly<Record<string, unknown>>;
|
|
24
|
-
}
|
|
25
|
-
interface PluginContext {
|
|
26
|
-
readonly projectPath: string;
|
|
27
|
-
readonly sdlcConfig: PluginSdlcConfigView;
|
|
28
|
-
readonly logger: PluginLogger;
|
|
29
|
-
readonly apiVersion: '1';
|
|
30
|
-
emit(event: PluginEvent): void;
|
|
31
|
-
}
|
|
32
|
-
type LifecycleHook = (ctx: PluginContext) => Promise<void> | void;
|
|
33
|
-
type PluginCommand = (ctx: PluginContext, args: readonly string[]) => Promise<void> | void;
|
|
34
|
-
interface Plugin {
|
|
35
|
-
readonly name: string;
|
|
36
|
-
readonly apiVersion: '1';
|
|
37
|
-
readonly hooks?: Partial<Record<LifecycleHookName, LifecycleHook>>;
|
|
38
|
-
readonly commands?: Readonly<Record<string, PluginCommand>>;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
interface CommandContribution {
|
|
42
|
-
readonly name: string;
|
|
43
|
-
readonly description: string;
|
|
44
|
-
}
|
|
45
|
-
declare function isValidCommandName(value: unknown): value is string;
|
|
46
|
-
|
|
47
|
-
declare const SUPPORTED_API_VERSIONS: readonly string[];
|
|
48
|
-
interface PluginManifest {
|
|
49
|
-
readonly apiVersion: '1';
|
|
50
|
-
readonly displayName?: string;
|
|
51
|
-
readonly description?: string;
|
|
52
|
-
readonly commands?: readonly CommandContribution[];
|
|
53
|
-
readonly hooks?: readonly LifecycleHookName[];
|
|
54
|
-
}
|
|
55
|
-
interface ManifestSource {
|
|
56
|
-
readonly name?: string;
|
|
57
|
-
readonly version?: string;
|
|
58
|
-
readonly main?: string;
|
|
59
|
-
readonly devaudit?: unknown;
|
|
60
|
-
readonly [key: string]: unknown;
|
|
61
|
-
}
|
|
62
|
-
interface ManifestValidationOk {
|
|
63
|
-
readonly valid: true;
|
|
64
|
-
readonly manifest: PluginManifest;
|
|
65
|
-
readonly packageName: string;
|
|
66
|
-
readonly packageVersion: string;
|
|
67
|
-
readonly main: string;
|
|
68
|
-
}
|
|
69
|
-
interface ManifestValidationFail {
|
|
70
|
-
readonly valid: false;
|
|
71
|
-
readonly errors: readonly string[];
|
|
72
|
-
}
|
|
73
|
-
type ManifestValidationResult = ManifestValidationOk | ManifestValidationFail;
|
|
74
|
-
declare function validateManifest(input: unknown): ManifestValidationResult;
|
|
75
|
-
|
|
76
|
-
export { type CommandContribution, LIFECYCLE_HOOK_NAMES, type LifecycleHook, type LifecycleHookName, type ManifestSource, type ManifestValidationFail, type ManifestValidationOk, type ManifestValidationResult, type Plugin, type PluginCommand, type PluginContext, type PluginEvent, type PluginLogger, type PluginManifest, type PluginSdlcConfigView, SUPPORTED_API_VERSIONS, isLifecycleHookName, isValidCommandName, validateManifest };
|
|
1
|
+
export type { Plugin, PluginContext, PluginLogger, PluginSdlcConfigView, PluginEvent, LifecycleHook, PluginCommand, } from './types.js';
|
|
2
|
+
export type { CommandContribution } from './commands.js';
|
|
3
|
+
export { isValidCommandName } from './commands.js';
|
|
4
|
+
export { LIFECYCLE_HOOK_NAMES, isLifecycleHookName, type LifecycleHookName, } from './lifecycle.js';
|
|
5
|
+
export type { PluginManifest, ManifestSource, ManifestValidationResult, ManifestValidationOk, ManifestValidationFail, } from './manifest.js';
|
|
6
|
+
export { validateManifest, SUPPORTED_API_VERSIONS } from './manifest.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,MAAM,EACN,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,WAAW,EACX,aAAa,EACb,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,KAAK,iBAAiB,GACvB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,cAAc,EACd,cAAc,EACd,wBAAwB,EACxB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const LIFECYCLE_HOOK_NAMES: readonly ['beforeInstall', 'afterInstall', 'beforeUpdate', 'afterUpdate', 'beforePush', 'afterPush', 'beforeSync', 'afterSync', 'onDoctor'];
|
|
2
|
+
export type LifecycleHookName = (typeof LIFECYCLE_HOOK_NAMES)[number];
|
|
3
|
+
export declare function isLifecycleHookName(value: unknown): value is LifecycleHookName;
|
|
4
|
+
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../src/lifecycle.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,YAC/B,eAAe,EACf,cAAc,EACd,cAAc,EACd,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,WAAW,EACX,UAAU,CACF,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,iBAAiB,CAE9E"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CommandContribution } from './commands.js';
|
|
2
|
+
import type { LifecycleHookName } from './lifecycle.js';
|
|
3
|
+
export declare const SUPPORTED_API_VERSIONS: readonly string[];
|
|
4
|
+
export interface PluginManifest {
|
|
5
|
+
readonly apiVersion: '1';
|
|
6
|
+
readonly displayName?: string;
|
|
7
|
+
readonly description?: string;
|
|
8
|
+
readonly commands?: readonly CommandContribution[];
|
|
9
|
+
readonly hooks?: readonly LifecycleHookName[];
|
|
10
|
+
}
|
|
11
|
+
export interface ManifestSource {
|
|
12
|
+
readonly name?: string;
|
|
13
|
+
readonly version?: string;
|
|
14
|
+
readonly main?: string;
|
|
15
|
+
readonly devaudit?: unknown;
|
|
16
|
+
readonly [key: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
export interface ManifestValidationOk {
|
|
19
|
+
readonly valid: true;
|
|
20
|
+
readonly manifest: PluginManifest;
|
|
21
|
+
readonly packageName: string;
|
|
22
|
+
readonly packageVersion: string;
|
|
23
|
+
readonly main: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ManifestValidationFail {
|
|
26
|
+
readonly valid: false;
|
|
27
|
+
readonly errors: readonly string[];
|
|
28
|
+
}
|
|
29
|
+
export type ManifestValidationResult = ManifestValidationOk | ManifestValidationFail;
|
|
30
|
+
export declare function validateManifest(input: unknown): ManifestValidationResult;
|
|
31
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGxD,eAAO,MAAM,sBAAsB,EAAE,SAAS,MAAM,EAAU,CAAC;AAE/D,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,UAAU,EAAE,GAAG,CAAC;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACnD,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAC/C;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAED,MAAM,MAAM,wBAAwB,GAAG,oBAAoB,GAAG,sBAAsB,CAAC;AAErF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,wBAAwB,CAgCzE"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { LifecycleHookName } from './lifecycle.js';
|
|
2
|
+
export interface PluginLogger {
|
|
3
|
+
info(message: string): void;
|
|
4
|
+
warn(message: string): void;
|
|
5
|
+
error(message: string): void;
|
|
6
|
+
debug(message: string): void;
|
|
7
|
+
}
|
|
8
|
+
export interface PluginSdlcConfigView {
|
|
9
|
+
readonly project_slug: string;
|
|
10
|
+
readonly stack?: string;
|
|
11
|
+
readonly host?: string;
|
|
12
|
+
readonly node_version?: string | number;
|
|
13
|
+
readonly python_version?: string | number;
|
|
14
|
+
readonly working_directory?: string;
|
|
15
|
+
readonly source_dirs?: string;
|
|
16
|
+
readonly [key: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
export interface PluginEvent {
|
|
19
|
+
readonly type: string;
|
|
20
|
+
readonly payload?: Readonly<Record<string, unknown>>;
|
|
21
|
+
}
|
|
22
|
+
export interface PluginContext {
|
|
23
|
+
readonly projectPath: string;
|
|
24
|
+
readonly sdlcConfig: PluginSdlcConfigView;
|
|
25
|
+
readonly logger: PluginLogger;
|
|
26
|
+
readonly apiVersion: '1';
|
|
27
|
+
emit(event: PluginEvent): void;
|
|
28
|
+
}
|
|
29
|
+
export type LifecycleHook = (ctx: PluginContext) => Promise<void> | void;
|
|
30
|
+
export type PluginCommand = (ctx: PluginContext, args: readonly string[]) => Promise<void> | void;
|
|
31
|
+
export interface Plugin {
|
|
32
|
+
readonly name: string;
|
|
33
|
+
readonly apiVersion: '1';
|
|
34
|
+
readonly hooks?: Partial<Record<LifecycleHookName, LifecycleHook>>;
|
|
35
|
+
readonly commands?: Readonly<Record<string, PluginCommand>>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,C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
"name": "@metasession.co/devaudit-plugin-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "DevAudit CLI plugin contract — interfaces, manifest schema, and lifecycle hooks that DevAudit plugins compile against.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"node": ">=22"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
|
-
"build": "tsup",
|
|
23
|
+
"build": "tsup && tsc --emitDeclarationOnly",
|
|
24
24
|
"dev": "tsup --watch",
|
|
25
25
|
"test": "vitest run",
|
|
26
26
|
"test:watch": "vitest",
|
|
@@ -29,8 +29,9 @@
|
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/node": "^26.0.1",
|
|
31
31
|
"tsup": "^8.3.5",
|
|
32
|
-
"typescript": "^
|
|
33
|
-
"
|
|
32
|
+
"typescript": "^7.0.2",
|
|
33
|
+
"vite": "^8.3.1",
|
|
34
|
+
"vitest": "^5.0.0"
|
|
34
35
|
},
|
|
35
36
|
"publishConfig": {
|
|
36
37
|
"access": "public"
|