-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f3897d7
Showing
16 changed files
with
652 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Test Raw Json | ||
on: push | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Test Local Action | ||
uses: ./ | ||
with: | ||
source-file: test/test.schema.json | ||
out-langs: ts,rs | ||
no-json-schema: true | ||
- name: Upload files | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: bindings | ||
path: | | ||
./test.ts | ||
./test.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Test | ||
on: push | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Test Local Action | ||
uses: ./ | ||
with: | ||
source-file: test/test.schema.json | ||
out-langs: ts,rs | ||
- name: Upload files | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: bindings | ||
path: | | ||
./test.ts | ||
./test.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# Dependency directory | ||
node_modules | ||
|
||
lib | ||
|
||
# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
*.lcov | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
.env.test | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
|
||
# next.js build output | ||
.next | ||
|
||
# nuxt.js build output | ||
.nuxt | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
# OS metadata | ||
.DS_Store | ||
Thumbs.db | ||
|
||
# Ignore built ts files | ||
__tests__/runner/* | ||
|
||
# IDE files | ||
.idea | ||
.vscode | ||
*.code-workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx lint-staged | ||
npx lint-staged | ||
npx lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
20.6.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dist/ | ||
node_modules/ | ||
coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# quicktype-gha | ||
|
||
A GitHub Action for generating type bindings from JSON schema files | ||
|
||
## Inputs | ||
|
||
### `source-file` | ||
|
||
Schema JSON file to generate type bindings from. | ||
|
||
### `out-langs` | ||
|
||
Comma-separated list of language extensions to generate bindings for | ||
|
||
### `out-dir` (optional) | ||
|
||
Directory to output generated bindings to | ||
|
||
## Example Usage | ||
|
||
You can use this action to generate artifacts with the type bindings in your preferred languages. | ||
|
||
For example, you might design a workflow to generate bindings for both TypeScript and Rust, e.g. | ||
|
||
```yml | ||
name: Build | ||
on: push | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: API Schema | ||
uses: thomasmost/[email protected] | ||
with: | ||
source-file: data_objects/api.schema.json | ||
out-langs: ts,rs | ||
- name: Upload files | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: bindings | ||
path: | | ||
./api.ts | ||
./api.rs | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: "Valjean JSON Schema Validator" | ||
description: "Validate JSON using remote schemas" | ||
|
||
branding: | ||
label: "Valjean JSON Schema Validator" | ||
icon: "book" | ||
color: "red" | ||
|
||
inputs: | ||
schema-url: | ||
description: "the url to the JSON schema" | ||
required: true | ||
target-dir: | ||
description: "the directory (or directories, comma separated) containing the json files to validate" | ||
required: true | ||
|
||
runs: | ||
using: "node20" | ||
main: "dist/index.js" |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"name": "gha-valjean", | ||
"version": "0.3.0", | ||
"description": "", | ||
"main": "index.js", | ||
"packageManager": "[email protected]", | ||
"scripts": { | ||
"all": "pnpm run format:write && pnpm run build", | ||
"build": "tsc && ncc build lib/index.js --minify", | ||
"format:check": "pnpm exec prettier --check .", | ||
"format:write": "pnpm exec prettier --write .", | ||
"prepare": "husky install", | ||
"test": "pnpm exec jest" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"@actions/core": "^1.10.1", | ||
"@actions/github": "^6.0.0", | ||
"@vercel/ncc": "^0.38.1", | ||
"ajv": "^8.16.0" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.12.12", | ||
"husky": "^9.0.11", | ||
"prettier": "^3.2.5", | ||
"typescript": "^5.4.5" | ||
}, | ||
"lint-staged": { | ||
"*.{js,css,md}": "prettier --write" | ||
} | ||
} |
Oops, something went wrong.