@birdie_moblie/plugin-marketplace-cli 1.0.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 +71 -0
- package/dist/adapters/claude.d.ts +41 -0
- package/dist/adapters/claude.js +89 -0
- package/dist/adapters/claude.js.map +1 -0
- package/dist/adapters/codex.d.ts +54 -0
- package/dist/adapters/codex.js +96 -0
- package/dist/adapters/codex.js.map +1 -0
- package/dist/cli.d.ts +13 -0
- package/dist/cli.js +58 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/build.d.ts +9 -0
- package/dist/commands/build.js +37 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/index-gen.d.ts +9 -0
- package/dist/commands/index-gen.js +72 -0
- package/dist/commands/index-gen.js.map +1 -0
- package/dist/commands/init-repo.d.ts +7 -0
- package/dist/commands/init-repo.js +116 -0
- package/dist/commands/init-repo.js.map +1 -0
- package/dist/commands/init.d.ts +9 -0
- package/dist/commands/init.js +101 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/release-local.d.ts +8 -0
- package/dist/commands/release-local.js +106 -0
- package/dist/commands/release-local.js.map +1 -0
- package/dist/commands/validate.d.ts +9 -0
- package/dist/commands/validate.js +150 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/schema/plugin-yaml.d.ts +59 -0
- package/dist/schema/plugin-yaml.js +140 -0
- package/dist/schema/plugin-yaml.js.map +1 -0
- package/dist/utils/helpers.d.ts +47 -0
- package/dist/utils/helpers.js +117 -0
- package/dist/utils/helpers.js.map +1 -0
- package/package.json +33 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* plugin.yaml JSON Schema 定义
|
|
3
|
+
*
|
|
4
|
+
* 这是 marketplace 的核心数据模型。所有 plugin.yaml 都必须符合此 schema。
|
|
5
|
+
* 生成双平台 manifest 时,也基于此 schema 做字段映射。
|
|
6
|
+
*/
|
|
7
|
+
// ── JSON Schema ──────────────────────────────────────────
|
|
8
|
+
export const pluginYamlSchema = {
|
|
9
|
+
type: 'object',
|
|
10
|
+
required: ['name', 'version', 'description', 'author', 'components'],
|
|
11
|
+
additionalProperties: false,
|
|
12
|
+
properties: {
|
|
13
|
+
name: {
|
|
14
|
+
type: 'string',
|
|
15
|
+
pattern: '^[a-z0-9][a-z0-9-]*[a-z0-9]$',
|
|
16
|
+
minLength: 2,
|
|
17
|
+
maxLength: 64,
|
|
18
|
+
},
|
|
19
|
+
version: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
pattern: '^\\d+\\.\\d+\\.\\d+',
|
|
22
|
+
},
|
|
23
|
+
description: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
minLength: 1,
|
|
26
|
+
maxLength: 500,
|
|
27
|
+
},
|
|
28
|
+
author: {
|
|
29
|
+
type: 'object',
|
|
30
|
+
required: ['name'],
|
|
31
|
+
additionalProperties: false,
|
|
32
|
+
properties: {
|
|
33
|
+
name: { type: 'string' },
|
|
34
|
+
email: { type: 'string', nullable: true },
|
|
35
|
+
url: { type: 'string', nullable: true },
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
category: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
nullable: true,
|
|
41
|
+
},
|
|
42
|
+
tags: {
|
|
43
|
+
type: 'array',
|
|
44
|
+
items: { type: 'string' },
|
|
45
|
+
nullable: true,
|
|
46
|
+
},
|
|
47
|
+
components: {
|
|
48
|
+
type: 'object',
|
|
49
|
+
required: [],
|
|
50
|
+
additionalProperties: false,
|
|
51
|
+
properties: {
|
|
52
|
+
skills: {
|
|
53
|
+
type: 'array',
|
|
54
|
+
nullable: true,
|
|
55
|
+
items: {
|
|
56
|
+
type: 'object',
|
|
57
|
+
required: ['name', 'path'],
|
|
58
|
+
additionalProperties: false,
|
|
59
|
+
properties: {
|
|
60
|
+
name: { type: 'string' },
|
|
61
|
+
path: { type: 'string' },
|
|
62
|
+
description: { type: 'string', nullable: true },
|
|
63
|
+
'argument-hint': { type: 'string', nullable: true },
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
mcp: {
|
|
68
|
+
type: 'array',
|
|
69
|
+
nullable: true,
|
|
70
|
+
items: {
|
|
71
|
+
type: 'object',
|
|
72
|
+
required: ['name', 'command'],
|
|
73
|
+
additionalProperties: false,
|
|
74
|
+
properties: {
|
|
75
|
+
name: { type: 'string' },
|
|
76
|
+
command: { type: 'string' },
|
|
77
|
+
args: {
|
|
78
|
+
type: 'array',
|
|
79
|
+
items: { type: 'string' },
|
|
80
|
+
nullable: true,
|
|
81
|
+
},
|
|
82
|
+
env: {
|
|
83
|
+
type: 'object',
|
|
84
|
+
nullable: true,
|
|
85
|
+
required: [],
|
|
86
|
+
additionalProperties: { type: 'string' },
|
|
87
|
+
},
|
|
88
|
+
description: { type: 'string', nullable: true },
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
hooks: {
|
|
93
|
+
type: 'array',
|
|
94
|
+
nullable: true,
|
|
95
|
+
items: {
|
|
96
|
+
type: 'object',
|
|
97
|
+
required: ['event', 'command'],
|
|
98
|
+
additionalProperties: false,
|
|
99
|
+
properties: {
|
|
100
|
+
event: { type: 'string' },
|
|
101
|
+
pattern: { type: 'string', nullable: true },
|
|
102
|
+
command: { type: 'string' },
|
|
103
|
+
timeout: { type: 'number', nullable: true },
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
platform: {
|
|
110
|
+
type: 'object',
|
|
111
|
+
nullable: true,
|
|
112
|
+
required: [],
|
|
113
|
+
additionalProperties: false,
|
|
114
|
+
properties: {
|
|
115
|
+
codex: {
|
|
116
|
+
type: 'object',
|
|
117
|
+
nullable: true,
|
|
118
|
+
required: [],
|
|
119
|
+
additionalProperties: false,
|
|
120
|
+
properties: {
|
|
121
|
+
interface: {
|
|
122
|
+
type: 'object',
|
|
123
|
+
nullable: true,
|
|
124
|
+
required: [],
|
|
125
|
+
additionalProperties: false,
|
|
126
|
+
properties: {
|
|
127
|
+
displayName: { type: 'string', nullable: true },
|
|
128
|
+
shortDescription: { type: 'string', nullable: true },
|
|
129
|
+
longDescription: { type: 'string', nullable: true },
|
|
130
|
+
category: { type: 'string', nullable: true },
|
|
131
|
+
developerName: { type: 'string', nullable: true },
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
//# sourceMappingURL=plugin-yaml.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-yaml.js","sourceRoot":"","sources":["../../src/schema/plugin-yaml.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAiEH,4DAA4D;AAE5D,MAAM,CAAC,MAAM,gBAAgB,GAA+B;IAC1D,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,CAAC;IACpE,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,8BAA8B;YACvC,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,EAAE;SACd;QACD,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,qBAAqB;SAC/B;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,GAAG;SACf;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,CAAC,MAAM,CAAC;YAClB,oBAAoB,EAAE,KAAK;YAC3B,UAAU,EAAE;gBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACxB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE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E,KAAK;4BAC3B,UAAU,EAAE;gCACV,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;gCAC/C,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;gCACpD,eAAe,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;gCACnD,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;gCAC5C,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;6BAClD;yBACF;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 共享工具函数
|
|
3
|
+
*
|
|
4
|
+
* 提供 plugin.yaml 加载、校验、路径解析等通用能力。
|
|
5
|
+
*/
|
|
6
|
+
import { type PluginYaml } from '../schema/plugin-yaml.js';
|
|
7
|
+
export interface PluginRepoContext {
|
|
8
|
+
rootDir: string;
|
|
9
|
+
pluginsDir: string;
|
|
10
|
+
marketplaceYamlPath: string;
|
|
11
|
+
distDir: string;
|
|
12
|
+
}
|
|
13
|
+
export interface MarketplaceMetadata {
|
|
14
|
+
name: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
organization?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function resolveInvocationPath(pathArg: string): string;
|
|
19
|
+
export declare function findMarketplaceRoot(startDir?: string): string | undefined;
|
|
20
|
+
export declare function resolveRepoContext(rootArg?: string, options?: {
|
|
21
|
+
allowMissingMarketplace?: boolean;
|
|
22
|
+
}): PluginRepoContext;
|
|
23
|
+
/**
|
|
24
|
+
* 加载并校验一个 plugin.yaml
|
|
25
|
+
*/
|
|
26
|
+
export declare function loadPluginYaml(pluginDir: string): PluginYaml;
|
|
27
|
+
/**
|
|
28
|
+
* 加载 marketplace.yaml。该文件是双平台 marketplace manifest 的元数据来源。
|
|
29
|
+
*/
|
|
30
|
+
export declare function loadMarketplaceMetadata(context: PluginRepoContext): MarketplaceMetadata;
|
|
31
|
+
/**
|
|
32
|
+
* 获取所有插件目录名
|
|
33
|
+
*/
|
|
34
|
+
export declare function listPluginNames(context: PluginRepoContext): string[];
|
|
35
|
+
/**
|
|
36
|
+
* 加载所有插件
|
|
37
|
+
*/
|
|
38
|
+
export declare function loadAllPlugins(context: PluginRepoContext): Array<{
|
|
39
|
+
name: string;
|
|
40
|
+
dir: string;
|
|
41
|
+
config: PluginYaml;
|
|
42
|
+
}>;
|
|
43
|
+
/**
|
|
44
|
+
* 将 kebab-case 名称转为 Title Case
|
|
45
|
+
* 例如 "marketplace-maintainer" → "Marketplace Maintainer"
|
|
46
|
+
*/
|
|
47
|
+
export declare function toTitleCase(kebab: string): string;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 共享工具函数
|
|
3
|
+
*
|
|
4
|
+
* 提供 plugin.yaml 加载、校验、路径解析等通用能力。
|
|
5
|
+
*/
|
|
6
|
+
import { readFileSync, existsSync, readdirSync } from 'node:fs';
|
|
7
|
+
import { dirname, join, resolve } from 'node:path';
|
|
8
|
+
import yaml from 'js-yaml';
|
|
9
|
+
import Ajv from 'ajv';
|
|
10
|
+
import { pluginYamlSchema } from '../schema/plugin-yaml.js';
|
|
11
|
+
// @ts-expect-error -- ajv v8 CJS/ESM interop: 运行时可构造,但 Node16 类型推导不对
|
|
12
|
+
const ajv = new Ajv({ allErrors: true });
|
|
13
|
+
const validateSchema = ajv.compile(pluginYamlSchema);
|
|
14
|
+
export function resolveInvocationPath(pathArg) {
|
|
15
|
+
return resolve(process.env.INIT_CWD || process.cwd(), pathArg);
|
|
16
|
+
}
|
|
17
|
+
export function findMarketplaceRoot(startDir = process.cwd()) {
|
|
18
|
+
let current = resolve(startDir);
|
|
19
|
+
while (true) {
|
|
20
|
+
if (existsSync(join(current, 'marketplace.yaml'))) {
|
|
21
|
+
return current;
|
|
22
|
+
}
|
|
23
|
+
const parent = dirname(current);
|
|
24
|
+
if (parent === current) {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
current = parent;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export function resolveRepoContext(rootArg, options = {}) {
|
|
31
|
+
const rootDir = rootArg ? resolveInvocationPath(rootArg) : findMarketplaceRoot();
|
|
32
|
+
if (!rootDir) {
|
|
33
|
+
throw new Error('marketplace.yaml not found. Run `plugin-marketplace init-repo` first or pass `--root <dir>`.');
|
|
34
|
+
}
|
|
35
|
+
const marketplaceYamlPath = join(rootDir, 'marketplace.yaml');
|
|
36
|
+
if (!options.allowMissingMarketplace && !existsSync(marketplaceYamlPath)) {
|
|
37
|
+
throw new Error(`marketplace.yaml not found: ${marketplaceYamlPath}. Run \`plugin-marketplace --root ${rootDir} init-repo\` first.`);
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
rootDir,
|
|
41
|
+
pluginsDir: join(rootDir, 'plugins'),
|
|
42
|
+
marketplaceYamlPath,
|
|
43
|
+
distDir: join(rootDir, 'dist'),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 加载并校验一个 plugin.yaml
|
|
48
|
+
*/
|
|
49
|
+
export function loadPluginYaml(pluginDir) {
|
|
50
|
+
const yamlPath = join(pluginDir, 'plugin.yaml');
|
|
51
|
+
if (!existsSync(yamlPath)) {
|
|
52
|
+
throw new Error(`plugin.yaml not found: ${yamlPath}`);
|
|
53
|
+
}
|
|
54
|
+
const raw = readFileSync(yamlPath, 'utf-8');
|
|
55
|
+
const data = yaml.load(raw);
|
|
56
|
+
if (!validateSchema(data)) {
|
|
57
|
+
const errors = validateSchema.errors
|
|
58
|
+
?.map((e) => ` - ${e.instancePath || '/'}: ${e.message}`)
|
|
59
|
+
.join('\n');
|
|
60
|
+
throw new Error(`plugin.yaml validation failed:\n${errors}`);
|
|
61
|
+
}
|
|
62
|
+
return data;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* 加载 marketplace.yaml。该文件是双平台 marketplace manifest 的元数据来源。
|
|
66
|
+
*/
|
|
67
|
+
export function loadMarketplaceMetadata(context) {
|
|
68
|
+
if (!existsSync(context.marketplaceYamlPath)) {
|
|
69
|
+
throw new Error(`marketplace.yaml not found: ${context.marketplaceYamlPath}`);
|
|
70
|
+
}
|
|
71
|
+
const raw = readFileSync(context.marketplaceYamlPath, 'utf-8');
|
|
72
|
+
const data = yaml.load(raw);
|
|
73
|
+
if (!data || typeof data !== 'object') {
|
|
74
|
+
throw new Error('marketplace.yaml must contain an object');
|
|
75
|
+
}
|
|
76
|
+
const record = data;
|
|
77
|
+
if (typeof record.name !== 'string' || record.name.trim().length === 0) {
|
|
78
|
+
throw new Error('marketplace.yaml field `name` must be a non-empty string');
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
name: record.name.trim(),
|
|
82
|
+
...(typeof record.description === 'string' ? { description: record.description } : {}),
|
|
83
|
+
...(typeof record.organization === 'string' ? { organization: record.organization } : {}),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* 获取所有插件目录名
|
|
88
|
+
*/
|
|
89
|
+
export function listPluginNames(context) {
|
|
90
|
+
if (!existsSync(context.pluginsDir)) {
|
|
91
|
+
return [];
|
|
92
|
+
}
|
|
93
|
+
return readdirSync(context.pluginsDir, { withFileTypes: true })
|
|
94
|
+
.filter((d) => d.isDirectory())
|
|
95
|
+
.filter((d) => existsSync(join(context.pluginsDir, d.name, 'plugin.yaml')))
|
|
96
|
+
.map((d) => d.name);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* 加载所有插件
|
|
100
|
+
*/
|
|
101
|
+
export function loadAllPlugins(context) {
|
|
102
|
+
return listPluginNames(context).map((name) => {
|
|
103
|
+
const dir = join(context.pluginsDir, name);
|
|
104
|
+
return { name, dir, config: loadPluginYaml(dir) };
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* 将 kebab-case 名称转为 Title Case
|
|
109
|
+
* 例如 "marketplace-maintainer" → "Marketplace Maintainer"
|
|
110
|
+
*/
|
|
111
|
+
export function toTitleCase(kebab) {
|
|
112
|
+
return kebab
|
|
113
|
+
.split('-')
|
|
114
|
+
.map((w) => w.charAt(0).toUpperCase() + w.slice(1))
|
|
115
|
+
.join(' ');
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAE7E,qEAAqE;AACrE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AACzC,MAAM,cAAc,GAAG,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAerD,MAAM,UAAU,qBAAqB,CAAC,OAAe;IACnD,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE;IAC1D,IAAI,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEhC,OAAO,IAAI,EAAE,CAAC;QACZ,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AC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,OAAO,KAAK;SACT,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAClD,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@birdie_moblie/plugin-marketplace-cli",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "CLI for maintaining Claude Code and Codex plugin marketplace repositories",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"bin": {
|
|
9
|
+
"plugin-marketplace": "dist/cli.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"clean": "rm -rf dist tsconfig.tsbuildinfo",
|
|
17
|
+
"build": "npm run clean && tsc",
|
|
18
|
+
"mp": "tsx src/cli.ts",
|
|
19
|
+
"dev": "tsx watch src/cli.ts"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"commander": "^13.0.0",
|
|
23
|
+
"js-yaml": "^4.1.0",
|
|
24
|
+
"ajv": "^8.17.0",
|
|
25
|
+
"chalk": "^5.4.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/js-yaml": "^4.0.9",
|
|
29
|
+
"@types/node": "^22.0.0",
|
|
30
|
+
"tsx": "^4.19.0",
|
|
31
|
+
"typescript": "^5.7.0"
|
|
32
|
+
}
|
|
33
|
+
}
|