diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..64b5838 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: +- package-ecosystem: npm + directory: "/" + schedule: + interval: monthly + time: "17:00" + timezone: Europe/London \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e3d2a86 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [24.x] # [18.x, 20.x, 21.x, 26.x] + # Node.js release schedule: nodejs.org/en/about/releases/ + + - uses: actions/checkout@v7 # github.com/actions/checkout + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v7 # github.com/actions/setup-node + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm test + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v7 # github.com/codecov/codecov-action + with: + token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/fix-typos.yml b/.github/workflows/fix-typos.yml new file mode 100644 index 0000000..ad1ae7d --- /dev/null +++ b/.github/workflows/fix-typos.yml @@ -0,0 +1,20 @@ +# Temporarily Commenting Out +# name: Automatically fix typos +# on: +# push: +# branches: +# - main + +# jobs: +# build: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v3 +# with: +# ref: main +# - uses: sobolevn/misspell-fixer-action@master +# - uses: peter-evans/create-pull-request@v4.2.0 +# env: +# ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' +# with: +# token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index e40f3b3..21d921b 100644 --- a/.gitignore +++ b/.gitignore @@ -14,12 +14,6 @@ lib-cov # Coverage directory used by tools like istanbul coverage -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# node-waf configuration -.lock-wscript - # Compiled binary addons (https://nodejs.org/api/addons.html) build/Release diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 95da228..0000000 --- a/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: node_js -node_js: - - "node" -env: - global: - - DATABASE_URL=postgres://postgres:@localhost/codeface - - NODE_ENV=TEST -services: - - postgresql -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/FAQ.md b/FAQ.md index 1ce202a..a56c776 100644 --- a/FAQ.md +++ b/FAQ.md @@ -1,69 +1,75 @@ -## Why PostgreSQL and _Not_ MySQL? +# _Why_ `Postgres` and _Not_ `MySQL`? -The _good_ news is that almost all of your PostgreSQL knowledge +The _good_ news is that almost all of your `PostgreSQL` knowledge is _directly_ transferable to [MySQL](https://en.wikipedia.org/wiki/MySQL). -Since _both_ use SQL as the language +Since _both_ use `SQL` as the language for interacting with the database, -the time you invest in learning PostgreSQL -and building SQL skills is a hugely valuable. +the time you invest in learning `Postgres` +and building `SQL` skills is a hugely valuable. Learning how to _run_ means you also know how to _walk_. -PostgreSQL might _feel_ "more difficult" +`Postgres` might _feel_ "more difficult" in the same way that , but the principals are all the same. -Just stick with it and keep asking questions until it all "makes sense". -If you need to _apply_ your SQL skills to MySQL, MS SQL or MariaDB, -it will only take you a few minutes to adapt to it. +Just stick with it +and **keep asking questions** until it all makes sense. +If you need to _apply_ your `SQL` skills to `MySQL`, +`MS SQL` or `MariaDB`, +it will only take you a few minutes to adapt to it +(with some Googling). It's very much like riding a bicycle. Once you know how to balance, pedal and steer, your skills transfer to other bicycles. - -The _reason_ MySQL is still _hugely_ popular +The _reason_ `MySQL` is still _hugely_ popular can be summarised by _one_ word: -[***WordPress***](https://en.wikipedia.org/wiki/WordPress). +[***`WordPress`***](https://en.wikipedia.org/wiki/WordPress). -Over **30%** of the 10 million most popular websites use WordPress. -WordPress runs on the "LAMP" (_Linux Apache **MySQL** PHP_) stack, -which means that people are using MySQL by _`default`_ +Over **30%** of the 10 million most popular websites use `WordPress`. +WordPress runs on the "LAMP" (_`Linux` `Apache` **`MySQL`** `PHP`_) stack, +which means that people are using `MySQL` by _`default`_ not _conscious enlightenment_. + https://www.whoishostingthis.com/compare/wordpress/stats + https://w3techs.com/technologies/overview/content_management/all -## Why _Not_ Use WordPress? +## Why _Not_ Use `WordPress`? -WordPress is _unquestionably_ a good CMS and blogging platform +`WordPress` is _unquestionably_ a good +[CMS](https://en.wikipedia.org/wiki/Content_management_system) +and blogging platform that helps millions of people/businesses publish online. -Sadly, it's not secure by _default_ and when a vulnerability is discovered, +Sadly, it's **not secure by _default_** +and when a vulnerability is discovered, it gets exploited en-mass very quickly. -Yes, WordPress can be +Yes, `WordPress` can be ["Hardened"](https://codex.wordpress.org/Hardening_WordPress) but that is _usually_ not the _first_ thing on people's todo list when launching a website or blog. -The result is that _thousands_ of WordPress websites get hacked +The result is that _thousands_ of `WordPress` websites get hacked each time a patch is released e.g: -https://www.zdnet.com/article/thousands-of-wordpress-sites-backdoored-with-malicious-code +[zdnet.com/article/thousands-of-wordpress-sites-backdoored-with-malicious-code](https://www.zdnet.com/article/thousands-of-wordpress-sites-backdoored-with-malicious-code) and it creates a maintenance headache for the person/people _responsible_ for the site. -We're not saying you (_or anyone else_) should not use WordPress, +We're not saying you (_or anyone else_) should not use `WordPress`, just make sure you follow the the latest "best practice" if you do. (_We have been "burned" by it through no fault of our own... and would not touch it again with a barge pole! There are **much** more **secure** and **performant** options!_) -### What About NoSQL Databases/Datastores Like ElasticSearch and Redis? +### What About NoSQL Databases/Datastores Like `ElasticSearch` and `Redis`? @dwyl we are _huge_ fans of _special-purpose_ data storage/retrieval systems. -We have used _several_ NoSQL databases including CouchDB, ElasticSearch, -MongoDB, Neo4J and Redis. -Of these we _recommend_ ElasticSearch for full-text search -and Redis for in-momory datasets and caching. see: +We have used _several_ NoSQL databases including `CouchDB`, `ElasticSearch`, +`MongoDB`, `Neo4J` and `Redis` to name a few. +Of these we _recommend_ `ElasticSearch` for **full-text search** +and `Redis` for in-momory datasets and caching. +see: + [github.com/dwyl/learn-**elasticsearch**](https://github.com/dwyl/learn-elasticsearch) + [github.com/dwyl/learn-**redis**](https://github.com/dwyl/learn-redis) However as a "primary" datastore with a robust query language, -we feel PostgreSQL is the _clear_ winner as a "first" database. +we feel `Postgres` is the **_clear_ winner** as a "first" database. diff --git a/README.md b/README.md index 1a31c44..e036255 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,45 @@
-
-
-