Skip to content

Commit 9bacc9c

Browse files
Feature/Add Contributing.md and Humans.txt (#38)
* Add CONTRIBUTING.md * Update README.md * Add humans.txt * Update README.md
1 parent eb99af1 commit 9bacc9c

File tree

5 files changed

+155
-42
lines changed

5 files changed

+155
-42
lines changed

README.md

Lines changed: 18 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,57 +2,33 @@
22

33
https://getcryptoaddress.github.io/
44

5-
6-
75
https://github.com/user-attachments/assets/6f1da5d9-89b0-4f50-a6e5-951d7f7ff3c9
86

7+
## Description
98

9+
Get Crypto Address is an open-source tool that allows you to generate
10+
cryptocurrency addresses and create paper wallets. It's free, offline, and
11+
open-source.
1012

11-
## Project Setup
12-
13-
```sh
14-
npm install
15-
```
16-
17-
### Compile and Hot-Reload for Development
18-
19-
```sh
20-
npm run dev
21-
```
22-
23-
### Type-Check, Compile and Minify for Production
24-
25-
```sh
26-
npm run build
27-
```
13+
### What Sets Us Apart?
2814

29-
### Run Unit Tests with [Vitest](https://vitest.dev/)
15+
1. **Supports Bitcoin Address Formats**:
16+
- P2PKH
17+
- P2WPKH
18+
- Taproot
3019

31-
```sh
32-
npm run test:unit
33-
```
20+
2. **Ethereum Support**:
21+
- Generate Ethereum addresses and private keys.
3422

35-
### Run End-to-End Tests with [Playwright](https://playwright.dev)
23+
3. **Custom Paper Wallet Designs**:
24+
- Create a unique, personalized design for your paper wallet.
3625

37-
```sh
38-
# Install browsers for the first run
39-
npx playwright install
26+
---
4027

41-
# When testing on CI, must build the project first
42-
npm run build
28+
## Contributing
4329

44-
# Runs the end-to-end tests
45-
npm run test:e2e
46-
# Runs the tests only on Chromium
47-
npm run test:e2e -- --project=chromium
48-
# Runs the tests of a specific file
49-
npm run test:e2e -- tests/example.spec.ts
50-
# Runs the tests in debug mode
51-
npm run test:e2e -- --debug
52-
```
30+
We welcome feedback, contributions, and suggestions to help us improve and
31+
expand Get Crypto Address. Your support and ideas are greatly appreciated!
5332

54-
### Lint with [ESLint](https://eslint.org/)
33+
- [CONTRIBUTING.md](docs/CONTRIBUTING.md)
5534

56-
```sh
57-
npm run lint
58-
```

docs/CONTRIBUTING.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Contributing to Get Crypto Address
2+
3+
Thank you for considering contributing to Get Crypto Address!
4+
We appreciate your interest in helping us improve the project.
5+
This guide provides instructions and best practices to make contributing as
6+
smooth as possible.
7+
8+
## 1. Setting Up the Local Development Environment for Pull Requests
9+
10+
To get started with contributing, you'll need to set up the project on your
11+
local machine. Please follow these steps:
12+
13+
1. **Clone the repository**:
14+
Clone the repository to your local machine using SSH or HTTPS:
15+
```shell
16+
git clone [email protected]:getCryptoAddress/getCryptoAddress.github.io.git
17+
# or:
18+
# git clone https://github.com/getCryptoAddress/getCryptoAddress.github.io.git
19+
20+
cd getCryptoAddress.github.io
21+
```
22+
2. **Install [Node.js](https://nodejs.org/)**:
23+
Ensure that you have [Node.js](https://nodejs.org/) installed.
24+
The required version can be found in the `engine.node` field in the
25+
[package.json](../package.json) file.
26+
3. **Install project dependencies**:
27+
Once Node.js is set up, install the project dependencies using npm:
28+
```shell
29+
npm install
30+
```
31+
4. **Run the project locally**:
32+
Start the local development server to ensure everything works as expected.
33+
```shell
34+
npm run dev
35+
```
36+
5. **Make your changes**:
37+
Make the necessary changes to the project and test them locally.
38+
6. **Test your changes**:
39+
Run the unit tests to ensure that your changes don't break existing
40+
functionality.
41+
```shell
42+
npm run test:unit
43+
```
44+
Run the end-to-end tests via [Playwright](https://playwright.dev)
45+
to ensure that your changes don't break the user
46+
interface.
47+
```shell
48+
# Install browsers for the first run
49+
npx playwright install
50+
51+
# Runs the end-to-end tests
52+
npm run test:e2e
53+
# Runs the tests only on Chromium
54+
npm run test:e2e -- --project=chromium
55+
# Runs the tests of a specific file
56+
npm run test:e2e -- tests/example.spec.ts
57+
# Runs the tests in debug mode
58+
npm run test:e2e -- --debug
59+
```
60+
Build the project for production to ensure that your changes don't introduce
61+
any issues.
62+
```shell
63+
npm run build;
64+
npm run prerender;
65+
PLAYWRIGHT_USE_BUILD=1 npm run test:e2e;
66+
```
67+
68+
7. **Commit your changes**:
69+
Once you're satisfied with your changes, commit them to your fork.
70+
Don't forget about [Eslint](https://eslint.org/)
71+
and [Prettier](https://prettier.io/).
72+
You can run them with:
73+
```shell
74+
npm run lint;
75+
npm run format;
76+
```
77+

node/humans/addSection.mjs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const newLine = "\n";
2+
const newParagraph = "\n\n";
3+
4+
/**
5+
* Add spaces to the beginning of a string
6+
* @param {string} str
7+
* @returns {string}
8+
*/
9+
function addSpaces(str) {
10+
return " ".repeat(2) + str.trim();
11+
}
12+
13+
/**
14+
* Add a section to the humans.txt file
15+
* @example
16+
* ```js
17+
* addSection("Site", [
18+
* ["Site: Get Crypto Address", "URL: https://getcryptoaddress.github.io"],
19+
* ]),
20+
* ```
21+
* @param {string} title
22+
* @param {string[][]} content
23+
*/
24+
export function addSection(title, content) {
25+
return (
26+
`/* ${title} */` +
27+
newLine +
28+
content
29+
.filter(Boolean)
30+
.map((contentLine) =>
31+
contentLine.filter(Boolean).map(addSpaces).join(newLine),
32+
)
33+
.join(newParagraph)
34+
);
35+
}

node/humans/generateHumans.mjs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import fs from "node:fs";
2+
import path from "node:path";
3+
import { addSection } from "./addSection.mjs";
4+
5+
export default async function generateHumans(pageFolder) {
6+
const content = [
7+
addSection("TEAM", [
8+
[
9+
"Developer: Get Crypto Address",
10+
"Site: https://getcryptoaddress.github.io",
11+
"GitHub: https://github.com/getCryptoAddress/",
12+
],
13+
]),
14+
addSection("SITE", [
15+
[
16+
`Last build: ${new Date().toUTCString()}`,
17+
"Programming languages: JavaScript, TypeScript",
18+
"Technologies: Vite, Vue, Playwright, Vitest",
19+
],
20+
]),
21+
].join("\n\n");
22+
fs.writeFileSync(path.join(pageFolder, "humans.txt"), content, "utf8");
23+
}

prerender.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import path from "node:path";
33
import { createServer } from "vite";
44
import { addInlineStylesHashesToHtml } from "./node/csp/addInlineStylesHashesToHtml.mjs";
55
import { getInlineStylesHashes } from "./node/csp/getInlineStylesHashes.mjs";
6+
import generateHumans from "./node/humans/generateHumans.mjs";
67
import generateSitemap from "./node/sitemap/generateSitemap.mjs";
78

89
// todo refactor file, separate into functions
@@ -19,6 +20,7 @@ const { render, routes } = await vite.ssrLoadModule("/src/entry-server.ts");
1920
const routerPaths = routes.map((route) => route.path);
2021

2122
generateSitemap(routerPaths, "https://getcryptoaddress.github.io", "dist");
23+
generateHumans("dist");
2224

2325
for (const routerPath of routerPaths) {
2426
const { appHtml, ctx } = await render(routerPath);

0 commit comments

Comments
 (0)