A monorepo containing TypeScript/JavaScript packages for Antfly.
| Package | Description | npm |
|---|---|---|
| @antfly/sdk | TypeScript SDK for the Antfly API | |
| @antfly/components | React components for building search interfaces |
pnpm add @antfly/sdk
# or
npm install @antfly/sdkimport { AntflyClient } from '@antfly/sdk';
const client = new AntflyClient({
baseUrl: 'http://localhost:8080',
auth: {
username: 'your-username',
password: 'your-password'
}
});
// Query data
const results = await client.query({
table: 'products',
limit: 10,
full_text_search: {
query: 'laptop'
}
});pnpm add @antfly/components
# or
npm install @antfly/componentsimport { Antfly, QueryBox, Facet, Results } from '@antfly/components';
const MySearchApp = () => (
<Antfly url="http://localhost:8080" table="movies">
<QueryBox id="mainSearch" mode="live" placeholder="Search movies..." />
<Facet id="actors" fields={["actors"]} />
<Results
id="results"
items={data =>
data.map(item => (
<div key={item._id}>
<h3>{item._source.title}</h3>
</div>
))
}
/>
</Antfly>
);This monorepo uses pnpm and Turborepo for package management and builds.
- Node.js >= 18
- pnpm >= 10
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Run tests
pnpm test
# Run in development mode
pnpm dev
# Type checking
pnpm typecheck
# Lint and format
pnpm lint
pnpm format# Run storybook for React components
pnpm storybook
# Build storybook
pnpm build-storybook
# Regenerate SDK types from OpenAPI spec
pnpm --filter @antfly/sdk generateantfly-ts/
├── packages/
│ ├── sdk/ # @antfly/sdk - TypeScript API client
│ └── components/ # @antfly/components - React search components
├── package.json # Root workspace config
├── pnpm-workspace.yaml
├── turbo.json # Turborepo config
└── tsconfig.base.json # Shared TypeScript config
- Node.js >= 18
- TypeScript >= 5.0 (for development)
Apache-2.0 License. See LICENSE file for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please ensure:
- All tests pass (
pnpm test) - Type checking passes (
pnpm typecheck) - Code is linted (
pnpm lint)
For issues and feature requests, please use the GitHub issue tracker.