Skip to content

Commit 13267d9

Browse files
committed
format: use prettier
1 parent e03da99 commit 13267d9

29 files changed

+6403
-689
lines changed

.github/workflows/deploy.yml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121

2222
- name: "Test"
2323
run: |
24+
yarn prettier -c .
2425
yarn tsc --noEmit
2526
yarn test
2627

.github/workflows/pr.yml

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333

3434
- name: "Test"
3535
run: |
36+
yarn prettier -c .
3637
yarn tsc --noEmit
3738
yarn test
3839

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
worker-configuration.d.ts

README.md

+20-13
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
# Pastebin-worker
22

3-
This is a pastebin that can be deployed on Cloudflare workers. Try it on [shz.al](https://shz.al).
3+
This is a pastebin that can be deployed on Cloudflare workers. Try it on [shz.al](https://shz.al).
44

5-
**Philosophy**: effortless deployment, friendly CLI usage, rich functionality.
5+
**Philosophy**: effortless deployment, friendly CLI usage, rich functionality.
66

77
**Features**:
88

99
1. Share your paste with as short as 4 characters
1010
2. Customize the paste URL
11-
4. **Update** and **delete** your paste as you want
12-
5. **Expire** your paste after a period of time
13-
6. **Syntax highlighting** powered by PrismJS
14-
7. Display **markdown** file as HTML
15-
8. Used as a URL shortener
16-
9. Customize returned mimetype
11+
3. **Update** and **delete** your paste as you want
12+
4. **Expire** your paste after a period of time
13+
5. **Syntax highlighting** powered by PrismJS
14+
6. Display **markdown** file as HTML
15+
7. Used as a URL shortener
16+
8. Customize returned mimetype
1717

1818
## Usage
1919

20-
1. You can post, update, delete your paste directly on the website (such as [shz.al](https://shz.al)).
20+
1. You can post, update, delete your paste directly on the website (such as [shz.al](https://shz.al)).
2121

22-
2. It also provides a convenient HTTP API to use. See [API reference](doc/api.md) for details. You can easily call API via command line (using `curl` or similar tools).
22+
2. It also provides a convenient HTTP API to use. See [API reference](doc/api.md) for details. You can easily call API via command line (using `curl` or similar tools).
2323

2424
3. [pb](/scripts) is a bash script to make it easier to use on command line.
2525

2626
## Limitations
2727

28-
1. If deployed on Cloudflare Worker free-tier plan, the service allows at most 100,000 reads and 1000 writes, 1000 deletes per day.
29-
2. Due to the size limit of Cloudflare KV storage, the size of each paste is bounded under 25 MB.
28+
1. If deployed on Cloudflare Worker free-tier plan, the service allows at most 100,000 reads and 1000 writes, 1000 deletes per day.
29+
2. Due to the size limit of Cloudflare KV storage, the size of each paste is bounded under 25 MB.
3030

3131
## Deploy
3232

33-
You are free to deploy the pastebin on your own domain if you host your domain on Cloudflare.
33+
You are free to deploy the pastebin on your own domain if you host your domain on Cloudflare.
3434

3535
1. Install `node` and `yarn`.
3636

@@ -82,34 +82,41 @@ $ curl -u admin1:this-is-passwd-1 -Fc=@/path/to/file example-pb.com
8282
```
8383

8484
## Administration
85+
8586
Delete a paste:
87+
8688
```console
8789
$ yarn delete-paste <name-of-paste>
8890
```
8991

9092
List pastes:
93+
9194
```console
9295
$ yarn -s wrangler kv:key list --binding PB > kv_list.json
9396
```
9497

9598
## Development
9699

97100
Run a local simulator:
101+
98102
```console
99103
$ yarn dev
100104
```
101105

102106
Run tests:
107+
103108
```console
104109
$ yarn test
105110
```
106111

107112
Run typing check:
113+
108114
```console
109115
$ yarn tsc --noEmit
110116
```
111117

112118
Run tests with coverage report:
119+
113120
```console
114121
$ yarn coverage
115122
```

doc/api.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Usage example:
8080

8181
```md
8282
# Header 1
83+
8384
This is the content of `test.md`
8485

8586
<script>
@@ -89,14 +90,14 @@ alert("Script should be removed")
8990
## Header 2
9091

9192
| abc | defghi |
92-
:-: | -----------:
93-
bar | baz
93+
| :-: | -----: |
94+
| bar | baz |
9495

95-
**Bold**, `Monospace`, *Italics*, ~~Strikethrough~~, [URL](https://github.com)
96+
**Bold**, `Monospace`, _Italics_, ~~Strikethrough~~, [URL](https://github.com)
9697

9798
- A
98-
- A1
99-
- A2
99+
- A1
100+
- A2
100101
- B
101102

102103
![Panty](https://shz.al/~panty.jpg)
@@ -109,7 +110,6 @@ bar | baz
109110
$$
110111
\int_{-\infty}^{\infty} e^{-x^2} = \sqrt{\pi}
111112
$$
112-
113113
```
114114

115115
```shell
@@ -136,10 +136,10 @@ Upload your paste. It accept parameters in form-data:
136136

137137
```json
138138
{
139-
"url": "https://shz.al/abcd",
140-
"manageUrl": "https://shz.al/abcd:w2eHqyZGc@CQzWLN=BiJiQxZ",
141-
"expirationSeconds": 1209600,
142-
"expireAt": "2025-05-05T10:33:06.114Z"
139+
"url": "https://shz.al/abcd",
140+
"manageUrl": "https://shz.al/abcd:w2eHqyZGc@CQzWLN=BiJiQxZ",
141+
"expirationSeconds": 1209600,
142+
"expireAt": "2025-05-05T10:33:06.114Z"
143143
}
144144
```
145145

0 commit comments

Comments
 (0)