-
Notifications
You must be signed in to change notification settings - Fork 49
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
1 parent
1cff141
commit c43d477
Showing
10 changed files
with
169 additions
and
107 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
.github/workflows/afk-community.yml → .github/workflows/mobile-app.yml
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,4 +1,4 @@ | ||
name: CI | ||
name: Mobile App | ||
|
||
on: | ||
push: | ||
|
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,64 @@ | ||
name: Web App | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "apps/website/**" | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- "apps/website/**" | ||
|
||
jobs: | ||
check-app: | ||
runs-on: ubuntu-latest | ||
|
||
defaults: | ||
run: | ||
working-directory: ./apps/website | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20.x" | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v4 | ||
|
||
- name: Get pnpm store directory | ||
id: pnpm-cache | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
- name: Setup pnpm cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install Dependencies | ||
run: | | ||
if [ -f "apps/website/pnpm-lock.yaml" ]; then | ||
pnpm install --frozen-lockfile | ||
else | ||
pnpm install | ||
fi | ||
- name: Prettier Format Check | ||
run: pnpm prettier:check | ||
|
||
- name: ESLint Check | ||
run: pnpm lint | ||
|
||
- name: TypeScript Check | ||
run: pnpm ts:check |
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
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
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,18 +1,24 @@ | ||
const ErrorCodesArray = [ | ||
'BAD_REQUEST', | ||
'INVALID_EVENT', | ||
'INVALID_EVENT_SIGNATURE', | ||
'INVALID_EVENT_CONTENT', | ||
'INVALID_ADDRESS', | ||
'DEPOSIT_NOT_FOUND', | ||
'INVALID_GAS_AMOUNT', | ||
'TRANSACTION_ERROR', | ||
'ESTIMATION_ERROR', | ||
'NO_ROUTE_FOUND', | ||
] as const; | ||
export const ErrorCodes = { | ||
BAD_REQUEST: 'BAD_REQUEST', | ||
INVALID_EVENT: 'INVALID_EVENT', | ||
INVALID_EVENT_SIGNATURE: 'INVALID_EVENT_SIGNATURE', | ||
INVALID_EVENT_CONTENT: 'INVALID_EVENT_CONTENT', | ||
INVALID_ADDRESS: 'INVALID_ADDRESS', | ||
DEPOSIT_NOT_FOUND: 'DEPOSIT_NOT_FOUND', | ||
INVALID_GAS_AMOUNT: 'INVALID_GAS_AMOUNT', | ||
TRANSACTION_ERROR: 'TRANSACTION_ERROR', | ||
ESTIMATION_ERROR: 'ESTIMATION_ERROR', | ||
NO_ROUTE_FOUND: 'NO_ROUTE_FOUND', | ||
} as const; | ||
|
||
export type ErrorCode = (typeof ErrorCodesArray)[number]; | ||
export type ErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes]; | ||
|
||
export const ErrorCode = Object.fromEntries(ErrorCodesArray.map((code) => [code, code])) as { | ||
[K in ErrorCode]: K; | ||
export const ErrorCode = { | ||
...ErrorCodes, | ||
isErrorCode: (code: string): code is ErrorCode => code in ErrorCodes, | ||
}; | ||
|
||
// Type guard function | ||
export function isErrorCode(code: string): code is ErrorCode { | ||
return code in ErrorCodes; | ||
} |
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,4 @@ | ||
declare module '*.png' { | ||
const content: string; | ||
export default content; | ||
} |
Oops, something went wrong.