From e55405691a1f2efb102349b3d00f3c9b660e5ab5 Mon Sep 17 00:00:00 2001 From: Ronald Langeveld Date: Tue, 17 Jan 2023 13:18:16 +0800 Subject: [PATCH] Added webmentions package (#16133) refs https://github.com/TryGhost/Team/issues/2408 - Added webmentions package - Setup basic folder structure, controllers, repositories & services to get started. - note package haven't been published yet --- ghost/webmentions/.eslintrc.js | 6 ++++++ ghost/webmentions/README.md | 21 +++++++++++++++++++++ ghost/webmentions/index.js | 1 + ghost/webmentions/lib/webmentions.js | 1 + ghost/webmentions/package.json | 26 ++++++++++++++++++++++++++ ghost/webmentions/test/.eslintrc.js | 6 ++++++ ghost/webmentions/test/hello.test.js | 8 ++++++++ 7 files changed, 69 insertions(+) create mode 100644 ghost/webmentions/.eslintrc.js create mode 100644 ghost/webmentions/README.md create mode 100644 ghost/webmentions/index.js create mode 100644 ghost/webmentions/lib/webmentions.js create mode 100644 ghost/webmentions/package.json create mode 100644 ghost/webmentions/test/.eslintrc.js create mode 100644 ghost/webmentions/test/hello.test.js diff --git a/ghost/webmentions/.eslintrc.js b/ghost/webmentions/.eslintrc.js new file mode 100644 index 0000000000..c9c1bcb522 --- /dev/null +++ b/ghost/webmentions/.eslintrc.js @@ -0,0 +1,6 @@ +module.exports = { + plugins: ['ghost'], + extends: [ + 'plugin:ghost/node' + ] +}; diff --git a/ghost/webmentions/README.md b/ghost/webmentions/README.md new file mode 100644 index 0000000000..bf7773d00b --- /dev/null +++ b/ghost/webmentions/README.md @@ -0,0 +1,21 @@ +# Webmentions + + +## Usage + + +## Develop + +This is a monorepo package. + +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. + + + +## Test + +- `yarn lint` run just eslint +- `yarn test` run lint and tests + diff --git a/ghost/webmentions/index.js b/ghost/webmentions/index.js new file mode 100644 index 0000000000..0abeb635fa --- /dev/null +++ b/ghost/webmentions/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/webmentions'); diff --git a/ghost/webmentions/lib/webmentions.js b/ghost/webmentions/lib/webmentions.js new file mode 100644 index 0000000000..10351222af --- /dev/null +++ b/ghost/webmentions/lib/webmentions.js @@ -0,0 +1 @@ +// webmentions.js \ No newline at end of file diff --git a/ghost/webmentions/package.json b/ghost/webmentions/package.json new file mode 100644 index 0000000000..15ca9b0366 --- /dev/null +++ b/ghost/webmentions/package.json @@ -0,0 +1,26 @@ +{ + "name": "@tryghost/webmentions", + "version": "0.0.0", + "repository": "https://github.com/TryGhost/Ghost/tree/main/packages/webmentions", + "author": "Ghost Foundation", + "private": true, + "main": "index.js", + "scripts": { + "dev": "echo \"Implement me!\"", + "test:unit": "NODE_ENV=testing c8 --all --check-coverage --100 --reporter text --reporter cobertura mocha './test/**/*.test.js'", + "test": "yarn test:unit", + "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" + }, + "files": [ + "index.js", + "lib" + ], + "devDependencies": { + "c8": "7.12.0", + "mocha": "10.2.0", + "sinon": "15.0.1" + }, + "dependencies": {} +} diff --git a/ghost/webmentions/test/.eslintrc.js b/ghost/webmentions/test/.eslintrc.js new file mode 100644 index 0000000000..829b601eb0 --- /dev/null +++ b/ghost/webmentions/test/.eslintrc.js @@ -0,0 +1,6 @@ +module.exports = { + plugins: ['ghost'], + extends: [ + 'plugin:ghost/test' + ] +}; diff --git a/ghost/webmentions/test/hello.test.js b/ghost/webmentions/test/hello.test.js new file mode 100644 index 0000000000..3224ab57bf --- /dev/null +++ b/ghost/webmentions/test/hello.test.js @@ -0,0 +1,8 @@ +const assert = require('assert'); + +describe('Hello world', function () { + it('Runs a test', function () { + // TODO: Write me! + assert.ok(require('../index')); + }); +});