forked from ubiquity/pay.ubq.fi
-
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.
Merge branch 'ubiquity:development' into improve-page-load
- Loading branch information
Showing
60 changed files
with
5,563 additions
and
1,420 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,3 +1,40 @@ | ||
{ | ||
"words": ["WXDAI"] | ||
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json", | ||
"version": "0.2", | ||
"ignorePaths": ["**/*.json", "**/*.css", "node_modules", "**/*.log"], | ||
"useGitignore": true, | ||
"language": "en", | ||
"words": [ | ||
"binkey", | ||
"binsec", | ||
"cirip", | ||
"dataurl", | ||
"devpool", | ||
"ethersproject", | ||
"fract", | ||
"gnosisscan", | ||
"godb", | ||
"greyscale", | ||
"IERC", | ||
"keccak", | ||
"keypair", | ||
"libsodium", | ||
"Numberish", | ||
"outdir", | ||
"Rpcs", | ||
"scalarmult", | ||
"servedir", | ||
"sonarjs", | ||
"typebox", | ||
"TYPEHASH", | ||
"ubiquibot", | ||
"UBIQUIBOT", | ||
"URLSAFE", | ||
"WXDAI", | ||
"XDAI", | ||
"xmark" | ||
], | ||
"dictionaries": ["typescript", "node", "software-terms", "html"], | ||
"import": ["@cspell/dict-typescript/cspell-ext.json", "@cspell/dict-node/cspell-ext.json", "@cspell/dict-software-terms"], | ||
"ignoreRegExpList": ["[0-9a-fA-F]{6}"] | ||
} |
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,108 @@ | ||
{ | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"project": ["./tsconfig.json"] | ||
}, | ||
"plugins": ["@typescript-eslint", "sonarjs"], | ||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:sonarjs/recommended"], | ||
"ignorePatterns": ["**/*.js"], | ||
"rules": { | ||
"prefer-arrow-callback": [ | ||
"warn", | ||
{ | ||
"allowNamedFunctions": true | ||
} | ||
], | ||
"func-style": [ | ||
"warn", | ||
"declaration", | ||
{ | ||
"allowArrowFunctions": false | ||
} | ||
], | ||
"@typescript-eslint/no-floating-promises": "error", | ||
"@typescript-eslint/no-non-null-assertion": "error", | ||
"constructor-super": "error", | ||
"no-invalid-this": "off", | ||
"@typescript-eslint/no-invalid-this": ["error"], | ||
"no-restricted-syntax": ["error", "ForInStatement"], | ||
"use-isnan": "error", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ | ||
"args": "after-used", | ||
"ignoreRestSiblings": true, | ||
"vars": "all", | ||
"varsIgnorePattern": "^_", | ||
"argsIgnorePattern": "^_" | ||
} | ||
], | ||
"@typescript-eslint/await-thenable": "error", | ||
"@typescript-eslint/no-misused-new": "error", | ||
"@typescript-eslint/restrict-plus-operands": "error", | ||
"sonarjs/no-all-duplicated-branches": "error", | ||
"sonarjs/no-collection-size-mischeck": "error", | ||
"sonarjs/no-duplicated-branches": "error", | ||
"sonarjs/no-element-overwrite": "error", | ||
"sonarjs/no-identical-conditions": "error", | ||
"sonarjs/no-identical-expressions": "error", | ||
"@typescript-eslint/naming-convention": [ | ||
"error", | ||
{ | ||
"selector": "interface", | ||
"format": ["PascalCase"], | ||
"custom": { | ||
"regex": "^I[A-Z]", | ||
"match": false | ||
} | ||
}, | ||
{ | ||
"selector": "memberLike", | ||
"modifiers": ["private"], | ||
"format": ["camelCase"], | ||
"leadingUnderscore": "require" | ||
}, | ||
{ | ||
"selector": "typeLike", | ||
"format": ["PascalCase"] | ||
}, | ||
{ | ||
"selector": "typeParameter", | ||
"format": ["PascalCase"], | ||
"prefix": ["T"] | ||
}, | ||
{ | ||
"selector": "variable", | ||
"format": ["camelCase", "UPPER_CASE"], | ||
"leadingUnderscore": "allow", | ||
"trailingUnderscore": "allow" | ||
}, | ||
{ | ||
"selector": "variable", | ||
"format": ["camelCase"], | ||
"leadingUnderscore": "allow", | ||
"trailingUnderscore": "allow" | ||
}, | ||
{ | ||
"selector": "variable", | ||
"modifiers": ["destructured"], | ||
"format": null | ||
}, | ||
{ | ||
"selector": "variable", | ||
"types": ["boolean"], | ||
"format": ["PascalCase"], | ||
"prefix": ["is", "should", "has", "can", "did", "will", "does"] | ||
}, | ||
{ | ||
"selector": "variableLike", | ||
"format": ["camelCase"] | ||
}, | ||
{ | ||
"selector": ["function", "variable"], | ||
"format": ["camelCase"] | ||
} | ||
] | ||
} | ||
} |
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 @@ | ||
Resolves # | ||
|
||
<!-- | ||
- You must link the issue number e.g. "Resolves #1234" | ||
- Please do not replace the keyword "Resolves" https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword | ||
--> |
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,31 @@ | ||
name: Deploy to Cloudflare Pages | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
deploy-to-cloudflare: | ||
name: Deploy to Cloudflare Pages | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Check Cloudflare API Token | ||
run: | | ||
if [[ -z "${{ secrets.CLOUDFLARE_API_TOKEN }}" ]]; then | ||
echo "CLOUDFLARE_API_TOKEN secret must be set" >&2 | ||
exit 1 | ||
fi | ||
- name: Deploy to Cloudflare | ||
uses: ubiquity/cloudflare-deploy-action@main | ||
with: | ||
cloudflare_api_token: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
repository: ${{ github.repository }} | ||
production_branch: ${{ github.event.repository.default_branch }} | ||
output_directory: "static" | ||
is_production: ${{ github.event_name == 'push' && github.ref == 'refs/heads/${{ github.event.repository.default_branch }}' }} | ||
# env: | ||
# Add any environment variables you need to pass along here | ||
# SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | ||
# SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }} |
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 @@ | ||
name: Conventional Commits | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
conventional-commits: | ||
name: Conventional Commits | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ubiquity/action-conventional-commits@master |
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,24 @@ | ||
name: Spell Check | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
spellcheck: | ||
name: Check for spelling errors | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20.10.0" | ||
|
||
- name: Install cspell | ||
run: yarn add cspell | ||
|
||
- name: Run cspell | ||
run: yarn format:cspell |
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 |
---|---|---|
|
@@ -5,3 +5,9 @@ out | |
.yarn | ||
.DS_Store | ||
commit.txt | ||
# macOS | ||
# node | ||
# yarn2 | ||
.pnp.cjs | ||
.pnp.loader.mjs | ||
static/dist |
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 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
yarn commitlint --edit "$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,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
yarn 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 |
---|---|---|
@@ -1,12 +1,10 @@ | ||
{ | ||
"useTabs": false, | ||
"trailingComma": "es5", | ||
"tabWidth": 2, | ||
"semi": true, | ||
"trailingComma": "all", | ||
"bracketSpacing": true, | ||
"arrowParens": "avoid", | ||
"singleQuote": false, | ||
"printWidth": 160, | ||
"proseWrap": "preserve", | ||
"tabWidth": 2, | ||
"htmlWhitespaceSensitivity": "strict", | ||
"singleQuote": false | ||
"plugins": [], | ||
"useTabs": 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 |
---|---|---|
@@ -1,3 +1,35 @@ | ||
import esbuild from "esbuild"; | ||
import { esBuildContext } from "./esbuild-config"; | ||
esbuild.build(esBuildContext); | ||
const typescriptEntries = [ | ||
"static/scripts/rewards/index.ts", | ||
"static/scripts/audit-report/audit.ts", | ||
"static/scripts/onboarding/onboarding.ts", | ||
"static/scripts/key-generator/keygen.ts", | ||
]; | ||
const cssEntries = ["static/styles/rewards/rewards.css", "static/styles/audit-report/audit.css", "static/styles/onboarding/onboarding.css"]; | ||
export const entries = [...typescriptEntries, ...cssEntries]; | ||
|
||
export const esBuildContext: esbuild.BuildOptions = { | ||
sourcemap: true, | ||
entryPoints: entries, | ||
bundle: true, | ||
minify: false, | ||
loader: { | ||
".png": "dataurl", | ||
".woff": "dataurl", | ||
".woff2": "dataurl", | ||
".eot": "dataurl", | ||
".ttf": "dataurl", | ||
".svg": "dataurl", | ||
}, | ||
outdir: "static/out", | ||
}; | ||
|
||
esbuild | ||
.build(esBuildContext) | ||
.then(() => { | ||
console.log("\tesbuild complete"); | ||
}) | ||
.catch((err) => { | ||
console.error(err); | ||
process.exit(1); | ||
}); |
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 |
---|---|---|
@@ -1,11 +1,18 @@ | ||
import esbuild from "esbuild"; | ||
import { esBuildContext } from "./esbuild-config"; | ||
import { esBuildContext } from "./esbuild-build"; | ||
|
||
async function server() { | ||
const ctx = await esbuild.context(esBuildContext); | ||
const { host, port } = await ctx.serve({ | ||
(async () => { | ||
await server(); | ||
})().catch((error) => { | ||
console.error("Unhandled error:", error); | ||
process.exit(1); | ||
}); | ||
|
||
export async function server() { | ||
const _context = await esbuild.context(esBuildContext); | ||
const { port } = await _context.serve({ | ||
servedir: "static", | ||
port: 8080, | ||
}); | ||
console.log(`http://localhost:${port}`); | ||
} | ||
server(); |
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 @@ | ||
import * as dotenv from "dotenv"; | ||
// load environment variables (if you have them) | ||
dotenv.config(); | ||
console.log("Welcome to ts-template"); |
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
Oops, something went wrong.