Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: generate json schema programmatically #97

Merged
merged 5 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/json-schema-upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Upload JSON Schema

on: workflow_dispatch

jobs:
upload:
name: Publish packages
timeout-minutes: 8
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 2

- uses: pnpm/action-setup@v3
with:
version: 8.5

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Lint
run: pnpm lint

- name: Build
run: pnpm build

- uses: ryand56/r2-upload-action@latest
with:
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
r2-bucket: ${{ secrets.R2_BUCKET }}
source-dir: ./packages/json-schema/dist/
destination-dir: ./config/schema/
17 changes: 16 additions & 1 deletion development/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,20 @@ Follow these concise steps to set up and contribute to this monorepo:
pnpm run gen:workspace
```

### JSON Schema

Enables auto-completion and linting inside VS Code.

## Development

1. Test the changes locally by changing the schema file in one of the examples to
```json
"$schema": "../../packages/json-schema/dist/latest.json",
```
2. Upload the new version to Cloudflare using github action CI pipeline
3. Update the schema reference for the examples to the new version
4. Commit the updated schema file

### Testing

- **Run Tests**:
Expand Down Expand Up @@ -71,4 +85,5 @@ Before creating a pull request (PR), follow these steps:

Follow the prompts presented by the changeset CLI to add the changeset to your PR.

> Note: If the changes do not require a version upgrade for the packages, you may skip adding a changeset.
> Note: If the changes do not require a version upgrade for the packages, you may skip adding a changeset.

15 changes: 0 additions & 15 deletions development/schema/README.md

This file was deleted.

Loading