generated from ubiquity/ts-template
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ubq-testing/development
feat: permit module
- Loading branch information
Showing
43 changed files
with
5,639 additions
and
388 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 |
---|---|---|
@@ -1,11 +1,34 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json", | ||
"version": "0.2", | ||
"ignorePaths": ["**/*.json", "**/*.css", "node_modules", "**/*.log"], | ||
"ignorePaths": ["**/*.json", "**/*.css", "node_modules", "**/*.log", "supabase"], | ||
"useGitignore": true, | ||
"language": "en", | ||
"words": ["dataurl", "devpool", "outdir", "servedir"], | ||
"dictionaries": ["typescript", "node", "software-terms"], | ||
"import": ["@cspell/dict-typescript/cspell-ext.json", "@cspell/dict-node/cspell-ext.json", "@cspell/dict-software-terms"], | ||
"ignoreRegExpList": ["[0-9a-fA-F]{6}"] | ||
"ignoreRegExpList": ["[0-9a-fA-F]{6}"], | ||
"ignoreWords": [ | ||
"keccak", | ||
"mult", | ||
"ensname", | ||
"supabase", | ||
"scalarmult", | ||
"URLSAFE", | ||
"Gddm", | ||
"Njbl", | ||
"knip", | ||
"jiggery", | ||
"pokery", | ||
"URLSAFE2", | ||
"Mult", | ||
"WXDAI", | ||
"ubiquibot", | ||
"Supabase", | ||
"supabase", | ||
"libsodium", | ||
"Libsodium", | ||
"ciphertext", | ||
"tweetnacl" | ||
] | ||
} |
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 |
---|---|---|
@@ -1 +1,4 @@ | ||
MY_SECRET="MY_SECRET" | ||
X25519_PRIVATE_KEY= | ||
NFT_MINTER_PRIVATE_KEY= | ||
SUPABASE_URL= | ||
SUPABASE_ANON_KEY= |
This file was deleted.
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,61 @@ | ||
name: Permit Generation | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
stateId: | ||
required: true | ||
eventName: | ||
required: true | ||
eventPayload: | ||
required: true | ||
settings: | ||
required: true | ||
authToken: | ||
required: true | ||
ref: | ||
required: true | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20.10.0" | ||
|
||
- name: Install dependencies | ||
run: yarn | ||
|
||
- name: Generate Permit | ||
run: npx tsx ./src/index.ts | ||
id: permit | ||
env: | ||
STATE_ID: ${{ github.event.inputs.stateId }} | ||
EVENT_NAME: ${{ github.event.inputs.eventName }} | ||
EVENT_PAYLOAD: ${{ github.event.inputs.eventPayload }} | ||
SETTINGS: ${{ github.event.inputs.settings }} | ||
AUTH_TOKEN: ${{ github.event.inputs.authToken }} | ||
REF: ${{ github.event.inputs.ref }} | ||
|
||
- name: Return Permit To The Kernel | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
const permitStr = '${{ steps.permit.outputs.result }}'; | ||
const permitObj = JSON.parse(permitStr); | ||
await github.rest.repos.createDispatchEvent({ | ||
owner: "${{ github.repository }}".split("/")[0], | ||
repo: "${{ github.repository }}".split("/")[1], | ||
event_type: "return_data_to_ubiquibot_kernel", | ||
client_payload: { | ||
state_id: "${{ inputs.stateId }}", | ||
output: JSON.stringify(permitObj), | ||
}, | ||
}); |
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,34 @@ | ||
name: Run Jest testing suite | ||
on: | ||
workflow_dispatch: | ||
pull_request_target: | ||
types: [opened, synchronize] | ||
|
||
env: | ||
NODE_ENV: "test" | ||
|
||
jobs: | ||
testing: | ||
permissions: write-all | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20.10.0" | ||
- uses: actions/checkout@master | ||
with: | ||
fetch-depth: 0 | ||
- name: Build & Run test suite | ||
run: | | ||
npm i -g bun | ||
bun install | ||
bun test | tee ./coverage.txt && exit ${PIPESTATUS[0]} | ||
- name: Jest Coverage Comment | ||
# Ensures this step is run even on previous step failure (e.g. test failed) | ||
if: always() | ||
uses: MishaKav/jest-coverage-comment@main | ||
with: | ||
coverage-summary-path: coverage/coverage-summary.json | ||
junitxml-path: junit.xml | ||
junitxml-title: JUnit | ||
coverage-path: ./coverage.txt |
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,30 @@ | ||
name: Knip | ||
|
||
on: | ||
pull_request: | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
run-knip: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.10.0 | ||
|
||
- name: Install toolchain | ||
run: yarn install | ||
|
||
- name: Report knip results to pull request | ||
uses: Codex-/knip-reporter@v2 | ||
with: | ||
verbose: true | ||
comment_id: ${{ github.workflow }}-reporter | ||
command_script_name: knip-ci | ||
annotations: true | ||
ignore_results: false |
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 |
---|---|---|
|
@@ -6,5 +6,7 @@ node_modules | |
.yarn | ||
.pnp.cjs | ||
.pnp.loader.mjs | ||
.env | ||
static/dist | ||
.env | ||
/coverage | ||
junit.xml |
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
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,12 @@ | ||
import { JestConfigWithTsJest } from "ts-jest"; | ||
|
||
module.exports = { | ||
preset: "ts-jest", | ||
testEnvironment: "node", | ||
roots: ["./tests"], | ||
coveragePathIgnorePatterns: ["node_modules", "mocks"], | ||
collectCoverage: true, | ||
coverageReporters: ["json", "lcov", "text", "clover", "json-summary"], | ||
reporters: ["default", "jest-junit"], | ||
coverageDirectory: "coverage", | ||
} as JestConfigWithTsJest; |
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,11 @@ | ||
import type { KnipConfig } from "knip"; | ||
|
||
const config: KnipConfig = { | ||
entry: ["build/index.ts"], | ||
project: ["src/**/*.ts"], | ||
ignore: ["src/types/config.ts"], | ||
ignoreExportsUsedInFile: true, | ||
ignoreDependencies: [], | ||
}; | ||
|
||
export default config; |
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
Oops, something went wrong.