From 12d0c3bf645ba24adb3a70d6dffa24223cf449f9 Mon Sep 17 00:00:00 2001 From: "Fabien \"egg\" O'Carroll" Date: Mon, 17 Apr 2023 11:12:55 +0100 Subject: [PATCH] Added post-revisions package This package will be used to contain the logic for determining when a revisions should be generated for a post. It will be used by the Post model during saving and will not handle the storage of revisions --- ghost/post-revisions/.eslintrc.js | 6 +++++ ghost/post-revisions/README.md | 21 +++++++++++++++++ ghost/post-revisions/index.js | 1 + ghost/post-revisions/lib/post-revisions.js | 0 ghost/post-revisions/package.json | 26 ++++++++++++++++++++++ ghost/post-revisions/test/.eslintrc.js | 6 +++++ ghost/post-revisions/test/hello.test.js | 8 +++++++ 7 files changed, 68 insertions(+) create mode 100644 ghost/post-revisions/.eslintrc.js create mode 100644 ghost/post-revisions/README.md create mode 100644 ghost/post-revisions/index.js create mode 100644 ghost/post-revisions/lib/post-revisions.js create mode 100644 ghost/post-revisions/package.json create mode 100644 ghost/post-revisions/test/.eslintrc.js create mode 100644 ghost/post-revisions/test/hello.test.js diff --git a/ghost/post-revisions/.eslintrc.js b/ghost/post-revisions/.eslintrc.js new file mode 100644 index 0000000000..c9c1bcb522 --- /dev/null +++ b/ghost/post-revisions/.eslintrc.js @@ -0,0 +1,6 @@ +module.exports = { + plugins: ['ghost'], + extends: [ + 'plugin:ghost/node' + ] +}; diff --git a/ghost/post-revisions/README.md b/ghost/post-revisions/README.md new file mode 100644 index 0000000000..9aa4390c96 --- /dev/null +++ b/ghost/post-revisions/README.md @@ -0,0 +1,21 @@ +# Post Revisions + + +## 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/post-revisions/index.js b/ghost/post-revisions/index.js new file mode 100644 index 0000000000..9f813a0b62 --- /dev/null +++ b/ghost/post-revisions/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/post-revisions'); diff --git a/ghost/post-revisions/lib/post-revisions.js b/ghost/post-revisions/lib/post-revisions.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ghost/post-revisions/package.json b/ghost/post-revisions/package.json new file mode 100644 index 0000000000..0906d9d763 --- /dev/null +++ b/ghost/post-revisions/package.json @@ -0,0 +1,26 @@ +{ + "name": "@tryghost/post-revisions", + "version": "0.0.0", + "repository": "https://github.com/TryGhost/Ghost/tree/main/packages/post-revisions", + "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.13.0", + "mocha": "10.2.0", + "sinon": "15.0.3" + }, + "dependencies": {} +} diff --git a/ghost/post-revisions/test/.eslintrc.js b/ghost/post-revisions/test/.eslintrc.js new file mode 100644 index 0000000000..829b601eb0 --- /dev/null +++ b/ghost/post-revisions/test/.eslintrc.js @@ -0,0 +1,6 @@ +module.exports = { + plugins: ['ghost'], + extends: [ + 'plugin:ghost/test' + ] +}; diff --git a/ghost/post-revisions/test/hello.test.js b/ghost/post-revisions/test/hello.test.js new file mode 100644 index 0000000000..3224ab57bf --- /dev/null +++ b/ghost/post-revisions/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')); + }); +});