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:
parent
017bbd89c3
commit
4ebe94f721
6
ghost/referrers/.eslintrc.js
Normal file
6
ghost/referrers/.eslintrc.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
module.exports = {
|
||||||
|
plugins: ['ghost'],
|
||||||
|
extends: [
|
||||||
|
'plugin:ghost/node'
|
||||||
|
]
|
||||||
|
};
|
19
ghost/referrers/README.md
Normal file
19
ghost/referrers/README.md
Normal 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
|
25
ghost/referrers/package.json
Normal file
25
ghost/referrers/package.json
Normal 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": {}
|
||||||
|
}
|
9386
ghost/referrers/referrers.json
Normal file
9386
ghost/referrers/referrers.json
Normal file
File diff suppressed because it is too large
Load Diff
6
ghost/referrers/test/.eslintrc.js
Normal file
6
ghost/referrers/test/.eslintrc.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
module.exports = {
|
||||||
|
plugins: ['ghost'],
|
||||||
|
extends: [
|
||||||
|
'plugin:ghost/test'
|
||||||
|
]
|
||||||
|
};
|
10
ghost/referrers/test/hello.test.js
Normal file
10
ghost/referrers/test/hello.test.js
Normal 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');
|
||||||
|
});
|
||||||
|
});
|
11
ghost/referrers/test/utils/assertions.js
Normal file
11
ghost/referrers/test/utils/assertions.js
Normal 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;
|
||||||
|
// });
|
11
ghost/referrers/test/utils/index.js
Normal file
11
ghost/referrers/test/utils/index.js
Normal 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');
|
10
ghost/referrers/test/utils/overrides.js
Normal file
10
ghost/referrers/test/utils/overrides.js
Normal 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');
|
Loading…
Reference in New Issue
Block a user