Skip to content

Commit 4e8619a

Browse files
authored
Initial commit
0 parents  commit 4e8619a

File tree

104 files changed

+14397
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+14397
-0
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": [
4+
"@changesets/changelog-github",
5+
{ "repo": "codama-idl/renderers-demo" }
6+
],
7+
"commit": false,
8+
"access": "public",
9+
"baseBranch": "main",
10+
"updateInternalDependencies": "patch"
11+
}

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: 'npm'
4+
directory: '/'
5+
schedule:
6+
interval: daily
7+
time: '01:00'
8+
timezone: America/Los_Angeles
9+
open-pull-requests-limit: 10
10+
groups:
11+
codama:
12+
patterns:
13+
- '@codama/*'

.github/workflows/main.yml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: Main
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
env:
9+
# Among other things, opts out of Turborepo telemetry. See https://consoledonottrack.com/.
10+
DO_NOT_TRACK: '1'
11+
NODE_VERSION: 20
12+
SOLANA_VERSION: 2.1.9
13+
14+
jobs:
15+
lint:
16+
name: Check styling
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Git checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Setup pnpm
23+
uses: pnpm/action-setup@v3
24+
25+
- name: Setup Node.js ${{ env.NODE_VERSION }}
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: ${{ env.NODE_VERSION }}
29+
cache: 'pnpm'
30+
31+
- name: Install dependencies
32+
run: pnpm install --frozen-lockfile
33+
34+
- name: Compile JS and types
35+
run: pnpm run build
36+
37+
- name: Check linting
38+
run: pnpm run lint
39+
40+
tests:
41+
name: Test
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Git checkout
45+
uses: actions/checkout@v4
46+
47+
- name: Install pnpm
48+
uses: pnpm/action-setup@v3
49+
50+
- name: Setup Node.js ${{ env.NODE_VERSION }}
51+
uses: actions/setup-node@v4
52+
with:
53+
node-version: ${{ env.NODE_VERSION }}
54+
cache: 'pnpm'
55+
56+
- name: Install dependencies
57+
run: pnpm install --frozen-lockfile
58+
59+
- name: Build and run tests
60+
run: pnpm build && pnpm test
61+
62+
- name: Ensure working directory is clean
63+
run: |
64+
git status
65+
test -z "$(git status --porcelain)"
66+
67+
release:
68+
name: Release
69+
runs-on: ubuntu-latest
70+
if: github.event_name == 'push'
71+
needs: [lint, tests]
72+
permissions:
73+
contents: write
74+
pull-requests: write
75+
outputs:
76+
published: ${{ steps.changesets.outputs.published }}
77+
steps:
78+
- name: Checkout Repo
79+
uses: actions/checkout@v4
80+
81+
- name: Setup pnpm
82+
uses: pnpm/action-setup@v3
83+
84+
- name: Setup Node.js ${{ env.NODE_VERSION }}
85+
uses: actions/setup-node@v4
86+
with:
87+
node-version: ${{ env.NODE_VERSION }}
88+
cache: 'pnpm'
89+
90+
- name: Install Dependencies
91+
run: pnpm install --frozen-lockfile
92+
93+
- name: Create Release Pull Request or Publish
94+
id: changesets
95+
uses: changesets/action@v1
96+
with:
97+
commit: 'Publish package'
98+
title: 'Publish package'
99+
publish: pnpm publish-package
100+
env:
101+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
102+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
103+
104+
dependabot:
105+
runs-on: ubuntu-latest
106+
if: github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'codama-idl/renderers-demo'
107+
needs: [lint, tests]
108+
permissions:
109+
contents: write
110+
pull-requests: write
111+
steps:
112+
- name: Auto-approve the PR
113+
run: gh pr review --approve "$PR_URL"
114+
env:
115+
PR_URL: ${{ github.event.pull_request.html_url }}
116+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
117+
- name: Enable auto-merge
118+
run: gh pr merge --auto --squash "$PR_URL"
119+
env:
120+
PR_URL: ${{ github.event.pull_request.html_url }}
121+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# builds
4+
dist/
5+
6+
# dependencies
7+
node_modules
8+
.pnp
9+
.pnp.js
10+
11+
# misc
12+
.DS_Store
13+
*.pem
14+
15+
# debug
16+
npm-debug.log*
17+
yarn-debug.log*
18+
yarn-error.log*
19+
.pnpm-debug.log*
20+
21+
# turbo
22+
.turbo
23+
24+
# `solana-test-validator`
25+
.solana/
26+
test-ledger/
27+
target/

.prettierignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
test/e2e/
2+
3+
.changeset/
4+
.github/workflows/PULL_REQUEST_TEMPLATE.md
5+
6+
declarations/
7+
dist/
8+
doc/
9+
lib/
10+
test-ledger/
11+
target/
12+
CHANGELOG.md
13+
14+
pnpm-lock.yaml
15+
pnpm-workspace.yaml

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# @codama/renderers-demo
2+
3+
## 1.0.3
4+
5+
### Patch Changes
6+
7+
- [`2874afc`](https://github.com/codama-idl/renderers-demo/commit/2874afccd5c51e034f8ebdd94ea18f8ca4ba4913) Thanks [@lorisleiva](https://github.com/lorisleiva)! - This is another test patch update.
8+
9+
## 1.0.2
10+
11+
### Patch Changes
12+
13+
- [#7](https://github.com/codama-idl/renderers-demo/pull/7) [`06e4f2c`](https://github.com/codama-idl/renderers-demo/commit/06e4f2c05943a857ec21f69be5980457400d3320) Thanks [@lorisleiva](https://github.com/lorisleiva)! - This is a test patch update to ensure the extraction of the demo renderer to its own repo was successful.

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Codama
4+
5+
Permission is hereby granted, free of charge, to any person obtaining
6+
a copy of this software and associated documentation files (the
7+
"Software"), to deal in the Software without restriction, including
8+
without limitation the rights to use, copy, modify, merge, publish,
9+
distribute, sublicense, and/or sell copies of the Software, and to
10+
permit persons to whom the Software is furnished to do so, subject to
11+
the following conditions:
12+
13+
The above copyright notice and this permission notice shall be
14+
included in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Codama ➤ Renderers ➤ Demo
2+
3+
[![npm][npm-image]][npm-url]
4+
[![npm-downloads][npm-downloads-image]][npm-url]
5+
6+
[npm-downloads-image]: https://img.shields.io/npm/dm/@codama/renderers-demo.svg?style=flat
7+
[npm-image]: https://img.shields.io/npm/v/@codama/renderers-demo.svg?style=flat&label=%40codama%2Frenderers-demo
8+
[npm-url]: https://www.npmjs.com/package/@codama/renderers-demo
9+
10+
This package provides a demo implementation of a Codama renderer to help developers create their own.
11+
12+
## Installation
13+
14+
```sh
15+
pnpm install @codama/renderers-demo
16+
```
17+
18+
## Usage
19+
20+
Add the following script to your Codama configuration file.
21+
22+
```json
23+
{
24+
"scripts": {
25+
"demo": {
26+
"from": "@codama/renderers-demo",
27+
"args": ["docs"]
28+
}
29+
}
30+
}
31+
```

eslint.config.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import solanaConfig from '@solana/eslint-config-solana';
2+
import { defineConfig } from 'eslint/config';
3+
4+
export default defineConfig([
5+
{ ignores: ['**/dist/**', '**/e2e/**'] },
6+
{ files: ['**/*.ts', '**/*.(c|m)?js'], extends: [solanaConfig] },
7+
]);

0 commit comments

Comments
 (0)