diff --git a/.changeset/two-hornets-perform.md b/.changeset/two-hornets-perform.md new file mode 100644 index 0000000000..335a8cf542 --- /dev/null +++ b/.changeset/two-hornets-perform.md @@ -0,0 +1,5 @@ +--- +"@inlang/sdk": minor +--- + +Add settingsSchema to installedPlugin & installedMessageLintRule diff --git a/inlang/source-code/sdk/src/api.ts b/inlang/source-code/sdk/src/api.ts index c4213faf48..a4c78cd36d 100644 --- a/inlang/source-code/sdk/src/api.ts +++ b/inlang/source-code/sdk/src/api.ts @@ -19,6 +19,7 @@ export type InstalledPlugin = { * The module which the plugin is installed from. */ module: string + settingsSchema: Plugin["settingsSchema"] // disabled: boolean } @@ -31,6 +32,7 @@ export type InstalledMessageLintRule = { */ module: string level: MessageLintLevel + settingsSchema: MessageLintRule["settingsSchema"] } export type InlangProject = { diff --git a/inlang/source-code/sdk/src/loadProject.test.ts b/inlang/source-code/sdk/src/loadProject.test.ts index dfa03585cb..d3e2732132 100644 --- a/inlang/source-code/sdk/src/loadProject.test.ts +++ b/inlang/source-code/sdk/src/loadProject.test.ts @@ -552,6 +552,7 @@ describe("functionality", () => { description: mockPlugin.description, displayName: mockPlugin.displayName, module: settings.modules[0], + settingsSchema: mockPlugin.settingsSchema, }) expect(project.installed.messageLintRules()[0]).toEqual({ @@ -560,6 +561,7 @@ describe("functionality", () => { displayName: mockMessageLintRule.displayName, module: settings.modules[1], level: "warning", + settingsSchema: mockMessageLintRule.settingsSchema, }) }) diff --git a/inlang/source-code/sdk/src/loadProject.ts b/inlang/source-code/sdk/src/loadProject.ts index 8f5bbfd538..da8a0df0c8 100644 --- a/inlang/source-code/sdk/src/loadProject.ts +++ b/inlang/source-code/sdk/src/loadProject.ts @@ -281,6 +281,7 @@ export async function loadProject(args: { "Unknown module. You stumbled on a bug in inlang's source code. Please open an issue.", // default to warning, see https://github.com/opral/monorepo/issues/1254 level: settingsValue["messageLintRuleLevels"]?.[rule.id] ?? "warning", + settingsSchema: rule.settingsSchema, } satisfies InstalledMessageLintRule) ) satisfies Array } @@ -294,6 +295,7 @@ export async function loadProject(args: { module: resolvedModules()?.meta.find((m) => m.id.includes(plugin.id))?.module ?? "Unknown module. You stumbled on a bug in inlang's source code. Please open an issue.", + settingsSchema: plugin.settingsSchema, })) satisfies Array }