mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-21 05:32:53 +00:00
fix: restore check-time path inference
This commit is contained in:
@@ -3,6 +3,11 @@
|
||||
"compilerOptions": {
|
||||
"ignoreDeprecations": "6.0",
|
||||
"paths": {
|
||||
"openclaw/extension-api": ["../src/extensionAPI.ts"],
|
||||
"openclaw/plugin-sdk": ["../src/plugin-sdk/index.ts"],
|
||||
"openclaw/plugin-sdk/*": ["../src/plugin-sdk/*.ts"],
|
||||
"openclaw/plugin-sdk/account-id": ["../src/plugin-sdk/account-id.ts"],
|
||||
"@openclaw/*": ["../extensions/*"],
|
||||
"@openclaw/plugin-sdk/*": ["../packages/plugin-sdk/dist/packages/plugin-sdk/src/*.d.ts"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
export type CommandPathMatchRule =
|
||||
| readonly string[]
|
||||
| {
|
||||
pattern: readonly string[];
|
||||
exact?: boolean;
|
||||
};
|
||||
export type StructuredCommandPathMatchRule = {
|
||||
pattern: readonly string[];
|
||||
exact?: boolean;
|
||||
};
|
||||
|
||||
export type CommandPathMatchRule = readonly string[] | StructuredCommandPathMatchRule;
|
||||
|
||||
function isStructuredCommandPathMatchRule(
|
||||
rule: CommandPathMatchRule,
|
||||
): rule is Extract<CommandPathMatchRule, { pattern: readonly string[] }> {
|
||||
): rule is StructuredCommandPathMatchRule {
|
||||
return !Array.isArray(rule);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,10 +16,11 @@ export type RoutedCommandDefinition<TArgs = unknown> = {
|
||||
runParsedArgs: (args: TArgs) => Promise<void>;
|
||||
};
|
||||
|
||||
function defineRoutedCommand<TArgs>(
|
||||
definition: RoutedCommandDefinition<TArgs>,
|
||||
): RoutedCommandDefinition<TArgs> {
|
||||
return definition;
|
||||
function defineRoutedCommand<TParse extends (argv: string[]) => unknown>(definition: {
|
||||
parseArgs: TParse;
|
||||
runParsedArgs: (args: Exclude<ReturnType<TParse>, null>) => Promise<void>;
|
||||
}): RoutedCommandDefinition<Exclude<ReturnType<TParse>, null>> {
|
||||
return definition as RoutedCommandDefinition<Exclude<ReturnType<TParse>, null>>;
|
||||
}
|
||||
|
||||
export const routedCommandDefinitions = {
|
||||
|
||||
@@ -32,7 +32,12 @@ describe("opt-in extension package boundaries", () => {
|
||||
const tsconfig = readJsonFile<TsConfigJson>("extensions/tsconfig.package-boundary.base.json");
|
||||
expect(tsconfig.extends).toBe("../tsconfig.json");
|
||||
expect(tsconfig.compilerOptions?.paths).toEqual({
|
||||
"@openclaw/plugin-sdk/*": ["packages/plugin-sdk/dist/packages/plugin-sdk/src/*.d.ts"],
|
||||
"openclaw/extension-api": ["../src/extensionAPI.ts"],
|
||||
"openclaw/plugin-sdk": ["../src/plugin-sdk/index.ts"],
|
||||
"openclaw/plugin-sdk/*": ["../src/plugin-sdk/*.ts"],
|
||||
"openclaw/plugin-sdk/account-id": ["../src/plugin-sdk/account-id.ts"],
|
||||
"@openclaw/*": ["../extensions/*"],
|
||||
"@openclaw/plugin-sdk/*": ["../packages/plugin-sdk/dist/packages/plugin-sdk/src/*.d.ts"],
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user