-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sdk): init sdk package with biome and a precommit hook
- Loading branch information
Showing
14 changed files
with
1,168 additions
and
1 deletion.
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
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
# get dir | ||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
# nav to sdk dir | ||
SDK_DIR="$SCRIPT_DIR/../sdk" | ||
|
||
# when running pre-commit, files are passed as args | ||
# when running git hook, find ourselves | ||
if [ $# -eq 0 ]; then | ||
TS_FILES=$(git diff --cached --name-only --diff-filter=ACMR | grep "^sdk.*\.\(ts\|tsx\)$" || true) | ||
else | ||
TS_FILES="$@" | ||
fi | ||
|
||
if [ -n "$TS_FILES" ]; then | ||
echo "Running SDK checks..." | ||
cd "$SDK_DIR" | ||
|
||
# clean + build | ||
echo "Building SDK..." | ||
pnpm build:clean | ||
|
||
# precommit checks (Biome) | ||
echo "Running SDK checks..." | ||
pnpm precommit | ||
|
||
echo "SDK checks completed..." | ||
fi |
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,7 @@ | ||
.DS_Store | ||
cache | ||
node_modules | ||
tsconfig.build.tsbuildinfo | ||
|
||
# compiled output | ||
/lib |
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,5 @@ | ||
# Omni SDK | ||
|
||
## Overview | ||
|
||
The Omni SDK is a TypeScript library for interfacing with the Omni network. |
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,35 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", | ||
"vcs": { | ||
"enabled": false, | ||
"clientKind": "git", | ||
"useIgnoreFile": false | ||
}, | ||
"files": { | ||
"ignoreUnknown": false, | ||
"ignore": ["dist", "tsconfig.json", "tsconfig.*.json"] | ||
}, | ||
"formatter": { | ||
"enabled": true, | ||
"indentStyle": "space", | ||
"formatWithErrors": false, | ||
"indentWidth": 2, | ||
"lineWidth": 80 | ||
}, | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true | ||
} | ||
}, | ||
"javascript": { | ||
"formatter": { | ||
"quoteStyle": "double", | ||
"trailingCommas": "all", | ||
"semicolons": "asNeeded" | ||
} | ||
} | ||
} |
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,22 @@ | ||
{ | ||
"name": "omni-sdk", | ||
"version": "0.0.1", | ||
"type": "module", | ||
"license": "GPL-3.0-only", | ||
"packageManager": "[email protected]", | ||
"sideEffects": false, | ||
"scripts": { | ||
"clean": "rm -rf dist", | ||
"build": "tsc -p tsconfig.build.json", | ||
"build:clean": "pnpm clean && pnpm build", | ||
"precommit": "biome check --write" | ||
}, | ||
"files": ["src/*", "dist/*"], | ||
"engines": { | ||
"node": "22.x" | ||
}, | ||
"devDependencies": { | ||
"@biomejs/biome": "1.9.4", | ||
"typescript": "5.7.2" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 @@ | ||
export * from "./types/index.js" |
Oops, something went wrong.