Added new package with known referrers list

refs TryGhost/Team#1923

- leverages well organized list from Plausible to create known referrers list package for grouping incoming referrers - 5d4918b66b/priv/ref_inspector/referers.yml
- original list has been modified from yaml to json
This commit is contained in:
Rishabh 2022-09-19 20:22:00 +05:30 committed by Rishabh Garg
parent 017bbd89c3
commit 4ebe94f721
9 changed files with 9484 additions and 0 deletions

View File

@ -0,0 +1,6 @@
module.exports = {
plugins: ['ghost'],
extends: [
'plugin:ghost/node'
]
};

19
ghost/referrers/README.md Normal file
View File

@ -0,0 +1,19 @@
# Referrers
A list of known domains/urls along with details about their Source and Medium, originally from [Plausible](https://github.com/plausible/analytics/blob/5d4918b66b862562cb42e3d7c3af86674a40bdf3/priv/ref_inspector/referers.yml).
## 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

View File

@ -0,0 +1,25 @@
{
"name": "@tryghost/referrers",
"version": "0.0.0",
"repository": "https://github.com/TryGhost/Ghost/tree/main/packages/referrers",
"author": "Ghost Foundation",
"private": true,
"main": "referrers.json",
"scripts": {
"dev": "echo \"Implement me!\"",
"test:unit": "NODE_ENV=testing c8 --all --check-coverage --reporter text --reporter cobertura mocha './test/**/*.test.js'",
"test": "yarn test:unit",
"lint": "yarn lint:test",
"lint:test": "eslint -c test/.eslintrc.js test/ --ext .js --cache"
},
"files": [
"referrer.json"
],
"devDependencies": {
"c8": "7.12.0",
"mocha": "10.0.0",
"should": "13.2.3",
"sinon": "14.0.0"
},
"dependencies": {}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,6 @@
module.exports = {
plugins: ['ghost'],
extends: [
'plugin:ghost/test'
]
};

View File

@ -0,0 +1,10 @@
// Switch these lines once there are useful utils
// const testUtils = require('./utils');
require('./utils');
describe('Hello world', function () {
it('Runs a test', function () {
// TODO: Write me!
'hello'.should.eql('hello');
});
});

View File

@ -0,0 +1,11 @@
/**
* Custom Should Assertions
*
* Add any custom assertions to this file.
*/
// Example Assertion
// should.Assertion.add('ExampleAssertion', function () {
// this.params = {operator: 'to be a valid Example Assertion'};
// this.obj.should.be.an.Object;
// });

View File

@ -0,0 +1,11 @@
/**
* Test Utilities
*
* Shared utils for writing tests
*/
// Require overrides - these add globals for tests
require('./overrides');
// Require assertions - adds custom should assertions
require('./assertions');

View File

@ -0,0 +1,10 @@
// This file is required before any test is run
// Taken from the should wiki, this is how to make should global
// Should is a global in our eslint test config
global.should = require('should').noConflict();
should.extend();
// Sinon is a simple case
// Sinon is a global in our eslint test config
global.sinon = require('sinon');