Skip to content

Commit 48a6353

Browse files
authored
Merge pull request #1 from IndieHub25/jules/x-cli-impl-3900908069278586411
2 parents e13d2c9 + bb67630 commit 48a6353

36 files changed

Lines changed: 8282 additions & 203 deletions

.github/workflows/py-ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Python Client CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'source/py-cli/**'
8+
pull_request:
9+
branches: [ main ]
10+
paths:
11+
- 'source/py-cli/**'
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
defaults:
17+
run:
18+
working-directory: ./source/py-cli
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: '3.9'
27+
cache: 'pip'
28+
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install flake8 pytest requests-mock
33+
pip install .
34+
35+
- name: Lint with flake8
36+
run: |
37+
# stop the build if there are Python syntax errors or undefined names
38+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
39+
# exit-zero treats all errors as warnings.
40+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
41+
42+
- name: Test with pytest
43+
run: |
44+
pytest

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: '18.x'
20+
registry-url: 'https://registry.npmjs.org'
21+
22+
- name: Setup Python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: '3.9'
26+
27+
- name: Build and Publish TS
28+
working-directory: ./source/ts-cli
29+
run: |
30+
npm ci
31+
npm run build
32+
# npm publish --access public
33+
env:
34+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
35+
36+
- name: Build and Publish Python
37+
working-directory: ./source/py-cli
38+
run: |
39+
pip install build twine
40+
python -m build
41+
# twine upload dist/*
42+
env:
43+
TWINE_USERNAME: __token__
44+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}

.github/workflows/ts-ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: TS Client CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'source/ts-cli/**'
8+
pull_request:
9+
branches: [ main ]
10+
paths:
11+
- 'source/ts-cli/**'
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
defaults:
17+
run:
18+
working-directory: ./source/ts-cli
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
23+
- name: Use Node.js
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: '18.x'
27+
cache: 'npm'
28+
cache-dependency-path: source/ts-cli/package-lock.json
29+
30+
- name: Install dependencies
31+
run: npm ci
32+
33+
- name: Lint
34+
run: npm run lint --if-present
35+
36+
- name: Build
37+
run: npm run build
38+
39+
- name: Test
40+
run: npm test

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
node_modules/
2+
dist/
3+
coverage/
4+
.DS_Store
5+
*.log
6+
.env
7+
__pycache__/
8+
*.pyc
9+
.pytest_cache/
10+
venv/
11+
.idea/
12+
.vscode/
13+
x-cli.egg-info/
14+
build/

CODE_OF_CONDUCT.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
## Enforcement
18+
19+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
20+
21+
## Attribution
22+
23+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 1.4.

CONTRIBUTING.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Contributing to x-cli
2+
3+
We welcome contributions! Please read this document before getting started.
4+
5+
## Development Setup
6+
7+
### Prerequisites
8+
9+
- Node.js 18+
10+
- Python 3.9+
11+
- Git
12+
13+
### TypeScript Client
14+
15+
1. Navigate to `source/ts-cli`.
16+
2. Install dependencies: `npm install`.
17+
3. Run build: `npm run build`.
18+
4. Run tests: `npm test`.
19+
5. Run dev mode: `npm run dev` (if available) or `npm start`.
20+
21+
### Python Client
22+
23+
1. Navigate to `source/py-cli`.
24+
2. Create a virtual env: `python -m venv venv && source venv/bin/activate`.
25+
3. Install editable: `pip install -e .[dev]`.
26+
4. Run tests: `pytest`.
27+
28+
## Code Style
29+
30+
- **TS:** We use `xo` / `eslint` and `prettier`. Run `npm run lint`.
31+
- **Python:** We use `black` and `flake8`.
32+
33+
## Pull Request Process
34+
35+
1. Fork the repository.
36+
2. Create a feature branch.
37+
3. Add tests for your changes.
38+
4. Ensure all tests pass.
39+
5. Submit a PR with a clear description.
40+
41+
## Commit Messages
42+
43+
Please follow the Conventional Commits specification (e.g., `feat: add search`, `fix: handle 429`).

0 commit comments

Comments
 (0)