Skip to content

Commit

Permalink
chore: generate json schema programmatically (#97)
Browse files Browse the repository at this point in the history
Co-authored-by: Saikat Mitra <saikatmitra91@gmail.com>
  • Loading branch information
arjunattam and saikatmitra91 authored Apr 8, 2024
1 parent b632035 commit 44f0639
Show file tree
Hide file tree
Showing 19 changed files with 306 additions and 371 deletions.
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

0 comments on commit 44f0639

Please sign in to comment.