Skip to content
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
File renamed without changes.
40 changes: 40 additions & 0 deletions .github/workflows/publish-types.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish types

on:
schedule:
- cron: '0 10 * * *'
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
defaults:
run:
working-directory: types
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
- run: |
npm install --global pnpm
pnpm install
- run: pnpm gen
- run: pnpm format
- name: Check for changes
id: check_changes
run: echo "changed_files=$(git status --porcelain)"
- name: Publish to npm
if: steps.check_changes.outputs.changed_files != ''
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm version patch --no-git-tag-version
npm publish --provenance
- uses: stefanzweifel/git-auto-commit-action@v5
if: steps.check_changes.outputs.changed_files != ''
with:
commit_message: 'Update type definitions'
1 change: 1 addition & 0 deletions types/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
1 change: 1 addition & 0 deletions types/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm-lock.yaml
31 changes: 31 additions & 0 deletions types/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Lichess.org API Types

## Installation

```bash
npm install @lichess-org/types
```

## Usage

```typescript
import { components } from "@lichess-org/types";

type LichessGame = components["schemas"]["GameJson"];
```

## For Maintainers

To regenerate:

```bash
pnpm gen
pnpm format
```

To publish:

```bash
npm version patch --no-git-tag-version
npm publish
```
Empty file added types/index.js
Empty file.
Loading