generated from ubiquity/ts-template
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'template/development' into chore/templa…
…te-sync
- Loading branch information
Showing
21 changed files
with
2,952 additions
and
144 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 +1,2 @@ | ||
DEVPOOL_GITHUB_API_TOKEN="MY_DEVPOOL_GITHUB_API_TOKEN" | ||
MY_SECRET="MY_SECRET" |
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,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,24 @@ | ||
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: 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" | ||
# 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
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 |
---|---|---|
|
@@ -7,3 +7,4 @@ node_modules | |
.yarn | ||
.pnp.loader.mjs | ||
.DS_Store | ||
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
yarn commitlint --edit $1 | ||
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,9 +1,10 @@ | ||
{ | ||
"trailingComma": "es5", | ||
"tabWidth": 2, | ||
"semi": true, | ||
"singleQuote": false, | ||
"printWidth": 160, | ||
"htmlWhitespaceSensitivity": "strict", | ||
"plugins": [] | ||
} | ||
"trailingComma": "es5", | ||
"tabWidth": 2, | ||
"semi": true, | ||
"singleQuote": false, | ||
"printWidth": 160, | ||
"htmlWhitespaceSensitivity": "strict", | ||
"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
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 @@ | ||
import esbuild from "esbuild"; | ||
const typescriptEntries = ["static/main.ts"]; | ||
// const cssEntries = ["static/style.css"]; | ||
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/dist", | ||
}; | ||
|
||
esbuild | ||
.build(esBuildContext) | ||
.then(() => { | ||
console.log("\tesbuild complete"); | ||
}) | ||
.catch((err) => { | ||
console.error(err); | ||
process.exit(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,18 @@ | ||
import esbuild from "esbuild"; | ||
import { esBuildContext } from "./esbuild-build"; | ||
|
||
(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}`); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,59 @@ | ||
{ | ||
"name": "ts-template", | ||
"version": "1.0.0", | ||
"description": "Template repository with typescript support", | ||
"main": "index.js", | ||
"description": "Template repository with TypeScript support.", | ||
"main": "build/index.ts", | ||
"author": "Ubiquity DAO", | ||
"license": "MIT", | ||
"engines": { | ||
"node": ">=20.10.0" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"start": "tsx build/esbuild-server.ts", | ||
"build": "tsx build/esbuild-build.ts", | ||
"format": "run-s format:prettier format:lint", | ||
"format:lint": "eslint --fix .", | ||
"format:prettier": "prettier --write .", | ||
"prepare": "husky install" | ||
}, | ||
"keywords": [ | ||
"typescript", | ||
"nodejs", | ||
"dotenv", | ||
"conventional-commits" | ||
"template", | ||
"dao", | ||
"ubiquity", | ||
"open-source" | ||
], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"dotenv": "^16.0.3", | ||
"dotenv": "^16.3.1", | ||
"octokit": "^2.0.14" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/cli": "^17.4.4", | ||
"@commitlint/config-conventional": "^17.4.4", | ||
"@types/node": "^18.14.6", | ||
"@typescript-eslint/eslint-plugin": "^6.13.1", | ||
"@typescript-eslint/parser": "^6.13.1", | ||
"esbuild": "^0.19.8", | ||
"eslint": "^8.43.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-plugin-prettier": "^5.0.1", | ||
"husky": "^8.0.3", | ||
"knip": "^3.3.0", | ||
"lint-staged": "^15.1.0", | ||
"npm-run-all": "^4.1.5", | ||
"prettier": "^2.8.8", | ||
"tsx": "^3.12.3", | ||
"typescript": "^4.9.5" | ||
}, | ||
"engines": { | ||
"node": ">=20.10.0" | ||
"lint-staged": { | ||
"*.ts": [ | ||
"yarn prettier --write", | ||
"eslint --fix" | ||
] | ||
}, | ||
"commitlint": { | ||
"extends": [ | ||
"@commitlint/config-conventional" | ||
] | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,13 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Ubiquity TypeScript Template</title> | ||
<link rel="stylesheet" href="style.css" /> | ||
</head> | ||
<body> | ||
<h1>Ubiquity TypeScript Template</h1> | ||
<script type="module" src="dist/main.js"></script> | ||
</body> | ||
</html> |
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,10 @@ | ||
export async function mainModule() { | ||
console.log(`Hello from mainModule`); | ||
} | ||
mainModule() | ||
.then(() => { | ||
console.log("mainModule loaded"); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); |
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,16 @@ | ||
body { | ||
font-family: "Proxima Nova", "Ubiquity Nova", sans-serif; | ||
background-color: #06061aff; | ||
color: #fff; | ||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABYWlDQ1BrQ0dDb2xvclNwYWNlRGlzcGxheVAzAAAokWNgYFJJLCjIYWFgYMjNKykKcndSiIiMUmB/yMAOhLwMYgwKicnFBY4BAT5AJQwwGhV8u8bACKIv64LMOiU1tUm1XsDXYqbw1YuvRJsw1aMArpTU4mQg/QeIU5MLikoYGBhTgGzl8pICELsDyBYpAjoKyJ4DYqdD2BtA7CQI+whYTUiQM5B9A8hWSM5IBJrB+API1klCEk9HYkPtBQFul8zigpzESoUAYwKuJQOUpFaUgGjn/ILKosz0jBIFR2AopSp45iXr6SgYGRiaMzCAwhyi+nMgOCwZxc4gxJrvMzDY7v////9uhJjXfgaGjUCdXDsRYhoWDAyC3AwMJ3YWJBYlgoWYgZgpLY2B4dNyBgbeSAYG4QtAPdHFacZGYHlGHicGBtZ7//9/VmNgYJ/MwPB3wv//vxf9//93MVDzHQaGA3kAFSFl7jXH0fsAAAA4ZVhJZk1NACoAAAAIAAGHaQAEAAAAAQAAABoAAAAAAAKgAgAEAAAAAQAAABigAwAEAAAAAQAAABgAAAAAwf1XlwAAACNJREFUSA3t0IEAAAAMBKFHm7/UTaQQWnXDgAEDBgwYMGDgAXaJAz4RVVHYAAAAAElFTkSuQmCC"); | ||
} | ||
@font-face { | ||
font-family: "Ubiquity Nova"; | ||
font-style: normal; | ||
font-weight: 400; | ||
src: url(./fonts/ubiquity-nova-standard.eot); | ||
src: | ||
url(./fonts/ubiquity-nova-standard.eot#iefix) format("embedded-opentype"), | ||
url(./fonts/ubiquity-nova-standard.woff) format("woff"), | ||
url(./fonts/ubiquity-nova-standard.ttf) format("truetype"); | ||
} |
Oops, something went wrong.