Skip to content

Commit

Permalink
Merge remote-tracking branch 'template/development' into chore/templa…
Browse files Browse the repository at this point in the history
…te-sync
  • Loading branch information
0x4007 committed Jan 23, 2024
2 parents 0d985b5 + db2e0e0 commit a609ace
Show file tree
Hide file tree
Showing 21 changed files with 2,952 additions and 144 deletions.
1 change: 1 addition & 0 deletions .env.example
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"
20 changes: 19 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@
"plugins": ["@typescript-eslint"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"rules": {
"@typescript-eslint/no-floating-promises": "error"
"ignorePatterns": ["**/*.js"],
"prefer-arrow-callback": ["warn", { "allowNamedFunctions": true }], // Disallow arrow functions as expressions
"func-style": ["warn", "declaration", { "allowArrowFunctions": false }], // Disallow the use of function expressions
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/naming-convention": [
"error",
{ "selector": "typeLike", "format": ["PascalCase"] },
{ "selector": "variableLike", "format": ["camelCase"] },
{ "selector": "memberLike", "modifiers": ["private"], "format": ["camelCase"], "leadingUnderscore": "require" },
{ "selector": "variable", "types": ["boolean"], "format": ["PascalCase"], "prefix": ["is", "should", "has", "can", "did", "will"] },
{ "selector": "variable", "format": ["camelCase", "UPPER_CASE"], "leadingUnderscore": "allow", "trailingUnderscore": "allow" },
{ "selector": "typeParameter", "format": ["PascalCase"], "prefix": ["T"] },
{ "selector": "interface", "format": ["PascalCase"], "custom": { "regex": "^I[A-Z]", "match": false } },
{ "selector": ["function", "variable"], "format": ["camelCase"] },
{ "selector": "variable", "modifiers": ["destructured"], "format": null },
{ "selector": "variable", "format": ["camelCase"], "leadingUnderscore": "allow", "trailingUnderscore": "allow" },
{ "selector": "variable", "types": ["boolean"], "format": ["PascalCase"], "prefix": ["is", "has", "should", "can", "did", "will"] }
]
}
}
6 changes: 6 additions & 0 deletions .github/pull_request_template.md
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
-->
24 changes: 24 additions & 0 deletions .github/workflows/cloudflare-deploy.yml
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 }}
2 changes: 1 addition & 1 deletion .github/workflows/conventional-commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ubiquity/action-conventional-commits@v1.1.2
- uses: ubiquity/action-conventional-commits@master
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ node_modules
.yarn
.pnp.loader.mjs
.DS_Store
static/dist
2 changes: 1 addition & 1 deletion .husky/commit-msg
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"
4 changes: 4 additions & 0 deletions .husky/pre-commit
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
17 changes: 9 additions & 8 deletions .prettierrc
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
}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@

## User Interface

- New (December 2023) use our custom UI [here](https://work.ubq.fi).
- New (December 2023) use our custom UI [here](https://work.ubq.fi).

## For Bounty Hunters

- All available bounties are viewable in the [issues section](https://github.com/ubiquity/devpool/issues).
- You can subscribe to notifications for this repository to automatically see new available bounties.
- You can not assign yourself to the issues inside of this repository. Instead, you must navigate to the linked issue, and write `/start` there in order to take a bounty.
- You can not assign yourself to the issues inside of this repository. Instead, you must navigate to the linked issue, and write `/start` there in order to take a bounty.

## For Partners

You can add your repository automatically by adding our [UbiquiBot](https://github.com/marketplace/ubiquibot) to your public repository.
1. The bot will automatically open up a pull request, requesting to be added.
1. The bot will automatically open up a pull request, requesting to be added.
2. When the pull request is merged your bounties will appear [here](https://github.com/ubiquity/devpool/issues).

## Maintaining This Repository

When maintaining this repository (e.g. when working on [its bounties](https://github.com/ubiquity/devpool-directory-bounties/issues)) please do not enable the `issues` tab on your fork, or else all of our partner issues will have spam from your fork (e.g. "x user mentioned this issue x days ago") on all of the issues of every repository in this directory.
When maintaining this repository (e.g. when working on [its bounties](https://github.com/ubiquity/devpool-directory-bounties/issues)) please do not enable the `issues` tab on your fork, or else all of our partner issues will have spam from your fork (e.g. "x user mentioned this issue x days ago") on all of the issues of every repository in this directory.

<img width="862" alt="image" src="https://github.com/ubiquity/devpool-directory/assets/4975670/c3db8f81-19ac-4aa4-9351-06c9a5fda77f">
33 changes: 33 additions & 0 deletions build/esbuild-build.ts
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);
});
18 changes: 18 additions & 0 deletions build/esbuild-server.ts
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}`);
}
4 changes: 4 additions & 0 deletions build/index.ts
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");
47 changes: 36 additions & 11 deletions package.json
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 added static/fonts/ubiquity-nova-standard.eot
Binary file not shown.
Binary file added static/fonts/ubiquity-nova-standard.ttf
Binary file not shown.
Binary file added static/fonts/ubiquity-nova-standard.woff
Binary file not shown.
13 changes: 13 additions & 0 deletions static/index.html
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>
10 changes: 10 additions & 0 deletions static/main.ts
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);
});
16 changes: 16 additions & 0 deletions static/style.css
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");
}
Loading

0 comments on commit a609ace

Please sign in to comment.