Skip to content

Commit a166660

Browse files
authored
Prettier Usage (#141)
* add dependencies and config files * run format * fix prettier version * devops: add basic ci workflow with prettier * chore: run format * chore: rerun npm install * chore: run format * chore: fix prettier to 3.3.3 * fix: correct file extension * add gitattributes file
1 parent 9ced6fc commit a166660

48 files changed

Lines changed: 18525 additions & 17626 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Set default behaviour, in case users don't have core.autocrlf set.
2+
* text=auto
3+
4+
# Explicitly declare text files we want to always be normalized and converted
5+
# to native line endings on checkout.
6+
7+
# Declare files that will always have LF line endings on checkout.
8+
*.c text eol=lf
9+
*.css text eol=lf
10+
*.cpp text eol=lf
11+
.editorconfig text eol=lf
12+
.gitattributes text eol=lf
13+
.gitignore text eol=lf
14+
.gitmodules text eol=lf
15+
*.gyp text eol=lf
16+
*.h text eol=lf
17+
*.hpp text eol=lf
18+
*.html text eol=lf
19+
*.js text eol=lf
20+
*.ts text eol=lf
21+
*.json text eol=lf
22+
LICENSE text eol=lf
23+
*.md text eol=lf
24+
*.puml text eol=lf
25+
*.svg text eol=lf
26+
*.sh text eol=lf
27+
*.sparql text eol=lf
28+
*.ttl text eol=lf
29+
*.yml text eol=lf
30+
31+
# Declare files that will always have CRLF line endings on checkout.
32+
*.bat text eol=crlf
33+
*.cmd text eol=crlf
34+
35+
# Denote all files that are truly binary and should not be modified.
36+
*.gif binary
37+
*.jpg binary
38+
*.node binary
39+
*.png binary

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Default CI Pipeline
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
workflow_dispatch:
9+
jobs:
10+
setup:
11+
name: Install dependencies and run build
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
- name: Install
17+
run: npm ci
18+
- name: Build
19+
run: npm run build
20+
prettier:
21+
name: Check coding style
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: Nerixyz/actionsx-prettier@v3-adj
26+
with:
27+
args: --check .

.github/workflows/static.yml

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,42 @@
22
name: Deploy static content to Pages
33

44
on:
5-
# Runs on pushes targeting the default branch
6-
push:
7-
branches: ["gh-pages"]
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches: ["gh-pages"]
88

9-
# Allows you to run this workflow manually from the Actions tab
10-
workflow_dispatch:
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
1111

1212
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1313
permissions:
14-
contents: read
15-
pages: write
16-
id-token: write
14+
contents: read
15+
pages: write
16+
id-token: write
1717

1818
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
1919
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
2020
concurrency:
21-
group: "pages"
22-
cancel-in-progress: false
21+
group: "pages"
22+
cancel-in-progress: false
2323

2424
jobs:
25-
# Single deploy job since we're just deploying
26-
deploy:
27-
environment:
28-
name: github-pages
29-
url: ${{ steps.deployment.outputs.page_url }}
30-
runs-on: ubuntu-latest
31-
steps:
32-
- name: Checkout
33-
uses: actions/checkout@v4
34-
- name: Setup Pages
35-
uses: actions/configure-pages@v5
36-
- name: Upload artifact
37-
uses: actions/upload-pages-artifact@v3
38-
with:
39-
# Upload entire repository
40-
path: '.'
41-
- name: Deploy to GitHub Pages
42-
id: deployment
43-
uses: actions/deploy-pages@v4
25+
# Single deploy job since we're just deploying
26+
deploy:
27+
environment:
28+
name: github-pages
29+
url: ${{ steps.deployment.outputs.page_url }}
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
- name: Setup Pages
35+
uses: actions/configure-pages@v5
36+
- name: Upload artifact
37+
uses: actions/upload-pages-artifact@v3
38+
with:
39+
# Upload entire repository
40+
path: "."
41+
- name: Deploy to GitHub Pages
42+
id: deployment
43+
uses: actions/deploy-pages@v4

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package-lock.json
2+
.docusaurus
3+
node_modules
4+
build
5+
.nyc_output

.prettierrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"trailingComma": "es5",
3+
"printWidth": 120,
4+
"singleQuote": false,
5+
"tabWidth": 4,
6+
"endOfLine": "lf"
7+
}

CONTRIBUTING.md

Lines changed: 50 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Thanks for your interest in this project. General information
44
regarding source code management, builds, coding standards, and
55
more can be found here:
66

7-
* https://projects.eclipse.org/projects/iot.thingweb/developer
7+
- https://projects.eclipse.org/projects/iot.thingweb/developer
88

99
## Legal Requirements
1010

@@ -13,22 +13,22 @@ This process helps us in creating great open source software within a safe legal
1313

1414
Thus, before your contribution can be accepted by the project team, contributors must electronically sign the [Eclipse Contributor Agreement (ECA)](http://www.eclipse.org/legal/ECA.php) and follow these preliminary steps:
1515

16-
* Obtain an [Eclipse Foundation account](https://accounts.eclipse.org/)
17-
* Anyone who currently uses Eclipse Bugzilla or Gerrit systems already has one of those
18-
* Newcomers can [create a new account](https://accounts.eclipse.org/user/register?destination=user)
19-
* Add your GiHub username to your Eclipse Foundation account
20-
* ([Log into Eclipse](https://accounts.eclipse.org/))
21-
* Go to the *Edit Profile* tab
22-
* Fill in the *GitHub ID* under *Social Media Links* and save
23-
* Sign the [Eclipse Contributor Agreement](http://www.eclipse.org/legal/ECA.php)
24-
* ([Log into Eclipse](https://accounts.eclipse.org/))
25-
* If the *Status* entry *Eclipse Contributor Agreement* has a green checkmark, the ECA is already signed
26-
* If not, go to the *Eclipse Contributor Agreement* tab or follow the corresponding link under *Status*
27-
* Fill out the form and sign it electronically
28-
* Sign-off every commit using the same email address used for your Eclipse account
29-
* Set the Git user email address with `git config user.email "<your Eclipse account email>"`
30-
* Add the `-s` flag when you make the commit(s), e.g. `git commit -s -m "feat: add support for magic"`
31-
* Open a [Pull Request](https://github.com/eclipse-thingweb/node-wot/pulls)
16+
- Obtain an [Eclipse Foundation account](https://accounts.eclipse.org/)
17+
- Anyone who currently uses Eclipse Bugzilla or Gerrit systems already has one of those
18+
- Newcomers can [create a new account](https://accounts.eclipse.org/user/register?destination=user)
19+
- Add your GiHub username to your Eclipse Foundation account
20+
- ([Log into Eclipse](https://accounts.eclipse.org/))
21+
- Go to the _Edit Profile_ tab
22+
- Fill in the _GitHub ID_ under _Social Media Links_ and save
23+
- Sign the [Eclipse Contributor Agreement](http://www.eclipse.org/legal/ECA.php)
24+
- ([Log into Eclipse](https://accounts.eclipse.org/))
25+
- If the _Status_ entry _Eclipse Contributor Agreement_ has a green checkmark, the ECA is already signed
26+
- If not, go to the _Eclipse Contributor Agreement_ tab or follow the corresponding link under _Status_
27+
- Fill out the form and sign it electronically
28+
- Sign-off every commit using the same email address used for your Eclipse account
29+
- Set the Git user email address with `git config user.email "<your Eclipse account email>"`
30+
- Add the `-s` flag when you make the commit(s), e.g. `git commit -s -m "feat: add support for magic"`
31+
- Open a [Pull Request](https://github.com/eclipse-thingweb/node-wot/pulls)
3232

3333
For more information, please see the Eclipse Committer Handbook:
3434
https://www.eclipse.org/projects/handbook/#resources-commit
@@ -37,6 +37,7 @@ https://www.eclipse.org/projects/handbook/#resources-commit
3737

3838
Eclipse Thingweb uses Conventional Changelog, which structure Git commit messages in a way that allows automatic generation of changelogs.
3939
Commit messages must be structured as follows:
40+
4041
```
4142
<type>(<scope>): <subject>
4243
<BLANK LINE>
@@ -45,58 +46,63 @@ Commit messages must be structured as follows:
4546
<footer>
4647
```
4748

48-
* `<type>`: A noun specifying the type of change, followed by a colon and a space. The types allowed are:
49-
* `feat`: A new feature
50-
* `fix`: A bug fix
51-
* `refactor`: Code change that neither fixes a bug or adds a feature (not relevant for end user)
52-
* `perf`: Change improves performance
53-
* `style`: Change does not affect the code (e.g., formatting, whitespaces)
54-
* `test`: Adding missing tests
55-
* `chore`: Change of build process or auxiliary tools
56-
* `docs`: Documentation only changes
57-
* `<scope>`: Optional. A term of free choice specifying the place of the commit change, enclosed in parentheses. Examples:
58-
* `feat(binding-coap): ...`
59-
* `fix(cli): ...`
60-
* `docs: ...` (no scope, as it is optional)
61-
* `<subject>`: A succinct description of the change, e.g., `add support for magic`
62-
* Use the imperative, present tense: "add", not "added" nor "adds"
63-
* Do not capitalize first letter: "add", not "Add"
64-
* No dot (.) at the end
65-
* `<body>`: Optional. Can include the motivation for the change and contrast this with previous behavior.
66-
* Just as in the subject, use the imperative, present tense: "change" not "changed" nor "changes"
67-
* `<footer>`: Optional. Can be used to automatically close GitHub Issues and to document breaking changes.
68-
* The prefix `BREAKING CHANGE: ` idicates API breakage (corresponding to a major version change) and everything after is a description what changed and what needs to be done to migrate
69-
* GitHub Issue controls such as `Fixes #123` or `Closes #4711` must come before a potential `BREAKING CHANGE: `.
49+
- `<type>`: A noun specifying the type of change, followed by a colon and a space. The types allowed are:
50+
- `feat`: A new feature
51+
- `fix`: A bug fix
52+
- `refactor`: Code change that neither fixes a bug or adds a feature (not relevant for end user)
53+
- `perf`: Change improves performance
54+
- `style`: Change does not affect the code (e.g., formatting, whitespaces)
55+
- `test`: Adding missing tests
56+
- `chore`: Change of build process or auxiliary tools
57+
- `docs`: Documentation only changes
58+
- `<scope>`: Optional. A term of free choice specifying the place of the commit change, enclosed in parentheses. Examples:
59+
- `feat(binding-coap): ...`
60+
- `fix(cli): ...`
61+
- `docs: ...` (no scope, as it is optional)
62+
- `<subject>`: A succinct description of the change, e.g., `add support for magic`
63+
- Use the imperative, present tense: "add", not "added" nor "adds"
64+
- Do not capitalize first letter: "add", not "Add"
65+
- No dot (.) at the end
66+
- `<body>`: Optional. Can include the motivation for the change and contrast this with previous behavior.
67+
- Just as in the subject, use the imperative, present tense: "change" not "changed" nor "changes"
68+
- `<footer>`: Optional. Can be used to automatically close GitHub Issues and to document breaking changes.
69+
- The prefix `BREAKING CHANGE: ` idicates API breakage (corresponding to a major version change) and everything after is a description what changed and what needs to be done to migrate
70+
- GitHub Issue controls such as `Fixes #123` or `Closes #4711` must come before a potential `BREAKING CHANGE: `.
7071

7172
Examples:
73+
7274
```
7375
docs: improve how to contribute
7476
```
77+
7578
```
7679
feat(core): add support for magic
7780
7881
Closes #110
7982
```
83+
8084
```
8185
feat(core): add support for magic
8286
8387
Simplify the API by reducing the number of functions.
8488
8589
Closes #110
8690
BREAKING CHANGE: Change all calls to the API to the new `do()` function.
87-
```
91+
```
8892

8993
## Pull Requests and Feature Branches
9094

91-
* Do not merge with master while developing a new feature or providing a fix in a new branch
92-
* Do a rebase if updates in the master such as a fix are required:
95+
- Do not merge with master while developing a new feature or providing a fix in a new branch
96+
- Do a rebase if updates in the master such as a fix are required:
97+
9398
```
9499
git checkout master && git pull && git checkout - && git rebase master
95100
```
96-
* Pull Requests are merged using rebase
101+
102+
- Pull Requests are merged using rebase
97103

98104
## Contact
99105

100106
Contact the project developers via the project's "dev" list.
101107

102-
* https://dev.eclipse.org/mailman/listinfo/thingweb-dev
108+
- https://dev.eclipse.org/mailman/listinfo/thingweb-dev

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
44

55
## Adopters
6+
67
If you are using any Eclipse Thingweb component within your organization, please support us by adding your logo to the [Eclipse IoT adopters list](https://iot.eclipse.org/adopters/#iot.thingweb). To do so, simply open an issue at [the Eclipse Gitlab](https://gitlab.eclipse.org/eclipsefdn/it/api/eclipsefdn-project-adopters/-/issues/new?issuable_template=adopter_request) by providing the name of your organization, its logo, and a link to your organization or team. You should be affiliated with that organization for the issue to be implemented.

SECURITY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ another country, of encryption software. BEFORE using any encryption software,
4141
please check the country's laws, regulations and policies concerning the import,
4242
possession, or use, and re-export of encryption software, to see if this is
4343
permitted.
44+
4445
<!--- https://www.eclipse.org/security/ --->
4546

4647
_ISO 27005 defines vulnerability as:

babel.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3-
};
2+
presets: [require.resolve("@docusaurus/core/lib/babel/preset")],
3+
};

docs/introduction.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
sidebar_position: 1
33
---
4+
45
# Introduction
56

67
:::info
78

89
For the moment the documentation page is still under construction. For more information about Thingweb and node-wot refer to this [`repository`](https://github.com/eclipse-thingweb/node-wot).
910

10-
:::
11+
:::

0 commit comments

Comments
 (0)