Skip to content
This repository was archived by the owner on May 8, 2020. It is now read-only.

Commit 8e75ea9

Browse files
committed
Merge master
2 parents 841bcbf + da4b9ad commit 8e75ea9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+4698
-2613
lines changed

.lintstagedrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"concurrent": true,
3+
"linters": {
4+
"*.ts": [
5+
"prettier --parser typescript --write",
6+
"git add"
7+
]
8+
}
9+
}

.nycrc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
{
22
"include": [
3-
"src/**/*.js"
3+
"src/**/*.ts"
44
],
55
"exclude": [
66
"**/index.ts",
77
"**/index.js",
88
"**/interfaces/*.js"
99
],
1010
"reporter": [
11-
"lcov",
12-
"text-summary"
11+
"text-summary",
12+
"html",
13+
"lcov"
1314
],
1415
"extension": [
1516
".ts"
@@ -20,4 +21,4 @@
2021
"functions": 99,
2122
"branches": 89,
2223
"all": true
23-
}
24+
}

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dist
2+
docs
3+
node_modules
4+
*-lock.json
5+
*.lock

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"printWidth": 140,
3+
"bracketSpacing": false
4+
}

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ notifications:
55

66
node_js:
77
- 'node'
8+
- '10'
9+
- '9'
810
- '8'
9-
- '7'
10-
- '6'
1111

1212
after_success:
1313
- npm run coveralls:travis
@@ -17,4 +17,4 @@ branches:
1717
except:
1818
- /^v\d+\.\d+\.\d+$/
1919

20-
sudo: false
20+
sudo: false

docs/_build/build-api.js

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,35 @@
11
/**
22
* Created by romain.lenzotti on 21/07/2017.
33
*/
4-
'use strict'
5-
const { writeSymbol, writeIndex } = require('./write')
6-
const template = require('./template')
7-
const scan = require('./scan')
8-
const writeVersion = require('./write-version')
9-
const path = require('path')
10-
11-
const { $log } = require('ts-log-debug')
12-
13-
$log.name = 'DOC'
4+
"use strict";
5+
const {writeSymbol, writeIndex} = require("./write");
6+
const template = require("./template");
7+
const scan = require("./scan");
8+
const writeVersion = require("./write-version");
9+
const path = require("path");
1410

1511
const options = {
16-
file: path.resolve(__dirname + '/../api/index.md'),
17-
pattern: __dirname + '/../../lib/**/*.ts'
18-
}
12+
file: path.resolve(__dirname + "/../api/index.md"),
13+
pattern: __dirname + "/../../lib/**/*.ts"
14+
};
1915

2016
Promise.resolve()
21-
.then(() => writeVersion(path.resolve(__dirname + '/../_coverpage.md')))
17+
.then(() => writeVersion(path.resolve(__dirname + "/../_coverpage.md")))
2218
.then(() => scan(options.pattern))
2319
.then(docComponents => {
2420
docComponents.forEach(docComponents => {
25-
if (docComponents) {
26-
docComponents.symbols.forEach((symbol) => {
27-
try {
28-
writeSymbol(Object.assign(symbol, { output: template(symbol) }))
29-
} catch (er) {
30-
console.error('Error when writting this symbol', symbol)
31-
throw er
32-
}
33-
})
34-
}
35-
})
21+
docComponents.symbols.forEach((symbol) => {
22+
try {
23+
writeSymbol(Object.assign(symbol, {output: template(symbol)}));
24+
} catch (er) {
25+
console.error("Error when writting this symbol", symbol);
26+
throw er;
27+
}
28+
});
29+
});
3630
})
3731
.then(() => {
38-
writeIndex()
32+
writeIndex();
3933
})
40-
.then(() => $log.info('done'))
41-
.catch(err => console.error(err))
34+
.then(() => console.info("done"))
35+
.catch(err => console.error(err));

docs/_build/info.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ module.exports = {
99
host: `${github}/blob/v${version}/src/`,
1010
modules: {
1111
"core": "common/core",
12-
"clientErrors": "common/clientErrors",
13-
"redirections": "common/redirections",
14-
"serverErrors": "common/serverErrors"
12+
"appenders": "common/appenders",
13+
"layouts": "common/layouts",
14+
"logger": "common/logger"
1515
},
1616
symbolTypes: require("./types"),
1717
symbols: new Map(),

docs/_build/models/component.js

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,43 @@
1-
const info = require('../info')
2-
const path = require('path')
3-
const fs = require('fs')
4-
const { $log } = require('ts-log-debug')
5-
const { name } = require('../../../package.json')
1+
const info = require("../info");
2+
const path = require("path");
3+
const fs = require("fs");
4+
const {name} = require("../../../package.json");
65

76
class DocComponent {
87
/**
98
*
109
* @param file
1110
*/
1211
constructor(file) {
13-
this.file = file
14-
this.path = (file || '').replace(path.join(info.root, 'lib/'), '').replace('.d.ts', '.ts')
15-
this.srcPath = path.resolve(path.join(info.root, 'src', this.path))
12+
this.file = file;
13+
this.path = (file || "").replace(path.join(info.root, "lib/"), "").replace(".d.ts", ".ts");
14+
this.srcPath = path.resolve(path.join(info.root, "src", this.path));
1615

17-
this.symbol = path.basename(file).replace('.d.ts', '')
18-
this.module = this.getModule()
19-
this.symbols = new Map()
16+
this.symbol = path.basename(file).replace(".d.ts", "");
17+
this.module = this.getModule();
18+
this.symbols = new Map();
2019

21-
this.originalContents = fs.readFileSync(this.srcPath).toString()
22-
this.contents = fs.readFileSync(file).toString()
20+
this.originalContents = fs.readFileSync(this.srcPath).toString();
21+
this.contents = fs.readFileSync(file).toString();
2322

2423
// $log.debug("DocComponent created from", this.file);
2524
}
2625

2726
getModule() {
28-
const index = this.path.split('/')[0]
29-
const docPath = info.modules[index] || 'common'
30-
const isCommon = docPath.indexOf('common/') > -1
31-
const packageName = isCommon ? name : (name + '/' + index)
27+
const index = this.path.split("/")[0];
28+
const docPath = info.modules[index] || "common";
29+
const isCommon = docPath.indexOf("common/") > -1;
30+
const packageName = isCommon ? name : (name + "/" + index);
3231
const srcPath = path.resolve(
33-
isCommon ? path.join(info.root, 'src') : path.join(info.root, 'src', index)
34-
)
32+
isCommon ? path.join(info.root, "src") : path.join(info.root, "src", index)
33+
);
3534
return {
3635
docPath,
3736
name: packageName,
3837
srcPath,
3938
isCommon
40-
}
39+
};
4140
}
4241
}
4342

44-
module.exports.DocComponent = DocComponent
43+
module.exports.DocComponent = DocComponent;

0 commit comments

Comments
 (0)