Skip to content

Commit 9cd8260

Browse files
authored
Merge pull request #55 from fbsamples/prettier
Prettier
2 parents 9fd622b + a5a1556 commit 9cd8260

17 files changed

+551
-343
lines changed

.prettierignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules/
2+
build/
3+
dist/
4+
*.min.js
5+
postman/threads-api.postman_collection.json
6+
.github/workflows/postman-sync.yaml
7+
.devcontainer/devcontainer.json
8+
package.json

.prettierrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"tabWidth": 4
4+
}

CODE_OF_CONDUCT.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
1414
Examples of behavior that contributes to creating a positive environment
1515
include:
1616

17-
* Using welcoming and inclusive language
18-
* Being respectful of differing viewpoints and experiences
19-
* Gracefully accepting constructive criticism
20-
* Focusing on what is best for the community
21-
* Showing empathy towards other community members
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
2222

2323
Examples of unacceptable behavior by participants include:
2424

25-
* The use of sexualized language or imagery and unwelcome sexual attention or
26-
advances
27-
* Trolling, insulting/derogatory comments, and personal or political attacks
28-
* Public or private harassment
29-
* Publishing others' private information, such as a physical or electronic
30-
address, without explicit permission
31-
* Other conduct which could reasonably be considered inappropriate in a
32-
professional setting
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
3333

3434
## Our Responsibilities
3535

@@ -77,4 +77,4 @@ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.ht
7777
[homepage]: https://www.contributor-covenant.org
7878

7979
For answers to common questions about this code of conduct, see
80-
https://www.contributor-covenant.org/faq
80+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# Contributing to Threads API Sample App
2+
23
We want to make contributing to this project as easy and transparent as
34
possible.
45

56
## Our Development Process
7+
68
... (in particular how this is synced with internal changes to the project)
79

810
## Pull Requests
11+
912
We actively welcome your pull requests.
1013

1114
1. Fork the repo and create your branch from `main`.
@@ -16,12 +19,14 @@ We actively welcome your pull requests.
1619
6. If you haven't already, complete the Contributor License Agreement ("CLA").
1720

1821
## Contributor License Agreement ("CLA")
22+
1923
In order to accept your pull request, we need you to submit a CLA. You only need
2024
to do this once to work on any of Meta's open source projects.
2125

2226
Complete your CLA here: <https://code.facebook.com/cla>
2327

2428
## Issues
29+
2530
We use GitHub issues to track public bugs. Please ensure your description is
2631
clear and has sufficient instructions to be able to reproduce the issue.
2732

@@ -30,5 +35,6 @@ disclosure of security bugs. In those cases, please go through the process
3035
outlined on that page and do not file a public issue.
3136

3237
## License
38+
3339
By contributing to Threads API Sample App, you agree that your contributions will be licensed
34-
under the LICENSE file in the root directory of this source tree.
40+
under the LICENSE file in the root directory of this source tree.

README.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,46 @@ You can use this Sample App to test the [Threads API](https://developers.faceboo
1111

1212
In order to run the Sample App you will need to install some required software, as follows:
1313

14-
- Node JS
14+
- Node JS
1515

1616
## Running the Sample App
1717

1818
Note: If you are using devcontainers, ensure that containers are enabled and supported by your IDE.
1919

2020
1. Install necessary tools
21-
* If you are using a [devcontainer](https://code.visualstudio.com/docs/devcontainers/containers), skip to step 2.
22-
* Install [nodeJS](https://nodejs.org/en/download/) to run the application. If you're using a Mac, you can install it via Homebrew: `brew install node`
23-
* Install [mkcert](https://mkcert.org/) to create the OpenSSL Certificate. If you're using a Mac, you can install it via Homebrew: `brew install mkcert`
21+
22+
- If you are using a [devcontainer](https://code.visualstudio.com/docs/devcontainers/containers), skip to step 2.
23+
- Install [nodeJS](https://nodejs.org/en/download/) to run the application. If you're using a Mac, you can install it via Homebrew: `brew install node`
24+
- Install [mkcert](https://mkcert.org/) to create the OpenSSL Certificate. If you're using a Mac, you can install it via Homebrew: `brew install mkcert`
2425

2526
2. Run `npm install` in your terminal
2627

2728
3. Create a new file called `.env` and copy/paste all the environment variables from `.env.template`. Replace any environnment variables that have placeholders, such as APP_ID.
2829

2930
4. Map a domain to your local machine for local development
30-
* Note: Threads apps do not support redirect URLs with using `localhost` so you must map a domain to test locally this Sample App.
31-
* Map a new entry in your hosts file to the domain that you will use to test the Sample App e.g. `threads-sample.meta`.
32-
* If you're using a Linux or Mac, this will be your `/etc/hosts` file.
33-
* Add an entry like so:
31+
32+
- Note: Threads apps do not support redirect URLs with using `localhost` so you must map a domain to test locally this Sample App.
33+
- Map a new entry in your hosts file to the domain that you will use to test the Sample App e.g. `threads-sample.meta`.
34+
- If you're using a Linux or Mac, this will be your `/etc/hosts` file.
35+
- Add an entry like so:
3436
```
3537
127.0.0.1 threads-sample.meta
3638
```
37-
* This will map threads-sample.meta to localhost, so you may visit https://threads-sample.meta:8000 to see the Threads Sample App.
38-
* This domain must match the one defined in your `.env` file as the value of the `HOST` variable.
39+
- This will map threads-sample.meta to localhost, so you may visit https://threads-sample.meta:8000 to see the Threads Sample App.
40+
- This domain must match the one defined in your `.env` file as the value of the `HOST` variable.
3941
4042
5. Create an OpenSSL Cert
41-
* OAuth redirects are only supported over HTTPS so you must create an SSL certificate
42-
* `mkcert threads-sample.meta` - This will create pem files for SSL.
43-
* You will see `threads-sample.meta.pem` and `threads-sample.meta-key.pem `files generated.
44-
* If you are using a host that is different than `threads-sample.meta` then replace it with your specific domain.
43+
44+
- OAuth redirects are only supported over HTTPS so you must create an SSL certificate
45+
- `mkcert threads-sample.meta` - This will create pem files for SSL.
46+
- You will see `threads-sample.meta.pem` and `threads-sample.meta-key.pem `files generated.
47+
- If you are using a host that is different than `threads-sample.meta` then replace it with your specific domain.
4548
4649
6. Run the Sample App
47-
* Run `npm start` from the command line.
48-
* Once the Sample App starts running, go to https://threads-sample.meta:8000 to test the workflow.
49-
* If you are using a different domain or port then replace those values accordingly.
50+
- Run `npm start` from the command line.
51+
- Once the Sample App starts running, go to https://threads-sample.meta:8000 to test the workflow.
52+
- If you are using a different domain or port then replace those values accordingly.
5053
5154
## License
55+
5256
Threads API is Meta Platform Policy licensed, as found in the LICENSE file.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"main": "index.js",
66
"scripts": {
77
"start": "node ./src/index.js",
8-
"test": "echo \"Error: no test specified\" && exit 1"
8+
"test": "echo \"Error: no test specified\" && exit 1",
9+
"format:check": "prettier --check .",
10+
"format:write": "prettier --write ."
911
},
1012
"author": "",
1113
"license": "ISC",

0 commit comments

Comments
 (0)