Skip to content

Commit 2c257f2

Browse files
committed
feat: Add minSupportedCliVersion
1 parent 4682406 commit 2c257f2

3 files changed

Lines changed: 25 additions & 17 deletions

File tree

package-lock.json

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codifycli/plugin-core",
3-
"version": "1.1.0-beta15",
3+
"version": "1.1.0-beta16",
44
"description": "TypeScript library for building Codify plugins to manage system resources (applications, CLI tools, settings) through infrastructure-as-code",
55
"main": "dist/index.js",
66
"typings": "dist/index.d.ts",
@@ -35,15 +35,15 @@
3535
},
3636
"license": "ISC",
3737
"dependencies": {
38-
"@codifycli/schemas": "1.1.0-beta5",
38+
"@codifycli/schemas": "1.1.0-beta6",
3939
"@homebridge/node-pty-prebuilt-multiarch": "^0.13.1",
4040
"ajv": "^8.18.0",
4141
"ajv-formats": "^2.1.1",
4242
"clean-deep": "^3.4.0",
4343
"lodash.isequal": "^4.5.0",
4444
"nanoid": "^5.0.9",
4545
"strip-ansi": "^7.1.0",
46-
"uuid": "^10.0.0",
46+
"uuid": "^14.0.0",
4747
"zod": "4.1.13"
4848
},
4949
"devDependencies": {

src/plugin/plugin.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,30 @@ import { VerbosityLevel } from '../utils/verbosity-level.js';
3131
export class Plugin {
3232
planStorage: Map<string, Plan<any>>;
3333
planPty = new BackgroundPty();
34+
minSupportedCliVersion: string | undefined;
3435

3536
constructor(
3637
public name: string,
37-
public resourceControllers: Map<string, ResourceController<ResourceConfig>>
38+
public resourceControllers: Map<string, ResourceController<ResourceConfig>>,
39+
options?: { minSupportedCliVersion?: string }
3840
) {
3941
this.planStorage = new Map();
42+
this.minSupportedCliVersion = options?.minSupportedCliVersion;
4043
}
4144

42-
static create(name: string, resources: Resource<any>[]) {
45+
static create(
46+
name: string,
47+
resources: Resource<any>[],
48+
options?: { minSupportedCliVersion?: string }
49+
) {
4350
const controllers = resources
4451
.map((resource) => new ResourceController(resource))
4552

4653
const controllersMap = new Map<string, ResourceController<any>>(
4754
controllers.map((r) => [r.typeId, r] as const)
4855
);
4956

50-
return new Plugin(name, controllersMap);
57+
return new Plugin(name, controllersMap, options);
5158
}
5259

5360
async initialize(data: InitializeRequestData): Promise<InitializeResponseData> {
@@ -60,6 +67,7 @@ export class Plugin {
6067
}
6168

6269
return {
70+
minSupportedCliVersion: this.minSupportedCliVersion,
6371
resourceDefinitions: [...this.resourceControllers.values()]
6472
.map((r) => {
6573
const sensitiveParameters = Object.entries(r.settings.parameterSettings ?? {})

0 commit comments

Comments
 (0)