Skip to content

Commit 2daa7a5

Browse files
authored
Initial commit
0 parents  commit 2daa7a5

File tree

104 files changed

+14396
-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

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