diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..0e0a957 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,39 @@ +# Set default behaviour, in case users don't have core.autocrlf set. +* text=auto + +# Explicitly declare text files we want to always be normalized and converted +# to native line endings on checkout. + +# Declare files that will always have LF line endings on checkout. +*.c text eol=lf +*.css text eol=lf +*.cpp text eol=lf +.editorconfig text eol=lf +.gitattributes text eol=lf +.gitignore text eol=lf +.gitmodules text eol=lf +*.gyp text eol=lf +*.h text eol=lf +*.hpp text eol=lf +*.html text eol=lf +*.js text eol=lf +*.ts text eol=lf +*.json text eol=lf +LICENSE text eol=lf +*.md text eol=lf +*.puml text eol=lf +*.svg text eol=lf +*.sh text eol=lf +*.sparql text eol=lf +*.ttl text eol=lf +*.yml text eol=lf + +# Declare files that will always have CRLF line endings on checkout. +*.bat text eol=crlf +*.cmd text eol=crlf + +# Denote all files that are truly binary and should not be modified. +*.gif binary +*.jpg binary +*.node binary +*.png binary \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..200f9d6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,27 @@ +name: Default CI Pipeline + +on: + push: + branches: [master] + pull_request: + branches: [master] + workflow_dispatch: +jobs: + setup: + name: Install dependencies and run build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install + run: npm ci + - name: Build + run: npm run build + prettier: + name: Check coding style + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: Nerixyz/actionsx-prettier@v3-adj + with: + args: --check . diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index b9c9160..3953bba 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -2,42 +2,42 @@ name: Deploy static content to Pages on: - # Runs on pushes targeting the default branch - push: - branches: ["gh-pages"] + # Runs on pushes targeting the default branch + push: + branches: ["gh-pages"] - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: - contents: read - pages: write - id-token: write + contents: read + pages: write + id-token: write # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. concurrency: - group: "pages" - cancel-in-progress: false + group: "pages" + cancel-in-progress: false jobs: - # Single deploy job since we're just deploying - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Pages - uses: actions/configure-pages@v5 - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - # Upload entire repository - path: '.' - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 + # Single deploy job since we're just deploying + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + # Upload entire repository + path: "." + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..df955a1 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,5 @@ +package-lock.json +.docusaurus +node_modules +build +.nyc_output \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..8c70045 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,7 @@ +{ + "trailingComma": "es5", + "printWidth": 120, + "singleQuote": false, + "tabWidth": 4, + "endOfLine": "lf" +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8bccc73..6689895 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ Thanks for your interest in this project. General information regarding source code management, builds, coding standards, and more can be found here: -* https://projects.eclipse.org/projects/iot.thingweb/developer +- https://projects.eclipse.org/projects/iot.thingweb/developer ## Legal Requirements @@ -13,22 +13,22 @@ This process helps us in creating great open source software within a safe legal 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: -* Obtain an [Eclipse Foundation account](https://accounts.eclipse.org/) - * Anyone who currently uses Eclipse Bugzilla or Gerrit systems already has one of those - * Newcomers can [create a new account](https://accounts.eclipse.org/user/register?destination=user) -* Add your GiHub username to your Eclipse Foundation account - * ([Log into Eclipse](https://accounts.eclipse.org/)) - * Go to the *Edit Profile* tab - * Fill in the *GitHub ID* under *Social Media Links* and save -* Sign the [Eclipse Contributor Agreement](http://www.eclipse.org/legal/ECA.php) - * ([Log into Eclipse](https://accounts.eclipse.org/)) - * If the *Status* entry *Eclipse Contributor Agreement* has a green checkmark, the ECA is already signed - * If not, go to the *Eclipse Contributor Agreement* tab or follow the corresponding link under *Status* - * Fill out the form and sign it electronically -* Sign-off every commit using the same email address used for your Eclipse account - * Set the Git user email address with `git config user.email ""` - * Add the `-s` flag when you make the commit(s), e.g. `git commit -s -m "feat: add support for magic"` -* Open a [Pull Request](https://github.com/eclipse-thingweb/node-wot/pulls) +- Obtain an [Eclipse Foundation account](https://accounts.eclipse.org/) + - Anyone who currently uses Eclipse Bugzilla or Gerrit systems already has one of those + - Newcomers can [create a new account](https://accounts.eclipse.org/user/register?destination=user) +- Add your GiHub username to your Eclipse Foundation account + - ([Log into Eclipse](https://accounts.eclipse.org/)) + - Go to the _Edit Profile_ tab + - Fill in the _GitHub ID_ under _Social Media Links_ and save +- Sign the [Eclipse Contributor Agreement](http://www.eclipse.org/legal/ECA.php) + - ([Log into Eclipse](https://accounts.eclipse.org/)) + - If the _Status_ entry _Eclipse Contributor Agreement_ has a green checkmark, the ECA is already signed + - If not, go to the _Eclipse Contributor Agreement_ tab or follow the corresponding link under _Status_ + - Fill out the form and sign it electronically +- Sign-off every commit using the same email address used for your Eclipse account + - Set the Git user email address with `git config user.email ""` + - Add the `-s` flag when you make the commit(s), e.g. `git commit -s -m "feat: add support for magic"` +- Open a [Pull Request](https://github.com/eclipse-thingweb/node-wot/pulls) For more information, please see the Eclipse Committer Handbook: https://www.eclipse.org/projects/handbook/#resources-commit @@ -37,6 +37,7 @@ https://www.eclipse.org/projects/handbook/#resources-commit Eclipse Thingweb uses Conventional Changelog, which structure Git commit messages in a way that allows automatic generation of changelogs. Commit messages must be structured as follows: + ``` (): @@ -45,38 +46,41 @@ Commit messages must be structured as follows: