mirror of
https://github.com/ComposioHQ/composio.git
synced 2026-09-22 11:46:35 +08:00
74ce25812e
This PR: - patches the Peekaboo sidecar build to rewrite the resolved `swift-system` `AT_RESOLVE_BENEATH` Darwin guard before compiling on GitHub macOS runners - adds regression coverage for the `swift-system` checkout patch and includes script tests in `@composio/cli-local-tools` Vitest - switches the SDK docs sync workflow to `anthropics/claude-code-action/base-action` so push-triggered automation does not fail on unsupported event parsing - moves Claude tool restrictions to `claude_args` and quotes `$GITHUB_OUTPUT` writes so the workflow passes `actionlint` - verifies the changed package and workflow with targeted tests, build, formatting, YAML parsing, and `actionlint`
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { patchSwiftSystemAtResolveBeneathGuardInSource } from './swift-system-patches';
|
|
|
|
describe('swift-system build patches', () => {
|
|
it('narrows AT_RESOLVE_BENEATH availability to FreeBSD', () => {
|
|
const source = `#if canImport(Darwin, _version: 346) || os(FreeBSD)
|
|
@_alwaysEmitIntoClient
|
|
internal var _AT_RESOLVE_BENEATH: CInt { AT_RESOLVE_BENEATH }
|
|
#endif
|
|
`;
|
|
|
|
const patched = patchSwiftSystemAtResolveBeneathGuardInSource(
|
|
source,
|
|
'Sources/System/Internals/Constants.swift'
|
|
);
|
|
|
|
expect(patched.replacementCount).toBe(1);
|
|
expect(patched.source).toContain('#if os(FreeBSD)');
|
|
expect(patched.source).not.toContain('canImport(Darwin, _version: 346)');
|
|
});
|
|
|
|
it('is idempotent for already patched sources', () => {
|
|
const source = `#if os(FreeBSD)
|
|
@_alwaysEmitIntoClient
|
|
internal var _AT_RESOLVE_BENEATH: CInt { AT_RESOLVE_BENEATH }
|
|
#endif
|
|
`;
|
|
|
|
const patched = patchSwiftSystemAtResolveBeneathGuardInSource(
|
|
source,
|
|
'Sources/System/Internals/Constants.swift'
|
|
);
|
|
|
|
expect(patched).toEqual({ source, replacementCount: 0 });
|
|
});
|
|
});
|