Skip to content

Commit 853672d

Browse files
committed
✨ Initial commit
0 parents  commit 853672d

16 files changed

+4848
-0
lines changed

.editorconfig

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 4
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.hbs]
14+
insert_final_newline = false
15+
16+
[*.json]
17+
indent_size = 2
18+
19+
[*.md]
20+
trim_trailing_whitespace = false
21+
22+
[*.{yml,yaml}]
23+
indent_size = 2
24+
25+
[Makefile]
26+
indent_style = tab

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/packages/*

.eslintrc.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
plugins: ['ghost'],
3+
extends: [
4+
'plugin:ghost/node',
5+
]
6+
};

.gitignore

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Node template
2+
3+
# Logs
4+
logs
5+
*.log
6+
npm-debug.log*
7+
yarn-debug.log*
8+
yarn-error.log*
9+
10+
# Runtime data
11+
pids
12+
*.pid
13+
*.seed
14+
*.pid.lock
15+
16+
# Directory for instrumented libs generated by jscoverage/JSCover
17+
lib-cov
18+
19+
# Coverage directory used by tools like istanbul
20+
coverage
21+
22+
# nyc test coverage
23+
.nyc_output
24+
25+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
26+
.grunt
27+
28+
# Bower dependency directory (https://bower.io/)
29+
bower_components
30+
31+
# node-waf configuration
32+
.lock-wscript
33+
34+
# Compiled binary addons (https://nodejs.org/api/addons.html)
35+
build/Release
36+
37+
# Dependency directories
38+
node_modules/
39+
jspm_packages/
40+
41+
# Typescript v1 declaration files
42+
typings/
43+
44+
# Optional npm cache directory
45+
.npm
46+
47+
# Optional eslint cache
48+
.eslintcache
49+
50+
# Optional REPL history
51+
.node_repl_history
52+
53+
# Output of 'npm pack'
54+
*.tgz
55+
56+
# Yarn Integrity file
57+
.yarn-integrity
58+
59+
# dotenv environment variables file
60+
.env
61+
62+
# IDE
63+
.idea/*
64+
*.iml
65+
*.sublime-*
66+
67+
# OSX
68+
.DS_Store
69+
70+
# Ghost SD Ks Custom

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Ghost Foundation
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Ghost SDKs
2+
3+
A collection of tools for interacting with Ghost's APIs.
4+
5+
## Develop
6+
7+
This is a mono repository, managed with [lerna](https://lernajs.io/).
8+
9+
1. `git clone` this repo & `cd` into it as usual
10+
2. `yarn setup` is mapped to `lerna bootstrap`
11+
- installs all external dependencies
12+
- links all internal dependencies
13+
14+
To add a new package to the repo:
15+
- install [slimer](https://github.com/TryGhost/slimer)
16+
- run `slimer new <package name>`
17+
18+
## Run
19+
20+
- `yarn dev`
21+
22+
## Test
23+
24+
- `yarn lint` run just eslint
25+
- `yarn test` run lint and tests
26+
27+
28+
## Publish
29+
30+
- `yarn ship` is an alias for `lerna publish`
31+
- Publishes all packages which have changed
32+
- Also updates any packages which depend on changed packages
33+
34+
# Copyright & License
35+
36+
Copyright (c) 2018 Ghost Foundation - Released under the [MIT license](LICENSE).

index.js

Whitespace-only changes.

lerna.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"version": "independent",
3+
"npmClient": "yarn",
4+
"packages": ["packages/*"],
5+
"useWorkspaces": true,
6+
"command": {
7+
"publish": {
8+
"allowBranch": "master",
9+
"message": "Published new versions"
10+
}
11+
},
12+
"local": {
13+
"public": "true",
14+
"repo": "https://github.com/TryGhost/Ghost-SDKs",
15+
"scope": "@tryghost"
16+
}
17+
}

package.json

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"private": true,
3+
"repository": "https://github.com/TryGhost/Ghost-SDKs",
4+
"author": "Ghost Foundation",
5+
"license": "MIT",
6+
"workspaces": [
7+
"packages/*"
8+
],
9+
"eslintIgnore": [
10+
"**/node_modules/**"
11+
],
12+
"scripts": {
13+
"dev": "echo \"Implement me!\"",
14+
"presetup": "yarn",
15+
"setup": "lerna bootstrap",
16+
"test:parent": "NODE_ENV=testing mocha ./test/**/*.test.js",
17+
"test": "yarn test:parent && lerna run test",
18+
"lint": "eslint . --ext .js --cache",
19+
"posttest": "yarn lint",
20+
"preship": "yarn test",
21+
"ship": "STATUS=$(git status --porcelain); echo $STATUS; if [ -z \"$STATUS\" ]; then lerna publish; fi"
22+
},
23+
"devDependencies": {
24+
"eslint": "5.6.1",
25+
"eslint-plugin-ghost": "0.0.27",
26+
"lerna": "3.4.0",
27+
"mocha": "5.2.0",
28+
"should": "13.2.3",
29+
"sinon": "6.3.5"
30+
}
31+
}

packages/.gitkeep

Whitespace-only changes.

test/.eslintrc.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
plugins: ['ghost'],
3+
extends: [
4+
'plugin:ghost/test',
5+
]
6+
};

test/hello.test.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Switch these lines once there are useful utils
2+
// const testUtils = require('./utils');
3+
require('./utils');
4+
5+
describe('Hello world', function () {
6+
it('Runs a test', function () {
7+
// TODO: Write me!
8+
'hello'.should.eql('hello');
9+
});
10+
});

test/utils/assertions.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Custom Should Assertions
3+
*
4+
* Add any custom assertions to this file.
5+
*/
6+
7+
// Example Assertion
8+
// should.Assertion.add('ExampleAssertion', function () {
9+
// this.params = {operator: 'to be a valid Example Assertion'};
10+
// this.obj.should.be.an.Object;
11+
// });

test/utils/index.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Test Utilities
3+
*
4+
* Shared utils for writing tests
5+
*/
6+
7+
// Require overrides - these add globals for tests
8+
require('./overrides');
9+
10+
// Require assertions - adds custom should assertions
11+
require('./assertions');

test/utils/overrides.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// This file is required before any test is run
2+
3+
// Taken from the should wiki, this is how to make should global
4+
// Should is a global in our eslint test config
5+
global.should = require('should').noConflict();
6+
should.extend();
7+
8+
// Sinon is a simple case
9+
// Sinon is a global in our eslint test config
10+
global.sinon = require('sinon');

0 commit comments

Comments
 (0)