From 38dc003258c35b2a6f760bb29e720514cf3840ce Mon Sep 17 00:00:00 2001 From: Naz Date: Fri, 22 Apr 2022 13:45:27 +0800 Subject: [PATCH] Added scaffolding for version notification data service refs https://github.com/TryGhost/Toolbox/issues/292 - This will be filled up with version nofitication data access logic --- .../.eslintrc.js | 6 +++ .../LICENSE | 21 ++++++++++ .../README.md | 41 +++++++++++++++++++ .../index.js | 1 + .../lib/version-notifications-data-service.js | 0 .../package.json | 30 ++++++++++++++ .../test/.eslintrc.js | 6 +++ .../test/hello.test.js | 8 ++++ 8 files changed, 113 insertions(+) create mode 100644 ghost/version-notifications-data-service/.eslintrc.js create mode 100644 ghost/version-notifications-data-service/LICENSE create mode 100644 ghost/version-notifications-data-service/README.md create mode 100644 ghost/version-notifications-data-service/index.js create mode 100644 ghost/version-notifications-data-service/lib/version-notifications-data-service.js create mode 100644 ghost/version-notifications-data-service/package.json create mode 100644 ghost/version-notifications-data-service/test/.eslintrc.js create mode 100644 ghost/version-notifications-data-service/test/hello.test.js diff --git a/ghost/version-notifications-data-service/.eslintrc.js b/ghost/version-notifications-data-service/.eslintrc.js new file mode 100644 index 0000000000..c9c1bcb522 --- /dev/null +++ b/ghost/version-notifications-data-service/.eslintrc.js @@ -0,0 +1,6 @@ +module.exports = { + plugins: ['ghost'], + extends: [ + 'plugin:ghost/node' + ] +}; diff --git a/ghost/version-notifications-data-service/LICENSE b/ghost/version-notifications-data-service/LICENSE new file mode 100644 index 0000000000..19bcb01bef --- /dev/null +++ b/ghost/version-notifications-data-service/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013-2022 Ghost Foundation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/ghost/version-notifications-data-service/README.md b/ghost/version-notifications-data-service/README.md new file mode 100644 index 0000000000..4820b32ce3 --- /dev/null +++ b/ghost/version-notifications-data-service/README.md @@ -0,0 +1,41 @@ +# Version Notifications Data Service + +Package-service managing data fot the version notification service + +## Install + +`npm install @tryghost/version-notifications-data-service --save` + +or + +`yarn add @tryghost/version-notifications-data-service` + + +## Usage + + +## Develop + +This is a mono repository, managed with [lerna](https://lernajs.io/). + +Follow the instructions for the top-level repo. +1. `git clone` this repo & `cd` into it as usual +2. Run `yarn` to install top-level dependencies. + + +## Run + +- `yarn dev` + + +## Test + +- `yarn lint` run just eslint +- `yarn test` run lint and tests + + + + +# Copyright & License + +Copyright (c) 2013-2022 Ghost Foundation - Released under the [MIT license](LICENSE). \ No newline at end of file diff --git a/ghost/version-notifications-data-service/index.js b/ghost/version-notifications-data-service/index.js new file mode 100644 index 0000000000..ad6f948f3f --- /dev/null +++ b/ghost/version-notifications-data-service/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/version-notifications-data-service'); diff --git a/ghost/version-notifications-data-service/lib/version-notifications-data-service.js b/ghost/version-notifications-data-service/lib/version-notifications-data-service.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ghost/version-notifications-data-service/package.json b/ghost/version-notifications-data-service/package.json new file mode 100644 index 0000000000..7971cb7527 --- /dev/null +++ b/ghost/version-notifications-data-service/package.json @@ -0,0 +1,30 @@ +{ + "name": "@tryghost/version-notifications-data-service", + "version": "0.0.0", + "repository": "https://github.com/TryGhost/Utils/tree/main/packages/version-notifications-data-service", + "author": "Ghost Foundation", + "license": "MIT", + "main": "index.js", + "scripts": { + "dev": "echo \"Implement me!\"", + "test": "NODE_ENV=testing c8 --all --check-coverage --reporter text --reporter cobertura mocha './test/**/*.test.js'", + "lint:code": "eslint *.js lib/ --ext .js --cache", + "lint": "yarn lint:code && yarn lint:test", + "lint:test": "eslint -c test/.eslintrc.js test/ --ext .js --cache", + "posttest": "yarn lint" + }, + "files": [ + "index.js", + "lib" + ], + "publishConfig": { + "access": "public" + }, + "devDependencies": { + "c8": "7.11.2", + "mocha": "9.2.2", + "should": "13.2.3", + "sinon": "13.0.2" + }, + "dependencies": {} +} diff --git a/ghost/version-notifications-data-service/test/.eslintrc.js b/ghost/version-notifications-data-service/test/.eslintrc.js new file mode 100644 index 0000000000..829b601eb0 --- /dev/null +++ b/ghost/version-notifications-data-service/test/.eslintrc.js @@ -0,0 +1,6 @@ +module.exports = { + plugins: ['ghost'], + extends: [ + 'plugin:ghost/test' + ] +}; diff --git a/ghost/version-notifications-data-service/test/hello.test.js b/ghost/version-notifications-data-service/test/hello.test.js new file mode 100644 index 0000000000..a480edd0bd --- /dev/null +++ b/ghost/version-notifications-data-service/test/hello.test.js @@ -0,0 +1,8 @@ +const assert = require('assert'); + +describe('Version Notification Data Service', function () { + it('Runs a test', function () { + // TODO: Write me! + assert.equal('hello', 'hello'); + }); +});